Skip 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. Other project I was working with named a paramter like that as "[ x ]OrNull" e.g. "igniterOrNull" to make it clear that it was a parameter that wouldn't throw NPE if you passed in null, as it was intended to handle such things.
  2. I did, I was still wanting to inform you what you were doing wrong. Also, read my sig, thanks.
  3. You're trying to declare a class variable in a location that only local variables are allowed. Go learn Java programming.
  4. The upside down shader is his hack around doing it the right way. He wants to h have a dimension that would be like digging around on the underside of a floating island, with the sun below him.
  5. Yes, Forge has documentation. It is called in-source Javadoc.
  6. You are creating itemstacks at class-instantiaion, before your items have been created and registered. Those stacks are stacks of null and cannot be rendered or used in recipes.
  7. You need to write your own sky renderer. Shouldn't be very hard. You'll also want to turn off void fog.
  8. Go to the edit button, click it, put [spoiler ] at the beginning, and [/spoiler ] at the end, remove the spaces.
  9. IIRC, the lookup ("find this field/method") is the most expensive portion, but the rest of it is more costly than direct access. But a single per-tick field.setValue() or method.invoke() isn't going to be noticeable. The reason it matters for Forge events is because there are potentially thousands of them running per-tick.
  10. Props on making it, too. Modding Minecraft has seriously been one of the most enjoyable programming experiences I've ever had. Everything is laid out so well with incredibly intuitive and easy to use systems that let me hook into nearly everything. I've had to coremod a few things, but they were things that have either been turned down (an event for when the player feeds animals...I still don't understand that one getting declined*) or don't have a general-purpose use (modifying the overworld moon phase calculation, an event for crop growth ticks, tweaking silverfish to enter custom blocks (actually that one might be worth trying to patch into Forge), couple other things). *I was told that the method that sets animals into love mode (func_146082_f) never got an event because there were other ways to get at what it does. And while true, my usecase needed to specifically detect the player setting the animal into love mode, rather than it coming from another source. I wanted to make it take more food to feed an animal before it would breed, but also make animals go into love mode on their own. If I couldn't detect that it was a player setting love mode, vs. it being from an AI task, then I coudn't achieve the effect I wanted.
  11. Gotcha. I figured that was why, but didn't see how the angle of rotation put it behind the player rather than in front. Huh.
  12. Mm, degrees and radains. Don't know why you had to subtract pi though.
  13. Use TickEvent.WorldTickEvent, unless they broke that out (not an internal subtype) for 1.8
  14. A does not imply B here. What calls this method?
  15. (newPosX + - 4, d1, newPosZ + 4); Wha?
  16. What for? The class is already only ever going to get loaded on the client. If the class gets loaded on the server, those annotations aren't going to keep the server from vomiting ClassNotFoundExceptions
  17. implement ITileEntityProvider and override its methods.
  18. Ohgodno. Reflection is awful.
  19. That can be simplified. E.g. by removing it entirely, because you're only going to get 1 item stack from that loop, so why bother with a loop?
  20. This: new BasicMetadataBlockMF("clayWall", Material.wood, ItemClayWall.class, 4) Calls this: public BasicMetadataBlockMF(String name, Material material, Class itemBlock, int number) { super(name, material, null); NUMBER = number; NAME = name; } Notice that the itemblock paramter goes unused.
  21. Ah! So that's how the event handlers work. I always wondered about that.
  22. You should be passing the TileEntity itself. The reason this isn't working is because your block doesn't HAVE a tile entity and the Container/GuiContainer are expecting an object of type moriumWorkbench (which, by the way, you should capitalize and prepend with "Block", BlockMoriumWorkbench ) You don't have a TileEntity to pass, so the TileEntity tileEntity = world.getTileEntity(x, y, z); is going to return null anyway and fail the instanceof check. If you want to do this with just the block, you're going to have some trouble. In fact, I already see some problems in your other classes. ContainerModTileEntity has this line: for(int y = 0; y < 3; ++y) { for(int x = 0; x < 3; ++x) { this.addSlotToContainer(new Slot(inventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18)); } } That's supposed to be adding a 3x3 grid for the crafting, but the inventory you told the slot that it is a part of is the player's inventory! Then there's this: public boolean canInteractWith(EntityPlayer player) { return ((IInventory) this.te).isUseableByPlayer(player); } te in this context is a moriumWorkbench , which as established above is a Block which does not extend IInventory! This line will throw a null pointer exception when run, as will likely your transferStackInSlot method; I'm not entirely sure what'll happen. Long story short, you've followed a tutorial for how to add a gui interface for a TileEntity and have even named your classes with "TileEntity" even though you do not have one.
  23. hehehehe Figures Forge would do that. What I don't know is why runtime class creation is preferable over a standard compiled class. That is: I can't think of a use-case where it would be necessary. Then again, the only example I saw was just that: an example to show that it could be done. And no, I have no idea what that Forge one does. It's still stupid complex even if you know what you're doing, because of how many things you have to keep in your head at one time in order to write a single line of code. You have to know what's on the stack, what operation you need to do next, how it will affect the stack, and so on. So I wouldn't say it's easy, more like doable.
  24. Oh. Try putting the @instance annotation above this line: public static TutorialMod instance;

Important Information

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

Account

Navigation

Search

Search

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.