From bc69aeb6203d3c9d667fe49807d8429df04aa7c9 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Fri, 29 Sep 2017 14:36:56 +1000 Subject: $ Fixed Fluorite ore not spawning properly from limestone. --- .../core/gui/machine/GUI_TradeTable.java | 8 ++-- .../core/handler/events/BlockEventHandler.java | 43 +++++++++++++++------- 2 files changed, 34 insertions(+), 17 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java index 93444a7a23..ea4d4ff2b8 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java @@ -17,7 +17,7 @@ import net.minecraft.util.ResourceLocation; public class GUI_TradeTable extends GuiContainer { TileEntityTradeTable mThisTable; - final String mOwnerName; + String mOwnerName; private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/ProjectTable.png"); @@ -30,15 +30,17 @@ public class GUI_TradeTable extends GuiContainer { Utils.LOG_INFO("Set invalid TE in GUI"); } else { + if (te.isServerSide()){ mThisTable = te; this.mOwnerName = mOwnerName; - Utils.LOG_INFO("Set valid TE in GUI"); + Utils.LOG_INFO("Set valid TE in GUI"); + } } } @Override protected void drawGuiContainerForegroundLayer(final int i, final int j){ - this.fontRendererObj.drawString(I18n.format("Owner: "+this.mOwnerName, new Object[0]), 28, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("Owner - "+this.mOwnerName, new Object[0]), 28, 66, 4210752); //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); } diff --git a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java index 58b5d6e7cc..26b559e926 100644 --- a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java @@ -13,6 +13,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; +import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -110,32 +111,46 @@ public class BlockEventHandler { //Spawns Fluorite from Lime Stone if (chanceToDropFluoriteOre != 0){ if (!this.oreLimestone.isEmpty() || !this.blockLimestone.isEmpty()){ - if (!this.oreLimestone.isEmpty()) { - for (final ItemStack temp : this.oreLimestone){ - if (ItemUtils.getSimpleStack(Item.getItemFromBlock(event.block)) == temp) { - if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1){ - event.drops.add(this.fluoriteOre.copy()); - } + + ArrayList mBlockTypes = new ArrayList(); + if (!this.oreLimestone.isEmpty()){ + for (int i=0;i