mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 11:53:29 +01:00
parent
20ca7711ff
commit
99fc5e7cc9
1 changed files with 14 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
||||||
package de.ellpeck.naturesaura.packet;
|
package de.ellpeck.naturesaura.packet;
|
||||||
|
|
||||||
|
import de.ellpeck.naturesaura.NaturesAura;
|
||||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||||
import de.ellpeck.naturesaura.chunk.AuraChunk;
|
import de.ellpeck.naturesaura.chunk.AuraChunk;
|
||||||
import de.ellpeck.naturesaura.events.ClientEvents;
|
import de.ellpeck.naturesaura.events.ClientEvents;
|
||||||
|
@ -63,13 +64,18 @@ public class PacketAuraChunk {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean tryHandle(World world) {
|
public boolean tryHandle(World world) {
|
||||||
Chunk chunk = world.getChunk(this.chunkX, this.chunkZ);
|
try {
|
||||||
if (chunk.isEmpty())
|
Chunk chunk = world.getChunk(this.chunkX, this.chunkZ);
|
||||||
return false;
|
if (chunk.isEmpty())
|
||||||
AuraChunk auraChunk = (AuraChunk) chunk.getCapability(NaturesAuraAPI.capAuraChunk).orElse(null);
|
return false;
|
||||||
if (auraChunk == null)
|
AuraChunk auraChunk = (AuraChunk) chunk.getCapability(NaturesAuraAPI.capAuraChunk).orElse(null);
|
||||||
return false;
|
if (auraChunk == null)
|
||||||
auraChunk.setSpots(this.drainSpots);
|
return false;
|
||||||
return true;
|
auraChunk.setSpots(this.drainSpots);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
NaturesAura.LOGGER.error("There was an error handling an aura chunk packet", e);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue