Jump to content

Angercraft

Members
  • Posts

    35
  • Joined

  • Last visited

Recent Profile Visitors

2023 profile views

Angercraft's Achievements

Tree Puncher

Tree Puncher (2/8)

3

Reputation

  1. I've increased the amount of damage the player does, but this results in the damage indicator particles spawning in very large numbers. Any ideas on how I can reduce the number of these particles spawned? They're spawned in the PlayerEntity#attackTargetEntityWithCurrentItem line 1209. Only way I can think of is modifying the base class, but that is a bad idea.
  2. Using the event, just check for who the player is, using their unique id. And you can get the custom name for a mob by using the Entity#getCustomNameTag which you can easily do by getting the killed entity in the event.
  3. You cannot call Minecraft.getMinecraft().thePlayer if you are on the server side. As you're already using the LivingDeathEvent you can call event.getSource().getTrueSource() to get the player who killed the enderman.
  4. Yeah I meant the capabilities. So no argument against using, for example MongoDB, to persist data?
  5. I'm just curious, I've seen some few places, people trying to use databases such as MySQL to persist data for their mods. I know forge already has systems to save data, but would there be a use case, in which you can argue for using a database? From wow private servers I always see the data for items, creatures, and so on saved in a MySQL table, mongodb or something similar. I'd guess this is because there's a lot of data, in which case, could I argue for using a database, if I have a lot of data to save, for example about players? Just curious, and for now the normal systems are great, but for future reference, I would like to know if it is a bad idea to use 3rd party databases, to not make that mistake. Thanks in advance!
  6. Alright, I got it to work. You can detect if a sound is done playing, when it is removed from the Map<ISound, Integer> playingSoundsStopTime located in the SoundEngine. Needed to use reflection to get it working, but for now it seems like a good workaround. Thank you for your time.
  7. Yeah, sorry about the exception, I know about that one, but when just testing I don't worry too much about them. Thank you for the help, I still need to figure out how to check if my custom track is done playing.
  8. Alright, got it all to work, and so far I've got a hacky solution to stop the normal music from playing. But how would I go about detecting when the song is done playing? As I need to return the timeUntilNextMusic to its normal value. private static Field timeUntilNextMusic = null; public static void playTrack() { Minecraft mc = Minecraft.getInstance(); MusicTicker musicTicker = mc.getMusicTicker(); if(timeUntilNextMusic == null) { timeUntilNextMusic = ObfuscationReflectionHelper.findField(MusicTicker.class, "field_147676_d"); } musicTicker.stop(); try { timeUntilNextMusic.setInt(musicTicker, 10000); } catch (IllegalAccessException e) { e.printStackTrace(); } mc.player.playSound(PostCreditsMusic.sound, 1.0F, 1.0F); }
  9. Thank you for your help. Regarding the SoundEvent, will the following be good manners, or should it be registered differently? public static SoundEvent sound; @SubscribeEvent public void registerMusic(RegistryEvent.Register<SoundEvent> event) { sound = new SoundEvent(new ResourceLocation(PostCreditsMusic.MOD_ID, "track")); event.getRegistry().register(sound); }
  10. I'm trying to play a custom piece of music, but would like to not have the background music from the game play, whilst my track is playing. I would like for other sounds, such as mob sounds, doors, and all other sounds than music to still play. As seen below, I tried using the soundhandler, but this doesn't seem to pause the sounds, whilst I play my own track. Any ideas for how I can pause only the background music, only while my own track is playing? import angercraft.postcreditsmusic.PostCreditsMusic; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.SoundHandler; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; public class ClientHandler { static Minecraft mc = Minecraft.getInstance(); static SoundEvent sound = new SoundEvent(new ResourceLocation(PostCreditsMusic.MOD_ID, "track")); public static void playTrack() { SoundHandler soundHandler = mc.getSoundHandler(); soundHandler.pause(); mc.player.playSound(sound, 1.0F, 1.0F); } }
  11. I'm using the recommended 1.14.4 - 28.1.0. I just tried with the latest 1.14.4 - 28.1.17, and the problem seems to be fixed now. It probably fixed it, by reimporting the Gradle project, so I will keep that in mind next time. Thank you for your help!
  12. You can retrieve the default textures in "C:\Users\<Username>\AppData\Roaming\.minecraft\versions\1.14.4\minecraft\textures"
  13. @Mod.EventBusSubscriber(modid = Reference.MOD_ID) public class Eventlistener { @SubscribeEvent public static void onRenderGui(GuiOpenEvent event) { if(event.getGui() instanceof EditSignScreen) { if(Keybinds.noSignGui.isKeyDown()) { event.setCanceled(true); } } } @SubscribeEvent public static void onRightClickEmpty(PlayerInteractEvent.RightClickEmpty event) { System.out.println("Empty event"); } @SubscribeEvent public static void onRightClicked(PlayerInteractEvent.RightClickBlock event) { System.out.println("Right click block"); } } The first method onRenderGui(GuiOpenEvent event) does trigger correctly, but I cannot seem to get the other two to trigger, no matter what I do. I tried having it as an object method and registrering it manually, I've tried registering the class with static methods manually, and I've tried the above.
  14. Alright, thank you for your time, and have a great day.
  15. Fantastic, thank you so much for the help. If you have time, could you answer what the best way is to disable the rendering of the original healthbar? Right now I use the event to check if the ElementType is of HEALTH, as can be seen in RPGHUD.java above. But I can see you can set GuiIngameForge.renderHealth = false; which I tried in my FMLPostInitializationEvent for the client side, and this seems to work. But does one of them have a downside, which should deter me from using them?
×
×
  • Create New...

Important Information

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