CustomNpcs:

-Added ScriptOpsOnly config, which controls if only ops can see and edit scripts.
-Added ScriptDevs config, a list of the UUIDs of players who should be able to see and edit scripts. If left empty and ScriptOpsOnly is false, everyone can see and edit scripts with a scripter.

IPlayer:
-Added isScriptDev() function to check if the player can see and edit scripts.
This commit is contained in:
c0508383 committed 2022-07-07 16:22:50 -05:00
1 parent 5fdef1cd0c
commit 22e01bba1f
6 files changed
+72 -26

No files matched your search

@@ -5,6 +5,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.world.World;
import noppes.npcs.CustomItems;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -31,11 +33,15 @@ public class ItemNpcScripter extends Item{
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
if(!par2World.isRemote)
return par1ItemStack;
CustomNpcs.proxy.openGui(0, 0, 0, EnumGuiType.ScriptEvent, par3EntityPlayer);
return par1ItemStack;
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player){
if(!world.isRemote)
return itemStack;
if(!CustomNpcs.isScriptDev(player)){
player.addChatMessage(new ChatComponentTranslation("availability.permission"));
} else {
CustomNpcs.proxy.openGui(0, 0, 0, EnumGuiType.ScriptEvent, player);
}
return itemStack;
}
@SideOnly(Side.CLIENT)