Jump to content

Meldexun

Members
  • Posts

    184
  • Joined

  • Last visited

Everything posted by Meldexun

  1. Ok, i think i found it. I had a capital letter in my ResourceLocation which only gives an error but no crash and prevents the events from being subscribed.
  2. Well I'm just saying what is happening. These are the only 3 classes in my mod and only when i remove the ResourceLocation i get the "test" printed in the console. I really would like to understand what is causing this.
  3. Now it says extrautils2 is crashing the game. Try to remove it.
  4. Post the new crash report.
  5. It says that there is a NullPointerException in a Botania class. Try to remove Botania. Also you could test if it also crashes with only Botania installed and then ask the Botania creator for help. Here you could send the issue to the Botania creator: https://github.com/Vazkii/Botania/issues
  6. Are you trying to create a mod? If not then i think you should ask for help in the Support & Bug Reports section instead of the Modder Support section. When doing this you should also post your crash report (or the latest.log file if there is no crash report).
  7. You said So where is the problem? Also why do you use field_78116_c as names for your objects? And why do you have a ArmPose class which does nothing? And you only posted half of your class. You should post a complete class and say what your problem is otherwise nobody can help you.
  8. As far as i know you need to create a .json file instead of a .lang file and also the translation key changed from "item.ITEM_NAME.name" to "item.MOD_ID.ITEM_NAME". You should take a look at the 1.13/1.14 lang changes: https://gist.github.com/williewillus/353c872bcf1a6ace9921189f6100d09a#lang-changes Edit: This applies for 1.13/1.14 (did you added the 1.12.2 just right now?...) Edit1: I can't find the setTranslationKey() method when using Forge 1.12.2 14.23.5.2838. What forge version are you using?
  9. I know it sounds like i'm just dumb. But these are my classes: Mod class: package meldexun.better_diving; import net.minecraftforge.fml.common.Mod; @Mod(BetterDiving.MOD_ID) public class BetterDiving { public static final String MOD_ID = "better_diving"; } Event class 1: package meldexun.better_diving; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; @EventBusSubscriber(modid = BetterDiving.MOD_ID) public class Event1 { public static final ResourceLocation DIVING_VALUES = new ResourceLocation(BetterDiving.MOD_ID, "divingValues"); } Event class 2: package meldexun.better_diving; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; @EventBusSubscriber(modid = BetterDiving.MOD_ID) public class Event2 { @SubscribeEvent public static void test(LivingUpdateEvent e) { if (e.getEntity() instanceof EntityPlayer) { System.out.println("test"); } } } When launching the game like this i never see the "test" from the LivingUpdateEvent. But when removing the ResourceLocation from the Event class 1 i get the "test" in the console.
  10. Okay, that wasn't the issue. Just another problem. The problem was that i had a static ResourceLocation in one of my event classes. So when you have a class with the EventBusSubscriber annotation and inside it a static ResourceLocation it will prevent all events from firing. That would be an example class: @EventBusSubscriber(modid = TestMod.MOD_ID) public class Test { public static ResourceLocation TEST = new ResourceLocation(TestMod.MOD_ID, "test"); }
  11. After testing my mod with only the mod class and the event test class i noticed that i forgot to register my capability. Still thank you for trying to help.
  12. All of the events never seem to work. I have added this class to my mod and i never see "Test1" or "Test2" when playing ingame.
  13. Hello there, i want to use some events in my mod but all of them don't seem to work. So this is an example class: @EventBusSubscriber(modid = BetterDiving.MOD_ID) public class Test { @SubscribeEvent public static void test1(PlayerInteractEvent.RightClickEmpty e) { System.out.println("Test1"); } @SubscribeEvent public static void test2(LivingUpdateEvent e) { System.out.println("Test2"); } } Am i missing something?
  14. Well i haven't registered my sound events. That may be the reason.
  15. Ok i'm playing a sound at 3 locations in my code: In my item class: @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { if (!worldIn.isRemote) { System.out.println("play sound"); worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundHelper.SEAMOTH_EXIT, SoundCategory.NEUTRAL, 0.6F, 1.0F); } return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, playerIn.getHeldItem(handIn)); } In my entity class: @Override public boolean processInitialInteract(EntityPlayer player, EnumHand hand) { if (!this.world.isRemote) { System.out.println("play sound"); this.world.playSound(null, this.posX, this.posY, this.posZ, SoundHelper.SEAMOTH_ENTER, SoundCategory.NEUTRAL, 0.6F, 1.0F); } return true; } In my event handler class: @EventBusSubscriber public class SeamothEventHandler { @SubscribeEvent public static void exit(EntityMountEvent event) { if (!event.getWorldObj().isRemote && event.isDismounting() && event.getEntityMounting() instanceof EntityPlayer && event.getEntityBeingMounted() instanceof EntitySeamoth) { System.out.println("play sound"); Entity e = event.getEntityBeingMounted(); event.getWorldObj().playSound(null, e.posX, e.posY, e.posZ, SoundHelper.SEAMOTH_EXIT, SoundCategory.NEUTRAL, 0.6F, 1.0F); } } } Here i'm collecting my sound events: public class SoundHelper { public static final SoundEvent SEAMOTH_ENTER = new SoundEvent(new ResourceLocation(BetterDiving.MOD_ID, "seamoth_enter")); public static final SoundEvent SEAMOTH_EXIT = new SoundEvent(new ResourceLocation(BetterDiving.MOD_ID, "seamoth_exit")); } In Singleplayer the sound is playing all 3 times. But on a dedicated server i just see the "play sound" in the log. Also i found this error in the client log when playing on a dedicated server: [16:21:55] [Client thread/FATAL] [net.minecraft.client.Minecraft]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?] at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1088) [bib.class:?] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398) [bib.class:?] at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] Caused by: java.lang.NullPointerException at net.minecraft.client.audio.PositionedSoundRecord.<init>(SourceFile:34) ~[cgp.class:?] at net.minecraft.client.audio.PositionedSoundRecord.<init>(SourceFile:30) ~[cgp.class:?] at net.minecraft.client.multiplayer.WorldClient.func_184134_a(WorldClient.java:468) ~[bsb.class:?] at net.minecraft.client.multiplayer.WorldClient.func_184148_a(WorldClient.java:456) ~[bsb.class:?] at net.minecraft.client.network.NetHandlerPlayClient.func_184327_a(NetHandlerPlayClient.java:1674) ~[brz.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.func_148833_a(SourceFile:89) ~[kq.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.func_148833_a(SourceFile:11) ~[kq.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[hv$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_201] at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?] ... 9 more
  16. So i want to play various sounds in my mod. For that I'm checking for the server side and call the world.playSound() method. When playing in a singleplayer world everything works and the sounds are playing but on a dedicated server the sounds are never playing. That's how i play the sounds: if (!worldIn.isRemote) { worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundHelper.SEAMOTH_EXIT, SoundCategory.NEUTRAL, 0.6F, 1.0F); } Shouldn't this method play the sound for all nearby players except the passed player? Thanks for the help in advance.
  17. Thank you it seems to work. But can you tell me the difference between blocklight and skylight?
  18. Hi there, I created an entity with a custom model and renderer. So now i want that the model kind of glows in the dark. I mean in the sunlight it's bright and you see everything easily and i want that this model is just as bright in the darkness of caves or the night as during the day. It doesn't have to emit light. It should just stay bright and colorful all the time.
  19. Yeah, i also found this out already after some testing. So i'm now checking for AbstractClientPlayer (it may be named different). Also i changed my model again and all seems to work fine now. Thank you for the help.
  20. I'm never using for this part of my mod. So thats my new model class: @SideOnly(Side.CLIENT) public class ModelDivingGear extends ModelPlayer { ModelRenderer diveRightArm; ModelRenderer diveLeftArm; public ModelDivingGear(float scale, boolean smallArmsIn) { super(scale, smallArmsIn); this.textureHeight = 128; this.textureWidth = 64; //arms if (smallArmsIn) { diveRightArm = this.createCube(0, 48 + 32, -2.0F, -2.0F, -2.0F, 3, 12, 4, 0.251F); setRotation(diveRightArm, 0.0F, 0.0F, 0.0F); diveLeftArm = this.createCube(0, 48 + 32, -2.0F, -2.0F, -2.0F, 3, 12, 4, 0.251F); setRotation(diveLeftArm, 0.0F, (float) Math.PI, 0.0F); } else { diveRightArm = this.createCube(0, 48 + 32, -3.0F, -2.0F, -2.0F, 4, 12, 4, 0.251F); setRotation(diveRightArm, 0.0F, 0.0F, 0.0F); diveLeftArm = this.createCube(0, 48 + 32, -3.0F, -2.0F, -2.0F, 4, 12, 4, 0.251F); setRotation(diveLeftArm, 0.0F, (float) Math.PI, 0.0F); } bipedRightArm.addChild(diveRightArm); bipedLeftArm.addChild(diveLeftArm); } @Override public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } private ModelRenderer createCube(int texOffX, int texOffY, float offX, float offY, float offZ, int width, int height, int depth, float scale) { ModelRenderer m = new ModelRenderer(this, texOffX, texOffY); m.addBox(offX, offY, offZ, width, height, depth, scale); m.setRotationPoint(0.0F, 0.0F, 0.0F); m.setTextureSize(textureWidth, textureHeight); m.mirror = true; return m; } } Here i create the model: @EventBusSubscriber(Side.CLIENT) public class ArmorModels { public static ModelDivingGear divingGearModel; public static ModelDivingGear divingGearModelSlim; public static ModelDivingGearLegs divingGearModelLegs; @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) { divingGearModel = new ModelDivingGear(0.0F, false); divingGearModelSlim = new ModelDivingGear(0.0F, true); divingGearModelLegs = new ModelDivingGearLegs(0.0F); } } And i override the getArmorModel method: @SideOnly(Side.CLIENT) @Override public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped _default) { return armorSlot == EntityEquipmentSlot.LEGS ? ArmorModels.divingGearModelLegs : entityLiving instanceof EntityPlayer && ((EntityPlayerSP) entityLiving).getSkinType().equals("slim") ? ArmorModels.divingGearModelSlim : ArmorModels.divingGearModel; } I thought the getArmorModel method always passes you an EntityPlayerSP when a player is wearing the armor. But it may pass an EntityPlayerMP on servers? Is that right? That the only point that i don't really know about.
  21. So i found out that when i extend my model class ModelPlayer instead of ModelBiped my model is rotating correctly with the arms. But that results in other problems. For example in multiplayer the armor is just rendered for yourself and others don't see it. Has anyone experience with that?
  22. So i have made a armor with a custom model. The model is tight on the player skin and is working properly with a normal Skin (the 4x12x4 arms from steve). But with a skin with small arms the arms aren't rotating the same way as my armor. This results in the arms coming out of the armor from the swing animation. That's the model class: ModelRenderer diveRightArm; public Model() { super(0.0F); this.textureWidth = 64; this.textureHeight = 64; diveRightArm = new ModelRenderer(this, 0, 80); diveRightArm.addBox(-2.0F, -2.0F, -2.0F, 4, 12, 4, 0.001F); diveRightArm.setRotationPoint(0.0F, 0.5F, 0.0F); diveRightArm.setTextureSize(textureWidthIn, textureHeightIn); diveRightArm.mirror = true; setRotation(diveRightArm, 0.0F, 0.0F, 0.0F); } @Override public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); } The arms should be covered:
  23. Ok that is working thank you. But how can i add a texture to my model?
  24. That is what i try to do. But to the body not to the head of the player. So thats the event: public static ModelBase ModelAngelWings = new ModelAngelWings(); @SubscribeEvent public static void renderPlayerPre(RenderPlayerEvent.Pre event) { EntityPlayer p = event.getEntityPlayer(); ModelAngelWings.render(p, 0, 0, 0, p.renderYawOffset, p.rotationPitch, 0.0625F); } And the model class: public class ModelAngelWings extends ModelBase { private final ModelRenderer leftWing; private final ModelRenderer rightWing; public ModelAngelWings() { textureWidth = 16; textureHeight = 16; leftWing = new ModelRenderer(this); leftWing.setRotationPoint(0.0F, 16.0F, 0.0F); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 0.0F, -2.0F, 3.0F, 1, 4, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 1.0F, -5.0F, 3.0F, 1, 11, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 2.0F, -5.0F, 4.0F, 6, 10, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 2.0F, -6.0F, 3.0F, 1, 2, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 2.0F, -7.0F, 3.0F, 4, 1, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 6.0F, -7.0F, 3.0F, 1, 2, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 7.0F, -6.0F, 3.0F, 1, 3, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 8.0F, -4.0F, 4.0F, 1, 8, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 8.0F, -1.0F, 5.0F, 1, 6, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 7.0F, 4.0F, 5.0F, 1, 3, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 2.0F, 5.0F, 4.0F, 5, 2, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 6.0F, 6.0F, 5.0F, 1, 3, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 2.0F, 7.0F, 4.0F, 4, 3, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 1.0F, -4.0F, 4.0F, 1, 13, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 1.0F, 8.0F, 5.0F, 1, 4, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 2.0F, 10.0F, 4.0F, 2, 2, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 4.0F, 10.0F, 5.0F, 1, 3, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 5.0F, 8.0F, 5.0F, 1, 3, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 3.0F, 12.0F, 4.0F, 1, 1, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 2.0F, 11.0F, 5.0F, 1, 2, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 3.0F, 12.0F, 5.0F, 1, 2, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 3.0F, -6.0F, 4.0F, 4, 1, 1, 0.0F, false)); leftWing.cubeList.add(new ModelBox(leftWing, 0, 0, 0.0F, -3.0F, 2.0F, 1, 6, 1, 0.0F, false)); rightWing = new ModelRenderer(this); rightWing.setRotationPoint(0.0F, 16.0F, 0.0F); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -1.0F, -3.0F, 2.0F, 1, 6, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -2.0F, -4.0F, 4.0F, 1, 13, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -8.0F, -5.0F, 4.0F, 6, 10, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -2.0F, -5.0F, 3.0F, 1, 11, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -3.0F, -6.0F, 3.0F, 1, 2, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -7.0F, -6.0F, 4.0F, 4, 1, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -6.0F, -7.0F, 3.0F, 4, 1, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -8.0F, -6.0F, 3.0F, 1, 3, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -7.0F, -7.0F, 3.0F, 1, 2, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -9.0F, -4.0F, 4.0F, 1, 8, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -9.0F, -1.0F, 5.0F, 1, 6, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -7.0F, 6.0F, 5.0F, 1, 3, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -8.0F, 4.0F, 5.0F, 1, 3, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -6.0F, 8.0F, 5.0F, 1, 3, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -6.0F, 7.0F, 4.0F, 4, 3, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -4.0F, 10.0F, 4.0F, 2, 2, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -5.0F, 10.0F, 5.0F, 1, 3, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -4.0F, 12.0F, 5.0F, 1, 2, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -3.0F, 11.0F, 5.0F, 1, 2, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -2.0F, 8.0F, 5.0F, 1, 4, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -7.0F, 5.0F, 4.0F, 5, 2, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -4.0F, 12.0F, 4.0F, 1, 1, 1, 0.0F, false)); rightWing.cubeList.add(new ModelBox(rightWing, 0, 0, -1.0F, -2.0F, 3.0F, 1, 4, 1, 0.0F, false)); } @Override public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { this.setRotationAngle(leftWing, 0.0F, (float) Math.PI - (float) Math.PI / 180.0F * netHeadYaw, 0.0F); leftWing.render(scale); this.setRotationAngle(rightWing, 0.0F, (float) Math.PI - (float) Math.PI / 180.0F * netHeadYaw, 0.0F); rightWing.render(scale); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } Also the model is rotating with the player but it is not as smooth as the player. It seems a bit laggy.
  25. How could i add a model to a player? So i thought of creating a Model class that extends ModelBase and render it in the RenderPlayerEvent. But it is untextured and is not rotation with the player. How can i solve this? Is there a better way to do that?
×
×
  • Create New...

Important Information

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