mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 04:35:03 +00:00
Brush Editor
This commit is contained in:
1 parent
16f2901fbc
commit
cb2c7910cf
13 files changed
+274
-19
No files matched your search
@@ -12,6 +12,9 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,6 +33,7 @@ public class ItemNpcTool extends Item {
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(CustomItems.tab);
|
||||
CustomNpcs.proxy.registerItem(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,15 +71,26 @@ public class ItemNpcTool extends Item {
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(world.isRemote) {
|
||||
int meta = stack.getItemDamage();
|
||||
if(meta < 0 || meta >= toolTypes.length) meta = 0;
|
||||
// Send a simple chat message indicating which tool was used
|
||||
player.addChatMessage(new ChatComponentTranslation("item.npc_tool." + toolTypes[meta] + ".use"));
|
||||
if(!world.isRemote)
|
||||
return stack;
|
||||
|
||||
if(player.isSneaking() && isPaintbrush(stack)){
|
||||
|
||||
} else if(isPaintbrush(stack)){
|
||||
|
||||
}
|
||||
if(CustomNpcsPermissions.hasPermission(player, CustomNpcsPermissions.PAINTBRUSH_GUI)){
|
||||
CustomNpcs.proxy.openGui(0, 0, 0, EnumGuiType.Paintbrush, player);
|
||||
}
|
||||
else
|
||||
player.addChatMessage(new ChatComponentTranslation("item.npc_tool." + toolTypes[stack.getItemDamage()] + ".use"));
|
||||
return stack;
|
||||
}
|
||||
|
||||
public boolean isPaintbrush(ItemStack itemStack){
|
||||
return itemStack.getItemDamage() == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String name){
|
||||
GameRegistry.registerItem(this, name);
|
||||
|
||||
Reference in new issue
Block a user