remove server side debug
This commit is contained in:
parent
f4c024cde7
commit
374e0c4617
22 changed files with 1084 additions and 801 deletions
|
@ -7,28 +7,16 @@ import common.network.Packet;
|
|||
import common.network.PacketBuffer;
|
||||
|
||||
public class RPacketLoginSuccess implements Packet<IClientLoginHandler> {
|
||||
private boolean debug;
|
||||
|
||||
public RPacketLoginSuccess() {
|
||||
}
|
||||
|
||||
public RPacketLoginSuccess(boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public final void readPacketData(PacketBuffer buf) throws IOException {
|
||||
this.debug = buf.readBoolean();
|
||||
}
|
||||
|
||||
public final void writePacketData(PacketBuffer buf) throws IOException {
|
||||
buf.writeBoolean(this.debug);
|
||||
}
|
||||
|
||||
public void processPacket(IClientLoginHandler handler) {
|
||||
handler.handleLoginSuccess(this);
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return this.debug;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ import common.init.SoundEvent;
|
|||
import common.tags.TagObject;
|
||||
|
||||
public abstract class AWorldClient extends World {
|
||||
protected AWorldClient(Dimension dim, boolean debug) {
|
||||
super(dim, true, debug);
|
||||
protected AWorldClient(Dimension dim) {
|
||||
super(dim, true);
|
||||
}
|
||||
|
||||
public abstract void playSound(double x, double y, double z, SoundEvent sound, float volume);
|
||||
|
|
|
@ -17,8 +17,8 @@ import common.util.PortalType;
|
|||
import common.village.Village;
|
||||
|
||||
public abstract class AWorldServer extends World {
|
||||
protected AWorldServer(Dimension dim, boolean debug) {
|
||||
super(dim, false, debug);
|
||||
protected AWorldServer(Dimension dim) {
|
||||
super(dim, false);
|
||||
}
|
||||
|
||||
public abstract List<IPlayer> getAllPlayers();
|
||||
|
|
|
@ -300,11 +300,6 @@ public abstract class Chunk {
|
|||
}
|
||||
|
||||
public State getState(BlockPos pos) {
|
||||
if(this.world.debug) {
|
||||
State state = pos.getY() == 1 ? DebugStates.getState(pos.getX(), pos.getZ()) : null;
|
||||
return state == null ? Blocks.air.getState() : state;
|
||||
}
|
||||
|
||||
BlockArray stor = this.getArray(pos.getY() >> 4);
|
||||
return stor != null ? stor.get(pos.getX() & 15, pos.getY() & 15, pos.getZ() & 15) : (pos.getY() < 0 ? this.filler : Blocks.air.getState());
|
||||
}
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package common.world;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import common.block.Block;
|
||||
import common.collect.Lists;
|
||||
import common.init.BlockRegistry;
|
||||
import common.util.ExtMath;
|
||||
|
||||
public class DebugStates {
|
||||
private static final List<State> STATES = Lists.<State>newArrayList();
|
||||
private static final int XSTRETCH;
|
||||
private static final int ZSTRETCH;
|
||||
|
||||
static {
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
STATES.addAll(block.getValidStates());
|
||||
}
|
||||
XSTRETCH = ExtMath.ceilf(ExtMath.sqrtf((float)STATES.size()));
|
||||
ZSTRETCH = ExtMath.ceilf((float)STATES.size() / (float)XSTRETCH);
|
||||
}
|
||||
|
||||
public static State getState(int x, int z) {
|
||||
State state = null;
|
||||
if(x > 0 && z > 0 && x % 2 != 0 && z % 2 != 0) {
|
||||
x = x / 2;
|
||||
z = z / 2;
|
||||
if(x <= XSTRETCH && z <= ZSTRETCH) {
|
||||
int idx = ExtMath.absi(x * XSTRETCH + z);
|
||||
if(idx < STATES.size()) {
|
||||
state = STATES.get(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
}
|
|
@ -58,7 +58,6 @@ public abstract class World implements IWorldAccess {
|
|||
// private static long lastUpdate;
|
||||
|
||||
public final boolean client;
|
||||
public final boolean debug;
|
||||
public double gravity = 1.0;
|
||||
protected long timeFactor = 1L;
|
||||
public final Random rand = new Random();
|
||||
|
@ -116,14 +115,13 @@ public abstract class World implements IWorldAccess {
|
|||
return pos.getX() >= -MAX_SIZE && pos.getZ() >= -MAX_SIZE && pos.getX() < MAX_SIZE && pos.getZ() < MAX_SIZE;
|
||||
}
|
||||
|
||||
protected World(Dimension dim, boolean client, boolean debug) {
|
||||
protected World(Dimension dim, boolean client) {
|
||||
// this.profiler = profiler;
|
||||
// this.info = info;
|
||||
// this.dimInfo = info.getDimension(dim.getDimensionId());
|
||||
this.dimension = dim;
|
||||
// this.storage = storage;
|
||||
this.client = client;
|
||||
this.debug = debug;
|
||||
this.weather = dim.getWeather();
|
||||
}
|
||||
|
||||
|
@ -200,9 +198,6 @@ public abstract class World implements IWorldAccess {
|
|||
if(!isValid(pos)) {
|
||||
return false;
|
||||
}
|
||||
else if(!this.client && this.debug) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
Chunk chunk = this.getChunk(pos);
|
||||
Block block = newState.getBlock();
|
||||
|
@ -225,7 +220,7 @@ public abstract class World implements IWorldAccess {
|
|||
}
|
||||
|
||||
if(!this.client && (flags & 1) != 0) {
|
||||
this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock());
|
||||
this.notifyNeighborsOfStateChange(pos, iblockstate.getBlock());
|
||||
|
||||
if(block.hasComparatorInputOverride()) {
|
||||
this.updateComparatorOutputLevel(pos, block);
|
||||
|
@ -263,12 +258,6 @@ public abstract class World implements IWorldAccess {
|
|||
}
|
||||
}
|
||||
|
||||
public void notifyNeighborsRespectDebug(BlockPos pos, Block blockType) {
|
||||
if(!this.debug) {
|
||||
this.notifyNeighborsOfStateChange(pos, blockType);
|
||||
}
|
||||
}
|
||||
|
||||
public void markBlocksDirtyVertical(int x1, int z1, int x2, int z2) {
|
||||
if(x2 > z2) {
|
||||
int i = z2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue