Upload server src

This commit is contained in:
PeytonPlayz595 2023-12-18 10:40:47 -05:00
parent e9b4d0d2d6
commit 3c3a039fa2
61 changed files with 6109 additions and 0 deletions

BIN
minecraft-server.jar Normal file

Binary file not shown.

3
src/META-INF/MANIFEST.MF Normal file
View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 1.6.0_17 (Sun Microsystems Inc.)

View File

@ -0,0 +1,56 @@
package com.mojang.minecraft;
import com.mojang.minecraft.level.tile.a;
import java.util.ArrayList;
import java.util.List;
public final class AvailableBlockType {
public static List blocks;
static {
(blocks = new ArrayList()).add(a.e);
blocks.add(a.h);
blocks.add(a.W);
blocks.add(a.g);
blocks.add(a.i);
blocks.add(a.u);
blocks.add(a.v);
blocks.add(a.x);
blocks.add(a.V);
blocks.add(a.Z);
blocks.add(a.j);
blocks.add(a.O);
blocks.add(a.P);
blocks.add(a.Q);
blocks.add(a.R);
blocks.add(a.p);
blocks.add(a.q);
blocks.add(a.w);
blocks.add(a.y);
blocks.add(a.z);
blocks.add(a.A);
blocks.add(a.B);
blocks.add(a.C);
blocks.add(a.D);
blocks.add(a.E);
blocks.add(a.F);
blocks.add(a.G);
blocks.add(a.H);
blocks.add(a.I);
blocks.add(a.J);
blocks.add(a.K);
blocks.add(a.L);
blocks.add(a.M);
blocks.add(a.N);
blocks.add(a.t);
blocks.add(a.s);
blocks.add(a.r);
blocks.add(a.T);
blocks.add(a.S);
blocks.add(a.Y);
blocks.add(a.X);
blocks.add(a.aa);
}
}

View File

