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 (2/8)
2
Reputation
-
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
-
Compound Tags apparently being reset randomly
DrNickenstein replied to DrNickenstein's topic in Modder Support
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 -
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!
-
[1.19.3] Confusing index out of bounds exception
DrNickenstein replied to DrNickenstein's topic in Modder Support
Nevermind that variable has to be static for the reason you wrote, that should fix it -
[1.19.3] Confusing index out of bounds exception
DrNickenstein replied to DrNickenstein's topic in Modder Support
That's weird because I got that code from the forge wiki. Where should I create it? Are there specific forge registries for this? -
[1.19.3] Confusing index out of bounds exception
DrNickenstein replied to DrNickenstein's topic in Modder Support
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 -
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
-
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
-
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.
-
Tooltip not showing up or is invisible
DrNickenstein replied to ClaraArmada's topic in Modder Support
Glad it was useful