
jamiemac262
Members-
Posts
87 -
Joined
-
Last visited
Everything posted by jamiemac262
-
ok, that makes this sooo much easier haha Thanks
-
oh... so actually, just the command name would suffice?
-
no, the ID is part of the permission in the config file, as a way to identify the different mods... so the system won't be confused if Thermal expansion and IC2 use the same command (for example) surely there's a way to identify the mod that a command belongs to?
-
Hi, Is it possible to get the modid of a command when a command is sent to the server? I'm building a permission manager and I want users to be able to enter something like <modid>.<command> so... "factionmod.create" where factionmod is the ID I have an event handler that runs a method everytime a command is sent, I need it to get the modid to check groups for that modid it needs to be the modid because you might have multiple mods that use the same commands (galacticraft.create and factionmod.create for example) Anyone know how to do this? Thanks
-
For anybody who might look for the answer to this in the future, GSON is the solution create a class for the object you want to make JSON Class Groups{ private String name; private boolean initial; private String[] permissions; public Group(String n, boolean init, String[] p) { // TODO Auto-generated constructor stub name = n; initial = init; permissions = p; } } then in the syncConfig() method you do something like this: String[] perms = {"vanilla.help"}; String[] oPerms = {"*"}; Group def = new Group("default", true, perms); Group owner = new Group("Owner", false, oPerms); Gson g = new Gson(); String json1 = g.toJson(def); String json2 = g.toJson(owner); String[] groups = {json1, json2}; config.getStringList("Groups", "groups", groups, "Comment here");
-
SOMEBODY PLEASE PLEASE PLEASE HELP!
jamiemac262 replied to Brad Is Romantic's topic in Modder Support
there are still videos out there... although most tutorials are text based now -
Run a method whenever a command is entered
jamiemac262 replied to jamiemac262's topic in Modder Support
Thanks now I have something to start on. latest conundrum, if you're interested: -
Hi, I'm building a simple permission manager for a friend. I'm pretty much learning everything as I go. What I'm trying to do right now is create a config file that lists the users, each user's group and the groups/permissions I want the permissions to be readable so I was trying to replicate the PermissionsEx Bukkit plugin e.g. default: default: true permissions: vanilla.gamemode so it's basically a key/value format. [groupname: [default: true, permissions: [vanilla.gamemode, vanilla.help]]] I'm not really sure how to do this using the Configuration class. Can someone help me with this? I'm using 1.12 Thanks
-
Run a method whenever a command is entered
jamiemac262 replied to jamiemac262's topic in Modder Support
If it helps, I'm building this for 1.12 -
SOMEBODY PLEASE PLEASE PLEASE HELP!
jamiemac262 replied to Brad Is Romantic's topic in Modder Support
A JAR file is an archive (collection) of classes that java can run... It only runs in JAVA An EXE file is a windows executable, It runs in windows without the need of java You screwed up the installation. The minecraft Forge installer needs an existing version of minecraft 1.12 before it can install. If you have deleted the .minecraft folder there won't be any versions of 1.12. try what I suggested, delete .minecraft and uninstall the Minecraft launcher. then start from scratch If you want to use a video get one that's less than 2 years old -
SOMEBODY PLEASE PLEASE PLEASE HELP!
jamiemac262 replied to Brad Is Romantic's topic in Modder Support
you might need to download and play on minecraft 1.12 before you can install forge 1.12 -
SOMEBODY PLEASE PLEASE PLEASE HELP!
jamiemac262 replied to Brad Is Romantic's topic in Modder Support
I think you've been watching videos from about 6 or 7 years ago Modding's come a looong way, Delete your .minecraft folder, uninstall minecraft launcher from your program file. then you should be able to start from scratch. Install minecraft then go to files.minecraftforge.net and get the version you want to play on.... download the INSTALLER run the installer and follow the instructions it show's you. it's that simple now -
Hi, I'm trying to build a simple permission system for a friend. The best way I can see to do this is to run a method whenever a command is sent to the server, even commands from other mods, then check the sender UUID against a YAML (or maybe JSON) file for the sender's group, and check that group for a permission (similar to the way PEX ran on bukkit). I'm also going to do the same thing for blocks...(Pretty sure I've seen an "onBlockPlaced" event example on the internet in the past) so a user group won't be able to place IC2 nukes without a permission like place.{modid}.{unlocalisedname} I have no knowledge of how to do anything of what I have just said First things first... I've had a look and I can't work out how to call a method whenever a command is sent to the server. Can someone help me out with this?... I think I can work the rest out on my own Thanks
-
thanks guys, that fixed it.... do either of you know if there's a way to stretch a background texture to a certain size? the image I have is too small, I wanna stretch it to fill more of the screen
-
Hi I'm trying to display a simple GUI, some buttons and a text box (if I can work out how to display one, lol). At the moment I'm just trying to draw a background.... This isn't working.... I know the function to draw the background it being called (drawScreen()) as when I right click the block that triggers the GUI, the screen goes dark (the default background) Can someone take a look and see where I'm going wrong? According to the logs there are no errors when the GUI is triggered The GUIScreen: package net.tekkcraft.factions.gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ResourceLocation; import java.io.IOException; /** * Created by jamie on 07/03/2017. */ public class FactionCoreGuiScreen extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); mc.getTextureManager().bindTexture(new ResourceLocation("factionMod", "/textures/gui/core.png")); super.drawScreen(mouseX, mouseY, partialTicks); } @Override public boolean doesGuiPauseGame() { return false; } @Override public void initGui() { } @Override protected void actionPerformed(GuiButton button) throws IOException { } }
-
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
I fixed it! thanks guys, The problem was the way I had set up my proxies Not only did I not have all the classes and methods I needed, but I also wasn't calling them in the main class -.- The client no longer crashes! -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
hold up... I think the tutorial I followed when setting up proxies missed a step 0.o override commonProxy.init? CommonProxy doesn't extend anything lol (I looked at bedrockminer's tutorial and noticed he has a "serverProxy" that extends Common proxy... I'll follow his proxy tutorial now and make changes) -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
here's what I've changed so far I can only see "Block Right Clicked" in the logs, that's where it crashes The right click event: public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { System.out.println("Block Right Clicked"); if(worldIn.isRemote) { playerIn.openGui(Factions.instance, GuiHandler.MOD_TILE_ENTITY_GUI, worldIn, pos.getX(), pos.getY(), pos.getZ()); } return true; } The GuiHandler: @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { System.out.println("GetServerGUI Will return null"); return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { System.out.println("clientGUI"); if (ID == MOD_TILE_ENTITY_GUI) return new FactionCoreGuiScreen(); else System.out.println("clientGUI null"); return null; } -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
indeed.... I'll bet my problem is something that's changed since this was written -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
nope, ignore me, that didn't fix it -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
my god it was actually in the damn tutorial! I must have overlooked that at least a dozen times! https://bedrockminer.jimdo.com/modding-tutorials/advanced-modding/gui-screen/ -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
wait... do I NEED a container to open a GUI? It's just going to be text and buttons, not storing any items...... (or have I misunderstood "container")? -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
I added println's to the 2 GuiHandler functions and it turns out the game is crashing before it calls either of the functions so it's not the getServerGUIElement -
Trying to open GUI causes game to crash
jamiemac262 replied to jamiemac262's topic in Modder Support
I changed getServerGuiElement to just return null..... tested the mod and got the same problem. I have no idea what I'm meant to do here IGuiHandler is registered in the common proxy: public void init(FMLInitializationEvent e){ NetworkRegistry.INSTANCE.registerGuiHandler(Factions.instance, new GuiHandler()); } is that correct? also my @Mod.Instance should be find as I've used it in other parts of the mod @Mod.Instance(MODID) public static Factions instance; It looks like the problem might be what you suggested, I just don't know how to fix it thanks Jamie -
Hi, I'm having a problem with displaying a GUI Screen when I right click a block. Whenever I right click the block the game crashes and I get a null pointer exception: I've had a good look at my code and I can't see what's wrong. Can anyone help? The event in the BlockCore.java: @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { System.out.println("Block Right Clicked"); playerIn.openGui(Factions.instance, GuiHandler.MOD_TILE_ENTITY_GUI, worldIn, pos.getX(), pos.getY(), pos.getZ()); return true; } The GUI Handler: public class GuiHandler implements IGuiHandler { public static final int MOD_TILE_ENTITY_GUI = 0; @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == MOD_TILE_ENTITY_GUI) return new FactionCoreGuiScreen(); return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == MOD_TILE_ENTITY_GUI) return new FactionCoreGuiScreen(); return null; } } FactionCoreGuiScreen: public class FactionCoreGuiScreen extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); super.drawScreen(mouseX, mouseY, partialTicks); } @Override public boolean doesGuiPauseGame() { return false; } @Override public void initGui() { } @Override protected void actionPerformed(GuiButton button) throws IOException { }