Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. Stick to one question per topic, don't replace the OP with a new question once you have the solution. This makes it harder for other people having the same problem to find the solution. To generate ore in non-stone blocks, use the WorldGenMinable(IBlockState, int, Predicate<IBlockState>) constructor. The Predicate determines whether the ore can replace a given IBlockState . Use BlockHelper.forBlock to create a Predicate that matches any state of the specified Block . The armour item models are in assets/minecraft/models/item with the other item models. Rendering armour on entity models is handled by LayerArmorBase and its subclasses, JSON models aren't used.
  2. 1 damage takes away 1 health. Each heart is 2 health. Like I said in my previous post, the arrow's base damage is multiplied by the magnitude of its motion vector to determine the actual damage. A decently charged arrow can easily have a velocity of 1.0, which results in a motion of roughly 2.97 when hitting a fairly close target. This is also a critical, which applies bonus damage. I said in my previous post that the base damage of the arrow is 20, it's actually 2.0 (I wasn't paying enough attention). The damage is actually rounded up after being multiplied with the motion, so 2.97 * 2.0 becomes 6 damage (before the critical bonus).
  3. To do something every tick from an Item , override Item#onUpdate . To store data for an Item , either use the NBT or the new Capability system.
  4. 1 damage is half a heart.
  5. A TileEntity is needed for two basic reasons: To store data beyond a 4-bit integer (metadata), e.g an inventory To run code every tick or every X ticks (by implementing ITickable ). This can also be done via World#scheduleUpdate / Block#updateTick , but this may not be as reliable since Minecraft will only run up to 1000 scheduled updates per tick. If you don't need either of these, you probably don't need a TileEntity .
  6. Arrows deal damage to the entity they hit in EntityArrow#onUpdate (lines 292 to 316 in Forge 1.8.9-11.15.1.1763). This is determined by multiplying the arrow's base damage with its motion (the magnitude of the vector composed of the motionX / Y / Z values) and then adding a random bonus if it's a critical hit. The base damage of the arrow is set when it's fired from the bow, this is 2.0 by default. If the bow has the Power enchantment, it adds 0.5 damage plus a further 0.5 damage for each level. Edit: The base damage is 2.0, not 20.
  7. So pass it an IRenderFactory instead of a Render .
  8. That doesn't tell me much. Which method are you talking about? What's the exact error message shown by your IDE?
  9. In preInit, register an IRenderFactory for your entity using an anonymous class or method reference. In this class's createRenderFor method, create and return a new instance of the appropriate Render class using the RenderManager argument.
  10. Because you're still creating the Render instance before the RenderManager instance has been created. IRenderFactory#createRenderFor must create a new instance of your Render class using the supplied RenderManager argument.
  11. 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. Don't implement IRenderFactory in your Render class. The whole point of IRenderFactory is to delay the creation of the Render instance until the RenderManager instance is created (between the preInit and init phases). Use an anonymous class or method reference to implement IRenderFactory , like I described in my first post.
  12. I suspect the Render#renderManager field is null . Upload your the latest versions of your Registers , ClientProxy and RenderTerrakon classes to Gist/Pastebin with syntax highlighting and link them here.
  13. You're using the index in the AllPlayers list as the index for the worldServers array. worldServers contains the WorldServer instance for each dimension. Vanilla only has three dimensions, so once you try to create more than three CustomPlayer s you're using an invalid index. I'd suggest using for-each/enhanced for loops instead of for / while loops here.
  14. IRenderFactory is just an interface with a single method: createRenderFor . This method is called to create the Render instance for the entity class. If you're building against Java 6/7, just use an anonymous class to implement it. If you're building against Java 8, either use an anonymous class or create a constructor in your Render class with the same signature as IRenderFactory#createRenderFor and use a method reference to that constructor. Constructors implicitly return a new instance of their class, so you just need to match the arguments of IRenderFactory#createRenderFor : a single RenderManager argument.
  15. Player data is stored in the playerdata directory of the save, with each file name being the UUID of that file's player. If both computers are on the same network, you can probably use symbolic links to link either the playerdata directories or the individual player files. Otherwise you may be able to use a service like DropBox, but that will probably require using a third party application or moving the playerdata directory or the individual player files into the DropBox directory and creating symbolic links in the original location.
  16. You can probably use ForgeGradle 2.0.2 with Forge 1.8-11.14.3.1520, just change the version number in your build.gradle. You'll probably have to update to a newer version of Forge eventually, so I'd recommend trying the latest 1.8.9 version and seeing if you can narrow down the performance issues.
  17. That isnt the problem, the call for that IS coming from the client proxy and not my common proxy. The code you posted shows registerTexture being called in the same method as GameRegistry.registerItem . Do you have a separate registration method for the dedicated server? I realise it's not causing the issue that this thread is about, but it will cause issues if you don't separate client-only code properly.
  18. The substitution alias system ( GameRegistry.addSubstitutionAlias ) is supposed to allow this, but I haven't had much luck with it myself.
  19. ModelLoader and ModelResourceLocation are client-only classes. If you register models from common code instead of from your client proxy, you'll crash the dedicated server.
  20. You're using 2.0.2 stable, which includes the fix. Once you've set up the ForgeGradle workspace and imported the project into your Eclipse workspace, the crash in the OP should no longer happen.
  21. "ForgeGradle 2.0-SNAPSHOT" without a number after it means you're either running an old snapshot or one of the stable versions. In your build.gradle script, have you got a buildscript block followed by apply plugin: 'net.minecraftforge.gradle.forge' (the snapshot) or have you got a plugins block (the stable version)? Most recent versions of the MDK have both of these, with one commented out. If you're not sure, upload your build.gradle script to Gist and link it here. Make sure you keep the .gradle extension so it has syntax highlighting. The eclipse folder isn't generated by Gradle, it's only included in the MDK download. I don't use Eclipse myself, but from what I understand you can create a workspace yourself and import the project generated by the eclipse Gradle task. The eclipse folder shouldn't be required.
  22. This exception is caused by ForgeGradle not rebuilding Minecraft with debug information (see this issue). There is another exception being thrown that's the initial cause of the crash, but the missing debug information causes the crash report system to crash the game (hiding the initial cause). Make sure you're running either ForgeGradle 2.0.2 or the latest 2.0 snapshot (2532819 at the time of this post), delete the ~/.gradle/caches/minecraft/net/minecraftforge/forge/<forge_version> directory (replace ~ with %USERPROFILE on Windows) and then re-run gradlew setupDecompWorkspace . This should rebuild Minecraft with debug information, revealing the initial cause of the crash.
  23. Your implementation of IGuiHandler#getServerGuiElement must return a Container , not a GuiScreen .
  24. If the World#perWorldStorage field is public in 1.6.4, your new code is correct. The field is protected in 1.8.9, but that may be a recent change.
  25. Any IMessage sent through SimpleNetworkWrapper can be either client-to-server or server-to-client. You just need to register the message using the receiving Side rather than the sending Side . The main purpose of a Container is to sync inventory contents between the server and client, but you can also use ICrafting#sendProgressBarUpdate to send two int s to the client-side Container (this calls Container#updateProgressBar on the client side). Container doesn't provide any way of sending other types of data or client-to-server data, you need to use your own packets ( IMessage s) for that. This tutorial explains SimpleNetworkWrapper in more detail.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.