mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 12:39:05 +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
@@ -14,35 +14,35 @@ import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.blocks.tiles.TileBook;
|
||||
|
||||
public class BlockBook extends BlockRotated{
|
||||
public class BlockBook extends BlockRotated {
|
||||
|
||||
public BlockBook() {
|
||||
public BlockBook() {
|
||||
super(Blocks.planks);
|
||||
setBlockBounds(0, 0, 0, 1, 0.2f, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int i, int j, int k, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||
if(par1World.isRemote)
|
||||
return true;
|
||||
TileEntity tile = par1World.getTileEntity(i, j, k);
|
||||
if(!(tile instanceof TileBook))
|
||||
return false;
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
if (currentItem != null && currentItem.getItem() == CustomItems.wand && CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.EDIT_BOOK)) {
|
||||
((TileBook)tile).book.func_150996_a(Items.writable_book);
|
||||
}
|
||||
PacketHandler.Instance.sendToPlayer(new GuiOpenBookPacket(i, j, k, ((TileBook)tile).book.writeToNBT(new NBTTagCompound())), (EntityPlayerMP) player);
|
||||
public boolean onBlockActivated(World par1World, int i, int j, int k, EntityPlayer player, int par6, float par7, float par8, float par9) {
|
||||
if (par1World.isRemote)
|
||||
return true;
|
||||
TileEntity tile = par1World.getTileEntity(i, j, k);
|
||||
if (!(tile instanceof TileBook))
|
||||
return false;
|
||||
ItemStack currentItem = player.inventory.getCurrentItem();
|
||||
if (currentItem != null && currentItem.getItem() == CustomItems.wand && CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.EDIT_BOOK)) {
|
||||
((TileBook) tile).book.func_150996_a(Items.writable_book);
|
||||
}
|
||||
PacketHandler.Instance.sendToPlayer(new GuiOpenBookPacket(i, j, k, ((TileBook) tile).book.writeToNBT(new NBTTagCompound())), (EntityPlayerMP) player);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(){
|
||||
return "item.book";
|
||||
public String getUnlocalizedName() {
|
||||
return "item.book";
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return new TileBook();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return new TileBook();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user