@ -0,0 +1,467 @@
package com.mojang.minecraft;
import com.mojang.minecraft.level.BlockMap;
import com.mojang.minecraft.level.Level;
import com.mojang.minecraft.level.liquid.LiquidType;
import com.mojang.minecraft.level.tile.Tile$SoundType;
import com.mojang.minecraft.level.tile.a;
import com.mojang.minecraft.model.Vector3D;
import com.mojang.minecraft.net.UNKNOWN0;
import com.mojang.minecraft.phys.AABB;
import com.mojang.util.MathHelper;
import java.io.Serializable;
import java.util.ArrayList;
public abstract class Entity implements Serializable {
public static final long serialVersionUID = 0L;
protected Level level;
public float xo;
public float yo;
public float zo;
public float x;
public float y;
public float z;
public float xd;
public float yd;
public float zd;
public float yRot;
public float xRot;
public float yRotO;
public float xRotO;
public AABB bb;
public boolean onGround = false;
public boolean horizontalCollision = false;
public boolean collision = false;
public boolean slide = true;
public boolean removed = false;
public float heightOffset = 0.0F;
public float bbWidth = 0.6F;
public float bbHeight = 1.8F;
public float walkDistO = 0.0F;
public float walkDist = 0.0F;
protected boolean makeStepSound = true;
protected float fallDistance = 0.0F;
private int nextStep = 1;
public BlockMap blockMap;
public float xOld;
public float yOld;
public float zOld;
public int textureId = 0;
public float ySlideOffset = 0.0F;
public float footSize = 0.0F;
public boolean noPhysics = false;
public float pushthrough = 0.0F;
public boolean hovered = false;
public Entity(Level var1) {
this.level = var1;
this.setPos(0.0F, 0.0F, 0.0F);
}
protected void resetPos() {
if(this.level != null) {
float var1 = (float)this.level.xSpawn + 0.5F;
float var2 = (float)this.level.ySpawn;
for(float var3 = (float)this.level.zSpawn + 0.5F; var2 > 0.0F; ++var2) {
this.setPos(var1, var2, var3);
if(this.level.getCubes(this.bb).size() == 0) {
break;
}
}
this.xd = this.yd = this.zd = 0.0F;
this.yRot = this.level.rotSpawn;
this.xRot = 0.0F;
}
}
public void remove() {
this.removed = true;
}
protected void setSize(float var1, float var2) {
this.bbWidth = var1;
this.bbHeight = var2;
}
protected void setPos(UNKNOWN0 var1) {
this.setPos(this.x, this.y, this.z);
this.setRot(this.yRot, this.xRot);
}
protected void setRot(float var1, float var2) {
this.yRot = var1;
this.xRot = var2;
}
protected void setPos(float var1, float var2, float var3) {
this.x = var1;
this.y = var2;
this.z = var3;
float var4 = this.bbWidth / 2.0F;
float var5 = this.bbHeight / 2.0F;
this.bb = new AABB(var1 - var4, var2 - var5, var3 - var4, var1 + var4, var2 + var5, var3 + var4);
}
public void turn(float var1, float var2) {
float var3 = this.xRot;
float var4 = this.yRot;
this.yRot = (float)((double)this.yRot + (double)var1 * 0.15D);
this.xRot = (float)((double)this.xRot - (double)var2 * 0.15D);
if(this.xRot < -90.0F) {
this.xRot = -90.0F;
}
if(this.xRot > 90.0F) {
this.xRot = 90.0F;
}
this.xRotO += this.xRot - var3;
this.yRotO += this.yRot - var4;
}
public void interpolateTurn(float var1, float var2) {
this.yRot = (float)((double)this.yRot + (double)var1 * 0.15D);
this.xRot = (float)((double)this.xRot - (double)var2 * 0.15D);
if(this.xRot < -90.0F) {
this.xRot = -90.0F;
}
if(this.xRot > 90.0F) {
this.xRot = 90.0F;
}
}
public void tick() {
this.walkDistO = this.walkDist;
this.xo = this.x;
this.yo = this.y;
this.zo = this.z;
this.xRotO = this.xRot;
this.yRotO = this.yRot;
}
public boolean isFree(float var1, float var2, float var3, float var4) {
AABB var5 = this.bb.grow(var4, var4, var4).cloneMove(var1, var2, var3);
return this.level.getCubes(var5).size() > 0?false:!this.level.containsAnyLiquid(var5);
}
public boolean isFree(float var1, float var2, float var3) {
AABB var4 = this.bb.cloneMove(var1, var2, var3);
return this.level.getCubes(var4).size() > 0?false:!this.level.containsAnyLiquid(var4);
}
public void move(float var1, float var2, float var3) {
if(this.noPhysics) {
this.bb.move(var1, var2, var3);
this.x = (this.bb.x0 + this.bb.x1) / 2.0F;
this.y = this.bb.y0 + this.heightOffset - this.ySlideOffset;
this.z = (this.bb.z0 + this.bb.z1) / 2.0F;
} else {
float var4 = this.x;
float var5 = this.z;
float var6 = var1;
float var7 = var2;
float var8 = var3;
AABB var9 = this.bb.copy();
ArrayList var10 = this.level.getCubes(this.bb.expand(var1, var2, var3));
for(int var11 = 0; var11 < var10.size(); ++var11) {
var2 = ((AABB)var10.get(var11)).clipYCollide(this.bb, var2);
}
this.bb.move(0.0F, var2, 0.0F);
if(!this.slide && var7 != var2) {
var3 = 0.0F;
var2 = 0.0F;
var1 = 0.0F;
}
boolean var16 = this.onGround || var7 != var2 && var7 < 0.0F;
int var12;
for(var12 = 0; var12 < var10.size(); ++var12) {
var1 = ((AABB)var10.get(var12)).clipXCollide(this.bb, var1);
}
this.bb.move(var1, 0.0F, 0.0F);
if(!this.slide && var6 != var1) {
var3 = 0.0F;
var2 = 0.0F;
var1 = 0.0F;
}
for(var12 = 0; var12 < var10.size(); ++var12) {
var3 = ((AABB)var10.get(var12)).clipZCollide(this.bb, var3);
}
this.bb.move(0.0F, 0.0F, var3);
if(!this.slide && var8 != var3) {
var3 = 0.0F;
var2 = 0.0F;
var1 = 0.0F;
}
float var17;
float var18;
if(this.footSize > 0.0F && var16 && this.ySlideOffset < 0.05F && (var6 != var1 || var8 != var3)) {
var18 = var1;
var17 = var2;
float var13 = var3;
var1 = var6;
var2 = this.footSize;
var3 = var8;
AABB var14 = this.bb.copy();
this.bb = var9.copy();
var10 = this.level.getCubes(this.bb.expand(var6, var2, var8));
int var15;
for(var15 = 0; var15 < var10.size(); ++var15) {
var2 = ((AABB)var10.get(var15)).clipYCollide(this.bb, var2);
}
this.bb.move(0.0F, var2, 0.0F);
if(!this.slide && var7 != var2) {
var3 = 0.0F;
var2 = 0.0F;
var1 = 0.0F;
}
for(var15 = 0; var15 < var10.size(); ++var15) {
var1 = ((AABB)var10.get(var15)).clipXCollide(this.bb, var1);
}
this.bb.move(var1, 0.0F, 0.0F);
if(!this.slide && var6 != var1) {
var3 = 0.0F;
var2 = 0.0F;
var1 = 0.0F;
}
for(var15 = 0; var15 < var10.size(); ++var15) {
var3 = ((AABB)var10.get(var15)).clipZCollide(this.bb, var3);
}
this.bb.move(0.0F, 0.0F, var3);
if(!this.slide && var8 != var3) {
var3 = 0.0F;
var2 = 0.0F;
var1 = 0.0F;
}
if(var18 * var18 + var13 * var13 >= var1 * var1 + var3 * var3) {
var1 = var18;
var2 = var17;
var3 = var13;
this.bb = var14.copy();
} else {
this.ySlideOffset = (float)((double)this.ySlideOffset + 0.5D);
}
}
this.horizontalCollision = var6 != var1 || var8 != var3;
this.onGround = var7 != var2 && var7 < 0.0F;
this.collision = this.horizontalCollision || var7 != var2;
if(this.onGround) {
if(this.fallDistance > 0.0F) {
this.causeFallDamage(this.fallDistance);
this.fallDistance = 0.0F;
}
} else if(var2 < 0.0F) {
this.fallDistance -= var2;
}
if(var6 != var1) {
this.xd = 0.0F;
}
if(var7 != var2) {
this.yd = 0.0F;
}
if(var8 != var3) {
this.zd = 0.0F;
}
this.x = (this.bb.x0 + this.bb.x1) / 2.0F;
this.y = this.bb.y0 + this.heightOffset - this.ySlideOffset;
this.z = (this.bb.z0 + this.bb.z1) / 2.0F;
var18 = this.x - var4;
var17 = this.z - var5;
this.walkDist = (float)((double)this.walkDist + (double)MathHelper.sqrt(var18 * var18 + var17 * var17) * 0.6D);
if(this.makeStepSound) {
int var19 = this.level.getTile((int)this.x, (int)(this.y - 0.2F - this.heightOffset), (int)this.z);
if(this.walkDist > (float)this.nextStep && var19 > 0) {
++this.nextStep;
Tile$SoundType var20;
if((var20 = a.b[var19].ac) != Tile$SoundType.none) {
this.playSound("step." + var20.name, var20.getVolume() * 0.75F, var20.getPitch());
}
}
}
this.ySlideOffset *= 0.4F;
}
}
protected void causeFallDamage(float var1) {}
public boolean isInWater() {
return this.level.containsLiquid(this.bb.grow(0.0F, -0.4F, 0.0F), LiquidType.WATER);
}
public boolean isUnderWater() {
int var1;
return (var1 = this.level.getTile((int)this.x, (int)(this.y + 0.12F), (int)this.z)) != 0?a.b[var1].d().equals(LiquidType.WATER):false;
}
public boolean isInLava() {
return this.level.containsLiquid(this.bb.grow(0.0F, -0.4F, 0.0F), LiquidType.LAVA);
}
public void moveRelative(float var1, float var2, float var3) {
float var4;
if((var4 = MathHelper.sqrt(var1 * var1 + var2 * var2)) >= 0.01F) {
if(var4 < 1.0F) {
var4 = 1.0F;
}
var4 = var3 / var4;
var1 *= var4;
var2 *= var4;
var3 = MathHelper.sin(this.yRot * 3.1415927F / 180.0F);
var4 = MathHelper.cos(this.yRot * 3.1415927F / 180.0F);
this.xd += var1 * var4 - var2 * var3;
this.zd += var2 * var4 + var1 * var3;
}
}
public boolean isLit() {
int var1 = (int)this.x;
int var2 = (int)this.y;
int var3 = (int)this.z;
return this.level.isLit(var1, var2, var3);
}
public float getBrightness(float var1) {
int var4 = (int)this.x;
int var2 = (int)(this.y + this.heightOffset / 2.0F - 0.5F);
int var3 = (int)this.z;
return this.level.getBrightness(var4, var2, var3);
}
public void render(com.mojang.minecraft.render.UNKNOWN0 var1, float var2) {}
public void setLevel(Level var1) {
this.level = var1;
}
public void playSound(String var1, float var2, float var3) {
this.level.playSound(var1, this, var2, var3);
}
public void moveTo(float var1, float var2, float var3, float var4, float var5) {
this.xo = this.x = var1;
this.yo = this.y = var2;
this.zo = this.z = var3;
this.yRot = var4;
this.xRot = var5;
this.setPos(var1, var2, var3);
}
public float distanceTo(Entity var1) {
float var2 = this.x - var1.x;
float var3 = this.y - var1.y;
float var4 = this.z - var1.z;
return MathHelper.sqrt(var2 * var2 + var3 * var3 + var4 * var4);
}
public float distanceTo(float var1, float var2, float var3) {
var1 = this.x - var1;
var2 = this.y - var2;
float var4 = this.z - var3;
return MathHelper.sqrt(var1 * var1 + var2 * var2 + var4 * var4);
}
public float distanceToSqr(Entity var1) {
float var2 = this.x - var1.x;
float var3 = this.y - var1.y;
float var4 = this.z - var1.z;
return var2 * var2 + var3 * var3 + var4 * var4;
}
public void playerTouch(Entity var1) {}
public void push(Entity var1) {
float var2 = var1.x - this.x;
float var3 = var1.z - this.z;
float var4;
if((var4 = var2 * var2 + var3 * var3) >= 0.01F) {
var4 = MathHelper.sqrt(var4);
var2 /= var4;
var3 /= var4;
var2 /= var4;
var3 /= var4;
var2 *= 0.05F;
var3 *= 0.05F;
var2 *= 1.0F - this.pushthrough;
var3 *= 1.0F - this.pushthrough;
this.push(-var2, 0.0F, -var3);
var1.push(var2, 0.0F, var3);
}
}
protected void push(float var1, float var2, float var3) {
this.xd += var1;
this.yd += var2;
this.zd += var3;
}
public void hurt(Entity var1, int var2) {}
public boolean intersects(float var1, float var2, float var3, float var4, float var5, float var6) {
return this.bb.intersects(var1, var2, var3, var4, var5, var6);
}
public boolean isPickable() {
return false;
}
public boolean isPushable() {
return false;
}
public boolean isShootable() {
return false;
}
public void awardKillScore(Entity var1, int var2) {}
public boolean shouldRender(Vector3D var1) {
float var2 = this.x - var1.x;
float var3 = this.y - var1.y;
float var4 = this.z - var1.z;
var4 = var2 * var2 + var3 * var3 + var4 * var4;
return this.shouldRenderAtSqrDistance(var4);
}
public boolean shouldRenderAtSqrDistance(float var1) {
float var2 = this.bb.getSize() * 64.0F;
return var1 < var2 * var2;
}
public int getTexture() {
return this.textureId;
}
public boolean isCreativeModeAllowed() {
return false;
}
public void renderHover(com.mojang.minecraft.render.UNKNOWN0 var1, float var2) {}
}

