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


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Squidsword's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. Problem solved, thanks ChampionAsh. I used Notepad++ to edit the mods.toml file. On the bottom of Notepad++, there's a line that says Windows CR LF. I clicked on it and changed it to Unix LF, and the boxes were gone. I recently got this weird thing a few weeks ago where the description of my mod has these "carriage return" boxes instead of just going to the next line. The text file encoding is UTF-8. I dismissed it at first since it wasn't very important but I haven't found a resolution yet and it's getting on my nerves. I use eclipse and to edit it, and I just used the windows notepad to make changes to the file. I have no idea what I did to mess it up like this. Does anybody know what's going on? Here's the mods.toml file. modLoader="javafml" #mandatory loaderVersion="[34,)" #mandatory (35 is current forge version) issueTrackerURL="https://github.com/Squidsword/OresAboveDiamonds/issues" license="MIT" [[mods]] #mandatory modId="oresabovediamonds" #mandatory version="6.2.0" #mandatory displayURL="https://www.curseforge.com/minecraft/mc-mods/ores-above-diamonds" #optional displayName="Ores Above Diamonds" #mandatory logoFile="oresabovediamonds_logo.png" #optional # A text field displayed in the mod UI authors="§dSquidsword" #optional credits="Special thanks to §6CriativeMan1§r for the making the art for this mod!" # The description text for the mod (multi line!) (#mandatory) description=''' Adds the §dAmethyst§r and §5Black Opal§r which are respectively §d3x§r and §59x§r rarer than diamonds. Both have its own set of balanced armors and tools. It's recommended to download Overloaded Armor Bar along with this mod. https://www.curseforge.com/minecraft/mc-mods/overloaded-armor-bar/ The mod doesn't have built in retrogen support. This means that ores will not spawn in already loaded chunks. Venture far into unexplored lands to have a chance at finding them. ''' # Here's another dependency [[dependencies.oresabovediamonds]] modId="forge" mandatory=true versionRange="[34.0.0,)" ordering="NONE" side="BOTH" [[dependencies.oresabovediamonds]] modId="minecraft" mandatory=true versionRange="[1.16.3,)" ordering="NONE" side="BOTH" Here's the repository.
  2. Wow thanks, I don't know how I missed that. You're definitely right, I wrote it before I took any java classes so it's super sloppy. I took an intro class since and I think I'm going to make some helper methods to reduce the horizontal space needed and maybe make an array instead of doing it all one by one so it'll trim the lines of code down by a bit. Anyway, problem solved!
  3. I checked the docs and I don't think anything changed. I debugged the client and put a breakpoint at decode and handle and none of them were going off. Here's the source code if it helps (it's a little sloppy). The 1.15.2 branch is pretty much the same and it works fine, the only difference in 1.16.1 and 1.16.4 I added some config options for some new gear. Both 1.16.1 and 1.16.4 have the same problem. I double checked the additions to make sure I didn't make any typos, and I don't think I did. I don't understand the system very well and I'm really confused and I'm not sure what is going on. I'm probably missing something obvious lol. I'd really appreciate any help; let me know if you guys need any more data.
  4. Here's the crash report Here's my build.gradle Here's the source code if still needed I'm not sure what I'm doing so I'd appreciate some help. I think it has to do with my mappings or something? It gives a java.lang.NoSuchMethodError: 'net.minecraft.client.Minecraft net.minecraft.client.Minecraft.func_71410_x()' I think func_71410_x() is supposed to be getInstance() in deobfuscated form. I'm very influent in programming so don't be too harsh on me lol.
  5. I have an eclipse gradle project with a Minecraft mod dealing with ore generation and I want to add the Advanced Xray Mod by Error_MiKeY for testing purposes. I'm not planning on distributing his mod with mine, I just want to be able to test my mod within my workspace without having to build a jar file and put both files into actual Minecraft and run it there every time I want to test something. What I've tried and what sometimes works with other mods is adding the mod's .jar file to the run\mods folder. However, when I put the Advanced Xray mod in there, I get "Advanced Xray has class loading errors" (crash report here). The mod calls a method called Minecraft.func_7140_x(), and it returns a NoSuchMethod error, even though both mods are on the same version 1.16.4. They both work when I build my mod and add it to the mod files in Minecraft and run it on the actual game, so why doesn't it work here? Is it because my workspace is set up incorrectly? I heard that it's because it's not deobfuscated, but I'm not sure how to deobfuscate it without a tool like BON2 to do it for me and I can only go up to 1.15 on that. I've researched it and I heard that you can also put a dependency on your build.gradle file and it will download it online. I don't really have an understanding of how it works so I got lost in this step. What URL do I put? The mod is on GitHub, so do I add a GitHub repository with the link to the GitHub and grab it from there? I'm not sure. I also heard another way to add a dependency is to add a libs folder on your project root directory and put it there. By that do they mean making a new libs folder on the outermost layer where the build, settings, and src folders are or are they talking about the libs folder in \build? If the former, I tried making a libs folder like this and then I added the .jar file to it but nothing happened. I clearly don't know what I'm doing so don't overestimate how many things I know lol. I'd appreciate any help, thanks.
  6. Thanks, that sounds like a more efficient solution but I feel like I'm going to have to put a lot of work for my level of programming, I'm not sure if I'll be able to do it or not.
  7. You're absolutely right, the config file on the server side will still take effect on all the clients. The only problem is that the players can't see some of the changes in their HUD since their own config file is different. The packet is for a client-side only change that will update the HUDs of the items by registering the proper config values so they will render properly after the restart, as you already said. I am not familiar with how ForgeConfigSpec works or how to change the file values in an efficient way, so I'm having a problem actually changing the values within the code itself.
  8. I do want the user to be able to customize their own config values as normal. For more details, when the player joins a minecraft server with the mod enabled, I want the client config to change to the servers values so the player can see the changes the server has made. I have config values that can change the damage and armor values of the items in my mod (which a minecraft restart to take effect or so I believe). I'm not sure if there is a simpler way to do this other than sending a packet and changing the values using the packet message. The problem I'm not sure how to change it from within the packet handler because I'm not sure how to set the values from within the code. I am not sure what you mean by change it to the config version, do you mean set the default value to the packet values from the server in the ForgeConfigSpec builder .define method?
  9. Hey guys, I am trying to send a packet to the client when he enters the server to update his config files. In 1.12.2 it was rather easy with the @Config annotation, however I am having difficulty finding ways to change ForgeConfigSpec values in the packet handler I just made. I am a new programmer and I am not really sure of the most efficient way to do so. final ForgeConfigSpec.BooleanValue overworld_ores; final ForgeConfigSpec.BooleanValue nether_ores; final ForgeConfigSpec.BooleanValue end_ores; ServerConfig(final ForgeConfigSpec.Builder builder) { builder.comment("Note that almost all config changes require a server restart. Dimensional Ore Configuration").push("dimensional_ore"); overworld_ores = builder .comment("Spawn ores in the overworld? Default = true") .define("overworld_ores", true); nether_ores = builder .comment("Spawn ores in the nether? Default = false") .define("nether_ores", false); end_ores = builder .comment("Spawn ores in the end? Default = false") .define("end_ores", false); builder.pop(); } Here's a snippet of the way I created the values. It writes the default value in the config value, but how do I set the value to something other than the default without manually going to the .toml file and rewriting new ones? Is there any way to do it within the code? Thanks for any help.
  10. Thank you everybody. I came up with a solution using AnvilUpdateEvent. For anyone who might stumble upon this in the future, here's the code. A lot of this code was pasted from RepairContainer with some if statements added in. For some reason the formatting is weird, oh well. package oresAboveDiamonds.OresMod.events; import java.util.Map; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraftforge.event.AnvilUpdateEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; public class AnvilUpdateEventHandler { @SubscribeEvent(priority = EventPriority.LOW) public void anvilEvent(AnvilUpdateEvent event) { ItemStack left = event.getLeft(); ItemStack right = event.getRight(); if(left.getMaxDamage() <= 0 && right.getItem() != Items.ENCHANTED_BOOK && left.getItem().equals(right.getItem())) { Map<Enchantment, Integer> map = EnchantmentHelper.getEnchantments(left); Map<Enchantment, Integer> map1 = EnchantmentHelper.getEnchantments(right); for(Enchantment enchantment1 : map1.keySet()) { if (enchantment1 != null) { int i2 = map.containsKey(enchantment1) ? map.get(enchantment1) : 0; int j2 = map1.get(enchantment1); j2 = i2 == j2 ? j2 + 1 : Math.max(j2, i2); if(j2 > enchantment1.getMaxLevel()) { j2 = enchantment1.getMaxLevel(); } map.put(enchantment1, j2); } } ItemStack output = left.copy(); EnchantmentHelper.setEnchantments(map, output); event.setOutput(output); } } }
  11. Alright, I put all the durabilities to 0 instead of -1, it better matches the vanilla code now, but the main problem still persists. I cannot combine the items as shown in the picture, sorry if I'm being repetitive. Also when I said less than 0, I meant to say less than or equal to zero so <=0.
  12. I think it's any value less than zero. I tested it out and I don't see any noticeable differences. Either one won't work for the anvil. To give more details, I have read the RepairContainer class, it has a lot of .getMaxDamage and .getDamage calls which I believe are not working properly due to my item having a <0 durability. I have tried multiple property changes and things to no avail, I'm not sure the best way to keep my item infinite durability and make it work in the anvil at the same time. The Unbreakable NBT tag does not work either as I'm pretty sure it does the same thing as <0 durability. Here's some pictures to better explain what's going on. It combines with books fine but when it tries to combine two items, it doesn't work, probably because it's trying to do something with the durabilities when there are none.
  13. For 1.15.2 and possibly other versions. I have a custom tool that has infinite durability (maxUses set to -1). I overrided isEnchantable = true. This solved most of my problems, however there is a very specific scenario which doesn't allow it to combine with other tools if they are also unbreakable. This might not sound like a problem because, since they are infinite durability, they don't need any repairs. However, if the first item slot in the anvil has infinite durability, it cannot combine to make enchantments with anything other than books. I believe it's trying to combine durabilities when it's combining two of the same item, and it rejects the combination since there is no valid durability on the first one. Since books don't have durabilities, it skips the step. I saw some conditions on RepairContainer and tried to override some properties on my tool, but to no avail. Something interesting is that if I use an item that is not registered as infinite durability, apply the unbreakable NBT tag on one of the items, if I put the finite durability on the first slot and the infinite on the second slot, they will still combine. The problem only persists if the infinite durability item is on the first slot rather than the second slot, which is a problem since both of them are registered with infinite durability. I am not too experienced with this, does anybody know a way to bypass this anvil restriction?
  14. Hey guys, beginner programmer here who's made an ores mod. When people download the mod, the ores don't spawn in already generated chunks, they only spawn as the world expands and generates fresh chunks from player movement. I would like for my mod to spawn in already generated chunks so the player doesn't have to travel arbitrarily far to find the ores. I looked into it, and apparently there are some mods from 1.12 that have retrogen capabilities; however, I found no open-source mods for 1.14.4. I have no idea where to start. Any suggestions?
  15. Alright, thanks for that, good read. I managed to fix the problem. Here's what I did for anyone else that has the same problem as me.
  • Create New...

Important Information

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