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


  • Posts

  • Joined

  • Last visited

Everything posted by skip999

  1. Hello, I am having an issue with NBT loading. Currently, I have machines that load FluidTank(s) during the onLoad() method, as they need to reference the recipe JSONs. The data loads (as I am able to see it via the guis), however I have encountered an issue that I can't seem to explain. The tanks are there, however nothing can interact with them. For example, if I have water in the tank and disconnect/reconnect to a world, the water will still be there, but I am unable to add any more to the tank, even if there's sufficient room. I have noticed that I can output fluids via a pipe, meaning the fluids can be accessed via the CAPABILITY_FLUID_HANDLER. I believe this is an issue with updating the TileEntity some how, but I would not know where to start. I have linked to the relevant methods on my github. Let me know if I need to provide any more information. >NBT reading: https://github.com/skiprocks999/Electrodynamics-Fork/blob/c426dc744452ca401fc7d6248ffe35373169c5d0/src/main/java/electrodynamics/prefab/tile/components/type/ComponentFluidHandler.java#L253 >Tile Entity Data Loading: https://github.com/skiprocks999/Electrodynamics-Fork/blob/c426dc744452ca401fc7d6248ffe35373169c5d0/src/main/java/electrodynamics/prefab/tile/GenericTile.java#L124 >Bucket Filling/Outputting to pipe: https://github.com/skiprocks999/Electrodynamics-Fork/blob/c426dc744452ca401fc7d6248ffe35373169c5d0/src/main/java/electrodynamics/prefab/tile/components/type/ComponentProcessor.java#L224
  2. Hello, I am looking at trying to combine three separate projectiles into one as they share a lot of redundancy. However, I need to know a little bit more about how the three constructors of the ProjectileItemEntity class are called by the game. Currently, the three constructors are: >public ProjectileItemEntity(EntityType<? extends ProjectileItemEntity> type, World worldIn) >public ProjectileItemEntity(EntityType<? extends ProjectileItemEntity> type, double x, double y, double z, World worldIn) >public ProjectileItemEntity(EntityType<? extends ProjectileItemEntity> type, LivingEntity livingEntityIn, World worldIn) I know that you are able to call one of these three in your CustomProjectile class when you when you want to summon an entity (say firing one from some sort of custom weapon). However, is this the ONLY time these constructors will be called, or will the server call one of them when say loading one from memory or rendering in a chunk? Before I start tinkering under the hood, I want to make sure I don't break the engine as it were. Thanks in advance!
  3. Hello, I have been running into a small issue while updating to ForgeGradle 5.1+ . I have been using:compile fileTree("C:/AmpzLibz") in my dependencies section of my build.gradle like so: to import various local jars that I use in making my mod. However, upon using this in gradle 5.1, I am greeted with the following error: I imagine the keyword to add local files has changed, but I wouldn't know where to look for it. If anyone could let me know what it's changed to or where to look, I would really appreciate it.
  4. Hello, I have been attempting to make a custom armor equip sound for a set of custom armor that I have made. I have registered the sound properly, but I have run into a problem: even though the sound is registered before the armor items are, the sound is returning as null for some reason. I know the sound works and is set up properly, so it must be something with registration. I have attached the crash report as well as linked the relevant classes from my github: Armor Type: https://github.com/skiprocks999/Electrodynamics-Fork/blob/01b65b032b3cce7c5b5e71485af1c2f24e7874a3/src/main/java/electrodynamics/common/item/gear/armor/types/composite/CompositeArmor.java#L10 Sound Registry: https://github.com/skiprocks999/Electrodynamics-Fork/blob/01b65b032b3cce7c5b5e71485af1c2f24e7874a3/src/main/java/electrodynamics/SoundRegister.java#L13 Item Registration: https://github.com/skiprocks999/Electrodynamics-Fork/blob/01b65b032b3cce7c5b5e71485af1c2f24e7874a3/src/main/java/electrodynamics/DeferredRegisters.java#L300 Registry Registration in Mod Class: https://github.com/skiprocks999/Electrodynamics-Fork/blob/01b65b032b3cce7c5b5e71485af1c2f24e7874a3/src/main/java/electrodynamics/Electrodynamics.java#L59 I imagine I'll kick myself when the problem is found. Any help would be appreciated! crash-2021-08-01_09.58.28-fml.txt
  5. I got it figured out. I needed to copy the model angles of the biped groups to the various parts in my render method.
  6. I didn't know ActionResult worked like that. Fixed it now. Thanks!
  7. Hello, I have run into an problem that I can't seem to solve. I have implemented a custom tool that I have overwritten the onRightClick method for. The item works fine when I use it in the main hand, but when I use it in the offhand/shield slot, the game copies whatever is in the main hand to the offhand. I am not sure why this is happening, as I have no code that does such a thing. The problem only occurs when it is in the offhand too, which is what confuses me. I have linked the code on my github. Any help would be appreciated! Relevant code: https://github.com/skiprocks999/Electrodynamics-Fork/blob/c68f5c93949c3fe0549ce4eecbcdbe55fe0e5305/src/main/java/electrodynamics/common/item/gear/tools/electric/PlasmaRailGun.java#L29
  8. In other words the various parts do not move with the player. Instead of behaving like the vanilla armor for example, it instead behaves like this: I was under the impression that adding the various armor parts as children to the various biped parts would do this, but this does not seem to be the case. I linked the whole render class in my first post, but I have also included a screenshot of the code:
  9. Hello, I have been trying to implement a custom armor model for a set of armor I'm making. The model is rendering correctly, however the armor pieces are not binding to the player. I am not sure why as from what I can tell from the limited resources on it, I am doing it correctly. I have linked to the rendering method as well as the rendering class. Any help would be appreciated! Rendering Method: https://github.com/skiprocks999/Electrodynamics-Fork/blob/c68f5c93949c3fe0549ce4eecbcdbe55fe0e5305/src/main/java/electrodynamics/common/item/gear/armor/types/composite/CompositeArmorItem.java#L89 Rendering Class: https://github.com/skiprocks999/Electrodynamics-Fork/blob/1.16.5/src/main/java/electrodynamics/common/item/gear/armor/types/composite/CompositeArmorModel.java
  10. Hello, I have been working on rendering a custom projectile entity for an item I have been working on. I have gotten the entity to render how I need it to, except for one small problem: it is not orienting to the direction of the player's camera. I have tried playing around with various rotation Quaternions for the Matrix Stack, but to no effect. The closest I got was having the rotation be based on the player's camera orientation. This gives the entity the initial orientation that I want, but the problem is then that the projectile will always be rendered like that. I know there is a way to do this , but I can't seem to find it. Any help is greatly appreciated! Link to the rendering code on github: https://github.com/skiprocks999/Electrodynamics-JEI-Integration/blob/81298f23b4e40b2dc18aaccd4da6c81a93628557/src/main/java/electrodynamics/client/render/entity/RenderMetalRod.java#L29
  11. Okay this is working perfectly. However, I get this cursed image when I run my code: I've tried calling different drawString variants, but to no avail. Here is the code I am using: @SuppressWarnings("resource") @SubscribeEvent public static void renderRailgunTooltip(RenderGameOverlayEvent event) { ItemStack gunStackMainHand = Minecraft.getInstance().player.getItemStackFromSlot(EquipmentSlotType.MAINHAND); ItemStack gunStackOffHand = Minecraft.getInstance().player.getItemStackFromSlot(EquipmentSlotType.OFFHAND); if(gunStackMainHand.getItem() instanceof AbstractRailgun) { renderHeatToolTip(event, gunStackMainHand); }else if(gunStackOffHand.getItem() instanceof AbstractRailgun) { renderHeatToolTip(event, gunStackOffHand); } } @SuppressWarnings("static-access") private static void renderHeatToolTip(RenderGameOverlayEvent event, ItemStack stack) { Minecraft minecraft = Minecraft.getInstance(); ItemElectric railgun = (ItemElectric)stack.getItem(); ITextComponent text = new StringTextComponent("Temperature: " + railgun.getTemperatureStored(stack) + " C").mergeStyle(TextFormatting.YELLOW); minecraft.currentScreen. drawString(event.getMatrixStack(), minecraft.fontRenderer, text, text.getString().length(),0,0); }
  12. Okay taking a look at that, that's more along the lines of what I need. However, I now have a problem in that I have no way of getting at the item in the player's inventory. What would I need to call in order to accomplish that?
  13. Hello, I have been working on a custom tool. One of it's properties is that it has a temperature. I have this displayed in the item's tooltip, but I would also like to display it to the player's screen for ease of use. I was recommended to look into the RenderTooltipEvent, but I was unable to find anything in the event or it's sub classes that would actually enable me to accomplish this. Am I looking at the wrong event, or am I simply missing something. Thanks in advance!
  14. Wait nvm found it. Didn't realize RenderTooltipEvent had some classes contained within it.
  15. I am also running into another issue: I need an instance of Screen in order to call the renderToolTip method. How would I get that from the event?
  16. Okay one final quesiton: How would I get either an instance of IReorderingProcessor or an instance of ITextComponent from an instance of ITextProperties? I took a look around the available method calls and couldn't find one that worked.
  17. Would I tag the class with @OnlyIn(Dist.CLIENT) for the event handler? Or would I configure it as normal?
  18. well to call Screen.renderToolTip() I need to pass in an instance of MatrixStack as one of the parameters
  19. Okay my only question is how do I get an instance of MatrixStack while in the addInformation() method?
  20. Hello, I would like to display some text on the player's screen (like when an item is scrolled over, only permanently) when a certain condition is met. I know how to add a tooltip via overriding the addInformation() method, and I imagine it is done through that method. However I have no idea what to call. Thanks in advance!
  21. Hello, I have been attempting to render a custom model for my armor. I have created the model in blockbench and have generated the texture mapping for it. However, the java class that block bench generates is not mapping properly to the player nor the texture map that comes along with it. I cannot seem to understand why. My only thought is that since block bench generates the class as extending EntityModel and not as Extending BipedModel, the shapes it makes are some how incorrect. I have attached the relevant classes as well as the class that BlockBench generates. Any help would be appreciated! link to render class: https://github.com/skiprocks999/Electrodynamics-JEI-Integration/blob/1.16.5/src/main/java/electrodynamics/common/player/armor/types/composite/CompositeArmorModel.java link to armor item class: https://github.com/skiprocks999/Electrodynamics-JEI-Integration/blob/448ecc8e849b42f03074c9a0bd0a03af3b5fd95a/src/main/java/electrodynamics/common/player/armor/types/composite/CompositeArmorItem.java#L76 CompositeArmorModel.java
  22. I swapped it to use the getPosition() option instead of the chunk coords and that worked. I appreciate the help. Events and Sounds are things I haven't worked with before. so I'm learning as I go as it were
  23. This is the if statement in the LivingHurtEvent method if(event.getAmount() >= LETHAL_DAMAGE_AMOUNT && h.getPlateCount() > 0) { event.setAmount((float) Math.sqrt(event.getAmount())); h.setPlateCount(h.getPlateCount() - 1); event.getEntityLiving().getEntityWorld().playSound( null, event.getEntityLiving().chunkCoordX, event.getEntityLiving().chunkCoordY, event.getEntityLiving().chunkCoordZ, SoundRegister.SOUND_CERAMICPLATEBREAKING.get(), SoundCategory.PLAYERS, 1, 1); }
  24. I've tried using variant where you pass in null for the player, but that also didn't work. I forgot to mention that.
  • Create New...

Important Information

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