Jump to content

Choonster

Moderators
  • Posts

    5117
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. Remove WhiteCoralBlock's override of Block#getCollisionBoundingBox and the AABB returned by CoralBlock#getBoundingBox should be used as the collision bounding box.
  2. That should work, though the AS local variable is pointless. This needs to be in a client-only class that's registered to the Forge event bus (e.g. annotated with @Mod.EventBusSubscriber). When using @Mod.EventBusSubscriber with classes that only exist on one physical side, make sure to pass Side.CLIENT or Side.SERVER to the annotation as appropriate so Forge only loads and registers it on that side.
  3. Now that your Block actually has a property, there are 16 variants that your blockstates file doesn't define a model for. You could define a model for each variant, but there's not much point in this because they'd all be the same. Instead, you should tell Minecraft to ignore the BlockLiquid.LEVEL property when loading models by registering an IStateMapper for your Block in ModelRegistryEvent. The easiest way to create an IStateMapper is by creating a StateMap.Builder, calling StateMap.Builder#ignore to ignore the property and then calling StateMap.Builder#build.
  4. Your model extends from builtin/entity, which means Minecraft expects it to be rendered by a TileEntitySpecialRenderer. Since you don't have one, nothing renders. Ideally you should use a regular baked model for the shield rather than a TESR.
  5. This hasn't changed since 1.8, you need to include the BlockLiquid.LEVEL property in your Block's state (by overriding Block#createBlockState) before you can set the value of it. I have a block that does this, you can see that in both 1.8 and 1.12.2 I override Block#createBlockState.
  6. Use EntityList.getTranslationName to get the unlocalised name of an entity type (rather than an individual entity), you can then translate "entity." + unlocalisedName + ".name". See Entity#getName and ItemMonsterPlacer#getItemStackDisplayName for examples of this.
  7. The MCP Mappings version is completely independent of the Forge MDK version; you can set the mappings property in the minecraft block of build.gradle to change the Mappings version. There's a snapshot version of the MCP Mappings released automatically every day, but Forge rarely updates to new Mappings versions.
  8. You can use CraftingHelper.findFiles to iterate through files in a specific path for a mod and process each one in some way. Forge uses it to load recipes in CraftingHelper.loadRecipes(ModContainer) and advancements in ForgeHooks.loadAdvancements(Map<ResourceLocation, Advancement.Builder>, ModContainer).
  9. If you use the WorldGenMinable(IBlockState, int) constructor, your ore will only generate in the "natural" variants of Blocks.STONE (i.e. Stone, Granite, Diorite or Andesite; but not the Smooth variants). These don't normally generate in the Nether, so your ore won't generate either. To generate your ore in other blocks, you need to use the WorldGenMinable(IBlockState, int, Predicate<IBlockState>) constructor and supply a Predicate that returns true for the block(s) your ore can generate in. Vanilla provides several Predicate<IBlockState> implementations in the net.minecraft.block.state.pattern package, you can also specify your own using a lambda or method reference.
  10. As I discovered in this topic, you need to set Block#useNeighborBrightness to true. For some reason, Vanilla does this in Block.registerBlocks instead of in the constructors of the appropriate Block classes.
  11. I've encountered a similar issue again while testing a PR. When attempting to run the Minecraft client from the Forge development environment with either JEI or TestMod3 in the mods directory, the game crashes with a ClassNotFoundException for a class that definitely exists in the corresponding mod JAR. This doesn't happen outside of the Forge development environment (neither in my TestMod3 development environment nor when launching Minecraft from the Mojang launcher). This was tested using Forge 1.12.2-14.23.2.2619 (commit 49be9b2) with JEI 1.12.2-4.8.5.147 and TestMod3 1.12.2-5.1-2ce586d (in separate runs). You can view the FML logs from these runs here. Does anyone have any idea why this would happen or how to fix it?
  12. Use the eye icon in the post editor. Delete the FML log and then run the server again, making sure to use Java 8. If it still crashes, post the new FML log.
  13. The sub-events of PlayerInteractEvent are fired when the player interacts with the world in various ways; you should be able to subscribe to the individual sub-events and cancel them when this mode is active.
  14. That wasn't in a spoiler or on Gist. There's no error in that log, because you're running the server with Java 8. Your original crash was caused by running the server with Java 9.
  15. You're using Java 9, which isn't supported by Forge. You need to use Java 8 instead. In future, post the FML log (fml-server-latest.log in the server directory) in a spoiler or on Gist.
  16. There are many versions of Forge for each version of Minecraft, you need to use a version that your mods support. You should generally use the Latest or Recommended Forge version for the Minecraft version you're using.
  17. You'll want to use the Capability system for this. If the levels are a property of the player, attach the capability to the player. If they're a property of the tool, attach the capability to the item.
  18. That tells us almost nothing. What purpose does this data serve? What is it associated with? Where is it read/modified from?
  19. Use Random#nextInt(int) to generate a random integer between 0 (inclusive) and the argument (exclusive) instead of the multiplication, subtraction and rounding you're doing now.
  20. It adds the items to the list that you pass as an argument.
  21. If an event exists, it can be subscribed to. Those three methods are only called when a player is actively using an item (e.g. drawing a bow, eating food, blocking with a shield) and only for the item that they're using.
  22. The sub-events of PlayerInteractEvent are fired when the player left or right clicks in various ways.
  23. Mojang obfuscates the Minecraft code as part of the build process, so everything has a name like a or cc. These names change with each Minecraft version. The MCP team is responsible for mapping these so-called Notch names to SRG names like func_0001_a or field_0002_b that remain stable between Minecraft versions. The MCP team and the community then map these SRG names to deobfuscated MCP names like doFoo or bar. It can be very difficult to understand what code is doing when nothing has a proper name and functionality can change between versions, so sometimes methods, fields and parameters end up with misleading names. If you have a better name for a method, field or parameter, you can open an issue on the MCPBot issue tracker.
  24. You're running 1.12.2, but you have a bunch of 1.7.10 mods installed; which won't work. Mods (especially coremods) only work for the Minecraft version they were built for. You should use a separate game directory for each Minecraft version so each version has its own mods, config files, etc.
  25. Minecraft uses StateMapperBase#getPropertyString to build the property strings uses as variants in blockstates files, but this is client-only. You can take a look at NBTUtil.readBlockState and NBTUtil.writeBlockState to see how Minecraft reads blockstates from and writes them to NBT; you could apply similar logic to generate/parse a state string in a config file. Edit: There's also CommandBase.convertArgToBlockState, used by commands to parse blockstates from strings. This is probably exactly what you want.
×
×
  • Create New...

Important Information

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