mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 19:59:55 +00:00
manual merge of master branch changes up to commit 1387bc6
This commit is contained in:
1 parent
2d99d5dba2
commit
14d357ccf6
23 files changed
+317
-172
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user