Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Zeher_Monkey

  1. However, the bar does not appear when moving the item, or in the players hotbar when not in a gui.
  2. Okay so this was NOT the way to go about this. I have since discovered they sorta correct way to do this. Using: GuiContainerEvent.DrawForeground event I can overlay my bar correctly.
  3. Hi, I am trying to create a custom ItemStackTileEntityRenderer For an Item, to render a custom durability bar. I have looked through vanilla code and tried to implement this with a ItemStackTileEntityRenderer But so far have had 0 luck. If I try to use ItemRenderer.render() It crashes because it ends up endlessly looping. My custom method to draw the bar is also not working. CosmosEnergyItemItemStackRenderer.java CosmosItemRenderer.java I am really not sure how to handle this. The item does not render in any state currently, it is i
  4. Okay so I fixed this issue, turns out I wasn't passing in the values int p_239207_5_, int p_239207_6_ Into the renderer.render(stackIn, transformIn, true, matrixStack, typeBuffer, 0 (Should have been p_239207_5_), 0 (Should have been p_239207_6_), model); Function. The item now correctly renders with the correct colour and scale.
  5. Yeah there are multiple ways, the simplest in my opinion is how the Furnace does it. You are very welcome!
  6. Yes, look into AbstractFurnaceTileEntity and FurnaceScreen to see how vanilla handles values like the Burn Time, and the Cook Progress, ie the white arrow inside the Furnace GUI.
  7. So quick update, The weird scale was caused by the GUI, GROUND, FIXED Inside the dimensional_trident__.json and the dimensional_trident_throwing.json So thats fixed. However the colour is still not correct.
  8. Hi all, I am attempting to add my own custom Trident into my Mod. I have 90% of things working currently, however the GUI, ItemEntity and ItemFrame (I assume from FIXED) rendering is very strange. Below are picures of the Issue, and any related code. dimensional_trident.json: dimensional_trident__.json: dimensional_trident_throwing.json: ItemStackTileEntityRenderer.class: Im not sure what the issue is. Ive looked through vanilla code to see if i could locate the source of the issue, no dice. I have also read a
  9. Okay, I misunderstood my old code then. Or I was doing things wrong... more likely for me to be honest. Ill have to look into server -> client packets. Its for a Screen that changes Widgets/Buttons depending on the other dimensions block information. Thanks for your help!
  10. So I am adding in features from previous versions of my mod from previous MC versions. One of these features is to access a block that is in another dimension from the players current dimension. Previously I used:SD DimensionManager.getWorld(int dimensionId); This allowed both Client and Server side to access without a problem. In 1.16.3 and forward this DimensionManager class is no longer in Forge so I now use: ServerLifecycleHooks.getCurrentServer().getWorld(RegistryKey<World> dimension); However this only works Server side, which is fine for my uses up till t
  11. Okay, that idea is scrapped then. I will have to accept that the standard sound will play when going from Custom -> Vanilla world. Which to be honest is not that bad, I'm not too happy with the Exit sound anyway. Maybe I could ask the Forge devs to see if they can work their magic and allow for custom sounds to be played via theS SPlaySoundEffectPacket(SoundEvent event, SoundCategory category, double x, double y, double x, float volume, float pitch) Instead of hard-coding the sound. Maybe that's a longshot but who knows.
  12. Okay. That seems reasonable. I have thought of an idea, which is to store a Previous Dimension [ResourceLocation] tag into the Players Persisted Data, and change that using PlayerEvent.PlayerChangedDimensionEvent. I can then use this to check when sound events are playing. I'm storing these tags under my MOD_ID so that no other mod can get confused.
  13. Yeah that is what I was afraid of. I may just have to accept using the nether portal sound for now. I don't think your solution would work on servers with many people, and I cant think of any way to do it personally. Ill have to leave the sound playing one way. Many thanks for your help!
  14. Okay thanks. That only solves half of the issue however, as: Going from Overworld / Nether / End -> Custom Dimension now cancels correctly. But going from Custom Dimension -> Overworld / Nether / End still plays the sound.
  15. How would I go about doing that? I cant get an Entity from the SoundEvent, and I'm not entirely sure how to replace / sounds. I can only get the ISound, SoundCategory and the X,Y,Z of the sound Event.
  16. Hi all, I have a custom dimension which is accessed through a custom block. I am using server_player.changeDimension(server_world, shifterIn); To change the player dimension when shift-right clicking the block. I have my own custom Portal Sounds for entry and exit, but the original Nether Portal sounds are playing over the top. Without resorting to using PlaySoundEvent event And cancelling all Portal Sounds, which I don't want to do, how could I stop the original sound from being played? PlaySoundEvent has a BlockPos, but when playing the Port
  17. Very true, but to be honest my code only needed a few lines updated. I want to move to something more native, but am struggling to find references to WorldSavedData. I am not worried about compact data, there is only 1 master file which contains each registered object, and each object is only ~3KB in size. It allows easy debugging, and on servers specifically, tweaks to the data that do not require things like NBTExplorer to use. It works for my purposes.
  18. That made me laugh! Okay maybe not robust, but it has been reliable for me so far. I use a GSON -> JSON converter with custom TypeAdapters for objects GSON doesn't already know how to convert. Works for my purposes. Thanks for your help!
  19. Many thanks for your help, although the ForgeDocs seem to be outdated, as I could not find reference to: World#getMapStorage() Anywhere in the actual code in Forges latest release for 1.16.3. I really do not want to enter the capability rabbit hole, as I have had major trouble getting packets to work in the past. I instead reviewed some other posts, and following your guidance on those posts have resorted to using this code, which works on both the client and server side: Object save = ObfuscationReflectionHelper.getPrivateValue(MinecraftServer.class, server, "fie
  20. Okay thanks, can these be changed dynamically with a world? Basically I am storing a LinkedHashMap with a BlockPos as the Key, and a custom Classfile as the value. When a block is placed down a new instance of the Customfile.class is created and added to the map, with that blocks BlockPos as the key, and the map is stored within the "/saves/WORLDNAME/mymod/" folder. I am assuming that Forge's config system is not the best system to use with my use-case.
  21. Hi, I am updating some of my mods, and I store config files in the "/saves/WORLDNAME/" folder. I am having trouble getting this folder name at the moment. In 1.12.2 the code to get this was: FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName() However I'm struggling to find the equivalent in 1.16. Many thanks in advance.
  22. This was the problem. I have had 0 luck getting @ObjectHolder to work. I have just declared the TileEntityType in a static field, this has solved the problem. Thank you @poopoodice
  23. I have scanned through and made some changes accordingly: 1. Copied similar Abstract Structure as FurnaceTileEntity 2. No longer using IInventory (Will use capabilities once I have wrapped my head around them, and the new Menu/Container/Gui system) 3. No longer using ISidedInventory 4. Removed onDataPacket() and getUpdatePacket() 5. Stopped using BlockContainer using these methods instead: @Override public TileEntity createTileEntity(BlockState state, IBlockReader worldIn) { return new PocketTileEntity(); } @Override public boolean hasTileEntity(BlockSta
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.