prevent crash when using sundial outside of overworld (#210)

This commit is contained in:
Jeremiah Winsley 2021-05-22 13:44:20 -04:00 committed by GitHub
parent 7135de5960
commit e06b2030fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.world.GameRules; import net.minecraft.world.GameRules;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
import net.minecraft.world.storage.ServerWorldInfo; import net.minecraft.world.storage.IServerWorldInfo;
import java.util.List; import java.util.List;
@ -48,7 +48,7 @@ public class TileEntityTimeChanger extends TileEntityImpl implements ITickableTi
this.sendToClients(); this.sendToClients();
return; return;
} }
((ServerWorldInfo) this.world.getWorldInfo()).setDayTime(current + toAdd); ((IServerWorldInfo) this.world.getWorldInfo()).setDayTime(current + toAdd);
BlockPos spot = IAuraChunk.getHighestSpot(this.world, this.pos, 35, this.pos); BlockPos spot = IAuraChunk.getHighestSpot(this.world, this.pos, 35, this.pos);
IAuraChunk.getAuraChunk(this.world, spot).drainAura(spot, (int) toAdd * 20); IAuraChunk.getAuraChunk(this.world, spot).drainAura(spot, (int) toAdd * 20);