Giter Site home page Giter Site logo

Comments (3)

Electroblob77 avatar Electroblob77 commented on July 17, 2024

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.

from wizardry.

Tora-B avatar Tora-B commented on July 17, 2024

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.

from wizardry.

Electroblob77 avatar Electroblob77 commented on July 17, 2024

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.

from wizardry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.