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. So, a couple things. chunk.getWorld().getBlockState(...) This can be better. Option 1: store the result of chunk.getWorld() to a local variable and use world.getBlockState() Option 2: skip the world object and use chunk.getBlockState() new BlockPos(...) Don't do this. BlockPos objects are (sort of) mutable. Use a local variable and pos = pos.down() instead.
  2. Diesieben07 got there first: You were already told what to do, you didn't do it, I have free reign to call you out on not doing what you were told to do.
  3. Neither one of the suggestions are (technically) correct. In this case, "implement methods" would work but it may cause a problem (duplicate method signatures) when there's an easier solution (importing the right classes).
  4. (Note: block-meta-4 <==> item-meta-4 only by coincidence (ease of programmer conversion), but there does exist one usage in vanilla code that assumes that they are exactly the same, and technically a bug from the perspective of the Forge team)
  5. Pretty sure that's now how you should be doing the spawn egg. For two reasons: 1) You shouldn't be adding it to the array yourself 2) You're ignoring the two color parameters, which means you aren't going to get an item at all. You pretty much took the fact that someone said "you need to call createEgg" and created a method called createEgg and did random bullshit you thought the method should do. You seem to do this a lot.
  6. Draco18s replied to a post in a topic in Site News (non-forge)
    I never said anything about a browser, I said the IPS forums. And if it's fine over there, then it is a style problem. That's all I was trying to confirm. I also did not request another screenshot.
  7. Inside the ItemStack class. IIRC, If the entity passed in is null, that check can't be made (because there is no entity, and the damage just happens).
  8. new ResourceLocation(a, b)?
  9. A TileEntity is a class that extends (surprise) TileEntity. Override hasTileEntity and createTileEntity in your block class. By using an IItemHandler and writeToNBT on your TileEntity (you'll also need readFromNBT too, surprisingly enough). By overriding hasCapability and getCapability on your TileEntity, checking if the reqrequested Capability is CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, and if so, returning the IItemHandler field stored in your TE. Same as you would without a TE. Using metadata. Using a boolean in your blockstate, then in your blockstate json file, using a different texture. Particles: look at the vanilla furnace. MORE FIELDS, this time one that's an integer that you add (or subtract) from every tick. Look at the vanilla furnace for a field called (curiously) "burnTime" Look at the vanilla furnace. There's an interface called IFuelHandler that is polled to find out. Technically it doesn't animate. It's just a progress bar that's handled by the client saying "the current burn time is 120, the maximum is 600. I should display (120/600) pixels worth of this texture." https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/client/gui/GuiContainerSifter.java#L37-L41
  10. Don't use ModelMesher. Use ModelLoader.setCustomModelResourceLocation during preInit instead.
  11. Actually, iterate from world.getSeaLevel (world.provider.getSeaHeight? Something along those lines) upwards. There's no need to check from 0 to 60 in the overworld. You know those are going to be stone, air, or water. And look for areas with sunlight > 5 or so. And look for the last stone, sand, gravel, or dirt block (looking for grass won't help, because it'll just iterate up the trunk of a tree) before finding sunlight. Alternatively you could use the value returned by getHeightValue and iterate downwards until you find sand/grass/dirt/stone/water/lava. That'll get you the best result, I think. You could also check all adjacent blocks to the column being searched and if any meet the criteria for "what is ground" and average the result. Note: vertical cave entrances will give slightly wonky values because their "surface" point will be below the surrounding area, but this may not be a big deal.
  12. If your block is in your inventory, it exists as an item. You need to register your inventory variant or item model to use the closed version.
  13. 1) don't use that game registry method. Set the registry name on your block yourself. 2) have you called setUnlocalizedName()?
  14. use new ResourceLocation(a, b)? Seriously, not that hard. You didn't use the new keyword, so you used Eclipse's "dis not right" helper to create a method, which you then pointedly ignored despite the fact that it was a stub. I like Visual Studio's default method instead. It's content is throw new NotImplementedException() which just makes things crash when you're a dumbfuck who didn't implement your stubs.
  15. Or you can fix your method declaration: public static void createEntity(Class<? Extends Entity> entityClass, String entityName, int solidColor, int spotColor) Also your resource location is null: private static ResourceLocation ResourceLocation(String modid, String entityName) { // TODO Auto-generated method stub return null; // <-- THIS HERE } You might want to fix that.
  16. You're basically doing this sort of thing: https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/api/interfaces/IArtifactComponent.java#L28
  17. ...You pass in the entity's class?
  18. This is old code (1.7.10 era) and draws a line between block positions (Vec3 ~= BlockPos), as well as some tweaks (color, slight offsets) specific to my use-case, but the general principle is the same. https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hazards/client/HazardsClientEventHandler.java#L371
  19. Do you mean drawing a line? A vector is just a mathematical notation of an arrow.
  20. You shouldn't be using global entity IDs. Use EntityRegistry.registerModEntity() and use your own ID list (starting at 0).
  21. Draco18s replied to a post in a topic in Site News (non-forge)
    Yeah, it's awful. And might not be something the Forge team can fix. Check the IPS Forums to see if they break too. If so, report to them. (IPS Forums are one of my least favorite, but still decently functional, forum software packages)
  22. Actually noCAPTCHA is really pretty good. reCAPTCHA was getting farmed out and they ran out of things computers couldn't recognize. https://www.youtube.com/watch?v=jCr6rNaZ9EU The idea behind noCAPTCHA is that it uses telemetry data (such as how the mouse moves across the page) in order to determine bot / not bot, although I'll agree that the first "checkbox" click is less likely to get flagged as a bot than subsequent checks.
  23. GL commands only work on the current draw frame. IBakedModels are not computed every frame. They're BAKED.

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.