Fixes #369 and fixes rubber tree spikes not decaying
This commit is contained in:
parent
0204ddc539
commit
7d514b718a
3 changed files with 37 additions and 3 deletions
|
@ -1,7 +1,10 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.tiles.TileImplosionCompressor;
|
||||
|
||||
|
@ -11,8 +14,8 @@ public class ContainerImplosionCompressor extends ContainerCrafting {
|
|||
|
||||
TileImplosionCompressor tile;
|
||||
|
||||
|
||||
public int tickTime;
|
||||
public int multiblockstate = 0;
|
||||
|
||||
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor,
|
||||
EntityPlayer player) {
|
||||
|
@ -48,4 +51,34 @@ public class ContainerImplosionCompressor extends ContainerCrafting {
|
|||
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.multiblockstate != getMultiblockstateint()) {
|
||||
icrafting.sendProgressBarUpdate(this, 3, getMultiblockstateint());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftGuiOpened(ICrafting crafting) {
|
||||
super.onCraftGuiOpened(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 3, getMultiblockstateint());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 3) {
|
||||
this.multiblockstate = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMultiblockstateint(){
|
||||
return tile.getMutliBlock() ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class GuiImplosionCompressor extends GuiContainer {
|
|||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (compresser.getMutliBlock() != true) {
|
||||
if (containerImplosionCompressor.multiblockstate == 0) {
|
||||
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import techreborn.blocks.BlockRubberLeaves;
|
||||
import techreborn.blocks.BlockRubberLog;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
|
@ -132,7 +133,7 @@ public class RubberTreeGenerator extends WorldGenerator {
|
|||
if(topLogPos != null){
|
||||
for (int i = 0; i < 4; i++) {
|
||||
BlockPos spikePos = topLogPos.up(i);
|
||||
this.setBlockAndNotifyAdequately(world, spikePos, ModBlocks.rubberLeaves.getDefaultState());
|
||||
this.setBlockAndNotifyAdequately(world, spikePos, ModBlocks.rubberLeaves.getDefaultState().withProperty(BlockRubberLeaves.DECAYABLE, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue