Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Stenbergcsgo

Members
  • Posts

    62
  • Joined

  • Last visited

Posts posted by Stenbergcsgo

  1. 19 minutes ago, diesieben07 said:

    The code you posted above is completely broken.

    Sponge is not needed, you need a Forge server.

    As it's been working fine locally, how can it be completely broken?

     

    Edit: Just tried running it on my server and it is indeed absolutely broken - would however like to know why so I can fix it =)

     

    Edit2: Added log if it helps in any way.

    [11:58:05] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
    [11:58:05] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker
    [11:58:05] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker
    [11:58:05] [main/INFO] [FML]: Forge Mod Loader version 14.23.3.2655 for Minecraft 1.12.2 loading
    [11:58:05] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_131, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_131
    [11:58:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
    [11:58:06] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
    [11:58:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
    [11:58:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
    [11:58:06] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
    [11:58:09] [main/INFO] [FML]: Found valid fingerprint for Minecraft Forge. Certificate fingerprint e3c3d50c7c986df74c645c0ac54639741c90a557
    [11:58:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
    [11:58:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
    [11:58:11] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
    [11:58:11] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
    [11:58:11] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer}
    [11:58:18] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Starting minecraft server version 1.12.2
    [11:58:18] [Server thread/INFO] [FML]: MinecraftForge v14.23.3.2655 Initialized
    [11:58:18] [Server thread/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients.
    [11:58:18] [Server thread/INFO] [FML]: Replaced 1036 ore ingredients
    [11:58:19] [Server thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
    [11:58:19] [Server thread/INFO] [FML]: Searching C:\Users\Frederik\Desktop\Forge server\mods for mods
    [11:58:19] [Server thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
    [11:58:19] [Server thread/WARN] [FML]: Missing English translation for FML: assets/fml/lang/en_us.lang
    [11:58:20] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, um] at CLIENT
    [11:58:20] [Server thread/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, um] at SERVER
    [11:58:21] [Server thread/INFO] [FML]: Processing ObjectHolder annotations
    [11:58:21] [Server thread/INFO] [FML]: Found 1168 ObjectHolder annotations
    [11:58:21] [Server thread/INFO] [FML]: Identifying ItemStackHolder annotations
    [11:58:21] [Server thread/INFO] [FML]: Found 0 ItemStackHolder annotations
    [11:58:21] [Server thread/INFO] [FML]: Configured a dormant chunk cache size of 0
    [11:58:21] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
    [11:58:21] [Server thread/INFO] [FML]: Applying holder lookups
    [11:58:22] [Server thread/INFO] [FML]: Holder lookups applied
    [11:58:22] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@67fc26f6:
    java.lang.NoClassDefFoundError: com/mta/utzonmod/client/gui/signInputGui
    	at com.mta.utzonmod.items.SchematicSign.<init>(SchematicSign.java:21) ~[SchematicSign.class:?]
    	at com.mta.utzonmod.init.ModItems.<clinit>(ModItems.java:15) ~[ModItems.class:?]
    	at com.mta.utzonmod.util.handlers.RegistryHandler.onItemRegister(RegistryHandler.java:16) ~[RegistryHandler.class:?]
    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_RegistryHandler_onItemRegister_Register.invoke(.dynamic) ~[?:?]
    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
    	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143) ~[EventBus$1.class:?]
    	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) [EventBus.class:?]
    	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:739) [GameData.class:?]
    	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604) [Loader.class:?]
    	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98) [FMLServerHandler.class:?]
    	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:332) [FMLCommonHandler.class:?]
    	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125) [nz.class:?]
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) [MinecraftServer.class:?]
    	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
    Caused by: java.lang.ClassNotFoundException: com.mta.utzonmod.client.gui.signInputGui
    	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	... 14 more
    Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@28a2a3e7 from coremod FMLCorePlugin
    	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:262) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	... 14 more
    Caused by: java.lang.RuntimeException: Attempted to load class com/mta/utzonmod/client/gui/signInputGui for invalid side SERVER
    	at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
    	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:258) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	... 14 more
    [11:58:22] [Server thread/ERROR] [FML]: Index: 2 Listeners:
    [11:58:22] [Server thread/ERROR] [FML]: 0: NORMAL
    [11:58:22] [Server thread/ERROR] [FML]: 1: net.minecraftforge.fml.common.eventhandler.EventBus$1@26df43d6
    [11:58:22] [Server thread/ERROR] [FML]: 2: net.minecraftforge.fml.common.eventhandler.EventBus$1@56679711
    [11:58:22] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
    java.lang.NoClassDefFoundError: com/mta/utzonmod/client/gui/signInputGui
    	at com.mta.utzonmod.items.SchematicSign.<init>(SchematicSign.java:21) ~[SchematicSign.class:?]
    	at com.mta.utzonmod.init.ModItems.<clinit>(ModItems.java:15) ~[ModItems.class:?]
    	at com.mta.utzonmod.util.handlers.RegistryHandler.onItemRegister(RegistryHandler.java:16) ~[RegistryHandler.class:?]
    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_RegistryHandler_onItemRegister_Register.invoke(.dynamic) ~[?:?]
    	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
    	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143) ~[EventBus$1.class:?]
    	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) ~[EventBus.class:?]
    	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:739) ~[GameData.class:?]
    	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604) ~[Loader.class:?]
    	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98) ~[FMLServerHandler.class:?]
    	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:332) ~[FMLCommonHandler.class:?]
    	at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125) ~[nz.class:?]
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) [MinecraftServer.class:?]
    	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
    Caused by: java.lang.ClassNotFoundException: com.mta.utzonmod.client.gui.signInputGui
    	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	... 14 more
    Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@28a2a3e7 from coremod FMLCorePlugin
    	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:262) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	... 14 more
    Caused by: java.lang.RuntimeException: Attempted to load class com/mta/utzonmod/client/gui/signInputGui for invalid side SERVER
    	at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
    	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:258) ~[forge-1.12.2-14.23.3.2655-universal.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
    	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
    	... 14 more
    [11:58:22] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: UP_TO_DATE Target: null
    [11:58:22] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: This crash report has been saved to: C:\Users\Frederik\Desktop\Forge server\.\crash-reports\crash-2018-05-03_11.58.22-server.txt
    [11:58:22] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Stopping server
    [11:58:22] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Saving worlds
    [11:58:22] [Server thread/WARN] [FML]: Can't revert to frozen GameData state without freezing first.
    [11:58:22] [Server thread/INFO] [FML]: The state engine was in incorrect state INITIALIZATION and forced into state SERVER_STOPPED. Errors may have been discarded.
    [11:58:22] [Server Shutdown Thread/INFO] [net.minecraft.server.MinecraftServer]: Stopping server
    [11:58:22] [Server Shutdown Thread/INFO] [net.minecraft.server.MinecraftServer]: Saving worlds
    

     

  2. I made what I thought was purely client-side: A mod where the player have 3 custom items that can be used as replacement of posting strings to chat. The plugin works fine when using it locally, but when I try to use the mod in a server, I have the items, but using them yields no results at all.

     

    An example of one of my item classes:

    package com.mta.utzonmod.items;
    
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    
    import com.mta.utzonmod.client.gui.signInputGui;
    
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.entity.EntityPlayerSP;
    import net.minecraft.command.ICommandManager;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.server.MinecraftServer;
    import net.minecraft.server.gui.MinecraftServerGui;
    import net.minecraft.util.ActionResult;
    import net.minecraft.util.EnumHand;
    import net.minecraft.util.text.ITextComponent;
    import net.minecraft.util.text.TextComponentString;
    import net.minecraft.world.World;
    
    public class Paste extends ItemBase{ 
        public Paste(String name) {
            
            super(name);
        }
        
        static boolean canPlace = false;
        
        @Override
        public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {
                if(canPlace == true) {
                    EntityPlayerSP playerSP = Minecraft.getMinecraft().player;
                    playerSP.sendChatMessage("//paste");
                    canPlace = false;
                    Undo.setCanUndo(true);
                }
            return super.onItemRightClick(worldIn, player, handIn);    
        }
        
        public static void setCanPlace(boolean cPlace) {
            canPlace = cPlace;
        }
    }

     

    Am I using something that's server sided?
     

  3. So I've created a mod for the newest version of Minecraft ( This is the first iteration of the mod) - however I would like for the mod to be additionally compatible with the Minecraft version 1.11.2. To create the mod I used the MCP eclipse workspace setup, is there an easy fix for me to rollback the mod, or do I need to setup a new MCP workspace for that version, then "remake" my mod?

  4. 6 minutes ago, diesieben07 said:

    Calling sendMessage on the server sends a message to the player via chat.

    If you want to execute a command on behalf of a player, call ICommandManager::executeCommand.

    I assume this can't be done client-side? All the examples I see use:

    MinecraftServer minecraftserver = MinecraftServer.getServer();

    Where I get told MinecraftServer's getServer() isn't static so I can't even call it if I wanted to. How would I implement this in the code from my original post?

  5. I'm trying to create a mod where the player can load, paste, and undo schematics using custom items, compared to manually typing the text. I got the first part working, but for some reason MCEdit ignores messages posted directly using the ITextComponent, opposed to actually typing the text and hitting enter.

     

    An example of my Paste.class:

    package com.mta.utzonmod.items;
    
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    
    import com.mta.utzonmod.client.gui.signInputGui;
    
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.ActionResult;
    import net.minecraft.util.EnumHand;
    import net.minecraft.util.text.ITextComponent;
    import net.minecraft.util.text.TextComponentString;
    import net.minecraft.world.World;
    
    public class Paste extends ItemBase{ 
    	public Paste(String name) {
    		
    		super(name);
    	}
    	
    	static boolean canPlace = false;
    	
    	@Override
    	public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {
    		if(!worldIn.isRemote) {
    			if(canPlace == true) {
    				ITextComponent message = new TextComponentString("//paste");
    				player.sendMessage(message);
    				canPlace = false;
    				Undo.setCanUndo(true);
    			}
    		}
    		return super.onItemRightClick(worldIn, player, handIn);	
    	}
    	
    	public static void setCanPlace(boolean cPlace) {
    		canPlace = cPlace;
    	}
    }
    

     

    Is there another component I can use for sending text, or is it a whole other size of problem?

  6. 14 hours ago, jabelar said:

    You shouldn't have lost any of your classes, all you needed to do was to rebuild your workspace using gradlew setupDecompWorkspace and gradlew eclipse. It will re-download everything, fix up your classpath, and update your run configurations.

     

    Note that you should do this regularly anyway to update to latest Forge version. In that case you update your build.gradle file and then do the above.

     

    Lastly, you shouldn't worry about losing your code if you're using a proper code revision system like git. If you're not familiar with using git I have a tutorial here:

      - General tips for setting up for modding: http://jabelarminecraft.blogspot.com/p/quick-tips-eclipse.html

      - Specific tutorial for setting up git (using a free graphical interface called SourceTree): http://jabelarminecraft.blogspot.com/p/minecraft-forge-publishing-to-github.html

    I tried creating a new workspace using your blog, but after importing the project I only have the JRE System Library, and not all the referenced that are needed. Any idea why this is happening?

  7. Aren't there usually gradle files in my lib as well? They also seem to have been removed, now I'm getting following error when trying to start my Main class:
     

    2018-04-16 14:04:31,745 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
    2018-04-16 14:04:31,751 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
    Completely ignored arguments: [--tweakClass, cpw.mods.fml.common.launcher.FMLTweaker]
    Exception in thread "Client thread" java.lang.NoSuchMethodError: com.google.common.collect.Queues.newArrayDeque()Ljava/util/ArrayDeque;
    	at net.minecraft.client.Minecraft.<init>(Minecraft.java:355)
    	at net.minecraft.client.main.Main.main(Main.java:118)
    

     

  8. 17 minutes ago, JulianClark2114 said:

    try having a backup for your progress (the src folder)
    put the back up files in desktop

    then re run
    gradlew setupDecompworkspace

    and gradlew eclipse  in cmd

    on your workspace that should do the trick.

    after both are done return the files back.

    That's odd, I'm getting the 'gradlew' is not recognized as an internal command message

     

    Edit: Tried importing the Guava jar as it seemed to fix the problem; except it then resulted in all my custom classes to return erros. 

    odd.PNG

  9. After taking a break from working on my mod, I today opened my workspace to find that some libraries were missing, making my mod return a ton of errors(See screencap).

     

    I assume it's the forge library messing up, but I have no idea how this happened. Trying to use "Restore from Local History" returns "No deleted resources in local history for selected container".

    Does anyone have experience with this, or know how I can redo the path without messing up my project?

     

    Edit: Just noticed it's my complete "Referenced Libraries" that are missing, if that helps in any way.

     

    rip.PNG

  10. Alright I tried debugging and these are the results:

    [09:39:18] [Server thread/INFO] [STDOUT]: [com.mta.utzonmod.client.gui.signInputGui:initGui:34]: textbox.text : 
    [09:39:18] [Server thread/INFO] [STDOUT]: [com.mta.utzonmod.client.gui.signInputGui:initGui:35]: lineScrollOffset : 129

    textbox.text is empty because I put it to: ""

     

    So it's not null.

     

    Doesn't seem like the textbox is the issue

  11. I created a custom GUI:

    package com.mta.utzonmod.client.gui;
     
    import java.io.IOException;
     
    import org.lwjgl.input.Keyboard;
     
    import net.minecraft.client.gui.GuiButton;
    import net.minecraft.client.gui.GuiScreen;
    import net.minecraft.client.gui.GuiTextField;
    import net.minecraft.client.renderer.GlStateManager;
    import net.minecraft.client.resources.I18n;
    import net.minecraft.util.ChatAllowedCharacters;
    import net.minecraft.util.text.ITextComponent;
    import net.minecraft.util.text.TextComponentString;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;
     
    @SideOnly(Side.CLIENT)
    public class signInputGui extends GuiScreen {
       
        private GuiButton doneBtn;
        private int updateCounter;
        public GuiTextField textfield = new GuiTextField(1, this.fontRenderer, this.width / 2 - 68, this.height / 2 - 46, 137, 20);
        public String playerInput;
       
       
        public void initGui() {
            this.buttonList.clear();
            Keyboard.enableRepeatEvents(true);
            this.doneBtn = this.addButton(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, I18n.format("gui.done"))); 
            textfield.setMaxStringLength(30);
            textfield.setText("");
            this.textfield.setFocused(true);
        }
       
        public void keyTyped(char c, int i) throws IOException {
            super.keyTyped(c, i);
            this.textfield.textboxKeyTyped(c, i);
           
        }
       
        public void onGuiClosed() {
            textfield.setFocused(false);
            Keyboard.enableRepeatEvents(false);
        }
       
        public void updateScreen() {
            ++this.updateCounter;
            this.textfield.updateCursorCounter();
            playerInput = textfield.getText();
        }
       
        protected void actionPerformed(GuiButton button) throws IOException {
            if(button.enabled) {
                if(button.id == 0) {
                    this.mc.displayGuiScreen((GuiScreen)null);
                }
            }
        }
       
        public void drawScreen(int mouseX, int mouseY, float partialTicks) {
            this.drawDefaultBackground();
            this.drawCenteredString(this.fontRenderer, "Insert schematic name",this.width / 2, 40, 16777215);
            this.textfield.drawTextBox();
            super.drawScreen(mouseX, mouseY, partialTicks);
        }
       
        protected void mouseClicked(int x, int y, int btn) throws IOException {
            super.mouseClicked(x, y, btn);
            this.textfield.mouseClicked(x, y, btn);
        }
       
        public String getPlayerInput() {
            return playerInput;
        }
    }

     

    And it works (somewhat) - If I open the game, and wait for a bit, then use my custom item with GUI it works as expected, but if I use the item as soon as I get into the server, I get a crash. Because of the nature of the error I expect it has something to do with the initialization, but in what manner I am unclear.

     

    Full error:

    ---- Minecraft Crash Report ----
    // Oh - I know what I did wrong!
    
    Time: 4/9/18 11:57 AM
    Description: Rendering screen
    
    java.lang.NullPointerException: Rendering screen
    	at net.minecraft.client.gui.GuiTextField.drawTextBox(GuiTextField.java:545)
    	at com.mta.utzonmod.client.gui.signInputGui.drawScreen(signInputGui.java:65)
    	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:368)
    	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1177)
    	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1207)
    	at net.minecraft.client.Minecraft.run(Minecraft.java:441)
    	at net.minecraft.client.main.Main.main(Main.java:118)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    	at GradleStart.main(GradleStart.java:26)
    
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Thread: Client thread
    Stacktrace:
    	at net.minecraft.client.gui.GuiTextField.drawTextBox(GuiTextField.java:545)
    	at com.mta.utzonmod.client.gui.signInputGui.drawScreen(signInputGui.java:65)
    	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:368)
    
    -- Screen render details --
    Details:
    	Screen name: com.mta.utzonmod.client.gui.signInputGui
    	Mouse location: Scaled: (105, 197). Absolute: (427, 240)
    	Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2
    
    -- Affected level --
    Details:
    	Level name: MpServer
    	All players: 1 total; [EntityPlayerSP['Player503'/163, l='MpServer', x=2020.62, y=3.00, z=1209.47]]
    	Chunk stats: MultiplayerChunkCache: 622, 622
    	Level seed: 0
    	Level generator: ID 01 - flat, ver 0. Features enabled: false
    	Level generator options: 
    	Level spawn location: World: (1994,4,1180), Chunk: (at 10,0,12 in 124,73; contains blocks 1984,0,1168 to 1999,255,1183), Region: (3,2; contains chunks 96,64 to 127,95, blocks 1536,0,1024 to 2047,255,1535)
    	Level time: 13786 game time, 13786 day time
    	Level dimension: 0
    	Level storage version: 0x00000 - Unknown?
    	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    	Forced entities: 79 total; [EntitySlime['Slime'/128, l='MpServer', x=2056.45, y=4.89, z=1280.15], EntityChicken['Chicken'/130, l='MpServer', x=2066.11, y=4.00, z=1252.91], EntityVillager['Villager'/132, l='MpServer', x=2094.50, y=5.00, z=1206.49], EntityVillager['Villager'/133, l='MpServer', x=2081.49, y=5.00, z=1200.07], EntityPlayerSP['Player503'/163, l='MpServer', x=2020.62, y=3.00, z=1209.47], EntitySlime['Slime'/40, l='MpServer', x=1945.09, y=4.00, z=1152.57], EntitySkeleton['Skeleton'/42, l='MpServer', x=1945.50, y=4.00, z=1201.50], EntitySkeleton['Skeleton'/43, l='MpServer', x=1940.81, y=4.00, z=1203.76], EntityCreeper['Creeper'/44, l='MpServer', x=1944.48, y=4.00, z=1208.58], EntityCreeper['Creeper'/45, l='MpServer', x=1951.50, y=4.00, z=1209.89], EntityPig['Pig'/47, l='MpServer', x=1945.79, y=4.00, z=1223.39], EntitySlime['Slime'/48, l='MpServer', x=1949.68, y=4.00, z=1219.31], EntitySlime['Slime'/49, l='MpServer', x=1959.03, y=4.00, z=1238.07], EntitySlime['Slime'/50, l='MpServer', x=1941.76, y=4.11, z=1235.26], EntitySlime['Slime'/51, l='MpServer', x=1946.12, y=4.00, z=1241.39], EntitySlime['Slime'/53, l='MpServer', x=1951.55, y=4.00, z=1267.16], EntitySlime['Slime'/54, l='MpServer', x=1959.71, y=4.00, z=1279.04], EntitySlime['Slime'/56, l='MpServer', x=1961.88, y=4.28, z=1203.91], EntitySlime['Slime'/57, l='MpServer', x=1955.53, y=4.00, z=1213.90], EntityPig['Pig'/58, l='MpServer', x=1966.21, y=4.00, z=1214.67], EntitySheep['Sheep'/59, l='MpServer', x=1958.36, y=4.00, z=1225.19], EntitySlime['Slime'/60, l='MpServer', x=1957.15, y=5.04, z=1224.21], EntitySlime['Slime'/61, l='MpServer', x=1963.73, y=5.04, z=1211.60], EntitySlime['Slime'/62, l='MpServer', x=1962.09, y=4.11, z=1229.70], EntitySlime['Slime'/63, l='MpServer', x=1952.97, y=4.00, z=1235.64], EntitySlime['Slime'/64, l='MpServer', x=1960.68, y=4.14, z=1239.06], EntitySlime['Slime'/69, l='MpServer', x=1968.83, y=4.34, z=1154.73], EntitySheep['Sheep'/70, l='MpServer', x=1980.82, y=4.00, z=1168.44], EntitySlime['Slime'/71, l='MpServer', x=1988.63, y=4.34, z=1202.20], EntitySlime['Slime'/72, l='MpServer', x=1985.39, y=4.48, z=1204.31], EntitySlime['Slime'/73, l='MpServer', x=1980.55, y=4.00, z=1198.62], EntitySlime['Slime'/74, l='MpServer', x=1973.44, y=4.00, z=1224.57], EntitySlime['Slime'/75, l='MpServer', x=1983.09, y=4.00, z=1221.68], EntitySlime['Slime'/76, l='MpServer', x=1984.92, y=5.00, z=1240.47], EntitySlime['Slime'/77, l='MpServer', x=1980.69, y=4.03, z=1232.13], EntitySlime['Slime'/78, l='MpServer', x=1983.00, y=4.14, z=1239.41], EntitySlime['Slime'/79, l='MpServer', x=1973.35, y=4.00, z=1240.43], EntitySlime['Slime'/80, l='MpServer', x=1985.13, y=4.00, z=1246.03], EntitySlime['Slime'/81, l='MpServer', x=1970.89, y=5.00, z=1262.21], EntitySlime['Slime'/82, l='MpServer', x=1975.30, y=4.77, z=1257.05], EntitySlime['Slime'/84, l='MpServer', x=1977.84, y=4.00, z=1277.74], EntitySlime['Slime'/86, l='MpServer', x=1974.92, y=5.00, z=1280.19], EntitySlime['Slime'/91, l='MpServer', x=1996.85, y=4.77, z=1137.84], EntitySlime['Slime'/92, l='MpServer', x=1997.24, y=4.14, z=1142.90], EntitySlime['Slime'/93, l='MpServer', x=1986.24, y=4.00, z=1203.97], EntitySlime['Slime'/94, l='MpServer', x=2002.33, y=4.63, z=1199.57], EntitySlime['Slime'/95, l='MpServer', x=1986.77, y=4.78, z=1222.70], EntitySlime['Slime'/96, l='MpServer', x=1983.13, y=4.14, z=1254.33], EntitySlime['Slime'/97, l='MpServer', x=1988.22, y=4.00, z=1272.83], EntitySlime['Slime'/98, l='MpServer', x=1983.19, y=4.77, z=1289.70], EntitySlime['Slime'/99, l='MpServer', x=2010.67, y=4.18, z=1143.98], EntitySlime['Slime'/100, l='MpServer', x=2016.56, y=4.63, z=1225.59], EntitySlime['Slime'/101, l='MpServer', x=2007.20, y=4.00, z=1217.88], EntitySlime['Slime'/102, l='MpServer', x=2016.44, y=5.06, z=1239.04], EntityHorse['Horse'/103, l='MpServer', x=2013.70, y=4.00, z=1257.58], EntityCow['Cow'/104, l='MpServer', x=1998.74, y=4.00, z=1276.43], EntitySheep['Sheep'/105, l='MpServer', x=2019.45, y=4.00, z=1133.78], EntitySheep['Sheep'/106, l='MpServer', x=2029.23, y=4.00, z=1185.67], EntitySlime['Slime'/107, l='MpServer', x=2019.56, y=4.00, z=1215.09], EntitySlime['Slime'/108, l='MpServer', x=2023.58, y=4.03, z=1214.03], EntitySlime['Slime'/109, l='MpServer', x=2027.03, y=4.34, z=1235.00], EntitySlime['Slime'/110, l='MpServer', x=2014.67, y=4.00, z=1241.15], EntitySlime['Slime'/111, l='MpServer', x=2036.40, y=5.04, z=1259.85], EntityHorse['Horse'/112, l='MpServer', x=2022.44, y=4.00, z=1255.49], EntityHorse['Horse'/113, l='MpServer', x=2021.36, y=4.00, z=1255.50], EntitySlime['Slime'/114, l='MpServer', x=2028.02, y=4.78, z=1259.45], EntityPig['Pig'/115, l='MpServer', x=2037.19, y=4.00, z=1187.33], EntitySlime['Slime'/116, l='MpServer', x=2036.34, y=5.00, z=1219.13], EntityChicken['Chicken'/117, l='MpServer', x=2035.82, y=4.00, z=1231.89], EntityZombie['Zombie'/118, l='MpServer', x=2046.29, y=4.00, z=1219.43], EntityItem['item.item.egg'/119, l='MpServer', x=2043.57, y=4.00, z=1247.18], EntityCow['Cow'/120, l='MpServer', x=2058.47, y=4.00, z=1182.38], EntityPig['Pig'/121, l='MpServer', x=2061.77, y=4.00, z=1188.39], EntitySlime['Slime'/122, l='MpServer', x=2059.71, y=4.28, z=1195.77], EntitySlime['Slime'/123, l='MpServer', x=2061.93, y=4.78, z=1218.27], EntityChicken['Chicken'/124, l='MpServer', x=2048.45, y=4.00, z=1238.32], EntityChicken['Chicken'/125, l='MpServer', x=2061.10, y=4.00, z=1254.83], EntityItem['item.item.egg'/126, l='MpServer', x=2059.97, y=4.00, z=1261.94], EntitySlime['Slime'/127, l='MpServer', x=2048.50, y=4.03, z=1286.58]]
    	Retry entities: 0 total; []
    	Server brand: fml,forge
    	Server type: Integrated singleplayer server
    Stacktrace:
    	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
    	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2896)
    	at net.minecraft.client.Minecraft.run(Minecraft.java:462)
    	at net.minecraft.client.main.Main.main(Main.java:118)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    	at GradleStart.main(GradleStart.java:26)
    
    -- System Details --
    Details:
    	Minecraft Version: 1.12.2
    	Operating System: Windows 8.1 (amd64) version 6.3
    	Java Version: 1.8.0_131, Oracle Corporation
    	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    	Memory: 131987664 bytes (125 MB) / 844103680 bytes (805 MB) up to 1884815360 bytes (1797 MB)
    	JVM Flags: 0 total; 
    	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    	FML: MCP 9.42 Powered by Forge 14.23.2.2624 5 mods loaded, 5 mods active
    	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    
    	| State     | ID        | Version      | Source                           | Signature |
    	|:--------- |:--------- |:------------ |:-------------------------------- |:--------- |
    	| UCHIJAAAA | minecraft | 1.12.2       | minecraft.jar                    | None      |
    	| UCHIJAAAA | mcp       | 9.42         | minecraft.jar                    | None      |
    	| UCHIJAAAA | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.2.2624.jar | None      |
    	| UCHIJAAAA | forge     | 14.23.2.2624 | forgeSrc-1.12.2-14.23.2.2624.jar | None      |
    	| UCHIJAAAA | um        | 1.0          | bin                              | None      |
    
    	Loaded coremods (and transformers): 
    	GL info: ' Vendor: 'Intel' Version: '4.2.0 - Build 10.18.10.3910' Renderer: 'Intel(R) HD Graphics 4400'
    	Launched Version: 1.12.2
    	LWJGL: 2.9.4
    	OpenGL: Intel(R) HD Graphics 4400 GL version 4.2.0 - Build 10.18.10.3910, Intel
    	GL Caps: Using GL 1.3 multitexturing.
    Using GL 1.3 texture combiners.
    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    Shaders are available because OpenGL 2.1 is supported.
    VBOs are available because OpenGL 1.5 is supported.
    
    	Using VBOs: Yes
    	Is Modded: Definitely; Client brand changed to 'fml,forge'
    	Type: Client (map_client.txt)
    	Resource Packs: 
    	Current Language: English (US)
    	Profiler Position: N/A (disabled)
    	CPU: 4x Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz

     

     

  12. I created a simple gui, based on the sign gui:

    package com.mta.utzonmod.client.gui;
    
    import java.io.IOException;
    
    import org.lwjgl.input.Keyboard;
    
    import net.minecraft.client.gui.GuiButton;
    import net.minecraft.client.gui.GuiScreen;
    import net.minecraft.client.renderer.GlStateManager;
    import net.minecraft.client.resources.I18n;
    import net.minecraft.util.ChatAllowedCharacters;
    import net.minecraft.util.text.ITextComponent;
    import net.minecraft.util.text.TextComponentString;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;
    
    @SideOnly(Side.CLIENT)
    public class signInputGui extends GuiScreen {
    	
    	private GuiButton doneBtn;
    	
    	private int updateCounter;
    	
    	private int editLine;
    	
    	public String playerInput;
    	
    	public void initGui() {
    		this.buttonList.clear();
    		Keyboard.enableRepeatEvents(true);
    		this.doneBtn = this.addButton(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, I18n.format("gui.done")));	
    	}
    	
    	public void onGuiClosed() {
    		Keyboard.enableRepeatEvents(false);
    	}
    	
    	public void updateScreen() {
    		++this.updateCounter;
    	}
    	
    	protected void actionPerformed(GuiButton button) throws IOException {
    		if(button.enabled) {
    			if(button.id == 0) {
    				this.mc.displayGuiScreen((GuiScreen)null);
    			}
    		}
    	}
    	
    	public final ITextComponent[] signText = new ITextComponent[] {new TextComponentString(""), new TextComponentString(""), new TextComponentString(""), new TextComponentString("")};
    	
    //	protected void keyTyped(char typedChar, int keyCode) throws IOException {
    //		if(keyCode == 200) {
    //			this.editLine = this.editLine - 1 & 3;
    //		}
    //		
    //		if (keyCode == 208 || keyCode == 28 || keyCode == 156) {
    //			this.editLine = this.editLine + 1 & 3;
    //		}
    //		
    //		for (int i = 0; i < 4; ++i)
    //        {
    //            playerInput = ITextComponent.Serializer.componentToJson(this.signText[i]);
    //        }
    //		
    //		if (keyCode == 14 && !playerInput.isEmpty()) {
    //			playerInput = playerInput.substring(0, playerInput.length() - 1);
    //		}
    //		
    //		if (ChatAllowedCharacters.isAllowedCharacter(typedChar) && this.fontRenderer.getStringWidth(playerInput + typedChar) <= 90) {
    //			playerInput = playerInput + typedChar;
    //		}
    //		
    //		if (keyCode == 1) {
    //			this.actionPerformed(this.doneBtn);
    //		}	
    //	}
    	
    	public void drawScreen(int mouseX, int mouseY, float partialTicks) {
    		this.drawDefaultBackground();
    		this.drawCenteredString(this.fontRenderer, I18n.format("sign.edit"),this.width / 2, 40, 16777215);
    		GlStateManager.color(1.0F,  1.0F,  1.0F, 1.0F);
    		GlStateManager.pushMatrix();
    		GlStateManager.translate((float)(this.width / 2), 0.0F, 50.0F);
    		
            GlStateManager.scale(-93.75F, -93.75F, -93.75F);
            GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
    		
    		GlStateManager.popMatrix();
    		super.drawScreen(mouseX, mouseY, partialTicks);
    	}
    }
    

     

    But for some reason when I open the GUI, my cursor disappears completely. Am I missing a function, or where am I going wrong?

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.