Jump to content

Nuke3d

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by Nuke3d

  1. That is indeed how I have it setup, however, I have two providers now. I am thinking I just need one provider that checks the cap requested in getCapability and returns implimentation(lazy optrional.cast() actually). I can see how that works. I'll have to handle both in serializeNBT and deserializeNBT as well I believe.
  2. Item#initCapabilities returns an ICapabilityProvider. This is working great, but now my mod has a second capability that needs to be added to some items that already have the first capability. How is this handled? Or do I need to create a provider that implements both interfaces now?
  3. *sigh* <people who know what they're talking about> have already spoken up and told you what you needed to know. You didn't like what they had to say and now you're just being rude. You had some very insightful responses from people. Bottom line, it really isn't done because it really isn't feasible or worth the time. Minecraft is written in Java. I get that that may not be your favorite language, but if you want to do MC in C#, there are no known projects that will let you do this, so you'll have to do it yourself. You do not have the Java chops to do it yet and since there are no projects that will allow you to do it, your only choice is to learn to mod MC in Java until you are experienced enough to handle both the Java and C#(and possibly C++) stuff yourself. You do not sound experienced enough in any of those languages to pull it off. I've been around programmers my entire life (I'm almost 50) and experienced programmers...well, you can just tell when they are talking about what they're good at. Maybe I'm wrong(wouldn't be the first time) but my advice to you is to listen to the "elders" of the forum. It sounds like you do not want to do this anyway, so, *shrug* I guess that's that. And please don't take any of this as insult. It's not. It's just truth. Sometimes truth cuts deep. Life is like that.
  4. I would recommend you start out modding in Java, and then once you feel you have decent command of that, if you still want to try doing it in C# go for it. You'll likely have the tools to make it happen on your own at that point too, and could start assembling your own group around the project. Good luck whatever you choose!
  5. This. I mean, unless you are trying to use C# for fun or education, just use Java. All the wrappers and who knows what else will just cause more problems and make things run slower if they work at all.
  6. I appreciate the ideas. I think it seems too risky to call getOffer during initialization like that.I can see what is being done for Vanilla mobs, but other mod authors might be doing other things with that entity object. Thanks for the ideas though! I will revisit another time.
  7. Doesn’t that require an entity as an argument? At this point in unit don’t have a reference to an entity. Perhaps I could just create one but not sure if that will work?
  8. Going to bump this as I just want to confirm something I *think* I know, but perhaps my Java-fu is not strong enough. I am trying to modify the list of trades for a villager type by removing any trade that involves emeralds, which should be the great majority of vanilla trades. During init I can get the trades. I can see each one, but they appear to be just a pointer to the object that implements ITrade for that trade. That being the case, I cannot actually see an actual trade to see if Emeralds are involved, so I can't delete the trade based on that. I don't want to just clear the trades and populate my own because that would not play nicely with other mods that might have added trades involving emeralds, which I don't want to do. Further, I am not totally certain that vanilla doesn't have any non-emerald trades(I've never seen any, but I haven't traded a ton), but if there are some, or if a future version adds them, I don't want to delete those. Just the annoyingly expensive vanilla emerald trades, which are being replaced with much more sensible ones. Add this point it appears to me that it's all or nothing, and I'll have to just be content with adding my trades for now until my Java skills are up to the task of figuring out how to override the vanilla villager/trade system. If there is some other way then please let me know, otherwise, I will be content with what I have for now and move on to the next part of my mod. Thanks!
  9. Alright, that is something I'll have to put off until later then as it sounds like quite a bit of work. For now, just removing the vanilla emerald trades will work. Would be great if forge allowed us more control over the trades, or even made another event the fired after the trades were chosen that let us modify the final list but I digress. Thank you!
  10. Well, it's a little more than that. Maybe my understanding is not correct, but I thought the list of trades were possible trades, but they were not all offered every time. For instance, the unmodifed level 1 farmer trades are wheat, potatoes, carrots, beetroot, and bread, but not all of those appear as a trade when clicking on the villager every time. I haven't followed the code but I assume there is something that causes only some of those to appear on the list. I guess I need to learn what causes it and figure out how to get certain items to appear on the list every day. (The concept is to make, for example, a blacksmith to always be able to sell some iron ingots every day.) Sorry if that was not more clear.
  11. I have been able to populate my alternate trades into the villager trade lists. Now I want to see if certain trades can always be available(the max uses will still be enforced, but I want them to always be in the list.) Is there any way to do this? Also, I want to remove most of the emerald trades. I *think* the best way to do this is in the trade initialization process to spin through event.getTrades().get() for each skill level of the trade and remove the ones I don't want. Just want to make sure I'm doing it the best way. Source at https://github.com/nuke3d/NukesEcon if interested.
  12. That worked. Thank you! You may get yourself a juice box. =]
  13. Thank you! I will give it a shot. Money was never supposed to grow on trees like this. =p
  14. Some time ago I used the GLM system to modify drops for several mobs, chests, etc. It all seemed to work well and I have since moved on to other parts of my mod. Yesterday I noticed that when a villager harvested some wheat, it was adding some of my drops. I did not do any harvest drops, yet there it was. In looking closer, it looks like the loot table ID is "minecraft:blocks/wheat", which I expected. The GLM that is being matches is my villager GLM: { "type": "nukesecon:addcoins", "conditions": [ { "condition": "minecraft:entity_properties", "predicate": { "type": "minecraft:villager" }, "entity": "this" } ], "numRolls": 5, "woodChance": 10, "ironChance": 1, "copperChance": 0.1, "goldChance": 0.001, "diamondChance": 0, "emeraldChance": 0 } This was meant to drop items should you kill a villager, and not modify the loot table should the villager harvest a block. I think this was just an unexpected consequence and I'm going to have to modify my GLMs to handle the fact that when an entity such as a villager acts on a block, such as harvesting wheat, this will match the condition/predicate. Anyway, I just thought I would ask the forum for advice on the best way to accomplish all this before I go too much further. Essentially, the goal is to drop coins when you kill mobs. The coins can also appear in chests and whatnot. Full source can be found here if interested: https://github.com/nuke3d/NukesEcon Thanks you!
  15. Ended up moving to 1.16 where it worked fine. Thanks again.
  16. Thank you! I will see about handling it manually for now. Planning on going to 1.16 soon, but wasn't go to do that quite yet.
  17. Quick update. I created a flat world and used a spawn egg to spawn a zombie. Killed the zombie and the error occurred again, so there's definitely something wrong with my stuff. Here is a more complete error log: [19:08:01] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.crash.ReportedException: Ticking entity at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:890) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:821) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:662) [?:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151] {} Caused by: java.lang.NullPointerException at net.minecraft.world.storage.loot.conditions.EntityHasProperty.test(EntityHasProperty.java:32) ~[?:?] {re:classloading} at net.minecraft.world.storage.loot.conditions.EntityHasProperty.test(EntityHasProperty.java:18) ~[?:?] {re:classloading} at net.minecraftforge.common.loot.LootModifier.apply(LootModifier.java:53) ~[?:?] {re:classloading} at net.minecraftforge.common.ForgeHooks.modifyLoot(ForgeHooks.java:1194) ~[?:?] {re:classloading} at net.minecraft.world.storage.loot.LootTable.generate(LootTable.java:86) ~[?:?] {re:classloading} at net.minecraft.entity.LivingEntity.dropLoot(LivingEntity.java:1246) ~[?:?] {re:classloading} at net.minecraft.entity.MobEntity.dropLoot(MobEntity.java:471) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.LivingEntity.spawnDrops(LivingEntity.java:1204) ~[?:?] {re:classloading} at net.minecraft.entity.LivingEntity.onDeath(LivingEntity.java:1165) ~[?:?] {re:classloading} at net.minecraft.entity.LivingEntity.attackEntityFrom(LivingEntity.java:1013) ~[?:?] {re:classloading} at net.minecraft.entity.monster.MonsterEntity.attackEntityFrom(MonsterEntity.java:68) ~[?:?] {re:classloading} at net.minecraft.entity.monster.ZombieEntity.attackEntityFrom(ZombieEntity.java:335) ~[?:?] {re:classloading} at net.minecraft.entity.Entity.baseTick(Entity.java:428) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.LivingEntity.baseTick(LivingEntity.java:289) ~[?:?] {re:classloading} at net.minecraft.entity.MobEntity.baseTick(MobEntity.java:232) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.Entity.tick(Entity.java:396) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2184) ~[?:?] {re:classloading} at net.minecraft.entity.MobEntity.tick(MobEntity.java:311) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.monster.ZombieEntity.tick(ZombieEntity.java:224) ~[?:?] {re:classloading} at net.minecraft.world.server.ServerWorld.updateEntity(ServerWorld.java:615) ~[?:?] {re:classloading} at net.minecraft.world.World.guardEntityTick(World.java:586) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:404) ~[?:?] {re:classloading} at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:886) ~[?:?] {re:classloading,pl:accesstransformer:B} ... 4 more
  18. As a pretext to adding some Items to various mob and chest loot tables, I decided to just modify the vanilla zombie loot table. I think things are Registering correctly, but I am getting some null pointer exceptions thrown whenever loot generation occurs. Not even for Zombies. Just random stuff. Here's the details: Code/JSON items relevant to issue(I think): https://github.com/nuke3d/NukesEcon/blob/master/src/main/resources/data/forge/loot_modifiers/global_loot_modifiers.json https://github.com/nuke3d/NukesEcon/blob/master/src/main/resources/data/nukesecon/loot_modifiers/zombie.json https://github.com/nuke3d/NukesEcon/blob/master/src/main/java/com/nuke3dtv/nukesecon/data/LootTableModifier.java https://github.com/nuke3d/NukesEcon/blob/master/src/main/java/com/nuke3dtv/nukesecon/setup/Registration.java Exception detail: [15:53:30] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server java.lang.NullPointerException: null at net.minecraft.world.storage.loot.conditions.EntityHasProperty.test(EntityHasProperty.java:32) ~[?:?] {re:classloading} at net.minecraft.world.storage.loot.conditions.EntityHasProperty.test(EntityHasProperty.java:18) ~[?:?] {re:classloading} at net.minecraftforge.common.loot.LootModifier.apply(LootModifier.java:53) ~[?:?] {re:classloading} at net.minecraftforge.common.ForgeHooks.modifyLoot(ForgeHooks.java:1194) ~[?:?] {re:classloading} at net.minecraft.world.storage.loot.LootTable.generate(LootTable.java:86) ~[?:?] {re:classloading} at net.minecraft.block.Block.getDrops(Block.java:622) ~[?:?] {re:classloading,pl:accesstransformer:B}... Any guidance on where the problem is would be appreciated. I'll keep plugging away at it in the meantime. Thank you!
×
×
  • Create New...

Important Information

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