mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 12:43:16 +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
@@ -19,69 +19,66 @@ import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
public class ItemNpcWand extends Item{
|
||||
public class ItemNpcWand extends Item {
|
||||
|
||||
public ItemNpcWand(){
|
||||
public ItemNpcWand() {
|
||||
maxStackSize = 1;
|
||||
setCreativeTab(CustomItems.tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player){
|
||||
if(!par2World.isRemote)
|
||||
return par1ItemStack;
|
||||
else if(CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.NPC_GUI)){
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player) {
|
||||
if (!par2World.isRemote)
|
||||
return par1ItemStack;
|
||||
else if (CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.NPC_GUI)) {
|
||||
CustomNpcs.proxy.openGui(0, 0, 0, EnumGuiType.NpcRemote, player);
|
||||
}
|
||||
else
|
||||
} else
|
||||
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, final EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if(par3World.isRemote)
|
||||
return false;
|
||||
if(ConfigMain.OpsOnly && !MinecraftServer.getServer().getConfigurationManager().func_152596_g(player.getGameProfile())){
|
||||
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, final EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
if (par3World.isRemote)
|
||||
return false;
|
||||
}
|
||||
else if(CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.NPC_CREATE)){
|
||||
EntityCustomNpc npc = new EntityCustomNpc(par3World);
|
||||
npc.ais.startPos = new int[]{par4,par5,par6};
|
||||
if (ConfigMain.OpsOnly && !MinecraftServer.getServer().getConfigurationManager().func_152596_g(player.getGameProfile())) {
|
||||
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
|
||||
return false;
|
||||
} else if (CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.NPC_CREATE)) {
|
||||
EntityCustomNpc npc = new EntityCustomNpc(par3World);
|
||||
npc.ais.startPos = new int[]{par4, par5, par6};
|
||||
|
||||
npc.setLocationAndAngles((float)par4 + 0.5F, npc.getStartYPos(), (float)par6 + 0.5F, player.rotationYaw, player.rotationPitch);
|
||||
npc.setLocationAndAngles((float) par4 + 0.5F, npc.getStartYPos(), (float) par6 + 0.5F, player.rotationYaw, player.rotationPitch);
|
||||
|
||||
par3World.spawnEntityInWorld(npc);
|
||||
npc.setHealth(npc.getMaxHealth());
|
||||
par3World.spawnEntityInWorld(npc);
|
||||
npc.setHealth(npc.getMaxHealth());
|
||||
|
||||
NoppesUtilServer.sendOpenGuiNoDelay(player, EnumGuiType.MainMenuDisplay,npc);
|
||||
NoppesUtilServer.sendOpenGuiNoDelay(player, EnumGuiType.MainMenuDisplay, npc);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
|
||||
} else
|
||||
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(ItemStack par1ItemStack, int par2){
|
||||
return 0x8B4513;
|
||||
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
|
||||
return 0x8B4513;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresMultipleRenderPasses(){
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister){
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
this.itemIcon = Items.iron_hoe.getIconFromDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String name){
|
||||
GameRegistry.registerItem(this, name);
|
||||
return super.setUnlocalizedName(name);
|
||||
public Item setUnlocalizedName(String name) {
|
||||
GameRegistry.registerItem(this, name);
|
||||
return super.setUnlocalizedName(name);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user