Merge branch 'master' of https://github.com/Ellpeck/ActuallyAdditions
|
@ -1,4 +1,4 @@
|
|||
![](https://github.com/Ellpeck/ActuallyAdditions/blob/master/src/main/resources/assets/actuallyadditions/textures/logoBig.png)
|
||||
![](https://raw.githubusercontent.com/Ellpeck/ActuallyAdditions/master/pics/logoBig.png)
|
||||
|
||||
##It's a Minecraft Mod!
|
||||
|
||||
|
|
Before Width: | Height: | Size: 728 KiB After Width: | Height: | Size: 728 KiB |
Before Width: | Height: | Size: 905 KiB After Width: | Height: | Size: 905 KiB |
BIN
pics/items.png
Normal file
After Width: | Height: | Size: 500 KiB |
Before Width: | Height: | Size: 347 KiB After Width: | Height: | Size: 347 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -10,8 +10,8 @@
|
|||
|
||||
package ellpeck.actuallyadditions.blocks.render;
|
||||
|
||||
import ellpeck.actuallyadditions.gadget.cloud.ISmileyCloudEasterEgg;
|
||||
import ellpeck.actuallyadditions.gadget.cloud.SmileyCloudEasterEggs;
|
||||
import ellpeck.actuallyadditions.misc.cloud.ISmileyCloudEasterEgg;
|
||||
import ellpeck.actuallyadditions.misc.cloud.SmileyCloudEasterEggs;
|
||||
import ellpeck.actuallyadditions.tile.TileEntitySmileyCloud;
|
||||
import ellpeck.actuallyadditions.util.StringUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
|
|
@ -15,7 +15,10 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import ellpeck.actuallyadditions.booklet.page.BookletPage;
|
||||
import ellpeck.actuallyadditions.config.GuiConfiguration;
|
||||
import ellpeck.actuallyadditions.update.UpdateChecker;
|
||||
import ellpeck.actuallyadditions.util.*;
|
||||
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import ellpeck.actuallyadditions.util.StringUtil;
|
||||
import ellpeck.actuallyadditions.util.Util;
|
||||
import ellpeck.actuallyadditions.util.playerdata.PersistentClientData;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
@ -81,7 +84,7 @@ public class GuiBooklet extends GuiScreen{
|
|||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(resLoc);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.isGimmicky() ? 256 : this.xSize, this.isGimmicky() ? 256 : this.ySize);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if(this.currentIndexEntry instanceof BookletEntryAllSearch && this.currentChapter == null){
|
||||
this.drawTexturedModalRect(this.guiLeft+146, this.guiTop+160, 146, 80, 70, 14);
|
||||
|
@ -111,18 +114,6 @@ public class GuiBooklet extends GuiScreen{
|
|||
}
|
||||
}
|
||||
|
||||
if(this.isGimmicky()){
|
||||
this.fontRendererObj.drawSplitString("This book looks a lot like the one from Botania, doesn't it? Well, I think it does, too, and I'm kind of annoyed by it to be honest. Wasn't really meant to be that way. I guess I just kind of had the design of the Botania Book in mind when designing this. Well. I made the Code on my own, so I don't really care. Also: How did you find this gimmick? :P -Peck", this.guiLeft-80-3, this.guiTop+25, 80, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
|
||||
String strg = "Click this! I need followaz #Pathetic #DontTakeSeriously ->";
|
||||
this.fontRendererObj.drawString(strg, this.guiLeft-this.fontRendererObj.getStringWidth(strg)-3, this.guiTop, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
|
||||
if(this.currentChapter == InitBooklet.chapterIntro && this.currentPage == InitBooklet.chapterIntro.pages[1]){
|
||||
strg = "Hey Hose, I kind of hate you a bit for that Ellopecko thing. (Not really! It's fun and games and stuff! :D)";
|
||||
this.fontRendererObj.drawString(strg, this.guiLeft+this.xSize/2-this.fontRendererObj.getStringWidth(strg)/2, this.guiTop-20, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
super.drawScreen(x, y, f);
|
||||
this.searchField.drawTextBox();
|
||||
|
||||
|
@ -509,10 +500,6 @@ public class GuiBooklet extends GuiScreen{
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isGimmicky(){
|
||||
return KeyUtil.isControlPressed() && KeyUtil.isShiftPressed() && KeyUtil.isAltPressed();
|
||||
}
|
||||
|
||||
private static class IndexButton extends GuiButton{
|
||||
|
||||
public BookletChapter chap;
|
||||
|
|
|
@ -198,7 +198,7 @@ public class ItemCrafting{
|
|||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeBlockPlacing),
|
||||
"CEC", "RAR", "CEC",
|
||||
'C', "cobblestone",
|
||||
'E', Items.ender_pearl,
|
||||
'E', Items.paper,
|
||||
'A', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()),
|
||||
'R', "ingotIron"));
|
||||
recipeDrillPlacing = Util.GetRecipes.lastIRecipe();
|
||||
|
|
|
@ -20,7 +20,7 @@ public class EntityConstructingEvent{
|
|||
|
||||
@SubscribeEvent
|
||||
public void onEntityConstructing(EntityEvent.EntityConstructing event){
|
||||
if(event.entity instanceof EntityPlayer){
|
||||
if(event.entity instanceof EntityPlayer && !event.entity.worldObj.isRemote){
|
||||
if(PersistentServerData.get((EntityPlayer)event.entity) == null){
|
||||
event.entity.registerExtendedProperties(ModUtil.MOD_ID, new PersistentServerData());
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ package ellpeck.actuallyadditions.event;
|
|||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.gadget.RenderSpecial;
|
||||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.misc.RenderSpecial;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* This file ("ModelStandardBlock.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015 Ellpeck
|
||||
*/
|
||||
|
||||
package ellpeck.actuallyadditions.gadget;
|
||||
|
||||
import ellpeck.actuallyadditions.blocks.render.ModelBaseAA;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelStandardBlock extends ModelBaseAA{
|
||||
|
||||
public ModelRenderer s;
|
||||
private String name;
|
||||
|
||||
public ModelStandardBlock(String name){
|
||||
this.name = name;
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
this.s = new ModelRenderer(this, 0, 0);
|
||||
this.s.setRotationPoint(-8.0F, 8.0F, -8.0F);
|
||||
this.s.addBox(0.0F, 0.0F, 0.0F, 16, 16, 16, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(float f){
|
||||
this.s.render(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return "model"+this.name;
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* This file ("ModelTorch.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015 Ellpeck
|
||||
*/
|
||||
|
||||
package ellpeck.actuallyadditions.gadget;
|
||||
|
||||
import ellpeck.actuallyadditions.blocks.render.ModelBaseAA;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelTorch extends ModelBaseAA{
|
||||
|
||||
public ModelRenderer s;
|
||||
|
||||
public ModelTorch(){
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 32;
|
||||
this.s = new ModelRenderer(this, 0, 0);
|
||||
this.s.setRotationPoint(-1.0F, 14.0F, -1.0F);
|
||||
this.s.addBox(0.0F, 0.0F, 0.0F, 2, 10, 2, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(float f){
|
||||
this.s.render(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return "modelHose";
|
||||
}
|
||||
}
|
|
@ -27,7 +27,7 @@ import net.minecraft.world.World;
|
|||
public class ItemBooklet extends Item implements IActAddItemOrBlock{
|
||||
|
||||
public ItemBooklet(){
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxStackSize(16);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* © 2015 Ellpeck
|
||||
*/
|
||||
|
||||
package ellpeck.actuallyadditions.gadget;
|
||||
package ellpeck.actuallyadditions.misc;
|
||||
|
||||
import ellpeck.actuallyadditions.event.RenderPlayerEventAA;
|
||||
import ellpeck.actuallyadditions.util.AssetUtil;
|
|
@ -8,7 +8,7 @@
|
|||
* © 2015 Ellpeck
|
||||
*/
|
||||
|
||||
package ellpeck.actuallyadditions.gadget.cloud;
|
||||
package ellpeck.actuallyadditions.misc.cloud;
|
||||
|
||||
public interface ISmileyCloudEasterEgg{
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
* © 2015 Ellpeck
|
||||
*/
|
||||
|
||||
package ellpeck.actuallyadditions.gadget.cloud;
|
||||
package ellpeck.actuallyadditions.misc.cloud;
|
||||
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.items.InitItems;
|
|
@ -16,7 +16,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import ellpeck.actuallyadditions.network.gui.PacketGuiButton;
|
||||
import ellpeck.actuallyadditions.network.gui.PacketGuiNumber;
|
||||
import ellpeck.actuallyadditions.network.gui.PacketGuiString;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
|
||||
public class PacketHandler{
|
||||
|
@ -27,8 +26,7 @@ public class PacketHandler{
|
|||
theNetwork = NetworkRegistry.INSTANCE.newSimpleChannel(ModUtil.MOD_ID_LOWER);
|
||||
|
||||
theNetwork.registerMessage(PacketGuiButton.Handler.class, PacketGuiButton.class, 0, Side.SERVER);
|
||||
theNetwork.registerMessage(PacketSyncerToClient.Handler.class, PacketSyncerToClient.class, 1, Side.CLIENT);
|
||||
theNetwork.registerMessage(PacketGuiNumber.Handler.class, PacketGuiNumber.class, 2, Side.SERVER);
|
||||
theNetwork.registerMessage(PacketGuiString.Handler.class, PacketGuiString.class, 3, Side.SERVER);
|
||||
theNetwork.registerMessage(PacketGuiNumber.Handler.class, PacketGuiNumber.class, 1, Side.SERVER);
|
||||
theNetwork.registerMessage(PacketGuiString.Handler.class, PacketGuiString.class, 2, Side.SERVER);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* This file ("IPacketSyncerToClient.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015 Ellpeck
|
||||
*/
|
||||
|
||||
package ellpeck.actuallyadditions.network.sync;
|
||||
|
||||
public interface IPacketSyncerToClient{
|
||||
|
||||
/**
|
||||
* @return The values that should be sent to the Client
|
||||
*/
|
||||
int[] getValues();
|
||||
|
||||
/**
|
||||
* Sets the Values on the Client
|
||||
*
|
||||
* @param values The Values
|
||||
*/
|
||||
void setValues(int[] values);
|
||||
|
||||
/**
|
||||
* Sends the Update
|
||||
*/
|
||||
void sendUpdate();
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* This file ("PacketSyncerToClient.java") is part of the Actually Additions Mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015 Ellpeck
|
||||
*/
|
||||
|
||||
package ellpeck.actuallyadditions.network.sync;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
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 cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.network.PacketHandler;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PacketSyncerToClient implements IMessage{
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int[] values;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public PacketSyncerToClient(){
|
||||
|
||||
}
|
||||
|
||||
public PacketSyncerToClient(TileEntity tile, int[] values){
|
||||
this.x = tile.xCoord;
|
||||
this.y = tile.yCoord;
|
||||
this.z = tile.zCoord;
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public static void sendPacket(TileEntity tile){
|
||||
if(tile instanceof IPacketSyncerToClient){
|
||||
PacketHandler.theNetwork.sendToAllAround(new PacketSyncerToClient(tile, ((IPacketSyncerToClient)tile).getValues()), new NetworkRegistry.TargetPoint(tile.getWorldObj().provider.dimensionId, tile.xCoord, tile.yCoord, tile.zCoord, 128));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf){
|
||||
this.x = buf.readInt();
|
||||
this.y = buf.readInt();
|
||||
this.z = buf.readInt();
|
||||
int length = buf.readInt();
|
||||
if(this.values == null){
|
||||
this.values = new int[length];
|
||||
}
|
||||
for(int i = 0; i < length; i++){
|
||||
this.values[i] = buf.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf){
|
||||
buf.writeInt(this.x);
|
||||
buf.writeInt(this.y);
|
||||
buf.writeInt(this.z);
|
||||
buf.writeInt(this.values.length);
|
||||
for(int value : this.values){
|
||||
buf.writeInt(value);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<PacketSyncerToClient, IMessage>{
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IMessage onMessage(PacketSyncerToClient message, MessageContext ctx){
|
||||
World world = FMLClientHandler.instance().getClient().theWorld;
|
||||
TileEntity tile = world.getTileEntity(message.x, message.y, message.z);
|
||||
if(tile != null && tile instanceof IPacketSyncerToClient){
|
||||
((IPacketSyncerToClient)tile).setValues(message.values);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -41,7 +41,7 @@ public class CrusherRecipeRegistry{
|
|||
String output = theCase.resultPreString+ore.substring(theCase.theCase.length());
|
||||
|
||||
if(!hasRecipe(ore)){
|
||||
if(!OreDictionary.getOres(output, false).isEmpty()){
|
||||
if(!OreDictionary.getOres(output, false).isEmpty() && !OreDictionary.getOres(ore, false).isEmpty()){
|
||||
addRecipe(ore, output, theCase.resultAmount);
|
||||
recipesAdded++;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityBase extends TileEntity{
|
||||
public abstract class TileEntityBase extends TileEntity{
|
||||
|
||||
public static void init(){
|
||||
ModUtil.LOGGER.info("Registering TileEntities...");
|
||||
|
@ -64,20 +64,40 @@ public class TileEntityBase extends TileEntity{
|
|||
GameRegistry.registerTileEntity(TileEntityRangedCollector.class, ModUtil.MOD_ID_LOWER+":tileEntityRangedCollector");
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
this.readSyncableNBT(compound, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
this.writeSyncableNBT(compound, false);
|
||||
}
|
||||
|
||||
public abstract void writeSyncableNBT(NBTTagCompound compound, boolean isForSync);
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket(){
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
this.writeToNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag);
|
||||
this.writeSyncableNBT(tag, true);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 3, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
this.readSyncableNBT(pkt.func_148857_g(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z){
|
||||
return !(oldBlock.isAssociatedBlock(newBlock));
|
||||
}
|
||||
|
||||
public abstract void readSyncableNBT(NBTTagCompound compound, boolean isForSync);
|
||||
|
||||
protected void sendUpdate(){
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
|
@ -78,14 +78,14 @@ public class TileEntityBreaker extends TileEntityInventoryBase{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.currentTime = compound.getInteger("CurrentTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setInteger("CurrentTime", this.currentTime);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@ import ellpeck.actuallyadditions.blocks.InitBlocks;
|
|||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -27,7 +25,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class TileEntityCanolaPress extends TileEntityInventoryBase implements IEnergyReceiver, IFluidHandler, IPacketSyncerToClient{
|
||||
public class TileEntityCanolaPress extends TileEntityInventoryBase implements IEnergyReceiver, IFluidHandler{
|
||||
|
||||
public EnergyStorage storage = new EnergyStorage(40000);
|
||||
public FluidTank tank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME);
|
||||
|
@ -106,19 +104,19 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.currentProcessTime = compound.getInteger("ProcessTime");
|
||||
this.storage.readFromNBT(compound);
|
||||
this.tank.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
compound.setInteger("ProcessTime", this.currentProcessTime);
|
||||
this.storage.writeToNBT(compound);
|
||||
this.tank.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -188,26 +186,4 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
|
|||
public FluidTankInfo[] getTankInfo(ForgeDirection from){
|
||||
return new FluidTankInfo[]{this.tank.getInfo()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.currentProcessTime, this.tank.getFluidAmount(), this.tank.getFluid() == null ? -1 : this.tank.getFluid().getFluidID(), this.storage.getEnergyStored()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.currentProcessTime = values[0];
|
||||
if(values[2] != -1){
|
||||
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1]));
|
||||
}
|
||||
else{
|
||||
this.tank.setFluid(null);
|
||||
}
|
||||
this.storage.setEnergyStored(values[3]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,15 +15,13 @@ import cofh.api.energy.IEnergyProvider;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoalGenerator extends TileEntityInventoryBase implements IEnergyProvider, IPacketSyncerToClient{
|
||||
public class TileEntityCoalGenerator extends TileEntityInventoryBase implements IEnergyProvider{
|
||||
|
||||
public EnergyStorage storage = new EnergyStorage(60000);
|
||||
public int maxBurnTime;
|
||||
|
@ -101,19 +99,19 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.currentBurnTime = compound.getInteger("BurnTime");
|
||||
this.maxBurnTime = compound.getInteger("MaxBurnTime");
|
||||
this.storage.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
compound.setInteger("BurnTime", this.currentBurnTime);
|
||||
compound.setInteger("MaxBurnTime", this.maxBurnTime);
|
||||
this.storage.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -150,21 +148,4 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
|||
public boolean canConnectEnergy(ForgeDirection from){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored(), this.currentBurnTime, this.maxBurnTime};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
this.currentBurnTime = values[1];
|
||||
this.maxBurnTime = values[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@ import ellpeck.actuallyadditions.items.InitItems;
|
|||
import ellpeck.actuallyadditions.items.ItemCoffee;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||
import ellpeck.actuallyadditions.network.gui.IButtonReactor;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -28,7 +26,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements IButtonReactor, IEnergyReceiver, IFluidHandler, IPacketSyncerToClient{
|
||||
public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements IButtonReactor, IEnergyReceiver, IFluidHandler{
|
||||
|
||||
public static final int SLOT_COFFEE_BEANS = 0;
|
||||
public static final int SLOT_INPUT = 1;
|
||||
|
@ -142,8 +140,8 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.storage.readFromNBT(compound);
|
||||
this.tank.readFromNBT(compound);
|
||||
this.coffeeCacheAmount = compound.getInteger("Cache");
|
||||
|
@ -151,8 +149,8 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
this.storage.writeToNBT(compound);
|
||||
this.tank.writeToNBT(compound);
|
||||
compound.setInteger("Cache", this.coffeeCacheAmount);
|
||||
|
@ -230,27 +228,4 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
public FluidTankInfo[] getTankInfo(ForgeDirection from){
|
||||
return new FluidTankInfo[]{this.tank.getInfo()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.tank.getFluidAmount(), this.tank.getFluid() == null ? -1 : this.tank.getFluid().getFluidID(), this.storage.getEnergyStored(), this.brewTime, this.coffeeCacheAmount};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
if(values[1] != -1){
|
||||
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0]));
|
||||
}
|
||||
else{
|
||||
this.tank.setFluid(null);
|
||||
}
|
||||
this.storage.setEnergyStored(values[2]);
|
||||
this.brewTime = values[3];
|
||||
this.coffeeCacheAmount = values[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,14 +57,14 @@ public class TileEntityCompost extends TileEntityInventoryBase{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.conversionTime = compound.getInteger("ConversionTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
compound.setInteger("ConversionTime", this.conversionTime);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ import cofh.api.energy.IEnergyReceiver;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldPos;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -27,7 +25,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements IEnergyReceiver, IPacketSyncerToClient{
|
||||
public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements IEnergyReceiver{
|
||||
|
||||
public EnergyStorage storage = new EnergyStorage(10000);
|
||||
private int lastEnergy;
|
||||
|
@ -91,17 +89,17 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
this.storage.readFromNBT(compound);
|
||||
this.currentTime = compound.getInteger("CurrentTime");
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
this.storage.writeToNBT(compound);
|
||||
compound.setInteger("CurrentTime", this.currentTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
this.storage.writeToNBT(compound);
|
||||
compound.setInteger("CurrentTime", this.currentTime);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.storage.readFromNBT(compound);
|
||||
this.currentTime = compound.getInteger("CurrentTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,19 +136,4 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
|
|||
public boolean canConnectEnergy(ForgeDirection from){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,14 +63,14 @@ public class TileEntityDropper extends TileEntityInventoryBase{
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.currentTime = compound.getInteger("CurrentTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setInteger("CurrentTime", this.currentTime);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,13 +15,11 @@ import cofh.api.energy.IEnergyContainerItem;
|
|||
import cofh.api.energy.IEnergyReceiver;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityEnergizer extends TileEntityInventoryBase implements IEnergyReceiver, IPacketSyncerToClient{
|
||||
public class TileEntityEnergizer extends TileEntityInventoryBase implements IEnergyReceiver{
|
||||
|
||||
public EnergyStorage storage = new EnergyStorage(500000);
|
||||
private int lastEnergy;
|
||||
|
@ -56,15 +54,15 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -106,19 +104,4 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne
|
|||
public boolean canConnectEnergy(ForgeDirection from){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,12 @@ import cofh.api.energy.IEnergyContainerItem;
|
|||
import cofh.api.energy.IEnergyProvider;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityEnervator extends TileEntityInventoryBase implements IEnergyProvider, IPacketSyncerToClient{
|
||||
public class TileEntityEnervator extends TileEntityInventoryBase implements IEnergyProvider{
|
||||
|
||||
public EnergyStorage storage = new EnergyStorage(500000);
|
||||
private int lastEnergy;
|
||||
|
@ -66,15 +64,15 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,19 +114,4 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne
|
|||
public boolean canExtractItem(int slot, ItemStack stack, int side){
|
||||
return slot == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,6 @@ package ellpeck.actuallyadditions.tile;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -23,7 +21,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityFeeder extends TileEntityInventoryBase implements IPacketSyncerToClient{
|
||||
public class TileEntityFeeder extends TileEntityInventoryBase{
|
||||
|
||||
public int currentTimer;
|
||||
public int currentAnimalAmount;
|
||||
|
@ -101,14 +99,14 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements IPacket
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.currentTimer = compound.getInteger("Timer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setInteger("Timer", this.currentTimer);
|
||||
}
|
||||
|
||||
|
@ -126,20 +124,4 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements IPacket
|
|||
public boolean canExtractItem(int slot, ItemStack stack, int side){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.currentAnimalAmount, this.currentTimer};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.currentAnimalAmount = values[0];
|
||||
this.currentTimer = values[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,6 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -23,7 +21,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class TileEntityFermentingBarrel extends TileEntityInventoryBase implements IFluidHandler, IPacketSyncerToClient{
|
||||
public class TileEntityFermentingBarrel extends TileEntityInventoryBase implements IFluidHandler{
|
||||
|
||||
public FluidTank canolaTank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME);
|
||||
public FluidTank oilTank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME);
|
||||
|
@ -82,21 +80,21 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
this.currentProcessTime = compound.getInteger("ProcessTime");
|
||||
this.canolaTank.readFromNBT(compound);
|
||||
this.oilTank.readFromNBT((NBTTagCompound)compound.getTag("OilTank"));
|
||||
super.readFromNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
compound.setInteger("ProcessTime", this.currentProcessTime);
|
||||
this.canolaTank.writeToNBT(compound);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
this.oilTank.writeToNBT(tag);
|
||||
compound.setTag("OilTank", tag);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.currentProcessTime = compound.getInteger("ProcessTime");
|
||||
this.canolaTank.readFromNBT(compound);
|
||||
this.oilTank.readFromNBT((NBTTagCompound)compound.getTag("OilTank"));
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -159,31 +157,4 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
|
|||
public FluidTankInfo[] getTankInfo(ForgeDirection from){
|
||||
return new FluidTankInfo[]{this.canolaTank.getInfo(), this.oilTank.getInfo()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.oilTank.getFluidAmount(), this.oilTank.getFluid() == null ? -1 : this.oilTank.getFluid().getFluidID(), this.canolaTank.getFluidAmount(), this.canolaTank.getFluid() == null ? -1 : this.canolaTank.getFluid().getFluidID(), this.currentProcessTime};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
if(values[1] != -1){
|
||||
this.oilTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0]));
|
||||
}
|
||||
else{
|
||||
this.oilTank.setFluid(null);
|
||||
}
|
||||
if(values[3] != -1){
|
||||
this.canolaTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2]));
|
||||
}
|
||||
else{
|
||||
this.canolaTank.setFluid(null);
|
||||
}
|
||||
this.currentProcessTime = values[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,15 +28,13 @@ public class TileEntityFishingNet extends TileEntityBase{
|
|||
public int timeUntilNextDrop;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
this.timeUntilNextDrop = compound.getInteger("TimeUntilNextDrop");
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
compound.setInteger("TimeUntilNextDrop", this.timeUntilNextDrop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
compound.setInteger("TimeUntilNextDrop", this.timeUntilNextDrop);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.timeUntilNextDrop = compound.getInteger("TimeUntilNextDrop");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,8 +13,6 @@ package ellpeck.actuallyadditions.tile;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldPos;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -24,7 +22,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class TileEntityFluidCollector extends TileEntityInventoryBase implements IFluidHandler, IPacketSyncerToClient{
|
||||
public class TileEntityFluidCollector extends TileEntityInventoryBase implements IFluidHandler{
|
||||
|
||||
public FluidTank tank = new FluidTank(8*FluidContainerRegistry.BUCKET_VOLUME);
|
||||
public boolean isPlacer;
|
||||
|
@ -79,26 +77,6 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
|
|||
return new FluidTankInfo[]{this.tank.getInfo()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.tank.getFluidAmount(), this.tank.getFluid() == null ? -1 : this.tank.getFluid().getFluidID()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
if(values[1] != -1){
|
||||
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0]));
|
||||
}
|
||||
else{
|
||||
this.tank.setFluid(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void updateEntity(){
|
||||
|
@ -181,17 +159,17 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
this.currentTime = compound.getInteger("CurrentTime");
|
||||
this.tank.readFromNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setInteger("CurrentTime", this.currentTime);
|
||||
this.tank.writeToNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
compound.setInteger("CurrentTime", this.currentTime);
|
||||
this.tank.writeToNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.currentTime = compound.getInteger("CurrentTime");
|
||||
this.tank.readFromNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,14 +15,12 @@ import cofh.api.energy.IEnergyReceiver;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements IEnergyReceiver, IPacketSyncerToClient{
|
||||
public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements IEnergyReceiver{
|
||||
|
||||
public static final int SLOT_INPUT_1 = 0;
|
||||
public static final int SLOT_OUTPUT_1 = 1;
|
||||
|
@ -132,16 +130,16 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.firstSmeltTime = compound.getInteger("FirstSmeltTime");
|
||||
this.secondSmeltTime = compound.getInteger("SecondSmeltTime");
|
||||
this.storage.readFromNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setInteger("FirstSmeltTime", this.firstSmeltTime);
|
||||
compound.setInteger("SecondSmeltTime", this.secondSmeltTime);
|
||||
this.storage.writeToNBT(compound);
|
||||
|
@ -196,21 +194,4 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements
|
|||
public boolean canConnectEnergy(ForgeDirection from){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored(), this.firstSmeltTime, this.secondSmeltTime};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
this.firstSmeltTime = values[1];
|
||||
this.secondSmeltTime = values[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,15 +42,13 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
this.storage.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.writeToNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
this.storage.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.readFromNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,6 +15,7 @@ import ellpeck.actuallyadditions.util.WorldPos;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGrass;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
|
||||
import java.util.Random;
|
||||
|
@ -63,4 +64,13 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
this.timeUntilNextFert = compound.getInteger("Time");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
compound.setInteger("Time", this.timeUntilNextFert);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@ import cofh.api.energy.IEnergyReceiver;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -26,7 +24,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityGrinder extends TileEntityInventoryBase implements IEnergyReceiver, IPacketSyncerToClient{
|
||||
public class TileEntityGrinder extends TileEntityInventoryBase implements IEnergyReceiver{
|
||||
|
||||
public static final int SLOT_INPUT_1 = 0;
|
||||
public static final int SLOT_OUTPUT_1_1 = 1;
|
||||
|
@ -71,23 +69,6 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored(), this.firstCrushTime, this.secondCrushTime};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
this.firstCrushTime = values[1];
|
||||
this.secondCrushTime = values[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void updateEntity(){
|
||||
|
@ -216,19 +197,19 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.firstCrushTime = compound.getInteger("FirstCrushTime");
|
||||
this.secondCrushTime = compound.getInteger("SecondCrushTime");
|
||||
this.storage.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
compound.setInteger("FirstCrushTime", this.firstCrushTime);
|
||||
compound.setInteger("SecondCrushTime", this.secondCrushTime);
|
||||
this.storage.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,6 +17,7 @@ import ellpeck.actuallyadditions.util.WorldPos;
|
|||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -77,4 +78,14 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr
|
|||
public boolean canConnectEnergy(ForgeDirection from){
|
||||
return from == ForgeDirection.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
this.storage.writeToNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
this.storage.readFromNBT(compound);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,6 @@ package ellpeck.actuallyadditions.tile;
|
|||
|
||||
import ellpeck.actuallyadditions.network.gui.IButtonReactor;
|
||||
import ellpeck.actuallyadditions.network.gui.INumberReactor;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
@ -22,7 +20,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityInputter extends TileEntityInventoryBase implements IButtonReactor, INumberReactor, IPacketSyncerToClient{
|
||||
public class TileEntityInputter extends TileEntityInventoryBase implements IButtonReactor, INumberReactor{
|
||||
|
||||
public static final int PUT_FILTER_START = 13;
|
||||
public static final int PULL_FILTER_START = 1;
|
||||
|
@ -82,28 +80,6 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{sideToPut, sideToPull, slotToPutStart, slotToPutEnd, slotToPullStart, slotToPullEnd, this.isPutWhitelist ? 1 : 0, this.isPullWhitelist ? 1 : 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.sideToPut = values[0];
|
||||
this.sideToPull = values[1];
|
||||
this.slotToPutStart = values[2];
|
||||
this.slotToPutEnd = values[3];
|
||||
this.slotToPullStart = values[4];
|
||||
this.slotToPullEnd = values[5];
|
||||
this.isPutWhitelist = values[6] == 1;
|
||||
this.isPullWhitelist = values[7] == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(){
|
||||
if(!worldObj.isRemote){
|
||||
|
@ -425,7 +401,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.sideToPut = compound.getInteger("SideToPut");
|
||||
this.slotToPutStart = compound.getInteger("SlotToPut");
|
||||
this.slotToPutEnd = compound.getInteger("SlotToPutEnd");
|
||||
|
@ -434,12 +410,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
|||
this.slotToPullEnd = compound.getInteger("SlotToPullEnd");
|
||||
this.isPullWhitelist = compound.getBoolean("PullWhitelist");
|
||||
this.isPutWhitelist = compound.getBoolean("PutWhitelist");
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setInteger("SideToPut", this.sideToPut);
|
||||
compound.setInteger("SlotToPut", this.slotToPutStart);
|
||||
compound.setInteger("SlotToPutEnd", this.slotToPutEnd);
|
||||
|
|
|
@ -32,23 +32,8 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
if(this.slots.length > 0){
|
||||
NBTTagList tagList = compound.getTagList("Items", 10);
|
||||
for(int i = 0; i < tagList.tagCount(); i++){
|
||||
NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
|
||||
byte slotIndex = tagCompound.getByte("Slot");
|
||||
if(slotIndex >= 0 && slotIndex < slots.length){
|
||||
slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
if(!isForSync){
|
||||
if(this.slots.length > 0){
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
for(int currentIndex = 0; currentIndex < slots.length; currentIndex++){
|
||||
|
@ -62,6 +47,23 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
|
|||
compound.setTag("Items", tagList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
if(!isForSync){
|
||||
if(this.slots.length > 0){
|
||||
NBTTagList tagList = compound.getTagList("Items", 10);
|
||||
for(int i = 0; i < tagList.tagCount(); i++){
|
||||
NBTTagCompound tagCompound = tagList.getCompoundTagAt(i);
|
||||
byte slotIndex = tagCompound.getByte("Slot");
|
||||
if(slotIndex >= 0 && slotIndex < slots.length){
|
||||
slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side){
|
||||
|
|
|
@ -15,13 +15,11 @@ import cofh.api.energy.IEnergyReceiver;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityItemRepairer extends TileEntityInventoryBase implements IEnergyReceiver, IPacketSyncerToClient{
|
||||
public class TileEntityItemRepairer extends TileEntityInventoryBase implements IEnergyReceiver{
|
||||
|
||||
public static final int SLOT_INPUT = 0;
|
||||
public static final int SLOT_OUTPUT = 1;
|
||||
|
@ -71,16 +69,16 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.nextRepairTick = compound.getInteger("NextRepairTick");
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.storage.readFromNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
compound.setInteger("NextRepairTick", this.nextRepairTick);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
this.storage.writeToNBT(compound);
|
||||
}
|
||||
|
||||
|
@ -131,19 +129,4 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I
|
|||
public boolean canConnectEnergy(ForgeDirection from){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,17 +31,15 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I
|
|||
private int currentWorkTime;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
this.storage.readFromNBT(compound);
|
||||
this.currentWorkTime = compound.getInteger("WorkTime");
|
||||
super.readFromNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.writeToNBT(compound);
|
||||
compound.setInteger("WorkTime", this.currentWorkTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
this.storage.writeToNBT(compound);
|
||||
compound.setInteger("WorkTime", this.currentWorkTime);
|
||||
super.writeToNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.readFromNBT(compound);
|
||||
this.currentWorkTime = compound.getInteger("WorkTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,15 +29,13 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
|
|||
private int nextUseCounter;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
this.storage.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.writeToNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
this.storage.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.readFromNBT(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,15 +16,13 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.blocks.InitBlocks;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
public class TileEntityOilGenerator extends TileEntityInventoryBase implements IEnergyProvider, IFluidHandler, IPacketSyncerToClient{
|
||||
public class TileEntityOilGenerator extends TileEntityInventoryBase implements IEnergyProvider, IFluidHandler{
|
||||
|
||||
public EnergyStorage storage = new EnergyStorage(50000);
|
||||
public FluidTank tank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME);
|
||||
|
@ -104,19 +102,19 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.currentBurnTime = compound.getInteger("BurnTime");
|
||||
this.storage.readFromNBT(compound);
|
||||
this.tank.readFromNBT(compound);
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
compound.setInteger("BurnTime", this.currentBurnTime);
|
||||
this.storage.writeToNBT(compound);
|
||||
this.tank.writeToNBT(compound);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -186,26 +184,4 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I
|
|||
public FluidTankInfo[] getTankInfo(ForgeDirection from){
|
||||
return new FluidTankInfo[]{this.tank.getInfo()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored(), this.currentBurnTime, this.tank.getFluidAmount(), this.tank.getFluid() == null ? -1 : this.tank.getFluid().getFluidID()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
this.currentBurnTime = values[1];
|
||||
if(values[3] != -1){
|
||||
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2]));
|
||||
}
|
||||
else{
|
||||
this.tank.setFluid(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,6 @@ import ellpeck.actuallyadditions.blocks.InitBlocks;
|
|||
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||
import ellpeck.actuallyadditions.config.ConfigValues;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldPos;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -32,7 +30,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEnergyReceiver, IFluidHandler, IPacketSyncerToClient{
|
||||
public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEnergyReceiver, IFluidHandler{
|
||||
|
||||
public static final int SLOT_OIL_INPUT = 0;
|
||||
public static final int SLOT_OIL_OUTPUT = 1;
|
||||
|
@ -182,19 +180,19 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.readFromNBT(compound);
|
||||
this.tank.readFromNBT(compound);
|
||||
this.currentWorkTimer = compound.getInteger("CurrentWorkTimer");
|
||||
super.readFromNBT(compound);
|
||||
super.readSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.storage.writeToNBT(compound);
|
||||
this.tank.writeToNBT(compound);
|
||||
compound.setInteger("CurrentWorkTimer", this.currentWorkTimer);
|
||||
super.writeToNBT(compound);
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -264,25 +262,4 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
|
|||
public FluidTankInfo[] getTankInfo(ForgeDirection from){
|
||||
return new FluidTankInfo[]{this.tank.getInfo()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.storage.getEnergyStored(), this.tank.getFluidAmount(), this.tank.getFluid() == null ? -1 : this.tank.getFluid().getFluidID()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.storage.setEnergyStored(values[0]);
|
||||
if(values[2] != -1){
|
||||
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1]));
|
||||
}
|
||||
else{
|
||||
this.tank.setFluid(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
package ellpeck.actuallyadditions.tile;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityPhantomBooster extends TileEntityBase{
|
||||
|
||||
@Override
|
||||
|
@ -17,4 +19,13 @@ public class TileEntityPhantomBooster extends TileEntityBase{
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,8 +138,20 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setInteger("Time", currentTime);
|
||||
if(this.hasBoundPosition()){
|
||||
compound.setInteger("XCoordOfTileStored", boundPosition.getX());
|
||||
compound.setInteger("YCoordOfTileStored", boundPosition.getY());
|
||||
compound.setInteger("ZCoordOfTileStored", boundPosition.getZ());
|
||||
compound.setInteger("WorldOfTileStored", boundPosition.getWorld().provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
int x = compound.getInteger("XCoordOfTileStored");
|
||||
int y = compound.getInteger("YCoordOfTileStored");
|
||||
int z = compound.getInteger("ZCoordOfTileStored");
|
||||
|
@ -150,18 +162,6 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
compound.setInteger("Time", currentTime);
|
||||
if(this.hasBoundPosition()){
|
||||
compound.setInteger("XCoordOfTileStored", boundPosition.getX());
|
||||
compound.setInteger("YCoordOfTileStored", boundPosition.getY());
|
||||
compound.setInteger("ZCoordOfTileStored", boundPosition.getZ());
|
||||
compound.setInteger("WorldOfTileStored", boundPosition.getWorld().provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack){
|
||||
return !this.isBreaker;
|
||||
|
|
|
@ -120,8 +120,8 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
int x = compound.getInteger("XCoordOfTileStored");
|
||||
int y = compound.getInteger("YCoordOfTileStored");
|
||||
int z = compound.getInteger("ZCoordOfTileStored");
|
||||
|
@ -133,8 +133,8 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
|||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
if(this.hasBoundPosition()){
|
||||
compound.setInteger("XCoordOfTileStored", boundPosition.getX());
|
||||
compound.setInteger("YCoordOfTileStored", boundPosition.getY());
|
||||
|
|
|
@ -12,8 +12,6 @@ package ellpeck.actuallyadditions.tile;
|
|||
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.network.gui.IButtonReactor;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -23,7 +21,7 @@ import net.minecraft.util.AxisAlignedBB;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TileEntityRangedCollector extends TileEntityInventoryBase implements IButtonReactor, IPacketSyncerToClient{
|
||||
public class TileEntityRangedCollector extends TileEntityInventoryBase implements IButtonReactor{
|
||||
|
||||
public static final int WHITELIST_START = 6;
|
||||
|
||||
|
@ -77,15 +75,15 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
this.isWhitelist = compound.getBoolean("Whitelist");
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setBoolean("Whitelist", this.isWhitelist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
compound.setBoolean("Whitelist", this.isWhitelist);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.isWhitelist = compound.getBoolean("Whitelist");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,19 +105,4 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement
|
|||
public void onButtonPressed(int buttonID, EntityPlayer player){
|
||||
this.isWhitelist = !this.isWhitelist;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.isWhitelist ? 1 : 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.isWhitelist = values[0] == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,14 +13,12 @@ package ellpeck.actuallyadditions.tile;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.network.gui.IStringReactor;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class TileEntitySmileyCloud extends TileEntityBase implements IPacketSyncerToClient, IStringReactor{
|
||||
public class TileEntitySmileyCloud extends TileEntityBase implements IStringReactor{
|
||||
|
||||
public String name;
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
@ -30,19 +28,17 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IPacketSync
|
|||
private String nameBefore;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
this.name = compound.getString("Name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
if(this.name != null){
|
||||
compound.setString("Name", this.name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
this.name = compound.getString("Name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity(){
|
||||
if(!worldObj.isRemote){
|
||||
|
@ -54,38 +50,6 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IPacketSync
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
if(this.name != null && !this.name.isEmpty()){
|
||||
int[] chars = new int[this.name.length()];
|
||||
for(int i = 0; i < this.name.length(); i++){
|
||||
char atPlace = this.name.charAt(i);
|
||||
chars[i] = (int)atPlace;
|
||||
}
|
||||
return chars;
|
||||
}
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
if(values != null && values.length > 0){
|
||||
String newName = "";
|
||||
for(int value : values){
|
||||
newName += (char)value;
|
||||
}
|
||||
this.name = newName;
|
||||
}
|
||||
else{
|
||||
this.name = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextReceived(String text, int textID, EntityPlayer player){
|
||||
this.name = text;
|
||||
|
|
|
@ -15,13 +15,11 @@ import ellpeck.actuallyadditions.items.InitItems;
|
|||
import ellpeck.actuallyadditions.items.ItemSpecialDrop;
|
||||
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
|
||||
import ellpeck.actuallyadditions.network.gui.IButtonReactor;
|
||||
import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient;
|
||||
import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityXPSolidifier extends TileEntityInventoryBase implements IButtonReactor, IPacketSyncerToClient{
|
||||
public class TileEntityXPSolidifier extends TileEntityInventoryBase implements IButtonReactor{
|
||||
|
||||
public short amount;
|
||||
private short lastAmount;
|
||||
|
@ -56,14 +54,14 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
super.readFromNBT(compound);
|
||||
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.readSyncableNBT(compound, sync);
|
||||
this.amount = compound.getShort("Amount");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound compound){
|
||||
super.writeToNBT(compound);
|
||||
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||||
super.writeSyncableNBT(compound, sync);
|
||||
compound.setShort("Amount", this.amount);
|
||||
}
|
||||
|
||||
|
@ -150,19 +148,4 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getValues(){
|
||||
return new int[]{this.amount};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(int[] values){
|
||||
this.amount = (short)values[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate(){
|
||||
PacketSyncerToClient.sendPacket(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class PersistentServerData implements IExtendedEntityProperties{
|
|||
public void saveNBTData(NBTTagCompound aComp){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
compound.setBoolean("BookGotten", bookGottenAlready);
|
||||
compound.setBoolean("BookGotten", this.bookGottenAlready);
|
||||
|
||||
aComp.setTag(ModUtil.MOD_ID, compound);
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 1.9 KiB |