mirror of
https://github.com/BG-Software-LLC/WildLoaders.git
synced 2024-11-24 12:15:28 +01:00
Fixed a NPE when placing a chunk loader (#77)
This commit is contained in:
parent
901f630d89
commit
a07499aa66
@ -41,6 +41,8 @@ public final class TileEntityChunkLoader extends TileEntity implements ITickable
|
|||||||
|
|
||||||
loaderBlock = world.getType(blockPosition).getBlock();
|
loaderBlock = world.getType(blockPosition).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -68,8 +70,6 @@ public final class TileEntityChunkLoader extends TileEntity implements ITickable
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,6 +49,8 @@ public final class TileEntityChunkLoader extends TileEntity implements ITickable
|
|||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -76,8 +78,6 @@ public final class TileEntityChunkLoader extends TileEntity implements ITickable
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,6 +48,8 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
|
|
||||||
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -76,8 +78,6 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -48,6 +48,8 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
|
|
||||||
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -76,8 +78,6 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -48,6 +48,8 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
|
|
||||||
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -76,8 +78,6 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -48,6 +48,8 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
|
|
||||||
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -76,8 +78,6 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -48,6 +48,8 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
|
|
||||||
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -76,8 +78,6 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -48,6 +48,8 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
|
|
||||||
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
loaderBlock = serverLevel.getBlockState(blockPos).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -76,8 +78,6 @@ public final class ChunkLoaderBlockEntity extends BlockEntity implements ITileEn
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -41,6 +41,8 @@ public final class TileEntityChunkLoader extends TileEntity implements IUpdatePl
|
|||||||
|
|
||||||
loaderBlock = world.getType(blockPosition).getBlock();
|
loaderBlock = world.getType(blockPosition).getBlock();
|
||||||
|
|
||||||
|
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
||||||
|
|
||||||
if (!this.chunkLoader.isInfinite()) {
|
if (!this.chunkLoader.isInfinite()) {
|
||||||
long timeLeft = chunkLoader.getTimeLeft();
|
long timeLeft = chunkLoader.getTimeLeft();
|
||||||
|
|
||||||
@ -68,8 +70,6 @@ public final class TileEntityChunkLoader extends TileEntity implements IUpdatePl
|
|||||||
currentY += 0.23;
|
currentY += 0.23;
|
||||||
holograms.add(hologram);
|
holograms.add(hologram);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cachedPlacerName = Optional.ofNullable(this.chunkLoader.getWhoPlaced().getName()).orElse("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user