mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
some fixes, RBMK control rod copyable
This commit is contained in:
parent
8ea7cf4080
commit
951c00d79d
@ -1,2 +1,7 @@
|
||||
## Changed
|
||||
* Due to severe issues with ticking order as well as a crash caused by certain tiles that uses threaded packets, Torcherino accelerator torches no longer affect NTM machines
|
||||
* Due to severe issues with ticking order as well as a crash caused by certain tiles that uses threaded packets, Torcherino accelerator torches no longer affect NTM machines
|
||||
* RBMK control rod colors and auto control rod settings are now copiable
|
||||
|
||||
## Fixed
|
||||
* Fixed conveyor grabber dropping items off at an offset when placing them on a conveyor belt due to a client desync
|
||||
* Fixed occasional crash caused by using the settings tool on the autoloader
|
||||
@ -565,6 +565,7 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
@Override
|
||||
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
|
||||
int[] pos = findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if (tile instanceof ICopiable)
|
||||
((ICopiable) tile).pasteSettings(nbt, index, world, player, pos[0], pos[1], pos[2]);
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.ICopiable;
|
||||
import com.hbm.inventory.container.ContainerRBMKControlAuto;
|
||||
import com.hbm.inventory.gui.GUIRBMKControlAuto;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKControlManual.RBMKColor;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -16,7 +18,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityRBMKControlAuto extends TileEntityRBMKControl implements IControlReceiver {
|
||||
public class TileEntityRBMKControlAuto extends TileEntityRBMKControl implements IControlReceiver, ICopiable {
|
||||
|
||||
public RBMKFunction function = RBMKFunction.LINEAR;
|
||||
public double levelLower;
|
||||
@ -164,4 +166,24 @@ public class TileEntityRBMKControlAuto extends TileEntityRBMKControl implements
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIRBMKControlAuto(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getSettings(World world, int x, int y, int z) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setDouble("levelLower", levelLower);
|
||||
data.setDouble("levelUpper", levelUpper);
|
||||
data.setDouble("heatLower", heatLower);
|
||||
data.setDouble("heatUpper", heatUpper);
|
||||
data.setInteger("function", function.ordinal());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
|
||||
if(nbt.hasKey("levelLower")) levelLower = nbt.getDouble("levelLower");
|
||||
if(nbt.hasKey("levelUpper")) levelLower = nbt.getDouble("levelUpper");
|
||||
if(nbt.hasKey("heatLower")) levelLower = nbt.getDouble("heatLower");
|
||||
if(nbt.hasKey("heatUpper")) levelLower = nbt.getDouble("heatUpper");
|
||||
if(nbt.hasKey("function")) function = EnumUtil.grabEnumSafely(RBMKFunction.class, nbt.getInteger("function"));
|
||||
}
|
||||
}
|
||||
@ -2,9 +2,11 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.blocks.machine.rbmk.RBMKControl;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.ICopiable;
|
||||
import com.hbm.inventory.container.ContainerRBMKControl;
|
||||
import com.hbm.inventory.gui.GUIRBMKControl;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -20,7 +22,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityRBMKControlManual extends TileEntityRBMKControl implements IControlReceiver {
|
||||
public class TileEntityRBMKControlManual extends TileEntityRBMKControl implements IControlReceiver, ICopiable {
|
||||
|
||||
public RBMKColor color;
|
||||
public double startingLevel;
|
||||
@ -177,5 +179,17 @@ public class TileEntityRBMKControlManual extends TileEntityRBMKControl implement
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIRBMKControl(player.inventory, this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getSettings(World world, int x, int y, int z) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("color", color.ordinal());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) {
|
||||
if(nbt.hasKey("color")) color = EnumUtil.grabEnumSafely(RBMKColor.class, nbt.getInteger("color"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +107,11 @@ public class TileEntityCraneGrabber extends TileEntityCraneBase implements IGUIP
|
||||
|
||||
Vec3 pos = Vec3.createVectorHelper(xCoord + 0.5 + outputSide.offsetX * 0.55, yCoord + 0.5 + outputSide.offsetY * 0.55, zCoord + 0.5 + outputSide.offsetZ * 0.55);
|
||||
Vec3 snap = belt.getClosestSnappingPosition(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, pos);
|
||||
item.setPosition(snap.xCoord, snap.yCoord, snap.zCoord);
|
||||
EntityMovingItem newItem = new EntityMovingItem(worldObj);
|
||||
newItem.setItemStack(item.getItemStack().copy());
|
||||
newItem.setPosition(snap.xCoord, snap.yCoord, snap.zCoord);
|
||||
item.setDead();
|
||||
worldObj.spawnEntityInWorld(newItem);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user