Mithion / ArsMagica2

Ars Magica 2 Bug Tracker
126 stars 188 forks source link

Vinteum Ore not respecting changes to mining level #1568

Closed wizard1399 closed 8 years ago

wizard1399 commented 8 years ago

Hey, I ran into a bug while trying to put a modpack together. I was attempting to use MTUtils to change the mining level of vinteum ore to level 1 (stone pickaxe), but the ore still requires an iron pick to harvest. Could someone look into this and get back to me asap. If I can't change the mining level of vinteum ore, then this issue become a pack breaker as the vinteum dust is needed to be able to get the calefactor which is required to smelt iron in the pack.

jjtParadox commented 8 years ago

There was an issue in the .008 version of AM2 that prevented harvest level being changed, but that was fixed in .009. Are you updated to the latest version of AM2?

wizard1399 commented 8 years ago

Yes, I am up to date and have the .009 vers.

wizard1399 commented 8 years ago

Yes, I am up to date and have the .009 vers.

jjtParadox commented 8 years ago

If you're already writing java code, just use BlocksCommonProxy.AMOres.setHarvestLevel("pickaxe", 1); instead.

jjtParadox commented 8 years ago

If you want only vinteum to be harvestable by stone, do BlocksCommonProxy.AMOres.setHarvestLevel("pickaxe", 1, 6);

wizard1399 commented 8 years ago

I am not writing java code. I am doing all my changes to the pack through minetweaker or other tweaker like mods.

jjtParadox commented 8 years ago

Whoops I thought that was a Java library, not a MineTweaker library. Looking at the code for the two, it all should work. Is MTUtils possibly throwing an error when it tries to load your json file?

wizard1399 commented 8 years ago

When I reload scripts in game, everything seems to be fine and I get a scripts reloaded message. If I screw up a command with MT, when I try to reload in game I would get an error message. I also tried to do the same thing using Block Properties mod, where I just change a line in the config folder and the next time I load minecraft, the changes should be made.

I noticed that all the ores in AM2 are the same id with different meta data. One of the other mods in the pack adds the ore dictionary name to WAILA and for the AM2 ores, it list the ore dictionary name twice. Is it possible that AM2 is creating 2 instances of the oredictionary reference? Maybe one of those instances is not subscribed to the right thing. Maybe the default block before the meta is applied can not be targeted by the methods MTUtils and Block Properties use.

jjtParadox commented 8 years ago

There shouldn't be anything special with the metadata and oredictionary stuff. All AM2 ores are from the same class and all have the same mining level. Can you pastebin link your configuration file so I can see what you're doing?

wizard1399 commented 8 years ago

Using MTUtils: Pastebin

Using Block Properties: Pastebin Block Properties auto generates the config file and then I should be able to make a change, save it, and reload Minecraft and the change is made for that instance. I tried changing iron ore using this method as well, and it worked just fine so I know it is not the mod.

jjtParadox commented 8 years ago

I think you need to add the word pickaxe between the quotes on line 13 of the pastebin. Also the MTUtils page says you need to import mods.MTUtils in the .zs file. Are you sure MTUtils is being loaded?

wizard1399 commented 8 years ago

there are 2 ways of calling a mod to use MT on it. If you are doing a lot of things with that particular mod, then you can import it. The other method is the one I used.

Block properties uses .json as the language. The only change to this file I made is: "level:2" -> "level:1" on line 13

jjtParadox commented 8 years ago

I can't figure out how Block Properties works, but MT should work just fine. Try adjusting the mining level of witchwood logs to use a stone axe with mods.MTUtils.setHarvestLevel(<arsmagica2:WitchwoodLog>, "axe", 1); to test if it's specific to AM2 Ores.

wizard1399 commented 8 years ago

Testing ...

Changing witchwood to stone axe ... Success! Changing iron ore to wood pickaxe ... Success! Changing vinteum ore to stone pickaxe ... Failure.

Seems the issue is specific to AM2 ores

jjtParadox commented 8 years ago

That's very weird... There's nothing special about how AM2 handles harvest level or registering the ore block.

Does changing vinteum ore to a stone axe work (not pickaxe, just axe)?

mods.MTUtils.setHarvestLevel(<arsmagica2:vinteumOre>, "axe", 1);

wizard1399 commented 8 years ago

There is a different command for changing the tool used for harvest. The command I used only changes the mining level. What was the issue in the last version?

jjtParadox commented 8 years ago

The command for getting and setting the harvest level was manually overwritten by the ores block, which screwed up a lot of stuff. That was removed, and now it acts the same way as any other block. Does that command from my previous comment do anything?

wizard1399 commented 8 years ago

The command you had me tried did change the mining level of the witchwood logs.

The only difference I notice is that all the ores use the same item ID similar to the way that wool does from vanilla MC. Could that somehow be involved?

jjtParadox commented 8 years ago

