mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
More Lidded Block API
This commit is contained in:
parent
f61b2947ad
commit
cd9caecbde
4 changed files with 29 additions and 1 deletions
|
@ -73,4 +73,11 @@ public class CraftBarrel extends CraftLootable<BarrelBlockEntity> implements Bar
|
||||||
public CraftBarrel copy(Location location) {
|
public CraftBarrel copy(Location location) {
|
||||||
return new CraftBarrel(this, location);
|
return new CraftBarrel(this, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - More Lidded Block API
|
||||||
|
@Override
|
||||||
|
public boolean isOpen() {
|
||||||
|
return getTileEntity().openersCounter.opened;
|
||||||
|
}
|
||||||
|
// Paper end - More Lidded Block API
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,4 +92,11 @@ public class CraftChest extends CraftLootable<ChestBlockEntity> implements Chest
|
||||||
public CraftChest copy(Location location) {
|
public CraftChest copy(Location location) {
|
||||||
return new CraftChest(this, location);
|
return new CraftChest(this, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - More Lidded Block API
|
||||||
|
@Override
|
||||||
|
public boolean isOpen() {
|
||||||
|
return getTileEntity().openersCounter.opened;
|
||||||
|
}
|
||||||
|
// Paper end - More Lidded Block API
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,4 +51,11 @@ public class CraftEnderChest extends CraftBlockEntityState<EnderChestBlockEntity
|
||||||
public CraftEnderChest copy(Location location) {
|
public CraftEnderChest copy(Location location) {
|
||||||
return new CraftEnderChest(this, location);
|
return new CraftEnderChest(this, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - More Lidded Block API
|
||||||
|
@Override
|
||||||
|
public boolean isOpen() {
|
||||||
|
return getTileEntity().openersCounter.opened;
|
||||||
|
}
|
||||||
|
// Paper end - More Lidded Block API
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class CraftShulkerBox extends CraftLootable<ShulkerBoxBlockEntity> implem
|
||||||
if (this.getTileEntity().opened && this.getWorldHandle() instanceof net.minecraft.world.level.Level) {
|
if (this.getTileEntity().opened && this.getWorldHandle() instanceof net.minecraft.world.level.Level) {
|
||||||
net.minecraft.world.level.Level world = this.getTileEntity().getLevel();
|
net.minecraft.world.level.Level world = this.getTileEntity().getLevel();
|
||||||
world.blockEvent(this.getPosition(), this.getTileEntity().getBlockState().getBlock(), 1, 0);
|
world.blockEvent(this.getPosition(), this.getTileEntity().getBlockState().getBlock(), 1, 0);
|
||||||
world.playSound(null, this.getPosition(), SoundEvents.SHULKER_BOX_OPEN, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F);
|
world.playSound(null, this.getPosition(), SoundEvents.SHULKER_BOX_CLOSE, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.1F + 0.9F); // Paper - More Lidded Block API (Wrong sound)
|
||||||
}
|
}
|
||||||
this.getTileEntity().opened = false;
|
this.getTileEntity().opened = false;
|
||||||
}
|
}
|
||||||
|
@ -73,4 +73,11 @@ public class CraftShulkerBox extends CraftLootable<ShulkerBoxBlockEntity> implem
|
||||||
public CraftShulkerBox copy(Location location) {
|
public CraftShulkerBox copy(Location location) {
|
||||||
return new CraftShulkerBox(this, location);
|
return new CraftShulkerBox(this, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - More Lidded Block API
|
||||||
|
@Override
|
||||||
|
public boolean isOpen() {
|
||||||
|
return getTileEntity().opened;
|
||||||
|
}
|
||||||
|
// Paper end - More Lidded Block API
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue