Stenbergcsgo
-
Posts
62 -
Joined
-
Last visited
Posts posted by Stenbergcsgo
-
-
1 minute ago, diesieben07 said:
No, you can't add new items using bukkit as far as I know.
You need to install your Forge mod on the server.
Would this require me to modify code, or simple set up something like sponge and add the mod?
-
4 minutes ago, diesieben07 said:
Yes, adding new items requires a server-side component.
So what would make sense in this situation? I'm using a Spigot server, so would the preferable way to go make a bukkit plugin?
-
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?
-
8 minutes ago, diesieben07 said:
- This is pointless.
Feel the same, but in a unique situation where this is required. Out of curiosity, if I'm required to make a new workspace(and a new jar file) for my mod to work on this outdated version, how come forges 1.12.2 version (single jar) runs on both 1.12.2 and 1.11.2?
-
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?
-
18 hours ago, diesieben07 said:
To obtain the server instance you can use ICommandSender::getServer (every entity is a command sender).
On the client you can use EntityPlayerSP::sendChatMessage to send a command to the server.
Worked like a charm, thank you very much =)
-
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?
-
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?
-
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?
-
-
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)
-
It has removed a lot of my classes, but the referenced libraries are working now. Guess I got some re-coding to do. Thanks for the help though! =)
-
17 minutes ago, JulianClark2114 said:
try having a backup for your progress (the src folder)
put the back up files in desktopthen re run
gradlew setupDecompworkspaceand 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.
-
-
3 minutes ago, JulianClark2114 said:
Please Note that this will be a long Process
is it ok with you?Yes =)
-
1 minute ago, JulianClark2114 said:
Before I tell you
Check First if you have " .gradle " folder in yourC:\Users\ (YourPCName)
Yea that's there
-
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.
-
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
-
4 minutes ago, Reflxction said:
Try Mouse#setCatched(), it could work but I am not sure
Can you give an example on where I should use it and how?
-
-
3 minutes ago, Lenardjee said:
Have you tried initialising the texfield inside the init method? I've had quite some issues with initialization of variables myself too...
Yea tried both same result
-
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
-
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?
-
8 minutes ago, diesieben07 said:
Do you even understand how @SidedProxy works? You now made a method in your proxy, but you don't call it from anywhere. What do you think this does? Exactly: nothing.
Yea my bad guess I'm starting to oversee some stuff after messing around with it for so long. Called the init from my item, and it works now. Thanks =)
Client side mod not working on server
in Modder Support
Posted · Edited by Stenbergcsgo
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.