diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 03bdb62bc8..e41cf25858 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -217,7 +217,7 @@ setting.sensitivity.name=Controller Sensitivity setting.saveinterval.name=Autosave Interval setting.seconds={0} Seconds setting.fullscreen.name=Fullscreen -setting.multithread.name=Multithreading [scarlet](extremely unstable!) +setting.multithread.name=Multithreading [scarlet](unstable!) setting.fps.name=Show FPS setting.vsync.name=VSync setting.lasers.name=Show Power Lasers diff --git a/core/assets/version.properties b/core/assets/version.properties index 8f3174b0e4..1d29cf5678 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,5 +1,5 @@ #Autogenerated file. Do not modify. -#Sat Feb 17 14:39:13 EST 2018 +#Sat Feb 17 20:42:58 EST 2018 version=beta androidBuildCode=235 name=Mindustry diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index ccba58ba10..b3ed97bcdf 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -28,6 +28,8 @@ public class Vars{ public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid; //shorthand for whether or not this is running on GWT public static final boolean gwt = (Gdx.app.getType() == ApplicationType.WebGL); + //whether to send block state change events to players + public static final boolean syncBlockState = false; //how far away from the player blocks can be placed public static final float placerange = 66; //respawn time in frames diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 7bd2812f07..d3adc77fe9 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -498,8 +498,7 @@ public class Renderer extends RendererModule{ public void drawBar(Color color, float x, float y, float fraction){ fraction = Mathf.clamp(fraction); - if(fraction > 0) - fraction = Mathf.clamp(fraction + 0.2f, 0.24f, 1f); + if(fraction > 0) fraction = Mathf.clamp(fraction + 0.2f, 0.24f, 1f); float len = 3; diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 9b1f50612c..596104a902 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -21,6 +21,7 @@ import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.state; +import static io.anuke.mindustry.Vars.syncBlockState; import static io.anuke.mindustry.Vars.tilesize; public class Block{ @@ -180,7 +181,7 @@ public class Block{ * Tries to put this item into a nearby container, if there are no available * containers, it gets added to the block's inventory.*/ public void offloadNear(Tile tile, Item item){ - if(Net.client()){ + if(Net.client() && syncBlockState){ handleItem(item, tile, tile); return; } @@ -193,7 +194,7 @@ public class Block{ if(other != null && other.block().acceptItem(item, other, tile)){ other.block().handleItem(item, other, tile); tile.setDump((byte)((i+1)%4)); - if(Net.server()) NetEvents.handleTransfer(tile, i, item); + if(Net.server() && syncBlockState) NetEvents.handleTransfer(tile, i, item); return; } i++; @@ -212,7 +213,7 @@ public class Block{ * Try dumping any item near the tile. -1 = any direction */ protected boolean tryDump(Tile tile, int direction, Item todump){ - if(Net.client()) return false; + if(Net.client() && syncBlockState) return false; int i = tile.getDump()%4; @@ -228,7 +229,7 @@ public class Block{ other.block().handleItem(item, other, tile); tile.entity.removeItem(item, 1); tile.setDump((byte)((i+1)%4)); - if(Net.server()) NetEvents.handleTransfer(tile, (byte)i, item); + if(Net.server() && syncBlockState) NetEvents.handleTransfer(tile, (byte)i, item); return true; } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java index 6e857ac4df..22291f7f46 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java @@ -20,6 +20,8 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import static io.anuke.mindustry.Vars.syncBlockState; + public class Teleporter extends PowerBlock{ public static final Color[] colorArray = {Color.ROYAL, Color.ORANGE, Color.SCARLET, Color.FOREST, Color.PURPLE, Color.GOLD, Color.PINK, Color.BLACK}; @@ -130,7 +132,7 @@ public class Teleporter extends PowerBlock{ Array links = findLinks(tile, item); if(links.size > 0){ - if(Net.server() || !Net.active()){ + if(!syncBlockState || Net.server() || !Net.active()){ Tile target = links.random(); target.block().offloadNear(target, item); } @@ -181,7 +183,7 @@ public class Teleporter extends PowerBlock{ } for(Tile remove : removal) - teleporters[entity.color].remove(remove); + teleporters[entity.color].remove(remove); return returns; }