MightyPirates / BedrockOres

A minecraft mod that adds ore clusters embedded in bedrock, and a machine to extract them automatically.
https://www.curseforge.com/minecraft/mc-mods/bedrockores
Other
12 stars 11 forks source link

Block Hardness (Continuation/Expansion of Issue #5) #61

Closed Tellik closed 6 years ago

Tellik commented 6 years ago

I've been doing some testing, and either need to clarify a few things or make a feature request.

Ultimately what I want to do is allow players to harvest ore from the bedrock ore by hand, however, I want it to take much longer than finding regular ore outside of the bedrock. While I can accomplish it by changing the global hardness of everything, it would be very tedious to add every other block into the blacklist to keep vanilla hardness for everything else but bedrock ores. And while I know IguanaTweaks can adjust hardness of the bedrock ores, I don't know how to make it happen due to the way bedrock ores seems to just wrap the vanilla ore as a tile entity.

"The hardness is just the hardness of the contained ore: harvestability and hardness checks are forwarded to the contained ore block"

This does not seem to be the case. I used IquanaTweaks for this test, which allows you to change the hardness of blocks, either globally or individually.

Changing the global hardness to 16x, I attempted to mine vanilla gold ore in bedrock. As expected, the mining took quite a while. So I know that IquanaTweaks was able to successfully adjust hardness of these blocks specifically (and all blocks since this was a global test.)

Next I mined vanilla gold ore without it being in bedrock, and the mining behavior was the same.

In IquanaTweaks I set minecraft:gold_ore to the blacklist, so that it wasn't affected by the 16x hardness change. When mining vanilla gold ore without it being in bedrock, it mined quickly as per what you'd expect with vanilla mining behavior. However, when I attempted to mine it inside of the bedrock, it still was under the effect of 16x hardness.

Using TellMe, it gave me the following information: Gold Ore (minecraft:gold_ore - 14:0) !! is not supposed to have a TileEntity, but there is one in the world!!

I'm not sure exactly if CraftTweaker would be able to accomplish it in a script since it's a little more powerful, but I think I would need a little more information and figure out how CraftTweaker works exactly.

Edit: While setting the hardness for the ore that's used in the bedrock ore is possible, this still changes the ore itself including the vanilla ore. What I'd be looking for would be an internal mod option that could change the hardness of all bedrock ores.

Edit: The largest reason for the request is the ability to have the ore spawn in other locations, outside of bedrock, and not be effected by the hardness that would have included all instances of that ore. Basically, early game through bedrock it mines slower, but later game it's easier to mine.

OneEyeMaker commented 6 years ago

Instead of changing hardness of (vanilla/mod) ore, you, probably, need to change hardness of block from BedrockOres itself. It won't affect all (vanilla/mod) ore blocks - it should just change hardness of all bedrock ores.

Tellik commented 6 years ago

That's pretty tricky from what I've seen. Bedrock ores aren't a block per say, they're a tile entity, when they shouldn't be. Tile entities don't have a hardness associated with them. I could do some more testing with CraftTweaker, but from what I saw when I looked into how to do it, it had to be done internally. (Unless you've already done something like this and have an easy solution.)

OneEyeMaker commented 6 years ago

@Tellik I guess you don't fully understand how mod works. Bedrock ore - is a single block (block!) that wraps all kinds of ores. Mod doesn't do anything with (vanilla/modded) ores - it doesn't transform its to 'bedrock' variant. Instead mod just creates single block, which can imitate look and behavior of any ore. But Minecraft block can have only 16 (AFAIK) different variants. If mod used only block, one could create only 16 bedrock ores. That's why mod uses TileEntity to store hundreds and thousands of different (ore) variants.

About your problem with block hardness. I didn't tested, but I guess you just need to modify hardness of block of bedrock ore. It's registered as bedrockores:bedrock_ore.

Tellik commented 6 years ago

I understood it just as much as what various mods and information was telling me. Basically that yes, bedrock ore, as a block, was effectively wrapping the ore as a tile entity to allow it to basically imitate the ore that you wanted. I'm sure there were some more details there, but I tried thinking of it in simple terms.

I am actually not sure what I was doing before. I tried various things of adjusting the hardness of bedrockores:bedrock_ore that weren't working. CraftTweaker scripts that worked on every other block hardness weren't affecting it. (I'll have to test this later to see if I get a script to work.) Before when I posted it (after trying that and Iguana Tweaks Reborn, it wasn't working); however, previous ITR didn't have functionality to affect blocks with meta data. An update was just released that I'm using and is working.

So either I was previously just completely clueless and messing it up completely, or something the various updates allowed my to affect the bedrock_ores specifically. Either way, it's all good now