diff --git a/resources/assets/tinker/lang/en_US.lang b/resources/assets/tinker/lang/en_US.lang index f7e39258..9591e468 100644 --- a/resources/assets/tinker/lang/en_US.lang +++ b/resources/assets/tinker/lang/en_US.lang @@ -414,6 +414,7 @@ item.tconstruct.bucket.Electrum.name=Molten Electrum Bucket item.tconstruct.bucket.Ender.name=Liquified Ender Bucket item.tconstruct.bucket.Slime.name=Liquid Slime Bucket item.tconstruct.bucket.PigIron.name=Molten Pig Iron Bucket +item.tconstruct.bucket.Glue.name=Sticky Glue Bucket item.tconstruct.bowstring.string.name=Bowstring item.tconstruct.bowstring.enchantedfabriI donc.name=Enchanted Bowstring diff --git a/resources/assets/tinker/textures/blocks/liquid_glue.png b/resources/assets/tinker/textures/blocks/liquid_glue.png new file mode 100644 index 00000000..75592501 Binary files /dev/null and b/resources/assets/tinker/textures/blocks/liquid_glue.png differ diff --git a/resources/assets/tinker/textures/blocks/liquid_glue.png.mcmeta b/resources/assets/tinker/textures/blocks/liquid_glue.png.mcmeta new file mode 100644 index 00000000..4f0718ac --- /dev/null +++ b/resources/assets/tinker/textures/blocks/liquid_glue.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/resources/assets/tinker/textures/blocks/liquid_glue_flow.png b/resources/assets/tinker/textures/blocks/liquid_glue_flow.png new file mode 100644 index 00000000..3588a77d Binary files /dev/null and b/resources/assets/tinker/textures/blocks/liquid_glue_flow.png differ diff --git a/resources/assets/tinker/textures/blocks/liquid_glue_flow.png.mcmeta b/resources/assets/tinker/textures/blocks/liquid_glue_flow.png.mcmeta new file mode 100644 index 00000000..4f0718ac --- /dev/null +++ b/resources/assets/tinker/textures/blocks/liquid_glue_flow.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/resources/assets/tinker/textures/items/materials/bucket_glue.png b/resources/assets/tinker/textures/items/materials/bucket_glue.png new file mode 100644 index 00000000..ddc29bea Binary files /dev/null and b/resources/assets/tinker/textures/items/materials/bucket_glue.png differ diff --git a/resources/assets/tinker/textures/items/materials/material_glueingot.png b/resources/assets/tinker/textures/items/materials/material_glueingot.png new file mode 100644 index 00000000..34b648ae Binary files /dev/null and b/resources/assets/tinker/textures/items/materials/material_glueingot.png differ diff --git a/src/tconstruct/blocks/GlueFluid.java b/src/tconstruct/blocks/GlueFluid.java new file mode 100644 index 00000000..f7ad3d8a --- /dev/null +++ b/src/tconstruct/blocks/GlueFluid.java @@ -0,0 +1,65 @@ +package tconstruct.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidFinite; +import net.minecraftforge.fluids.Fluid; + +public class GlueFluid extends BlockFluidFinite { + + Icon stillIcon; + Icon flowIcon; + + public GlueFluid(int id, Fluid fluid, Material material) + { + super(id, fluid, material); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister iconRegister) + { + stillIcon = iconRegister.registerIcon("tinker:liquid_glue"); + flowIcon = iconRegister.registerIcon("tinker:liquid_glue_flow"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon (int side, int meta) + { + if (side == 0 || side == 1) + return stillIcon; + return flowIcon; + } + + @Override + public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { + entity.motionX *= 0.1; + entity.motionZ *= 0.1; + + if (entity instanceof EntityLivingBase) { + EntityLivingBase lvb = (EntityLivingBase)entity; + // Well you'd feel ill too standing in glue... + if (lvb.isPotionActive(Potion.hunger)) { + lvb.getActivePotionEffect(Potion.hunger).duration = 20; + } else { + lvb.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 20, 4)); + } + + // Glue is sticky stuff + if (lvb.isPotionActive(Potion.moveSlowdown)) { + lvb.getActivePotionEffect(Potion.moveSlowdown).duration = 30; + } else { + lvb.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 30, 4)); + } + } + } +} diff --git a/src/tconstruct/client/TClientEvents.java b/src/tconstruct/client/TClientEvents.java index 22437194..5988e4ed 100644 --- a/src/tconstruct/client/TClientEvents.java +++ b/src/tconstruct/client/TClientEvents.java @@ -58,8 +58,8 @@ public class TClientEvents /* Liquids */ - Icon[] stillIcons = new Icon[1]; - Icon[] flowIcons = new Icon[1]; + Icon[] stillIcons = new Icon[2]; + Icon[] flowIcons = new Icon[2]; @ForgeSubscribe public void preStitch (TextureStitchEvent.Pre event) diff --git a/src/tconstruct/common/TContent.java b/src/tconstruct/common/TContent.java index 7c028a27..2ab327f6 100644 --- a/src/tconstruct/common/TContent.java +++ b/src/tconstruct/common/TContent.java @@ -248,6 +248,10 @@ public class TContent implements IFuelHandler public static Block slimeChannel; public static Block slimePad; + //Glue + public static Fluid glueFluid; + public static Block glueFluidBlock; + //Ores public static Block oreSlag; public static Block oreGravel; @@ -324,8 +328,8 @@ public class TContent implements IFuelHandler //EntityRegistry.registerModEntity(MetalSlime.class, "MetalSlime", 13, TConstruct.instance, 64, 5, true); } - public static Fluid[] fluids = new Fluid[26]; - public static Block[] fluidBlocks = new Block[25]; + public static Fluid[] fluids = new Fluid[27]; + public static Block[] fluidBlocks = new Block[26]; void registerBlocks () { @@ -716,12 +720,23 @@ public class TContent implements IFuelHandler blueSlimeFluid.setBlockID(slimePool); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(blueSlimeFluid, 1000), new ItemStack(buckets, 1, 24), new ItemStack(Item.bucketEmpty))); + //Glue + glueFluid = new Fluid("glue").setDensity(6000).setViscosity(6000).setTemperature(200); + if (!FluidRegistry.registerFluid(glueFluid)) + glueFluid = FluidRegistry.getFluid("glue"); + glueFluidBlock = new GlueFluid(PHConstruct.glueFluidBlock, glueFluid, Material.water).setCreativeTab(TConstructRegistry.blockTab).setStepSound(slimeStep).setUnlocalizedName("liquid.glue"); + GameRegistry.registerBlock(glueFluidBlock, "liquid.glue"); + fluids[25] = glueFluid; + fluidBlocks[25] = glueFluidBlock; + glueFluid.setBlockID(glueFluidBlock); + FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(glueFluid, 1000), new ItemStack(buckets, 1, 26), new ItemStack(Item.bucketEmpty))); + pigIronFluid = new Fluid("pigiron.molten"); if (!FluidRegistry.registerFluid(pigIronFluid)) pigIronFluid = FluidRegistry.getFluid("pigiron.molten"); else pigIronFluid.setDensity(3000).setViscosity(6000).setTemperature(1300); - fluids[25] = pigIronFluid; + fluids[26] = pigIronFluid; slimeGel = new SlimeGel(PHConstruct.slimeGel).setStepSound(slimeStep).setLightOpacity(0).setUnlocalizedName("slime.gel"); GameRegistry.registerBlock(slimeGel, SlimeGelItemBlock.class, "slime.gel"); @@ -1593,7 +1608,7 @@ public class TContent implements IFuelHandler { tableCasting.addCastingRecipe(new ItemStack(buckets, 1, sc), new FluidStack(fluids[sc], FluidContainerRegistry.BUCKET_VOLUME), bucket, true, 10); } - tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 25), new FluidStack(fluids[25], FluidContainerRegistry.BUCKET_VOLUME), bucket, true, 10); + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 26), new FluidStack(fluids[26], FluidContainerRegistry.BUCKET_VOLUME), bucket, true, 10); // Clear glass pane casting tableCasting.addCastingRecipe(new ItemStack(glassPane), new FluidStack(moltenGlassFluid, 250), null, 80); @@ -1677,6 +1692,7 @@ public class TContent implements IFuelHandler basinCasting.addCastingRecipe(new ItemStack(speedBlock, 1, 0), new FluidStack(moltenTinFluid, TConstruct.nuggetLiquidValue), new ItemStack(Block.gravel), true, 100); //brownstone basinCasting.addCastingRecipe(new ItemStack(Block.whiteStone), new FluidStack(moltenEnderFluid, TConstruct.chunkLiquidValue), new ItemStack(Block.obsidian), true, 100); //endstone basinCasting.addCastingRecipe(new ItemStack(metalBlock.blockID, 1, 10), new FluidStack(moltenEnderFluid, 1000), null, true, 100); //ender + basinCasting.addCastingRecipe(new ItemStack(glueBlock), new FluidStack(glueFluid, TConstruct.blockLiquidValue), null, true, 100); //glue // basinCasting.addCastingRecipe(new ItemStack(slimeGel, 1, 0), new FluidStack(blueSlimeFluid, FluidContainerRegistry.BUCKET_VOLUME), null, true, 100); @@ -1767,6 +1783,7 @@ public class TContent implements IFuelHandler Smeltery.addMelting(Block.stone, 0, 800, new FluidStack(moltenStoneFluid, TConstruct.ingotLiquidValue / 18)); Smeltery.addMelting(Block.cobblestone, 0, 800, new FluidStack(moltenStoneFluid, TConstruct.ingotLiquidValue / 18)); Smeltery.addMelting(Block.blockEmerald, 0, 800, new FluidStack(moltenEmeraldFluid, 640*9)); + Smeltery.addMelting(glueBlock, 0, 250, new FluidStack(glueFluid, TConstruct.blockLiquidValue)); Smeltery.addMelting(clearGlass, 0, 500, new FluidStack(moltenGlassFluid, 1000)); Smeltery.addMelting(glassPane, 0, 350, new FluidStack(moltenGlassFluid, 250)); diff --git a/src/tconstruct/items/FilledBucket.java b/src/tconstruct/items/FilledBucket.java index 9c8bc986..76b88b08 100644 --- a/src/tconstruct/items/FilledBucket.java +++ b/src/tconstruct/items/FilledBucket.java @@ -2,6 +2,8 @@ package tconstruct.items; import java.util.List; +import net.minecraftforge.fluids.BlockFluidFinite; +import tconstruct.TConstruct; import tconstruct.blocks.logic.LiquidTextureLogic; import tconstruct.common.TContent; @@ -137,11 +139,16 @@ public class FilledBucket extends ItemBucket } else { - int id = 0; - int metadata = 0; - if (type == 25) - metadata = 0; - world.setBlock(clickX, clickY, clickZ, TContent.fluidBlocks[type].blockID, metadata, 3); //TODO: Merge liquids + try { + int metadata = 0; + if (TContent.fluidBlocks[type] instanceof BlockFluidFinite) + metadata = 7; + + world.setBlock(clickX, clickY, clickZ, TContent.fluidBlocks[type].blockID, metadata, 3); //TODO: Merge liquids + } catch (ArrayIndexOutOfBoundsException ex) { + TConstruct.logger.warning("AIOBE occured when placing bucket into world; " + ex); + return false; + } return true; } @@ -180,8 +187,8 @@ public class FilledBucket extends ItemBucket } public static final String[] materialNames = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "AluBrass", "Manyullyn", "Alumite", "Obsidian", "Steel", - "Glass", "Stone", "Villager", "Cow", "Nickel", "Lead", "Silver", "Shiny", "Invar", "Electrum", "Ender", "Slime", "PigIron" }; + "Glass", "Stone", "Villager", "Cow", "Nickel", "Lead", "Silver", "Shiny", "Invar", "Electrum", "Ender", "Slime", "Glue", "PigIron" }; public static final String[] textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel", - "glass", "stone", "emerald", "blood", "nickel", "lead", "silver", "shiny", "invar", "electrum", "ender", "slime", "pigiron" }; + "glass", "stone", "emerald", "blood", "nickel", "lead", "silver", "shiny", "invar", "electrum", "ender", "slime", "glue", "pigiron" }; } diff --git a/src/tconstruct/library/crafting/FluidType.java b/src/tconstruct/library/crafting/FluidType.java index b919fd45..6bd6a857 100644 --- a/src/tconstruct/library/crafting/FluidType.java +++ b/src/tconstruct/library/crafting/FluidType.java @@ -59,7 +59,9 @@ public enum FluidType /** Slime Smelting **/ Slime(TContent.slimeGel.blockID, 0, 250, TContent.blueSlimeFluid, false), /** Pigiron Smelting **/ - PigIron(TContent.meatBlock.blockID, 0, 610, TContent.pigIronFluid, true); + PigIron(TContent.meatBlock.blockID, 0, 610, TContent.pigIronFluid, true), + /** Glue Smelting **/ + Glue(TContent.glueBlock.blockID, 0, 125, TContent.glueFluid, false); public final int renderBlockID; public final int renderMeta; diff --git a/src/tconstruct/util/config/PHConstruct.java b/src/tconstruct/util/config/PHConstruct.java index 1b67818f..71d2dc31 100644 --- a/src/tconstruct/util/config/PHConstruct.java +++ b/src/tconstruct/util/config/PHConstruct.java @@ -163,6 +163,7 @@ public class PHConstruct woolSlab1 = config.getBlock("Wool Slab 1", 3244).getInt(3244); woolSlab2 = config.getBlock("Wool Slab 2", 3245).getInt(3245); glueBlock = config.getBlock("Glue Block", 3256).getInt(3256); + glueFluidBlock = config.getBlock("Glue Fluid Block", 3257).getInt(3257); castingChannel = config.getBlock("Casting Channel", 3249).getInt(3249); slimePoolBlue = config.getBlock("Liquid Blue Slime", 3235).getInt(3235); @@ -486,6 +487,10 @@ public class PHConstruct public static int slimeChannel; public static int slimePad; + // Glue + public static int glueFluidBlock; + public static int glueBlock; + //Decoration public static int stoneTorch; public static int stoneLadder; @@ -497,7 +502,6 @@ public class PHConstruct public static int meatBlock; public static int woolSlab1; public static int woolSlab2; - public static int glueBlock; //Patterns and misc public static int blankPattern; @@ -717,6 +721,7 @@ public class PHConstruct //Looks public static int connectedTexturesMode; public static File cfglocation; + //dimensionblacklist public static boolean slimeIslGenDim0Only; public static int[] cfgDimBlackList;