Jump to content

Dzuchun

Members
  • Posts

    98
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dzuchun

  1. A number 1 you pass here is actually double and defines movement speed multiplier. Resulting movement speed will equal to speed attribute * this parameter, as shown at MovementController::tick. So, you may try change 1 to 1.0d, and then set there, for example, 2.0d.
  2. I think, this name should include your mod id (not sure) May you look down in spectator mode? I wonder, if they are generated underground. Here is obvious problem with placement config, I can't even find, where you specify it. Vanilla makes it in DefaultBiomeFeaturesClass: (mapping may differ, so I'll use some common descriptions) Look at public static final StructureFeature<VillageConfig, ? extends Structure<VillageConfig>> objects initialization. If fact, they are defined as method output of some field at class Structure. And this field is public static final Structure<VillageConfig> object, in it's definition you may see some mention of surface. So, where do you specify placement config? Read sign.
  3. You may check manually, these files exist in linked libraries? If they're not, they obviously should.
  4. I want to add some additional sounds, to be played with ambient vanilla sounds. Here's what I found at SoundEvents class: public static final SoundEvent AMBIENT_CAVE = register("ambient.cave"); and same for all other sounds. Inside register method parsed string used to create ResourceLocation and add SoundEvent with it to Registry. So, it looks like any sound file that corresponds to SoundEvent with ResourceLocation "minecraft:ambient.cave" will be played as ambient sound at caves. So, I looked through description of sounds.json file at gamepedia, and now have an idea: If create minecraft folder in my mod assets folder, it's namespace would be "minecraft", right? Then, if I put sounds.json file there that links some my sound files to "ambient.cave", their ResourceLocation would be "minecraft:ambient.cave", right? If so, will they be used by minecraft as ambient sounds? Is it a correct way to do that? Is it okay to even create minecraft folder inside your mod assets folder? Would be graceful for any help.
  5. https://forums.minecraftforge.net/topic/61757-common-issues-and-recommendations/?do=findComment&comment=289980
  6. Tip: This is a class and row, exception occurred at, so you may analyze what exactly happened. Please, share your project with GitHub, for precise help. Read sign.
  7. https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/ + Java knowledge.
  8. Oh, that's sad:( But yeah, == is likely to not work here.
  9. Probably you should use ItemStack::equals for comparing itemstacks
  10. Please, explain what exactly you want to do, "this" is final.
  11. Forge has two event buses: 1) Mod event bus for registration and all other initialization 2) Forge event bus for everything else. It seems like you subscribed to Mod bus, so your init and related events are fired, but nothing else.
  12. You may open type hierarchy and see that both LavaFluid, WaterFluid and ForgeFlowingFluid are extending FlowingFluid which extends Fluid itself. I think, ForgeFlowingFluid is the one you should extend, but read sign. EDIT: Actually, it looks like you may not extend ForgeFlowingFluid for some basic cases. It may work same as creating a primitive item (without separate class).
  13. PlayerInventory#addItemStackToInventory 's javadoc: "Adds the stack to the first empty slot in the player's inventory. Returns {@code false} if it's not possible to place the entire stack in the inventory."
  14. Thanks, that worked. Here is my code: @SubscribeEvent public static void onRenderGameOverlayText(RenderGameOverlayEvent.Text event) { if (Minecraft.getInstance().gameSettings.showDebugInfo) { //Otherwise string is displayed all the time event.getLeft().add("Placeholder string"); //You may add empty string to insert a gap in overlay } } P.S.: I definitely should refresh my java knowledge.
  15. *bla-bla-bla, I don't know java* (skip this post) So, to change a text I should catch mentioned event and... what's next? As I can see, there is no method to add more data... Should I use reflect to modify these fields? I'm afraid even that won't work, because they're not used further in render, are they? I could render my info separately, but if possible better do it in featured way, right?
  16. I want to add some extra debug info to overlay that open on F3 press. I believe, ForgeIngameGui.GuiOverlayDebugForge class is somehow related to this, but I can't figure out what exactly should I extend (mentioned class is private) and how do I register my class to be initialized and taken information for displaying. Appreciate for any help provided!
  17. This actually renders nothing. Superclass method renders name label, as I understood, so I predict your entity is not rendered at all. There are two ways how to render things (they do the same, but differ at usage). 1) Create a model for your entity. Model should have a separate render method which invokes ModelRenderer#render, that actually does rendering. Advantage: you may not perform rendering itself; drawback: you'll need to understand how this all works (but that's easy with a ton of examples from vanilla Minecraft and some experimenting). 2) Preform rendering with "bare hands" - using GL11 methods directly or some predefined sequences. Advantage: you may render most mind-blowing things that could ever come to your head; drawback: you'll need to study OpenGL a bit (well, depends on rendering complexity). Read sign.
  18. How would server encode your message, if you did not registered it on server? To send packet from server to client both sides should know that this message exists. If you want to specify network direction of the message, then this method: has a variant with Optional<NetworkDirection>, which does what you need as I believe.
  19. You may see all the events with checking Event class implementations in your IDE.
  20. To check this, search your log for "FileNotFound" string. Likely will output only FileNotFoundException's stacktraces. All you need is to check comments after each - if minecraft can't find some texture that he needs, there would be a report about it. You will likely find one about version checker file, don't care about that.
  21. You may look through implementations of EntityEvent, probably you will find something useful in your situation. Also, I think, entities move once per tick, so you may just check for collisions manually in [Something]TickEvent. (but better use some pre-defined event, if it exists of course)
  22. If you want to apply an effect, use Item#onItemUseFinish, that works fine. But don't forget to check if you're on server - otherwise you'll get infinite ghost effect with zero duration left. I attach source of my pineapple item class, which has a stacking speed effect. (Whould be appreciate for any suggestions how to improve it as well) PineappleBlockItem.java P.S.: Now I don't use static fields as I do here.
  23. Also you may need to disable gravity with Entity#setNoGravity, so you could ignore stock gravity applied to FallingBlockEntity,
  24. Also using Minecraft and other classes, methods, valiables marked with "@OnlyIn(Dist.CLIENT)" annotation on physical server will result in a crash.
  25. I need to perform custom rendering, and I can't even explain how custom it is. Anybody know a good documentation on minecraft render system?
×
×
  • Create New...

Important Information

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