Some blocks

This commit is contained in:
Vincent Lee committed 2016-03-18 13:26:42 -05:00
1 parent 644d6553d1
commit 017829927f
8 files changed
+19 -17

No files matched your search

@@ -17,6 +17,7 @@ import net.minecraft.client.particle.EntityDiggingFX;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.MathHelper;
@@ -52,8 +53,8 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
}
@Override
public int getRenderType() {
return 2;
public EnumBlockRenderType getRenderType() {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
@@ -67,7 +68,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
}
@Override
public boolean addLandingEffects(net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles )
public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles )
{
float f = (float) MathHelper.ceiling_float_int(entity.fallDistance - 3.0F);
double d0 = (double)Math.min(0.2F + f / 15.0F, 10.0F);
@@ -85,7 +85,7 @@ public class Block18Stone extends BlockMod implements ILexiconable {
}
@Override
public ItemStack getPickBlock(RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos)));
}
@@ -80,7 +80,7 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
}
@Override
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
return side == EnumFacing.DOWN;
}
@@ -118,9 +118,9 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
public void onTickEnd(TickEvent.WorldTickEvent event) {
if(event.world.isRemote || event.phase != TickEvent.Phase.END)
return;
for(EntityPlayerMP player : event.world.getPlayers(EntityPlayerMP.class, p -> p.getEntityAttribute(SharedMonsterAttributes.movementSpeed).hasModifier(speedBoost))) {
for(EntityPlayerMP player : event.world.getPlayers(EntityPlayerMP.class, p -> p.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).hasModifier(speedBoost))) {
if (event.world.getBlockState(new BlockPos(player).down()).getBlock() != this) {
player.getEntityAttribute(SharedMonsterAttributes.movementSpeed).removeModifier(speedBoost);
player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).removeModifier(speedBoost);
}
} // todo 1.8 there's probably a better way to do this.
}
@@ -26,6 +26,7 @@ import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
@@ -82,8 +83,8 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
}
@Override
public int getRenderType() {
return 2;
public EnumBlockRenderType getRenderType() {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
@@ -117,7 +118,7 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
}
@Override
public boolean addLandingEffects(net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles) {
public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles) {
float f = (float) MathHelper.ceiling_float_int(entity.fallDistance - 3.0F);
double d0 = (double)Math.min(0.2F + f / 15.0F, 10.0F);
if (d0 > 2.5D) {
@@ -60,12 +60,12 @@ public class BlockStarfield extends BlockMod implements ILexiconable {
}
@Override
public boolean isFullCube() {
public boolean isFullCube(IBlockState state) {
return false;
}
@Override
public boolean isOpaqueCube() {
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@@ -7,7 +7,7 @@ public abstract class BlockLivingSlab extends BlockModSlab {
IBlockState sourceState;
public BlockLivingSlab(boolean full, IBlockState state) {
super(full, state.getBlock().getMaterial(), state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Slab" + (full ? "Full" : ""));
super(full, state.getMaterial(), state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Slab" + (full ? "Full" : ""));
setStepSound(state.getBlock().stepSound);
this.sourceState = state;
}
@@ -68,7 +68,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable {
public abstract BlockSlab getSingleBlock();
@Override
public ItemStack getPickBlock(RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
return new ItemStack(getSingleBlock());
}
@@ -107,7 +107,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable {
}
@Override
public final Object getVariant(ItemStack stack) {
public final Comparable<?> getTypeForItem(ItemStack stack) {
return DummyEnum.SINGLETON;
}
@@ -87,12 +87,12 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
}
@Override
public boolean isFullCube() {
public boolean isFullCube(IBlockState state) {
return false;
}
@Override
public boolean isOpaqueCube() {
public boolean isOpaqueCube(IBlockState state) {
return false;
}