This commit is contained in:
Anuken
2019-11-17 11:20:36 -05:00
parent 629999a1cd
commit 2593e96999
9 changed files with 12 additions and 10 deletions

View File

@@ -104,7 +104,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
public void resize(int width, int height){
if(assets == null) return;
if(!assets.isFinished()){
if(!finished){
Draw.proj().setOrtho(0, 0, width, height);
}else{
super.resize(width, height);

View File

@@ -484,7 +484,7 @@ public class NetServer implements ApplicationListener{
for(BuildRequest req : requests){
if(req == null) continue;
Tile tile = world.tile(req.x, req.y);
if(tile == null) continue;
if(tile == null || (!req.breaking && req.block == null)) continue;
//auto-skip done requests
if(req.breaking && tile.block() == Blocks.air){
continue;

View File

@@ -75,7 +75,7 @@ public class Rules{
/** Blocks that cannot be placed. */
public ObjectSet<Block> bannedBlocks = new ObjectSet<>();
/** Whether everything is dark. Enables lights. Experimental. */
public boolean lighting = true;
public boolean lighting = false;
/** Ambient light color, used when lighting is enabled. */
public Color ambientLight = new Color(0.01f, 0.01f, 0.04f, 0.99f);

View File

@@ -455,7 +455,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
protected void drawRequest(BuildRequest request){
drawRequest(request.x, request.y, request.block, request.rotation);
request.block.drawRequest(request, allRequests(), validPlace(request.x, request.y, request.block, request.rotation));
}
/** Draws a placement icon for a specific block. */

View File

@@ -80,7 +80,7 @@ public class Packets{
buffer.put(mobile ? (byte)1 : 0);
buffer.putInt(color);
buffer.put(Base64Coder.decode(uuid));
buffer.putInt(mods.size);
buffer.put((byte)mods.size);
for(int i = 0; i < mods.size; i++){
TypeIO.writeString(buffer, mods.get(i));
}
@@ -97,7 +97,7 @@ public class Packets{
byte[] idbytes = new byte[8];
buffer.get(idbytes);
uuid = new String(Base64Coder.encode(idbytes));
int totalMods = buffer.getInt();
int totalMods = buffer.get();
mods = new Array<>(totalMods);
for(int i = 0; i < totalMods; i++){
mods.add(TypeIO.readString(buffer));

View File

@@ -720,10 +720,12 @@ public class Block extends BlockStorage{
Color color = content instanceof Item ? ((Item)content).color : content instanceof Liquid ? ((Liquid)content).color : null;
if(color == null) return;
float prev = Draw.scl;
Draw.color(color);
Draw.scl *= req.animScale;
Draw.rect(region, req.drawx(), req.drawy());
Draw.scl /= req.animScale;
Draw.scl = prev;
Draw.color();
}

View File

@@ -116,7 +116,7 @@ public abstract class BlockStorage extends UnlockableContent{
Tile other = proximity.get((i + dump) % proximity.size);
Tile in = Edges.getFacingEdge(tile, other);
other = other.block().getLiquidDestination(other, tile);
other = other.block().getLiquidDestination(other, in);
if(other != null && other.getTeam() == tile.getTeam() && other.block().hasLiquids && canDumpLiquid(tile, other, liquid) && other.entity.liquids != null){
float ofract = other.entity.liquids.get(liquid) / other.block().liquidCapacity;

View File

@@ -140,7 +140,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
if(entity.generateTime > 0f){
entity.generateTime -= Math.min(1f / itemDuration * entity.delta(), entity.generateTime);
if(randomlyExplode && Mathf.chance(entity.delta() * 0.06 * Mathf.clamp(entity.explosiveness - 0.5f))){
if(randomlyExplode && state.rules.reactorExplosions && Mathf.chance(entity.delta() * 0.06 * Mathf.clamp(entity.explosiveness - 0.5f))){
//this block is run last so that in the event of a block destruction, no code relies on the block type
Core.app.post(() -> {
entity.damage(Mathf.random(11f));