Everything posted by Choonster
-
[SOLVED]Modify Vanilla Items?
The shine effect is controlled by the return value of Item#hasEffect . The default implementation only returns true when the ItemStack is enchanted (i.e. it has a compound tag with the "ench" key). This means there's no easy way to force an existing item to always display the effect without replacing it your own or resorting to ASM (neither of which is desirable). Changing the display name is much easier, just add a translation with the same key as the vanilla one ( item.monsterPlacer.name ) in your own lang files.
-
FMLTweaker not found
I had to manually synchronise the project (rather than refresh it from the Gradle window) to get the reload popup to appear. Thanks for the tip.
-
FMLTweaker not found
You don't need to close it Really? I haven't been able to generate runs from IDEA's Gradle window with the project open (even after refreshing the project), but generating them from the command line without the project open seems to work for me.
-
[1.7.10] player.addExperienceLevel(int);
That registration code looks correct, but I can't understand what you're asking.
-
[1.7.10] player.addExperienceLevel(int);
Use the Simple Network Wrapper to send packets between the client and server. Look at the tutorial I linked in my first post for an explanation of how to use the system.
-
[1.7.10] player.addExperienceLevel(int);
What do you mean? If your mod isn't on the server, you can't modify server-controlled values like experience unless you can use a vanilla packet to do it for you. There's no packet that modifies experience. You could send a chat packet to execute the /xp command, but that would only work if the player has permission to use it.
-
[SOLVED] Minecraft not launching using runServer in Eclipse
You can't join a server from the development client unless you specify a valid username (email address) and password using the --username and --password command line arguments in your run configuration.
-
FMLTweaker not found
You've used the pre-1.8 FML namespace ( cpw.mods.fml ) instead of the 1.8+ namespace ( net.minecraftforge.fml ). Why are you running the Launch class instead of the GradleStart class? Using the latter should automatically provide the necessary command line arguments for you, so you don't need to manually specify the version, tweaker or access token. If you run the genIntelliJRuns Gradle task with IDEA closed, it should generate the run configurations for you.
-
[1.7.10] player.addExperienceLevel(int);
GUIs are client-only, but the server is in control of the game. If you make changes on the client, they'll just be overwritten by the server's values. You need to send a packet to the server telling it that the player pressed the button so it can take the appropriate action. diesieben07 has a tutorial on the Simple Network Wrapper here.
-
[1.8] Frustrating Missing Textures
ModelLoader.setCustomModelResourceLocation and ModelLoader.setCustomMeshDefinition can be called during preInit to do the same thing as calling ItemModelMesher#register in init. The Minecraft instance is created and stored before mod loading starts, though the ItemModelMesher instance is only created between preInit and init. 1Poseidon3: You're free to use my code within the terms of the MIT License (basically you can do what you want with it as long as you credit me). I don't really mind if you include the credit in every file or just include a line in your license/readme.
-
event.state for 1.8
You don't pass those values to HarvestDropsEvent , Forge does that. You just need to subscribe to the event and read the values from it. coolAlias has a tutorial on event handlers here.
-
why can't use LivingDeathEvent on server?
That should work on both sides. How are you registering the event handler?
-
MeshDefinitionFix error on build
This is what I was referring to.
-
MeshDefinitionFix error on build
http://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html I use anonymous classes that extend StateMapperBase in my ModModelManager class.
-
MeshDefinitionFix error on build
ForgeGradle compiles your code with Java 6 compatibility by default (the same as Minecraft). If you want to use Java 8 features like lambdas, you need to tell Gradle to compile your code with Java 8 compatibility instead. You can see an example of this here. Keep in mind that users will need to be running Java 8 to use your mod if you do this, Minecraft itself only requires Java 6. If you don't want to compile with Java 8 compatibility, use an anonymous class instead of a lambda.
-
Fluid Rendering not Working
I explained a lot of the new fluid model system (including example code) in this thread recently. Post #5 explains the fluid initialisation and registration, post #19 explains the model registration.
-
[1.8] How to Create a Custom Liquid?
That constructor was added with the fluid model in Forge 1.8-11.14.3.1464. Make sure you're using that version or a newer one.
-
[1.8] No Furnace Events ?
Interestingly, the furnace uses TileEntityFurnace#func_174904_a to determine the cook time of the item being smelted, but this always returns 200. It doesn't look like Forge provides any hooks for changing this value, but you may be able to file a suggestion in the Suggestions forum or a pull request on GitHub to implement a hook for it. Forge does provide the IFuelHandler interface for determining fuel values (burn times), but this isn't used for vanilla fuels and the highest value returned by any fuel handler is always used.
-
[1.8] Use Item or ItemGlassBottle/ItemBucket?
You can subscribe to FillBucketEvent to allow the vanilla bucket to pick up your fluids. You may want to make sure the Fluid being drained is one you've actually specified a bucket model for, otherwise you'll end up giving the player an item with no model. There's no equivalent of this event for the glass bottle; but you could subscribe to PlayerInteractEvent (with the RIGHT_CLICK_AIR action), check that the player is holding a glass bottle and looking at one of your fluids, give them the appropriate filled bottle and then set useItem to Result.DENY . How you implement the bucket item itself is up to you, you can either use metadata or NBT to store the contained Fluid . If you're using metadata, you can register it with FluidContainerRegistry . If you're using NBT, you can implement IFluidContainerItem (or extend ItemFluidContainer , the default implementation); FluidContainerRegistry doesn't support NBT-based containers. You can see my FillBucketEvent handler here and my bucket item here. A lot of this logic is adapted from the vanilla bucket.
-
[1.7.10] Need help with disappearing XP-levels and Durability.
Keybindings are client-only, but the server is in control of the game. Changing things on the client will just get them overwritten by the server's values. You need to handle your keybindings client-side and then send a packet to the server telling it that the key was pressed so it can take the appropriate action. diesieben07 has a tutorial on the Simple Network Wrapper here, there are probably several keybinding tutorials out there.
-
[1.8] Use Item or ItemGlassBottle/ItemBucket?
Are you talking about the type of the field that holds the instance or the type of the instance itself? The type of the field doesn't matter (as long as it's compatible with the instance's type), the type of the instance determines the behaviour of the block/item. ItemGlassBottle overrides Item#onItemRightClick to decrement the stack size and add a water bottle to the player's inventory when they right click while looking at water. This is hardcoded to detect water and add a water bottle, so if you wanted to do the same thing for your own liquid you'd need to override the method yourself. Since ItemGlassBottle doesn't add any other behaviour, there's not much difference between extending Item and ItemGlassBottle . BlockAir overrides several methods to make it completely invisible and untouchable, so it's probably easier to extend it or instantiate it directly when making a similar block than extending Block and overriding the same methods to do the same thing.
-
Forge not Installing libraries
There's a space between java and -Djava.net... .
-
Access transformer help
You tried to access a GuiScreen field on TConstruct's TabRegistry class, which doesn't extend GuiScreen . Edit: Disregard this post, I misinterpreted the error.
-
Minecraft custom modpack crash
Only ever download mods from their official site or a trusted modpack launcher like FTB, Curse, ATLauncher, etc. Don't use sites like Skydaz.
-
Minecraft custom modpack crash
It looks like it was still loading when the log stopped. The only real errors I can see are related to Reika's mods (DragonAPI, RotaryCraft, ElectriCraft) missing signatures and DragonAPI having a blank access transformer class specified, but these happen quite early on and don't seem to have stopped the game. Try re-downloading the latest versions of these mods.
IPS spam blocked by CleanTalk.