diff --git a/resources/assets/tinker/lang/en_US.lang b/resources/assets/tinker/lang/en_US.lang index 10c95c3e..f7e39258 100644 --- a/resources/assets/tinker/lang/en_US.lang +++ b/resources/assets/tinker/lang/en_US.lang @@ -118,6 +118,8 @@ tile.cloth.green.slab.name=Green Wool Slab tile.cloth.red.slab.name=Red Wool Slab tile.cloth.black.slab.name=Black Wool Slab +tile.GlueBlock.name=Glue Block + item.oreberry.iron.name=Iron Oreberry item.oreberry.gold.name=Gold Oreberry item.oreberry.copper.name=Copper Oreberry diff --git a/resources/assets/tinker/textures/blocks/glue.png b/resources/assets/tinker/textures/blocks/glue.png new file mode 100644 index 00000000..47ce56ee Binary files /dev/null and b/resources/assets/tinker/textures/blocks/glue.png differ diff --git a/src/tconstruct/blocks/GlueBlock.java b/src/tconstruct/blocks/GlueBlock.java new file mode 100644 index 00000000..94b425f8 --- /dev/null +++ b/src/tconstruct/blocks/GlueBlock.java @@ -0,0 +1,48 @@ +package tconstruct.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class GlueBlock extends TConstructBlock { + + public GlueBlock(int id) + { + super(id, Material.ground, 4.0f, new String[]{"glue"}); + } + + @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 on 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)); + } + } + } + + public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) + { + return Block.slowSand.getCollisionBoundingBoxFromPool(world, x, y, z); + } + +} diff --git a/src/tconstruct/common/TContent.java b/src/tconstruct/common/TContent.java index ced9da48..7c028a27 100644 --- a/src/tconstruct/common/TContent.java +++ b/src/tconstruct/common/TContent.java @@ -158,6 +158,7 @@ public class TContent implements IFuelHandler public static Block meatBlock; public static Block woolSlab1; public static Block woolSlab2; + public static Block glueBlock; //Traps public static Block landmine; @@ -378,6 +379,10 @@ public class TContent implements IFuelHandler LanguageRegistry.addName(meatBlock, "Hambone"); GameRegistry.addRecipe(new ItemStack(meatBlock), "mmm", "mbm", "mmm", 'b', new ItemStack(Item.bone), 'm', new ItemStack(Item.porkRaw)); + glueBlock = new GlueBlock(PHConstruct.glueBlock).setUnlocalizedName("GlueBlock").setCreativeTab(TConstructRegistry.blockTab); + GameRegistry.registerBlock(glueBlock, "GlueBlock"); + OreDictionary.registerOre("blockRubber", new ItemStack(glueBlock)); + woolSlab1 = new SlabBase(PHConstruct.woolSlab1, Material.cloth, Block.cloth, 0, 8).setUnlocalizedName("cloth"); woolSlab1.setStepSound(Block.soundClothFootstep).setCreativeTab(CreativeTabs.tabDecorations); GameRegistry.registerBlock(woolSlab1, WoolSlab1Item.class, "WoolSlab1"); diff --git a/src/tconstruct/util/config/PHConstruct.java b/src/tconstruct/util/config/PHConstruct.java index 4346229e..1b67818f 100644 --- a/src/tconstruct/util/config/PHConstruct.java +++ b/src/tconstruct/util/config/PHConstruct.java @@ -162,7 +162,7 @@ public class PHConstruct woodCrafterSlab = config.getBlock("Crafting Slab", 3243).getInt(3243); woolSlab1 = config.getBlock("Wool Slab 1", 3244).getInt(3244); woolSlab2 = config.getBlock("Wool Slab 2", 3245).getInt(3245); - //3246 + glueBlock = config.getBlock("Glue Block", 3256).getInt(3256); castingChannel = config.getBlock("Casting Channel", 3249).getInt(3249); slimePoolBlue = config.getBlock("Liquid Blue Slime", 3235).getInt(3235); @@ -374,6 +374,7 @@ public class PHConstruct //Experimental functionality throwableSmeltery = config.get("Experimental", "Items can be thrown into smelteries", true).getBoolean(true); newSmeltery = config.get("Experimental", "Use new adaptive Smeltery code", false, "Warning: Very buggy").getBoolean(false); + meltableHorses = config.get("Experimental", "Allow horses to be melted down for glue", true).getBoolean(true); //Addon stuff isCleaverTwoHanded = config.get("Battlegear", "Can Cleavers have shields", true).getBoolean(true); @@ -496,6 +497,7 @@ 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; @@ -724,6 +726,7 @@ public class PHConstruct //Experimental functionality public static boolean throwableSmeltery; public static boolean newSmeltery; + public static boolean meltableHorses; //Addon stuff public static boolean isCleaverTwoHanded;