mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 19:39:04 +07:00
Bugfixes
This commit is contained in:
parent
4ae4456c43
commit
bb593af463
@ -82,7 +82,8 @@ public class Logic implements ApplicationListener{
|
|||||||
//painful O(n) iteration + copy
|
//painful O(n) iteration + copy
|
||||||
for(int i = 0; i < data.brokenBlocks.size; i++){
|
for(int i = 0; i < data.brokenBlocks.size; i++){
|
||||||
BrokenBlock b = data.brokenBlocks.get(i);
|
BrokenBlock b = data.brokenBlocks.get(i);
|
||||||
if(b.x == event.tile.x && b.y == event.tile.y){
|
Block block = content.block(b.block);
|
||||||
|
if(event.tile.block().bounds(event.tile.x, event.tile.y, Tmp.r1).overlaps(block.bounds(b.x, b.y, Tmp.r2))){
|
||||||
data.brokenBlocks.removeIndex(i);
|
data.brokenBlocks.removeIndex(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -64,17 +64,15 @@ public class BuildBlock extends Block{
|
|||||||
tile.entity.health = block.health * healthf;
|
tile.entity.health = block.health * healthf;
|
||||||
}
|
}
|
||||||
Effects.effect(Fx.placeBlock, tile.drawx(), tile.drawy(), block.size);
|
Effects.effect(Fx.placeBlock, tile.drawx(), tile.drawy(), block.size);
|
||||||
Core.app.post(() -> tile.block().placed(tile));
|
tile.block().placed(tile);
|
||||||
|
|
||||||
//last builder was this local client player, call placed()
|
//last builder was this local client player, call placed()
|
||||||
if(!headless && builderID == player.id){
|
if(!headless && builderID == player.id){
|
||||||
//this is run delayed, since if this is called on the server, all clients need to recieve the onBuildFinish()
|
|
||||||
//event first before they can recieve the placed() event modification results
|
|
||||||
if(!skipConfig){
|
if(!skipConfig){
|
||||||
Core.app.post(() -> tile.block().playerPlaced(tile));
|
tile.block().playerPlaced(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Core.app.post(() -> Events.fire(new BlockBuildEndEvent(tile, playerGroup.getByID(builderID), team, false)));
|
Events.fire(new BlockBuildEndEvent(tile, playerGroup.getByID(builderID), team, false));
|
||||||
Sounds.place.at(tile, Mathf.random(0.7f, 1.4f));
|
Sounds.place.at(tile, Mathf.random(0.7f, 1.4f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package io.anuke.mindustry.world.blocks.distribution;
|
package io.anuke.mindustry.world.blocks.distribution;
|
||||||
|
|
||||||
import io.anuke.arc.*;
|
|
||||||
import io.anuke.arc.function.*;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.graphics.g2d.*;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.math.*;
|
import io.anuke.arc.math.*;
|
||||||
@ -39,7 +38,7 @@ public class Sorter extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void playerPlaced(Tile tile){
|
public void playerPlaced(Tile tile){
|
||||||
if(lastItem != null){
|
if(lastItem != null){
|
||||||
Core.app.post(() -> tile.configure(lastItem.id));
|
tile.configure(lastItem.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package io.anuke.mindustry.world.blocks.storage;
|
package io.anuke.mindustry.world.blocks.storage;
|
||||||
|
|
||||||
import io.anuke.arc.*;
|
|
||||||
import io.anuke.arc.function.*;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.graphics.*;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.graphics.g2d.*;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
@ -49,7 +48,7 @@ public class Unloader extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void playerPlaced(Tile tile){
|
public void playerPlaced(Tile tile){
|
||||||
if(lastItem != null){
|
if(lastItem != null){
|
||||||
Core.app.post(() -> tile.configure(lastItem.id));
|
tile.configure(lastItem.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=079b22fcc73b96d406f600edb608af4c92cdc2b3
|
archash=420acdb85cd7ad6d0a7a1a4f1aff09d965267374
|
||||||
|
Loading…
Reference in New Issue
Block a user