Jump to content

MFMods

Members
  • Posts

    370
  • Joined

  • Days Won

    13

Everything posted by MFMods

  1. try with half of those mods. binary search.
  2. you have a big picture. good for you. now you need to divide it into small solvable problems. those, we might help you with.
  3. override those methods freely. you should and for many blocks you need to. they are not about to be removed. in this case the "deprecated" notice is used wrongly and someone should have introduced a new one.
  4. do not keep client-only code in your main mod class or any class that has anything else in it. it needs to be a separate class with client things (ItemBlockRenderTypes.setRenderLayer call etc.) and nothing else. on a dedicated server, it needs to stay unloaded. to subscribe to an event, use the annotation (preferred way) or the line i gave you above. do not call addListener unconditionally.
  5. your client setup method looks fine. did you add it as a listener in main mod class constructor? DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientEvents::clientSetup)); (replace clientevents with how you called that class)
  6. you already have it. you set RenderType.cutout() in FMLClientSetupEvent. find out why that code doesn't execute.
  7. your renderer extends EntityRenderer which doesn't do much. extend LivingEntityRenderer.
  8. make a handler for ChunkDataEvent.Load event. get pixel colors for your map and add to your data structure. do not worry about that chunk getting unloaded 5 minutes later. you will have to update map later if player builds a big fort, but that can be done in EnteringSection event.
  9. addEffect should be run on server-side (level.isClientSide==false). playSound on client-side (isClientSIde==true).
  10. well you can load a chunk, but i feel you shouldn't. i don't know what you are doing but the game is structured so that parts of the world where no player has been for a while are "frozen", kinda. machines from good-quality mods stop working when in unloaded parts of the world. plants from good-quality mods stop growing. all those modders could have forced part of the world to stay loaded (at a price paid by the player). but they didn't. they didn't say "i don't care how the game is intended to run and that players expect all mods to behave uniformly, because my block is just that important!". when mods keep chunks loaded it's often because the young modder was too lazy to make their block just unavailable at the moment.
  11. https://forge.gemwire.uk/wiki/Saved_Data just make one method (save) that stores your thing into CompoundNBT and another (constructor in 1.18+, separate load method in 1.16) that rebuilds your list/map/whatever from NBT. you can attach everything to overworld (unless the world is part of your data in which case split and attach separate data to each world).
  12. stupid microsoft convinced so many people that file managers aren't a thing. search the net for "double commander". then install "imagine" as a plugin to quickly view image files.
  13. when you override a method, you usually want to call the inherited code with your own being an addition. separate issue, why "lit"? that's a furnace on/off property. don't you want an integer property?
  14. if you are porting from a super-old version, go to https://discord.neoforged.net/, and then to bot-commands channel. you can use bot there to find out the mojang name of the old function, and then to find the new name. let's not get into details of me giving you a link to a discord channel of a forge fork. it's the only place i know of that can translate between obfuscated names, mojang names and mcp names.
  15. in your block class, override getFireSpreadSpeed and getFlammability. try just returning 5 and 20 and see how it works for you.
  16. event.getEntity(). tick event (every instance of it) exists so that you can do things when the entity (your projectile) gets one tick older. just subscribe to the tick event (LivingUpdateEvent). use the logger (or just system.out.printLine) and print out important things in event object.
  17. ...and see how that item class does what it does.
  18. all entities tick all the time, including projectile entities. respond to entity tick event, check the side (client), check total world ticks (you don't want particles 20x per second so you'll ask if total time modulo 20 is 7 or something like that), check that the entity is your projectile, check that it isn't dead/removed, check that it is moving (entities remember previous position). then pop a particle.
  19. so, what vanilla item has that? lilypad. type Items.LILY_PAD, follow inside, that takes you to PlaceOnWaterBlockItem.
  20. try commenting out 1st and 3rd registration and leave only the 2nd. i never did what you're trying but start with that.
  21. that would be difficult. and there is a ton of ways an item could end up in a chest - maybe i tossed it and a conveyor belt brought it to a chest and placed it in? or i threw it onto a hopper? no way you can detect all that. what do you want, really? perhaps you can react to ItemEntity creation and have your item be one thing while in inventories and another when spinning on the ground? if it finds its way back into player's inventory, you can "feel" it there (things can tick in player's inventory) and do a switcharoo?
×
×
  • Create New...

Important Information

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