Block fixes
This commit is contained in:
parent
252a4559f0
commit
10c6829482
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
#Thu Mar 17 16:37:36 EDT 2016
|
||||
#Fri Mar 18 12:08:18 EDT 2016
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -11,16 +10,26 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import WayofTime.bloodmagic.tile.TileAlchemyArray;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
public class BlockAlchemyArray extends BlockContainer
|
||||
{
|
||||
protected static final AxisAlignedBB ARRAY_AABB = new AxisAlignedBB(0, 0, 0, 1, 0.1, 1);
|
||||
|
||||
public BlockAlchemyArray()
|
||||
{
|
||||
super(Material.cloth);
|
||||
|
@ -28,43 +37,60 @@ public class BlockAlchemyArray extends BlockContainer
|
|||
setUnlocalizedName(Constants.Mod.MODID + ".alchemyArray");
|
||||
setRegistryName(Constants.BloodMagicBlock.ALCHEMY_ARRAY.getRegName());
|
||||
setHardness(0.1f);
|
||||
setBlockBounds(0, 0, 0, 1, 0.1f, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
|
||||
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
|
||||
{
|
||||
// No-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
return ARRAY_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumWorldBlockLayer getBlockLayer()
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return EnumBlockRenderType.INVISIBLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileAlchemyArray array = (TileAlchemyArray) world.getTileEntity(pos);
|
||||
|
||||
if (array == null || player.isSneaking())
|
||||
return false;
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
ItemStack playerItem = player.getHeldItem(hand);
|
||||
|
||||
if (playerItem != null)
|
||||
{
|
||||
|
@ -81,12 +107,12 @@ public class BlockAlchemyArray extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(pos);
|
||||
world.notifyBlockUpdate(pos, state, state, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
return new ItemStack(ModItems.arcaneAshes);
|
||||
}
|
||||
|
@ -97,12 +123,6 @@ public class BlockAlchemyArray extends BlockContainer
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.altar.IAltarManipulator;
|
||||
|
@ -11,21 +30,8 @@ import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
|||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import com.google.common.base.Strings;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
public class BlockAltar extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -42,13 +48,13 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
if (world.isRemote)
|
||||
return 0;
|
||||
|
@ -89,13 +95,13 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -107,9 +113,9 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -119,20 +125,20 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileAltar altar = (TileAltar) world.getTileEntity(pos);
|
||||
|
||||
if (altar == null || player.isSneaking())
|
||||
return false;
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
ItemStack playerItem = player.inventory.getCurrentItem();
|
||||
|
||||
if (playerItem != null)
|
||||
{
|
||||
if (playerItem.getItem() instanceof IAltarReader || playerItem.getItem() instanceof IAltarManipulator)
|
||||
{
|
||||
playerItem.getItem().onItemRightClick(playerItem, world, player);
|
||||
playerItem.getItem().onItemRightClick(playerItem, world, player, hand);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +148,7 @@ public class BlockAltar extends BlockContainer implements IVariantProvider
|
|||
else
|
||||
altar.setActive();
|
||||
|
||||
world.markBlockForUpdate(pos);
|
||||
world.notifyBlockUpdate(pos, state, state, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +1,29 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
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 java.util.List;
|
||||
import java.util.Random;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
|
||||
public class BlockBloodLight extends Block
|
||||
{
|
||||
protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.4, 0.4, 0.4, 0.6, 0.6, 0.6);
|
||||
|
||||
public BlockBloodLight()
|
||||
{
|
||||
super(Material.cloth);
|
||||
|
@ -30,26 +33,38 @@ public class BlockBloodLight extends Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
|
||||
{
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumWorldBlockLayer getBlockLayer()
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockState state)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
|
@ -68,26 +83,26 @@ public class BlockBloodLight extends Block
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)
|
||||
{
|
||||
EntityPlayerSP playerSP = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (rand.nextInt(3) != 0)
|
||||
{
|
||||
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
if (playerSP.getHeldItem() != null && playerSP.getHeldItem().getItem() == ModItems.sigilBloodLight)
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
if (playerSP.getActiveItemStack() != null && playerSP.getActiveItemStack().getItem() == ModItems.sigilBloodLight)
|
||||
{
|
||||
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
world.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity)
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
this.setBlockBounds(0.35F, 0.35F, 0.35F, 0.65F, 0.65F, 0.65F);
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,9 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.block.base.BlockString;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
|
@ -22,7 +24,7 @@ public class BlockBloodRune extends BlockString implements IVariantProvider
|
|||
setUnlocalizedName(Constants.Mod.MODID + ".rune.");
|
||||
setRegistryName(Constants.BloodMagicBlock.BLOOD_RUNE.getRegName());
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setStepSound(soundTypeStone);
|
||||
setStepSound(SoundType.STONE);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
|
|
|
@ -4,7 +4,9 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.block.base.BlockString;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
|
@ -24,7 +26,7 @@ public class BlockBloodStoneBrick extends BlockString implements IVariantProvide
|
|||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setStepSound(SoundType.STONE);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.TileBloodTank;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -12,16 +12,19 @@ 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.BlockPos;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.TileBloodTank;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
public class BlockBloodTank extends BlockContainer
|
||||
{
|
||||
|
@ -33,7 +36,7 @@ public class BlockBloodTank extends BlockContainer
|
|||
setRegistryName(Constants.BloodMagicBlock.BLOOD_TANK.getRegName());
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeGlass);
|
||||
setStepSound(SoundType.GLASS);
|
||||
setHarvestLevel("pickaxe", 1);
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
}
|
||||
|
@ -45,32 +48,32 @@ public class BlockBloodTank extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState blockState, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos blockPos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileBloodTank fluidHandler = (TileBloodTank) world.getTileEntity(blockPos);
|
||||
if (Utils.fillHandlerWithContainer(world, fluidHandler, player))
|
||||
{
|
||||
world.markBlockForUpdate(blockPos);
|
||||
world.notifyBlockUpdate(blockPos, state, state, 3);
|
||||
return true;
|
||||
}
|
||||
if (Utils.fillContainerFromHandler(world, fluidHandler, player, fluidHandler.tank.getFluid()))
|
||||
{
|
||||
world.markBlockForUpdate(blockPos);
|
||||
world.notifyBlockUpdate(blockPos, state, state, 3);
|
||||
return true;
|
||||
}
|
||||
if (FluidContainerRegistry.isContainer(player.getCurrentEquippedItem()))
|
||||
if (FluidContainerRegistry.isContainer(heldItem))
|
||||
{
|
||||
world.markBlockForUpdate(blockPos);
|
||||
world.notifyBlockUpdate(blockPos, state, state, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onBlockActivated(world, blockPos, blockState, player, side, hitX, hitY, hitZ);
|
||||
return super.onBlockActivated(world, blockPos, state, player, hand, heldItem, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -112,7 +115,7 @@ public class BlockBloodTank extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos)
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
|
@ -129,7 +132,7 @@ public class BlockBloodTank extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
return getDrops(world, pos, world.getBlockState(pos), 0).get(0);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,9 @@ import WayofTime.bloodmagic.BloodMagic;
|
|||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.block.base.BlockString;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
|
@ -22,7 +24,7 @@ public class BlockCrystal extends BlockString implements IVariantProvider
|
|||
setUnlocalizedName(Constants.Mod.MODID + ".crystal.");
|
||||
setRegistryName(Constants.BloodMagicBlock.CRYSTAL.getRegName());
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setStepSound(soundTypeStone);
|
||||
setStepSound(SoundType.STONE);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.soul.IDemonWillGem;
|
||||
|
@ -7,20 +26,6 @@ import WayofTime.bloodmagic.api.soul.IDiscreteDemonWill;
|
|||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrucible;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockDemonCrucible extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -39,13 +44,13 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -57,9 +62,9 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -69,18 +74,16 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileDemonCrucible crucible = (TileDemonCrucible) world.getTileEntity(pos);
|
||||
|
||||
if (crucible == null || player.isSneaking())
|
||||
return false;
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
|
||||
if (playerItem != null)
|
||||
if (heldItem != null)
|
||||
{
|
||||
if (!(playerItem.getItem() instanceof IDiscreteDemonWill) && !(playerItem.getItem() instanceof IDemonWillGem))
|
||||
if (!(heldItem.getItem() instanceof IDiscreteDemonWill) && !(heldItem.getItem() instanceof IDemonWillGem))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -88,7 +91,7 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid
|
|||
|
||||
Utils.insertItemToTile(crucible, player);
|
||||
|
||||
world.markBlockForUpdate(pos);
|
||||
world.notifyBlockUpdate(pos, state, state, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,33 +1,35 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
|
||||
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
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 java.util.List;
|
||||
import java.util.Random;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
|
||||
import WayofTime.bloodmagic.item.ItemDemonCrystal;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystal;
|
||||
|
||||
public class BlockDemonCrystal extends BlockContainer
|
||||
{
|
||||
|
@ -55,7 +57,7 @@ public class BlockDemonCrystal extends BlockContainer
|
|||
IBlockState offsetState = world.getBlockState(offsetPos);
|
||||
Block offsetBlock = offsetState.getBlock();
|
||||
|
||||
return offsetBlock.isSideSolid(world, offsetPos, side) && this.canPlaceBlockAt(world, pos);
|
||||
return offsetBlock.isSideSolid(offsetState, world, offsetPos, side) && this.canPlaceBlockAt(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -67,7 +69,7 @@ public class BlockDemonCrystal extends BlockContainer
|
|||
IBlockState offsetState = world.getBlockState(offsetPos);
|
||||
Block offsetBlock = offsetState.getBlock();
|
||||
|
||||
if (!offsetBlock.isSideSolid(world, offsetPos, placement))
|
||||
if (!offsetBlock.isSideSolid(offsetState, world, offsetPos, placement))
|
||||
{
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
|
@ -89,13 +91,13 @@ public class BlockDemonCrystal extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -107,9 +109,9 @@ public class BlockDemonCrystal extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
// public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
|
||||
|
@ -136,9 +138,9 @@ public class BlockDemonCrystal extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[] { TYPE, AGE, ATTACHED });
|
||||
return new BlockStateContainer(this, new IProperty[] { TYPE, AGE, ATTACHED });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -191,7 +193,7 @@ public class BlockDemonCrystal extends BlockContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
|
@ -204,7 +206,7 @@ public class BlockDemonCrystal extends BlockContainer
|
|||
{
|
||||
crystal.dropSingleCrystal();
|
||||
|
||||
world.markBlockForUpdate(pos);
|
||||
world.notifyBlockUpdate(pos, state, state, 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,21 +1,25 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileDemonCrystallizer;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockDemonCrystallizer extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -34,19 +38,19 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
return side == EnumFacing.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -58,9 +62,9 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,18 +1,24 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileDemonPylon;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockDemonPylon extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -31,13 +37,13 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -49,9 +55,9 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
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 WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.ritual.IMasterRitualStone;
|
||||
import WayofTime.bloodmagic.api.teleport.PortalLocation;
|
||||
|
@ -8,21 +22,6 @@ import WayofTime.bloodmagic.block.base.BlockIntegerContainer;
|
|||
import WayofTime.bloodmagic.ritual.portal.LocationsHandler;
|
||||
import WayofTime.bloodmagic.ritual.portal.Teleports;
|
||||
import WayofTime.bloodmagic.tile.TileDimensionalPortal;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockDimensionalPortal extends BlockIntegerContainer
|
||||
{
|
||||
|
@ -44,7 +43,7 @@ public class BlockDimensionalPortal extends BlockIntegerContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -60,7 +59,7 @@ public class BlockDimensionalPortal extends BlockIntegerContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos)
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
|
|
|
@ -1,23 +1,30 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
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 org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileIncenseAltar;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockIncenseAltar extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
|
||||
|
||||
public BlockIncenseAltar()
|
||||
{
|
||||
super(Material.rock);
|
||||
|
@ -28,18 +35,22 @@ public class BlockIncenseAltar extends BlockContainer implements IVariantProvide
|
|||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
|
||||
setBlockBounds(0.3F, 0F, 0.3F, 0.72F, 1F, 0.72F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -51,9 +62,9 @@ public class BlockIncenseAltar extends BlockContainer implements IVariantProvide
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
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.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.routing.TileInputRoutingNode;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockInputRoutingNode extends BlockRoutingNode
|
||||
{
|
||||
|
@ -20,12 +22,6 @@ public class BlockInputRoutingNode extends BlockRoutingNode
|
|||
setRegistryName(Constants.BloodMagicBlock.INPUT_ROUTING_NODE.getRegName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
|
@ -46,7 +42,7 @@ public class BlockInputRoutingNode extends BlockRoutingNode
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(pos) instanceof TileInputRoutingNode)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.routing.TileItemRoutingNode;
|
||||
import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockItemRoutingNode extends BlockRoutingNode
|
||||
{
|
||||
|
@ -18,12 +18,6 @@ public class BlockItemRoutingNode extends BlockRoutingNode
|
|||
setRegistryName(Constants.BloodMagicBlock.ITEM_ROUTING_NODE.getRegName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import java.awt.Color;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.awt.*;
|
||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class BlockLifeEssence extends BlockFluidClassic
|
||||
{
|
||||
|
@ -33,13 +33,13 @@ public class BlockLifeEssence extends BlockFluidClassic
|
|||
@Override
|
||||
public boolean canDisplace(IBlockAccess world, BlockPos blockPos)
|
||||
{
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.canDisplace(world, blockPos);
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial(world.getBlockState(blockPos)).isLiquid() && super.canDisplace(world, blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean displaceIfPossible(World world, BlockPos blockPos)
|
||||
{
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.displaceIfPossible(world, blockPos);
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial(world.getBlockState(blockPos)).isLiquid() && super.displaceIfPossible(world, blockPos);
|
||||
}
|
||||
|
||||
public static class FluidLifeEssence extends Fluid
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
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.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.routing.TileMasterRoutingNode;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMasterRoutingNode extends BlockRoutingNode
|
||||
{
|
||||
|
@ -24,12 +26,6 @@ public class BlockMasterRoutingNode extends BlockRoutingNode
|
|||
setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
|
@ -37,7 +33,7 @@ public class BlockMasterRoutingNode extends BlockRoutingNode
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(pos) instanceof TileMasterRoutingNode)
|
||||
{
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
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.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.routing.TileOutputRoutingNode;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockOutputRoutingNode extends BlockRoutingNode
|
||||
{
|
||||
|
@ -20,12 +22,6 @@ public class BlockOutputRoutingNode extends BlockRoutingNode
|
|||
setRegistryName(Constants.BloodMagicBlock.OUTPUT_ROUTING_NODE.getRegName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
|
@ -46,7 +42,7 @@ public class BlockOutputRoutingNode extends BlockRoutingNode
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(pos) instanceof TileOutputRoutingNode)
|
||||
{
|
||||
|
|
|
@ -1,19 +1,22 @@
|
|||
package WayofTime.bloodmagic.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.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.incense.IIncensePath;
|
||||
import WayofTime.bloodmagic.block.base.BlockString;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockPath extends BlockString implements IIncensePath, IVariantProvider
|
||||
{
|
||||
|
@ -28,7 +31,7 @@ public class BlockPath extends BlockString implements IIncensePath, IVariantProv
|
|||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setStepSound(SoundType.STONE);
|
||||
|
||||
setHarvestLevel("axe", 0, getStateFromMeta(0));
|
||||
setHarvestLevel("axe", 0, getStateFromMeta(1));
|
||||
|
|
|
@ -1,18 +1,21 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
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.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.block.base.BlockStringContainer;
|
||||
import WayofTime.bloodmagic.tile.TilePlinth;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPedestal extends BlockStringContainer
|
||||
{
|
||||
|
@ -30,7 +33,7 @@ public class BlockPedestal extends BlockStringContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
switch (getMetaFromState(state))
|
||||
{
|
||||
|
@ -58,34 +61,46 @@ public class BlockPedestal extends BlockStringContainer
|
|||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(pos);
|
||||
world.notifyBlockUpdate(pos, state, state, 3);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, BlockPos pos)
|
||||
{
|
||||
IBlockState state = blockAccess.getBlockState(pos);
|
||||
|
||||
if (getMetaFromState(state) == 0)
|
||||
setBlockBounds(0.5F - 0.3125F, 0.0F, 0.5F - 0.3125F, 0.5F + 0.3125F, 0.6F, 0.5F + 0.3125F);
|
||||
else if (getMetaFromState(state) == 1)
|
||||
setBlockBounds(0.1F, 0.0F, 0.1F, 1.0F - 0.1F, 0.8F, 1.0F - 0.1F);
|
||||
|
||||
}
|
||||
// @Override
|
||||
// public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, BlockPos pos)
|
||||
// {
|
||||
// IBlockState state = blockAccess.getBlockState(pos);
|
||||
//
|
||||
// if (getMetaFromState(state) == 0)
|
||||
// setBlockBounds(0.5F - 0.3125F, 0.0F, 0.5F - 0.3125F, 0.5F + 0.3125F, 0.6F, 0.5F + 0.3125F);
|
||||
// else if (getMetaFromState(state) == 1)
|
||||
// setBlockBounds(0.1F, 0.0F, 0.1F, 1.0F - 0.1F, 0.8F, 1.0F - 0.1F);
|
||||
//
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TilePhantomBlock;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
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 org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TilePhantomBlock;
|
||||
|
||||
public class BlockPhantom extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -35,50 +38,48 @@ public class BlockPhantom extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isTranslucent()
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumWorldBlockLayer getBlockLayer()
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return EnumWorldBlockLayer.TRANSLUCENT;
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
Block block = state.getBlock();
|
||||
|
||||
if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate)
|
||||
if (world.getBlockState(pos.offset(side.getOpposite())) != state)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return block != this && super.shouldSideBeRendered(worldIn, pos, side);
|
||||
return block != this && super.shouldSideBeRendered(state, world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,23 @@
|
|||
package WayofTime.bloodmagic.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.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
@ -13,19 +31,6 @@ import WayofTime.bloodmagic.registry.ModItems;
|
|||
import WayofTime.bloodmagic.tile.TileImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.tile.TileMasterRitualStone;
|
||||
import WayofTime.bloodmagic.util.ChatUtil;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockRitualController extends BlockStringContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -38,20 +43,20 @@ public class BlockRitualController extends BlockStringContainer implements IVari
|
|||
setUnlocalizedName(Constants.Mod.MODID + ".stone.ritual.");
|
||||
setRegistryName(Constants.BloodMagicBlock.RITUAL_CONTROLLER.getRegName());
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setStepSound(soundTypeStone);
|
||||
setStepSound(SoundType.STONE);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (getMetaFromState(state) == 0 && tile instanceof TileMasterRitualStone)
|
||||
{
|
||||
if (player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.activationCrystal)
|
||||
if (heldItem != null && heldItem.getItem() == ModItems.activationCrystal)
|
||||
{
|
||||
String key = RitualHelper.getValidRitual(world, pos);
|
||||
EnumFacing direction = RitualHelper.getDirectionOfRitual(world, pos, key);
|
||||
|
@ -59,7 +64,7 @@ public class BlockRitualController extends BlockStringContainer implements IVari
|
|||
// ritual.
|
||||
if (!key.isEmpty() && direction != null && RitualHelper.checkValidRitual(world, pos, key, direction))
|
||||
{
|
||||
if (((TileMasterRitualStone) tile).activateRitual(player.getHeldItem(), player, RitualRegistry.getRitualForId(key)))
|
||||
if (((TileMasterRitualStone) tile).activateRitual(heldItem, player, RitualRegistry.getRitualForId(key)))
|
||||
{
|
||||
((TileMasterRitualStone) tile).setDirection(direction);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
package WayofTime.bloodmagic.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.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.ritual.EnumRuneType;
|
||||
|
@ -7,15 +19,6 @@ import WayofTime.bloodmagic.api.ritual.IRitualStone;
|
|||
import WayofTime.bloodmagic.block.base.BlockString;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockRitualStone extends BlockString implements IRitualStone, IVariantProvider
|
||||
{
|
||||
|
@ -28,7 +31,7 @@ public class BlockRitualStone extends BlockString implements IRitualStone, IVari
|
|||
setUnlocalizedName(Constants.Mod.MODID + ".ritualStone.");
|
||||
setRegistryName(Constants.BloodMagicBlock.RITUAL_STONE.getRegName());
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setStepSound(soundTypeStone);
|
||||
setStepSound(SoundType.STONE);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
|
||||
public abstract class BlockRoutingNode extends BlockContainer
|
||||
{
|
||||
protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.378F, 0.378F, 0.378F, 0.625F, 0.625F, 0.625F);
|
||||
|
||||
public static final PropertyBool UP = PropertyBool.create("up");
|
||||
public static final PropertyBool DOWN = PropertyBool.create("down");
|
||||
public static final PropertyBool NORTH = PropertyBool.create("north");
|
||||
|
@ -29,25 +33,23 @@ public abstract class BlockRoutingNode extends BlockContainer
|
|||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
|
||||
setBlockBounds(0.378F, 0.378F, 0.378F, 0.625F, 0.625F, 0.625F);
|
||||
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(DOWN, false).withProperty(UP, false).withProperty(NORTH, false).withProperty(EAST, false).withProperty(SOUTH, false).withProperty(WEST, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(EnumWorldBlockLayer layer)
|
||||
{
|
||||
return layer == EnumWorldBlockLayer.CUTOUT_MIPPED || layer == EnumWorldBlockLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -58,6 +60,18 @@ public abstract class BlockRoutingNode extends BlockContainer
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer)
|
||||
{
|
||||
return layer == BlockRenderLayer.CUTOUT_MIPPED || layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
|
@ -76,24 +90,18 @@ public abstract class BlockRoutingNode extends BlockContainer
|
|||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return state.withProperty(UP, this.shouldConnect(worldIn, pos.up())).withProperty(DOWN, this.shouldConnect(worldIn, pos.down())).withProperty(NORTH, this.shouldConnect(worldIn, pos.north())).withProperty(EAST, this.shouldConnect(worldIn, pos.east())).withProperty(SOUTH, this.shouldConnect(worldIn, pos.south())).withProperty(WEST, this.shouldConnect(worldIn, pos.west()));
|
||||
return state.withProperty(UP, this.shouldConnect(state, worldIn, pos.up())).withProperty(DOWN, this.shouldConnect(state, worldIn, pos.down())).withProperty(NORTH, this.shouldConnect(state, worldIn, pos.north())).withProperty(EAST, this.shouldConnect(state, worldIn, pos.east())).withProperty(SOUTH, this.shouldConnect(state, worldIn, pos.south())).withProperty(WEST, this.shouldConnect(state, worldIn, pos.west()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockState(this, UP, DOWN, NORTH, EAST, WEST, SOUTH);
|
||||
return new BlockStateContainer(this, UP, DOWN, NORTH, EAST, WEST, SOUTH);
|
||||
}
|
||||
|
||||
public boolean shouldConnect(IBlockAccess world, BlockPos pos)
|
||||
public boolean shouldConnect(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
return block.isFullBlock() && block.isFullCube();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return 3;
|
||||
return block.isFullBlock(state) && block.isFullCube(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,35 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileSoulForge;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSoulForge extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
protected static final AxisAlignedBB AABB = new AxisAlignedBB(0.06F, 0.0F, 0.06F, 0.94F, 0.75F, 0.94F);
|
||||
|
||||
public BlockSoulForge()
|
||||
{
|
||||
super(Material.iron);
|
||||
|
@ -28,21 +38,25 @@ public class BlockSoulForge extends BlockContainer implements IVariantProvider
|
|||
setRegistryName(Constants.BloodMagicBlock.SOUL_FORGE.getRegName());
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setStepSound(SoundType.METAL);
|
||||
setHarvestLevel("pickaxe", 1);
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
|
||||
setBlockBounds(0.06F, 0.0F, 0.06F, 0.94F, 0.75F, 0.94F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -54,13 +68,13 @@ public class BlockSoulForge extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(pos) instanceof TileSoulForge)
|
||||
player.openGui(BloodMagic.instance, Constants.Gui.SOUL_FORGE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
|
|
|
@ -1,59 +1,71 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileSpectralBlock;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumWorldBlockLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
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 org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.tile.TileSpectralBlock;
|
||||
|
||||
public class BlockSpectral extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
protected static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
|
||||
public BlockSpectral()
|
||||
{
|
||||
super(Material.cloth);
|
||||
|
||||
setUnlocalizedName(Constants.Mod.MODID + ".spectral");
|
||||
setRegistryName(Constants.BloodMagicBlock.SPECTRAL.getRegName());
|
||||
setBlockBounds(0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumWorldBlockLayer getBlockLayer()
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity)
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -64,13 +76,13 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(World world, BlockPos blockPos)
|
||||
public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir(IBlockAccess world, BlockPos blockPos)
|
||||
public boolean isAir(IBlockState state, IBlockAccess world, BlockPos blockPos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,24 +1,28 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.ItemTelepositionFocus;
|
||||
import WayofTime.bloodmagic.tile.TileTeleposer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
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.BlockPos;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.item.ItemTelepositionFocus;
|
||||
import WayofTime.bloodmagic.tile.TileTeleposer;
|
||||
|
||||
public class BlockTeleposer extends BlockContainer implements IVariantProvider
|
||||
{
|
||||
|
@ -34,15 +38,15 @@ public class BlockTeleposer extends BlockContainer implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return 3;
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
ItemStack playerItem = heldItem;
|
||||
|
||||
if (playerItem != null && playerItem.getItem() instanceof ItemTelepositionFocus)
|
||||
((ItemTelepositionFocus) playerItem.getItem()).setBlockPos(playerItem, world, pos);
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockTestSpellBlock extends Block
|
||||
{
|
||||
public static final PropertyDirection INPUT = PropertyDirection.create("input");
|
||||
public static final PropertyDirection OUTPUT = PropertyDirection.create("output");
|
||||
|
||||
public BlockTestSpellBlock()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
|
||||
setUnlocalizedName(Constants.Mod.MODID + ".testSpellBlock");
|
||||
setRegistryName("BlockTestSpellBlock");
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(INPUT, EnumFacing.DOWN).withProperty(OUTPUT, EnumFacing.UP));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return state.withProperty(INPUT, EnumFacing.DOWN).withProperty(OUTPUT, EnumFacing.UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[] { INPUT, OUTPUT });
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess blockAccess, BlockPos pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,16 +1,11 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLeavesBase;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -18,18 +13,25 @@ import net.minecraft.entity.SharedMonsterAttributes;
|
|||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||
import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider
|
||||
{
|
||||
|
@ -59,7 +61,7 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider
|
|||
if (world.isRemote)
|
||||
return;
|
||||
|
||||
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(player);
|
||||
boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.silkTouch, stack) > 0;
|
||||
int fortuneLvl = EnchantmentHelper.getFortuneModifier(player);
|
||||
int range = (int) (charge / 6); //Charge is a max of 30 - want 5 to be the max
|
||||
|
||||
|
@ -76,18 +78,18 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider
|
|||
BlockPos blockPos = playerPos.add(i, j, k);
|
||||
BlockStack blockStack = BlockStack.getStackFromPos(world, blockPos);
|
||||
|
||||
if (blockStack.getBlock().isAir(world, blockPos))
|
||||
if (blockStack.getBlock().isAir(blockStack.getState(), world, blockPos))
|
||||
continue;
|
||||
|
||||
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(world, blockPos, blockStack.getState(), player);
|
||||
if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY)
|
||||
continue;
|
||||
|
||||
if (blockStack.getBlock().getBlockHardness(world, blockPos) != -1)
|
||||
if (blockStack.getBlock().getBlockHardness(blockStack.getState(), world, blockPos) != -1)
|
||||
{
|
||||
float strengthVsBlock = getStrVsBlock(stack, blockStack.getBlock());
|
||||
|
||||
if (strengthVsBlock > 1.1F || blockStack.getBlock() instanceof BlockLeavesBase && world.canMineBlockBody(player, blockPos))
|
||||
if (strengthVsBlock > 1.1F || blockStack.getBlock() instanceof BlockLeaves && world.canMineBlockBody(player, blockPos))
|
||||
{
|
||||
if (silkTouch && blockStack.getBlock().canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player))
|
||||
drops.add(new ItemStackWrapper(blockStack));
|
||||
|
@ -116,7 +118,7 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider
|
|||
public Multimap<String, AttributeModifier> getAttributeModifiers(ItemStack stack)
|
||||
{
|
||||
Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(stack);
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Weapon modifier", 7, 0));
|
||||
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Weapon modifier", 7, 0));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,51 @@
|
|||
package WayofTime.bloodmagic.util.handler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHealEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.event.world.ChunkDataEvent;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
@ -12,7 +58,11 @@ import WayofTime.bloodmagic.api.iface.IUpgradeTrainer;
|
|||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.api.network.SoulNetwork;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.soul.*;
|
||||
import WayofTime.bloodmagic.api.soul.DemonWillHolder;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.api.soul.IDemonWill;
|
||||
import WayofTime.bloodmagic.api.soul.IDemonWillWeapon;
|
||||
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
|
||||
import WayofTime.bloodmagic.api.util.helper.BindableHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
|
@ -28,52 +78,28 @@ import WayofTime.bloodmagic.item.ItemUpgradeTome;
|
|||
import WayofTime.bloodmagic.item.armour.ItemLivingArmour;
|
||||
import WayofTime.bloodmagic.item.gear.ItemPackSacrifice;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.*;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.*;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerArrowShot;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerDigging;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerGrimReaperSprint;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerHealthboost;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerMeleeDamage;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerPhysicalProtect;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerSelfSacrifice;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerSolarPowered;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeArrowShot;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeDigging;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeGrimReaperSprint;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrifice;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSpeed;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeStepAssist;
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import WayofTime.bloodmagic.registry.ModPotions;
|
||||
import WayofTime.bloodmagic.util.ChatUtil;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.base.Strings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.player.*;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.event.world.ChunkDataEvent;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
public class EventHandler
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue