mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-18 03:35:07 +00:00
Added in all of the original files
This commit is contained in:
1 parent
b61f5f1072
commit
aa52debeb5
1764 files changed
+15476
No files matched your search
@@ -0,0 +1,82 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAutoChisel extends BlockContainer
|
||||
{
|
||||
public BlockAutoChisel()
|
||||
{
|
||||
super(Material.rock);
|
||||
setBlockName("autoChisel");
|
||||
setHardness(1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1, float y1, float z1){
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(world.isRemote)
|
||||
return true;
|
||||
if(tile !=null && tile instanceof TileEntityAutoChisel)
|
||||
player.openGui(Chisel.instance, 1, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int par6){
|
||||
dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, block, par6);
|
||||
}
|
||||
|
||||
private void dropItems(World world, int x, int y, int z){
|
||||
Random random = new Random();
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(tileEntity instanceof IInventory)){
|
||||
return;
|
||||
}
|
||||
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
|
||||
for(int c = 0; c < inventory.getSizeInventory(); c++){
|
||||
ItemStack stack = inventory.getStackInSlot(c);
|
||||
|
||||
if(stack != null && stack.stackSize > 0){
|
||||
float rx = random.nextFloat() * 0.8F + 0.1F;
|
||||
float ry = random.nextFloat() * 0.8F + 0.1F;
|
||||
float rz = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, stack);
|
||||
|
||||
if(stack.hasTagCompound()){
|
||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float factor = 0.05F;
|
||||
entityItem.motionX = random.nextGaussian() * factor;
|
||||
entityItem.motionY = random.nextGaussian() * factor + 0.2F;
|
||||
entityItem.motionZ = random.nextGaussian() * factor;
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
stack.stackSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TileEntityAutoChisel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/**
|
||||
* Created by Pokefenn
|
||||
*/
|
||||
public class BlockBeaconBase extends BlockCarvable
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCarvable extends Block implements ICarvable
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
private boolean isAlpha;
|
||||
|
||||
public BlockCarvable()
|
||||
{
|
||||
this(Material.rock);
|
||||
}
|
||||
|
||||
public BlockCarvable(Material m)
|
||||
{
|
||||
super(m);
|
||||
carverHelper = new CarvableHelper();
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
public BlockCarvable setStained(boolean a)
|
||||
{
|
||||
this.isAlpha = a;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return isAlpha ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
return carverHelper.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return Chisel.RenderCTMId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
|
||||
|
||||
public static class SoundType extends Block.SoundType
|
||||
{
|
||||
public final String soundNameStep;
|
||||
public final String soundNameBreak;
|
||||
public final String soundNamePlace;
|
||||
|
||||
/**
|
||||
* Creates a SoundType with automatic names for step and break sounds.
|
||||
* Sound names dig.soundName and step.soundName must be specified in the
|
||||
* sounds.json
|
||||
*
|
||||
* @param soundName
|
||||
* block of the sound. Will automatically be expanded to
|
||||
* "mod:dig.soundName" and "mod:step.soundName" respectively)
|
||||
* @param volume
|
||||
* default 1.0f
|
||||
* @param frequency
|
||||
* default 1.0f
|
||||
*/
|
||||
public SoundType(String soundName, float volume, float frequency)
|
||||
{
|
||||
super(soundName, volume, frequency);
|
||||
this.soundNameStep = null;
|
||||
this.soundNameBreak = null;
|
||||
this.soundNamePlace = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SoundType with manual names for step and break sounds.
|
||||
* Sound names must be specified in the sounds.json
|
||||
*
|
||||
* @param soundNameBreak
|
||||
* block break sound
|
||||
* @param soundNameStep
|
||||
* block step sound
|
||||
* @param volume
|
||||
* default 1.0f
|
||||
* @param frequency
|
||||
* default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency)
|
||||
{
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
this.soundNamePlace = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SoundType with manual names for step, break and place
|
||||
* sounds. Sound names must be specified in the sounds.json
|
||||
*
|
||||
* @param soundNameBreak
|
||||
* block break sound
|
||||
* @param soundNameStep
|
||||
* block step sound
|
||||
* @param soundNamePlace
|
||||
* block place sound
|
||||
* @param volume
|
||||
* default 1.0f
|
||||
* @param frequency
|
||||
* default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, float frequency)
|
||||
{
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
this.soundNamePlace = soundNamePlace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBreakSound()
|
||||
{
|
||||
if(soundNameBreak == null)
|
||||
return Chisel.MOD_ID + ":dig." + this.soundName;
|
||||
else
|
||||
return this.soundNameBreak;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStepResourcePath()
|
||||
{
|
||||
if(soundNameStep == null)
|
||||
return Chisel.MOD_ID + ":step." + this.soundName;
|
||||
else
|
||||
return this.soundNameStep;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String func_150496_b()
|
||||
{
|
||||
if(soundNamePlace == null)
|
||||
return getBreakSound();
|
||||
else
|
||||
return this.soundNamePlace;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import net.minecraft.block.BlockGlass;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCarvableGlass extends BlockGlass implements ICarvable
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
private boolean isAlpha = false;
|
||||
|
||||
public BlockCarvableGlass()
|
||||
{
|
||||
super(Material.glass, false);
|
||||
|
||||
carverHelper = new CarvableHelper();
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
public BlockCarvableGlass setStained(boolean a)
|
||||
{
|
||||
this.isAlpha = a;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return Chisel.RenderCTMId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return isAlpha ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.client.render.BlockMarblePaneRenderer;
|
||||
import net.minecraft.block.BlockPane;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCarvablePane extends BlockPane implements ICarvable
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
public boolean isAlpha;
|
||||
|
||||
public BlockCarvablePane(Material material, boolean drops)
|
||||
{
|
||||
super("", "", material, drops);
|
||||
|
||||
carverHelper = new CarvableHelper();
|
||||
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
public BlockCarvablePane setStained(boolean a)
|
||||
{
|
||||
this.isAlpha = a;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return isAlpha ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockMarblePaneRenderer.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockCarvablePowered extends BlockCarvable
|
||||
{
|
||||
public BlockCarvablePowered(Material m)
|
||||
{
|
||||
super(m);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can this block provide power. Only wire currently seems to have this
|
||||
* change based on its state.
|
||||
*/
|
||||
@Override
|
||||
public boolean canProvidePower()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the block is emitting indirect/weak redstone power on the
|
||||
* specified side. If isBlockNormalCube returns true, standard redstone
|
||||
* propagation rules will apply instead and this will not be called. Args:
|
||||
* World, X, Y, Z, side. Note that the side is reversed - eg it is 1 (up)
|
||||
* when checking the bottom of the block.
|
||||
*/
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCarvablePumpkin extends BlockCarvable
|
||||
{
|
||||
|
||||
public BlockCarvablePumpkin()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world_, int x, int y, int z_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
|
||||
{
|
||||
return p_149660_9_;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
|
||||
import info.jbcs.minecraft.chisel.Configurations;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockCloud extends BlockCarvable
|
||||
{
|
||||
|
||||
public BlockCloud()
|
||||
{
|
||||
super(Material.ice);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
|
||||
{
|
||||
entity.fallDistance = 0.0F;
|
||||
|
||||
if(entity.motionY < 0.0D)
|
||||
{
|
||||
entity.motionY *= 0.0050000000000000001D;
|
||||
} else if(entity.motionY > 0)
|
||||
{
|
||||
entity.motionY += 0.0285;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return Configurations.ghostCloud ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
|
||||
{
|
||||
return super.shouldSideBeRendered(iblockaccess, i, j, k, 1 - l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
|
||||
{
|
||||
return AxisAlignedBB.getBoundingBox(i + 0.2, j, k + 0.2, i + 0.8, j + 0.2, k + 0.8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int par1, Random rand, int par3)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import info.jbcs.minecraft.chisel.Configurations;
|
||||
import info.jbcs.minecraft.chisel.client.GeneralChiselClient;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockConcrete extends BlockCarvable
|
||||
{
|
||||
|
||||
public BlockConcrete()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
float f = 0.125F;
|
||||
return AxisAlignedBB.getBoundingBox(par2, par3, par4, (par2 + 1), ((par3 + 1) - f), (par4 + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
if(FMLCommonHandler.instance().getEffectiveSide() != Side.CLIENT)
|
||||
return;
|
||||
if(Configurations.concreteVelocity == 0)
|
||||
return;
|
||||
|
||||
GeneralChiselClient.speedupPlayer(world, entity, Configurations.concreteVelocity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
|
||||
|
||||
public class BlockEldritch extends BlockCarvable
|
||||
{
|
||||
|
||||
public BlockEldritch()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return Chisel.RenderEldritchId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.client.GeneralChiselClient;
|
||||
import info.jbcs.minecraft.utilities.General;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockHolystone extends BlockCarvable
|
||||
{
|
||||
public IIcon iconStar;
|
||||
|
||||
public BlockHolystone(Material m)
|
||||
{
|
||||
super(m);
|
||||
|
||||
this.setLightLevel(0.25F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if(General.rand.nextInt(4) == 0 && world.isRemote)
|
||||
GeneralChiselClient.spawnHolystoneFX(world, this, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
super.registerBlockIcons(register);
|
||||
|
||||
iconStar = register.registerIcon("Chisel:holystone/particles/star");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
|
||||
import info.jbcs.minecraft.chisel.client.GeneralChiselClient;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLavastone extends BlockMarbleTexturedOre
|
||||
{
|
||||
public BlockLavastone(Material mat, String baseIcon)
|
||||
{
|
||||
super(mat, baseIcon);
|
||||
setLightLevel(1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if(random.nextInt(8) == 0 && world.isRemote)
|
||||
GeneralChiselClient.spawnLavastoneFX(world, this, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLightstoneCarvable extends BlockCarvable
|
||||
{
|
||||
public BlockLightstoneCarvable()
|
||||
{
|
||||
super(Material.glass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
return Blocks.glowstone.quantityDropped(random);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random random, int a)
|
||||
{
|
||||
return Items.glowstone_dust;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMarbleBookshelf extends BlockCarvable
|
||||
{
|
||||
|
||||
public BlockMarbleBookshelf()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
if(side < 2)
|
||||
return Blocks.planks.getBlockTextureFromSide(side);
|
||||
return super.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
if(side < 2)
|
||||
return Blocks.planks.getBlockTextureFromSide(side);
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return Items.book;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnchantPowerBonus(World world, int x, int y, int z)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockCarpet;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockMarbleCarpet extends BlockCarpet implements ICarvable
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
|
||||
public BlockMarbleCarpet(Material m)
|
||||
{
|
||||
carverHelper = new CarvableHelper();
|
||||
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
return carverHelper.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return Chisel.RenderCarpetId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockIce;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMarbleIce extends BlockIce implements ICarvable
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
|
||||
public BlockMarbleIce()
|
||||
{
|
||||
super();
|
||||
carverHelper = new CarvableHelper();
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
|
||||
par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
|
||||
par2EntityPlayer.addExhaustion(0.025F);
|
||||
|
||||
/*
|
||||
if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
|
||||
{
|
||||
ItemStack itemstack = this.createStackedBlock(par6);
|
||||
|
||||
if(itemstack != null)
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par3, par4, par5, itemstack);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.ChiselBlocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMarbleIceStairs extends BlockMarbleStairs
|
||||
{
|
||||
public BlockMarbleIceStairs(Block block, int meta, CarvableHelper helper)
|
||||
{
|
||||
super(block, meta, helper);
|
||||
|
||||
slipperiness = 0.98F;
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
ChiselBlocks.blockIce.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return ChiselBlocks.blockIce.quantityDropped(par1Random);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
ChiselBlocks.blockIce.updateTick(par1World, par2, par3, par4, par5Random);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMobilityFlag()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMarbleLamp extends BlockCarvable
|
||||
{
|
||||
BlockMarbleLamp blockUnpowered;
|
||||
BlockMarbleLamp blockPowered;
|
||||
boolean powered;
|
||||
|
||||
public BlockMarbleLamp()
|
||||
{
|
||||
super(Material.redstoneLight);
|
||||
|
||||
powered = false;
|
||||
blockUnpowered = this;
|
||||
blockPowered = new BlockMarbleLamp(this);
|
||||
|
||||
setHardness(0.3F);
|
||||
}
|
||||
|
||||
public BlockMarbleLamp(BlockMarbleLamp unpoweredVersion)
|
||||
{
|
||||
super(Material.redstoneLight);
|
||||
|
||||
carverHelper = unpoweredVersion.carverHelper;
|
||||
|
||||
powered = true;
|
||||
blockUnpowered = unpoweredVersion;
|
||||
blockPowered = this;
|
||||
|
||||
setLightLevel(1.0F);
|
||||
setHardness(0.3F);
|
||||
}
|
||||
|
||||
|
||||
public void checkPower(World world, int x, int y, int z)
|
||||
{
|
||||
if(world.isRemote) return;
|
||||
|
||||
boolean isGettingPower = world.isBlockIndirectlyGettingPowered(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(powered && !isGettingPower)
|
||||
{
|
||||
world.setBlock(x, y, z, blockUnpowered, meta, 2);
|
||||
} else if(!powered && isGettingPower)
|
||||
{
|
||||
world.setBlock(x, y, z, blockPowered, meta, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z)
|
||||
{
|
||||
checkPower(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
checkPower(world, x, y, z);
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand){
|
||||
if (world.isRemote) return;
|
||||
|
||||
if(powered && !world.isBlockIndirectlyGettingPowered(x, y, z)){
|
||||
int meta=world.getBlockMetadata(x, y, z);
|
||||
world.setBlock(x, y, z, Block.redstoneLampIdle.blockID, meta, 2);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return Item.getItemFromBlock(blockUnpowered);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
||||
{
|
||||
return new ItemStack(blockUnpowered, 1, world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.client.render.BlockMarblePillarRenderer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockMarblePillar extends BlockCarvable
|
||||
{
|
||||
public IIcon sides[] = new IIcon[6];
|
||||
|
||||
public BlockMarblePillar(Material m)
|
||||
{
|
||||
super(m);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockMarblePillarRenderer.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return sides[side];
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
return sides[side];
|
||||
}
|
||||
|
||||
public IIcon getCtmIcon(int index, int metadata)
|
||||
{
|
||||
CarvableVariation var = carverHelper.variations.get(metadata);
|
||||
|
||||
if(index >= 4) return var.iconTop;
|
||||
if(var.seamsCtmVert == null) return var.icon;
|
||||
return var.seamsCtmVert.icons[index];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockMarbleSlab extends BlockCarvable
|
||||
{
|
||||
public Block master;
|
||||
public BlockMarbleSlab bottom;
|
||||
public BlockMarbleSlab top;
|
||||
public boolean isBottom;
|
||||
|
||||
public BlockMarbleSlab(BlockCarvable marble)
|
||||
{
|
||||
opaque = true;
|
||||
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
|
||||
master = marble;
|
||||
bottom = this;
|
||||
top = new BlockMarbleSlab(this);
|
||||
|
||||
isBottom = true;
|
||||
}
|
||||
|
||||
public BlockMarbleSlab(BlockMarbleSlab bottomBlock)
|
||||
{
|
||||
super();
|
||||
setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
master = bottomBlock.master;
|
||||
bottom = bottomBlock;
|
||||
top = this;
|
||||
|
||||
carverHelper = bottomBlock.carverHelper;
|
||||
isBottom = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
if(isBottom)
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
} else
|
||||
{
|
||||
setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsForItemRender()
|
||||
{
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
||||
{
|
||||
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return Item.getItemFromBlock(bottom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition mop, World world, int x, int y, int z)
|
||||
{
|
||||
return new ItemStack(bottom, 1, world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
// return master.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item block, CreativeTabs tabs, List list)
|
||||
{
|
||||
if(isBottom)
|
||||
super.getSubBlocks(block, tabs, list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.client.render.BlockMarbleStairsRenderer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMarbleStairs extends BlockStairs implements ICarvable
|
||||
{
|
||||
CarvableHelper carverHelper;
|
||||
int blockMeta;
|
||||
|
||||
public BlockMarbleStairs(Block block, int meta, CarvableHelper helper)
|
||||
{
|
||||
super(block, meta);
|
||||
|
||||
this.useNeighborBrightness = true;
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
carverHelper = helper;
|
||||
blockMeta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, blockMeta + metadata / 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i & 0x8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
if(blockMeta == 0)
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item block, CreativeTabs tabs, List list)
|
||||
{
|
||||
list.add(new ItemStack(block, 1, 0));
|
||||
list.add(new ItemStack(block, 1, 8));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockMarbleStairsRenderer.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack)
|
||||
{
|
||||
int l = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4) & 4;
|
||||
int odd = par6ItemStack.getItemDamage();
|
||||
|
||||
if(l == 0)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | i1 + odd, 2);
|
||||
}
|
||||
|
||||
if(l == 1)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | i1 + odd, 2);
|
||||
}
|
||||
|
||||
if(l == 2)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | i1 + odd, 2);
|
||||
}
|
||||
|
||||
if(l == 3)
|
||||
{
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | i1 + odd, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int damage)
|
||||
{
|
||||
// int res=super.onBlockPlaced();
|
||||
return side != 0 && (side == 1 || hy <= 0.5D) ? damage : damage | 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.item.ItemCarvable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockMarbleStairsMaker
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
BlockMarbleStairs blocks[];
|
||||
|
||||
//int idStart;
|
||||
Block blockBase;
|
||||
String blockName;
|
||||
|
||||
public BlockMarbleStairsMaker(Block base)
|
||||
{
|
||||
carverHelper = new CarvableHelper();
|
||||
blockBase = base;
|
||||
}
|
||||
|
||||
public void create(String name)
|
||||
{
|
||||
create(null, name);
|
||||
}
|
||||
|
||||
public void create(BlockMarbleStairsMakerCreator creator, String name)
|
||||
{
|
||||
blocks = new BlockMarbleStairs[carverHelper.variations.size() / 2];
|
||||
for(int i = 0; i < blocks.length; i++)
|
||||
{
|
||||
String n = name + "." + i;
|
||||
blocks[i] = creator == null ?
|
||||
new BlockMarbleStairs(blockBase, i * 2, carverHelper) :
|
||||
creator.create(blockBase, i * 2, carverHelper);
|
||||
|
||||
blocks[i].setBlockName(n);
|
||||
GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n);
|
||||
|
||||
for(int meta = 0; meta < 2 && i * 2 + meta < carverHelper.variations.size(); meta++)
|
||||
{
|
||||
CarvableVariation variation = carverHelper.variations.get(i * 2 + meta);
|
||||
|
||||
for(int j = 0; j < 8; j++)
|
||||
carverHelper.registerVariation(name + ".orientation." + j, variation, blocks[i], j + meta * 8);
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(blocks[i], 4, meta * 8), new Object[]{"* ", "** ", "***", '*', new ItemStack(blockBase, 1, i * 2 + meta)});
|
||||
}
|
||||
|
||||
CarvableHelper.chiselBlocks.add(blocks[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public interface BlockMarbleStairsMakerCreator
|
||||
{
|
||||
public BlockMarbleStairs create(Block block, int meta, CarvableHelper helper);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.api.ICarvable;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockMarbleTexturedOre extends BlockTexturedOre implements ICarvable
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
|
||||
public BlockMarbleTexturedOre(Material mat, String baseIcon)
|
||||
{
|
||||
super(mat, baseIcon);
|
||||
|
||||
carverHelper = new CarvableHelper();
|
||||
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
super.registerBlockIcons(register);
|
||||
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item block, CreativeTabs tabs, List list)
|
||||
{
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata)
|
||||
{
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockWall;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockMarbleWall extends BlockWall
|
||||
{
|
||||
CarvableHelper carverHelper;
|
||||
|
||||
public BlockMarbleWall(Block block)
|
||||
{
|
||||
super(block);
|
||||
|
||||
carverHelper = new CarvableHelper();
|
||||
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
carverHelper.registerBlockIcons("Chisel", this, register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item block, CreativeTabs tabs, List list)
|
||||
{
|
||||
carverHelper.registerSubBlocks(this, tabs, list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.client.render.BlockRoadLineRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRoadLine extends Block
|
||||
{
|
||||
public IIcon aloneIcon;
|
||||
public IIcon halfLineIcon;
|
||||
public IIcon fullLineIcon;
|
||||
|
||||
public BlockRoadLine()
|
||||
{
|
||||
super(Material.circuits);
|
||||
|
||||
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.00390625f, 1.0f);
|
||||
// this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
|
||||
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockRoadLineRenderer.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
return par1World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) || par1World.getBlock(par2, par3 - 1, par4).equals(Blocks.glowstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block block)
|
||||
{
|
||||
if(par1World.isRemote) return;
|
||||
|
||||
if(!this.canPlaceBlockAt(par1World, par2, par3, par4))
|
||||
{
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
super.onNeighborBlockChange(par1World, par2, par3, par4, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister reg)
|
||||
{
|
||||
blockIcon = aloneIcon = reg.registerIcon("Chisel:line-marking/white-center");
|
||||
halfLineIcon = reg.registerIcon("Chisel:line-marking/white-side");
|
||||
fullLineIcon = reg.registerIcon("Chisel:line-marking/white-long");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,576 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.Chisel;
|
||||
import info.jbcs.minecraft.chisel.client.render.BlockSnakeStoneRenderer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSnakestone extends Block
|
||||
{
|
||||
static final int SEC_HEAD = 0;
|
||||
static final int SEC_DOWN = 4;
|
||||
static final int SEC_UP = 8;
|
||||
static final int SEC_HOR = 12;
|
||||
|
||||
static final int SIDE_B = 0;
|
||||
static final int SIDE_T = 1;
|
||||
static final int SIDE_N = 2;
|
||||
static final int SIDE_S = 3;
|
||||
static final int SIDE_W = 4;
|
||||
static final int SIDE_E = 5;
|
||||
|
||||
String iconPrefix;
|
||||
IIcon iconFaceLeft;
|
||||
IIcon iconFaceRight;
|
||||
IIcon iconCross;
|
||||
IIcon iconFace;
|
||||
IIcon iconTopTip;
|
||||
IIcon iconTopSide;
|
||||
IIcon iconBottom;
|
||||
IIcon iconBottomSide;
|
||||
IIcon iconBottomTip;
|
||||
IIcon iconLeftDown;
|
||||
IIcon iconRightDown;
|
||||
IIcon iconLeftUp;
|
||||
IIcon iconRightUp;
|
||||
IIcon iconLeftTip;
|
||||
IIcon iconSide;
|
||||
IIcon iconRightTip;
|
||||
IIcon iconTop;
|
||||
|
||||
public boolean flipTopTextures;
|
||||
|
||||
public BlockSnakestone(String iconPrefix)
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(1.5F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setCreativeTab(Chisel.tabChisel);
|
||||
flipTopTextures = false;
|
||||
|
||||
this.iconPrefix = iconPrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockSnakeStoneRenderer.id;
|
||||
}
|
||||
|
||||
static final int[] rotRemap = {0, 3, 1, 2};
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(meta > 3) return;
|
||||
|
||||
if(rotateHead(world, x, y, z) != -1)
|
||||
return;
|
||||
|
||||
int rot = rotRemap[(MathHelper.floor_double(entity.rotationYaw * 4.0 / 360.0 + 0.5)) & 3];
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, rot, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int meta)
|
||||
{
|
||||
if(meta <= 3) return meta;
|
||||
|
||||
if(rotateBodyPart(world, x, y, z))
|
||||
{
|
||||
return world.getBlockMetadata(x, y, z);
|
||||
}
|
||||
|
||||
if(side == 0 || side == 1) meta = 14;
|
||||
if(side == 2 || side == 3) meta = 13;
|
||||
if(side == 4 || side == 5) meta = 12;
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
int kind = world.getBlockMetadata(x, y, z) & 0xC;
|
||||
|
||||
if(kind == 0)
|
||||
{
|
||||
rotateHead(world, x, y, z);
|
||||
} else
|
||||
{
|
||||
rotateBodyPart(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getConnections(World world, int ox, int oy, int oz)
|
||||
{
|
||||
int index = 0;
|
||||
int[] res = {-1, -1, -1, -1, -1, -1, -1};
|
||||
|
||||
for(int direction = 0; direction < 6; direction++)
|
||||
{
|
||||
int x = ox, y = oy, z = oz;
|
||||
switch(direction)
|
||||
{
|
||||
case 0:
|
||||
z--;
|
||||
break;
|
||||
case 1:
|
||||
z++;
|
||||
break;
|
||||
case 2:
|
||||
x--;
|
||||
break;
|
||||
case 3:
|
||||
x++;
|
||||
break;
|
||||
case 4:
|
||||
y--;
|
||||
break;
|
||||
case 5:
|
||||
y++;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!world.getBlock(x, y, z).equals(this)) continue;
|
||||
boolean match = false;
|
||||
|
||||
int px1 = x, px2 = x;
|
||||
int py1 = y, py2 = y;
|
||||
int pz1 = z, pz2 = z;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if((meta & 0xc) == 4 || (meta & 0xc) == 8)
|
||||
{
|
||||
if((meta & 4) == 4) py1--;
|
||||
else py1++;
|
||||
|
||||
switch(meta & 3)
|
||||
{
|
||||
case 0:
|
||||
pz2--;
|
||||
break;
|
||||
case 1:
|
||||
pz2++;
|
||||
break;
|
||||
case 2:
|
||||
px2--;
|
||||
break;
|
||||
case 3:
|
||||
px2++;
|
||||
break;
|
||||
}
|
||||
} else if(meta == 12)
|
||||
{
|
||||
px1--;
|
||||
px2++;
|
||||
} else if(meta == 13)
|
||||
{
|
||||
pz1--;
|
||||
pz2++;
|
||||
} else if(meta == 14)
|
||||
{
|
||||
py1--;
|
||||
py2++;
|
||||
} else if(meta == 15)
|
||||
{
|
||||
match = true;
|
||||
} else if(meta < 4)
|
||||
{
|
||||
match = true;
|
||||
}
|
||||
|
||||
if(!match)
|
||||
{
|
||||
Block b1 = world.getBlock(px1, py1, pz1);
|
||||
Block b2 = world.getBlock(px2, py2, pz2);
|
||||
|
||||
|
||||
if(b1 != this || b2 != this)
|
||||
match = true;
|
||||
|
||||
if(ox == px1 && oy == py1 && oz == pz1)
|
||||
match = true;
|
||||
|
||||
if(ox == px2 && oy == py2 && oz == pz2)
|
||||
match = true;
|
||||
}
|
||||
|
||||
if(match)
|
||||
res[index++] = direction;
|
||||
}
|
||||
|
||||
if(index != 5)
|
||||
res[index] = -1;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public boolean rotateBodyPart(World world, int x, int y, int z)
|
||||
{
|
||||
int[] con = getConnections(world, x, y, z);
|
||||
int blockMeta = world.getBlockMetadata(x, y, z);
|
||||
int kind = blockMeta & 0xc;
|
||||
|
||||
if(con[1] == -1) return false;
|
||||
if(con[2] != -1) return false;
|
||||
|
||||
int meta = 15;
|
||||
|
||||
if(con[0] == 2 && con[1] == 3)
|
||||
{
|
||||
meta = 12;
|
||||
} else if(con[0] == 0 && con[1] == 1)
|
||||
{
|
||||
meta = 13;
|
||||
} else if(con[0] == 4 && con[1] == 5)
|
||||
{
|
||||
meta = 14;
|
||||
} else if(con[1] == 4)
|
||||
{
|
||||
meta = SEC_DOWN | con[0];
|
||||
} else if(con[1] == 5)
|
||||
{
|
||||
meta = SEC_UP | con[0];
|
||||
}
|
||||
|
||||
if(blockMeta != meta)
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta, 3);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int rotateHead(World world, int x, int y, int z)
|
||||
{
|
||||
int[] con = getConnections(world, x, y, z);
|
||||
|
||||
if(con[1] >= 0 && con[1] < 4) return -1;
|
||||
|
||||
int meta = -1;
|
||||
switch(con[0])
|
||||
{
|
||||
case 0:
|
||||
meta = 1;
|
||||
break;
|
||||
case 1:
|
||||
meta = 0;
|
||||
break;
|
||||
case 2:
|
||||
meta = 3;
|
||||
break;
|
||||
case 3:
|
||||
meta = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if(meta == -1) return -1;
|
||||
|
||||
world.setBlock(x, y, z, this, meta, 3);
|
||||
return meta;
|
||||
}
|
||||
|
||||
public boolean connectedTo(World par1World, int x, int y, int z, int direction)
|
||||
{
|
||||
switch(direction)
|
||||
{
|
||||
case 0:
|
||||
return par1World.getBlock(x, y, z - 1).equals(this);
|
||||
case 1:
|
||||
return par1World.getBlock(x, y, z + 1).equals(this);
|
||||
case 2:
|
||||
return par1World.getBlock(x - 1, y, z).equals(this);
|
||||
case 3:
|
||||
return par1World.getBlock(x + 1, y, z).equals(this);
|
||||
case 4:
|
||||
return par1World.getBlock(x, y - 1, z).equals(this);
|
||||
case 5:
|
||||
return par1World.getBlock(x, y + 1, z).equals(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
int type = meta & 0xc;
|
||||
int orient = meta & 0x3;
|
||||
|
||||
switch(meta | (side << 4))
|
||||
{
|
||||
|
||||
case (SEC_HOR | 0 | (SIDE_B << 4)):
|
||||
return iconBottomTip;
|
||||
case (SEC_HOR | 0 | (SIDE_T << 4)):
|
||||
return iconTopSide;
|
||||
case (SEC_HOR | 0 | (SIDE_N << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 0 | (SIDE_S << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 0 | (SIDE_W << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HOR | 0 | (SIDE_E << 4)):
|
||||
return iconCross;
|
||||
|
||||
case (SEC_HOR | 1 | (SIDE_B << 4)):
|
||||
return iconBottomTip;
|
||||
case (SEC_HOR | 1 | (SIDE_T << 4)):
|
||||
return iconTopSide;
|
||||
case (SEC_HOR | 1 | (SIDE_N << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HOR | 1 | (SIDE_S << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HOR | 1 | (SIDE_W << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 1 | (SIDE_E << 4)):
|
||||
return iconSide;
|
||||
|
||||
case (SEC_HOR | 2 | (SIDE_B << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HOR | 2 | (SIDE_T << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HOR | 2 | (SIDE_N << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 2 | (SIDE_S << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 2 | (SIDE_W << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 2 | (SIDE_E << 4)):
|
||||
return iconSide;
|
||||
|
||||
case (SEC_HOR | 3 | (SIDE_B << 4)):
|
||||
return iconBottom;
|
||||
case (SEC_HOR | 3 | (SIDE_T << 4)):
|
||||
return iconTop;
|
||||
case (SEC_HOR | 3 | (SIDE_N << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 3 | (SIDE_S << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 3 | (SIDE_W << 4)):
|
||||
return iconSide;
|
||||
case (SEC_HOR | 3 | (SIDE_E << 4)):
|
||||
return iconSide;
|
||||
|
||||
case (SEC_DOWN | 0 | (SIDE_B << 4)):
|
||||
return iconCross;
|
||||
case (SEC_DOWN | 0 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_DOWN | 0 | (SIDE_N << 4)):
|
||||
return iconCross;
|
||||
case (SEC_DOWN | 0 | (SIDE_S << 4)):
|
||||
return iconRightTip;
|
||||
case (SEC_DOWN | 0 | (SIDE_W << 4)):
|
||||
return iconLeftDown;
|
||||
case (SEC_DOWN | 0 | (SIDE_E << 4)):
|
||||
return iconRightDown;
|
||||
|
||||
case (SEC_DOWN | 1 | (SIDE_B << 4)):
|
||||
return iconCross;
|
||||
case (SEC_DOWN | 1 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_DOWN | 1 | (SIDE_N << 4)):
|
||||
return iconLeftTip;
|
||||
case (SEC_DOWN | 1 | (SIDE_S << 4)):
|
||||
return iconCross;
|
||||
case (SEC_DOWN | 1 | (SIDE_W << 4)):
|
||||
return iconRightDown;
|
||||
case (SEC_DOWN | 1 | (SIDE_E << 4)):
|
||||
return iconLeftDown;
|
||||
|
||||
case (SEC_DOWN | 2 | (SIDE_B << 4)):
|
||||
return iconCross;
|
||||
case (SEC_DOWN | 2 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_DOWN | 2 | (SIDE_N << 4)):
|
||||
return iconRightDown;
|
||||
case (SEC_DOWN | 2 | (SIDE_S << 4)):
|
||||
return iconLeftDown;
|
||||
case (SEC_DOWN | 2 | (SIDE_W << 4)):
|
||||
return iconCross;
|
||||
case (SEC_DOWN | 2 | (SIDE_E << 4)):
|
||||
return iconLeftTip;
|
||||
|
||||
case (SEC_DOWN | 3 | (SIDE_B << 4)):
|
||||
return iconCross;
|
||||
case (SEC_DOWN | 3 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_DOWN | 3 | (SIDE_N << 4)):
|
||||
return iconLeftDown;
|
||||
case (SEC_DOWN | 3 | (SIDE_S << 4)):
|
||||
return iconRightDown;
|
||||
case (SEC_DOWN | 3 | (SIDE_W << 4)):
|
||||
return iconRightTip;
|
||||
case (SEC_DOWN | 3 | (SIDE_E << 4)):
|
||||
return iconCross;
|
||||
|
||||
case (SEC_UP | 0 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_UP | 0 | (SIDE_T << 4)):
|
||||
return iconCross;
|
||||
case (SEC_UP | 0 | (SIDE_N << 4)):
|
||||
return iconCross;
|
||||
case (SEC_UP | 0 | (SIDE_S << 4)):
|
||||
return iconLeftTip;
|
||||
case (SEC_UP | 0 | (SIDE_W << 4)):
|
||||
return iconLeftUp;
|
||||
case (SEC_UP | 0 | (SIDE_E << 4)):
|
||||
return iconRightUp;
|
||||
|
||||
case (SEC_UP | 1 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_UP | 1 | (SIDE_T << 4)):
|
||||
return iconCross;
|
||||
case (SEC_UP | 1 | (SIDE_N << 4)):
|
||||
return iconRightTip;
|
||||
case (SEC_UP | 1 | (SIDE_S << 4)):
|
||||
return iconCross;
|
||||
case (SEC_UP | 1 | (SIDE_W << 4)):
|
||||
return iconRightUp;
|
||||
case (SEC_UP | 1 | (SIDE_E << 4)):
|
||||
return iconLeftUp;
|
||||
|
||||
case (SEC_UP | 2 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_UP | 2 | (SIDE_T << 4)):
|
||||
return iconCross;
|
||||
case (SEC_UP | 2 | (SIDE_N << 4)):
|
||||
return iconRightUp;
|
||||
case (SEC_UP | 2 | (SIDE_S << 4)):
|
||||
return iconLeftUp;
|
||||
case (SEC_UP | 2 | (SIDE_W << 4)):
|
||||
return iconCross;
|
||||
case (SEC_UP | 2 | (SIDE_E << 4)):
|
||||
return iconRightTip;
|
||||
|
||||
case (SEC_UP | 3 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_UP | 3 | (SIDE_T << 4)):
|
||||
return iconCross;
|
||||
case (SEC_UP | 3 | (SIDE_N << 4)):
|
||||
return iconLeftUp;
|
||||
case (SEC_UP | 3 | (SIDE_S << 4)):
|
||||
return iconRightUp;
|
||||
case (SEC_UP | 3 | (SIDE_W << 4)):
|
||||
return iconLeftTip;
|
||||
case (SEC_UP | 3 | (SIDE_E << 4)):
|
||||
return iconCross;
|
||||
|
||||
case (SEC_HEAD | 0 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_HEAD | 0 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_HEAD | 0 | (SIDE_N << 4)):
|
||||
return iconFace;
|
||||
case (SEC_HEAD | 0 | (SIDE_S << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HEAD | 0 | (SIDE_W << 4)):
|
||||
return iconFaceLeft;
|
||||
case (SEC_HEAD | 0 | (SIDE_E << 4)):
|
||||
return iconFaceRight;
|
||||
|
||||
case (SEC_HEAD | 1 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_HEAD | 1 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_HEAD | 1 | (SIDE_N << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HEAD | 1 | (SIDE_S << 4)):
|
||||
return iconFace;
|
||||
case (SEC_HEAD | 1 | (SIDE_W << 4)):
|
||||
return iconFaceRight;
|
||||
case (SEC_HEAD | 1 | (SIDE_E << 4)):
|
||||
return iconFaceLeft;
|
||||
|
||||
case (SEC_HEAD | 2 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_HEAD | 2 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_HEAD | 2 | (SIDE_N << 4)):
|
||||
return iconFaceRight;
|
||||
case (SEC_HEAD | 2 | (SIDE_S << 4)):
|
||||
return iconFaceLeft;
|
||||
case (SEC_HEAD | 2 | (SIDE_W << 4)):
|
||||
return iconFace;
|
||||
case (SEC_HEAD | 2 | (SIDE_E << 4)):
|
||||
return iconCross;
|
||||
|
||||
case (SEC_HEAD | 3 | (SIDE_B << 4)):
|
||||
return iconBottomSide;
|
||||
case (SEC_HEAD | 3 | (SIDE_T << 4)):
|
||||
return iconTopTip;
|
||||
case (SEC_HEAD | 3 | (SIDE_N << 4)):
|
||||
return iconFaceLeft;
|
||||
case (SEC_HEAD | 3 | (SIDE_S << 4)):
|
||||
return iconFaceRight;
|
||||
case (SEC_HEAD | 3 | (SIDE_W << 4)):
|
||||
return iconCross;
|
||||
case (SEC_HEAD | 3 | (SIDE_E << 4)):
|
||||
return iconFace;
|
||||
|
||||
}
|
||||
|
||||
return iconCross;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
list.add(new ItemStack(item, 1, 13));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
if(meta < 4)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 13;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
iconFaceLeft = register.registerIcon(iconPrefix + "face-left");
|
||||
iconFaceRight = register.registerIcon(iconPrefix + "face-right");
|
||||
iconFace = register.registerIcon(iconPrefix + "face");
|
||||
|
||||
iconLeftUp = register.registerIcon(iconPrefix + "left-up");
|
||||
iconLeftDown = register.registerIcon(iconPrefix + "left-down");
|
||||
iconLeftTip = register.registerIcon(iconPrefix + "left-tip");
|
||||
|
||||
iconRightUp = register.registerIcon(iconPrefix + "right-up");
|
||||
iconRightDown = register.registerIcon(iconPrefix + "right-down");
|
||||
iconRightTip = register.registerIcon(iconPrefix + "right-tip");
|
||||
|
||||
iconTop = register.registerIcon(iconPrefix + "top");
|
||||
iconTopTip = register.registerIcon(iconPrefix + "top-tip");
|
||||
iconTopSide = register.registerIcon(iconPrefix + "top-side");
|
||||
|
||||
iconBottom = register.registerIcon(iconPrefix + "bot");
|
||||
iconBottomTip = register.registerIcon(iconPrefix + "bot-tip");
|
||||
iconBottomSide = register.registerIcon(iconPrefix + "bot-side");
|
||||
|
||||
iconCross = register.registerIcon(iconPrefix + "crosssection");
|
||||
iconSide = register.registerIcon(iconPrefix + "side");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
|
||||
import info.jbcs.minecraft.chisel.client.GeneralChiselClient;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSnakestoneObsidian extends BlockSnakestone
|
||||
{
|
||||
public IIcon[] particles = new IIcon[8];
|
||||
|
||||
public BlockSnakestoneObsidian(String iconPrefix)
|
||||
{
|
||||
super(iconPrefix);
|
||||
|
||||
flipTopTextures = true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
GeneralChiselClient.spawnSnakestoneObsidianFX(world, this, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
super.registerBlockIcons(register);
|
||||
|
||||
for(int i = 0; i < particles.length; i++)
|
||||
{
|
||||
particles[i] = register.registerIcon(iconPrefix + "particles/" + i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import info.jbcs.minecraft.chisel.Configurations;
|
||||
import info.jbcs.minecraft.chisel.client.GeneralChiselClient;
|
||||
import info.jbcs.minecraft.chisel.client.render.BlockSpikesRenderer;
|
||||
import info.jbcs.minecraft.utilities.General;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSpikes extends Block
|
||||
{
|
||||
public IIcon iconBase;
|
||||
public IIcon iconSpike;
|
||||
|
||||
public BlockSpikes(Material mat)
|
||||
{
|
||||
super(Material.circuits);
|
||||
|
||||
this.setCreativeTab(CreativeTabs.tabDecorations);
|
||||
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 1.0f / 16, 1.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
||||
{
|
||||
if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
return;
|
||||
|
||||
double dy = entity.posY - entity.prevPosY;
|
||||
|
||||
GeneralChiselClient.speedupPlayer(world, entity, Configurations.concreteVelocity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockSpikesRenderer.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
blockIcon = iconBase = register.registerIcon(General.getName(this) + "base");
|
||||
iconSpike = register.registerIcon(General.getName(this) + "spike");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package info.jbcs.minecraft.chisel.block;
|
||||
|
||||
import info.jbcs.minecraft.chisel.client.render.BlockTexturedOreRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockTexturedOre extends Block
|
||||
{
|
||||
public int currentPass;
|
||||
public Block base;
|
||||
public IIcon icon;
|
||||
String iconFile;
|
||||
|
||||
public BlockTexturedOre(Material mat, Block base)
|
||||
{
|
||||
super(mat);
|
||||
|
||||
this.base = base;
|
||||
}
|
||||
|
||||
public BlockTexturedOre(Material mat, String iconFile)
|
||||
{
|
||||
super(mat);
|
||||
|
||||
this.iconFile = iconFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockTexturedOreRenderer.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInPass(int pass)
|
||||
{
|
||||
currentPass = pass;
|
||||
|
||||
return pass == 1 || pass == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register)
|
||||
{
|
||||
if(iconFile != null)
|
||||
icon = register.registerIcon(iconFile);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package info.jbcs.minecraft.chisel.block.tile;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TilePumpkin extends TileEntity
|
||||
{
|
||||
|
||||
public int pos;
|
||||
|
||||
public TilePumpkin()
|
||||
{
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTagCompound)
|
||||
{
|
||||
super.writeToNBT(nbtTagCompound);
|
||||
nbtTagCompound.setInteger("pos", pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTagCompound)
|
||||
{
|
||||
super.readFromNBT(nbtTagCompound);
|
||||
pos = nbtTagCompound.getInteger("pos");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package info.jbcs.minecraft.chisel.block.tileentity;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityAutoChisel extends TileEntity implements ISidedInventory{
|
||||
|
||||
private ItemStack[] inventory = new ItemStack[3];
|
||||
private String name = "autoChisel";
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int size) {
|
||||
if (inventory[slot] != null) {
|
||||
ItemStack is;
|
||||
if (inventory[slot].stackSize <= size) {
|
||||
is = inventory[slot];
|
||||
inventory[slot] = null;
|
||||
return is;
|
||||
} else {
|
||||
is = inventory[slot].splitStack(size);
|
||||
if (inventory[slot].stackSize == 0)
|
||||
inventory[slot] = null;
|
||||
return is;
|
||||
}
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList tags = nbt.getTagList("Items", 10);
|
||||
inventory = new ItemStack[getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < tags.tagCount(); i++) {
|
||||
NBTTagCompound data = tags.getCompoundTagAt(i);
|
||||
int j = data.getByte("Slot") & 255;
|
||||
|
||||
if (j >= 0 && j < inventory.length) {
|
||||
inventory[j] = ItemStack.loadItemStackFromNBT(data);
|
||||
}
|
||||
}
|
||||
|
||||
if (nbt.hasKey("CustomName", 8))
|
||||
{
|
||||
this.name = nbt.getString("CustomName");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
NBTTagList tags = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < inventory.length; i++) {
|
||||
if (inventory[i] != null) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setByte("Slot", (byte) i);
|
||||
inventory[i].writeToNBT(data);
|
||||
tags.appendTag(data);
|
||||
}
|
||||
}
|
||||
|
||||
nbt.setTag("Items", tags);
|
||||
|
||||
if (this.hasCustomInventoryName())
|
||||
{
|
||||
nbt.setString("CustomName", this.name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory(){
|
||||
return inventory.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot){
|
||||
return inventory[slot];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
if (inventory[slot] != null) {
|
||||
ItemStack is = inventory[slot];
|
||||
inventory[slot] = null;
|
||||
return is;
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack){
|
||||
inventory[slot] = stack;
|
||||
|
||||
if(stack != null && stack.stackSize > getInventoryStackLimit()){
|
||||
stack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName(){
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isUseableByPlayer(EntityPlayer player){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit(){
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side){
|
||||
int[] slots = new int[getSizeInventory()];
|
||||
|
||||
for(int c = 0; c < slots.length; c++){
|
||||
slots[c] = c;
|
||||
}
|
||||
|
||||
if(side != 0){
|
||||
return slots;
|
||||
} else if(side == 0){
|
||||
return new int[] {2};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack itemStack){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack itemStack, int side){
|
||||
if(side != 0){
|
||||
if(slot == 0){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if(side == 0){
|
||||
if(slot == 2){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack itemStack, int side){
|
||||
if(side != 0){
|
||||
if(slot == 1){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if(side == 0){
|
||||
if(slot == 2){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(){}
|
||||
|
||||
@Override
|
||||
public void closeInventory(){
|
||||
NBTTagList tags = new NBTTagList();
|
||||
System.out.print(tags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeToNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
||||
readFromNBT(packet.func_148857_g());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user