Jump to content

DrNickenstein

Members
  • Posts

    49
  • Joined

  • Last visited

  • Days Won

    1

DrNickenstein last won the day on February 13 2023

DrNickenstein had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DrNickenstein's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. What would the best way to make an entity emit light be? There doesn't seem to be a way similar to how light source blocks work
  2. Hello, I want my entity to drink a potion at some point. I took a look at the Witch's code but I couldn't really identify which part of it makes the entity drink the potion. Help would be much appreciated!
  3. Hello Oh I didn't know that sir The currentTime is there because I thought it would be more readable if I had that instead of always doing level.getGameTime. it doesn't matter that it's a mutable variable in a singleton since the game time is the same for everything anyway. I can remove it though if if really is useless Hmmm in this case may I also just check if it's on the server and then do the same logic? I read a little into that Capability thing and it's not quite clear what that is for but I'll look into it properly later, it may be useful, thanks
  4. Hello, I'm experiencing an issue with two tags of mine changing their value apparently randomly. We're talking about a long and a boolean. Moreover, it appears that both values are getting changed OUTSIDE of my code, perhaps meaning something is happening in the vanilla code. The idea here is that a special ability for the armour can to be activated through a key bind every 180s (3600 ticks) lasting for only 10 seconds (200 ticks). However, it's not key bindings I'm having issues with, the problem I'm having is with the lastUsage and isEffectActive tags which seem to be changing, somewhere, somehow. Here is the class where most of the logic is happening: https://github.com/DrNickenstein/Rework-mod/blob/main/src/main/java/io/github/drnickenstein/reworkmod/items/wearables/armour/AmethystChestplate.java Here is the class where everything starts, calling the activateEffects method of the class: https://github.com/DrNickenstein/Rework-mod/blob/main/src/main/java/io/github/drnickenstein/reworkmod/handler/ClientForgeHandler.java And here is the latest.log: https://pastebin.com/MZdDK3sz Particularly, this is the section of the log where I'm printing the value of the isEffectActive tag and as you can see the way it is changing is quite odd. key pressed set is full Effect applied. tick start, isEffectActive: false tick end, isEffectActive: false activateEffects call ending. true tick start, isEffectActive: true Invulnerability set isEffect active if, isEffectActive: true tick end, isEffectActive: true tick start, isEffectActive: true Invulnerability set isEffect active if, isEffectActive: true tick end, isEffectActive: true tick start, isEffectActive: true Invulnerability set isEffect active if, isEffectActive: true tick end, isEffectActive: true tick start, isEffectActive: false tick end, isEffectActive: false tick start, isEffectActive: false tick end, isEffectActive: false tick start, isEffectActive: true Invulnerability set isEffect active if, isEffectActive: true tick end, isEffectActive: true tick start, isEffectActive: false tick end, isEffectActive: false tick start, isEffectActive: true Invulnerability set isEffect active if, isEffectActive: true tick end, isEffectActive: true tick start, isEffectActive: false tick end, isEffectActive: false tick start, isEffectActive: true Invulnerability set isEffect active if, isEffectActive: true tick end, isEffectActive: true tick start, isEffectActive: true Invulnerability set isEffect active if, isEffectActive: true tick end, isEffectActive: true tick start, isEffectActive: false tick end, isEffectActive: false tick start, isEffectActive: false tick end, isEffectActive: false If there is anything I could optimize/do in a better way or anything I should specify, please let me know Thanks in advance!
  5. I tried just changing the texture's alpha but as expected it did not work at all so I was wondering at this point how something like that would work.
  6. Nevermind that variable has to be static for the reason you wrote, that should fix it
  7. That's weird because I got that code from the forge wiki. Where should I create it? Are there specific forge registries for this?
  8. I'm creating the arm pose elsewhere and I didn't think it was involved in the error since it was always there and this issue only showed up now. Anyway, this is it: https://gist.github.com/DrNickenstein/db36043cb2f8d91a6f272c2834409444 This code is located in my item class. Initially I thought it had something to do with the pose index in the switch or something like that but then it is out of my comprehension why that wouldn't be a consistent error. As I said, it is in fact an exception that isn't getting thrown every single time. It's not uncommon either though if that can help
  9. After a few tries rendering the left arm on the screen together with someone from here I finally got it to work (it renders correctly) but when I right click to use my item, under certain circumstances unknown to me, an index out of bounds exception is thrown. In the following code, line 83 is the renderer#renderLeftHand method call. Looking at the methods in the stack trace, it looks like the issue might be the player parameter as it is the only one in common with said methods until the end. Should I get the player in some other way? I can't get it from the event directly. Is it another issue that I didn't catch? The event hook is the following: https://gist.github.com/DrNickenstein/d89af6a1ced023b9b017b2510d1fcd81 The latest log is this one: https://pastebin.com/myF5ZBj0
  10. Oh, thank you, it works now! Although I didn't really understand what I was doing wrong before, is it the fact that canceling the event nullifies all of the changes vanilla normally applies to the arm or is there something else I should understand?
  11. I copied the function and edited the variables that I couldn't get (swingProgress and equippedProgress), trying to replicate what they would be from my understanding. The arm is moving differently now but it's still twitching, moving around and then disappearing. Would using an AT make sense here to change the access modifier of renderPlayerArm or not? @SubscribeEvent public void renderInjectedArm(RenderArmEvent event) { AbstractClientPlayer player = event.getPlayer(); MultiBufferSource source = event.getMultiBufferSource(); PoseStack poseStack = new PoseStack(); int combinedLight = event.getPackedLight(); Minecraft minecraft = Minecraft.getInstance(); Item mainHandItem = player.getMainHandItem().getItem(); ItemStack offHandItem = player.getOffhandItem(); PlayerRenderer renderer = (PlayerRenderer)minecraft.getEntityRenderDispatcher().getRenderer(player); if(event.getArm() == HumanoidArm.RIGHT && mainHandItem instanceof EndiriumMetalSyringe && offHandItem.isEmpty()) { float partialTicks = minecraft.getPartialTick(); float equippedProgress = partialTicks - Mth.lerp(partialTicks, 1, 1); float f = -1.0F; float f1 = Mth.sqrt(partialTicks); float f2 = -0.3F * Mth.sin(f1 * (float)Math.PI); float f3 = 0.4F * Mth.sin(f1 * ((float)Math.PI * 2F)); float f4 = -0.4F * Mth.sin(partialTicks * (float)Math.PI); poseStack.translate(f * (f2 + 0.64000005F), f3 + -0.6F + equippedProgress * -0.6F, f4 + -0.71999997F); poseStack.mulPose(Axis.YP.rotationDegrees(f * 45.0F)); float f5 = Mth.sin(partialTicks * partialTicks * (float)Math.PI); float f6 = Mth.sin(f1 * (float)Math.PI); poseStack.mulPose(Axis.YP.rotationDegrees(f * f6 * 70.0F)); poseStack.mulPose(Axis.ZP.rotationDegrees(f * f5 * -20.0F)); RenderSystem.setShaderTexture(0, player.getSkinTextureLocation()); poseStack.translate(f * -1.0F, 3.6F, 3.5F); poseStack.mulPose(Axis.ZP.rotationDegrees(f * 120.0F)); poseStack.mulPose(Axis.XP.rotationDegrees(200.0F)); poseStack.mulPose(Axis.YP.rotationDegrees(f * -135.0F)); poseStack.translate(f * 5.6F, 0.0F, 0.0F); renderer.renderLeftHand(poseStack, source, combinedLight, player); poseStack.popPose(); System.out.println("Left arm rendered"); } } This is my code right now in case it's needed
  12. Oh yeah in that case that could be it I need rendering because normally the left arm is not rendered in first person when holding an item, correct? I could render it only when using the item, sure, but still it's not meant to move or be animated at all, I wanted to just render it on the left side of the screen.
  13. Ok this would make sense if I was either using the item, attacking or swinging my arm. In this case, I'm not, so why is the arm moving? And if that determines an animation, where should I put the code to move the arm so that it doesn't move?
  14. I don't think I understand: in the clip I'm not swinging my arm at all and it should not be moving at all, I thought translating the poseStack would just translate my arm not animate it? Edit: To be clear: my question is, why on earth is the arm moving and then disappearing?
  15. Glad it was useful
×
×
  • Create New...

Important Information

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