mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 15:45:10 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -17,33 +17,32 @@ import noppes.npcs.blocks.tiles.TileVariant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSign extends BlockRotated{
|
||||
public class BlockSign extends BlockRotated {
|
||||
|
||||
public BlockSign() {
|
||||
public BlockSign() {
|
||||
super(Blocks.planks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
||||
{
|
||||
int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
int l = MathHelper.floor_double((double) (par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
l %= 4;
|
||||
TileSign tile = (TileSign) par1World.getTileEntity(par2, par3, par4);
|
||||
tile.rotation = l;
|
||||
tile.time = System.currentTimeMillis();
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, par6ItemStack.getItemDamage() , 2);
|
||||
if(par5EntityLivingBase instanceof EntityPlayer && par1World.isRemote)
|
||||
((EntityPlayer)par5EntityLivingBase).addChatComponentMessage(new ChatComponentTranslation("availability.editIcon"));
|
||||
tile.rotation = l;
|
||||
tile.time = System.currentTimeMillis();
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, par6ItemStack.getItemDamage(), 2);
|
||||
if (par5EntityLivingBase instanceof EntityPlayer && par1World.isRemote)
|
||||
((EntityPlayer) par5EntityLivingBase).addChatComponentMessage(new ChatComponentTranslation("availability.editIcon"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){
|
||||
TileBanner tile = (TileBanner) world.getTileEntity(x, y, z);
|
||||
return tile.canEdit();
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
TileBanner tile = (TileBanner) world.getTileEntity(x, y, z);
|
||||
return tile.canEdit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List){
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
par3List.add(new ItemStack(par1, 1, 0));
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
par3List.add(new ItemStack(par1, 1, 2));
|
||||
@@ -53,26 +52,26 @@ public class BlockSign extends BlockRotated{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
if(!(tileentity instanceof TileVariant)){
|
||||
super.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return;
|
||||
}
|
||||
TileVariant tile = (TileVariant) tileentity;
|
||||
if(tile.rotation % 2 == 1)
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
if (!(tileentity instanceof TileVariant)) {
|
||||
super.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return;
|
||||
}
|
||||
TileVariant tile = (TileVariant) tileentity;
|
||||
if (tile.rotation % 2 == 1)
|
||||
setBlockBounds(0, 0.3f, 0.3f, 1, 1, 0.7f);
|
||||
else
|
||||
else
|
||||
setBlockBounds(0.3f, 0.3f, 0, 0.7f, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1){
|
||||
public int damageDropped(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return new TileSign();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return new TileSign();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user