diff --git a/.gitignore b/.gitignore index 4c93d3da..2005a9d2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ thumbs.db .mtj.tmp/ # Package Files # -*.jar *.war *.ear *.txt diff --git a/build.properties b/build.properties index 45f30a45..1ccf4d96 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.10.2 forge.version=12.18.1.2079 -gt.version=5.10.23 +gt.version=5.10.24 forestry.version=5.2.7.220 ic2.version=2.6.99-ex110 diff --git a/build/libs/gregtech-5.10.24-dev.jar b/build/libs/gregtech-5.10.24-dev.jar new file mode 100644 index 00000000..3b497bf5 Binary files /dev/null and b/build/libs/gregtech-5.10.24-dev.jar differ diff --git a/build/libs/gregtech-5.10.24-sources.jar b/build/libs/gregtech-5.10.24-sources.jar new file mode 100644 index 00000000..a5574a65 Binary files /dev/null and b/build/libs/gregtech-5.10.24-sources.jar differ diff --git a/build/libs/gregtech-5.10.24.jar b/build/libs/gregtech-5.10.24.jar new file mode 100644 index 00000000..71d0f79c Binary files /dev/null and b/build/libs/gregtech-5.10.24.jar differ diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 5b9fffe7..756122bd 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -209,6 +209,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mFlintChance = tMainConfig.get("general", "FlintAndSteelChance", 30).getInt(30); gregtechproxy.mItemDespawnTime = tMainConfig.get("general", "ItemDespawnTime", 6000).getInt(6000); gregtechproxy.mDisableVanillaOres = tMainConfig.get("general", "DisableVanillaOres", true).getBoolean(true); + gregtechproxy.mDisableModdedOres = tMainConfig.get("general", "DisableModdedOres", true).getBoolean(true); gregtechproxy.mNerfDustCrafting = tMainConfig.get("general", "NerfDustCrafting", true).getBoolean(true); gregtechproxy.mIncreaseDungeonLoot = tMainConfig.get("general", "IncreaseDungeonLoot", true).getBoolean(true); gregtechproxy.mAxeWhenAdventure = tMainConfig.get("general", "AdventureModeStartingAxe", true).getBoolean(true); diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 1ba6285a..688df7db 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -711,7 +711,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { @Deprecated Wolframite (Tungstate, false), @Deprecated Wolframium (Tungsten, false), @Deprecated Wolfram (Tungsten, false), - ; + ; /** List of all Materials. */ public static final Collection VALUES = new HashSet(Arrays.asList(values())); @@ -1036,6 +1036,8 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { Silicon .addOreByProducts(SiliconDioxide ); Salt .addOreByProducts(RockSalt ); RockSalt .addOreByProducts(Salt ); + Andesite .addOreByProducts(Basalt ); + Diorite .addOreByProducts(NetherQuartz ); Glue.mChemicalFormula = "No Horses were harmed for the Production"; UUAmplifier.mChemicalFormula = "Accelerates the Mass Fabricator"; @@ -1144,6 +1146,8 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { GraniteBlack .add(SubTag.STONE, SubTag.NO_SMASHING); Salt .add(SubTag.STONE, SubTag.NO_SMASHING); RockSalt .add(SubTag.STONE, SubTag.NO_SMASHING); + Andesite .add(SubTag.STONE, SubTag.NO_SMASHING); + Diorite .add(SubTag.STONE, SubTag.NO_SMASHING); Sand .add(SubTag.NO_RECYCLING); @@ -1284,10 +1288,6 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { mToolSpeed = aToolSpeed; mIconSet = aIconSet; - //mOreTextureSet = new GT_RenderedTexture[2]; - //mOreTextureSet[0] = new GT_RenderedTexture(mIconSet.mTextures[68], mRGBa); //normal ore - //mOreTextureSet[1] = new GT_RenderedTexture(mIconSet.mTextures[67], mRGBa); //small ore - if (aMetaItemSubID >= 0) { if (GregTech_API.sGeneratedMaterials[aMetaItemSubID] == null) { GregTech_API.sGeneratedMaterials[aMetaItemSubID] = this; @@ -1305,10 +1305,6 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { mChemicalFormula = aMaterialInto.mChemicalFormula; mMetaItemSubID = -1; mIconSet = TextureSet.SET_NONE; - - //mOreTextureSet = new GT_RenderedTexture[2]; - //mOreTextureSet[0] = new GT_RenderedTexture(mIconSet.mTextures[68], mRGBa); //normal ore - //mOreTextureSet[1] = new GT_RenderedTexture(mIconSet.mTextures[67], mRGBa); //small ore } /** diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index a3c7eb53..06dd2dfd 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -467,6 +467,8 @@ public enum OrePrefixes { dustImpure.mGeneratedItems.add(Materials.Netherrack); dustImpure.mGeneratedItems.add(Materials.Endstone); dustImpure.mGeneratedItems.add(Materials.Stone); + dustImpure.mGeneratedItems.add(Materials.Andesite); + dustImpure.mGeneratedItems.add(Materials.Diorite); plate.mGeneratedItems.add(Materials.Redstone); plate.mGeneratedItems.add(Materials.Concrete); @@ -475,6 +477,8 @@ public enum OrePrefixes { plate.mGeneratedItems.add(Materials.Glowstone); plate.mGeneratedItems.add(Materials.Nikolite); plate.mGeneratedItems.add(Materials.Obsidian); + plate.mGeneratedItems.add(Materials.Andesite); + plate.mGeneratedItems.add(Materials.Diorite); plate.mGeneratedItems.add(Materials.Paper); plateDouble.mGeneratedItems.add(Materials.Paper); diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java index a35ff549..b396c078 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java @@ -6,6 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; @@ -19,6 +20,9 @@ import net.minecraftforge.fluids.IFluidHandler; * Note: It doesn't have to be a TileEntity in certain cases! And only certain cases, such as the Recipe checking of the findRecipe Function. */ public interface IHasWorldObjectAndCoords { + + static BlockPos.MutableBlockPos t = new BlockPos.MutableBlockPos(); + public World getWorld(); public BlockPos getPos(); @@ -67,27 +71,61 @@ public interface IHasWorldObjectAndCoords { public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance); - public Block getBlock(int aX, int aY, int aZ); + public default Block getBlock(int aX, int aY, int aZ) { + return getBlockState(t.setPos(aX, aY, aZ)).getBlock(); + } + + public default IBlockState getBlockState(BlockPos pos) { + return getWorld().getBlockState(pos); + } + + public default boolean setBlockState(BlockPos pos, IBlockState state) { + return getWorld().setBlockState(pos, state); + } + + public default boolean setBlockToAir(BlockPos pos) { + return getWorld().setBlockToAir(pos); + } public default Block getBlockOffset(int aX, int aY, int aZ) { return getBlockStateOffset(aX, aY, aZ).getBlock(); } public default IBlockState getBlockStateOffset(int aX, int aY, int aZ) { - return getWorld().getBlockState(new BlockPos(getXCoord() + aX, getYCoord() + aY, getZCoord() + aZ)); + return getBlockState(t.setPos(getPos()).add(aX, aY, aZ)); } - public Block getBlockAtSide(byte aSide); + public default Block getBlockAtSide(byte aSide) { + return getBlockState(t.setPos(getPos()).offset(EnumFacing.VALUES[aSide])).getBlock(); + } - public Block getBlockAtSideAndDistance(byte aSide, int aDistance); + public default Block getBlockAtSideAndDistance(byte aSide, int aDistance) { + return getBlockState(t.setPos(getPos()).offset(EnumFacing.VALUES[aSide], aDistance)).getBlock(); + } - public byte getMetaID(int aX, int aY, int aZ); + public default byte getMetaID(int aX, int aY, int aZ) { + IBlockState state = getBlockState(t.setPos(aX, aY, aZ)); + return (byte) state.getBlock().getMetaFromState(state); + } - public byte getMetaIDOffset(int aX, int aY, int aZ); + public default byte getMetaIDOffset(int aX, int aY, int aZ) { + IBlockState state = getBlockStateOffset(aX, aY, aZ); + return (byte) state.getBlock().getMetaFromState(state); + } - public byte getMetaIDAtSide(byte aSide); + public default byte getMetaIDAtSide(byte aSide) { + IBlockState state = getBlockState(t.setPos(getPos()).offset(EnumFacing.VALUES[aSide])); + return (byte) state.getBlock().getMetaFromState(state); + } - public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance); + public default byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) { + IBlockState state = getBlockState(t.setPos(getPos()).offset(EnumFacing.VALUES[aSide], aDistance)); + return (byte) state.getBlock().getMetaFromState(state); + } + + public default boolean isAir(BlockPos pos) { + return getWorld().isAirBlock(pos); + } public byte getLightLevel(int aX, int aY, int aZ); diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 97362e7b..aa7029f6 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -19,6 +19,7 @@ import ic2.core.ref.FluidName; import ic2.core.ref.ItemName; import ic2.core.ref.TeBlock; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -111,6 +112,10 @@ public class GT_ModHandler { sSpecialRecipeClasses.add("shedar.mods.ic2.nuclearcontrol.StorageArrayRecipe"); } + public static IBlockState getIC2BlockState(BlockName blockName, T type) { + return blockName.getBlockState(type); + } + public static ItemStack getIC2Item(ItemName itemName, int amount) { ItemStack stack = itemName.getItemStack(); stack.stackSize = amount; diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index fb30c3ed..c1ef35dc 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -9,6 +9,7 @@ import gregtech.api.objects.GT_HashSet; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -69,7 +70,7 @@ public class GT_OreDictUnificator { if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack); addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack)); if (aOverwrite || GT_Utility.isStackInvalid(sName2StackMap.get(aPrefix.get(aMaterial).toString()))) - sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack); + if(!isBlacklisted(aStack)) sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack); isAddingOre--; } @@ -135,8 +136,10 @@ public class GT_OreDictUnificator { if (GT_Utility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); ItemStack rStack = null; + if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GT_Utility.copy(aStack); + if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; return GT_Utility.copy(aStack); @@ -203,6 +206,11 @@ public class GT_OreDictUnificator { return rData; } + public static ItemData getAssociation(IBlockState blockState) { + ItemStack itemStack = new ItemStack(blockState.getBlock(), 1, blockState.getBlock().getMetaFromState(blockState)); + return getAssociation(itemStack); + } + public static ItemData getAssociation(ItemStack aStack) { ItemData rData = getItemData(aStack); return rData != null && rData.hasValidPrefixMaterialData() ? rData : null; diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index fd0859c8..9b53a77d 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -980,7 +980,7 @@ public class GT_Utility { } public static Block getBlockFromStack(Object aStack) { - if (isStackInvalid(aStack)) return Blocks.AIR; + if (isStackInvalid(aStack)) return null; return Block.getBlockFromItem(((ItemStack) aStack).getItem()); } diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index a061cde3..929f9181 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -16,15 +16,12 @@ import gregtech.api.util.*; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.armor.*; -import ic2.core.block.type.ResourceBlock; import ic2.core.block.wiring.CableType; -import ic2.core.item.ItemFluidCell; +import ic2.core.item.ItemIC2FluidContainer; import ic2.core.item.type.*; -import ic2.core.ref.BlockName; -import ic2.core.ref.FluidName; import ic2.core.ref.ItemName; import ic2.core.util.Ic2Color; -import net.minecraft.enchantment.Enchantment; +import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -35,6 +32,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.*; import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; @@ -49,7 +47,6 @@ import net.minecraft.world.GameType; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.player.ArrowLooseEvent; @@ -62,16 +59,14 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.common.FMLCommonHandler; -import net.minecraftforge.fml.common.IFuelHandler; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModContainer; +import net.minecraftforge.fml.common.*; import net.minecraftforge.fml.common.eventhandler.Event.Result; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent; import net.minecraftforge.fml.common.network.IGuiHandler; import net.minecraftforge.fml.common.network.NetworkRegistry; +import net.minecraftforge.fml.common.registry.GameData; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.RecipeSorter; @@ -139,6 +134,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public ArrayList mBufferedPlayerActivity = new ArrayList(); public boolean mHardcoreCables = false; public boolean mDisableVanillaOres = true; + public boolean mDisableModdedOres = true; public boolean mNerfDustCrafting = true; public boolean mSortToTheEnd = true; public boolean mCraftingUnification = true; @@ -872,9 +868,21 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onOreGenEvent(OreGenEvent.GenerateMinable aGenerator) { - if ((this.mDisableVanillaOres) && ((aGenerator.getGenerator() instanceof WorldGenMinable)) - && (PREVENTED_ORES.contains(aGenerator.getType()))) { - aGenerator.setResult(Result.DENY); + if (aGenerator.getGenerator() instanceof WorldGenMinable) { + if (PREVENTED_ORES.contains(aGenerator.getType())) { + if (mDisableVanillaOres) { + aGenerator.setResult(Result.DENY); + } + return; + } + if (mDisableModdedOres) { + WorldGenMinable worldGenMinable = (WorldGenMinable) aGenerator.getGenerator(); + IBlockState oreBlock = ObfuscationReflectionHelper.getPrivateValue(WorldGenMinable.class, worldGenMinable, 0); + ItemData itemData = GT_OreDictUnificator.getAssociation(oreBlock); + if(itemData != null && itemData.mPrefix.toString().startsWith("ore") && (itemData.mMaterial.mMaterial.mTypes & 0x08) != 0) { + aGenerator.setResult(Result.DENY); + } + } } } @@ -955,11 +963,16 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return; } } + if(aEvent.getOre().getItem() instanceof ItemIC2FluidContainer) { + System.out.println("Ignoring IC2 fluid container " + aEvent.getOre() + " registration as " + aEvent.getName() + " because ic2 fluid containers are mad."); + GT_OreDictUnificator.addToBlacklist(aEvent.getOre()); + return; + } String tModToName = aMod + " -> " + aEvent.getName(); if ((this.mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((this.mSortToTheEnd) && (GregTech_API.sLoadFinished))) { tModToName = aOriginalMod + " --Late--> " + aEvent.getName(); } - if (((aEvent.getOre().getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.getOre()) != Blocks.AIR)) { + if (((aEvent.getOre().getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.getOre()) != null)) { GT_OreDictUnificator.addToBlacklist(aEvent.getOre()); } this.mRegisteredOres.add(aEvent.getOre()); @@ -1274,15 +1287,15 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return; } } else { - for (Dyes tDye : Dyes.VALUES) { - if (aEvent.getName().endsWith(tDye.name().replaceFirst("dye", ""))) { - GT_OreDictUnificator.addToBlacklist(aEvent.getOre()); - GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is."); - return; - } - } - System.out.println("Material Name: "+aEvent.getName()+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); - GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech."); + //for (Dyes tDye : Dyes.VALUES) { + // if (aEvent.getName().endsWith(tDye.name().replaceFirst("dye", ""))) { + // GT_OreDictUnificator.addToBlacklist(aEvent.getOre()); + // GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is."); + // return; + // } + //} + //System.out.println("Material Name: "+aEvent.getName()+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me."); + //GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech."); return; } } else { diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 0233ca12..96255b0c 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -204,7 +204,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { return false; } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, new ItemStack[]{aInput1, (ItemStack) (aInput2 == null ? new ItemStack[]{aInput1} : aInput2)}, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, null, aDuration, aEUt, 0); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInput2 == null ? new ItemStack[] {aInput1} : new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, null, aDuration, aEUt, 0); return true; } diff --git a/src/main/java/gregtech/common/render/ModelUtil.java b/src/main/java/gregtech/common/render/ModelUtil.java index d5f15958..2da52a06 100644 --- a/src/main/java/gregtech/common/render/ModelUtil.java +++ b/src/main/java/gregtech/common/render/ModelUtil.java @@ -2,11 +2,13 @@ package gregtech.common.render; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemTransformVec3f; import net.minecraft.client.renderer.block.model.ModelBlock; import net.minecraft.client.resources.IResource; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import org.lwjgl.util.vector.Vector3f; import java.io.IOException; import java.io.InputStreamReader; @@ -21,6 +23,21 @@ public class ModelUtil { public static ItemCameraTransforms HANDHELD_TRANSFORMS = getTransformsFromModel("models/item/handheld.json"); public static ItemCameraTransforms BLOCK_TRANSFORMS = getTransformsFromModel("models/block/block.json"); + static { + ItemTransformVec3f vec = HANDHELD_TRANSFORMS.ground; + ItemTransformVec3f newVec = new ItemTransformVec3f(vec.rotation, vec.translation, new Vector3f(0.5f, 0.5f, 0.5f)); + HANDHELD_TRANSFORMS = new ItemCameraTransforms( + HANDHELD_TRANSFORMS.thirdperson_left, + HANDHELD_TRANSFORMS.thirdperson_right, + HANDHELD_TRANSFORMS.firstperson_left, + HANDHELD_TRANSFORMS.firstperson_right, + HANDHELD_TRANSFORMS.head, + HANDHELD_TRANSFORMS.gui, + newVec, + HANDHELD_TRANSFORMS.fixed + ); + } + public static ItemCameraTransforms getTransformsFromModel(String path) { try { ResourceLocation location = new ResourceLocation(path); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java index aa56cafb..bd6210f9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java @@ -1,27 +1,45 @@ package gregtech.common.tileentities.machines.basic; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_BasicTank; import gregtech.api.gui.GT_GUIContainer_BasicTank; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_AdvMiner2; +import ic2.core.block.machine.BlockMiningPipe; +import ic2.core.ref.BlockName; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidBlock; + +import java.util.ArrayList; +import java.util.Iterator; import static gregtech.api.enums.GT_Values.V; public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { - //public ArrayList mPumpList = new ArrayList<>(); - //public int mPumpTimer = 0; - //public int mPumpCountBelow = 0; + private static IBlockState miningPipe = GT_ModHandler.getIC2BlockState(BlockName.mining_pipe, BlockMiningPipe.MiningPipeType.pipe); + private static IBlockState miningPipeTip = GT_ModHandler.getIC2BlockState(BlockName.mining_pipe, BlockMiningPipe.MiningPipeType.tip); + + public ArrayList mPumpList = new ArrayList<>(); + public int mPumpTimer = 0; + public int mPumpCountBelow = 0; public Block mPumpedBlock1 = null; public Block mPumpedBlock2 = null; @@ -98,7 +116,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - /*if (getBaseMetaTileEntity().isServerSide()) { + if (getBaseMetaTileEntity().isServerSide()) { this.mPumpTimer -= 1; if ((getBaseMetaTileEntity() instanceof BaseTileEntity)) { ((BaseTileEntity) getBaseMetaTileEntity()).ignoreUnloadedChunks = false; @@ -120,33 +138,29 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { tMovedOneDown = moveOneDown(); } if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { - getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead() - 1, getBaseMetaTileEntity().getZCoord()); + getFluidAt(getYOfPumpHead().down()); if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { - getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() + 1); + getFluidAt(getYOfPumpHead().east()); } if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { - getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() - 1); + getFluidAt(getYOfPumpHead().west()); } if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { - getFluidAt(getBaseMetaTileEntity().getXCoord() + 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord()); + getFluidAt(getYOfPumpHead().south()); } if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) { - getFluidAt(getBaseMetaTileEntity().getXCoord() - 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord()); + getFluidAt(getYOfPumpHead().north()); } - } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) { + } else if (getYOfPumpHead().getY() < getBaseMetaTileEntity().getYCoord()) { if ((tMovedOneDown) || ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) || (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) { this.mPumpList.clear(); int y = getBaseMetaTileEntity().getYCoord() - 1; - for (int yHead = getYOfPumpHead(); (this.mPumpList.isEmpty()) && (y >= yHead); y--) { + for (int yHead = getYOfPumpHead().getY(); (this.mPumpList.isEmpty()) && (y >= yHead); y--) { scanForFluid(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), this.mPumpList, getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), 10 * ((int) Math.pow(1.6, this.mTier))); } } - if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) { - while ((!this.mPumpList.isEmpty()) - && (!consumeFluid(((ChunkPos) this.mPumpList.get(this.mPumpList.size() - 1)).chunkXPos, - 0, - this.mPumpList.remove(this.mPumpList.size() - 1).chunkZPos))) { - } + if (!tMovedOneDown && this.mPumpTimer <= 0) { + while (!this.mPumpList.isEmpty() && !consumeFluid(this.mPumpList.get(this.mPumpList.size() - 1))) {} this.mPumpTimer = 160 / ((int) Math.pow(2, this.mTier)); } } @@ -158,69 +172,66 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { private boolean moveOneDown() { if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1) - || (!GT_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L)))) { + || (!GT_Utility.areStacksEqual(this.mInventory[0], BlockName.mining_pipe.getItemStack(BlockMiningPipe.MiningPipeType.pipe)))) { return false; } - int yHead = getYOfPumpHead(); - if (yHead <= 0) { + BlockPos yHead = getYOfPumpHead(); + if (yHead.getY() <= 0) { return false; } - if ((!consumeFluid(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord())) && (!getBaseMetaTileEntity().getAir(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord()))) { - + if (!consumeFluid(yHead.down()) && !getBaseMetaTileEntity().isAir(yHead.down())) { return false; } - if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord(), GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) { + if (!getBaseMetaTileEntity().setBlockState(yHead.down(), miningPipeTip)) { return false; } - if (yHead != getBaseMetaTileEntity().getYCoord()) { - getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead, getBaseMetaTileEntity().getZCoord(), GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))); + if (yHead.getY() != getBaseMetaTileEntity().getYCoord()) { + getBaseMetaTileEntity().setBlockState(yHead, miningPipeTip); } getBaseMetaTileEntity().decrStackSize(0, 1); return true; } - private int getYOfPumpHead() { - int y = getBaseMetaTileEntity().getYCoord() - 1; - while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) == GT_Utility - .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) { - y--; + private BlockPos getYOfPumpHead() { + BlockPos yPos = new BlockPos.MutableBlockPos(getBaseMetaTileEntity().getPos()).down(); + while (getBaseMetaTileEntity().getBlockState(yPos) == miningPipe) { + yPos.down(); } - if (y == getBaseMetaTileEntity().getYCoord() - 1) { - if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility - .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) { - return y + 1; + + if (yPos.getY() == getBaseMetaTileEntity().getYCoord() - 1) { + if (getBaseMetaTileEntity().getBlockState(yPos) != miningPipeTip) { + return yPos.up().toImmutable(); } - } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility - .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)) && this.mInventory[0] != null && this.mInventory[0].stackSize > 0 && GT_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L))) { - getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), - GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); + + } else if (getBaseMetaTileEntity().getBlockState(yPos) != miningPipeTip && this.mInventory[0] != null && this.mInventory[0].stackSize > 0 && GT_Utility.areStacksEqual(this.mInventory[0], BlockName.mining_pipe.getItemStack(BlockMiningPipe.MiningPipeType.pipe))) { + getBaseMetaTileEntity().setBlockState(yPos, miningPipeTip); getBaseMetaTileEntity().decrStackSize(0, 1); } - return y; + return yPos.toImmutable(); } - private void scanForFluid(int aX, int aY, int aZ, ArrayList aList, int mX, int mZ, int mDist) { + private void scanForFluid(int aX, int aY, int aZ, ArrayList aList, int mX, int mZ, int mDist) { doTickProfilingInThisTick = false; ArrayList tList1 = new ArrayList(); ArrayList tList2 = new ArrayList(); - tList1.add(new ChunkPos(aX, aY, aZ)); + tList1.add(new BlockPos(aX, aY, aZ)); while (!tList1.isEmpty()) { Iterator i$ = tList1.iterator(); do { if (!i$.hasNext()) break; - ChunkPos tPos = (ChunkPos) i$.next(); - if (tPos.chunkPosX < mX + mDist) - addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX + 1, tPos.chunkPosY, tPos.chunkPosZ, tList2, aList); - if (tPos.chunkPosX > mX - mDist) - addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX - 1, tPos.chunkPosY, tPos.chunkPosZ, tList2, aList); - if (tPos.chunkPosZ < mZ + mDist) - addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ + 1, tList2, aList); - if (tPos.chunkPosZ > mZ - mDist) - addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ - 1, tList2, aList); - addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY + 1, tPos.chunkPosZ, tList2, aList); - ChunkPos tCoordinate = new ChunkPos(aX, aY + 1, aZ); - if (tPos.chunkPosX == mX && tPos.chunkPosZ == mZ && tPos.chunkPosY < getBaseMetaTileEntity().getYCoord() && !aList.contains(tCoordinate) && !tList2.contains(tCoordinate)) + BlockPos tPos = (BlockPos) i$.next(); + if (tPos.getX() < mX + mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.getX() + 1, tPos.getY(), tPos.getZ(), tList2, aList); + if (tPos.getX() > mX - mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.getX() - 1, tPos.getY(), tPos.getZ(), tList2, aList); + if (tPos.getZ() < mZ + mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.getX(), tPos.getY(), tPos.getZ() + 1, tList2, aList); + if (tPos.getZ() > mZ - mDist) + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.getX(), tPos.getY(), tPos.getZ() - 1, tList2, aList); + addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.getX(), tPos.getY() + 1, tPos.getZ(), tList2, aList); + BlockPos tCoordinate = new BlockPos(aX, aY + 1, aZ); + if (tPos.getX() == mX && tPos.getZ() == mZ && tPos.getY() < getBaseMetaTileEntity().getYCoord() && !aList.contains(tCoordinate) && !tList2.contains(tCoordinate)) tList2.add(tCoordinate); } while (true); aList.addAll(tList2); @@ -228,12 +239,12 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { tList2 = new ArrayList(); } for (int y = getBaseMetaTileEntity().getYCoord(); y >= aY; y--) - aList.remove(new ChunkPos(aX, y, aZ)); + aList.remove(new BlockPos(aX, y, aZ)); } - private boolean addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(int aX, int aY, int aZ, ArrayList aList1, - ArrayList aList2) { - ChunkPos tCoordinate = new ChunkPos(aX, aY, aZ); + private boolean addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(int aX, int aY, int aZ, ArrayList aList1, + ArrayList aList2) { + BlockPos tCoordinate = new BlockPos(aX, aY, aZ); if ((!aList1.contains(tCoordinate)) && (!aList2.contains(tCoordinate))) { Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); if ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock)) { @@ -244,17 +255,17 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { return false; } - private void getFluidAt(int aX, int aY, int aZ) { - Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); + private void getFluidAt(BlockPos pos) { + Block aBlock = getBaseMetaTileEntity().getBlockState(pos).getBlock(); if (GT_Utility.isBlockValid(aBlock)) { - if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) { - this.mPumpedBlock1 = Blocks.water; - this.mPumpedBlock2 = Blocks.flowing_water; + if ((aBlock == Blocks.WATER) || (aBlock == Blocks.FLOWING_WATER)) { + this.mPumpedBlock1 = Blocks.WATER; + this.mPumpedBlock2 = Blocks.FLOWING_WATER; return; } - if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) { - this.mPumpedBlock1 = Blocks.lava; - this.mPumpedBlock2 = Blocks.flowing_lava; + if ((aBlock == Blocks.LAVA) || (aBlock == Blocks.FLOWING_LAVA)) { + this.mPumpedBlock1 = Blocks.LAVA; + this.mPumpedBlock2 = Blocks.FLOWING_LAVA; return; } if ((aBlock instanceof IFluidBlock)) { @@ -267,11 +278,12 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { this.mPumpedBlock2 = null; } - private boolean consumeFluid(int aX, int aY, int aZ) { - Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); - int aMeta = getBaseMetaTileEntity().getMetaID(aX, aY, aZ); + private boolean consumeFluid(BlockPos pos) { + IBlockState fluidState = getBaseMetaTileEntity().getBlockState(pos); + Block aBlock = fluidState.getBlock(); + int aMeta = fluidState.getBlock().getMetaFromState(fluidState); if ((GT_Utility.isBlockValid(aBlock)) && ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock))) { - if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) { + if ((aBlock == Blocks.WATER) || (aBlock == Blocks.FLOWING_WATER)) { if (aMeta == 0) { if (this.mFluid == null) { getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true); @@ -286,7 +298,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { getBaseMetaTileEntity().decreaseStoredEnergyUnits(4 * ((int) Math.pow(4, this.mTier)), true); } } - if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) { + if ((aBlock == Blocks.LAVA) || (aBlock == Blocks.FLOWING_LAVA)) { if (aMeta == 0) { if (this.mFluid == null) { getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true); @@ -303,21 +315,21 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } if ((aBlock instanceof IFluidBlock)) { if (this.mFluid == null) { - this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true); + this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), pos, true); getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mFluid == null ? 1000 : this.mFluid.amount, true); - } else if (this.mFluid.isFluidEqual(((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))) { - this.getBaseMetaTileEntity().getWorld().setBlockToAir(aX, aY, aZ); + } else if (this.mFluid.isFluidEqual(((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), pos, false))) { + this.getBaseMetaTileEntity().setBlockToAir(pos); this.mFluid.amount += 1000; getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true); } else { return false; } } - getBaseMetaTileEntity().getWorld().setBlock(aX, aY, aZ, Blocks.air, 0, 2); + this.getBaseMetaTileEntity().setBlockToAir(pos); return true; } return false; - */} + } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, EnumHand hand) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java index 8b1afe40..f6036967 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java @@ -16,12 +16,14 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_GeneratedOres; import ic2.core.block.machine.BlockMiningPipe; import ic2.core.ref.BlockName; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; @@ -38,7 +40,6 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas private final ArrayList mMineList = new ArrayList(); - private boolean completedCycle = false; public GT_MetaTileEntity_AdvMiner2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -80,7 +81,6 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas if (tStack.isItemEqual(mining_pipe)) { tStack.stackSize--; if (tStack.stackSize < 1) { - tStack = null; } if (mInventory[1] == null) { mInventory[1] = mining_pipe; @@ -111,13 +111,11 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas for (int f = -48; f < 49; f++) { Block tBlock = getBaseMetaTileEntity().getBlockOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f); int tMetaID = getBaseMetaTileEntity().getMetaIDOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f); - // if (tBlock instanceof GT_Block_Ores_Abstract) { - // TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f); - // if ((tTileEntity!=null) && (tTileEntity instanceof GT_TileEntity_Ores) && ((GT_TileEntity_Ores) tTileEntity).mNatural == true && !mMineList.contains(new BlockPos(i, yLevel - getBaseMetaTileEntity().getYCoord(), f))) { - // mMineList.add(new BlockPos(i, yLevel - getBaseMetaTileEntity().getYCoord(), f)); - // } - // } - //else { + if (tBlock instanceof GT_Block_GeneratedOres) { + if (tBlock instanceof GT_Block_GeneratedOres && !mMineList.contains(new BlockPos(i, yLevel - getBaseMetaTileEntity().getYCoord(), f))) { + mMineList.add(new BlockPos(i, yLevel - getBaseMetaTileEntity().getYCoord(), f)); + } + } else { ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { BlockPos cp = new BlockPos(i, yLevel - getBaseMetaTileEntity().getYCoord(), f); @@ -125,7 +123,7 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas mMineList.add(cp); } } - // } + } } } } diff --git a/src/main/java/gregtech/loaders/load/GT_ItemIterator.java b/src/main/java/gregtech/loaders/load/GT_ItemIterator.java index 40fdec8d..805e984b 100644 --- a/src/main/java/gregtech/loaders/load/GT_ItemIterator.java +++ b/src/main/java/gregtech/loaders/load/GT_ItemIterator.java @@ -3,6 +3,7 @@ package gregtech.loaders.load; import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.items.GT_Generic_Item; +import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -98,7 +99,7 @@ public class GT_ItemIterator GT_Values.RA.addCannerRecipe(new ItemStack(tItem, 1, 32767), ItemList.IC2_Food_Can_Empty.get(tFoodValue, new Object[0]), ItemList.IC2_Food_Can_Filled.get(tFoodValue, new Object[0]), GT_Utility.getContainerItem(new ItemStack(tItem, 1, 0), true), tFoodValue * 100, 1); } } - if ((tItem instanceof IFluidContainerItem)) { + if (tItem instanceof IFluidContainerItem) { GT_OreDictUnificator.addToBlacklist(new ItemStack(tItem, 1, 32767)); } if ((tName.equals("item.ItemSensorLocationCard")) || (tName.equals("item.ItemEnergySensorLocationCard")) || (tName.equals("item.ItemEnergyArrayLocationCard")) || (tName.equals("item.ItemTextCard"))) { diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java index a3df8819..cef7d273 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java @@ -97,7 +97,6 @@ public class ProcessingDust implements gregtech.api.interfaces.IOreRecipeRegistr } } if ((aMaterial.mExtraData & 0x1) != 0) - System.out.println("Electrolyzer for " + aMaterial + " " + tList.size()); GT_Values.RA.addElectrolyzerRecipe(GT_Utility.copyAmount(tItemAmount, aStack), tCapsuleCount > 0L ? ItemList.Cell_Empty.get(tCapsuleCount) : null, null, tFluid, tList.get(0), tList.size() < 2 ? null : tList.get(1), tList.size() < 3 ? null : tList.get(2), tList.size() < 4 ? null : tList.get(3), tList.size() < 5 ? null : tList.get(4), tList.size() < 6 ? null : tList.get(5), null, (int) Math.max(1L, Math.abs(aMaterial.getProtons() * 2L * tItemAmount)), Math.min(4, tList.size()) * 30); if ((aMaterial.mExtraData & 0x2) != 0) { GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(tItemAmount, aStack), tCapsuleCount > 0L ? ItemList.Cell_Empty.get(tCapsuleCount) : null, null, tFluid, tList.get(0), tList.size() < 2 ? null : tList.get(1), tList.size() < 3 ? null : tList.get(2), tList.size() < 4 ? null : tList.get(3), tList.size() < 5 ? null : tList.get(4), tList.size() < 6 ? null : tList.get(5), null, (int) Math.max(1L, Math.abs(aMaterial.getMass() * 4L * tItemAmount)), Math.min(4, tList.size()) * 5); diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate1.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate1.java index 0fa54028..5b22734c 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate1.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate1.java @@ -68,6 +68,12 @@ public class ProcessingPlate1 implements gregtech.api.interfaces.IOreRecipeRegis case GraniteRed: GregTech_API.registerCover(aStack, new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.GRANITE_RED_SMOOTH), null); break; + case Andesite: + GregTech_API.registerCover(aStack, new GT_RenderedTexture(new RegIconContainer("blocks/stone_andesite")), null); + break; + case Diorite: + GregTech_API.registerCover(aStack, new GT_RenderedTexture(new RegIconContainer("blocks/stone_diorite")), null); + break; case Concrete: GregTech_API.registerCover(aStack, new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.CONCRETE_LIGHT_SMOOTH), null); break; diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStone.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStone.java index 2292e3c5..8f6ea0ce 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStone.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStone.java @@ -57,7 +57,6 @@ public class ProcessingStone GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Biotite, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Uranium, 1), 5, false); break; case Dacite: - case Andesite: GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Obsidian, 1), 20, false); break; case Gabbro: @@ -93,6 +92,11 @@ public class ProcessingStone case GraniteRed: GT_Values.RA.addCutterRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1), null, 200, 32); GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Uranium, 1), 1, false); + case Andesite: + case Diorite: + GT_Values.RA.addCutterRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1), null, 200, 32); + GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Stone, 1), 1, false); + break; } } } diff --git a/src/main/java/gregtech/loaders/postload/ChestGenHooks.java b/src/main/java/gregtech/loaders/postload/ChestGenHooks.java index 997fefbb..b8c2e913 100644 --- a/src/main/java/gregtech/loaders/postload/ChestGenHooks.java +++ b/src/main/java/gregtech/loaders/postload/ChestGenHooks.java @@ -1,7 +1,7 @@ package gregtech.loaders.postload; -import com.google.common.cache.LoadingCache; import com.google.common.collect.Lists; +import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.world.storage.loot.*; @@ -9,7 +9,6 @@ import net.minecraft.world.storage.loot.conditions.LootCondition; import net.minecraft.world.storage.loot.functions.LootFunction; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.LootTableLoadEvent; -import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -21,6 +20,9 @@ import java.util.Random; public class ChestGenHooks { private static final HashMap> lootEntryItems = new HashMap<>(); + private static final HashMap rollVals = new HashMap<>(); + + private static final LootCondition[] NO_CONDITIONS = new LootCondition[0]; public ChestGenHooks() { @@ -28,20 +30,19 @@ public class ChestGenHooks { } @SubscribeEvent - public void onWorldLoad(WorldEvent.Load worldEvent) { - LootTableManager tableManager = worldEvent.getWorld().getLootTableManager(); - LoadingCache lootTablesCache = ObfuscationReflectionHelper.getPrivateValue(LootTableManager.class, tableManager, 2); - for(ResourceLocation tableLocation : lootTablesCache.asMap().keySet()) { - if(lootEntryItems.containsKey(tableLocation)) { - ArrayList items = lootEntryItems.get(tableLocation); - LootTable lootTable = lootTablesCache.getUnchecked(tableLocation); - List pools = ObfuscationReflectionHelper.getPrivateValue(LootTable.class, lootTable, 2); - pools.add(new LootPool( - items.toArray(new LootEntryItem[items.size()]), NO_CONDITIONS, - new RandomValueRange(items.size()), - new RandomValueRange(0.2F), "Gregtech Loot")); + public void onWorldLoad(LootTableLoadEvent event) { + LootPool mainPool = event.getTable().getPool("main"); + if(mainPool != null && lootEntryItems.containsKey(event.getName())) { + ArrayList entryItems = lootEntryItems.get(event.getName()); + for(LootEntryItem entry : entryItems) { + mainPool.addEntry(entry); } } + if(mainPool != null && rollVals.containsKey(event.getName())) { + RandomValueRange rangeAdd = rollVals.get(event.getName()); + RandomValueRange range = mainPool.getRolls(); + mainPool.setRolls(new RandomValueRange(range.getMin() + rangeAdd.getMin(), range.getMax() + rangeAdd.getMax())); + } } public static void addItem(ResourceLocation loottable, ItemStack item, int minChance, int maxChance, int weight) { @@ -54,7 +55,7 @@ public class ChestGenHooks { return stack; } } - }, NO_CONDITIONS, "Gregtech loot"); + }, NO_CONDITIONS, "#loot_" + GT_Utility.stackToIntHash(item)); if(lootEntryItems.containsKey(loottable)) { lootEntryItems.get(loottable).add(itemEntry); } else { @@ -62,6 +63,10 @@ public class ChestGenHooks { } } + public static void addRolls(ResourceLocation tableLocation, int minAdd, int maxAdd) { + rollVals.put(tableLocation, new RandomValueRange(minAdd, maxAdd)); + } + diff --git a/src/main/java/gregtech/loaders/postload/GT_BookAndLootLoader.java b/src/main/java/gregtech/loaders/postload/GT_BookAndLootLoader.java index 88bec7e8..ec091a7d 100644 --- a/src/main/java/gregtech/loaders/postload/GT_BookAndLootLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_BookAndLootLoader.java @@ -15,72 +15,52 @@ public class GT_BookAndLootLoader public void run() { GT_Log.out.println("GT_Mod: Adding worldgenerated Chest Content."); + new ChestGenHooks(); + if (GT_Mod.gregtechproxy.mIncreaseDungeonLoot) { - /*ChestGenHooks tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_SPAWN_BONUS_CHEST); - tChest.setMax(tChest.getMax() + 8); - tChest.setMin(tChest.getMin() + 4); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_SIMPLE_DUNGEON); - tChest.setMax(tChest.getMax() + 6); - tChest.setMin(tChest.getMin() + 3); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_DESERT_PYRAMID); - tChest.setMax(tChest.getMax() + 8); - tChest.setMin(tChest.getMin() + 4); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_JUNGLE_TEMPLE); - tChest.setMax(tChest.getMax() + 16); - tChest.setMin(tChest.getMin() + 8); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER); - tChest.setMax(tChest.getMax() + 2); - tChest.setMin(tChest.getMin() + 1); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_ABANDONED_MINESHAFT); - tChest.setMax(tChest.getMax() + 4); - tChest.setMin(tChest.getMin() + 2); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_VILLAGE_BLACKSMITH); - tChest.setMax(tChest.getMax() + 12); - tChest.setMin(tChest.getMin() + 6); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_STRONGHOLD_CROSSING); - tChest.setMax(tChest.getMax() + 8); - tChest.setMin(tChest.getMin() + 4); - tChest = ChestGenHooks.getInfo(LootTableList.CHESTS_STRONGHOLD_CORRIDOR); - tChest.setMax(tChest.getMax() + 6); - tChest.setMin(tChest.getMin() + 3); - tChest = ChestGenHooks.getInfo("strongholdLibrary"); - tChest.setMax(tChest.getMax() + 16); - tChest.setMin(tChest.getMin() + 8); - TODO fix - */ + ChestGenHooks.addRolls(LootTableList.CHESTS_SPAWN_BONUS_CHEST, 1, 2); + ChestGenHooks.addRolls(LootTableList.CHESTS_SIMPLE_DUNGEON, 0, 1); + ChestGenHooks.addRolls(LootTableList.CHESTS_DESERT_PYRAMID, 1, 2); + ChestGenHooks.addRolls(LootTableList.CHESTS_JUNGLE_TEMPLE, 2, 4); + ChestGenHooks.addRolls(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER, 0, 1); + ChestGenHooks.addRolls(LootTableList.CHESTS_ABANDONED_MINESHAFT, 0, 1); + ChestGenHooks.addRolls(LootTableList.CHESTS_VILLAGE_BLACKSMITH, 1, 3); + ChestGenHooks.addRolls(LootTableList.CHESTS_STRONGHOLD_CROSSING, 1, 2); + ChestGenHooks.addRolls(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, 0, 2); + ChestGenHooks.addRolls(LootTableList.CHESTS_STRONGHOLD_LIBRARY, 2, 4); } + ChestGenHooks.addItem(LootTableList.CHESTS_SPAWN_BONUS_CHEST, ItemList.Bottle_Purple_Drink.get(1L), 8, 16, 2); - - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, ItemList.Bottle_Holy_Water.get(1L), 4, 8, 20); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, ItemList.Bottle_Purple_Drink.get(1L), 8, 16, 80); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Silver, 1L), 1, 6, 120); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Lead, 1L), 1, 6, 30); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), 1, 6, 60); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Bronze, 1L), 1, 6, 60); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Manganese, 1L), 1, 6, 60); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.DamascusSteel, 1L), 1, 6, 10); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Emerald, 1L), 1, 6, 20); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Ruby, 1L), 1, 6, 20); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Sapphire, 1L), 1, 6, 20); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GreenSapphire, 1L), 1, 6, 20); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Olivine, 1L), 1, 6, 20); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetRed, 1L), 1, 6, 40); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetYellow, 1L), 1, 6, 40); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Neodymium, 1L), 1, 6, 40); - ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 1L), 1, 3, 40); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, ItemList.Bottle_Holy_Water.get(1L), 4, 8, 10); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, ItemList.Bottle_Purple_Drink.get(1L), 8, 16, 40); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Silver, 1L), 1, 6, 30); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Lead, 1L), 1, 6, 7); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), 1, 6, 15); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Bronze, 1L), 1, 6, 15); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Manganese, 1L), 1, 6, 15); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.DamascusSteel, 1L), 1, 6, 3); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Emerald, 1L), 1, 6, 5); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Ruby, 1L), 1, 6, 5); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Sapphire, 1L), 1, 6, 5); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GreenSapphire, 1L), 1, 6, 5); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Olivine, 1L), 1, 6, 5); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetRed, 1L), 1, 6, 10); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetYellow, 1L), 1, 6, 10); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Neodymium, 1L), 1, 6, 10); + ChestGenHooks.addItem(LootTableList.CHESTS_SIMPLE_DUNGEON, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 1L), 1, 3, 10); ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, ItemList.Bottle_Holy_Water.get(1L), 4, 8, 2); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Silver, 1L), 4, 16, 12); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Platinum, 1L), 2, 8, 4); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Ruby, 1L), 2, 8, 2); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Sapphire, 1L), 2, 8, 2); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GreenSapphire, 1L), 2, 8, 2); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Olivine, 1L), 2, 8, 2); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetRed, 1L), 2, 8, 4); - ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetYellow, 1L), 2, 8, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Silver, 1L), 4, 16, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Platinum, 1L), 2, 8, 3); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Ruby, 1L), 2, 8, 1); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Sapphire, 1L), 2, 8, 3); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GreenSapphire, 1L), 2, 8, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Olivine, 1L), 2, 8, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetRed, 1L), 2, 8, 3); + ChestGenHooks.addItem(LootTableList.CHESTS_DESERT_PYRAMID, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetYellow, 1L), 2, 8, 3); - ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE, ItemList.Coin_Gold_Ancient.get(1L), 16, 64, 10); + ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE, ItemList.Coin_Gold_Ancient.get(1L), 16, 64, 5); ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE, ItemList.ZPM.getWithCharge(1L, 2147483647), 1, 1, 1); ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Bronze, 1L), 4, 16, 12); ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Ruby, 1L), 2, 8, 2); @@ -90,11 +70,11 @@ public class GT_BookAndLootLoader ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetRed, 1L), 2, 8, 4); ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE, GT_OreDictUnificator.get(OrePrefixes.gem, Materials.GarnetYellow, 1L), 2, 8, 4); - ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER, new ItemStack(Items.FIRE_CHARGE, 1), 2, 8, 30); - ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER, GT_OreDictUnificator.get(OrePrefixes.arrowGtWood, Materials.DamascusSteel, 1L), 8, 16, 20); + ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER, new ItemStack(Items.FIRE_CHARGE, 1), 2, 8, 15); + ChestGenHooks.addItem(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER, GT_OreDictUnificator.get(OrePrefixes.arrowGtWood, Materials.DamascusSteel, 1L), 8, 16, 10); - ChestGenHooks.addItem(LootTableList.CHESTS_ABANDONED_MINESHAFT, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Silver, 1L), 1, 4, 12); + ChestGenHooks.addItem(LootTableList.CHESTS_ABANDONED_MINESHAFT, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Silver, 1L), 1, 4, 6); ChestGenHooks.addItem(LootTableList.CHESTS_ABANDONED_MINESHAFT, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Lead, 1L), 1, 4, 3); ChestGenHooks.addItem(LootTableList.CHESTS_ABANDONED_MINESHAFT, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), 1, 4, 6); ChestGenHooks.addItem(LootTableList.CHESTS_ABANDONED_MINESHAFT, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Bronze, 1L), 1, 4, 6); @@ -109,27 +89,27 @@ public class GT_BookAndLootLoader ChestGenHooks.addItem(LootTableList.CHESTS_ABANDONED_MINESHAFT, GT_OreDictUnificator.get(OrePrefixes.toolHeadShovel, Materials.DamascusSteel, 1L), 1, 4, 1); ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, ItemList.McGuffium_239.get(1L), 1, 1, 1); - ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 1L), 1, 4, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Neodymium, 1L), 2, 8, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Manganese, 1L), 2, 8, 12); - ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), 4, 12, 12); - ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Bronze, 1L), 4, 12, 12); - ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Brass, 1L), 4, 12, 12); + ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 1L), 1, 4, 3); + ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Neodymium, 1L), 2, 8, 3); + ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Manganese, 1L), 2, 8, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), 4, 12, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Bronze, 1L), 4, 12, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Brass, 1L), 4, 12, 6); ChestGenHooks.addItem(LootTableList.CHESTS_VILLAGE_BLACKSMITH, GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.DamascusSteel, 1L), 4, 12, 1); ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, ItemList.Bottle_Holy_Water.get(1L), 4, 8, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, ItemList.McGuffium_239.get(1L), 1, 1, 10); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, ItemList.McGuffium_239.get(1L), 1, 1, 8); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.DamascusSteel, 1L), 4, 8, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.Steel, 1L), 8, 16, 12); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.Bronze, 1L), 8, 16, 12); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.Manganese, 1L), 4, 8, 12); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtDust, Materials.Neodymium, 1L), 4, 8, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtDust, Materials.Chrome, 1L), 2, 4, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.DamascusSteel, 1L), 4, 8, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.Steel, 1L), 8, 16, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.Bronze, 1L), 8, 16, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, Materials.Manganese, 1L), 4, 8, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtDust, Materials.Neodymium, 1L), 4, 8, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CROSSING, GT_OreDictUnificator.get(OrePrefixes.crateGtDust, Materials.Chrome, 1L), 2, 4, 4); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.DamascusSteel, 1L), 1, 4, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.DamascusSteel, 1L), 1, 4, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.arrowGtWood, Materials.DamascusSteel, 1L), 16, 48, 6); - ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.arrowGtWood, Materials.SterlingSilver, 1L), 8, 24, 6); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.toolHeadSword, Materials.DamascusSteel, 1L), 1, 4, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.toolHeadAxe, Materials.DamascusSteel, 1L), 1, 4, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.arrowGtWood, Materials.DamascusSteel, 1L), 16, 48, 4); + ChestGenHooks.addItem(LootTableList.CHESTS_STRONGHOLD_CORRIDOR, GT_OreDictUnificator.get(OrePrefixes.arrowGtWood, Materials.SterlingSilver, 1L), 8, 24, 4); } } diff --git a/src/main/java/gregtech/loaders/postload/GT_UUMRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_UUMRecipeLoader.java deleted file mode 100644 index a3a57879..00000000 --- a/src/main/java/gregtech/loaders/postload/GT_UUMRecipeLoader.java +++ /dev/null @@ -1,7 +0,0 @@ -package gregtech.loaders.postload; - -public class GT_UUMRecipeLoader - implements Runnable { - public void run() { - } -} diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_ItemData.java b/src/main/java/gregtech/loaders/preload/GT_Loader_ItemData.java index 77df09b6..8fece2d5 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_ItemData.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_ItemData.java @@ -139,10 +139,19 @@ public class GT_Loader_ItemData GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE_SLAB, 1, 13), new ItemData(Materials.Stone, 1814400L)); GT_OreDictUnificator.addItemData(new ItemStack(Blocks.DOUBLE_STONE_SLAB, 1, 5), new ItemData(Materials.Stone, 3628800L)); GT_OreDictUnificator.addItemData(new ItemStack(Blocks.DOUBLE_STONE_SLAB, 1, 13), new ItemData(Materials.Stone, 3628800L)); - GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 32767), new ItemData(Materials.Stone, 3628800L)); GT_OreDictUnificator.addItemData(new ItemStack(Blocks.FURNACE, 1, 32767), new ItemData(Materials.Stone, 29030400L)); GT_OreDictUnificator.addItemData(new ItemStack(Blocks.LIT_FURNACE, 1, 32767), new ItemData(Materials.Stone, 29030400L)); GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONEBRICK, 1, 32767), new ItemData(Materials.Stone, 3628800L)); + + GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 0), new ItemData(Materials.Stone, 3628800L)); + //added automatically in Loader_OreDictionary + //GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 1), new ItemData(Materials.GraniteBlack, 3628800L)); + //GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 2), new ItemData(Materials.GraniteBlack, 3628800L)); + //GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 5), new ItemData(Materials.Diorite, 3628800L)); + //GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 6), new ItemData(Materials.Diorite, 3628800L)); + //GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 3), new ItemData(Materials.Andesite, 3628800L)); + //GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE, 1, 4), new ItemData(Materials.Andesite, 3628800L)); + GT_OreDictUnificator.addItemData(new ItemStack(Blocks.COBBLESTONE, 1, 32767), new ItemData(Materials.Stone, 3628800L)); GT_OreDictUnificator.addItemData(new ItemStack(Blocks.MOSSY_COBBLESTONE, 1, 32767), new ItemData(Materials.Stone, 3628800L)); GT_OreDictUnificator.addItemData(new ItemStack(Blocks.STONE_BUTTON, 1, 32767), new ItemData(Materials.Stone, 3628800L)); diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_OreDictionary.java b/src/main/java/gregtech/loaders/preload/GT_Loader_OreDictionary.java index 001b30ad..90bd6306 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_OreDictionary.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_OreDictionary.java @@ -96,6 +96,13 @@ public class GT_Loader_OreDictionary if (Blocks.ENDER_CHEST != null) { GT_OreDictUnificator.registerOre(OreDictNames.enderChest, new ItemStack(Blocks.ENDER_CHEST, 1)); } + GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.GraniteBlack, new ItemStack(Blocks.STONE, 1, 1)); + GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.GraniteBlack, new ItemStack(Blocks.STONE, 1, 2)); + GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Andesite, new ItemStack(Blocks.STONE, 1, 5)); + GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Andesite, new ItemStack(Blocks.STONE, 1, 6)); + GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Diorite, new ItemStack(Blocks.STONE, 1, 3)); + GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Diorite, new ItemStack(Blocks.STONE, 1, 4)); + GT_OreDictUnificator.registerOre(OreDictNames.craftingAnvil, new ItemStack(Blocks.ANVIL, 1)); GT_OreDictUnificator.registerOre(OreDictNames.craftingAnvil, GT_ModHandler.getModItem("Railcraft", "tile.railcraft.anvil", 1, 0)); GT_OreDictUnificator.registerOre(OreDictNames.craftingIndustrialDiamond, ItemList.IC2_Industrial_Diamond.get(1));