forked from BynBang/OpenPrestige
fixed bugs, memory leaks, etc
This commit is contained in:
1 parent
aa4f6b6ddc
commit
c3f8f23c1d
124 files changed
+1060
-420
No files matched your search
@@ -29,7 +29,7 @@ public class BotFilter implements MinecraftAccess {
|
||||
public void onClientTick(ClientTickEvent event) {
|
||||
this.validityCache.clear();
|
||||
if (!this.validatedPlayers.isEmpty()) {
|
||||
this.validatedPlayers.removeIf(player -> !((net.minecraft.entity.Entity)player).isAlive());
|
||||
this.validatedPlayers.removeIf(player -> !((net.minecraft.entity.Entity)player).isAlive() || ((net.minecraft.entity.Entity)player).isRemoved());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,10 @@ public class ExplosionDamageCalculator implements MinecraftAccess {
|
||||
}
|
||||
|
||||
public double getCrystalDamage(LivingEntity target, Vec3d crystalPos, boolean predictMotion, BlockPos obsidianPos, boolean ignoreTerrain) {
|
||||
if (mc.world == null || mc.player == null || mc.getNetworkHandler() == null) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
long worldTime = mc.world.getTime();
|
||||
if (worldTime != this.cacheTime) {
|
||||
this.damageCache.clear();
|
||||
@@ -305,6 +309,10 @@ public class ExplosionDamageCalculator implements MinecraftAccess {
|
||||
}
|
||||
|
||||
private double getExposureWithOffset(Vec3d source, Entity entity, Vec3d boxOffset, RaycastContext context, BlockPos obsidianPos, boolean ignoreTerrain, BlockPos airPos, BlockPos placedBlockPos, BlockState placedBlockState) {
|
||||
if (context == null) {
|
||||
context = this.raycastContext = new RaycastContext(null, null, ShapeType.COLLIDER, FluidHandling.ANY, mc.player);
|
||||
}
|
||||
|
||||
Box box = entity.getBoundingBox();
|
||||
if (boxOffset != null) {
|
||||
box = box.offset(boxOffset.x, boxOffset.y, boxOffset.z);
|
||||
|
||||
@@ -22,7 +22,7 @@ public class TargetTracker implements MinecraftAccess {
|
||||
|
||||
@Subscribe
|
||||
public void onClientTick(ClientTickEvent event) {
|
||||
if (this.target != null && (mc.world == null || !this.target.isAlive() || this.target.distanceTo(mc.player) > 15.0F || System.currentTimeMillis() - this.lastAttackTime > 5000L)) {
|
||||
if (this.target != null && (mc.world == null || mc.player == null || !this.target.isAlive() || this.target.distanceTo(mc.player) > 15.0F || System.currentTimeMillis() - this.lastAttackTime > 5000L)) {
|
||||
this.target = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user