I meant the command from two comments ago (mods.MTUtils.setHarvestLevel(<arsmagica2:vinteumOre>, "axe", 1);)

Does that do anything?

wizard1399 commented 8 years ago

That is the one I tried when I ran the test. The string in the " " made no difference.

jjtParadox commented 8 years ago

That's... really odd. Let me do some more testing.

jjtParadox commented 8 years ago

Alright just tested it on my end. mods.MTUtils.setHarvestLevel(<arsmagica2:vinteumOre>, "", 1); loads fine but breaks WALIA and can't be harvested by anything properly mods.MTUtils.setHarvestLevel(<arsmagica2:vinteumOre>, "pickaxe", 1); makes vinteum ore harvestable by a stone pickaxe

Is the combination of block properties and MTUtils breaking stuff?

wizard1399 commented 8 years ago

I took block properties out for my test. I tried the second command you mentioned and it did not work. I have hardcore map reset as part of this pack. The world I was testing in is based off of a template. Could this possible be playing some factor in this

wizard1399 commented 8 years ago

It must be some kind of intermod interaction. Below is a list of what mods I currently have in the pack. You can assume I have the needed core mods and libraries.

Ars Magica 2 Accidentally Circumstantial Events Agricraft Ancient Warfare 2 Another One Bites the Dust Arcane Arteries Aura Cascade Automagy Avaritia Backpack Better Beginnings Better Loading Screen BiblioCraft Biome Tweaker Blood Magic Botania Botanical ESM Botanical Addons Chisel Cookingbook Craft Heraldry Crafting Tweaks Dragon Egg Replicator Dragon Mounts Enchiridion Essential Craft Essential Thaumaturgy Evil Craft Fast Leaf Decay Fluxed Crystals 2 Forbidden Magic FTB Lib, FTB Tweaks, FTB Utilities Gadomancy Garden Of Glass Grimoire of Gaia 3 Guide API Hardcore Map Reset Hopper Duct Hunger Overhaul Inventory Tweaks Iron Chest Jabba Just another Crafting Bench Journey Map Just a few Fish Kleeslabs Magical Decorations Mine Tweaker 3 MmmMmmMmmMmm Mod Tweaker Morph MTUtils Mystcraft Nodal Mechanics No More Recipe Conflict NEI Not Enough Resources Not Enough thaumcraft Tabs Pam's Harvest Craft Practical Logistics Prayers Recall Stones Refined Relocation Ritual Enchanting Rope Bridge Runic Dungeons Sanguimancy Storage Drawers Sym Calc Tainted Magic TCBotania Exoflame TC Inventory Scan TC Node Tracker Technomancy Thaumaturgical Knowledge Thaumcraft Thaumcraft NEI Plugin Thaumic Bases Thaumic Exploration Thaumic Horizons Thaumic Tinkerer Travellers Gear Tube Transport System Twilight Forest Waila Witchery Witching Gadgets Wooden Buckets

wizard1399 commented 8 years ago

Just tested with a fresh instance with only Ars Magica 2, Animation Api, Minetweaker, and MTUtils installed. Tried the commands:

mods.MTUtils.setHarvestLevel(arsmagica2:vinteumOre, "pickaxe", 1); mods.MTUtils.setHarvestLevel(minecraft:iron_ore, "pickaxe", 3);

The iron ore was successfully changed, but not the vinteum ore. This rules out the possibility of intermod compatibility issues. Can there be something you missed when you fixed the harvest level issue?

jjtParadox commented 8 years ago

That's exactly the setup I tested on my end, and vinteum ore was changed correctly. I had < > around the item identifier if that makes any difference.

As for what the fix was, check PR #1401. Basically changed ores to use the exact same method as any other block in Minecraft (note that witchwood and ores use the same method).

I messed up. Looks like that change never made it into the published .009 version.

@Kolatra or @Mithion, would you mind tagging 2cd3f46 with v1.4.0.009?

@wizard1399 Alright so you're going to need to compile your own version of AM2 from the code available here.

  1. Clone or Download this repository
  2. Extract download and go to the AM2 folder (Should have a README and some "gradle" stuff inside)
  3. Open a terminal or command line (Windows: with no files selected, shift+rightclick empty space in the folder and select "Open command window here")
  4. Run gradlew setupCIWorkspace build (Type it and press enter)
  5. Wait
  6. You'll find the ready mod in the build/libs folder.
wizard1399 commented 8 years ago

I am working on a macintosh. Will that make a difference?

jjtParadox commented 8 years ago

It shouldn't. You'll just need to get familiar with the Terminal app and learn how to navigate into the AM2 dir from that, and then run ./gradlew setupCIWorkspace build instead of what I listed above. Google is your friend here.

wizard1399 commented 8 years ago

That worked. Thanks for your help.

jjtParadox commented 8 years ago

Great! Mind closing this issue since it's been resolved?