-
Posts
5160 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
[1.9] Executing a Client command when client joins a server
Choonster replied to TommyHoogstra's topic in Modder Support
The FML bus has been merged with the Forge bus now, so FMLCommonHandler#bus is deprecated; though it will still work since it returns a reference to the Forge bus. If the command doesn't exist, ClientCommandHandler#executeCommand will return 0; it won't throw an exception or send a chat message. Is this command supposed to be handled on the client or the server? If it's a server command, you need to send a chat message packet to the server with the command in it. -
[1.9] Executing a Client command when client joins a server
Choonster replied to TommyHoogstra's topic in Modder Support
Yes, that should work. -
[1.9] Executing a Client command when client joins a server
Choonster replied to TommyHoogstra's topic in Modder Support
FMLNetworkEvent.ClientConnectedToServerEvent or EntityJoinWorldEvent should work, though there's something to note about each event: All sub-events of FMLNetworkEvent are fired on the Netty thread, so you need to schedule a task on the main thread using IThreadListener before you can safely interact with normal Minecraft classes. This is explained in slightly more detail here. EntityJoinWorldEvent will be fired for every entity that joins the world and will also be fired when the player respawns or changes dimension. PlayerLoggedInEvent is only fired server-side, so it can't be used by a client-only mod in multiplayer (it will work in single player because the integrated server is running in the same JVM process as the client). Use ICommandManager#executeCommand to execute a command. The ICommandManager for client commands is stored in the ClientCommandHandler.instance field. -
If you look at ItemBow and the assets/minecraft/models/item/bow.json model, you'll see that they use the new property override system to switch the model when the bow is pulled.
-
Make Button URL go streight to URL without Confirmation GUI
Choonster replied to ScottehBoeh's topic in Modder Support
Look at how GuiScreen#openWebLink opens the URI it's given. -
[SOLVED][1.8.9] Where do I place my assets
Choonster replied to fatguylaughing's topic in Modder Support
Assets go in src/main/resources/assets/<modid>/.... -
IBakedModel now has the functionality of ISmartBlockModel / ISmartItemModel built in, so Forge's interfaces were removed. See this thread for more details.
-
FMLNetworkEvent.ClientConnectedToServerEvent is fired (on the Netty thread) when the client connects to a server. The FMLNetworkEvent.ClientConnectedToServerEvent#isLocal field will be true when the connection is local, i.e. the server is an integrated server and this client is the host. Minecraft#getCurrentServerData will return the current ServerData . ServerData#func_181041_d ( isOnLAN in recent mappings) will return true when the connection is to a LAN server (i.e. an integrated server hosted by a different client).
-
It looks like you're never calling the ClientProxy#preInit method. Add a method with the same signature (name + arguments) to CommonProxy , add the @Override annotation to the ClientProxy method and then call this method from DaemonologyMod#preInit . The overload of RenderingRegistry.registerEntityRenderingHandler you're using is deprecated and will be removed at some point in the future. Use the overload with an IRenderFactory argument instead. To implement IRenderFactory , either use an anonymous class (if you're targeting Java 6/7) or a constructor method reference (if you're targeting Java . As the documentation of this method says, it should be called in the preInit phase. Edit: The smiley is really annoying when talking about Java 8 or Minecraft 1.8.
-
You're passing the Integer 1 as the mod argument of EntityRegistry.registerModEntity . This compiles because every reference type extends Object and every primitive type can be boxed to a reference type. This fails at runtime because 1 isn't a String mod ID or an instance of a mod class, it's just an integer. When asking for help with a crash, always post the FML log or crash report. In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page. It's much easier to read code with proper formatting and syntax highlighting.
-
The sources JAR is exactly what the name suggests: the source code of the mod; though it's actually the reobfuscated source (SRG names) rather than the original deobfuscated source (MCP names). Source JARs are there to allow other projects that depend on yours to see your project's source code in the IDE. ForgeGradle allows you to add deobfCompile / deobfProvided dependencies (source code or compiled bytecode), these will be deobfuscated on disk from SRG names to the current project's MCP names. Source JARs definitely shouldn't be required outside of the development environment. Any mod that asks you to install a source JAR is doing something wrong.
-
Chunk#getChunkCoordIntPair returns the chunk's coordinates as a ChunkCoordIntPair . This class implements Object#hashCode to return a hash based on the coordinates. You can also use the ChunkCoordIntPair#chunkXZ2Int method to combine the x and z coordinates of a chunk into a long suitable for hashing.
-
The only unique identifier of a chunk is its x and z coordinates.
-
You have a _JAVA_OPTIONS environment variable limiting the maximum memory to 512 MB. Delete this and give Gradle at least 2 GB of memory in gradle.properties. I'd recommend following the official documentation's Getting Started tutorial to set up your ForgeGradle workspace and IDE project.
-
EntityPlayer#isUsingItem has been replaced by EntityLivingBase#isHandActive , yes. EntityPlayer#getItemInUse has been replaced by EntityLivingBase#getActiveItemStack . EntityLivingBase#getHeldItemMainhand only returns the item in the entity's main hand, regardless of which hand they're using (if any).
-
When the if statement's conditional is true , you know that the entity argument (the entity updating the item) is an instance of EntityPlayer . This means that you can safely cast entity to EntityPlayer . As Draco said, never use the Minecraft class in common code. It's client-only and will crash the dedicated server (as you've seen). Always add the @Override annotation to override methods so you get a compilation error if the method doesn't actually override a super method. Your IDE can also auto-generate override methods with the correct signature and the annotation.
-
Ah, I missed that. It looks like line 140 is where you instantiate EPick . Post this class. In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page. It's much easier to read code with proper formatting and syntax highlighting.
-
Did you read the big red text at the top of the main page of the forums or the EAQ? Always post your FML log, preferably using Gist.
-
[1.8.9] Add procedurally generated names to the language registry
Choonster replied to Roboguy99's topic in Modder Support
Create an array of Element s indexed by their atomic number and populate it when you register each Element . -
[1.8.9] Add procedurally generated names to the language registry
Choonster replied to Roboguy99's topic in Modder Support
To save a class to NBT, you need to convert runtime types to collection (byte array, int array, list, compound) and primitive (byte, short, int, long, float, double, string) tags. The only part of a Compound you need to store is its structure. The LinkedHashMap can become a list tag, with a compound tag for each entry containing an int each for the Element (the atomic number) and the amount. To use capabilities for this, you'd need to create an ICompound interface with the required Compound methods and register it as a capability. Upon further consideration, I don't think capabilities will work for you here. Combining stacks in inventories ignores capabilities, so you could combine a stack of water and a stack of glucose together as if they were the same item. You'll have to stick to NBT in this case. -
Assuming that's in a JSON file, you need to escape the quotation marks for the --mods argument by placing a backslash in front of them: "minecraftArguments": "--username ${auth_player_name} --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid ${auth_uuid} --accessToken ${auth_access_token} --userProperties ${user_properties} --userType ${user_type} --tweakClass net.minecraftforge.fml.common.launcher.FMLTweaker --mods \"modsDir1/mod1.jar,modsDir1/mod2.jar,modsDir2/mod3.jar\"" Does the Mojang launcher actually support passing arguments to Minecraft like this?
-
[1.7.10] Crash on Startup of Modpack (Custom)
Choonster replied to trevorb221's topic in Support & Bug Reports
Make sure you're using the latest version of Galacticraft and MicdoodleCore. In future, please post logs using Gist. -
[1.7.10] Crash on Startup of Modpack (Custom)
Choonster replied to trevorb221's topic in Support & Bug Reports
The versions of Extra Cells 2 and Applied Energistics 2 you have installed are incompatible. Update AE2.