Ender Zoo

Ender Zoo

12M Downloads

[1.9.4] Khndrel Keght spawning from Slimy Grass

Mohron opened this issue ยท 26 comments

commented

Version: EnderZoo-1.9.4-1.2.2.40
Tinkers': TConstruct-1.9.4-2.3.1.jenkins229.jar

Honestly not 100% sure what mod the problem lies in here but a Khndrel Keght can spawn from TiC Slimy Grass even when harvested with a shovel. In my tests, this does not occur with TiC slimey dirt, vanilla dirt or grass.

FYI @SlimeKnights

commented

It seems Slimy Grass is a kind of Grass (which makes sense) but the shovel doesn't recognize it as such (we ask the item if it can be used on the block). I'll have a look into the vanilla shovel code tonight.

Update: This changed in 1.8 or 1.9, now we need to ask the block about the tool.

commented

I our tests, we tried both Minecraft and TiC shovels. Both spawned the lovely slimes of death :)

commented

Maybe

if (block instanceof BlockSlimeGrass) {
    event.setCanceled(true);
    ChatHelper.toPlayer(event.getPlayer(), "Use an effective tool to break this!");
}

would help?

(just kidding, I'm not that evil...)

commented

It just makes slime islands especially dangerous places with EnderZoo installed. I guess something has to protect the coveted Kightslime material...

commented

Actually it's no problem. As those blocks have no effective tool anyway, they break as fast using your bare hands. And bare hands don't spawn Khndrel Keght.

commented

In my experience it certainly does... the version I'm using here does. Breaking dirt with you hand is scary.

commented

Then that's a bug. One that I'll stomp now.

commented

Honestly I thought that was a feature. After all, it forces you to use the proper tool (if such a thing exists)!

commented

It's a safeguard. If you'd manage to fall into a hole with no shovel on you, you'd be dead.

However, I just tried in a clean dev environment and nothing's spawning. So it may be a mod interaction. Any idea with which mod?

commented

Only dirt does it, not grass. if it's another mod, that would take a lot of testing to drill down. We found this issue while test our modpack Rebel Uprising.

commented

And if it makes any difference, I also experienced the hand-breaking=spawning behavior in 1.7.10

commented

No, doesn't happen with dirt here either. And it's a really funny thing because the only time either dirt or grass in mentioned in our code is:

    if (!(event.getState().getBlock() instanceof BlockDirt || event.getState().getBlock() instanceof BlockGrass)) {
      return;
    }    
commented

Can I send you a test version with some debug statements in it? That'd be the fasted way to find out what's happening...

commented

I think my friend just figured out what we've been doing wrong. We would start with a bare hand but after 1 piece of dirt, it was not longer bare... So it's my mistake, that works as intended.

commented

Anyway you can blacklist spawning on the slime blocks though, because telling players to not use a shovel on grass blocks isn't really a solution.

commented

Oops, that'd do it. That actually happened to me during my testing, too. I just dismissed it because it was so obvious...

commented

I'm a bit torn. On the one hand people don't expect it, on the other hand the slime grass has no effective tool on purpose. And then we'd have another list of modded blocks we'd have to maintain (major pain in Ender IO...).

Let me think about it for a day or so. Feel free to nag me on Monday if I forget. (commenting here will notify me)

commented

I already have a regrettable fix, because I don't want to be any trouble. It should have gotten changed on the TiC side imo. I can just disable Khndrel Keghts in my mod pack to remove the unwanted behavior.

commented

Instead of you having to maintain the blacklist, could a block blacklist be supported by the SpawnConfig_xxx.xml files?

commented

Doesn't make much difference whether it's in the xml, the config or hardcoded...

commented

I'm only asking for the capability. no default blacklist. Users/mod pack designers will be responsible for adding blocks if necessary. Ultimately, I don't want you feeling like I need you to add a feature that's not (easily) maintainable. I don't want that and neither do you.

commented

I think I found a better solution. As we are only working on dirt and grass blocks, we can just assume any shovel is effective, no matter what the block says. In fact, I would have implemented it that way instead of using the isEffective() check, but in 1.7.10 that call went to the tool which then checked if it wanted to be considered a shovel.

commented

I love it! Virtual High five to you ๐Ÿ‘

commented

Yes, that's a bug in Tinkers. The BlockSlimeGrass doesn't have any harvest level set, so no tool is effective on it. And on the other hand it extends BlockGrass, so our code detects it as a kind of dirt. SlimeDirt on the other hand is not a kind of dirt (why? please!).

All it needs is setHarvestLevel("shovel", 0); in its constructor.

commented

Well Boni acted just like I've come to expect... Any other way to fix this without his help?

commented

(why? please!)

Grass has logic. Dirt doesn't.