diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-09-29 14:36:56 +1000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-09-29 14:36:56 +1000 |
commit | bc69aeb6203d3c9d667fe49807d8429df04aa7c9 (patch) | |
tree | d348dd1b4fdd69d46ca07aef4c3bddead62a93fd /src/Java | |
parent | 19749c79884682301e292b52d0ddb15e6d35a580 (diff) | |
download | GT5-Unofficial-bc69aeb6203d3c9d667fe49807d8429df04aa7c9.tar.gz GT5-Unofficial-bc69aeb6203d3c9d667fe49807d8429df04aa7c9.tar.bz2 GT5-Unofficial-bc69aeb6203d3c9d667fe49807d8429df04aa7c9.zip |
$ Fixed Fluorite ore not spawning properly from limestone.
Diffstat (limited to 'src/Java')
-rw-r--r-- | src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java | 8 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java | 43 |
2 files changed, 34 insertions, 17 deletions
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<Block> mBlockTypes = new ArrayList<Block>(); + if (!this.oreLimestone.isEmpty()){ + for (int i=0;i<this.oreLimestone.size();i++){ + mBlockTypes.add(Block.getBlockFromItem(this.oreLimestone.get(i).getItem())); + } + } + if (!this.blockLimestone.isEmpty()){ + for (int i=0;i<this.blockLimestone.size();i++){ + if (!mBlockTypes.contains(Block.getBlockFromItem(this.oreLimestone.get(i).getItem()))){ + mBlockTypes.add(Block.getBlockFromItem(this.oreLimestone.get(i).getItem())); } } } - if (!this.blockLimestone.isEmpty()) { - for (final ItemStack temp : this.blockLimestone){ - if (ItemUtils.getSimpleStack(Item.getItemFromBlock(event.block)) == temp) { + + Utils.LOG_WARNING("Found Limestone in OreDict."); + if (!mBlockTypes.isEmpty()) { + Utils.LOG_WARNING("1a | "+event.block.getUnlocalizedName()); + for (final Block temp : mBlockTypes){ + Utils.LOG_WARNING("2a - "+temp.getUnlocalizedName()); + if (event.block == temp) { + Utils.LOG_WARNING("3a - found "+temp.getUnlocalizedName()); if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1){ + Utils.LOG_WARNING("4a"); event.drops.add(this.fluoriteOre.copy()); } } } } } - else { - if (event.block.getUnlocalizedName().toLowerCase().contains("limestone")){ - if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1){ - event.drops.add(this.fluoriteOre.copy()); - } + + + if (event.block.getUnlocalizedName().toLowerCase().contains("limestone")){ + Utils.LOG_WARNING("1c"); + if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1){ + Utils.LOG_WARNING("2c"); + event.drops.add(this.fluoriteOre.copy()); } } + if (event.block == Blocks.sandstone){ if (MathUtils.randInt(1, chanceToDropFluoriteOre*20) == 1){ event.drops.add(this.fluoriteOre.copy()); |