Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Alpvax

Members
  • Posts

    257
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Alpvax

  1. If you are subscribing the events to the class, the methods have to be static (there is no instance to access the methods on).
  2. For starters this: .setRegistryName("[NAMESPACE HERE]","steve_head") won't work, everything has to be lowercase (and the namespace should be your modid). Secondly, What is the error? Show us your log file.
  3. Look at the blue banner at the top of the page: "New LTS System, 1.14 and moving forward" 1.12 is no longer supported on this forum. Update to a newer version.
  4. I looked at Lex's mod CobbleForDays to get mine working. Tropicraft's 1.14 branch was useful to start with as well (I used that until I found Lex's).
  5. Please create a github repository, it is very hard to debug when we only have tiny snapshots of your code.
  6. What's the exception? With stacktrace preferably. Is your code on github? It would be easier for me to see if it was.
  7. I'm not quite sure what you mean by this. I would use this as your loop. You have no use for the ..._SUPPLIERS variables, as RegistryObjects ARE Suppliers. And again, the ArrayList<FlowerPotBlock> is useless, because the blocks do not exist yet, so there is nothing to fill the list with. i = 0; for(String color : COLORS) { EMPTY_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_flower_pot", () -> new FlowerPotBlock(null, AIR_SUPPLIER, Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid()))); j = 0; for(Supplier<Block> plant_supplier : PLANT_SUPPLIERS) { String plant = plant_supplier.getId().getPath(); FULL_FLOWER_POT_REGISTRIES.add(BLOCKS.register(color + "_potted_" + plant, () -> new FlowerPotBlock(EMPTY_FLOWER_POT_SUPPLIERS.get(i), plant_supplier, Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0f).notSolid()))); j++; } i++; }
  8. I'm pretty sure I played a 1.15.2 modpack the other day which had more than 2 pages, so I don't think that is accurate.
  9. Again, you CANNOT access the blocks until after the event has fired. They simply don't exist. Use the ID, or the RegistryObject itself, it is an instance of Supplier<T>. I use the following 3 methods to register my blocks: /** * Register a block and a default ItemBlock with the Item group set to my Item group. */ private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> block) { return register(name, block, (b) -> () -> new BlockItem(b.get(), new Item.Properties().group(AAItems.ITEM_GROUP))); } /** * Register a block and an Item using a custom Item supplier. * @param itemCreator type is (block) -> Supplier<Item>. (block passed in so you could use the same function to define multiple block items). */ private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> block, Function<RegistryObject<T>, Supplier<? extends Item>> itemCreator) { RegistryObject<T> ret = registerBlockOnly(name, block); ITEMS.register(name, itemCreator.apply(ret)); return ret; } /** * Register a block with no item (could be used for door/bed halves etc.). */ private static <T extends Block> RegistryObject<T> registerBlockOnly(String name, Supplier<? extends T> sup) { return BLOCKS.register(name, sup); } The reason why you have to pass in suppliers to the DeferredRegister#register methods is so that they can call them in the registry events, i.e. at the correct time. Note that using the block/item objects .get() in suppliers ONLY WORKS FOR GETTING BLOCKS AND ITEMS. This is because those 2 registry events are fired in that order, before any others, and until the event has fired, the object doesn't exist, so cannot be used in other events. (The order of other registries is random, so it might work sometimes and not others.) If you need to access other registry objects, you need to use a supplier (as in pass the actual RegistryObject into the constructor) and get the object when it is needed.
  10. The whole point of registry objects is that they are initialised in the correct event (The DeferredRegister does that too). Until the registry events have run, the registry objects will be "not present". As all you are after is the id, use RegistryObject#getId() instead of trying to get the object first.
  11. Be careful when doing that, chunks are unloaded for a reason (reduce memory usage by not keeping all chunks in memory at once). Make sure you unload/unforce the chunk again when you're done. Otherwise your mod will have performance issues on worlds which have been played for a while.
  12. Use a multipart model/blockstate is the easiest way to do it: https://minecraft.gamepedia.com/Model#Block_states Look at how the fence blockstate is defined (client-extra.jar) for an example, and just rotate about the other axis for up/down. That way you only need a couple of models for all permutations, and don't need a custom baked model. See mine (wire, has multiple states for each side so is somewhat complicated, but you can just look at the basic structure): Blockstate file: https://github.com/Alpvax/AdvancedAutocrafting/blob/1.15/src/generated/resources/assets/advancedautocrafting/blockstates/wire.json One of the model files (wire_arm is currently just base_wire_arm, but with a texture): https://github.com/Alpvax/AdvancedAutocrafting/blob/1.15/src/generated/resources/assets/advancedautocrafting/models/block/part/base_wire_arm.json For reference, my wire blockstate has an enum property for each direction (NONE, CONNECTED, INTERFACE, DISABLED) and each state shows something different ("arm"s are visible for both connected and interface, hence the | in the "when" json value. I would not recommend actually looking at my WireBlock code, it is overly complicated due to some experimentation I was doing with data generation and general messing around). Attached image for end result (before disabled got its own model).
  13. There is always a log. As your code looks correct, I would say there's probably a line in your log file telling you what is wrong.
  14. You will have to make a new blockstate file for each block (unless they have custom tile renderers, which I haven't looked into). You can use the same model for all of those files I believe. Also, look into data generators, it will help you generate all the files from code, saving you a lot of time.
  15. Imagine if everyone used 2 character mod IDs. That means there would be a lot of conflicts, as there are only 26² possible combinations, but some would be more popular than others.
  16. Actually yes. But only if the player uses the vanilla "recipes need to be unlocked before they can be used" mechanic. I believe you can relock the recipes, although I've never tried. Alternatively, make your own IRecipe implementation which checks whether or not it should be unlocked for the player creating it.
  17. In your model JSON, set the "particle" texture to "#texture" (or whatever you want it to be). I went with the vanilla approach of having base models (in /part/) and then my textured models, which the blockstate references. I'm not sure if there is a better way, as I don't think you can pass in texture overrides from the blockstate file. My models are here: https://github.com/Alpvax/AdvancedAutocrafting/tree/1.15/src/generated/resources/assets/advancedautocrafting/models/block
  18. The voxelshapes method takes values between 0 and 1, the model takes 0-16. You need to divide all your voxelshapes by 16.
  19. Please keep this forum in English! Learn Java first, before you start modding. For your issue, look into resource packs, the vanilla format can support 3d models from JSON.
  20. Copy one of the mappings from here: http://export.mcpbot.bspk.rs/ Into your build gradle (copy the existing format, just update the numbers).
  21. You need to look into tile entity rendering (look at chests and shulker boxes opening animations
  22. No, it would appear that I'm getting a 404 when using curl. I'm afraid I'm not sure what your issue is. I have just noticed that your mappings are for 1.14, but you're missing for 1.15. try updating your mappings.
  23. This is the third thread I have come across from you now, all asking the same thing! Please stop spamming the forums and give people a chance to actually answer!
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.