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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. if (this.villagerObj.getDistanceSqToEntity(this.animal) > 2.25D) //Crashes here No, it's crashing trying to calculate the distance. Inside this function. There's only one object here that could be null: this.animal Do a search of your file for "animal =" and tell me what you find and if you still have a problem.
  2. No I can't. I have to assume the opposite, because if I assume that your superclass does something, then I can assume your code works perfectly.
  3. Because we can totally tell what your superclass does.
  4. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/entities/TileEntityTanner.java#L174-L189
  5. You would need a custom IStateMapper. For example, I needed something like this, so I used two blockstate files and used the mapper to decide which one to load. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/flowers/states/StateMapperFlowers.java
  6. Actually.... You want [inside the current chunk] + (8,8) Due to the way Minecraft generates chunks, you want to always offset by 8 blocks in the positive X and positive Z directions. The next chunk in that direction are guaranteed to already exist.
  7. You can't. At some point, somewhere, you have to specify what you want dropped.
  8. http://mcforge.readthedocs.io/en/latest/networking/simpleimpl/
  9. The tripwire probably has a non-default IStateMapper. For example, this block: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/flowers/block/BlockOreFlower1.java#L114 Has 3 properties. But you'll notice that one of them is distinctly missing from my blockstate file: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/oreflowers/blockstates/oreflowers1.json That's because this class handles it: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/flowers/states/StateMapperFlowers.java In my case, the property splits across two blockstate files, but other options are available as well (such as outright ignoring it). You'll have to dig around for the one Vanilla uses for the tripwire. You then call ModelLoader.setCustomStateMapper(block, mapper); to register it.
  10. You can't. You would need to use an event handler and check which block the entity is standing on.
  11. veganism:hemp_tripwire#attached=false,disarmed=true,east=false,north=true,powered=false,south=false,west=true for blockstate "veganism:hemp_tripwire[attached=false,disarmed=true,east=false,north=true,powered=false,south=false,west=true]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model veganism:hemp_tripwire#attached=false,disarmed=true,east=false,north=true,powered=false,south=false,west=true with loader VariantLoader.INSTANCE, skipping Your block has a "disarmed" property but your blockstate file lacks it. Also, you might be interested in using the Forge Blockstate format http://mcforge.readthedocs.io/en/latest/blockstates/forgeBlockstates/ Which doesn't require you to fully specify every possible combination of states. For example I have a block with three properties: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/harderfarming/blockstates/tanner.json#L17 The facing indicates the rotation, the other two properties specify a submodel (although they could specify anything other than rotation). Forge then automatically combines these.
  12. That will spawn it exactly on top of the player. Probably not what you want, but yes.
  13. There's a few other things to do, as well, such as setting the entity's position. But largely, yes. Take a look around the vanilla code for some other examples of that function in use (right-click -> references -> find in workspace)
  14. World.spawnEntity(...)
  15. In the code that modifies that integer (I mean...you wrote it...)...check to see if that integer is greater than the desired number and if so, give the player the advancement (check vanilla code for how to award advancements).
  16. I doubt the veracity of this statement. You can prove me wrong by posting your code.
  17. I love how your screenshot is completely useless (the fuck does "he turned face" (this isn't even a sentence!) and this cropped screen shot have to do with each other?). Fuck if I can tell what's wrong with your code snippet based on that screenshot.
  18. It looks like it's been through a hash algorithm because Mojang obfuscates the source code. All field names, class names, and method names get replaced with single-letter abbreviations, then two-letter, then three-letter, and so on until there aren't any more to replace. As for complex...well yeah, it has to be. Minecraft as a game is complex and incredibly flexible.
  19. I thought I said that... Oh, I did.
  20. Ok, so. 1) It looks like you are storing the entity's name in a class field. You can't do this, Items are singletons. 2) You need to check whether or not you've already stored an entity or not, and if you have, do something different 3) Figure out how to spawn cows, then work out how to genericize it.
  21. How does EventPriority.HIGHEST solve the client-vs-server issue? I'll give you one hint: It does fuck all about it.

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.