Electroblob's Wizardry

Electroblob's Wizardry

18M Downloads

Add smelting recipe for crystal ore -> magic crystal

Tora-B opened this issue ยท 3 comments

commented

Minecraft version: 1.12.2
Wizardry version: 4.1.1

Issue details: There are no recipes involving Crystal Ore, which means that if the player acquires it, using Silk Touch, for example, there's nothing that can be done with it other than place it back down and use a non-Silk Touch tool to harvest it. Vanilla ores have smelting recipes, which, while inefficient on their own, other mods tend to draw from those recipes for their own mechanics.

In my case, I'd like to process those crystal ores in Thermal Expansion machines, so adding recipes that the Redstone Furnace or Pulverizer can pick up on would streamline the process. Thermal Expansion now has support for JSON recipes, so I can easily add it myself, but you may wish to solve the pure (Vanilla + Wizardry) use case yourself, just to improve the user experience.

commented

On that note... In attempting to put together appropriate recipes, I went looking through the code, and I'm a bit confused as to your intentions on the ore. It looks like it drops 1-2 crystals when mined, and Fortune only provides a bonus at level 2 or higher.

		if(fortune > 0){
			return random.nextInt(2) + 1 + random.nextInt(fortune);
		}else{
			return random.nextInt(2) + 1;
		}

That's going to give you [0 to 1] + 1 + [0 to Fortune level - 1], so that's nothing for Fortune I, up to a bonus of 2 for Fortune III. Maybe it's just coding style, but given the way that block of code is laid out, it looks to me like you expected random.nextInt() to include the upper bound, and thus the ore drops fewer crystals than intended. If you intended for Fortune I to have no effect, it would have been more clear to check for fortune > 1, rather than making a call to random.nextInt(1), which will only ever return 0.

The other thing that leads me to this suspicion is that flowers seem like a much better source of crystals than ore: They're easy to find, require no resources to harvest, and are simply crafted by hand into two crystals. While they can't be grown as crops, they can be generated with bonemeal, which is renewable, and it's not difficult to make a very fast system to automate that generation -- purely in vanilla Minecraft.

Ores are more difficult to find, require a pick, thus consuming durability on a tool, and don't generally produce as many crystals. Only at Fortune III will ore produce more crystals than flowers on average, and just barely, at 2.5 crystals per ore. [1 to 3] + [0 to Fortune] for a total of 1 to 6 with Fortune III, averaging 3.5 crystals per ore, seems a bit more consistent, so I suspect that's what you had intended.

All that said, a smelting recipe of one ore -> one crystal seems weird at first glance, but is consistent with vanilla recipes for similar items, such as redstone or lapis. Those recipes seem like a trap, since they punish the player for using a rare, and otherwise beneficial enchantment, but they may be intended to encourage the player to use a variety of tools, with different enchantments, rather than depending on a single one. That would be consistent with the randomness of the vanilla enchanting system, and the anvil mechanics forcing replacement rather than perpetual use. Mending and villager trading have changed the equation over the years, but there's a lot of historical leftovers in the Minecraft codebase.

commented

Yes, I need to add a smelting recipe to smelt one crystal ore into one crystal. That will probably end up in the next patch because it's such a minor change. Feel free to add one yourself for now.

commented

You know, I was looking at that bit of code the other day and thought exactly the same thing. It's probably the oldest bit of code in the entire mod so it's no wonder it's broken. I'll have to look at vanilla ore blocks and see how they do that calculation. Crystal ore should be consistent with redstone/lapis, just with a different spawn rate and not dropping quite as many per ore block.