Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. Your errorlog doesn't match your code at all. As for the code you've provided: Don't extend Gui on your event handler class, that makes no sense. The resourcelocation currently points to assets/minecraft/vezythieme/vezy.png. if (e.getType() != null) { if (e.getType() == ElementType.TEXT) The first check is redundant. If the type is TEXT it can't be null. RenderGameOverlayEvent is a parent class for Pre and Post events. Pick the one you need. However that doesn't matter since your error log indicates that the code you are using is completely different. Make sure the file is actually there. Check that it isn't test.png.png or something like that, check that eclipse isn't being a derp and is actually including your resources, etc. A screenshot of the file in your folder structure would also help.
  2. This is not entirely true. https://stackoverflow.com/questions/3301635/change-private-static-final-field-using-java-reflection In fact I am pretty sure I saw similar code in forge at some point. Doing this is not a good idea though. "In some cases they are better than reflection. That is in ALL of access cases." There is nothing wrong with using reflection and you should prefer reflection to ATs in most cases IMO. Use ATs if your reflective operation is too expensive(eg. called multiple times a frame).
  3. As I've said Your file isn't horse_armor_wood. It's horse_armor_wood.png(I presume anyway since you have file extensions hidden it may be any other image extension - and it has an image extension because it has an image thumbnail).
  4. What is "ctx associated with this type of textures"? Show what you've tried.
  5. This would not work since new Block() != new Block(). You must pass the same object to the ItemBlock that you have registered, not an identical one. https://mcforge.readthedocs.io/en/1.13.x/concepts/registries/#injecting-registry-values-into-fields
  6. Instantinate in the registry event. event.registerAll(new BlockA(), new BlockB(), new Block(Material.IRON).setRegistryName(...), new ...) One of the many reasons I chose a different IDE...
  7. Your system will not work. Registry entries MUST be instantinated in the appropriate registry event, now more than ever. Don't ever use static inializers for registry entries. Rework this right now, before it gets too big. You will also make your code much more readable and will write way less code. The code in your repository doesn't match the code you've posted. So yeah, fix the static initializer issue first, then I can debug your repository.
  8. Thanks. Override Block#isFullCube and return false. For propagating light either override Block#isOpaqueCube or Block#propagatesSkylightDown and return false.
  9. The title of your post suggests you are using 1.14.2. Please clarify what version are you actually using. And whether you are using forge at all. This has nothing to do with the model file of either of the blocks. OP just needs to override Block#isFullCube and Block#isOpaqueCube to return false.
  10. Where'd you get 1.14 forge from?
  11. https://github.com/JGgithub2018/Simple-Batteries/blob/master/src/main/java/jgcodes/sb/SimpleBatteries.java#L24 A common proxy makes no sense. Proxies exist to separate sided-only code. If your code is common then it goes anywhere else but the proxy. https://github.com/JGgithub2018/Simple-Batteries/blob/master/src/main/java/jgcodes/sb/content/ModBlocks.java#L15 Don't ever use static initializers for registry entries. They must be instantinated in the appropriate registry event. This is not how ObjectHolders are used. ObjectHolders inject values into fields. https://github.com/JGgithub2018/Simple-Batteries/blob/master/src/main/java/jgcodes/sb/proxy/CommonProxy.java#L21 Your proxy can't be an event handler since it will load the class and crash the game. https://github.com/JGgithub2018/Simple-Batteries/blob/master/src/main/java/jgcodes/sb/content/blocks/BlockBase.java Don't do XBase. There is already a BlockBase, it's called Block. Do not abuse inheritance. Your issue is caused by you not setting the registry name for your blocks/items. You need to set the registry name before registering them.
  12. Just send the value as you change it. I doubt sending 4 bytes per tick is much overhead.
  13. LivingAttackEvent allows you to cancel the damage alltogether, with the effects. If you want to only cancel the effects then it's more tricky. You would need to use a tick handler and basically do the reverse of what the EntityLivingBase#attackEntityFrom does to the entity that took damage that you caught in this event.
  14. Don't hijack old threads. Make your own, especially since your issue is unrelated to the one OP once had. You put these in your block class of course.
  15. There are a bunch of swingX fields in the EntityLivingBase class. You would need to look at what the game does with those fields to play the animation and do the reverse.
  16. A supplier would just give you a thing every time you asked it for one. In most cases it would be a new instance of said thing. A LazyWhatever would work in this way when asked for a thing - it would check if it has initialized it, if not it would do so, and then return the thing stored in it, thus only initializing/evaluating it once. Lazy is usually used for expensive operations that should only be done once.
  17. If it's a soft dependency then nothing changed apart from Loader.isModLoaded => ModList.get().isLoaded() A hard dependency would be defined in your mods.toml file. There are already 2 examples of that in a default mods.toml provided by the example mod.
  18. With the current parameters you are passing to the method the game would look for your textures in assets/modid/horse_armor_wood. Pass an actual texture path to your second parameter.
  19. Capability data isn't synced by default. You need to use the NBT share tag to sync it.
  20. Subscribe to a HarvestDropsEvent, then add/remove the drops from the drops list provided to you by HarvestDropsEvent#getDrops.
  21. LivingHurtEvent, LivingDamageEvent, etc. Check for the distance and the source yourselves. I am not sure there is such an event. You could still use one of the damage events to cancel the damage and just reset the cooldown/animation.
  22. Don't hijack old threads, make your own. This wouldn't be in the main mod class, it would be in the event handler.
  23. While it is true that the default jvm won't load classes unless it is required it isn't the only JVM in existance.
  24. https://github.com/GloriousAlpaca/Leer/blob/master/Void Mod/src/main/java/mod/leer/network/VoidcomReturnMessage.java#L63 Well, you are returning the same packet as a response packet to send back, which will return itself as a response packet to send back ....... rince, repeat and you have a memory leak. Return null if you don't want to send a response packet. https://github.com/GloriousAlpaca/Leer/blob/master/Void Mod/src/main/java/mod/leer/network/VoidcomReturnMessage.java#L62 You can't do this. Minecraft is a client only class and as such this code will crash the server. https://github.com/GloriousAlpaca/Leer/blob/master/Void Mod/src/main/java/mod/leer/network/VoidcomReturnMessage.java#L66 But WHY if you are the owner of these classes? Why would you use reflection on your own classes when you can just create a setter?
×
×
  • Create New...

Important Information

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