Jump to content

theishiopian

Members
  • Posts

    150
  • Joined

  • Last visited

Everything posted by theishiopian

  1. I have been attempting to make a spear for my mod, and up until now everything had been going fairly well by using the trident as a guide. The problem is that I absolutely cannot get the entity to render. As in, at all. I am registering the renderer, and I've confirmed the event is being called for it. @OnlyIn(Dist.CLIENT) public void ClientSetup(FMLClientSetupEvent event) { if(Config.flailEnabled.get())ModItems.RegisterFlailOverrides(); MinecraftForge.EVENT_BUS.addListener(ClientEvents::OnClick); MinecraftForge.EVENT_BUS.addListener(ClientEvents::OnKeyPressed); RenderingRegistry.registerEntityRenderingHandler(ModEntities.SPEAR.get(), RenderSpear::new); } The other 3 lines here work perfectly. Here is the renderer: public class RenderSpear extends EntityRenderer<SpearEntity> { public RenderSpear(EntityRendererManager manager) { super(manager); } @Override public void render(SpearEntity spearEntity, float yaw, float partialTicks, MatrixStack matrix, @NotNull IRenderTypeBuffer buffer, int light) { System.out.println("the funny"); matrix.pushPose(); //todo: translate/rotate/scale matrix Minecraft mc = Minecraft.getInstance(); mc.getItemRenderer().render(spearEntity.spearItem, ItemCameraTransforms.TransformType.FIXED, false, matrix, buffer, light, OverlayTexture.NO_OVERLAY, mc.getItemRenderer().getModel(spearEntity.spearItem, spearEntity.level, null)); matrix.popPose(); } @Override public ResourceLocation getTextureLocation(@NotNull SpearEntity entity) { return null; } } The println at the top does not print, proving this method is not being called. The entity itself works fine, I can throw it and deal damage just like a trident. It just won't render.
  2. I am attempting to add config entries for disabling items from being loaded. When I attempt to change the config however (with the game closed) not only does it not work, but the entries are erased from the .toml, and the first entry after the new entries is also removed. Config class: https://pastebin.com/67b9Ytf7 The config file is attached, with different versions for the default, the edited one, and the broken one. The entries i edit are the first three, which i set to false. Notice how even the fourth entry is deleted, despite not being edited. Log: https://pastebin.com/d0bKF4Pa I already saw the 4 lines about the file being changed, but i have no idea what is changing it. parrying-common BEFORE LOAD.toml parrying-common BEFORE LOAD EDITED.toml parrying-common AFTER LOAD.toml
  3. I am attempting to make a weapon with a custom attribute, in this case armor penetration. Everything has made sense so far, except that the attribute map on the item requires a UUID, which from what i can tell, is just preset at random. My current constructor looks like this: public WeaponMace(IItemTier tier, Properties properties, float baseDamage, double speed, int armorPen) { super(tier, properties); Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder(); float attackDamage = baseDamage + tier.getAttackDamageBonus(); builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Weapon modifier", attackDamage, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Weapon modifier", speed, AttributeModifier.Operation.ADDITION)); builder.put(ModAttributes.ARMOR_PENETRATION.get(), new AttributeModifier(UUID.fromString("c7675e5c-2e25-4589-ace1-f0ad816b40b8"), "Weapon modifier", armorPen, AttributeModifier.Operation.ADDITION)); this.defaultModifiers = builder.build(); } Is this an ok way of doing this?
  4. Holy crap that actually worked! Thank you very much, I haven't seen hurtMarked documented or used anywhere!
  5. Absolutely! You're in luck, I have a git repo. I added comments in the problem section, the offending code is in EventHandler.java Repo: https://github.com/theishiopian/Parrying
  6. This is a follow up to an earlier post about not being able to use the knockback method. Well, since then I've learned a bit more about the nature of my problem. It turns out that knockback DOES work, but the catch is if I cancel the LivingAttackEvent that I'm calling the code from, then all attempts to modify the velocity of the player are nullified, even if i extract the mojang knockback code and reuse it (which I don't want to do in the long run, for legal reasons). As soon as I stop canceling the event, the knockback works. Unfortunately, I NEED to cancel the event, since its the whole point of the mod. What could be causing this interaction???
  7. Yes, I know I wasn't using it correctly, that is extremely unhelpful. Fortunately, I was able to figure it out. turns out you have to pass null as the entity argument, which the docs don't do a good job of explaining.
  8. I can't seem to get a sound to play. Code is: player.getLevel().playSound(player, player.blockPosition(), SoundEvents.SHIELD_BLOCK, SoundCategory.PLAYERS, 5, 1); "player" is of type ServerPlayerEntity. I know this code is being called, but no sound is playing.
  9. I am attempting to knock the player in a direction, but cannot seem to figure out how to do it. im using the latest mdk, I've tried "entity.knockback()", "entity.push()" and even "entity.setDeltaMovement()" and nothing seems to work. What is the best way to apply knockback in a direction?
  10. Ok, we've found the culprit! The current version of Atum 2 has some leftover debug code, it's been fixed on their end. Hopefully a release with the fix will be out soon. Thank you for the modlist, that really helped narrow it down.
  11. Thank you for your help. We will cross reference our mod list with yours and see if that narrows it down
  12. yeah, ill send you the changelog: https://www.curseforge.com/minecraft/modpacks/arcanes-pack/files/2801127 We searched through all the mods that got updated, and none of them have calls to System.out.println(); that just print numbers. We found one in enderio, but removing it did not fix the issue.
  13. WHOOPS, I goofed. Heres the real one: https://gist.github.com/RealArcanePhysics/2fda41362f697958cff78375b1fc5733
  14. Here is debug.log: https://gist.github.com/ As well as latest.log: https://gist.github.com/RealArcanePhysics/4ac44e336074c106e86e0090a86567db Please note that the 50s don't show up in either, they only appear in the server console.
  15. Greetings, not sure if this is the right place for this, but I need some modding experts to help with a peculiar phenomenon. My friend runs a modded server and recently updated the pack, which can be found here: https://www.curseforge.com/minecraft/modpacks/arcanes-pack After the most recent update, the console has started spamming the number "50". Thats it, nothing else, just 50. It happens whenever anyone places a block. We are searching the added mods for the cause, I'd guess its some sort of debug code, but in the mean time has anyone else had this happen?
  16. Alright, I figured it out. you need to call ConfigManager.synch(). The forge docs link a great example that really helped.
  17. I'm trying to use the annotation based config system that forge offers, but the changes don't seem to be saved after a game restart. Is there an extra step I have to do to save the changes to the file? My config class: @net.minecraftforge.common.config.Config(modid = MODID) public static class Config { @RequiresMcRestart @RangeInt(min = 0) @Comment({"The duration of the non-extended immortality potion, in ticks","§eThere are 20 ticks to a second in Minecraft"}) public static int immortalityDurationShort = 200; @RequiresMcRestart @RangeInt(min = 0) @Comment({"The duration of the extended immortality potion, in ticks","§eThere are 20 ticks to a second in Minecraft"}) public static int immortalityDurationLong = 400; @RequiresMcRestart @RangeInt(min = 0) @Comment({"The minimum nuber of tries the world generator gets","§ewhen trying to generate philosopher's stone ore"}) public static int minGen = 64; @RequiresMcRestart @RangeInt(min = 0) @Comment({"The minimum nuber of tries the world generator gets","§ewhen trying to generate philosopher's stone ore"}) public static int maxGen = 256; }
  18. There's about a dozen fields with names like j6 or k4. I could spend a few hours picking apart all that junk, or make a much more reliable indicator that gets the same idea across without jiggling.
  19. @Animefan8888 I tried setting the seed, but it doesn't seem to work at all. I think I'm going to rethink my effect, the health rendering section is a mess of obfuscated fields that make no sense.
  20. Ah, perfect. so If i get the update counter and multiply, the seed should give me the same number? or will the update counter have updated by the time my code calls?
  21. Since by default my effect really kicks in at 4 hearts, it unfortunately does influence me. However, the seed does help, where does it come from? I'm not at my dev environment currently so I can't find it myself.
  22. I did see a call to rand.nextInt(), Ill find it when I get home. It may turn out to be extraneous though, in which case I'll use the update counter.
  23. I am trying to make an overlay of the vanilla health bar that changes the color of the first two hearts on the bar. The render works fine, and renders my hearts over the vanilla ones no problem. The trouble is that vanilla hearts tend to shake up and down under various conditions, and these movements are hardcoded and can't be accessed. The solution taken by tinkers construct appears to be to render their own health bar, which is something I'd like to avoid. Is there some way of masking out shapes underneath my render, IE erasing anything on the HUD behind my icons? Or perhaps some way of getting the shake that I don't see? I really REALLY don't want to cancel the vanilla render and make my own health bar if it can be at all avoided, as that would be a compatibility nightmare for other mods that do the same. Is there a decently efficient way to use reflection to get a reference to the field in GUIIngame that stores the y offset for each heart? I hesitate to do that since reflection tends to be rather intensive.
  24. Ok, it looks like the heart shaking is random, I might want to just cancel the health bar rendering and render my own. If anyone has a better idea, I'm all ears. Thank you for the help so far, I've learned a lot about HUD rendering.
×
×
  • Create New...

Important Information

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