[1.12.2] Collapse Block Drops invalid Lapis Ore and Charged Certus Quartz and voids lit Redstone Lamps
Freedbot opened this issue ยท 2 comments
Version Information
Forge version: 14.23.5.2860
Psi version: r1.1-78
Further Information
I get a lot of hate for supporting my old 1.12.2 pack and anything less than the latest MC thing in general. Don't care. Playing with these classic massive collections of mods is often more fun than the current releases. I will continue to post bugs as I find them and try my best to work around them. If anyone knows how/if I might resolve this through CraftTweaker, I'm listening. If I find a workaround elsewhere, I'll post it here.
- Place torch
- Place lapis ore or a redstone lamp (with adjacent redstone signal) 2 blocks above torch
- Cast a spell composed of collapse block on caster raycast position on the ore/lamp.
What I expected to happen:
drops of minecraft: lapis_ore with metadata 0 or a normal redstone lamp.
What happened instead:
drops of minecraft: lapis_ore with metadata 4 or nothing from the lamp.
This issue was previously fixed for redstone ore in #171 but even though the botania coded solution for a similar problem was referenced, a fix was not applied for lit redstone lamps, and lapis was never mentioned/noticed.
Using CT I managed to print out the nbt. Lit Redstone Lamps show up as expected and can be simply solved this way... but the more important Lapis ore... I have no clue what's going on. The nbt doesn't have metadata in it. Whatever's going wrong seemingly is happening during the failed placement or item drop, not during or before the falling block entity stage.
Here's an inefficient but effective solution for anyone who finds this issue. Requires Craft Tweaker. Save this as a .zs file in your scripts folder.
// Psi's collapse block trick and Botania's weight lens turn non-tile entity blocks into falling blocks that can be dropped on non-solid blocks (torches etc.) to effectively "silk touch" them. This doesn't work for everything. Lapis and charged certus quartz are corrupted with the wrong metadata when turned into items. Lit redstone lamps have no associated item, so they're just deleted.
// This script adapted (personal formatting preference) from friendlyhj solves the corruption issue by scanning every item entity on creation and forcibly changing the damage value back to 0.
// It does NOT fix blocks with no associated item.
import crafttweaker.entity.IEntityItem;
static fixMetaBlocks as crafttweaker.item.IIngredient = <minecraft:lapis_ore:4> | <appliedenergistics2:charged_quartz_ore:1>;
events.onEntityJoinWorld(function(event as crafttweaker.event.EntityJoinWorldEvent) {
if (event.entity instanceof IEntityItem) {
val entityItem as IEntityItem = event.entity;
if (fixMetaBlocks.matches(entityItem.item)) {
entityItem.item.mutable().withDamage(0);
}
}
});
I can also confirm that AE2: Unofficial Extended Life's charged Certus does NOT have this issue. If I notice this issue for other ores, I'll try to remember to make a note. For anyone else who finds an ore but lacks scripting knowledge, you can add to this script by putting your problem block after charged certus in the fixMetaBlocks list | modname:blockid:*. The exact incorrect meta/damage number is nice, but not required, just having * works if there aren't multiple valid items sharing the same id.