mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-22 05:02:25 +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,46 +1,43 @@
|
||||
package crazypants.enderio.machine;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import com.enderio.core.api.common.util.IProgressTile;
|
||||
import com.enderio.core.common.network.MessageTileEntity;
|
||||
|
||||
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 crazypants.enderio.EnderIO;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PacketProgress extends MessageTileEntity<TileEntity> implements IMessageHandler<PacketProgress, IMessage> {
|
||||
public class PacketProgress extends MessageTileEntity<TileEntity> implements IMessageHandler<PacketProgress, IMessage> {
|
||||
|
||||
private float progress;
|
||||
private float progress;
|
||||
|
||||
public PacketProgress() {
|
||||
}
|
||||
public PacketProgress() {}
|
||||
|
||||
public PacketProgress(IProgressTile tile) {
|
||||
super(tile.getTileEntity());
|
||||
progress = tile.getProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeFloat(progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
progress = buf.readFloat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketProgress message, MessageContext ctx) {
|
||||
TileEntity tile = message.getTileEntity(EnderIO.proxy.getClientWorld());
|
||||
if(tile instanceof IProgressTile) {
|
||||
((IProgressTile) tile).setProgress(message.progress);
|
||||
public PacketProgress(IProgressTile tile) {
|
||||
super(tile.getTileEntity());
|
||||
progress = tile.getProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeFloat(progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
progress = buf.readFloat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketProgress message, MessageContext ctx) {
|
||||
TileEntity tile = message.getTileEntity(EnderIO.proxy.getClientWorld());
|
||||
if (tile instanceof IProgressTile) {
|
||||
((IProgressTile) tile).setProgress(message.progress);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user