Jump to content

The_Fireplace

Forge Modder
  • Posts

    243
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by The_Fireplace

  1. Looks great, thanks. Specifically, I have an annotation processor that produces a configuration file in json format. Rather than scanning for that file from all places at once, I've set it up so a given mod will only pull in its own configuration and those of its dependencies, to reduce risk of another mod's configuration getting pulled in during setup, breaking, and crashing with the wrong ModContainer reported as causing the crash.
  2. Is there a way to get a resource file from a given mod container on 1.16.5? I've found modContainer.get().getModInfo().getOwningFile().getFile().findResource() on 1.18.2, but IModFileInfo#getFile() doesn't seem to be present in the ForgeSPI version used for 1.16.5. Is there an alternate way to get a resource file (or the IModFile) from a specific mod on 1.16.5?
  3. Yeah, the entire mod, including the data used for the check, is only on the server side. Since the original post, I've also tried decreasing the stack size of the block when I cancel the event then adding the block to the inventory, but that didn't fix it either.
  4. Hello, After cancelling BlockEvent.PlaceEvent on the server side, I'd like to make sure the client knows the block hasn't been placed. I've tried EntityPlayer.inventory.markDirty(), as well as overwriting the stack in the slot with itself, but neither updated the client. Ideally I'd like a way to do this on the server side only, without having to make changes to the client, because the mod I'm doing this in is intended to run on the server side only. If anyone has any suggestions about how to make this work, please let me know. I'll edit the post if I come up with a solution. EDIT: Solved by adding the following after cancelling the event: EntityEquipmentSlot hand = event.getHand().equals(EnumHand.MAIN_HAND) ? EntityEquipmentSlot.MAINHAND : EntityEquipmentSlot.OFFHAND; ((EntityPlayerMP) event.getPlayer()).connection.sendPacket(new SPacketEntityEquipment(event.getPlayer().getEntityId(), hand, event.getPlayer().getItemStackFromSlot(hand)));
  5. The command is no longer needed. Just open IntelliJ Idea/Eclipse and import build.gradle as a gradle project.
  6. After running "gradlew setupDecompWorkspace idea" and opening the project in Idea, running the game does not detect the mod I'm working on. The only 4 mods that load are Minecraft, MCP, FML, and Forge. My build.gradle My main mod file My run configuration: Forge 14.23.5.2768 ForgeGradle 2.3-SNAPSHOT If there is any other information I can provide to help get this resolved, please let me know.
  7. SRG stands for Searge. He is one of the guys that works/worked on MCP, possibly the one that came up with that naming system.
  8. For a while, it was working fine, then my game started crashing on launch. First thing I did was disable all mods and attempt to reproduce the issue, and it continued. Here is my latest.log: http://paste.ubuntu.com/24779792/ And (I don't see how this helps any more than the log), the crash report: http://paste.ubuntu.com/24779841/ Forge 13.20.0.2313 Minecraft 1.11.2 EDIT: It looks like the resolution it was trying to run at was wrong; I had switched monitors before the crash started occurring. To fix the issue, I disabled fullscreen in options.txt and tweaked the resolution in the launcher settings. EDIT 2: This is a huge pain, it happens every time I launch the game and it tries to enter fullscreen. Going to test on a new instance and see if I can reproduce the issue. If so, I'd assume it's a Forge bug. EDIT 3: After a bit of research, it turns out it is a vanilla bug.
  9. Depends. Is it just that you need to use server-side data for something on the client? Or are you actually trying to have the server do something? If what you want is the former, I would use packets to request the information from the server and have it sent back to the client. If you want the latter, I would look in to using LivingUpdateEvent, check if the entity is a player, and write code similar to Entity::rayTrace() (A client only method, which is why you would need to recreate something similar) to determine if the player is looking at an entity.
  10. Can we see your block code? It looks to me like one of the methods used in calculating the block's light value needs to be overridden.
  11. Hey guys, I want to render an itemstack from a slot in my entity's inventory above the entity. I would prefer for it to render like the EntityItem does. My question is, how do you recommend I do this? I would like to avoid causing a noticeable performance hit if possible. It should also be noted that I plan to have this rendering disabled by default, and enabled by either using a keybind or equipping an item.
  12. Ah, I see. Thanks for the explanation, it should be somewhat easy to fix now, since the client shouldn't have any reason in this mod to need to send that much data to the server. Thanks for the suggestions, I will work on them today. You've pointed out several problems and ways to fix them that I wouldn't have caught. As for the why of all of that bad design, that was the original author's doing, and I have been working on fixing it for a while now.
  13. So, I send a packet that contains one NBTTagCompound containing a lot of data(Mostly inventories within a tile entity). Unfortunately, it seems to be too large, since I get the following crash upon sending. http://paste.ubuntu.com/24062837/ My question to you is, how do you suggest I redesign the system to reduce the packet size? My current way of doing things involves sending the packet to the client just before the GUI opens. This packet contains all of the entity's data, including inventory, which the client needs or else it will crash upon opening the GUI. The creation of the NBT Tag Compound The packet If anyone knows of a way to reduce packet size or simply split this in to as many smaller packets as needed, it would be greatly appreciated.
  14. Alright, found kind of a workaround. If you manipulate the item json correctly with rotation and scaling, you can flatten it and make it look like a normal item. The only part I have done so far is the gui part, which I will post below, and if I ever do the in-hand renderings, I will post that too. If anyone else needs to do it before I do, I have found that Item Transform Helper is very useful for doing this. "display": { "gui": { "rotation": [ 0, 45, 32 ], "translation": [ 0.00, 0.00, 0.00 ], "scale": [ 1.50, 1.50, 1.50 ] } } Thanks for trying to help out, and feel free to respond if you have a code fix.
  15. item/generated wasn't introduced until 1.9(or at least, wasn't used for the vanilla items before then, idk if it existed code-wise), and I am working on 1.8.9. Still, I went ahead and gave it a shot, and it still rendered like an itemblock(same as I showed in the first post), along with giving me this error in the console. Edit: It appears that setting it to anything vanilla causes it to switch to the vanilla Compass's TextureAtlasSprite. I just tried making that line item/potato and it caused it to switch to the vanilla Compass's.
  16. And how do you suggest going about doing that? I know I'm probably derping on this one, but when I change this line to use builtin/generated, the item switches from my custom TextureAtlasSprite to the vanilla Compass's TextureAtlasSprite.
  17. Hey guys, I have made something with a custom TextureAtlasSprite, but when it renders, it looks like this: [/img] Functionally, the texture works fine, I just need it to render like an item. My TextureAtlasSprite class: https://github.com/The-Fireplace/UHC-Compass/blob/master/src/main/java/the_fireplace/uhccompass/TextureUHCCompass.java Note that this is currently for 1.8.9, though I plan on updating it once it is completed.
  18. Still no progress on this. Anyone have any ideas on the best way to go about doing this now?
  19. Hey guys, I found an old tutorial on adding hidden achievements to pages, so they don't show up until they've been achieved. However, several changes have been made since then(Achievements are now world based), and the actual code shown is pretty old. Does anyone know of a simple way to do this now?
  20. Hello everyone, I am trying to add combat AI to my custom entity, and I get the following NPE when it is trying to create Melee attack AI: http://paste.ubuntu.com/23243073/ Honestly, I' a little confused about this one, because I see no way this should throw an NPE. Anyways, the code for my entity: https://github.com/The-Fireplace/Overlord/blob/master/src/main/java/the_fireplace/overlord/entity/EntitySkeletonWarrior.java Any help with solving this would be greatly appreciated.
  21. You need to have it use your modid as well. For example: ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation("everythinginbetween:"+item.getRegistryName(), "inventory")); If that doesn't work, try the following code instead(this is how I register mine, so I know this method works): Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("everythinginbetween:" + item.getRegistryName(), "inventory"));
  22. I have searched the forums for this issue, and after looking at about 10 different threads, I have only found a single answer that (should have) helped me with this issue: After following these instructions, my entity is still a white cube. Here is my code: If any more code is needed, here is my source code.
  23. Ok, so, my initial issue was that my custom TNT was rendering as a white cube. I searched every thread I could find related to that issue, and the only real answer I found was this: So, I tried following what it said, and it seems that when I try to read the data from the DataWatcher, it throws a NullPointerException repeatedly as long as the entity exists: And here is the important part of my code: The part surrounded by try/catch is what throws the NPE. If you need to see the full file, here is a link to it on github. Could anyone tell me what I am doing wrong?
  24. Well, I'm out of ideas; I don't see any reason for this to not work. Are there any errors that show up in the log related to texture loading?
  25. When is registerRenders() being called? It sounds to me like it is being called during FMLInitializationEvent; it needs to be called in FMLPreInitializationEvent.
×
×
  • Create New...

Important Information

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