Merge remote-tracking branch 'remotes/origin/master' into 1.8.8
# Conflicts: # src/main/java/techreborn/client/gui/GuiGrinder.java # src/main/java/techreborn/tiles/TileGrinder.java
This commit is contained in:
commit
eedabb9e7d
5 changed files with 54 additions and 20 deletions
|
@ -1,6 +1,9 @@
|
||||||
package techreborn.client.container;
|
package techreborn.client.container;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import reborncore.client.gui.SlotOutput;
|
import reborncore.client.gui.SlotOutput;
|
||||||
import techreborn.tiles.TileGrinder;
|
import techreborn.tiles.TileGrinder;
|
||||||
|
@ -11,7 +14,7 @@ public class ContainerGrinder extends ContainerCrafting {
|
||||||
|
|
||||||
TileGrinder tile;
|
TileGrinder tile;
|
||||||
|
|
||||||
public int tickTime;
|
public int connectionStatus;
|
||||||
|
|
||||||
public ContainerGrinder(TileGrinder tileGrinder,
|
public ContainerGrinder(TileGrinder tileGrinder,
|
||||||
EntityPlayer player) {
|
EntityPlayer player) {
|
||||||
|
@ -50,4 +53,29 @@ public class ContainerGrinder extends ContainerCrafting {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges() {
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
for (int i = 0; i < this.crafters.size(); i++) {
|
||||||
|
ICrafting icrafting = (ICrafting) this.crafters.get(i);
|
||||||
|
if (this.connectionStatus != tile.connectionStatus) {
|
||||||
|
icrafting.sendProgressBarUpdate(this, 10, tile.connectionStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting crafting) {
|
||||||
|
super.addCraftingToCrafters(crafting);
|
||||||
|
crafting.sendProgressBarUpdate(this, 10, tile.connectionStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void updateProgressBar(int id, int value) {
|
||||||
|
if (id == 10) {
|
||||||
|
this.connectionStatus = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,14 @@ public class GuiGrinder extends GuiContainer {
|
||||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_grinder.png");
|
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_grinder.png");
|
||||||
|
|
||||||
TileGrinder grinder;
|
TileGrinder grinder;
|
||||||
|
ContainerGrinder containerGrinder;
|
||||||
|
|
||||||
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder) {
|
public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder) {
|
||||||
super(new ContainerGrinder(tilegrinder, player));
|
super(new ContainerGrinder(tilegrinder, player));
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 167;
|
this.ySize = 167;
|
||||||
grinder = tilegrinder;
|
grinder = tilegrinder;
|
||||||
|
containerGrinder = (ContainerGrinder) this.inventorySlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,7 +42,7 @@ public class GuiGrinder extends GuiContainer {
|
||||||
this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2);
|
this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grinder.getMutliBlock() != true) {
|
if (containerGrinder.connectionStatus != 1) {
|
||||||
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10);
|
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10);
|
||||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - j, -1);
|
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - j, -1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,24 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
||||||
|
|
||||||
public boolean hasLava;
|
public boolean hasLava;
|
||||||
public boolean isStar = false;
|
public boolean isStar = false;
|
||||||
|
public int height = 0;
|
||||||
|
|
||||||
public MultiBlockCasing(World world) {
|
public MultiBlockCasing(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getInfo(){
|
||||||
|
String value = "Intact";
|
||||||
|
try {
|
||||||
|
isMachineWhole();
|
||||||
|
} catch (MultiblockValidationException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
value = e.getLocalizedMessage();
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return True if the machine is "whole" and should be assembled. False
|
* @return True if the machine is "whole" and should be assembled. False
|
||||||
* otherwise.
|
* otherwise.
|
||||||
|
@ -83,7 +95,7 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
||||||
"Machine is too small, it must be at least %d blocks in the Z dimension",
|
"Machine is too small, it must be at least %d blocks in the Z dimension",
|
||||||
minZ));
|
minZ));
|
||||||
}
|
}
|
||||||
|
height = deltaY;
|
||||||
|
|
||||||
// if(checkIfStarShape(minimumCoord.x, minimumCoord.y, minimumCoord.z)){
|
// if(checkIfStarShape(minimumCoord.x, minimumCoord.y, minimumCoord.z)){
|
||||||
// isStar = true;
|
// isStar = true;
|
||||||
|
@ -92,7 +104,7 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
||||||
// isStar = false;
|
// isStar = false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (deltaY < 4) {
|
if (deltaY < minY) {
|
||||||
throw new MultiblockValidationException(
|
throw new MultiblockValidationException(
|
||||||
String.format(
|
String.format(
|
||||||
"Machine is too small, it must be at least %d blocks in the Y dimension",
|
"Machine is too small, it must be at least %d blocks in the Y dimension",
|
||||||
|
|
|
@ -120,16 +120,16 @@ public class TileAesu extends TilePowerAcceptor implements IWrenchable {
|
||||||
return dropStack;
|
return dropStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
|
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||||
super.writeToNBTWithoutCoords(tagCompound);
|
super.writeToNBT(tagCompound);
|
||||||
tagCompound.setDouble("euChange", euChange);
|
tagCompound.setDouble("euChange", euChange);
|
||||||
tagCompound.setDouble("euLastTick", euLastTick);
|
tagCompound.setDouble("euLastTick", euLastTick);
|
||||||
tagCompound.setInteger("output", OUTPUT);
|
tagCompound.setInteger("output", OUTPUT);
|
||||||
inventory.writeToNBT(tagCompound);
|
inventory.writeToNBT(tagCompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromNBTWithoutCoords(NBTTagCompound nbttagcompound) {
|
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||||
super.readFromNBTWithoutCoords(nbttagcompound);
|
super.readFromNBT(nbttagcompound);
|
||||||
this.euChange = nbttagcompound.getDouble("euChange");
|
this.euChange = nbttagcompound.getDouble("euChange");
|
||||||
this.euLastTick = nbttagcompound.getDouble("euLastTick");
|
this.euLastTick = nbttagcompound.getDouble("euLastTick");
|
||||||
this.OUTPUT = nbttagcompound.getInteger("output");
|
this.OUTPUT = nbttagcompound.getInteger("output");
|
||||||
|
|
|
@ -29,6 +29,7 @@ public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFlui
|
||||||
public Inventory inventory = new Inventory(6, "TileGrinder", 64, this);
|
public Inventory inventory = new Inventory(6, "TileGrinder", 64, this);
|
||||||
public Tank tank = new Tank("TileGrinder", 16000, this);
|
public Tank tank = new Tank("TileGrinder", 16000, this);
|
||||||
public RecipeCrafter crafter;
|
public RecipeCrafter crafter;
|
||||||
|
public int connectionStatus;
|
||||||
|
|
||||||
public TileGrinder() {
|
public TileGrinder() {
|
||||||
super(ConfigTechReborn.CentrifugeTier);
|
super(ConfigTechReborn.CentrifugeTier);
|
||||||
|
@ -85,21 +86,13 @@ public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFlui
|
||||||
for (EnumFacing direction : EnumFacing.values()) {
|
for (EnumFacing direction : EnumFacing.values()) {
|
||||||
TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()));
|
TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()));
|
||||||
if (tileEntity instanceof TileMachineCasing) {
|
if (tileEntity instanceof TileMachineCasing) {
|
||||||
if(!((TileMachineCasing) tileEntity).isConnected()){
|
if(((TileMachineCasing) tileEntity).isConnected() && ((TileMachineCasing) tileEntity).getMultiblockController().isAssembled() && ((TileMachineCasing) tileEntity).getMultiblockController().height == 3){
|
||||||
return false;
|
connectionStatus = 1;
|
||||||
}
|
|
||||||
if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) {
|
|
||||||
BlockMachineCasing machineCasing = (BlockMachineCasing) tileEntity.getBlockType();
|
|
||||||
int heat = machineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos()));
|
|
||||||
Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction);
|
|
||||||
location.modifyPositionFromSide(direction, 1);
|
|
||||||
if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava")) {
|
|
||||||
heat += 500;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
connectionStatus = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +213,6 @@ public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFlui
|
||||||
inventory.closeInventory(player);
|
inventory.closeInventory(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getField(int id) {
|
public int getField(int id) {
|
||||||
return inventory.getField(id);
|
return inventory.getField(id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue