Jump to content

Alpvax

Members
  • Posts

    297
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Alpvax

  1. I'm not fully convinced of that. You should send "player scrolled X slots", that way the actual scroll amount per slot can be configured client-side.
  2. It is also possible to use NBT tags to create swords which have custom attributemodifiers and models in order to have more than the usual sword types. It can be done with any item, but you cannot add new functionality and behind the scenes they are still the vanilla sword item. See https://minecraft.gamepedia.com/Model#Item_predicates for more info on custom models (uses an NBT tag to select which model override to use).
  3. I saw, thank you. I'll hopefully test it tomorrow, but it looks good. I've never managed to get my head around this, so thanks for helping.
  4. Alpvax/AdvancedAutocrafting 1.16_wireTEs branch TileEntity: block.tile.WireTileEntity Block: block.WireBlockV2 The model stuff is in client.data.model.
  5. I already do call it client side. I have now removed the server side call, but nothing has changed.
  6. Even closer now. I do not want to update neighbours, as the property is changed from Block#neighborChanged, and I do not want to cause an infinite loop. //Called after updating property BlockState blockState = getBlockState(); //Do not update neighbours getWorld().notifyBlockUpdate(getPos(), blockState, blockState, Constants.BlockFlags.BLOCK_UPDATE | Constants.BlockFlags.RERENDER_MAIN_THREAD); requestModelDataUpdate(); I also call requestModelDataUpdate at the end of handleUpdateTag. The data is now correct on the client (displayed when right clicked), but the render is always 1 step behind (Only updates once another block is placed).
  7. Almost fully working. Only thing I'm now struggling with is forcing my TileEntity to sync. I'm calling markDirty and requestModelDataUpdate after changing the property, but the client side data doesn't refresh until I close and reopen the world. Do I need to send a custom packet, or is there an easier way of forcing a resync?
  8. Perfect, thank you. I'll give that a go and return if I run into any issues.
  9. I am in the process of converting my existing blockstate based model to a tileentity due to excessive use of blockstates (4-value EnumProperty for each direction = 4096 + waterlogged = 8192 permutations!) I have an existing (generated) multipart blockstate json, is there any way to easily convert it to the same model, just using the data from the tileentity instead of the blockstate? I'm assuming I need to create a custom BakedModel, but I would ideally like to keep the current data-driven approach (one model for each of the 4 enum values). It's the first time I've started looking into custom models, and I think a TileEntityRenderer is overkill for static models. Please correct me if I'm wrong.
  10. Can we add this question to a FAQ/EAQ somewhere obvious? It is the most requested suggestion I have seen by far. Although I suppose that people requesting it probably haven't read FAQs.
  11. You haven't understood what Draco and I told you. minecraft:carnivores is a completely unrelated tag to mymod:carnivores. There is no link between them AT ALL. You need to make a single tag (maybe myanimalmodid:carnivores), then for each of your expansion mods, you add to THAT tag. Not to a different tag for each mod.
  12. If you are really desperate to share your resource packs, I believe that using symbolic links should work.
  13. These are 2 different tags ("minecraft:carnivore" and "mymod:carnivore" respectively). You should make 1 tag "mymod:carnivore" and add all the defaults to it (as in all the vanilla items, and your custom items if applicable), then if you want to add items in another mod, you also define the "mymod:carnivore" tag (not the "mysecondmod:carnivore", again that would be a different tag). As an extension on what draco said, the only time you should put tags in the minecraft domain is if you are overriding/adding to an existing vanilla tag.
  14. That is not valid json. Currently you have an array with keys. Either it should be an array of objects "[ { ..." or it should be an object with keys of "one, two,...". I would suggest going for the first option (especially as that is what you support in your code):
  15. Worked around the issue by double unchecked casting the type: public abstract class IOType<T> extends ForgeRegistryEntry<IOType<?>> { @SuppressWarnings("unchecked") public static final Class<IOType<?>> CLASS_GENERIC = (Class<IOType<?>>)((Class<?>)IOType.class); } //Can then be used as follows public static final DeferredRegister<IOType<?>> IO_TYPES = DeferredRegister.create(IOType.CLASS_GENERIC, MODID); By putting the constant in the API class, it can be used by others who are consuming the API.
  16. DeferredRegister has been updated recently to make it work with custom registries, but it still doesn't work with custom generic RegistryObjects (similar to TileEntityType<T>). When trying to create the DeferredRegister, it errors with: //Registry public static final DeferredRegister<IOType<?>> IO_TYPES = DeferredRegister.create(IOType.class, MODID); //IOType.java (currently just a stub) public abstract class IOType<T> extends ForgeRegistryEntry<IOType<?>> { } Is there a workaround for this issue, or can I just not use DeferredRegister? This will be available in an API, so I would ideally be able to support the more popular DeferredRegister approach. Removing the parametised type (DeferredRegister<IOType> IO_TYPES = ...) then throws the error of IOType not implementing IForgeRegistryEntry<IOType>, so that isn't a fix. I am wondering if the only workaround is to make the registry in a static initialiser (and overriding it in the NewRegistryEvent), but that seems like a step backwards. Does anyone have any suggestions?
  17. I believe that the last time I looked into doing something similar, I decided to make my HashMaps per-chunk to prevent this issue.
  18. What are you actually trying to achieve for the players? If you want a slime block, register a new SlimeBlock.
  19. If you are new to modding, I would suggest starting with 1.15, not 1.16. 1.16 has only just been released, so there are still bugs and issues being worked out. You need to subscribe to one of the render events, and render your text inside the event listener, in the same way you would in any other GUI.
  20. When I was starting to use DataGenerators, I found that Lex's mod CobbleForDays helped me understand.
  21. I don't agree with that logic. Yes, 1 bucket of a fluid is 1 block of the fluid (although it actually doesn't quite reach the top, so you could argue that is not true), but there is nothing saying 1 solid block is equivalent to 1 bucket of that material melted down. Liquid doesn't have ingots or nuggets, so those solid conversions do not need to apply to them. If we keep it as 1 block of a solid becomes a bucket-and-a-bit, all it means is that you don't fit an even number of blocks into your tanks. But I don't see why that is an issue, because once you have converted it to a fluid, whatever you're using it for (machines?) probably doesn't care about the solid amount. If you want to transfer exact amounts, use the blocks. They are probably easier to transport anyway (there is a vanilla mechanic for it, and you can usually carry 64 per inventory slot as opposed to the 1 in a bucket).
  22. I don't see how that is true at all. Why does 1 block have to fit in 1 bucket? If we just accept that 1 block is 1296mb, everything works. I don't see why we have to add the restriction that 1 bucket is 1 (solid) block. We can just accept that melting it makes it less dense, therefore bigger.
  23. Bear in mind that more players use metric systems than imperial (according to minecraft server statistics, and the fact that there are few countries which still use the imperial system). It is far easier for users to understand that half a bucket is 500mb, than it is for them to see 648 "atoms" (If that is the approach, I would prefer to use something like "voxellites" which has no real-world bearing than "atoms" which could cause huge confusion for users of chemical mods). And to the next argument that you would just display it as "3 1/2 buckets" or 3 1/1296 buckets", that is hugely unnatural for me (and presumably many others). I'm not sure what the issue with 144mb/ingot is. Why does a melted compound have to fit in the same space as a solid one? It doesn't in real life. And as far as cauldrons, I think it's fair enough to just lose 1mb in a cauldron. Who cares about 1/1000 of a bucket of an infinite resource? And for those mods which have finite supplies of water, they usually add their own mechanisms for collecting/storing it, so the cauldron issue is moot.
  24. Do you just mean with spawn eggs? Or do commands not work either? Vanilla spawn eggs (I believe) have the entity set when they are created, so if you override the entity, I think you also need to override the spawn egg to make it work. Disclaimer: I've not actually done it myself, but I believe that is the case.
  25. I don't believe that is the case. Look at the subclasses of JSONReloadListener (recipes, loot tables, advancements etc.). You don't care which files exist, just try to load all of them.
×
×
  • Create New...

Important Information

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