mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-28 07:56:01 +00:00
manual update of all master commits up to ca86fa8
This commit is contained in:
1 parent
14d357ccf6
commit
983c91c2c9
48 files changed
+680
-158
No files matched your search
@@ -20,8 +20,8 @@ public class BloodBlock extends TConstructFluid
|
||||
{
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 200, 0));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 20*10, 4));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20*15, 0));
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 20*5, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ public class DryingRackLogic extends InventoryLogic
|
||||
|
||||
public DryingRackLogic()
|
||||
{
|
||||
super(1);
|
||||
super(1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.monster.EntityIronGolem;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -345,6 +346,17 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (o instanceof EntityHorse)
|
||||
{
|
||||
EntityHorse horse = (EntityHorse) o;
|
||||
if (PHConstruct.meltableHorses && horse.attackEntityFrom(new SmelteryDamageSource(), 5))
|
||||
{
|
||||
if (currentLiquid + 108 < maxLiquid)
|
||||
{
|
||||
this.fill(new FluidStack(TContent.glueFluid, 108), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (o instanceof EntityLivingBase)
|
||||
{
|
||||
EntityLivingBase living = (EntityLivingBase) o;
|
||||
@@ -661,6 +673,12 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
//worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
//worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void setInventorySlotContents (int slot, ItemStack itemstack)
|
||||
{
|
||||
inventory[slot] = itemstack != null ? itemstack.splitStack(1) : null; //May include unintended side effects. Possible fix for max stack size of 1?
|
||||
}*/
|
||||
|
||||
/* Multiblock */
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user