12
12
13
13
public class CraftBarrel extends CraftLootable <BarrelBlockEntity > implements Barrel {
14
14
15
- public CraftBarrel (World world , BarrelBlockEntity tileEntity ) {
16
- super (world , tileEntity );
15
+ public CraftBarrel (World world , BarrelBlockEntity blockEntity ) {
16
+ super (world , blockEntity );
17
17
}
18
18
19
19
protected CraftBarrel (CraftBarrel state , Location location ) {
@@ -31,37 +31,37 @@ public Inventory getInventory() {
31
31
return this .getSnapshotInventory ();
32
32
}
33
33
34
- return new CraftInventory (this .getTileEntity ());
34
+ return new CraftInventory (this .getBlockEntity ());
35
35
}
36
36
37
37
@ Override
38
38
public void open () {
39
39
this .requirePlaced ();
40
- if (!this .getTileEntity ().openersCounter .opened ) {
41
- BlockState blockData = this .getTileEntity ().getBlockState ();
40
+ if (!this .getBlockEntity ().openersCounter .opened ) {
41
+ BlockState blockData = this .getBlockEntity ().getBlockState ();
42
42
boolean open = blockData .getValue (BarrelBlock .OPEN );
43
43
44
44
if (!open ) {
45
- this .getTileEntity ().updateBlockState (blockData , true );
45
+ this .getBlockEntity ().updateBlockState (blockData , true );
46
46
if (this .getWorldHandle () instanceof net .minecraft .world .level .Level ) {
47
- this .getTileEntity ().playSound (blockData , SoundEvents .BARREL_OPEN );
47
+ this .getBlockEntity ().playSound (blockData , SoundEvents .BARREL_OPEN );
48
48
}
49
49
}
50
50
}
51
- this .getTileEntity ().openersCounter .opened = true ;
51
+ this .getBlockEntity ().openersCounter .opened = true ;
52
52
}
53
53
54
54
@ Override
55
55
public void close () {
56
56
this .requirePlaced ();
57
- if (this .getTileEntity ().openersCounter .opened ) {
58
- BlockState blockData = this .getTileEntity ().getBlockState ();
59
- this .getTileEntity ().updateBlockState (blockData , false );
57
+ if (this .getBlockEntity ().openersCounter .opened ) {
58
+ BlockState blockData = this .getBlockEntity ().getBlockState ();
59
+ this .getBlockEntity ().updateBlockState (blockData , false );
60
60
if (this .getWorldHandle () instanceof net .minecraft .world .level .Level ) {
61
- this .getTileEntity ().playSound (blockData , SoundEvents .BARREL_CLOSE );
61
+ this .getBlockEntity ().playSound (blockData , SoundEvents .BARREL_CLOSE );
62
62
}
63
63
}
64
- this .getTileEntity ().openersCounter .opened = false ;
64
+ this .getBlockEntity ().openersCounter .opened = false ;
65
65
}
66
66
67
67
@ Override
@@ -77,7 +77,7 @@ public CraftBarrel copy(Location location) {
77
77
// Paper start - More Lidded Block API
78
78
@ Override
79
79
public boolean isOpen () {
80
- return getTileEntity ().openersCounter .opened ;
80
+ return getBlockEntity ().openersCounter .opened ;
81
81
}
82
82
// Paper end - More Lidded Block API
83
83
}
0 commit comments