mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-17 11:15:07 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
a314fccd1b
commit
8f026dad8f
161 files changed
+14073
-12846
No files matched your search
@@ -1,64 +1,65 @@
|
||||
package team.chisel.network.message;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import team.chisel.network.message.base.MessageCoords;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
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;
|
||||
|
||||
public class MessageAutoChisel extends MessageCoords {
|
||||
|
||||
public MessageAutoChisel() {
|
||||
}
|
||||
public MessageAutoChisel() {}
|
||||
|
||||
ItemStack base;
|
||||
boolean playSound, breakChisel;
|
||||
int chiseled;
|
||||
ItemStack base;
|
||||
boolean playSound, breakChisel;
|
||||
int chiseled;
|
||||
|
||||
public MessageAutoChisel(TileEntityAutoChisel tile, int chiseled, boolean playSound, boolean breakChisel) {
|
||||
super(tile);
|
||||
this.base = tile.getStackInSlot(TileEntityAutoChisel.BASE);
|
||||
if (base != null) {
|
||||
base = base.copy();
|
||||
}
|
||||
this.playSound = playSound;
|
||||
this.breakChisel = breakChisel;
|
||||
this.chiseled = chiseled;
|
||||
}
|
||||
public MessageAutoChisel(TileEntityAutoChisel tile, int chiseled, boolean playSound, boolean breakChisel) {
|
||||
super(tile);
|
||||
this.base = tile.getStackInSlot(TileEntityAutoChisel.BASE);
|
||||
if (base != null) {
|
||||
base = base.copy();
|
||||
}
|
||||
this.playSound = playSound;
|
||||
this.breakChisel = breakChisel;
|
||||
this.chiseled = chiseled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeBoolean(playSound);
|
||||
buf.writeBoolean(breakChisel);
|
||||
buf.writeInt(chiseled);
|
||||
ByteBufUtils.writeItemStack(buf, base);
|
||||
}
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeBoolean(playSound);
|
||||
buf.writeBoolean(breakChisel);
|
||||
buf.writeInt(chiseled);
|
||||
ByteBufUtils.writeItemStack(buf, base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
this.playSound = buf.readBoolean();
|
||||
this.breakChisel = buf.readBoolean();
|
||||
this.chiseled = buf.readInt();
|
||||
this.base = ByteBufUtils.readItemStack(buf);
|
||||
}
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
this.playSound = buf.readBoolean();
|
||||
this.breakChisel = buf.readBoolean();
|
||||
this.chiseled = buf.readInt();
|
||||
this.base = ByteBufUtils.readItemStack(buf);
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<MessageAutoChisel, IMessage> {
|
||||
public static class Handler implements IMessageHandler<MessageAutoChisel, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(MessageAutoChisel message, MessageContext ctx) {
|
||||
@Override
|
||||
public IMessage onMessage(MessageAutoChisel message, MessageContext ctx) {
|
||||
|
||||
TileEntity te = message.getTileEntity(ctx);
|
||||
if (te instanceof TileEntityAutoChisel) {
|
||||
((TileEntityAutoChisel) te).doChiselAnim(message.base, message.chiseled, message.playSound, message.breakChisel);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
TileEntity te = message.getTileEntity(ctx);
|
||||
if (te instanceof TileEntityAutoChisel) {
|
||||
((TileEntityAutoChisel) te)
|
||||
.doChiselAnim(message.base, message.chiseled, message.playSound, message.breakChisel);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user