mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
#687: Add visibility and fixed API for ItemFrames
By: SydMontague <sydmontague@phoenix-staffel.de>
This commit is contained in:
parent
a74fb02e61
commit
83f25730bd
@ -1,5 +1,14 @@
|
||||
--- a/net/minecraft/server/EntityItemFrame.java
|
||||
+++ b/net/minecraft/server/EntityItemFrame.java
|
||||
@@ -11,7 +11,7 @@
|
||||
private static final DataWatcherObject<ItemStack> ITEM = DataWatcher.a(EntityItemFrame.class, DataWatcherRegistry.g);
|
||||
private static final DataWatcherObject<Integer> g = DataWatcher.a(EntityItemFrame.class, DataWatcherRegistry.b);
|
||||
private float an = 1.0F;
|
||||
- private boolean ao;
|
||||
+ public boolean ao; // PAIL private -> public // PAIL rename isFixed
|
||||
|
||||
public EntityItemFrame(EntityTypes<? extends EntityItemFrame> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -53,16 +53,27 @@
|
||||
@Override
|
||||
protected void updateBoundingBox() {
|
||||
|
@ -128,6 +128,26 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return !getHandle().isInvisible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean visible) {
|
||||
getHandle().setInvisible(!visible);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFixed() {
|
||||
return getHandle().ao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFixed(boolean fixed) {
|
||||
getHandle().ao = fixed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityItemFrame getHandle() {
|
||||
return (EntityItemFrame) entity;
|
||||
|
Loading…
Reference in New Issue
Block a user