Own item trap runtime with safe lifecycle and upgrade regression tests

This commit is contained in:
2026-09-24 22:25:12 +03:00
parent c9a4e9d643
commit 0ab34eef48
26 changed files with 1486 additions and 53 deletions
@@ -0,0 +1,19 @@
package online.astradev.content.trap;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Display;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.level.storage.ValueOutput;
final class ItemTrapDisplay extends Display.ItemDisplay {
ItemTrapDisplay(ServerLevel level) {
super(EntityTypes.ITEM_DISPLAY, level);
setNoGravity(true);
setInvulnerable(true);
setTransformationInterpolationDuration(1);
setPosRotInterpolationDuration(1);
addTag(ItemTrapCapabilities.displayTag());
}
@Override public boolean shouldBeSaved() { return false; }
@Override public boolean saveAsPassenger(ValueOutput output) { return false; }
}