View File

@ -0,0 +1,5 @@
package com.mojang.minecraft.UNKNOWN0;
public interface UNKNOWN0 {
}

View File

@ -0,0 +1,10 @@
package com.mojang.minecraft;
import com.mojang.minecraft.model.Vector3D;
public final class Vector3DCreator {
public Vector3DCreator(int var1, int var2, int var3, int var4, Vector3D var5) {
new Vector3D(var5.x, var5.y, var5.z);
}
}

View File

@ -0,0 +1,86 @@
package com.mojang.minecraft.level;
import com.mojang.minecraft.Entity;
import com.mojang.minecraft.level.BlockMap;
import com.mojang.minecraft.level.UNKNOWN1;
import java.io.Serializable;
class BlockMap$Slot implements Serializable {
public static final long serialVersionUID = 0L;
private int xSlot;
private int ySlot;
private int zSlot;
// $FF: synthetic field
final BlockMap this$0;
private BlockMap$Slot(BlockMap var1) {
this.this$0 = var1;
}
public BlockMap$Slot init(float var1, float var2, float var3) {
this.xSlot = (int)(var1 / 16.0F);
this.ySlot = (int)(var2 / 16.0F);
this.zSlot = (int)(var3 / 16.0F);
if(this.xSlot < 0) {
this.xSlot = 0;
}
if(this.ySlot < 0) {
this.ySlot = 0;
}
if(this.zSlot < 0) {
this.zSlot = 0;
}
if(this.xSlot >= BlockMap.access$000(this.this$0)) {
this.xSlot = BlockMap.access$000(this.this$0) - 1;
}
if(this.ySlot >= BlockMap.access$100(this.this$0)) {
this.ySlot = BlockMap.access$100(this.this$0) - 1;
}
if(this.zSlot >= BlockMap.access$200(this.this$0)) {
this.zSlot = BlockMap.access$200(this.this$0) - 1;
}
return this;
}
public void add(Entity var1) {
if(this.xSlot >= 0 && this.ySlot >= 0 && this.zSlot >= 0) {
this.this$0.entityGrid[(this.zSlot * BlockMap.access$100(this.this$0) + this.ySlot) * BlockMap.access$000(this.this$0) + this.xSlot].add(var1);
}
}
public void remove(Entity var1) {
if(this.xSlot >= 0 && this.ySlot >= 0 && this.zSlot >= 0) {
this.this$0.entityGrid[(this.zSlot * BlockMap.access$100(this.this$0) + this.ySlot) * BlockMap.access$000(this.this$0) + this.xSlot].remove(var1);
}
}
// $FF: synthetic method
BlockMap$Slot(BlockMap var1, UNKNOWN1 var2) {
this(var1);
}
// $FF: synthetic method
static int access$400(BlockMap$Slot var0) {
return var0.xSlot;
}
// $FF: synthetic method
static int access$500(BlockMap$Slot var0) {
return var0.ySlot;
}
// $FF: synthetic method
static int access$600(BlockMap$Slot var0) {
return var0.zSlot;
}
}

