Own item trap runtime with safe lifecycle and upgrade regression tests
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
Reference in New Issue
Block a user