Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
aa836e77f5
Commit
93c32a6dc0
@ -36,13 +36,13 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void handleEntityDamage(EntityDamageEvent event) {
|
public void handleEntityDamage(EntityDamageEvent event) {
|
||||||
if(Config.ArenaRegion.inRegion(event.getEntity().getLocation()))
|
if(Config.ArenaRegion.in2dRegion(event.getEntity().getLocation()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void handleEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
public void handleEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||||
if(Config.ArenaRegion.inRegion(event.getEntity().getLocation()))
|
if(Config.ArenaRegion.in2dRegion(event.getEntity().getLocation()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ public class PacketProcessor {
|
|||||||
packetDecoder[0xef] = source::readUTF;
|
packetDecoder[0xef] = source::readUTF;
|
||||||
packetDecoder[0xff] = this::tick;
|
packetDecoder[0xff] = this::tick;
|
||||||
|
|
||||||
FightWorld.forceLoad();
|
execSync(FightWorld::forceLoad);
|
||||||
|
|
||||||
if(source.async()) {
|
if(source.async()) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(FightSystem.getPlugin(), this::process);
|
Bukkit.getScheduler().runTaskAsynchronously(FightSystem.getPlugin(), this::process);
|
||||||
@ -544,12 +544,11 @@ public class PacketProcessor {
|
|||||||
String msg = source.readUTF();
|
String msg = source.readUTF();
|
||||||
List<Object> params = new ArrayList<>();
|
List<Object> params = new ArrayList<>();
|
||||||
|
|
||||||
int type;
|
while(true) {
|
||||||
do {
|
int type = source.readUnsignedByte();
|
||||||
type = Byte.toUnsignedInt(source.readByte());
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
break;
|
return new Message(msg, params.toArray());
|
||||||
case 0x01:
|
case 0x01:
|
||||||
params.add(source.readBoolean());
|
params.add(source.readBoolean());
|
||||||
break;
|
break;
|
||||||
@ -577,9 +576,7 @@ public class PacketProcessor {
|
|||||||
default:
|
default:
|
||||||
throw new IOException("Unknown message param type " + type);
|
throw new IOException("Unknown message param type " + type);
|
||||||
}
|
}
|
||||||
} while(type != 0x00);
|
}
|
||||||
|
|
||||||
return new Message(msg, params.toArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface PacketParser{
|
private interface PacketParser{
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren