Full Imports and Code Format Optimization

This commit is contained in:
Kam committed 2025-03-12 20:12:01 -04:00
1 parent 250edf099c
commit 6815f579a7
1192 files changed
+60344 -62167

No files matched your search

@@ -18,28 +18,28 @@ import noppes.npcs.CustomNpcsPermissions;
import noppes.npcs.blocks.tiles.TileRedstoneBlock;
import noppes.npcs.constants.EnumGuiType;
public class BlockNpcRedstone extends BlockContainer{
public BlockNpcRedstone(){
public class BlockNpcRedstone extends BlockContainer {
public BlockNpcRedstone() {
super(Material.rock);
}
@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 false;
ItemStack currentItem = player.inventory.getCurrentItem();
if (currentItem != null && currentItem.getItem() == CustomItems.wand && CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.EDIT_REDSTONE)) {
TileEntity tile = par1World.getTileEntity(i, j, k);
NBTTagCompound compound = new NBTTagCompound();
tile.writeToNBT(compound);
PacketHandler.Instance.sendToPlayer(new GuiRedstonePacket(compound), (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 false;
ItemStack currentItem = player.inventory.getCurrentItem();
if (currentItem != null && currentItem.getItem() == CustomItems.wand && CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.EDIT_REDSTONE)) {
TileEntity tile = par1World.getTileEntity(i, j, k);
NBTTagCompound compound = new NBTTagCompound();
tile.writeToNBT(compound);
PacketHandler.Instance.sendToPlayer(new GuiRedstonePacket(compound), (EntityPlayerMP) player);
return true;
}
return false;
}
return false;
}
@Override
public void onBlockAdded(World par1World, int par2, int par3, int par4){
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this);
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this);
par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this);
@@ -50,46 +50,46 @@ public class BlockNpcRedstone extends BlockContainer{
}
@Override
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack item){
if(entityliving instanceof EntityPlayer && world.isRemote){
CustomNpcs.proxy.openGui(i, j, k, EnumGuiType.RedstoneBlock, (EntityPlayer) entityliving);
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack item) {
if (entityliving instanceof EntityPlayer && world.isRemote) {
CustomNpcs.proxy.openGui(i, j, k, EnumGuiType.RedstoneBlock, (EntityPlayer) entityliving);
}
}
@Override
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {
onBlockAdded(par1World, par2, par3, par4);
onBlockAdded(par1World, par2, par3, par4);
}
@Override
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){
if(isActivated(par1IBlockAccess, par2, par3, par4) > 0)
return 0xFF6B68;
else
return super.colorMultiplier(par1IBlockAccess, par2, par3, par4);
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
if (isActivated(par1IBlockAccess, par2, par3, par4) > 0)
return 0xFF6B68;
else
return super.colorMultiplier(par1IBlockAccess, par2, par3, par4);
}
@Override
public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5){
public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
return isActivated(par1IBlockAccess, par2, par3, par4);
}
@Override
public int isProvidingStrongPower(IBlockAccess par1World, int par2, int par3, int par4, int par5){
public int isProvidingStrongPower(IBlockAccess par1World, int par2, int par3, int par4, int par5) {
return isActivated(par1World, par2, par3, par4);
}
@Override
public boolean canProvidePower(){
public boolean canProvidePower() {
return true;
}
public int isActivated(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){
return par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 1?15 : 0;
}
public int isActivated(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
return par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 1 ? 15 : 0;
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileRedstoneBlock();
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileRedstoneBlock();
}
}