View File

@ -0,0 +1,279 @@
package com.mojang.minecraft.level;
import com.mojang.minecraft.Entity;
import com.mojang.minecraft.level.BlockMap$Slot;
import com.mojang.minecraft.level.UNKNOWN1;
import com.mojang.minecraft.model.Vector3D;
import com.mojang.minecraft.phys.AABB;
import com.mojang.minecraft.render.Frustrum;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class BlockMap implements Serializable {
public static final long serialVersionUID = 0L;
private int width;
private int depth;
private int height;
private BlockMap$Slot slot = new BlockMap$Slot(this, (UNKNOWN1)null);
private BlockMap$Slot slot2 = new BlockMap$Slot(this, (UNKNOWN1)null);
public List[] entityGrid;
public List all = new ArrayList();
private List tmp = new ArrayList();
public BlockMap(int var1, int var2, int var3) {
this.width = var1 / 16;
this.depth = var2 / 16;
this.height = var3 / 16;
if(this.width == 0) {
this.width = 1;
}
if(this.depth == 0) {
this.depth = 1;
}
if(this.height == 0) {
this.height = 1;
}
this.entityGrid = new ArrayList[this.width * this.depth * this.height];
for(var1 = 0; var1 < this.width; ++var1) {
for(var2 = 0; var2 < this.depth; ++var2) {
for(var3 = 0; var3 < this.height; ++var3) {
this.entityGrid[(var3 * this.depth + var2) * this.width + var1] = new ArrayList();
}
}
}
}
public void insert(Entity var1) {
this.all.add(var1);
this.slot.init(var1.x, var1.y, var1.z).add(var1);
var1.xOld = var1.x;
var1.yOld = var1.y;
var1.zOld = var1.z;
var1.blockMap = this;
}
public void remove(Entity var1) {
this.slot.init(var1.xOld, var1.yOld, var1.zOld).remove(var1);
this.all.remove(var1);
}
public void moved(Entity var1) {
BlockMap$Slot var2 = this.slot.init(var1.xOld, var1.yOld, var1.zOld);
BlockMap$Slot var3 = this.slot2.init(var1.x, var1.y, var1.z);
if(!var2.equals(var3)) {
var2.remove(var1);
var3.add(var1);
var1.xOld = var1.x;
var1.yOld = var1.y;
var1.zOld = var1.z;
}
}
public List getEntities(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) {
this.tmp.clear();
return this.getEntities(var1, var2, var3, var4, var5, var6, var7, this.tmp);
}
public List getEntities(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7, List var8) {
BlockMap$Slot var9 = this.slot.init(var2, var3, var4);
BlockMap$Slot var10 = this.slot2.init(var5, var6, var7);
for(int var11 = BlockMap$Slot.access$400(var9) - 1; var11 <= BlockMap$Slot.access$400(var10) + 1; ++var11) {
for(int var12 = BlockMap$Slot.access$500(var9) - 1; var12 <= BlockMap$Slot.access$500(var10) + 1; ++var12) {
for(int var13 = BlockMap$Slot.access$600(var9) - 1; var13 <= BlockMap$Slot.access$600(var10) + 1; ++var13) {
if(var11 >= 0 && var12 >= 0 && var13 >= 0 && var11 < this.width && var12 < this.depth && var13 < this.height) {
List var14 = this.entityGrid[(var13 * this.depth + var12) * this.width + var11];
for(int var15 = 0; var15 < var14.size(); ++var15) {
Entity var16;
if((var16 = (Entity)var14.get(var15)) != var1 && var16.intersects(var2, var3, var4, var5, var6, var7)) {
var8.add(var16);
}
}
}
}
}
}
return var8;
}
public void removeAllNonCreativeModeEntities() {
for(int var1 = 0; var1 < this.width; ++var1) {
for(int var2 = 0; var2 < this.depth; ++var2) {
for(int var3 = 0; var3 < this.height; ++var3) {
List var4 = this.entityGrid[(var3 * this.depth + var2) * this.width + var1];
for(int var5 = 0; var5 < var4.size(); ++var5) {
if(!((Entity)var4.get(var5)).isCreativeModeAllowed()) {
var4.remove(var5--);
}
}
}
}
}
}
public void clear() {
for(int var1 = 0; var1 < this.width; ++var1) {
for(int var2 = 0; var2 < this.depth; ++var2) {
for(int var3 = 0; var3 < this.height; ++var3) {
this.entityGrid[(var3 * this.depth + var2) * this.width + var1].clear();
}
}
}
}
public List getEntities(Entity var1, AABB var2) {
this.tmp.clear();
return this.getEntities(var1, var2.x0, var2.y0, var2.z0, var2.x1, var2.y1, var2.z1, this.tmp);
}
public List getEntities(Entity var1, AABB var2, List var3) {
return this.getEntities(var1, var2.x0, var2.y0, var2.z0, var2.x1, var2.y1, var2.z1, var3);
}
public void tickAll() {
for(int var1 = 0; var1 < this.all.size(); ++var1) {
Entity var2;
(var2 = (Entity)this.all.get(var1)).tick();
if(var2.removed) {
this.all.remove(var1--);
this.slot.init(var2.xOld, var2.yOld, var2.zOld).remove(var2);
} else {
int var3 = (int)(var2.xOld / 16.0F);
int var4 = (int)(var2.yOld / 16.0F);
int var5 = (int)(var2.zOld / 16.0F);
int var6 = (int)(var2.x / 16.0F);
int var7 = (int)(var2.y / 16.0F);
int var8 = (int)(var2.z / 16.0F);
if(var3 != var6 || var4 != var7 || var5 != var8) {
this.moved(var2);
}
}
}
}
public void render(Vector3D var1, Frustrum var2, com.mojang.minecraft.render.UNKNOWN0 var3, float var4) {
for(int var5 = 0; var5 < this.width; ++var5) {
float var6 = (float)((var5 << 4) - 2);
float var7 = (float)((var5 + 1 << 4) + 2);
for(int var8 = 0; var8 < this.depth; ++var8) {
float var9 = (float)((var8 << 4) - 2);
float var10 = (float)((var8 + 1 << 4) + 2);
for(int var11 = 0; var11 < this.height; ++var11) {
List var12;
if((var12 = this.entityGrid[(var11 * this.depth + var8) * this.width + var5]).size() != 0) {
float var13 = (float)((var11 << 4) - 2);
float var14 = (float)((var11 + 1 << 4) + 2);
if(var2.isBoxInFrustrum(var6, var9, var13, var7, var10, var14)) {
float var16 = var14;
float var17 = var10;
float var15 = var7;
var14 = var13;
var13 = var9;
float var18 = var6;
Frustrum var19 = var2;
int var20 = 0;
boolean var10000;
while(true) {
if(var20 >= 6) {
var10000 = true;
break;
}
if(var19.frustrum[var20][0] * var18 + var19.frustrum[var20][1] * var13 + var19.frustrum[var20][2] * var14 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
if(var19.frustrum[var20][0] * var15 + var19.frustrum[var20][1] * var13 + var19.frustrum[var20][2] * var14 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
if(var19.frustrum[var20][0] * var18 + var19.frustrum[var20][1] * var17 + var19.frustrum[var20][2] * var14 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
if(var19.frustrum[var20][0] * var15 + var19.frustrum[var20][1] * var17 + var19.frustrum[var20][2] * var14 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
if(var19.frustrum[var20][0] * var18 + var19.frustrum[var20][1] * var13 + var19.frustrum[var20][2] * var16 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
if(var19.frustrum[var20][0] * var15 + var19.frustrum[var20][1] * var13 + var19.frustrum[var20][2] * var16 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
if(var19.frustrum[var20][0] * var18 + var19.frustrum[var20][1] * var17 + var19.frustrum[var20][2] * var16 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
if(var19.frustrum[var20][0] * var15 + var19.frustrum[var20][1] * var17 + var19.frustrum[var20][2] * var16 + var19.frustrum[var20][3] <= 0.0F) {
var10000 = false;
break;
}
++var20;
}
boolean var21 = var10000;
for(int var23 = 0; var23 < var12.size(); ++var23) {
Entity var22;
if((var22 = (Entity)var12.get(var23)).shouldRender(var1)) {
if(!var21) {
AABB var24 = var22.bb;
if(!var2.isBoxInFrustrum(var24.x0, var24.y0, var24.z0, var24.x1, var24.y1, var24.z1)) {
continue;
}
}
var22.render(var3, var4);
}
}
}
}
}
}
}
}
// $FF: synthetic method
static int access$000(BlockMap var0) {
return var0.width;
}
// $FF: synthetic method
static int access$100(BlockMap var0) {
return var0.depth;
}
// $FF: synthetic method
static int access$200(BlockMap var0) {
return var0.height;
}
}

View File

@ -0,0 +1,981 @@
package com.mojang.minecraft.level;
import com.mojang.minecraft.Entity;
import com.mojang.minecraft.Vector3DCreator;
import com.mojang.minecraft.level.BlockMap;
import com.mojang.minecraft.level.NextTickListEntry;
import com.mojang.minecraft.level.UNKNOWN0;
import com.mojang.minecraft.level.liquid.LiquidType;
import com.mojang.minecraft.level.tile.a;
import com.mojang.minecraft.model.Vector3D;
import com.mojang.minecraft.phys.AABB;
import com.mojang.minecraft.server.MinecraftServer;
import com.mojang.util.MathHelper;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
public class Level implements Serializable {
public static final long serialVersionUID = 0L;
public int width;
public int height;
public int depth;
public byte[] blocks;
public String name;
public String creator;
public long createTime;
public int xSpawn;
public int ySpawn;
public int zSpawn;
public float rotSpawn;
private transient ArrayList listeners = new ArrayList();
private transient int[] blockers;
transient Random random = new Random();
private transient int randomID;
private transient ArrayList tickList;
public BlockMap blockMap;
private boolean networkMode;
public transient UNKNOWN0 rendererContext;
public boolean creativeMode;
public int waterLevel;
public int skyColor;
public int fogColor;
public int cloudColor;
int unprocessed;
private int tickCount;
public Entity player;
public transient com.mojang.minecraft.UNKNOWN0.UNKNOWN0 particleEngine;
public transient Object font;
public boolean growTrees;
public Level() {
this.randomID = this.random.nextInt();
this.tickList = new ArrayList();
this.networkMode = false;
this.unprocessed = 0;
this.tickCount = 0;
this.growTrees = false;
}
public void initTransient() {
if(this.blocks == null) {
throw new RuntimeException("The level is corrupt!");
} else {
this.listeners = new ArrayList();
this.blockers = new int[this.width * this.height];
Arrays.fill(this.blockers, this.depth);
this.calcLightDepths(0, 0, this.width, this.height);
this.random = new Random();
this.randomID = this.random.nextInt();
this.tickList = new ArrayList();
if(this.waterLevel == 0) {
this.waterLevel = this.depth / 2;
}
if(this.skyColor == 0) {
this.skyColor = 10079487;
}
if(this.fogColor == 0) {
this.fogColor = 16777215;
}
if(this.cloudColor == 0) {
this.cloudColor = 16777215;
}
if(this.xSpawn == 0 && this.ySpawn == 0 && this.zSpawn == 0) {
this.findSpawn();
}
if(this.blockMap == null) {
this.blockMap = new BlockMap(this.width, this.depth, this.height);
}
}
}
public void setData(int var1, int var2, int var3, byte[] var4) {
this.width = var1;
this.height = var3;
this.depth = var2;
this.blocks = var4;
this.blockers = new int[var1 * var3];
Arrays.fill(this.blockers, this.depth);
this.calcLightDepths(0, 0, var1, var3);
for(var1 = 0; var1 < this.listeners.size(); ++var1) {
this.listeners.get(var1);
}
this.tickList.clear();
this.findSpawn();
this.initTransient();
System.gc();
}
public void findSpawn() {
Random var1 = new Random();
int var2 = 0;
int var3;
int var4;
int var5;
do {
++var2;
var3 = var1.nextInt(this.width / 2) + this.width / 4;
var4 = var1.nextInt(this.height / 2) + this.height / 4;
var5 = this.getHighestTile(var3, var4) + 1;
if(var2 == 10000) {
this.xSpawn = var3;
this.ySpawn = -100;
this.zSpawn = var4;
return;
}
} while((float)var5 <= this.getWaterLevel());
this.xSpawn = var3;
this.ySpawn = var5;
this.zSpawn = var4;
}
public void calcLightDepths(int var1, int var2, int var3, int var4) {
for(int var5 = var1; var5 < var1 + var3; ++var5) {
for(int var6 = var2; var6 < var2 + var4; ++var6) {
int var7 = this.blockers[var5 + var6 * this.width];
int var8;
for(var8 = this.depth - 1; var8 > 0 && !this.isLightBlocker(var5, var8, var6); --var8) {
;
}
this.blockers[var5 + var6 * this.width] = var8;
if(var7 != var8) {
for(var7 = 0; var7 < this.listeners.size(); ++var7) {
this.listeners.get(var7);
}
}
}
}
}
public void addListener$74652038(MinecraftServer var1) {
this.listeners.add(var1);
}
public void finalize() {}
public void removeListener$74652038(MinecraftServer var1) {
this.listeners.remove(var1);
}
public boolean isLightBlocker(int var1, int var2, int var3) {
a var4;
return (var4 = a.b[this.getTile(var1, var2, var3)]) == null?false:var4.b();
}
public ArrayList getCubes(AABB var1) {
ArrayList var2 = new ArrayList();
int var3 = (int)var1.x0;
int var4 = (int)var1.x1 + 1;
int var5 = (int)var1.y0;
int var6 = (int)var1.y1 + 1;
int var7 = (int)var1.z0;
int var8 = (int)var1.z1 + 1;
if(var1.x0 < 0.0F) {
--var3;
}
if(var1.y0 < 0.0F) {
--var5;
}
if(var1.z0 < 0.0F) {
--var7;
}
for(var3 = var3; var3 < var4; ++var3) {
for(int var9 = var5; var9 < var6; ++var9) {
for(int var10 = var7; var10 < var8; ++var10) {
AABB var11;
if(var3 >= 0 && var9 >= 0 && var10 >= 0 && var3 < this.width && var9 < this.depth && var10 < this.height) {
a var12;
if((var12 = a.b[this.getTile(var3, var9, var10)]) != null && (var11 = var12.a(var3, var9, var10)) != null && var1.intersectsInner(var11)) {
var2.add(var11);
}
} else if((var3 < 0 || var9 < 0 || var10 < 0 || var3 >= this.width || var10 >= this.height) && (var11 = a.k.a(var3, var9, var10)) != null && var1.intersectsInner(var11)) {
var2.add(var11);
}
}
}
}
return var2;
}
public void swap(int var1, int var2, int var3, int var4, int var5, int var6) {
if(!this.networkMode) {
int var7 = this.getTile(var1, var2, var3);
int var8 = this.getTile(var4, var5, var6);
this.setTileNoNeighborChange(var1, var2, var3, var8);
this.setTileNoNeighborChange(var4, var5, var6, var7);
this.updateNeighborsAt(var1, var2, var3, var8);
this.updateNeighborsAt(var4, var5, var6, var7);
}
}
public boolean setTileNoNeighborChange(int var1, int var2, int var3, int var4) {
return this.networkMode?false:this.netSetTileNoNeighborChange(var1, var2, var3, var4);
}
public boolean netSetTileNoNeighborChange(int var1, int var2, int var3, int var4) {
if(var1 >= 0 && var2 >= 0 && var3 >= 0 && var1 < this.width && var2 < this.depth && var3 < this.height) {
if(var4 == this.blocks[(var2 * this.height + var3) * this.width + var1]) {
return false;
} else {
if(var4 == 0 && (var1 == 0 || var3 == 0 || var1 == this.width - 1 || var3 == this.height - 1) && (float)var2 >= this.getGroundLevel() && (float)var2 < this.getWaterLevel()) {
var4 = a.l.ab;
}
byte var5 = this.blocks[(var2 * this.height + var3) * this.width + var1];
this.blocks[(var2 * this.height + var3) * this.width + var1] = (byte)var4;
if(var5 != 0) {
a.b[var5].c(this, var1, var2, var3);
}
if(var4 != 0) {
a.b[var4].b(this, var1, var2, var3);
}
this.calcLightDepths(var1, var3, 1, 1);
for(var4 = 0; var4 < this.listeners.size(); ++var4) {
((MinecraftServer)this.listeners.get(var4)).a(var1, var2, var3);
}
return true;
}
} else {
return false;
}
}
public boolean setTile(int var1, int var2, int var3, int var4) {
if(this.networkMode) {
return false;
} else if(this.setTileNoNeighborChange(var1, var2, var3, var4)) {
this.updateNeighborsAt(var1, var2, var3, var4);
return true;
} else {
return false;
}
}
public boolean netSetTile(int var1, int var2, int var3, int var4) {
if(this.netSetTileNoNeighborChange(var1, var2, var3, var4)) {
this.updateNeighborsAt(var1, var2, var3, var4);
return true;
} else {
return false;
}
}
public void updateNeighborsAt(int var1, int var2, int var3, int var4) {
this.a(var1 - 1, var2, var3, var4);
this.a(var1 + 1, var2, var3, var4);
this.a(var1, var2 - 1, var3, var4);
this.a(var1, var2 + 1, var3, var4);
this.a(var1, var2, var3 - 1, var4);
this.a(var1, var2, var3 + 1, var4);
}
public boolean setTileNoUpdate(int var1, int var2, int var3, int var4) {
if(var1 >= 0 && var2 >= 0 && var3 >= 0 && var1 < this.width && var2 < this.depth && var3 < this.height) {
if(var4 == this.blocks[(var2 * this.height + var3) * this.width + var1]) {
return false;
} else {
this.blocks[(var2 * this.height + var3) * this.width + var1] = (byte)var4;
return true;
}
} else {
return false;
}
}
private void a(int var1, int var2, int var3, int var4) {
if(var1 >= 0 && var2 >= 0 && var3 >= 0 && var1 < this.width && var2 < this.depth && var3 < this.height) {
a var5;
if((var5 = a.b[this.blocks[(var2 * this.height + var3) * this.width + var1]]) != null) {
var5.a(this, var1, var2, var3, var4);
}
}
}
public boolean isLit(int var1, int var2, int var3) {
return var1 >= 0 && var2 >= 0 && var3 >= 0 && var1 < this.width && var2 < this.depth && var3 < this.height?var2 >= this.blockers[var1 + var3 * this.width]:true;
}