diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-12-11 22:43:49 +0100 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-12-11 22:43:49 +0100 |
commit | 1a184abb892c4b9a83c7b89d59fcd3206ca7378e (patch) | |
tree | edfaf3a8a46c7cb3bd2630b89eb5a4892fecf811 /src/main | |
parent | f87ba14311de8c8d9d34858b311a43c268bb4dfe (diff) | |
download | GT5-Unofficial-1a184abb892c4b9a83c7b89d59fcd3206ca7378e.tar.gz GT5-Unofficial-1a184abb892c4b9a83c7b89d59fcd3206ca7378e.tar.bz2 GT5-Unofficial-1a184abb892c4b9a83c7b89d59fcd3206ca7378e.zip |
added fully automated Werkstoff Blocks
+ added recipes for the blocks
+ version increase
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Former-commit-id: dec9f6907e8c91cff240f6a9141c3531ceccea62
Diffstat (limited to 'src/main')
15 files changed, 386 insertions, 157 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 7146293456..5418587508 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -22,9 +22,8 @@ package com.github.bartimaeusnek.bartworks.client.renderer; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedSmallOreTE; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import net.minecraft.block.Block; @@ -41,7 +40,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { - BW_MetaGeneratedOreTE tTileEntity = aBlock instanceof BW_MetaGenerated_SmallOres ? new BW_MetaGeneratedSmallOreTE() : new BW_MetaGeneratedOreTE(); + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = (short) aMeta; aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 4fb77d6671..b1aeb18a54 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -53,7 +53,7 @@ import net.minecraftforge.fluids.IFluidContainerItem; public class BW_TileEntityContainer extends BlockContainer implements ITileAddsInformation { - Class<? extends TileEntity> tileEntity; + protected Class<? extends TileEntity> tileEntity; public BW_TileEntityContainer(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index 7c6ba97d67..b22bd115fd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -59,7 +59,7 @@ public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new OrePacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; + this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List<Object> aOutput) throws Exception { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 75d5cddc30..7d083bdaec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -23,7 +23,7 @@ package com.github.bartimaeusnek.bartworks.common.net; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE; +import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; @@ -33,14 +33,14 @@ import net.minecraft.world.World; import java.nio.ByteBuffer; -public class OrePacket extends GT_Packet { +public class MetaBlockPacket extends GT_Packet { int x; short y; int z; short meta; - public OrePacket(int x, int y, int z, int meta) { + public MetaBlockPacket(int x, int y, int z, int meta) { super(false); this.x = x; this.y = (short) y; @@ -48,7 +48,7 @@ public class OrePacket extends GT_Packet { this.meta = (short) meta; } - public OrePacket() { + public MetaBlockPacket() { super(true); } @@ -72,7 +72,7 @@ public class OrePacket extends GT_Packet { this.z = buff.getInt(); this.y = buff.getShort(); this.meta = buff.getShort(); - OrePacket todecode = new OrePacket(this.x, this.y, this.z, this.meta); + MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; @@ -84,8 +84,8 @@ public class OrePacket extends GT_Packet { public void process(IBlockAccess iBlockAccess) { if (iBlockAccess != null) { TileEntity tTileEntity = iBlockAccess.getTileEntity(this.x, this.y, this.z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = this.meta; + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData = this.meta; } if (((iBlockAccess instanceof World)) && (((World) iBlockAccess).isRemote)) { ((World) iBlockAccess).markBlockForUpdate(this.x, this.y, this.z); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 90c30d1adf..d50511337d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -35,9 +35,9 @@ import net.minecraft.world.World; import java.util.ArrayList; import java.util.List; -public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { +public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { - public BW_MetaGeneratedOre_Item(Block par1) { + public BW_MetaGeneratedBlock_Item(Block par1) { super(par1); } @@ -70,7 +70,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { return false; } - BW_MetaGeneratedOreTE tTileEntity = (BW_MetaGeneratedOreTE) aWorld.getTileEntity(aX, aY, aZ); + BW_MetaGenerated_Block_TE tTileEntity = (BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ); tTileEntity.mMetaData = tDamage; } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 5d876b3986..5a5539b3f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -22,69 +22,14 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.common.net.OrePacket; -import com.github.bartimaeusnek.bartworks.util.Coords; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; - -public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEntity { - - public short mMetaData; - - public static boolean placeOre(World aWorld, Coords coords, Werkstoff werkstoff) { - short meta = werkstoff.getmID(); - aWorld.setBlock(coords.x, coords.y, coords.z, WerkstoffLoader.BWOres, 0, 0); - TileEntity tTileEntity = aWorld.getTileEntity(coords.x, coords.y, coords.z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = meta; - } - return true; - } - - public boolean canUpdate() { - return false; - } - - public void readFromNBT(NBTTagCompound aNBT) { - super.readFromNBT(aNBT); - this.mMetaData = aNBT.getShort("m"); - } - - public void writeToNBT(NBTTagCompound aNBT) { - super.writeToNBT(aNBT); - aNBT.setShort("m", this.mMetaData); - } - - public ArrayList<ItemStack> getDrops(Block aDroppedOre, int aFortune) { - ArrayList<ItemStack> rList = new ArrayList<>(); - if (this.mMetaData < 0) { - rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); - return rList; - } - rList.add(new ItemStack(aDroppedOre, 1, this.mMetaData)); - return rList; - } - - @Override - public Packet getDescriptionPacket() { - if (!this.worldObj.isRemote) - BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new OrePacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); - return null; - } +public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { @Override public ITexture[] getTexture(Block aBlock, byte aSide) { @@ -95,4 +40,9 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn } return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWOres; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index 849126df83..80126f39f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -39,7 +39,7 @@ import java.util.Random; public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { - public ArrayList<ItemStack> getDrops(Block aDroppedOre, int aFortune) { + public ArrayList<ItemStack> getDrops(int aFortune) { ArrayList<ItemStack> rList = new ArrayList<>(); Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); @@ -113,4 +113,9 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { } return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWSmallOres; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java new file mode 100644 index 0000000000..7213816976 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; + +public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements ITexturedTileEntity { + + public short mMetaData; + + public boolean canUpdate() { + return false; + } + + public void readFromNBT(NBTTagCompound aNBT) { + super.readFromNBT(aNBT); + this.mMetaData = aNBT.getShort("m"); + } + + public void writeToNBT(NBTTagCompound aNBT) { + aNBT.setShort("m", this.mMetaData); + super.writeToNBT(aNBT); + } + + @Override + public Packet getDescriptionPacket() { + if (!this.worldObj.isRemote) + BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + return null; + } + + protected abstract Block GetProperBlock(); + + public ArrayList<ItemStack> getDrops(int aFortune) { + ArrayList<ItemStack> rList = new ArrayList<>(); + if (this.mMetaData < 0) { + rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); + return rList; + } + rList.add(new ItemStack(GetProperBlock(), 1, this.mMetaData)); + return rList; + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java new file mode 100644 index 0000000000..1b3a645e5c --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; +import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.ArrayList; + +import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; + +public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { + + public static ThreadLocal<BW_MetaGenerated_Block_TE> mTemporaryTileEntity = new ThreadLocal<>(); + + public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + + this.setHardness(5.0F); + this.setResistance(5.0F); + this.setBlockTextureName("stone"); + this.setCreativeTab(metaTab); + for (Werkstoff w : Werkstoff.werkstoffHashSet) + doRegistrationStuff(w); + } + + @SideOnly(Side.CLIENT) + public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering(){ + return (BW_MetaGenerated_Block_TE) createNewTileEntity(null,0); + } + + protected abstract void doRegistrationStuff(Werkstoff w); + + @Override + public String getHarvestTool(int metadata) { + return "pickaxe"; + } + + protected boolean canSilkHarvest() { + return false; + } + + public int getRenderType() { + if (BW_Renderer_Block_Ores.INSTANCE == null) { + return super.getRenderType(); + } + return BW_Renderer_Block_Ores.INSTANCE.mRenderID; + } + + public int getDamageValue(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof BW_MetaGenerated_Block_TE))) { + return ((BW_MetaGenerated_Block_TE) tTileEntity).mMetaData; + } + return 0; + } + + @Override + public TileEntity createTileEntity(World world, int metadata) { + return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); + } + + @Override + public boolean hasTileEntity(int metadata) { + return true; + } + + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + TileEntity tTileEntity = world.getTileEntity(x, y, z); + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + mTemporaryTileEntity.set((BW_MetaGenerated_Block_TE) tTileEntity); + } + super.breakBlock(world, x, y, z, block, meta); + } + + public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { + return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune); + } + return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); + } + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 57f6c319b6..268be7eddf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -68,7 +68,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public Item getTabIconItem() { return new ItemStack(Blocks.iron_ore).getItem(); } + }; + protected final OrePrefixes orePrefixes; public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 9ac1b0f383..dc4bc47673 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -22,8 +22,6 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; @@ -35,29 +33,16 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; - -public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { - - public static ThreadLocal<BW_MetaGeneratedOreTE> mTemporaryTileEntity = new ThreadLocal<>(); +public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - - this.setHardness(5.0F); - this.setResistance(5.0F); - this.setBlockTextureName("stone"); - this.setCreativeTab(metaTab); - for (Werkstoff w : Werkstoff.werkstoffHashSet) - doRegistrationStuff(w); } protected void doRegistrationStuff(Werkstoff w){ @@ -98,10 +83,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } - public String getLocalizedName() { - return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); - } - @Override public IIcon getIcon(int side, int meta) { return Blocks.stone.getIcon(0, 0); @@ -112,46 +93,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { return Blocks.stone.getIcon(0, 0); } - @Override - public String getHarvestTool(int metadata) { - return "pickaxe"; - } - - protected boolean canSilkHarvest() { - return false; - } - - public int getRenderType() { - if (BW_Renderer_Block_Ores.INSTANCE == null) { - return super.getRenderType(); - } - return BW_Renderer_Block_Ores.INSTANCE.mRenderID; - } - - public int getDamageValue(World aWorld, int aX, int aY, int aZ) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof BW_MetaGeneratedOreTE))) { - return ((BW_MetaGeneratedOreTE) tTileEntity).mMetaData; - } - return 0; - } - - public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - TileEntity tTileEntity = world.getTileEntity(x, y, z); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - BW_MetaGenerated_Ores.mTemporaryTileEntity.set((BW_MetaGeneratedOreTE) tTileEntity); - } - super.breakBlock(world, x, y, z, block, meta); - } - - public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { - return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres,aFortune); - } - return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList<>() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres,aFortune); - } - public int getHarvestLevel(int metadata) { return 3; } @@ -171,17 +112,6 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } } -// @Override -// public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block p_149695_5_) { -// if ((!aWorld.isRemote || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) -// ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); -// } -// -// @Override -// public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int tileX, int tileY, int tileZ) { -// if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) -// ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); -// } @SuppressWarnings("unused") private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ for (int x = -1; x <= 1; x++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java new file mode 100644 index 0000000000..632c3e034f --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_TE { + + @Override + public ITexture[] getTexture(Block aBlock, byte aSide) { + Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); + if ((aMaterial != null)) { + GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.block.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), aIconSet}; + } + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.iron_block, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + } + + @Override + protected Block GetProperBlock() { + return WerkstoffLoader.BWBlocks; + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java new file mode 100644 index 0000000000..382163ae8b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.system.material; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import java.util.List; + +public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { + + public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { + super(p_i45386_1_, tileEntity, blockName); + } + + @Override + protected void doRegistrationStuff(Werkstoff tMaterial) { + if (tMaterial != null) { + if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + tMaterial.getmID() + ".name", OrePrefixes.block.mLocalizedMaterialPre + tMaterial.getDefaultName() + OrePrefixes.block.mLocalizedMaterialPost); + } + } + + @Override + public String getUnlocalizedName() { + return "bw.werkstoffblocks.01"; + } + + @Override + public IIcon getIcon(int side, int meta) { + return Blocks.iron_block.getIcon(0, 0); + } + + @Override + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return Blocks.iron_block.getIcon(0, 0); + } + + @Override + @SuppressWarnings("unchecked") + public void getSubBlocks(Item aItem, CreativeTabs p_149666_2_, List aList) { + for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { + if (tMaterial.getGenerationFeatures().hasGems() || (tMaterial.getGenerationFeatures().toGenerate & 0b10) != 0) + aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); + } + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index 77b027c123..afa98aa857 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -406,6 +406,10 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); } + public boolean hasItemType(OrePrefixes prefixes){ + return (this.getGenerationFeatures().toGenerate & GenerationFeatures.prefixLogic.get(prefixes)) != 0; + } + public enum Types { MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; @@ -440,9 +444,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final HashMap<OrePrefixes,Integer> prefixLogic = new HashMap<>(); static { - for (OrePrefixes p : OrePrefixes.values()){ - Werkstoff.GenerationFeatures.prefixLogic.put(p,0); - } + Arrays.stream(OrePrefixes.values()).forEach( e -> prefixLogic.put(e,0)); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dust,0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustTiny,0b1); Werkstoff.GenerationFeatures.prefixLogic.put(OrePrefixes.dustSmall,0b1); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 818fc44c78..6ff6c28d98 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1311,6 +1311,7 @@ public class WerkstoffLoader implements Runnable { public static HashBiMap<Werkstoff, Fluid> molten = HashBiMap.create(); public static Block BWOres; public static Block BWSmallOres; + public static Block BWBlocks; public boolean registered; public static final HashSet<OrePrefixes> ENABLED_ORE_PREFIXES = new HashSet<>(); @@ -1337,9 +1338,11 @@ public class WerkstoffLoader implements Runnable { } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); - if (orePrefixes == oreSmall) + else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); - if (WerkstoffLoader.items.get(orePrefixes) == null) + else if (orePrefixes == block) + return new ItemStack(WerkstoffLoader.BWBlocks,amount,werkstoff.getmID()); + else if (WerkstoffLoader.items.get(orePrefixes) == null) MainMod.LOGGER.catching(Level.ERROR,new Exception("NO SUCH ITEM! "+orePrefixes+werkstoff.getVarName() +" If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + "If you are a Developer, you forgot to enable "+orePrefixes+" OrePrefix for Werkstoff "+werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -1397,6 +1400,8 @@ public class WerkstoffLoader implements Runnable { this.addCraftingMetalRecipes(werkstoff); DebugLog.log("Loading MultipleIngots MetalWorking Recipes"+" " +(System.nanoTime()-timepreone)); this.addMultipleMetalRecipes(werkstoff); + DebugLog.log("Loading Metal Recipes"+" " +(System.nanoTime()-timepreone)); + this.addMetalRecipes(werkstoff); DebugLog.log("Loading Tool Recipes"+" " +(System.nanoTime()-timepreone)); this.addTools(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { @@ -1596,10 +1601,13 @@ public class WerkstoffLoader implements Runnable { RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); + GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); - GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.01"); - GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedOre_Item.class, "bw.blockores.02"); + WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron,BW_MetaGenerated_WerkstoffBlock_TE.class,"bw.werkstoffblocks"); + GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); + GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); + GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); new GTMetaItemEnhancer(); } @@ -1795,13 +1803,20 @@ public class WerkstoffLoader implements Runnable { OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite))); } else { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if (werkstoff.getGenerationFeatures().hasOres()) + if (werkstoff.getGenerationFeatures().hasOres()) { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); + GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); + } + if (werkstoff.getGenerationFeatures().hasGems()) OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + if (werkstoff.getGenerationFeatures().hasGems() || (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ + GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); + } + werkstoff.getADDITIONAL_OREDICT() - .forEach(s -> WerkstoffLoader.items.keySet() + .forEach(s -> ENABLED_ORE_PREFIXES .stream() .filter(o -> Objects.nonNull(werkstoff.get(o))) .forEach( od -> OreDictionary.registerOre(od+s, werkstoff.get(od)))); @@ -1815,6 +1830,8 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasGems()) { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { + GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); + GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block),werkstoff.get(gem, 9), 100, 24); GT_Values.RA.addSifterRecipe( werkstoff.get(crushedPurified), new ItemStack[]{ @@ -1859,8 +1876,9 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); } - if ((werkstoff.getGenerationFeatures().toGenerate & 2) != 0) { + if (werkstoff.hasItemType(plate)) { GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate,9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); } GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); @@ -1878,8 +1896,8 @@ public class WerkstoffLoader implements Runnable { } private void addSimpleMetalRecipes(Werkstoff werkstoff) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000000) != 0) { - if (werkstoff.getGenerationFeatures().hasGems()) { + if (werkstoff.hasItemType(plate)) { + if (werkstoff.hasItemType(gem)) { GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); @@ -1976,6 +1994,14 @@ public class WerkstoffLoader implements Runnable { } } + private void addMetalRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(ingot)) != 0) { + GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); + GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9),ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().mass, 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().mass/2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + } + } + private void addMultipleMetalRecipes(Werkstoff werkstoff){ if ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(plateDense)) != 0) { GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{werkstoff.get(ingot,2),GT_Utility.getIntegratedCircuit(2)},new ItemStack[]{werkstoff.get(plateDouble)},null,null,null,null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60,0)); @@ -2136,6 +2162,9 @@ public class WerkstoffLoader implements Runnable { GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 || werkstoff.getGenerationFeatures().hasGems() ){ + GT_ModHandler.addPulverisationRecipe(werkstoff.get(block),werkstoff.get(dust, 9)); + } } } @@ -2380,10 +2409,12 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); } else if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) == 0){ GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust),null,werkstoff.getMolten(144),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall),null,werkstoff.getMolten(36),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny),null,werkstoff.getMolten(16),0,(int) werkstoff.getStats().mass, werkstoff.getStats().getMass() > 128 ? 64 : 30); - } + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block),null,werkstoff.getMolten(1296),0,288, 8); + } } }
\ No newline at end of file |