mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 06:53:24 +00:00
Update buildscript & spotlessApply (#78)
* Update buildscript & spotlessApply * Add mapping version
This commit is contained in:
1 parent
f272840987
commit
cf41b89ae4
851 files changed
+95348
-92599
No files matched your search
@@ -1,54 +1,51 @@
|
||||
package crazypants.enderio.machine.spawner;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PacketMode implements IMessage, IMessageHandler<PacketMode, IMessage> {
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
|
||||
private boolean isSpawnMode;
|
||||
private boolean isSpawnMode;
|
||||
|
||||
public PacketMode() {
|
||||
public PacketMode() {}
|
||||
|
||||
}
|
||||
|
||||
public PacketMode(TilePoweredSpawner tile) {
|
||||
x = tile.xCoord;
|
||||
y = tile.yCoord;
|
||||
z = tile.zCoord;
|
||||
isSpawnMode = tile.isSpawnMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeBoolean(isSpawnMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
isSpawnMode = buf.readBoolean();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketMode message, MessageContext ctx) {
|
||||
TileEntity te = ctx.getServerHandler().playerEntity.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if(te instanceof TilePoweredSpawner) {
|
||||
TilePoweredSpawner me = (TilePoweredSpawner) te;
|
||||
me.setSpawnMode(message.isSpawnMode);
|
||||
public PacketMode(TilePoweredSpawner tile) {
|
||||
x = tile.xCoord;
|
||||
y = tile.yCoord;
|
||||
z = tile.zCoord;
|
||||
isSpawnMode = tile.isSpawnMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeBoolean(isSpawnMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
isSpawnMode = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketMode message, MessageContext ctx) {
|
||||
TileEntity te = ctx.getServerHandler().playerEntity.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (te instanceof TilePoweredSpawner) {
|
||||
TilePoweredSpawner me = (TilePoweredSpawner) te;
|
||||
me.setSpawnMode(message.isSpawnMode);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user