mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-29 00:08:56 +00:00
Glue block
This commit is contained in:
1 parent
2bf8dc759c
commit
1387bc6f74
5 files changed
+59
-1
No files matched your search
@@ -118,6 +118,8 @@ tile.cloth.green.slab.name=Green Wool Slab
|
|||||||
tile.cloth.red.slab.name=Red Wool Slab
|
tile.cloth.red.slab.name=Red Wool Slab
|
||||||
tile.cloth.black.slab.name=Black Wool Slab
|
tile.cloth.black.slab.name=Black Wool Slab
|
||||||
|
|
||||||
|
tile.GlueBlock.name=Glue Block
|
||||||
|
|
||||||
item.oreberry.iron.name=Iron Oreberry
|
item.oreberry.iron.name=Iron Oreberry
|
||||||
item.oreberry.gold.name=Gold Oreberry
|
item.oreberry.gold.name=Gold Oreberry
|
||||||
item.oreberry.copper.name=Copper Oreberry
|
item.oreberry.copper.name=Copper Oreberry
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 508 B |
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -158,6 +158,7 @@ public class TContent implements IFuelHandler
|
|||||||
public static Block meatBlock;
|
public static Block meatBlock;
|
||||||
public static Block woolSlab1;
|
public static Block woolSlab1;
|
||||||
public static Block woolSlab2;
|
public static Block woolSlab2;
|
||||||
|
public static Block glueBlock;
|
||||||
|
|
||||||
//Traps
|
//Traps
|
||||||
public static Block landmine;
|
public static Block landmine;
|
||||||
@@ -378,6 +379,10 @@ public class TContent implements IFuelHandler
|
|||||||
LanguageRegistry.addName(meatBlock, "Hambone");
|
LanguageRegistry.addName(meatBlock, "Hambone");
|
||||||
GameRegistry.addRecipe(new ItemStack(meatBlock), "mmm", "mbm", "mmm", 'b', new ItemStack(Item.bone), 'm', new ItemStack(Item.porkRaw));
|
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 = new SlabBase(PHConstruct.woolSlab1, Material.cloth, Block.cloth, 0, 8).setUnlocalizedName("cloth");
|
||||||
woolSlab1.setStepSound(Block.soundClothFootstep).setCreativeTab(CreativeTabs.tabDecorations);
|
woolSlab1.setStepSound(Block.soundClothFootstep).setCreativeTab(CreativeTabs.tabDecorations);
|
||||||
GameRegistry.registerBlock(woolSlab1, WoolSlab1Item.class, "WoolSlab1");
|
GameRegistry.registerBlock(woolSlab1, WoolSlab1Item.class, "WoolSlab1");
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class PHConstruct
|
|||||||
woodCrafterSlab = config.getBlock("Crafting Slab", 3243).getInt(3243);
|
woodCrafterSlab = config.getBlock("Crafting Slab", 3243).getInt(3243);
|
||||||
woolSlab1 = config.getBlock("Wool Slab 1", 3244).getInt(3244);
|
woolSlab1 = config.getBlock("Wool Slab 1", 3244).getInt(3244);
|
||||||
woolSlab2 = config.getBlock("Wool Slab 2", 3245).getInt(3245);
|
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);
|
castingChannel = config.getBlock("Casting Channel", 3249).getInt(3249);
|
||||||
|
|
||||||
slimePoolBlue = config.getBlock("Liquid Blue Slime", 3235).getInt(3235);
|
slimePoolBlue = config.getBlock("Liquid Blue Slime", 3235).getInt(3235);
|
||||||
@@ -374,6 +374,7 @@ public class PHConstruct
|
|||||||
//Experimental functionality
|
//Experimental functionality
|
||||||
throwableSmeltery = config.get("Experimental", "Items can be thrown into smelteries", true).getBoolean(true);
|
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);
|
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
|
//Addon stuff
|
||||||
isCleaverTwoHanded = config.get("Battlegear", "Can Cleavers have shields", true).getBoolean(true);
|
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 meatBlock;
|
||||||
public static int woolSlab1;
|
public static int woolSlab1;
|
||||||
public static int woolSlab2;
|
public static int woolSlab2;
|
||||||
|
public static int glueBlock;
|
||||||
|
|
||||||
//Patterns and misc
|
//Patterns and misc
|
||||||
public static int blankPattern;
|
public static int blankPattern;
|
||||||
@@ -724,6 +726,7 @@ public class PHConstruct
|
|||||||
//Experimental functionality
|
//Experimental functionality
|
||||||
public static boolean throwableSmeltery;
|
public static boolean throwableSmeltery;
|
||||||
public static boolean newSmeltery;
|
public static boolean newSmeltery;
|
||||||
|
public static boolean meltableHorses;
|
||||||
|
|
||||||
//Addon stuff
|
//Addon stuff
|
||||||
public static boolean isCleaverTwoHanded;
|
public static boolean isCleaverTwoHanded;
|
||||||
|
|||||||
Reference in new issue
Block a user