mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 03:55:14 +01:00
Added per world PVP setting support.
This commit is contained in:
parent
5a5ce79035
commit
f342db744a
@ -132,7 +132,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|||||||
if (this.bG > 0) {
|
if (this.bG > 0) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (!this.b.pvpMode) {
|
if (!this.world.pvpMode) { // CraftBukkit this.b.pvpMode -> this.world.pvpMode
|
||||||
if (entity instanceof EntityHuman) {
|
if (entity instanceof EntityHuman) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ public class World implements IBlockAccess {
|
|||||||
private int J = 0;
|
private int J = 0;
|
||||||
public boolean allowMonsters = true; // CraftBukkit private->public
|
public boolean allowMonsters = true; // CraftBukkit private->public
|
||||||
public boolean allowAnimals = true; // CraftBukkit private->public
|
public boolean allowAnimals = true; // CraftBukkit private->public
|
||||||
|
public boolean pvpMode; // CraftBukkit
|
||||||
static int u = 0;
|
static int u = 0;
|
||||||
private Set M = new HashSet();
|
private Set M = new HashSet();
|
||||||
private int N;
|
private int N;
|
||||||
|
@ -26,6 +26,7 @@ public class WorldServer extends World implements BlockChangeDelegate {
|
|||||||
this.cserver = minecraftserver.server;
|
this.cserver = minecraftserver.server;
|
||||||
this.world = new CraftWorld(this);
|
this.world = new CraftWorld(this);
|
||||||
this.manager = new PlayerManager(minecraftserver, this);
|
this.manager = new PlayerManager(minecraftserver, this);
|
||||||
|
this.pvpMode = minecraftserver.pvpMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerManager manager;
|
public PlayerManager manager;
|
||||||
|
@ -612,4 +612,12 @@ public class CraftWorld implements World {
|
|||||||
public long getSeed() {
|
public long getSeed() {
|
||||||
return world.worldData.b();
|
return world.worldData.b();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getPVP() {
|
||||||
|
return world.pvpMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPVP(boolean pvp) {
|
||||||
|
world.pvpMode = pvp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user