mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
Lots of blocks
This commit is contained in:
1 parent
a268149d73
commit
5cc6879ecb
128 files changed
+684
-446
No files matched your search
@@ -21,6 +21,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
@@ -126,7 +127,7 @@ public class SubTileEntity {
|
||||
/**
|
||||
* Called when a player right clicks this sub tile.
|
||||
*/
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { return false; }
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) { return false; }
|
||||
|
||||
/**
|
||||
* Called when this sub tile is added to the world.
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -35,7 +36,7 @@ public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable
|
||||
public BlockAlfPortal() {
|
||||
super(Material.wood);
|
||||
setHardness(10F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.ALF_PORTAL);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.ALFPORTAL_STATE, AlfPortalState.OFF));
|
||||
}
|
||||
@@ -82,8 +83,8 @@ public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
return world.getBlockState(pos).getBlock() == this && world.getBlockState(pos).getValue(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : 0;
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return state.getValue(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -45,7 +46,7 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
public BlockAltGrass() {
|
||||
super(Material.grass);
|
||||
setHardness(0.6F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setUnlocalizedName(LibBlockNames.ALT_GRASS);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, AltGrassVariant.DRY));
|
||||
setTickRandomly(true);
|
||||
@@ -109,37 +110,37 @@ public class BlockAltGrass 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)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
|
||||
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
|
||||
EnumPlantType type = plantable.getPlantType(world, pos.down());
|
||||
return type == EnumPlantType.Plains || type == EnumPlantType.Beach;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random r) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random r) {
|
||||
if (state.getBlock() != this)
|
||||
return;
|
||||
AltGrassVariant variant = state.getValue(BotaniaStateProps.ALTGRASS_VARIANT);
|
||||
switch(variant) {
|
||||
case DRY: // Dry
|
||||
case DRY:
|
||||
break;
|
||||
case GOLDEN: // Golden
|
||||
case GOLDEN:
|
||||
break;
|
||||
case VIVID: // Vivid
|
||||
case VIVID:
|
||||
break;
|
||||
case SCORCHED: // Scorched
|
||||
case SCORCHED:
|
||||
if(r.nextInt(80) == 0)
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + r.nextFloat(), pos.getY() + 1.1, pos.getZ() + r.nextFloat(), 0, 0, 0);
|
||||
break;
|
||||
case INFUSED: // Infused
|
||||
case INFUSED:
|
||||
if(r.nextInt(100) == 0)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0F, 1F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
break;
|
||||
case MUTATED: // Mutated
|
||||
case MUTATED:
|
||||
if(r.nextInt(100) == 0) {
|
||||
if(r.nextInt(100) > 25)
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 0F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -26,6 +27,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
@@ -53,24 +56,26 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
|
||||
Random random;
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.125, 0.125, 0.125, 0.875, 20.0/16, 0.875);
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
protected BlockAltar() {
|
||||
super(Material.rock);
|
||||
setHardness(3.5F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.ALTAR);
|
||||
|
||||
float f = 1F / 16F * 2F;
|
||||
setBlockBounds(f, f, f, 1F - f, 1F / 16F * 20F, 1F - f);
|
||||
|
||||
random = new Random();
|
||||
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.DEFAULT)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.ALTAR_VARIANT);
|
||||
@@ -134,14 +139,13 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
TileAltar tile = (TileAltar) world.getTileEntity(pos);
|
||||
return (tile != null && tile.hasLava) ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumFacing par6, float par7, float par8, float par9) {
|
||||
ItemStack stack = par5EntityPlayer.getCurrentEquippedItem();
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileAltar tile = (TileAltar) par1World.getTileEntity(pos);
|
||||
if(par5EntityPlayer.isSneaking()) {
|
||||
for(int i = tile.getSizeInventory() - 1; i >= 0; i--) {
|
||||
@@ -307,12 +311,12 @@ public class BlockAltar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World par1World, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileAltar altar = (TileAltar) par1World.getTileEntity(pos);
|
||||
return altar.hasWater ? 15 : 0;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -21,6 +22,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -41,13 +45,25 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
|
||||
protected BlockAvatar() {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.AVATAR);
|
||||
setBlockBounds(EnumFacing.Axis.Z);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.NORTH));
|
||||
random = new Random();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
float f = 1F / 16F;
|
||||
float w = f * 9;
|
||||
float l = f * 6;
|
||||
float ws = (1F - w) / 2;
|
||||
float ls = (1F - l) / 2;
|
||||
|
||||
if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.Z)
|
||||
setBlockBounds(ws, 0F, ls, 1F - ws, 1F + f, 1F - ls);
|
||||
else setBlockBounds(ls, 0F, ws, 1F - ls, 1F + f, 1F - ws);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.CARDINALS);
|
||||
@@ -67,10 +83,9 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing s, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stackOnPlayer, EnumFacing s, float xs, float ys, float zs) {
|
||||
TileAvatar avatar = (TileAvatar) world.getTileEntity(pos);
|
||||
ItemStack stackOnAvatar = avatar.getItemHandler().getStackInSlot(0);
|
||||
ItemStack stackOnPlayer = player.getCurrentEquippedItem();
|
||||
if(stackOnAvatar != null) {
|
||||
ItemStack copyStack = stackOnAvatar.copy();
|
||||
avatar.getItemHandler().setStackInSlot(0, null);
|
||||
@@ -87,23 +102,6 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess w, BlockPos pos) {
|
||||
setBlockBounds(w.getBlockState(pos).getValue(BotaniaStateProps.CARDINALS).getAxis());
|
||||
}
|
||||
|
||||
public void setBlockBounds(EnumFacing.Axis horiz) {
|
||||
float f = 1F / 16F;
|
||||
float w = f * 9;
|
||||
float l = f * 6;
|
||||
float ws = (1F - w) / 2;
|
||||
float ls = (1F - l) / 2;
|
||||
|
||||
if(horiz == EnumFacing.Axis.Z)
|
||||
setBlockBounds(ws, 0F, ls, 1F - ws, 1F + f, 1F - ls);
|
||||
else setBlockBounds(ls, 0F, ws, 1F - ls, 1F + f, 1F - ws);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, BlockPos pos, IBlockState state) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
|
||||
@@ -158,8 +156,8 @@ public class BlockAvatar extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -40,7 +41,7 @@ public class BlockBifrost extends BlockMod implements ILexiconable {
|
||||
setLightOpacity(0);
|
||||
setLightLevel(1F);
|
||||
setBlockUnbreakable();
|
||||
setStepSound(soundTypeGlass);
|
||||
setSoundType(SoundType.GLASS);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@@ -55,19 +56,14 @@ public class BlockBifrost 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(ModItems.rainbowRod);
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, BlockPos pos, EnumFacing side) {
|
||||
Block block = p_149646_1_.getBlockState(pos).getBlock();
|
||||
|
||||
return block == this ? false : super.shouldSideBeRendered(p_149646_1_, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, BlockPos pos, EnumFacing side) {
|
||||
return shouldSideBeRendered1(p_149646_1_, pos, side.getOpposite());
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
return block != this && super.shouldSideBeRendered(state, world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -36,7 +37,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
setLightOpacity(0);
|
||||
setHardness(0.3F);
|
||||
setLightLevel(1F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setSoundType(SoundType.GLASS);
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@@ -45,19 +46,14 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, BlockPos pos, EnumFacing side) {
|
||||
Block block = p_149646_1_.getBlockState(pos).getBlock();
|
||||
|
||||
return block == this ? false : super.shouldSideBeRendered(p_149646_1_, pos, side);
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
return block != this && super.shouldSideBeRendered(state, world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, BlockPos pos, EnumFacing side) {
|
||||
return shouldSideBeRendered1(p_149646_1_, pos, side.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
if(rand.nextBoolean())
|
||||
Botania.proxy.sparkleFX(world, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -32,23 +34,22 @@ public abstract class BlockCamo extends BlockMod {
|
||||
super(par2Material);
|
||||
}
|
||||
|
||||
public static boolean isValidBlock(Block block) {
|
||||
return block.isOpaqueCube(IBlockState state) || block.getRenderType() == 3;
|
||||
public static boolean isValidBlock(IBlockState state) {
|
||||
return state.isOpaqueCube() || state.getRenderType() == EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumFacing par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack currentStack, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = par1World.getTileEntity(pos);
|
||||
|
||||
if(tile instanceof TileCamo) {
|
||||
TileCamo camo = (TileCamo) tile;
|
||||
ItemStack currentStack = par5EntityPlayer.getCurrentEquippedItem();
|
||||
|
||||
if(currentStack == null)
|
||||
currentStack = new ItemStack(Block.getBlockFromName("air"), 1, 0);
|
||||
|
||||
boolean doChange = true;
|
||||
Block block = null;
|
||||
IBlockState testState = null;
|
||||
checkChange : {
|
||||
if(currentStack.getItem() != Item.getItemFromBlock(Block.getBlockFromName("air"))) {
|
||||
if(Item.getIdFromItem(currentStack.getItem()) == 0) {
|
||||
@@ -56,21 +57,21 @@ public abstract class BlockCamo extends BlockMod {
|
||||
break checkChange;
|
||||
}
|
||||
|
||||
block = Block.getBlockFromItem(currentStack.getItem());
|
||||
if(block == null || !isValidBlock(block) || block instanceof BlockCamo || block.getMaterial() == Material.air)
|
||||
testState = Block.getBlockFromItem(currentStack.getItem()).getStateFromMeta(currentStack.getItemDamage());
|
||||
if(testState == null || !isValidBlock(testState) || testState.getBlock() instanceof BlockCamo || testState.getMaterial() == Material.air)
|
||||
doChange = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(doChange && currentStack.getItem() != null) {
|
||||
IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).getStateFromMeta(currentStack.getItemDamage());
|
||||
if(block instanceof BlockDirectional) {
|
||||
if(testState.getBlock() instanceof BlockDirectional) {
|
||||
if (BlockDirectional.FACING.getAllowedValues().contains(par6.getOpposite())) {
|
||||
changeState = changeState.withProperty(BlockDirectional.FACING, par6.getOpposite());
|
||||
}
|
||||
}
|
||||
camo.camoState = changeState;
|
||||
par1World.markBlockForUpdate(pos);
|
||||
par1World.notifyBlockUpdate(pos, state, state, 8);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -32,7 +33,7 @@ public class BlockCell extends BlockMod implements ILexiconable {
|
||||
public BlockCell() {
|
||||
super(Material.gourd);
|
||||
setUnlocalizedName(LibBlockNames.CELL_BLOCK);
|
||||
setStepSound(soundTypeCloth);
|
||||
setSoundType(SoundType.CLOTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,12 +13,16 @@ package vazkii.botania.common.block;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -31,15 +35,19 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockCocoon extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(3.0/16, 0, 3.0/16, 0.125, 0.875, 0.125);
|
||||
|
||||
protected BlockCocoon() {
|
||||
super(Material.cloth);
|
||||
setHardness(3.0F);
|
||||
setResistance(50.0F);
|
||||
setStepSound(soundTypeCloth);
|
||||
setSoundType(SoundType.CLOTH);
|
||||
setUnlocalizedName(LibBlockNames.COCOON);
|
||||
float f = 3F / 16F;
|
||||
float f1 = 14F / 16F;
|
||||
setBlockBounds(f, 0F, f, 1F - f, f1, 1F - f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,14 +61,13 @@ public class BlockCocoon extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing s, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack item, EnumFacing s, float xs, float ys, float zs) {
|
||||
TileCocoon cocoon = (TileCocoon) world.getTileEntity(pos);
|
||||
ItemStack item = player.getCurrentEquippedItem();
|
||||
if(cocoon.emeraldsGiven < TileCocoon.MAX_EMERALDS && item != null && item.getItem() == Items.emerald) {
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
item.stackSize--;
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -34,7 +35,7 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
|
||||
public BlockEnchantedSoil() {
|
||||
super(Material.grass);
|
||||
setHardness(0.6F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setUnlocalizedName(LibBlockNames.ENCHANTED_SOIL);
|
||||
}
|
||||
|
||||
@@ -49,7 +50,7 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
|
||||
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
|
||||
return plantable.getPlantType(world, pos.down()) == EnumPlantType.Plains;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -33,7 +34,7 @@ public class BlockEnderEye extends BlockMod implements ILexiconable {
|
||||
super(Material.iron);
|
||||
setHardness(3F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setUnlocalizedName(LibBlockNames.ENDER_EYE_BLOCK);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
@@ -54,12 +55,12 @@ public class BlockEnderEye extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
@@ -32,16 +33,22 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockFakeAir extends BlockMod {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
|
||||
public BlockFakeAir() {
|
||||
super(Material.air);
|
||||
setUnlocalizedName(LibBlockNames.FAKE_AIR);
|
||||
setBlockBounds(0, 0, 0, 0, 0, 0);
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.INVISIBLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,7 +89,7 @@ public class BlockFakeAir extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockNormalCube() {
|
||||
public boolean isBlockNormalCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -92,7 +99,7 @@ public class BlockFakeAir extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity e) {
|
||||
public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -102,7 +109,7 @@ public class BlockFakeAir extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeReplacedByLeaves(IBlockAccess world, BlockPos pos) {
|
||||
public boolean canBeReplacedByLeaves(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -117,12 +124,12 @@ public class BlockFakeAir extends BlockMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World par1World, BlockPos pos, IBlockState state) {
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World par1World, BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir(IBlockAccess world, BlockPos pos) {
|
||||
public boolean isAir(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -40,7 +41,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
|
||||
super(Material.gourd);
|
||||
setUnlocalizedName(LibBlockNames.FEL_PUMPKIN);
|
||||
setHardness(1F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
}
|
||||
|
||||
@@ -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.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
@@ -83,7 +84,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
int currentLight = tile instanceof TileSpecialFlower ? ((TileSpecialFlower) tile).getLightValue() : -1;
|
||||
if(currentLight == -1)
|
||||
@@ -92,32 +93,32 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).getComparatorInputOverride();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).getPowerLevel(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
return getWeakPower(world, pos, state, side);
|
||||
public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return getWeakPower(state, world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@@ -131,9 +132,8 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@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) {
|
||||
String name = ((TileSpecialFlower) world.getTileEntity(pos)).subTileName;
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
return ItemBlockSpecialFlower.ofType(new ItemStack(state.getBlock()), name);
|
||||
}
|
||||
|
||||
@@ -177,8 +177,8 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, side, hitX, hitY, hitZ) || super.onBlockActivated(world, pos, state, player, side, hitX, hitY, hitZ);
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ) || super.onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,12 +10,15 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -25,15 +28,21 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockForestEye extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75);
|
||||
|
||||
public BlockForestEye() {
|
||||
super(Material.iron);
|
||||
setHardness(5.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setSoundType(SoundType.METAL);
|
||||
setUnlocalizedName(LibBlockNames.FOREST_EYE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
@@ -45,12 +54,12 @@ public class BlockForestEye extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World par1World, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileForestEye eye = (TileForestEye) par1World.getTileEntity(pos);
|
||||
return Math.min(15, Math.max(0, eye.entities - 1));
|
||||
}
|
||||
|
||||
@@ -17,11 +17,13 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSkull;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.block.tile.TileGaiaHead;
|
||||
@@ -45,9 +47,8 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World p_149694_1_, BlockPos pos) {
|
||||
return ModItems.gaiaHead;
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(ModItems.gaiaHead);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,11 +72,6 @@ public class BlockGaiaHead extends BlockSkull {
|
||||
return ModItems.gaiaHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World p_149643_1_, BlockPos pos) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return 0;
|
||||
|
||||
@@ -68,12 +68,10 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMinecartUpdate(MinecartUpdateEvent event) {
|
||||
int x = MathHelper.floor_double(event.entity.posX);
|
||||
int y = MathHelper.floor_double(event.entity.posY);
|
||||
int z = MathHelper.floor_double(event.entity.posZ);
|
||||
BlockPos entPos = new BlockPos(event.entity);
|
||||
Block block = event.entity.worldObj.getBlockState(entPos).getBlock();
|
||||
boolean air = block.isAir(event.entity.worldObj, entPos);
|
||||
IBlockState state = event.entity.worldObj.getBlockState(entPos);
|
||||
Block block = state.getBlock();
|
||||
boolean air = block.isAir(state, event.entity.worldObj, entPos);
|
||||
int floatTicks = event.entity.getEntityData().getInteger(TAG_FLOAT_TICKS);
|
||||
|
||||
if(block == this)
|
||||
@@ -86,8 +84,9 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
|
||||
floatTicks = event.entity.getEntityData().getInteger(TAG_FLOAT_TICKS);
|
||||
|
||||
if(floatTicks > 0) {
|
||||
Block blockBelow = event.entity.worldObj.getBlockState(entPos.down()).getBlock();
|
||||
boolean airBelow = blockBelow.isAir(event.entity.worldObj, entPos.down());
|
||||
IBlockState stateBelow = event.entity.worldObj.getBlockState(entPos.down());
|
||||
Block blockBelow = stateBelow.getBlock();
|
||||
boolean airBelow = blockBelow.isAir(stateBelow, event.entity.worldObj, entPos.down());
|
||||
if(air && airBelow || !air && !airBelow)
|
||||
event.entity.noClip = true;
|
||||
event.entity.motionY = 0.2;
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -22,6 +23,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -43,23 +47,23 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable, IWandHUD, ILexiconable {
|
||||
|
||||
Random random;
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0, 0.25, 0.75, 1.15, 0.75);
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
protected BlockHourglass() {
|
||||
super(Material.iron);
|
||||
setUnlocalizedName(LibBlockNames.HOURGLASS);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
|
||||
float f = 1F / 16F;
|
||||
float w = 8F * f;
|
||||
float d = (1F - w) / 2;
|
||||
setBlockBounds(d, 0F, d, 1F - d, 1.15F, 1F - d);
|
||||
|
||||
random = new Random();
|
||||
setSoundType(SoundType.METAL);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
|
||||
@@ -76,10 +80,9 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float xs, float ys, float zs) {
|
||||
TileHourglass hourglass = (TileHourglass) world.getTileEntity(pos);
|
||||
ItemStack hgStack = hourglass.getItemHandler().getStackInSlot(0);
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() == ModItems.twigWand)
|
||||
return false;
|
||||
|
||||
@@ -107,12 +110,12 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
}
|
||||
|
||||
@@ -176,8 +179,8 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -18,6 +19,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -36,7 +38,7 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
|
||||
super(Material.wood);
|
||||
setUnlocalizedName(LibBlockNames.INCENSE_PLATE);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setBlockBounds(EnumFacing.Axis.Z);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
}
|
||||
@@ -60,9 +62,8 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing s, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
|
||||
TileIncensePlate plate = (TileIncensePlate) world.getTileEntity(pos);
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
ItemStack plateStack = plate.getItemHandler().getStackInSlot(0);
|
||||
boolean did = false;
|
||||
|
||||
@@ -100,20 +101,15 @@ public class BlockIncensePlate extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
return ((TileIncensePlate) world.getTileEntity(pos)).comparatorOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess w, BlockPos pos) {
|
||||
setBlockBounds(w.getBlockState(pos).getValue(BotaniaStateProps.CARDINALS).getAxis());
|
||||
}
|
||||
|
||||
public void setBlockBounds(EnumFacing.Axis axis) {
|
||||
float f = 1F / 16F;
|
||||
float w = 12 * f;
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -38,15 +39,21 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class BlockLightLauncher extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.25, 1);
|
||||
|
||||
public BlockLightLauncher() {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.LIGHT_LAUNCHER);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.25F, 1F);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.POWERED);
|
||||
|
||||
@@ -22,6 +22,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -40,14 +42,20 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(5.0/16, 5.0/16, 5.0/16, 11.0/16, 11.0/16, 11.0/16);
|
||||
|
||||
protected BlockLightRelay() {
|
||||
super(Material.glass);
|
||||
float f = 5F / 16F;
|
||||
setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f);
|
||||
setUnlocalizedName(LibBlockNames.LIGHT_RELAY);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.LUMINIZER_VARIANT, LuminizerVariant.DEFAULT).withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.LUMINIZER_VARIANT, BotaniaStateProps.POWERED);
|
||||
@@ -103,13 +111,13 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing s, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
|
||||
((TileLightRelay) world.getTileEntity(pos)).mountEntity(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World p_149668_1_, BlockPos pos, IBlockState state) {
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World p_149668_1_, BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -124,12 +132,12 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing s) {
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing s) {
|
||||
return state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR
|
||||
&& state.getValue(BotaniaStateProps.POWERED) ? 15 : 0;
|
||||
}
|
||||
@@ -145,8 +153,8 @@ public class BlockLightRelay extends BlockMod implements IWandable, ILexiconable
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -38,7 +39,7 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.LIVING_ROCK);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.DEFAULT));
|
||||
}
|
||||
@@ -84,8 +85,8 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos)));
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, getMetaFromState(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -42,7 +43,7 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
public BlockLivingwood(String name) {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(name);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.DEFAULT));
|
||||
}
|
||||
@@ -92,13 +93,13 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, getMetaFromState(world.getBlockState(pos)));
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, getMetaFromState(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
return world.getBlockState(pos).getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.GLIMMERING ? 12 : 0;
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.GLIMMERING ? 12 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,8 +109,8 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainLeaves(IBlockAccess world, BlockPos pos) {
|
||||
return world.getBlockState(pos).getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.DEFAULT;
|
||||
public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.DEFAULT;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -33,7 +34,7 @@ public class BlockManaBomb extends BlockMod implements IManaTrigger, ILexiconabl
|
||||
public BlockManaBomb() {
|
||||
super(Material.wood);
|
||||
setHardness(12.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.MANA_BOMB);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -55,11 +56,10 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
public BlockModDoubleFlower(boolean second) {
|
||||
this.second = second;
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(soundTypeGrass);
|
||||
this.setSoundType(SoundType.PLANT);
|
||||
offset = second ? 8 : 0;
|
||||
setUnlocalizedName(LibBlockNames.DOUBLE_FLOWER + (second ? 2 : 1));
|
||||
setHardness(0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
}
|
||||
@@ -101,8 +101,8 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, BlockPos pos, IBlockState state, TileEntity te) {
|
||||
if(p_149636_1_.isRemote || p_149636_2_.getCurrentEquippedItem() == null || p_149636_2_.getCurrentEquippedItem().getItem() != Items.shears || state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack) {
|
||||
if(p_149636_1_.isRemote || stack == null || stack.getItem() != Items.shears || state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
harvestBlockCopy(p_149636_1_, p_149636_2_, pos, state);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
int hex = state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
@@ -227,12 +227,11 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
}
|
||||
}
|
||||
|
||||
return state.withProperty(VARIANT, EnumPlantType.SUNFLOWER).withProperty(field_181084_N, EnumFacing.SOUTH);
|
||||
return state.withProperty(VARIANT, EnumPlantType.SUNFLOWER).withProperty(FACING, EnumFacing.SOUTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
state = state.getBlock().getActualState(state, world, pos);
|
||||
PropertyEnum<EnumDyeColor> prop = second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1;
|
||||
return new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getValue(prop).ordinal() - (second ? 8 : 0));
|
||||
|
||||
@@ -12,7 +12,7 @@ public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
|
||||
public BlockModDoubleFlower1() {
|
||||
super(false);
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(field_181084_N, EnumFacing.SOUTH)
|
||||
.withProperty(FACING, EnumFacing.SOUTH)
|
||||
.withProperty(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.WHITE));
|
||||
@@ -20,7 +20,7 @@ public class BlockModDoubleFlower1 extends BlockModDoubleFlower {
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, field_181084_N, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_1);
|
||||
return new BlockStateContainer(this, FACING, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,7 @@ public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
|
||||
public BlockModDoubleFlower2() {
|
||||
super(true);
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(field_181084_N, EnumFacing.SOUTH)
|
||||
.withProperty(FACING, EnumFacing.SOUTH)
|
||||
.withProperty(VARIANT, EnumPlantType.SUNFLOWER)
|
||||
.withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER)
|
||||
.withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.SILVER));
|
||||
@@ -21,7 +21,7 @@ public class BlockModDoubleFlower2 extends BlockModDoubleFlower {
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, field_181084_N, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_2);
|
||||
return new BlockStateContainer(this, FACING, VARIANT, HALF, BotaniaStateProps.DOUBLEFLOWER_VARIANT_2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -26,6 +27,7 @@ import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -44,9 +46,9 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockModFlower extends BlockFlower implements ILexiconable, IPickupAchievement, IGrowable {
|
||||
|
||||
public int originalLight;
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8);
|
||||
|
||||
public static final String ALT_DIR = "alt";
|
||||
public int originalLight;
|
||||
|
||||
protected BlockModFlower() {
|
||||
this(LibBlockNames.FLOWER);
|
||||
@@ -56,13 +58,17 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
super();
|
||||
setUnlocalizedName(name);
|
||||
setHardness(0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(registerInCreative() ? BotaniaCreativeTab.INSTANCE : null);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, getTypeProperty(), BotaniaStateProps.COLOR);
|
||||
@@ -119,7 +125,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) {
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
int hex = state.getValue(BotaniaStateProps.COLOR).getMapColor().colorValue;
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -56,7 +57,7 @@ public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable,
|
||||
public BlockOpenCrate() {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.OPEN_CRATE);
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(BotaniaStateProps.CRATE_VARIANT, CrateVariant.OPEN)
|
||||
@@ -118,12 +119,12 @@ public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable,
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World par1World, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileOpenCrate crate = (TileOpenCrate) par1World.getTileEntity(pos);
|
||||
return crate.getSignal();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ import gnu.trove.map.hash.TObjectIntHashMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonExtension;
|
||||
import net.minecraft.block.BlockPistonMoving;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.EnumPushReaction;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -32,14 +34,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.sound.BotaniaSoundEvents;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -62,7 +67,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
setUnlocalizedName(LibBlockNames.PISTON_RELAY);
|
||||
setHardness(2F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
@@ -104,7 +109,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
}
|
||||
|
||||
static IBlockState getStateAt(DimWithPos key) {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if(server == null)
|
||||
return null;
|
||||
return server.worldServerForDimension(key.dim).getBlockState(key.blockPos);
|
||||
@@ -117,7 +122,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
playerPositions.put(player.getName(), new DimWithPos(world.provider.getDimension(), pos));
|
||||
world.playSoundEffect(pos.getX(), pos.getY(), pos.getZ(), "botania:ding", 0.5F, 1F);
|
||||
world.playSound(null, pos, BotaniaSoundEvents.ding, SoundCategory.BLOCKS, 0.5F, 1F);
|
||||
} else {
|
||||
spawnAsEntity(world, pos, new ItemStack(this));
|
||||
world.setBlockToAir(pos);
|
||||
@@ -196,7 +201,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
boolean sticky = BlockPistonExtension.EnumPistonType.STICKY == state.getValue(BlockPistonMoving.TYPE);
|
||||
EnumFacing dir = state.getValue(BlockPistonMoving.FACING);
|
||||
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
|
||||
if(server != null && getTimeInCoords(s) == 0) {
|
||||
DimWithPos newPos;
|
||||
@@ -223,10 +228,10 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
|
||||
IBlockState srcState = world.getBlockState(pos2);
|
||||
TileEntity tile = world.getTileEntity(pos2);
|
||||
Material mat = srcState.getBlock().getMaterial();
|
||||
Material mat = srcState.getMaterial();
|
||||
|
||||
if(!sticky && tile == null && mat.getMaterialMobility() == 0 && srcState.getBlock().getBlockHardness(world, pos2) != -1 && !srcState.getBlock().isAir(world, pos2)) {
|
||||
Material destMat = world.getBlockState(pos2.offset(dir)).getBlock().getMaterial();
|
||||
if(!sticky && tile == null && mat.getMobilityFlag() == EnumPushReaction.NORMAL && srcState.getBlockHardness(world, pos2) != -1 && !srcState.getBlock().isAir(srcState, world, pos2)) {
|
||||
Material destMat = world.getBlockState(pos2.offset(dir)).getMaterial();
|
||||
if(world.isAirBlock(pos2.offset(dir)) || destMat.isReplaceable()) {
|
||||
world.setBlockState(pos2, Blocks.air.getDefaultState());
|
||||
world.setBlockState(pos2.offset(dir), srcState, 1 | 2);
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
@@ -50,7 +51,7 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.PLATFORM);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.HELD_STATE, null)
|
||||
@@ -119,16 +120,16 @@ public class BlockPlatform extends BlockCamo implements ILexiconable, IWandable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, BlockPos pos, IBlockState state, AxisAlignedBB par5AxisAlignedBB, List<AxisAlignedBB> par6List, Entity par7Entity) {
|
||||
public void addCollisionBoxToList(IBlockState state, World par1World, BlockPos pos, AxisAlignedBB par5AxisAlignedBB, List<AxisAlignedBB> par6List, Entity par7Entity) {
|
||||
PlatformVariant variant = state.getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
if(variant == PlatformVariant.INFRANGIBLE || variant == PlatformVariant.ABSTRUSE && par7Entity != null && par7Entity.posY > pos.getY() + 0.9 && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
|
||||
super.addCollisionBoxesToList(par1World, pos, state, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxToList(state, par1World, pos, par5AxisAlignedBB, par6List, par7Entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World par1World, BlockPos pos) {
|
||||
public float getBlockHardness(IBlockState state, World par1World, BlockPos pos) {
|
||||
PlatformVariant variant = par1World.getBlockState(pos).getValue(BotaniaStateProps.PLATFORM_VARIANT);
|
||||
return variant == PlatformVariant.INFRANGIBLE ? -1F : super.getBlockHardness(par1World, pos);
|
||||
return variant == PlatformVariant.INFRANGIBLE ? -1F : super.getBlockHardness(state, par1World, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -21,7 +22,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
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.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.crafting.IInfusionStabiliser;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
@@ -39,18 +43,23 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockPylon extends BlockMod implements ILexiconable, IInfusionStabiliser {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.125, 0, 0.125, 0.875, 21.0/16, 0.875);
|
||||
|
||||
public BlockPylon() {
|
||||
super(Material.iron);
|
||||
setHardness(5.5F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setUnlocalizedName(LibBlockNames.PYLON);
|
||||
setLightLevel(0.5F);
|
||||
|
||||
float f = 1F / 16F * 2F;
|
||||
setBlockBounds(f, 0F, f, 1F - f, 1F / 16F * 21F, 1F - f);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.PYLON_VARIANT, PylonVariant.MANA));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BotaniaStateProps.PYLON_VARIANT);
|
||||
@@ -102,8 +111,8 @@ public class BlockPylon extends BlockMod implements ILexiconable, IInfusionStabi
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -30,7 +31,7 @@ public class BlockRoot extends BlockMod implements ILexiconable {
|
||||
public BlockRoot() {
|
||||
super(Material.plants);
|
||||
setHardness(1.2F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.ROOT);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockVine;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -34,7 +35,7 @@ public class BlockSolidVines extends BlockVine implements ILexiconable {
|
||||
public BlockSolidVines() {
|
||||
setUnlocalizedName(LibBlockNames.SOLID_VINE);
|
||||
setHardness(0.5F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setCreativeTab(null);
|
||||
}
|
||||
|
||||
@@ -70,7 +71,7 @@ public class BlockSolidVines extends BlockVine 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(Blocks.vine);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -21,6 +22,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -36,17 +39,22 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockSparkChanger extends BlockMod implements ILexiconable {
|
||||
|
||||
Random random;
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 3.0/16, 1);
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
public BlockSparkChanger() {
|
||||
super(Material.rock);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 3F / 16F, 1F);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.SPARK_CHANGER);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, true));
|
||||
random = new Random();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,10 +100,9 @@ public class BlockSparkChanger extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing s, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack pstack, EnumFacing s, float xs, float ys, float zs) {
|
||||
TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(pos);
|
||||
ItemStack cstack = changer.getItemHandler().getStackInSlot(0);
|
||||
ItemStack pstack = player.getCurrentEquippedItem();
|
||||
if(cstack != null) {
|
||||
changer.getItemHandler().setStackInSlot(0, null);
|
||||
world.updateComparatorOutputLevel(pos, this);
|
||||
@@ -157,12 +164,12 @@ public class BlockSparkChanger extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
TileSparkChanger changer = (TileSparkChanger) world.getTileEntity(pos);
|
||||
ItemStack stack = changer.getItemHandler().getStackInSlot(0);
|
||||
if(stack == null)
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -32,6 +33,8 @@ import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
@@ -64,7 +67,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, IWandable, ILexiconable, IWandHUD {
|
||||
|
||||
static {
|
||||
BotaniaAPI.subtilesForCreativeMenu.addAll(Arrays.asList(new String[] {
|
||||
BotaniaAPI.subtilesForCreativeMenu.addAll(Arrays.asList(
|
||||
// Misc
|
||||
LibBlockNames.SUBTILE_PUREDAISY,
|
||||
LibBlockNames.SUBTILE_MANASTAR,
|
||||
@@ -110,24 +113,29 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
LibBlockNames.SUBTILE_VINCULOTUS,
|
||||
LibBlockNames.SUBTILE_SPECTRANTHEMUM,
|
||||
LibBlockNames.SUBTILE_BUBBELL,
|
||||
LibBlockNames.SUBTILE_SOLEGNOLIA
|
||||
}));
|
||||
LibBlockNames.SUBTILE_SOLEGNOLIA));
|
||||
}
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8);
|
||||
|
||||
protected BlockSpecialFlower() {
|
||||
super();
|
||||
setUnlocalizedName(LibBlockNames.SPECIAL_FLOWER);
|
||||
setHardness(0.1F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.SUBTILE_ID, "daybloom")
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE).withProperty(type, EnumFlowerType.POPPY)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStateContainer createBlockState() {
|
||||
return new ExtendedBlockState(this, new IProperty[] { getTypeProperty(), BotaniaStateProps.COLOR }, new IUnlistedProperty[] { BotaniaStateProps.SUBTILE_ID } );
|
||||
@@ -159,35 +167,35 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
int currentLight = world.getTileEntity(pos) == null ? -1 : ((TileSpecialFlower) world.getTileEntity(pos)).getLightValue();
|
||||
if(currentLight == -1)
|
||||
currentLight = 0;
|
||||
return LightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), currentLight);
|
||||
return LightHelper.getPackedColor(state.getValue(BotaniaStateProps.COLOR), currentLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).getComparatorInputOverride();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).getPowerLevel(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side) {
|
||||
return getWeakPower(world, pos, state, side);
|
||||
public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return getWeakPower(state, world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -217,14 +225,14 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@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) {
|
||||
String name = ((TileSpecialFlower) world.getTileEntity(pos)).subTileName;
|
||||
return ItemBlockSpecialFlower.ofType(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canPlaceBlockOn(Block block) {
|
||||
return super.canPlaceBlockOn(block) || block == ModBlocks.redStringRelay || block == Blocks.mycelium;
|
||||
public boolean canPlaceBlockAt(World world, BlockPos pos) {
|
||||
return super.canPlaceBlockAt(world, pos) || world.getBlockState(pos.down()).getBlock() == ModBlocks.redStringRelay || world.getBlockState(pos.down()).getBlock() == Blocks.mycelium;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -287,8 +295,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if(stack != null && stack.getItem() == ModItems.dye) {
|
||||
EnumDyeColor newColor = EnumDyeColor.byMetadata(stack.getItemDamage());
|
||||
EnumDyeColor oldColor = state.getValue(BotaniaStateProps.COLOR);
|
||||
@@ -296,7 +303,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
world.setBlockState(pos, state.withProperty(BotaniaStateProps.COLOR, newColor), 1 | 2);
|
||||
}
|
||||
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, side, hitX, hitY, hitZ);
|
||||
return ((TileSpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, stack, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -305,7 +312,7 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
|
||||
}
|
||||
|
||||
@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) {
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -38,7 +39,7 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
super(Material.iron);
|
||||
setHardness(3F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setUnlocalizedName(LibBlockNames.STORAGE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.MANASTEEL));
|
||||
}
|
||||
|
||||
@@ -19,8 +19,12 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -30,11 +34,17 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.01, 0.25, 0.75, 0.99, 0.75);
|
||||
|
||||
public BlockTeruTeruBozu() {
|
||||
super(Material.cloth);
|
||||
setUnlocalizedName(LibBlockNames.TERU_TERU_BOZU);
|
||||
float f = 0.25F;
|
||||
setBlockBounds(f, 0.01F, f, 1F - f, 0.99F, 1F - f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,8 +61,7 @@ public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing s, float xs, float ys, float zs) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
|
||||
if(stack != null && (isSunflower(stack) && removeRain(world) || isBlueOrchid(stack) && startRain(world))) {
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
stack.stackSize--;
|
||||
@@ -87,12 +96,12 @@ public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
|
||||
return world.isRaining() ? 15 : 0;
|
||||
}
|
||||
|
||||
@@ -107,8 +116,8 @@ public class BlockTeruTeruBozu extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,12 +10,15 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -25,16 +28,22 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockTinyPlanet extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(3.0/16, 3.0/16, 3.0/16, 13.0/16, 13.0/16, 13.0/16);
|
||||
|
||||
protected BlockTinyPlanet() {
|
||||
super(Material.rock);
|
||||
setHardness(20F);
|
||||
setResistance(100F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
float size = 3F / 16F;
|
||||
setBlockBounds(size, size, size, 1F - size, 1F - size, 1F - size);
|
||||
setUnlocalizedName(LibBlockNames.TINY_PLANET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
|
||||
@@ -10,33 +10,25 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.corporea;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
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.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import net.minecraftforge.common.property.Properties;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.StorageVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaBase;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -44,12 +36,12 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(3.0/16, 0, 3.0/16, 13.0/16, 1, 13.0/16);
|
||||
|
||||
public BlockCorporeaCrystalCube() {
|
||||
super(Material.iron, LibBlockNames.CORPOREA_CRYSTAL_CUBE);
|
||||
setHardness(5.5F);
|
||||
setStepSound(soundTypeMetal);
|
||||
float f = (1F - 10F / 16F) / 2F;
|
||||
setBlockBounds(f, 0F, f, 1F - f, 1F, 1F - f);
|
||||
setSoundType(SoundType.METAL);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState()).withProperty(Properties.AnimationProperty, null).withProperty(Properties.StaticProperty, true));
|
||||
}
|
||||
|
||||
@@ -81,6 +73,11 @@ public class BlockCorporeaCrystalCube extends BlockCorporeaBase implements ILexi
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
|
||||
if(stack != null) {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.corporea;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -31,7 +32,7 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase implements ILexiconab
|
||||
public BlockCorporeaFunnel() {
|
||||
super(Material.iron, LibBlockNames.CORPOREA_FUNNEL);
|
||||
setHardness(5.5F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.corporea;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.particle.EntityDiggingFX;
|
||||
@@ -39,7 +40,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
|
||||
public BlockCorporeaIndex() {
|
||||
super(Material.iron, LibBlockNames.CORPOREA_INDEX);
|
||||
setHardness(5.5F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block.corporea;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -34,7 +35,7 @@ public class BlockCorporeaInterceptor extends BlockCorporeaBase implements ILexi
|
||||
public BlockCorporeaInterceptor() {
|
||||
super(Material.iron, LibBlockNames.CORPOREA_INTERCEPTOR);
|
||||
setHardness(5.5F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.corporea;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -36,7 +37,7 @@ public class BlockCorporeaRetainer extends BlockMod implements ILexiconable, ICr
|
||||
public BlockCorporeaRetainer() {
|
||||
super(Material.iron);
|
||||
setHardness(5.5F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setUnlocalizedName(LibBlockNames.CORPOREA_RETAINER);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -39,7 +40,7 @@ public class Block18Stone extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.STONE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.FUTURESTONE_VARIANT, FutureStoneVariant.ANDESITE));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -33,7 +34,7 @@ public class BlockBlaze extends BlockMod implements ILexiconable, IFuelHandler {
|
||||
super(Material.iron);
|
||||
setHardness(3F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setLightLevel(1F);
|
||||
setUnlocalizedName(LibBlockNames.BLAZE_BLOCK);
|
||||
GameRegistry.registerFuelHandler(this);
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -29,12 +30,18 @@ import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
public class BlockBuriedPetals extends BlockModFlower {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.1, 1);
|
||||
|
||||
public BlockBuriedPetals() {
|
||||
super(LibBlockNames.BURIED_PETALS);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.1F, 1F);
|
||||
setLightLevel(0.25F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "easycoloredlights")
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -39,7 +40,7 @@ public class BlockCustomBrick extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.CUSTOM_BRICK);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, CustomBrickVariant.HELLISH_BRICK));
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -46,10 +47,9 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
|
||||
|
||||
public BlockDirtPath() {
|
||||
super(Material.ground);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 15F / 16F, 1F);
|
||||
setLightOpacity(255);
|
||||
setHardness(0.6F);
|
||||
setStepSound(soundTypeGravel);
|
||||
setSoundType(SoundType.GROUND);
|
||||
setUnlocalizedName(LibBlockNames.DIRT_PATH);
|
||||
useNeighborBrightness = true;
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
@@ -72,11 +72,12 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos) {
|
||||
Block blockAbove = world.getBlockState(pos.up()).getBlock();
|
||||
if(!blockAbove.isAir(world, pos.up()))
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 1, 1F);
|
||||
else setBlockBounds(0F, 0F, 0F, 1F, 15F / 16F, 1F);
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
IBlockState stateAbove = world.getBlockState(pos.up());
|
||||
Block blockAbove = stateAbove.getBlock();
|
||||
if(!blockAbove.isAir(stateAbove, world, pos.up()))
|
||||
return FULL_BLOCK_AABB;
|
||||
else return new AxisAlignedBB(0F, 0F, 0F, 1F, 15F / 16F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,11 +85,6 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
|
||||
return side == EnumFacing.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block block) {
|
||||
setBlockBoundsBasedOnState(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) {
|
||||
return new AxisAlignedBB(pos, pos.add(1, 1, 1));
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -39,7 +40,7 @@ public class BlockEndStoneBrick extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.END_STONE_BRICK);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.ENDBRICK_VARIANT, EndBrickVariant.END_STONE_BRICKS));
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
@@ -28,6 +29,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
@@ -65,6 +67,8 @@ import java.util.Random;
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfusionStabiliser {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.1, 0.1, 0.1, 0.9, 0.9, 0.9);
|
||||
|
||||
public BlockFloatingFlower() {
|
||||
this(LibBlockNames.MINI_ISLAND);
|
||||
}
|
||||
@@ -73,16 +77,19 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
|
||||
super(Material.ground);
|
||||
setUnlocalizedName(name);
|
||||
setHardness(0.5F);
|
||||
setStepSound(soundTypeGravel);
|
||||
setSoundType(SoundType.GROUND);
|
||||
setLightLevel(1F);
|
||||
|
||||
float f = 0.1F;
|
||||
setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f);
|
||||
setDefaultState(((IExtendedBlockState) blockState.getBaseState())
|
||||
.withProperty(BotaniaStateProps.ISLAND_TYPE, IslandType.GRASS)
|
||||
.withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -22,6 +23,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.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -37,13 +39,14 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockManaBeacon extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(3.0/16, 3.0/16, 3.0/16, 13.0/16, 13.0/16, 13.0/16);
|
||||
|
||||
public BlockManaBeacon() {
|
||||
super(Material.iron);
|
||||
setHardness(5.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
float size = 3F / 16F;
|
||||
setBlockBounds(size, size, size, 1F - size, 1F - size, 1F - size);
|
||||
setUnlocalizedName(LibBlockNames.MANA_BEACON);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
@@ -66,6 +69,11 @@ public class BlockManaBeacon extends BlockMod implements ILexiconable {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -39,15 +40,21 @@ import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
public class BlockManaFlame extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75);
|
||||
|
||||
public BlockManaFlame() {
|
||||
super(Material.cloth);
|
||||
setUnlocalizedName(LibBlockNames.MANA_FLAME);
|
||||
float f = 0.25F;
|
||||
setStepSound(soundTypeCloth);
|
||||
setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f);
|
||||
setSoundType(SoundType.CLOTH);
|
||||
setLightLevel(1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean registerInCreative() {
|
||||
return false;
|
||||
@@ -55,7 +62,7 @@ public class BlockManaFlame extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "easycoloredlights")
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return ((TileManaFlame) world.getTileEntity(pos)).getLightColor();
|
||||
}
|
||||
|
||||
@@ -87,7 +94,7 @@ public class BlockManaFlame extends BlockMod implements ILexiconable {
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
|
||||
if(WorldTypeSkyblock.isWorldSkyblock(world)) {
|
||||
if(stack != null && stack.getItem() == Item.getItemFromBlock(Blocks.sapling) && !player.inventory.hasItem(ModItems.lexicon)) {
|
||||
if(stack != null && stack.getItem() == Item.getItemFromBlock(Blocks.sapling) && !player.inventory.hasItemStack(new ItemStack(ModItems.lexicon))) {
|
||||
if(!world.isRemote)
|
||||
stack.stackSize--;
|
||||
if(!player.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon)))
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -35,7 +36,7 @@ public class BlockManaGlass extends BlockMod implements ILexiconable {
|
||||
public BlockManaGlass(String name) {
|
||||
super(Material.glass);
|
||||
setHardness(0.3F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setSoundType(SoundType.GLASS);
|
||||
setLightLevel(1.0F);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.BlockMushroom;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -24,6 +25,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -46,14 +48,14 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.crafting.IInfusionStabiliser", striprefs = true)
|
||||
public class BlockModMushroom extends BlockMushroom implements IInfusionStabiliser, IHornHarvestable, ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.3, 0, 0.3, 0.8, 1, 0.8);
|
||||
public int originalLight;
|
||||
|
||||
public BlockModMushroom() {
|
||||
setUnlocalizedName(LibBlockNames.MUSHROOM);
|
||||
setLightLevel(0.2F);
|
||||
setHardness(0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setTickRandomly(false);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
@@ -77,6 +79,11 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World p_149674_1_, BlockPos pos, IBlockState state, Random p_149674_5_) {
|
||||
// NO-OP, to prevent spreading
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -38,7 +39,7 @@ public class BlockPavement extends BlockMod {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.PAVEMENT);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -38,7 +39,7 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
|
||||
public BlockPetalBlock() {
|
||||
super(Material.plants);
|
||||
setHardness(0.4F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setUnlocalizedName(LibBlockNames.PETAL_BLOCK);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -41,7 +42,7 @@ public class BlockPrismarine extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.PRISMARINE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.PRISMARINE_VARIANT, PrismarineVariant.PRISMARINE));
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -35,7 +36,7 @@ public class BlockReeds extends BlockRotatedPillar implements ILexiconable {
|
||||
public BlockReeds() {
|
||||
super(Material.wood);
|
||||
setHardness(1.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.REED_BLOCK);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.AXIS_FACING, EnumFacing.Axis.Y));
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -29,7 +31,7 @@ public class BlockSeaLamp extends BlockMod implements ILexiconable {
|
||||
public BlockSeaLamp() {
|
||||
super(Material.glass);
|
||||
setHardness(0.3F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setSoundType(SoundType.GLASS);
|
||||
setLightLevel(1.0F);
|
||||
setUnlocalizedName(LibBlockNames.SEA_LAMP);
|
||||
}
|
||||
@@ -38,7 +40,7 @@ public class BlockSeaLamp extends BlockMod implements ILexiconable {
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "easycoloredlights")
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos) {
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return coloredLight == -1 ? (coloredLight = ColoredLightHelper.makeRGBLightValue(85, 136, 125, originalLight)) : coloredLight;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -27,7 +28,7 @@ public class BlockShimmerrock extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.SHIMMERROCK);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,7 +27,7 @@ public class BlockShimmerwoodPlanks extends BlockMod implements ILexiconable {
|
||||
public BlockShimmerwoodPlanks() {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.SHIMMERWOOD_PLANKS);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,14 +10,17 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -29,14 +32,20 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockStarfield extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.25, 1);
|
||||
|
||||
public BlockStarfield() {
|
||||
super(Material.iron);
|
||||
setHardness(5F);
|
||||
setResistance(2000F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
setUnlocalizedName(LibBlockNames.STARFIELD);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.25F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -26,7 +27,7 @@ public class BlockThatch extends BlockMod implements ILexiconable {
|
||||
public BlockThatch() {
|
||||
super(Material.grass);
|
||||
setHardness(1.0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setSoundType(SoundType.PLANT);
|
||||
setUnlocalizedName(LibBlockNames.THATCH);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
@@ -41,12 +42,13 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockTinyPotato extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.375, 0, 0.375, 0.625, 0.375, 0.625);
|
||||
|
||||
public BlockTinyPotato() {
|
||||
super(Material.cloth);
|
||||
setHardness(0.25F);
|
||||
setUnlocalizedName(LibBlockNames.TINY_POTATO);
|
||||
float f = 1F / 16F * 6F;
|
||||
setBlockBounds(f, 0, f, 1F - f, f, 1F - f);
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH)
|
||||
);
|
||||
@@ -83,6 +85,11 @@ public class BlockTinyPotato extends BlockMod implements ILexiconable {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockTinyPotato.class, par1Str);
|
||||
@@ -100,7 +107,7 @@ public class BlockTinyPotato extends BlockMod implements ILexiconable {
|
||||
if(tile instanceof TileTinyPotato) {
|
||||
((TileTinyPotato) tile).interact();
|
||||
par5EntityPlayer.addStat(ModAchievements.tinyPotatoPet, 1);
|
||||
par1World.spawnParticle(EnumParticleTypes.HEART, pos.getX() + minX + Math.random() * (maxX - minX), pos.getY() + maxY, pos.getZ() + minZ + Math.random() * (maxZ - minZ), 0, 0 ,0);
|
||||
par1World.spawnParticle(EnumParticleTypes.HEART, pos.getX() + AABB.minX + Math.random() * (AABB.maxX - AABB.minX), pos.getY() + AABB.maxY, pos.getZ() + AABB.minZ + Math.random() * (AABB.maxZ - AABB.minZ), 0, 0 ,0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,17 +15,22 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
@@ -39,12 +44,13 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75);
|
||||
|
||||
public BlockUnstable() {
|
||||
super(Material.iron);
|
||||
setHardness(5.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setSoundType(SoundType.METAL);
|
||||
setUnlocalizedName(LibBlockNames.UNSTABLE_BLOCK);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.WHITE));
|
||||
}
|
||||
@@ -67,6 +73,11 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
@@ -95,8 +106,9 @@ public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World par1World, BlockPos pos, Random par5Random) {
|
||||
int color = getRenderColor(state);
|
||||
int color = Minecraft.getMinecraft().getBlockColors().colorMultiplier(state, par1World, pos, 0);
|
||||
int colorBright = new Color(color).brighter().getRGB();
|
||||
int colorDark = new Color(color).darker().getRGB();
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block.decor.biomestone;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -35,7 +36,7 @@ public class BlockBiomeStone extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@@ -62,7 +63,7 @@ public class BlockBiomeStone 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)));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block.decor.panes;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPane;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -32,7 +33,7 @@ public class BlockModPane extends BlockPane {
|
||||
setUnlocalizedName(source.getUnlocalizedName().replaceAll("tile.", "") + "Pane");
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setHardness(0.3F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setSoundType(SoundType.GLASS);
|
||||
setLightLevel(1.0F);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -26,7 +27,7 @@ public class BlockEndStoneSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.endStoneBrick.getDefaultState());
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -28,7 +29,7 @@ public class BlockEnderBrickSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.endStoneBrick.getDefaultState().withProperty(BotaniaStateProps.ENDBRICK_VARIANT, EndBrickVariant.ENDER_BRICKS));
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ public abstract class BlockLivingSlab extends BlockModSlab {
|
||||
|
||||
public BlockLivingSlab(boolean full, IBlockState state) {
|
||||
super(full, state.getMaterial(), state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Slab" + (full ? "Full" : ""));
|
||||
setStepSound(state.getBlock().stepSound);
|
||||
setSoundType(state.getBlock().getSoundType());
|
||||
this.sourceState = state;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -25,7 +26,7 @@ public class BlockReedSlab extends BlockLivingSlab {
|
||||
public BlockReedSlab(boolean full) {
|
||||
super(full, ModBlocks.reedBlock.getDefaultState());
|
||||
setHardness(1.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -25,7 +26,7 @@ public class BlockThatchSlab extends BlockLivingSlab {
|
||||
public BlockThatchSlab(boolean full) {
|
||||
super(full, ModBlocks.thatch.getDefaultState());
|
||||
setHardness(1.0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
setSoundType(SoundType.PLANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs.bricks;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -33,7 +34,7 @@ public class BlockCustomBrickSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.customBrick.getDefaultState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, variant));
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs.living;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LivingRockVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -13,7 +14,7 @@ public class BlockLivingrockBrickSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK));
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs.living;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -11,7 +12,7 @@ public class BlockLivingrockSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.livingrock.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs.living;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -21,7 +22,7 @@ public class BlockShimmerrockSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.shimmerrock.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs.living;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -21,7 +22,7 @@ public class BlockShimmerwoodPlankSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.shimmerwoodPlanks.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package vazkii.botania.common.block.decor.slabs.prismarine;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -23,7 +24,7 @@ public class BlockPrismarineSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.prismarine.getDefaultState().withProperty(BotaniaStateProps.PRISMARINE_VARIANT, variant));
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.walls;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -24,7 +25,7 @@ public class BlockPrismarineWall extends BlockModWall {
|
||||
super(ModBlocks.prismarine, 0);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.walls;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class BlockReedWall extends BlockModWall {
|
||||
@@ -17,7 +18,7 @@ public class BlockReedWall extends BlockModWall {
|
||||
public BlockReedWall() {
|
||||
super(ModBlocks.reedBlock, 0);
|
||||
setHardness(1.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.walls.living;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.walls.BlockModWall;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class BlockDreamwoodWall extends BlockModWall {
|
||||
public BlockDreamwoodWall() {
|
||||
super(ModBlocks.dreamwood, 0);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.walls.living;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.walls.BlockModWall;
|
||||
|
||||
@@ -19,7 +20,7 @@ public class BlockLivingrockWall extends BlockModWall {
|
||||
super(ModBlocks.livingrock, 0);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.walls.living;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.walls.BlockModWall;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class BlockLivingwoodWall extends BlockModWall {
|
||||
public BlockLivingwoodWall() {
|
||||
super(ModBlocks.livingwood, 0);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -37,7 +37,7 @@ public class BlockAlchemyCatalyst extends BlockMod implements ILexiconable, IPoo
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -17,8 +18,12 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -31,14 +36,15 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockBellows extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.1875, 0, 0.1875, 1-0.1875, 10.0 / 16, 1-0.1875);
|
||||
|
||||
public BlockBellows() {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.BELLOWS);
|
||||
|
||||
float f = (1F - 10 / 16F) / 2F;
|
||||
setBlockBounds(f, 0F, f, 1F - f, 10F / 16F, 1F - f);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
}
|
||||
|
||||
@@ -60,13 +66,18 @@ public class BlockBellows extends BlockMod implements ILexiconable {
|
||||
return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World p_149689_1_, BlockPos pos, IBlockState state, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
|
||||
p_149689_1_.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, p_149689_5_.getHorizontalFacing()), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing s, float xs, float ys, float zs) {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) {
|
||||
if(EntityDoppleganger.isTruePlayer(player))
|
||||
((TileBellows) world.getTileEntity(pos)).interact();
|
||||
return true;
|
||||
@@ -83,8 +94,8 @@ public class BlockBellows extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block.mana;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -22,8 +23,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -37,18 +42,17 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
|
||||
Random random;
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.375, 0.05, 0.375, 0.625, 0.95, 0.625);
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
public BlockBrewery() {
|
||||
super(Material.rock);
|
||||
float f = 6F / 16F;
|
||||
setBlockBounds(f, 0.05F, f, 1F - f, 0.95F, 1F - f);
|
||||
setUnlocalizedName(LibBlockNames.BREWERY);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
random = new Random();
|
||||
setSoundType(SoundType.STONE);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@@ -68,7 +72,12 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumFacing side, float par7, float par8, float par9) {
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9) {
|
||||
TileBrewery brew = (TileBrewery) par1World.getTileEntity(pos);
|
||||
|
||||
if(par5EntityPlayer.isSneaking()) {
|
||||
@@ -85,7 +94,6 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ItemStack stack = par5EntityPlayer.getCurrentEquippedItem();
|
||||
if(stack != null)
|
||||
return brew.addItem(par5EntityPlayer, stack);
|
||||
}
|
||||
@@ -131,19 +139,19 @@ public class BlockBrewery extends BlockMod implements ILexiconable, IWandHUD {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World par1World, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TileBrewery brew = (TileBrewery) par1World.getTileEntity(pos);
|
||||
return brew.signal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BlockDistributor extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.DISTRIBUTOR);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable,
|
||||
setHardness(3.0F);
|
||||
setResistance(5.0F);
|
||||
setLightLevel(1.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.ENCHANTER);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.ENCHANTER_DIRECTION, EnumFacing.Axis.X));
|
||||
random = new Random();
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
setBlockBounds(f * 3, 0F, f * 3, 1F - f * 3, 1F - f * 2, 1F - f * 3);
|
||||
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.FOREST_DRUM);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.DRUM_VARIANT, DrumVariant.WILD));
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class BlockManaDetector extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setSoundType(Block.SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.MANA_DETECTOR);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POWERED, false));
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BlockManaVoid extends BlockMod implements ILexiconable, IPoolOverla
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(2000F);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setSoundType(Block.SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.MANA_VOID);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -29,13 +29,12 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
@@ -44,7 +43,6 @@ import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.PoolVariant;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
@@ -56,15 +54,16 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexiconable, ICraftAchievement {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.5, 1);
|
||||
|
||||
boolean lastFragile = false;
|
||||
|
||||
public BlockPool() {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.POOL);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
|
||||
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POOL_VARIANT, PoolVariant.DEFAULT));
|
||||
|
||||
@@ -89,6 +88,11 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
return getDefaultState().withProperty(BotaniaStateProps.POOL_VARIANT, PoolVariant.values()[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return false;
|
||||
@@ -166,7 +170,7 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@@ -181,17 +185,17 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
public boolean hasComparatorInputOverride(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World par1World, BlockPos pos) {
|
||||
public int getComparatorInputOverride(IBlockState state, World par1World, BlockPos pos) {
|
||||
TilePool pool = (TilePool) par1World.getTileEntity(pos);
|
||||
int val = (int) ((double) pool.getCurrentMana() / (double) pool.manaCap * 15.0);
|
||||
if(pool.getCurrentMana() > 0)
|
||||
|
||||
@@ -47,7 +47,7 @@ public class BlockPrism extends BlockMod implements IManaTrigger, ILexiconable {
|
||||
public BlockPrism() {
|
||||
super(Material.glass);
|
||||
setHardness(0.3F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setSoundType(SoundType.GLASS);
|
||||
setLightLevel(1.0F);
|
||||
setUnlocalizedName(LibBlockNames.PRISM);
|
||||
float f = 0.25F;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class BlockPump extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.PUMP);
|
||||
setBlockBounds(EnumFacing.Axis.X);
|
||||
setDefaultState(blockState.getBaseState().withProperty(Properties.StaticProperty, true).withProperty(BotaniaStateProps.CARDINALS, EnumFacing.SOUTH));
|
||||
|
||||
@@ -32,7 +32,7 @@ public class BlockRFGenerator extends BlockMod implements ILexiconable {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.RF_GENERATOR);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BlockRuneAltar extends BlockMod implements IWandable, ILexiconable
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.75F, 1F);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setSoundType(SoundType.STONE);
|
||||
setUnlocalizedName(LibBlockNames.RUNE_ALTAR);
|
||||
|
||||
BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE);
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -30,12 +30,12 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
@@ -44,12 +44,10 @@ import vazkii.botania.api.state.enums.SpreaderVariant;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.api.wand.IWireframeAABBProvider;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetaNameAndColor;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
@@ -61,7 +59,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
public BlockSpreader() {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setSoundType(SoundType.WOOD);
|
||||
setUnlocalizedName(LibBlockNames.SPREADER);
|
||||
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.SPREADER_VARIANT, SpreaderVariant.MANA));
|
||||
random = new Random();
|
||||
@@ -104,7 +102,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, BlockPos pos, IBlockState state, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
EnumFacing orientation = BlockPistonBase.getFacingFromEntity(par1World, pos, par5EntityLivingBase);
|
||||
EnumFacing orientation = BlockPistonBase.getFacingFromEntity(pos, par5EntityLivingBase);
|
||||
TileSpreader spreader = (TileSpreader) par1World.getTileEntity(pos);
|
||||
par1World.setBlockState(pos, getStateFromMeta(par6ItemStack.getItemDamage()), 1 | 2);
|
||||
|
||||
@@ -145,19 +143,18 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumFacing par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9) {
|
||||
TileEntity tile = par1World.getTileEntity(pos);
|
||||
if(!(tile instanceof TileSpreader))
|
||||
return false;
|
||||
|
||||
TileSpreader spreader = (TileSpreader) tile;
|
||||
ItemStack lens = spreader.getItemHandler().getStackInSlot(0);
|
||||
ItemStack heldItem = par5EntityPlayer.getCurrentEquippedItem();
|
||||
boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens;
|
||||
boolean wool = heldItem != null && heldItem.getItem() == Item.getItemFromBlock(Blocks.wool);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable {
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 3F / 16F, 1F);
|
||||
setHardness(3F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setSoundType(SoundType.METAL);
|
||||
|
||||
setUnlocalizedName(LibBlockNames.TERRA_PLATE);
|
||||
|
||||
|
||||
Loaded 100 of 128 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user