mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 11:38:26 +01:00
Add files
This commit is contained in:
parent
43f7cbc4a5
commit
598bd56323
7
src/main/java/net/citizensnpcs/npc/ai/NPCHolder.java
Normal file
7
src/main/java/net/citizensnpcs/npc/ai/NPCHolder.java
Normal file
@ -0,0 +1,7 @@
|
||||
package net.citizensnpcs.npc.ai;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
|
||||
public interface NPCHolder {
|
||||
public NPC getNPC();
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package net.citizensnpcs.npc.network;
|
||||
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.NetServerHandler;
|
||||
import net.minecraft.server.NetworkManager;
|
||||
import net.minecraft.server.Packet;
|
||||
import net.minecraft.server.Packet102WindowClick;
|
||||
import net.minecraft.server.Packet106Transaction;
|
||||
import net.minecraft.server.Packet10Flying;
|
||||
import net.minecraft.server.Packet130UpdateSign;
|
||||
import net.minecraft.server.Packet14BlockDig;
|
||||
import net.minecraft.server.Packet15Place;
|
||||
import net.minecraft.server.Packet16BlockItemSwitch;
|
||||
import net.minecraft.server.Packet255KickDisconnect;
|
||||
import net.minecraft.server.Packet28EntityVelocity;
|
||||
import net.minecraft.server.Packet3Chat;
|
||||
import net.minecraft.server.Packet51MapChunk;
|
||||
|
||||
public class EmptyNetHandler extends NetServerHandler {
|
||||
public EmptyNetHandler(MinecraftServer minecraftServer, NetworkManager networkManager, EntityPlayer entityPlayer) {
|
||||
super(minecraftServer, networkManager, entityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet102WindowClick packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet106Transaction packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet10Flying packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet130UpdateSign packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet14BlockDig packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet15Place packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet16BlockItemSwitch packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet255KickDisconnect packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet28EntityVelocity packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet3Chat packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(Packet51MapChunk packet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(String string, Object[] objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(String string) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket(Packet packet) {
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package net.citizensnpcs.npc.network;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.Socket;
|
||||
|
||||
import net.minecraft.server.NetHandler;
|
||||
import net.minecraft.server.NetworkManager;
|
||||
import net.minecraft.server.Packet;
|
||||
|
||||
public class EmptyNetworkManager extends NetworkManager {
|
||||
|
||||
public EmptyNetworkManager(Socket socket, String string, NetHandler netHandler) {
|
||||
super(socket, string, netHandler);
|
||||
|
||||
try {
|
||||
// the field above the 3 synchronized lists
|
||||
Field f = NetworkManager.class.getDeclaredField("l");
|
||||
f.setAccessible(true);
|
||||
f.set(this, false);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(NetHandler netHandler) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(String s, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void b() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void d() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int e() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queue(Packet packet) {
|
||||
}
|
||||
}
|
20
src/main/java/net/citizensnpcs/npc/network/EmptySocket.java
Normal file
20
src/main/java/net/citizensnpcs/npc/network/EmptySocket.java
Normal file
@ -0,0 +1,20 @@
|
||||
package net.citizensnpcs.npc.network;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
public class EmptySocket extends Socket {
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() {
|
||||
return new ByteArrayInputStream(new byte[10]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutputStream getOutputStream() {
|
||||
return new ByteArrayOutputStream();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user