Merge fixes

This commit is contained in:
Anuken
2018-03-03 18:08:35 -05:00
parent 6de48b4535
commit 41e4f87e06
3 changed files with 14 additions and 21 deletions

View File

@@ -164,7 +164,7 @@ public class NetClient extends Module {
});
Net.handleClient(PlacePacket.class, (packet) -> {
Placement.placeBlock(packet.x, packet.y, Block.getByID(packet.block), packet.rotation, true, false);
Placement.placeBlock(packet.x, packet.y, Block.getByID(packet.block), packet.rotation, true, Timers.get("placeblocksound", 10));
if(packet.playerid == player.id){
Tile tile = world.tile(packet.x, packet.y);
@@ -173,7 +173,7 @@ public class NetClient extends Module {
});
Net.handleClient(BreakPacket.class, (packet) -> {
Placement.breakBlock(packet.x, packet.y, true, false);
Placement.breakBlock(packet.x, packet.y, true, Timers.get("breakblocksound", 10));
});
Net.handleClient(EntitySpawnPacket.class, packet -> {
@@ -262,11 +262,7 @@ public class NetClient extends Module {
next.block().handleItem(Item.getByID(packet.itemid), next, tile);
};
if(threads.isEnabled()){
threads.run(r);
}else{
r.run();
}
threads.run(r);
});
Net.handleClient(ItemSetPacket.class, packet -> {
@@ -276,11 +272,7 @@ public class NetClient extends Module {
tile.entity.items[packet.itemid] = packet.amount;
};
if(threads.isEnabled()){
threads.run(r);
}else{
r.run();
}
threads.run(r);
});
Net.handleClient(ItemOffloadPacket.class, packet -> {
@@ -291,11 +283,7 @@ public class NetClient extends Module {
next.block().handleItem(Item.getByID(packet.itemid), next, tile);
};
if(threads.isEnabled()){
threads.run(r);
}else{
r.run();
}
threads.run(r);
});
Net.handleClient(NetErrorPacket.class, packet -> {
@@ -375,4 +363,4 @@ public class NetClient extends Module {
Net.updatePing();
}
}
}
}

View File

@@ -231,6 +231,11 @@ public class Tile{
return world.tile(x + relative.x, y + relative.y);
}
public Tile target(){
Tile link = getLinked();
return link == null ? this : link;
}
public Tile getNearby(int rotation){
if(rotation == 0) return world.tile(x + 1, y);
if(rotation == 1) return world.tile(x, y + 1);