Commits
md_5 authored 7bb75dc5c23
63 63 | |
64 64 | set.add(DataComponents.BLOCK_ENTITY_DATA); |
65 65 | set.add(DataComponents.BLOCK_STATE); |
66 66 | final PatchedDataComponentMap patcheddatacomponentmap = PatchedDataComponentMap.fromPatch(datacomponentmap, datacomponentpatch); |
67 67 | |
68 68 | - this.applyImplicitComponents(new TileEntity.b(this) { |
69 69 | + this.applyImplicitComponents(new TileEntity.b() { // CraftBukkit - decompile error |
70 70 | @Nullable |
71 71 | @Override |
72 72 | public <T> T get(DataComponentType<T> datacomponenttype) { |
73 - | |
73 + | |
74 74 | DataComponentPatch datacomponentpatch1 = datacomponentpatch.forget(set::contains); |
75 75 | |
76 76 | this.components = datacomponentpatch1.split().added(); |
77 77 | + // CraftBukkit start |
78 78 | + set.remove(DataComponents.BLOCK_ENTITY_DATA); // Remove as never actually added by applyImplicitComponents |
79 + | + set.remove(DataComponents.BLOCK_STATE); // Remove as never actually added by applyImplicitComponents |
79 80 | + return set; |
80 81 | + // CraftBukkit end |
81 82 | } |
82 83 | |
83 84 | protected void collectImplicitComponents(DataComponentMap.a datacomponentmap_a) {} |
84 - | |
85 + | |
85 86 | } |
86 87 | } |
87 88 | |
88 89 | + // CraftBukkit start - add method |
89 90 | + public InventoryHolder getOwner() { |
90 91 | + if (level == null) return null; |
91 92 | + org.bukkit.block.BlockState state = level.getWorld().getBlockAt(worldPosition.getX(), worldPosition.getY(), worldPosition.getZ()).getState(); |
92 93 | + if (state instanceof InventoryHolder) return (InventoryHolder) state; |
93 94 | + return null; |
94 95 | + } |