File tree 1 file changed +40
-1
lines changed
src/main/java/dev/hephaestus/glowcase/block/entity
1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change 5
5
import net .minecraft .block .entity .BlockEntity ;
6
6
import net .minecraft .entity .Entity ;
7
7
import net .minecraft .entity .player .PlayerEntity ;
8
+ import net .minecraft .inventory .Inventory ;
8
9
import net .minecraft .item .ItemStack ;
9
10
import net .minecraft .item .SpawnEggItem ;
10
11
import net .minecraft .nbt .NbtCompound ;
27
28
import java .util .Set ;
28
29
import java .util .UUID ;
29
30
30
- public class ItemDisplayBlockEntity extends BlockEntity {
31
+ public class ItemDisplayBlockEntity extends BlockEntity implements Inventory {
31
32
private ItemStack stack = ItemStack .EMPTY ;
32
33
private Entity displayEntity = null ;
33
34
@@ -238,6 +239,44 @@ public enum Offset {
238
239
CENTER , BACK , FRONT
239
240
}
240
241
242
+ // hopper extraction
243
+
244
+ @ Override
245
+ public int size () {
246
+ return 1 ;
247
+ }
248
+
249
+ @ Override
250
+ public boolean isEmpty () {
251
+ return stack .isEmpty ();
252
+ }
253
+
254
+ @ Override
255
+ public ItemStack getStack (int slot ) {
256
+ return stack .copyWithCount (1 );
257
+ }
258
+
259
+ @ Override
260
+ public ItemStack removeStack (int slot , int amount ) {
261
+ return stack .copyWithCount (1 );
262
+ }
263
+
264
+ @ Override
265
+ public ItemStack removeStack (int slot ) {
266
+ return stack .copyWithCount (1 );
267
+ }
268
+
269
+ @ Override
270
+ public void setStack (int slot , ItemStack stack ) {}
271
+
272
+ @ Override
273
+ public boolean canPlayerUse (PlayerEntity player ) {
274
+ return false ;
275
+ }
276
+
277
+ @ Override
278
+ public void clear () {}
279
+
241
280
// standard blockentity boilerplate
242
281
243
282
public void dispatch () {
You can’t perform that action at this time.
0 commit comments