Everything posted by Choonster
-
[SOLVED] Rendering custom projectile
If you want something to behave similar to vanilla, look at the vanilla implementation and either re-use or extend it as appropriate. In this case, use or extend RenderSnowball to render an entity as an item model.
-
forge crashing 1.7.10
1.7.10 is no longer supported on this forum, you won't get any help with it.
-
Problem running mod in normal minecraft
That shouldn't be possible. Are you definitely running the build task? Are you looking in the correct output directory (build/libs)? Run the build task again and post the output, there may be some information as to why it's failing to reobfuscate the JAR.
-
Prefixes
EntityPlayer#addPrefix is the preferred way to add prefixes to a player's name. If you can't do that, use ServerChatEvent#setComponent to replace the chat message instead of cancelling the event and re-sending the message yourself. I suspected that may have been the case. As Ugdhar said, 1.7.10 is no longer supported here.
-
[1.11.2] [Unsolved] Accessing an entity's gui container
Data parameter IDs are automatically assigned per class hierarchy. You're passing EntityTameable.class as the first argument of EntityDataManager.createKey, so the DataParameter is being assigned the next ID for the EntityTameable class instead of the next ID for the IvVillager class. When you try to register it for the IvVillager instance, there's already a DataParamter registered for that ID so the game crashes with an IllegalArgumentException. In future, please select the appropriate syntax highlighting when posting code on a site like Gist or Pastebin. 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. The Adult_Age data parameter is Stringly Typed. I suggest replacing the strings with an enum. I can't see any obvious reason for this. If you haven't already, please create a Git repository for your mod, push it to a site like GitHub and link it here so I can debug it locally. See my mod and its .gitignore file for an example of the repository structure to use and the files to include. You can still create a BlockPos from the individual coordinates.
-
[1.7.10] Setting fire
1.7.10 is no longer supported on this forum, you won't get any help with it.
-
Prefixes
"It crashes" doesn't really tell us anything. Post the latest code and the crash report. Is there a reason you're intercepting and manually re-sending the chat messages? Why not use EntityPlayer#addPrefix or at least ServerChatEvent#setComponent? What version of Minecraft are you using?
-
Install Forge with Mod Coder Pack
Forge can't be installed in an MCP workspace. Forge's documentation explains how to set up a ForgeGradle workspace here. If you set up the workspace correctly, you'll have read-only access to the vanilla code (with Forge's patches).
-
Prefixes
You should read Forge's documentation page on events, it explains that event handler methods must be annotated with @SubscribeEvent and when to use static or non-static event handler methods. The FML event bus has been merged with the Forge event bus, so FMLCommonHandler#bus returns the same EventBus that's stored in the MinecraftForge.EVENT_BUS field. It's also deprecated, with a comment containing this information.
-
Prefixes
EntityPlayer#addPrefix takes an ITextComponent, which will be added to the player's display name as a prefix. There are multiple implementations of ITextComponent, but the most commonly used ones are TextComponentTranslation (translates its first argument and then formats it by calling String.format with its other arguments) and TextComponentString (a single string). ITextComponent#getStyle returns the ITextComponent's Style, which can be used to modify the style of the text.
-
Prefixes
You can use EntityPlayer#addPrefix to add a prefix to a player's display name. You'll probably want to do this when EntityJoinWorldEvent is fired for an EntityPlayer.
-
Minecolonies and other crashing my MC
Minecolonies is broken. Update to the latest version, this crash has been fixed.
-
Server closes after a few seconds.
The installer is just for creating the server, you don't need to keep it once you've run it. You need to run forge-1.11.2-13.20.0.2309-universal.jar to run the server. If it just closes after a few seconds, run it from the command line instead of double-clicking and look for any errors in the output. If you still don't know what the error is, post the FML log (logs/fml-server-latest.log) using Gist or Pastebin.
-
Problem running mod in normal minecraft
You need to build your mod with the build Gradle task, this reobfuscates it from MCP names like getMinecraft to SRG names like func_0220_b. SRG names are the names used by Minecraft outside of the development environment.
-
[1.11.2] [Unsolved] Accessing an entity's gui container
You're creating an AABB with the x and z coordinates of the BlockPos as both the minimum and maximum coordinates, so the entity will only be found if its bounding box overlaps the northwest corner of the block it's standing on (the area represented by the AABB). You should instead create the AABB with the x and z coordinates of the BlockPos as the minimum coordinates and the x and z coordinates plus 1 as the maximum coordinates. This way the AABB will cover the entire block instead of just the northwest corner. The AxisAlignedBB(BlockPos) constructor does this for you, you can then use AxisAlignedBB#expand to expand it by 1 in each direction of the y axis (i.e. up and down). I created this item to experiment with corner- and edge-based AABBs passed to World#getEntitiesWithinAABB. Side note: You don't need to cast the result of the List#get call to IvVillager; the result of World#getEntitiesWithinAABB is a List<IvVillager> (because of the first argument), so the List#get call returns an IvVillager. Are you registering the data parameter more than once? Post the IvVillager class using Gist or Pastebin.
-
Minecraft is closing???
Minecraft ran out of memory. You can find instructions on how to give it more using your search engine of choice. In future, please post the entire FML log using Gist or Pastebin (like you were told to in your previous thread).
-
Using "config" button in Mods menu
If you're using the new @Config annotation-based system, a config GUI will automatically be created for you. If you're using the Configuration class and specifying the properties yourself, you need to create a class that implements IModGuiFactory and specify it in the guiFactory property of your @Mod annotation. In the IModGuiFactory#createConfigGui implementation, you need to create and return an instance of GuiConfig with the top-level IConfigElements. You can see an example of the new system here.
-
When I try To install forge 1.8.9 It doesnt go into the launcher
You should be able to edit or create a profile in the launcher and select Forge 1.8.9-11.15.1.1902-1.8.9 as the version.
-
[1.11.2] [Unsolved] Accessing an entity's gui container
World#getEntitiesWithinAABB returns a List<T>, where T is the class you pass as the first argument or any super class up to Entity. You can't cast a List<T> to T, you need to get an individual element from the list. This is basic Java knowledge.
-
[1.8.9] Custom Door issues
The issue is that you're still registering an ItemBlock for the door and then registering a model for this instead of the ItemDiamondDoor instance. I explained this in my first reply: I've fixed these issues and slightly cleaned up the door registration code, you can view and/or merge the changes here.
-
[1.8.9] Custom Door issues
The page I linked lets you create a Pull Request, which you can then merge.
-
[1.8.9] Custom Door issues
I've identified and fixed the problems: BlockDiamondDoor overrides Block#getRenderType to return 7, which isn't a valid return value in 1.8+. The default return value of 3 tells Minecraft to use the baked model system to render the block, which is usually what you want; there's generally no need to override this. This numeric return value was replaced with an enum in 1.9. The diamondDoor.json blockstates file doesn't include the powered property and you haven't told Minecraft to ignore it. You can create an IStateMappper to do this by creating a StateMap.Builder, calling StateMap.Builder#ignore with the properties to ignore and then calling StateMap.Builder#build. Register the IStateMapper by calling ModelLoader.setCustomStateMapper in preInit. You can view and/or merge the changes here. It wasn't immediately obvious what the issue with the model was, since you have 101 model errors and Forge only logs the first five. This was made configurable via the forge.verboseMissingModelLoggingCount system property in 1.9.
-
[1.10.2] Issues with Custom Fluids
I'm glad you figured that out. I haven't done this myself, but it may be possible to implement it yourself with Block#onEntityCollidedWithBlock. I can't really help you any further with this, though there may be existing mods that have done this.
-
[1.10.2] Issues with Custom Fluids
Minecraft will always use assets/<modid>/blockstates/<registry_name>.json for the Block's models (unless you register a custom IStateMapper), but the blockstates file used for the Item models depends on the ModelResourceLocation you pass to ModelLoader.setCustomModelResourceLocation or return from the ItemMeshDefinition you pass to ModelLoader#setCustomMeshDefinition. To use the inventory variant of the assets/<modid>/blockstates/<path>.json blockstates file for an Item model, use a ModelResourceLocation with <modid> as the domain, <path> as the path and inventory as the variant. If a MissingVariantException is logged for the inventory variant of this blockstates file, you may be running into this issue where Forge is treating your inventory variant as partially-defined instead of fully-defined. If you still need help, post the code where you register the Item model, the latest blockstates file (including its path) and the full FML log.
-
[1.11.2] [Unsolved] Accessing an entity's gui container
Java doesn't allow operator overloading, so you can't use relational operators like >= to compare non-numeric values. Use the static equality methods in the ItemStack class to check if two ItemStacks are equal or use the getter methods to get each part of the ItemStack (e.g. ItemStack#getItem to get the Item, ItemStack#getCount to get the count/stack size).
IPS spam blocked by CleanTalk.