Archiviert
13
0

Update to mcdev rename revision 01 for 1.8.1

Dieser Commit ist enthalten in:
Dinnerbone 2011-09-24 22:03:31 +01:00
Ursprung 75ac4e00b2
Commit 0118a20d6a
40 geänderte Dateien mit 322 neuen und 324 gelöschten Zeilen

Datei anzeigen

@ -39,7 +39,7 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>minecraft-server</artifactId> <artifactId>minecraft-server</artifactId>
<version>1.8.1</version> <version>1.8.1_01</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

Datei anzeigen

@ -219,7 +219,7 @@ public class ChunkProviderServer implements IChunkProvider {
} }
public boolean unloadChunks() { public boolean unloadChunks() {
if (!this.world.canSave) { if (!this.world.savingDisabled) {
// CraftBukkit start // CraftBukkit start
org.bukkit.Server server = this.world.getServer(); org.bukkit.Server server = this.world.getServer();
for (int i = 0; i < 50 && !this.unloadQueue.isEmpty(); i++) { for (int i = 0; i < 50 && !this.unloadQueue.isEmpty(); i++) {
@ -251,6 +251,6 @@ public class ChunkProviderServer implements IChunkProvider {
} }
public boolean canSave() { public boolean canSave() {
return !this.world.canSave; return !this.world.savingDisabled;
} }
} }

Datei anzeigen

@ -125,7 +125,7 @@ public abstract class Entity {
protected abstract void b(); protected abstract void b();
public DataWatcher al() { public DataWatcher getDataWatcher() {
return this.datawatcher; return this.datawatcher;
} }
@ -206,7 +206,7 @@ public abstract class Entity {
this.lastYaw = this.yaw; this.lastYaw = this.yaw;
int i; int i;
if (this.at()) { if (this.isSprinting()) {
int j = MathHelper.floor(this.locX); int j = MathHelper.floor(this.locX);
int k = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height); int k = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height);
@ -1231,11 +1231,11 @@ public abstract class Entity {
this.a(1, flag); this.a(1, flag);
} }
public boolean at() { public boolean isSprinting() {
return this.e(3); return this.e(3);
} }
public void g(boolean flag) { public void setSprinting(boolean flag) {
this.a(3, flag); this.a(3, flag);
} }
@ -1244,11 +1244,11 @@ public abstract class Entity {
} }
protected boolean e(int i) { protected boolean e(int i) {
return (this.datawatcher.a(0) & 1 << i) != 0; return (this.datawatcher.getByte(0) & 1 << i) != 0;
} }
protected void a(int i, boolean flag) { protected void a(int i, boolean flag) {
byte b0 = this.datawatcher.a(0); byte b0 = this.datawatcher.getByte(0);
if (flag) { if (flag) {
this.datawatcher.watch(0, Byte.valueOf((byte) (b0 | 1 << i))); this.datawatcher.watch(0, Byte.valueOf((byte) (b0 | 1 << i)));

Datei anzeigen

@ -24,7 +24,7 @@ public class EntityCreeper extends EntityMonster {
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound); super.b(nbttagcompound);
if (this.datawatcher.a(17) == 1) { if (this.datawatcher.getByte(17) == 1) {
nbttagcompound.a("powered", true); nbttagcompound.a("powered", true);
} }
} }
@ -129,7 +129,7 @@ public class EntityCreeper extends EntityMonster {
} }
public boolean isPowered() { public boolean isPowered() {
return this.datawatcher.a(17) == 1; return this.datawatcher.getByte(17) == 1;
} }
protected int k() { protected int k() {
@ -137,7 +137,7 @@ public class EntityCreeper extends EntityMonster {
} }
private int w() { private int w() {
return this.datawatcher.a(16); return this.datawatcher.getByte(16);
} }
private void b(int i) { private void b(int i) {

Datei anzeigen

@ -284,7 +284,7 @@ public class EntityEnderman extends EntityMonster {
} }
public int getCarriedId() { public int getCarriedId() {
return this.datawatcher.a(16); return this.datawatcher.getByte(16);
} }
public void setCarriedData(int i) { public void setCarriedData(int i) {
@ -292,7 +292,7 @@ public class EntityEnderman extends EntityMonster {
} }
public int getCarriedData() { public int getCarriedData() {
return this.datawatcher.a(17); return this.datawatcher.getByte(17);
} }
static { static {

Datei anzeigen

@ -24,9 +24,9 @@ public class EntityFireball extends Entity {
public EntityLiving shooter; public EntityLiving shooter;
private int k; private int k;
private int l = 0; private int l = 0;
public double c; public double dirX;
public double d; public double dirY;
public double e; public double dirZ;
public float yield = 1; // CraftBukkit public float yield = 1; // CraftBukkit
public boolean isIncendiary = true; // CraftBukkit public boolean isIncendiary = true; // CraftBukkit
@ -56,9 +56,9 @@ public class EntityFireball extends Entity {
d2 += this.random.nextGaussian() * 0.4D; d2 += this.random.nextGaussian() * 0.4D;
double d3 = (double) MathHelper.a(d0 * d0 + d1 * d1 + d2 * d2); double d3 = (double) MathHelper.a(d0 * d0 + d1 * d1 + d2 * d2);
this.c = d0 / d3 * 0.1D; this.dirX = d0 / d3 * 0.1D;
this.d = d1 / d3 * 0.1D; this.dirY = d1 / d3 * 0.1D;
this.e = d2 / d3 * 0.1D; this.dirZ = d2 / d3 * 0.1D;
} }
public void s_() { public void s_() {
@ -210,9 +210,9 @@ public class EntityFireball extends Entity {
f2 = 0.8F; f2 = 0.8F;
} }
this.motX += this.c; this.motX += this.dirX;
this.motY += this.d; this.motY += this.dirY;
this.motZ += this.e; this.motZ += this.dirZ;
this.motX *= (double) f2; this.motX *= (double) f2;
this.motY *= (double) f2; this.motY *= (double) f2;
this.motZ *= (double) f2; this.motZ *= (double) f2;
@ -251,9 +251,9 @@ public class EntityFireball extends Entity {
this.motX = vec3d.a; this.motX = vec3d.a;
this.motY = vec3d.b; this.motY = vec3d.b;
this.motZ = vec3d.c; this.motZ = vec3d.c;
this.c = this.motX * 0.1D; this.dirX = this.motX * 0.1D;
this.d = this.motY * 0.1D; this.dirY = this.motY * 0.1D;
this.e = this.motZ * 0.1D; this.dirZ = this.motZ * 0.1D;
} }
return true; return true;

Datei anzeigen

@ -9,7 +9,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerFishEvent; import org.bukkit.event.player.PlayerFishEvent;
// CraftBukkit end // CraftBukkit end
public class EntityFish extends Entity { public class EntityFishingHook extends Entity {
private int d = -1; private int d = -1;
private int e = -1; private int e = -1;
@ -29,13 +29,13 @@ public class EntityFish extends Entity {
private double p; private double p;
private double q; private double q;
public EntityFish(World world) { public EntityFishingHook(World world) {
super(world); super(world);
this.b(0.25F, 0.25F); this.b(0.25F, 0.25F);
this.bZ = true; this.bZ = true;
} }
public EntityFish(World world, EntityHuman entityhuman) { public EntityFishingHook(World world, EntityHuman entityhuman) {
super(world); super(world);
this.bZ = true; this.bZ = true;
this.owner = entityhuman; this.owner = entityhuman;

Datei anzeigen

@ -31,13 +31,13 @@ public class EntityGhast extends EntityFlying implements IMonster {
public void s_() { public void s_() {
super.s_(); super.s_();
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.getByte(16);
this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png"; this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
} }
protected void c_() { protected void c_() {
if (!this.world.isStatic && this.world.spawnMonsters == 0) { if (!this.world.isStatic && this.world.difficulty == 0) {
this.die(); this.die();
} }
@ -140,7 +140,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
} }
if (!this.world.isStatic) { if (!this.world.isStatic) {
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.getByte(16);
byte b1 = (byte) (this.f > 10 ? 1 : 0); byte b1 = (byte) (this.f > 10 ? 1 : 0);
if (b0 != b1) { if (b0 != b1) {
@ -186,7 +186,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
} }
public boolean d() { public boolean d() {
return this.random.nextInt(20) == 0 && super.d() && this.world.spawnMonsters > 0; return this.random.nextInt(20) == 0 && super.d() && this.world.difficulty > 0;
} }
public int m() { public int m() {

Datei anzeigen

@ -62,7 +62,7 @@ public abstract class EntityHuman extends EntityLiving {
protected float O = 0.1F; protected float O = 0.1F;
protected float P = 0.02F; protected float P = 0.02F;
private int f = 0; private int f = 0;
public EntityFish hookedFish = null; public EntityFishingHook hookedFish = null;
public EntityHuman(World world) { public EntityHuman(World world) {
super(world); super(world);
@ -152,7 +152,7 @@ public abstract class EntityHuman extends EntityLiving {
super.s_(); super.s_();
if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.b(this)) { if (!this.world.isStatic && this.activeContainer != null && !this.activeContainer.b(this)) {
this.x(); this.closeInventory();
this.activeContainer = this.defaultContainer; this.activeContainer = this.defaultContainer;
} }
@ -251,7 +251,7 @@ public abstract class EntityHuman extends EntityLiving {
return this.health <= 0 || this.isSleeping(); return this.health <= 0 || this.isSleeping();
} }
protected void x() { protected void closeInventory() {
this.activeContainer = this.defaultContainer; this.activeContainer = this.defaultContainer;
} }
@ -267,7 +267,7 @@ public abstract class EntityHuman extends EntityLiving {
} }
private int o() { private int o() {
return this.a(MobEffectList.e) ? 6 - (1 + this.b(MobEffectList.e).c()) * 1 : (this.a(MobEffectList.f) ? 6 + (1 + this.b(MobEffectList.f).c()) * 2 : 6); return this.hasEffect(MobEffectList.FASTER_DIG) ? 6 - (1 + this.getEffect(MobEffectList.FASTER_DIG).getAmplifier()) * 1 : (this.hasEffect(MobEffectList.SLOWER_DIG) ? 6 + (1 + this.getEffect(MobEffectList.SLOWER_DIG).getAmplifier()) * 2 : 6);
} }
protected void c_() { protected void c_() {
@ -291,7 +291,7 @@ public abstract class EntityHuman extends EntityLiving {
--this.n; --this.n;
} }
if (this.world.spawnMonsters == 0 && this.health < 20 && this.ticksLived % 20 * 12 == 0) { if (this.world.difficulty == 0 && this.health < 20 && this.ticksLived % 20 * 12 == 0) {
// CraftBukkit - added regain reason of "REGEN" for filtering purposes. // CraftBukkit - added regain reason of "REGEN" for filtering purposes.
this.c(1, RegainReason.REGEN); this.c(1, RegainReason.REGEN);
} }
@ -301,7 +301,7 @@ public abstract class EntityHuman extends EntityLiving {
super.s(); super.s();
this.aj = this.O; this.aj = this.O;
this.ak = this.P; this.ak = this.P;
if (this.at()) { if (this.isSprinting()) {
this.aj = (float) ((double) this.aj + (double) this.O * 0.3D); this.aj = (float) ((double) this.aj + (double) this.O * 0.3D);
this.ak = (float) ((double) this.ak + (double) this.P * 0.3D); this.ak = (float) ((double) this.ak + (double) this.P * 0.3D);
} }
@ -442,12 +442,12 @@ public abstract class EntityHuman extends EntityLiving {
f /= 5.0F; f /= 5.0F;
} }
if (this.a(MobEffectList.e)) { if (this.hasEffect(MobEffectList.FASTER_DIG)) {
f *= 1.0F + (float) (this.b(MobEffectList.e).c() + 1) * 0.2F; f *= 1.0F + (float) (this.getEffect(MobEffectList.FASTER_DIG).getAmplifier() + 1) * 0.2F;
} }
if (this.a(MobEffectList.f)) { if (this.hasEffect(MobEffectList.SLOWER_DIG)) {
f *= 1.0F - (float) (this.b(MobEffectList.f).c() + 1) * 0.2F; f *= 1.0F - (float) (this.getEffect(MobEffectList.SLOWER_DIG).getAmplifier() + 1) * 0.2F;
} }
return f; return f;
@ -534,15 +534,15 @@ public abstract class EntityHuman extends EntityLiving {
Entity entity = damagesource.getEntity(); Entity entity = damagesource.getEntity();
if (entity instanceof EntityMonster || entity instanceof EntityArrow) { if (entity instanceof EntityMonster || entity instanceof EntityArrow) {
if (this.world.spawnMonsters == 0) { if (this.world.difficulty == 0) {
i = 0; i = 0;
} }
if (this.world.spawnMonsters == 1) { if (this.world.difficulty == 1) {
i = i / 3 + 1; i = i / 3 + 1;
} }
if (this.world.spawnMonsters == 3) { if (this.world.difficulty == 3) {
i = i * 3 / 2; i = i * 3 / 2;
} }
} }
@ -726,11 +726,11 @@ public abstract class EntityHuman extends EntityLiving {
// CraftBukkit end // CraftBukkit end
if (flag1) { if (flag1) {
if (this.at()) { if (this.isSprinting()) {
entity.b((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * 1.0F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * 1.0F)); entity.b((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * 1.0F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * 1.0F));
this.motX *= 0.6D; this.motX *= 0.6D;
this.motZ *= 0.6D; this.motZ *= 0.6D;
this.g(false); this.setSprinting(false);
} }
if (flag) { if (flag) {
@ -975,7 +975,7 @@ public abstract class EntityHuman extends EntityLiving {
protected void S() { protected void S() {
super.S(); super.S();
this.a(StatisticList.u, 1); this.a(StatisticList.u, 1);
if (this.at()) { if (this.isSprinting()) {
this.b(0.8F); this.b(0.8F);
} else { } else {
this.b(0.2F); this.b(0.2F);
@ -1026,7 +1026,7 @@ public abstract class EntityHuman extends EntityLiving {
i = Math.round(MathHelper.a(d0 * d0 + d2 * d2) * 100.0F); i = Math.round(MathHelper.a(d0 * d0 + d2 * d2) * 100.0F);
if (i > 0) { if (i > 0) {
this.a(StatisticList.l, i); this.a(StatisticList.l, i);
if (this.at()) { if (this.isSprinting()) {
this.b(0.099999994F * (float) i * 0.01F); this.b(0.099999994F * (float) i * 0.01F);
} else { } else {
this.b(0.01F * (float) i * 0.01F); this.b(0.01F * (float) i * 0.01F);

Datei anzeigen

@ -59,7 +59,7 @@ public abstract class EntityLiving extends Entity {
private int c = 0; private int c = 0;
public int aD = 0; public int aD = 0;
public int aE = 0; public int aE = 0;
protected HashMap aF = new HashMap(); protected HashMap effects = new HashMap();
protected int aG; protected int aG;
protected double aH; protected double aH;
protected double aI; protected double aI;
@ -144,7 +144,7 @@ public abstract class EntityLiving extends Entity {
int i; int i;
if (this.ac() && this.a(Material.WATER) && !this.b_() && !this.aF.containsKey(Integer.valueOf(MobEffectList.o.H))) { if (this.ac() && this.a(Material.WATER) && !this.b_() && !this.effects.containsKey(Integer.valueOf(MobEffectList.WATER_BREATHING.id))) {
--this.airTicks; --this.airTicks;
if (this.airTicks == -20) { if (this.airTicks == -20) {
this.airTicks = 0; this.airTicks = 0;
@ -691,17 +691,17 @@ public abstract class EntityLiving extends Entity {
nbttagcompound.a("HurtTime", (short) this.hurtTicks); nbttagcompound.a("HurtTime", (short) this.hurtTicks);
nbttagcompound.a("DeathTime", (short) this.deathTicks); nbttagcompound.a("DeathTime", (short) this.deathTicks);
nbttagcompound.a("AttackTime", (short) this.attackTicks); nbttagcompound.a("AttackTime", (short) this.attackTicks);
if (!this.aF.isEmpty()) { if (!this.effects.isEmpty()) {
NBTTagList nbttaglist = new NBTTagList(); NBTTagList nbttaglist = new NBTTagList();
Iterator iterator = this.aF.values().iterator(); Iterator iterator = this.effects.values().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
MobEffect mobeffect = (MobEffect) iterator.next(); MobEffect mobeffect = (MobEffect) iterator.next();
NBTTagCompound nbttagcompound1 = new NBTTagCompound(); NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.a("Id", (byte) mobeffect.a()); nbttagcompound1.a("Id", (byte) mobeffect.getEffectId());
nbttagcompound1.a("Amplifier", (byte) mobeffect.c()); nbttagcompound1.a("Amplifier", (byte) mobeffect.getAmplifier());
nbttagcompound1.a("Duration", mobeffect.b()); nbttagcompound1.a("Duration", mobeffect.getDuration());
nbttaglist.a((NBTBase) nbttagcompound1); nbttaglist.a((NBTBase) nbttagcompound1);
} }
@ -727,7 +727,7 @@ public abstract class EntityLiving extends Entity {
byte b1 = nbttagcompound1.c("Amplifier"); byte b1 = nbttagcompound1.c("Amplifier");
int j = nbttagcompound1.e("Duration"); int j = nbttagcompound1.e("Duration");
this.aF.put(Integer.valueOf(b0), new MobEffect(b0, j, b1)); this.effects.put(Integer.valueOf(b0), new MobEffect(b0, j, b1));
} }
} }
} }
@ -832,7 +832,7 @@ public abstract class EntityLiving extends Entity {
protected void S() { protected void S() {
this.motY = 0.41999998688697815D; this.motY = 0.41999998688697815D;
if (this.at()) { if (this.isSprinting()) {
float f = this.yaw * 0.017453292F; float f = this.yaw * 0.017453292F;
this.motX -= (double) (MathHelper.sin(f) * 0.2F); this.motX -= (double) (MathHelper.sin(f) * 0.2F);
@ -1021,37 +1021,37 @@ public abstract class EntityLiving extends Entity {
} }
protected void aj() { protected void aj() {
Iterator iterator = this.aF.keySet().iterator(); Iterator iterator = this.effects.keySet().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Integer integer = (Integer) iterator.next(); Integer integer = (Integer) iterator.next();
MobEffect mobeffect = (MobEffect) this.aF.get(integer); MobEffect mobeffect = (MobEffect) this.effects.get(integer);
if (!mobeffect.a(this) && !this.world.isStatic) { if (!mobeffect.tick(this) && !this.world.isStatic) {
iterator.remove(); iterator.remove();
this.c(mobeffect); this.c(mobeffect);
} }
} }
} }
public Collection ak() { public Collection getEffects() {
return this.aF.values(); return this.effects.values();
} }
public boolean a(MobEffectList mobeffectlist) { public boolean hasEffect(MobEffectList mobeffectlist) {
return this.aF.containsKey(Integer.valueOf(mobeffectlist.H)); return this.effects.containsKey(Integer.valueOf(mobeffectlist.id));
} }
public MobEffect b(MobEffectList mobeffectlist) { public MobEffect getEffect(MobEffectList mobeffectlist) {
return (MobEffect) this.aF.get(Integer.valueOf(mobeffectlist.H)); return (MobEffect) this.effects.get(Integer.valueOf(mobeffectlist.id));
} }
public void d(MobEffect mobeffect) { public void addEffect(MobEffect mobeffect) {
if (this.aF.containsKey(Integer.valueOf(mobeffect.a()))) { if (this.effects.containsKey(Integer.valueOf(mobeffect.getEffectId()))) {
((MobEffect) this.aF.get(Integer.valueOf(mobeffect.a()))).a(mobeffect); ((MobEffect) this.effects.get(Integer.valueOf(mobeffect.getEffectId()))).a(mobeffect);
this.b((MobEffect) this.aF.get(Integer.valueOf(mobeffect.a()))); this.b((MobEffect) this.effects.get(Integer.valueOf(mobeffect.getEffectId())));
} else { } else {
this.aF.put(Integer.valueOf(mobeffect.a()), mobeffect); this.effects.put(Integer.valueOf(mobeffect.getEffectId()), mobeffect);
this.a(mobeffect); this.a(mobeffect);
} }
} }
@ -1065,12 +1065,12 @@ public abstract class EntityLiving extends Entity {
protected float D() { protected float D() {
float f = 1.0F; float f = 1.0F;
if (this.a(MobEffectList.c)) { if (this.hasEffect(MobEffectList.FASTER_MOVEMENT)) {
f *= 1.0F + 0.2F * (float) (this.b(MobEffectList.c).c() + 1); f *= 1.0F + 0.2F * (float) (this.getEffect(MobEffectList.FASTER_MOVEMENT).getAmplifier() + 1);
} }
if (this.a(MobEffectList.d)) { if (this.hasEffect(MobEffectList.SLOWER_MOVEMENT)) {
f *= 1.0F - 0.15F * (float) (this.b(MobEffectList.d).c() + 1); f *= 1.0F - 0.15F * (float) (this.getEffect(MobEffectList.SLOWER_MOVEMENT).getAmplifier() + 1);
} }
return f; return f;

Datei anzeigen

@ -29,7 +29,7 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
public void s_() { public void s_() {
super.s_(); super.s_();
if (!this.world.isStatic && this.world.spawnMonsters == 0) { if (!this.world.isStatic && this.world.difficulty == 0) {
this.die(); this.die();
} }
} }

Datei anzeigen

@ -53,7 +53,7 @@ public class EntityPig extends EntityAnimal {
} }
public boolean hasSaddle() { public boolean hasSaddle() {
return (this.datawatcher.a(16) & 1) != 0; return (this.datawatcher.getByte(16) & 1) != 0;
} }
public void setSaddle(boolean flag) { public void setSaddle(boolean flag) {

Datei anzeigen

@ -31,7 +31,7 @@ public class EntityPigZombie extends EntityZombie {
} }
public boolean d() { public boolean d() {
return this.world.spawnMonsters > 0 && this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox); return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.getEntities(this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
} }
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {

Datei anzeigen

@ -172,7 +172,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.inventory.armor[i] = null; this.inventory.armor[i] = null;
} }
this.x(); this.closeInventory();
// CraftBukkit end // CraftBukkit end
} }
@ -265,7 +265,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (this.I) { if (this.I) {
//if (this.b.propertyManager.getBoolean("allow-nether", true)) { // CraftBukkit //if (this.b.propertyManager.getBoolean("allow-nether", true)) { // CraftBukkit
if (this.activeContainer != this.defaultContainer) { if (this.activeContainer != this.defaultContainer) {
this.x(); this.closeInventory();
} }
if (this.vehicle != null) { if (this.vehicle != null) {
@ -463,7 +463,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void a(ItemStack itemstack) {} public void a(ItemStack itemstack) {}
public void x() { public void closeInventory() {
this.netServerHandler.sendPacket(new Packet101CloseWindow(this.activeContainer.windowId)); this.netServerHandler.sendPacket(new Packet101CloseWindow(this.activeContainer.windowId));
this.z(); this.z();
} }

Datei anzeigen

@ -82,21 +82,21 @@ public class EntitySheep extends EntityAnimal {
} }
public int getColor() { public int getColor() {
return this.datawatcher.a(16) & 15; return this.datawatcher.getByte(16) & 15;
} }
public void setColor(int i) { public void setColor(int i) {
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.getByte(16);
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 & 240 | i & 15))); this.datawatcher.watch(16, Byte.valueOf((byte) (b0 & 240 | i & 15)));
} }
public boolean isSheared() { public boolean isSheared() {
return (this.datawatcher.a(16) & 16) != 0; return (this.datawatcher.getByte(16) & 16) != 0;
} }
public void setSheared(boolean flag) { public void setSheared(boolean flag) {
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.getByte(16);
if (flag) { if (flag) {
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 16))); this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 16)));

Datei anzeigen

@ -8,7 +8,7 @@ import java.util.Set;
public class EntityTracker { public class EntityTracker {
private Set a = new HashSet(); private Set a = new HashSet();
private EntityList b = new EntityList(); private EntityList trackedEntities = new EntityList();
private MinecraftServer c; private MinecraftServer c;
private int d; private int d;
private int e; private int e;
@ -22,7 +22,7 @@ public class EntityTracker {
// CraftBukkit - synchronized // CraftBukkit - synchronized
public synchronized void track(Entity entity) { public synchronized void track(Entity entity) {
if (entity instanceof EntityPlayer) { if (entity instanceof EntityPlayer) {
this.a(entity, 512, 2); this.addEntity(entity, 512, 2);
EntityPlayer entityplayer = (EntityPlayer) entity; EntityPlayer entityplayer = (EntityPlayer) entity;
Iterator iterator = this.a.iterator(); Iterator iterator = this.a.iterator();
@ -33,55 +33,55 @@ public class EntityTracker {
entitytrackerentry.b(entityplayer); entitytrackerentry.b(entityplayer);
} }
} }
} else if (entity instanceof EntityFish) { } else if (entity instanceof EntityFishingHook) {
this.a(entity, 64, 5, true); this.addEntity(entity, 64, 5, true);
} else if (entity instanceof EntityArrow) { } else if (entity instanceof EntityArrow) {
this.a(entity, 64, 20, false); this.addEntity(entity, 64, 20, false);
} else if (entity instanceof EntityFireball) { } else if (entity instanceof EntityFireball) {
this.a(entity, 64, 10, false); this.addEntity(entity, 64, 10, false);
} else if (entity instanceof EntitySnowball) { } else if (entity instanceof EntitySnowball) {
this.a(entity, 64, 10, true); this.addEntity(entity, 64, 10, true);
} else if (entity instanceof EntityEgg) { } else if (entity instanceof EntityEgg) {
this.a(entity, 64, 10, true); this.addEntity(entity, 64, 10, true);
} else if (entity instanceof EntityItem) { } else if (entity instanceof EntityItem) {
this.a(entity, 64, 20, true); this.addEntity(entity, 64, 20, true);
} else if (entity instanceof EntityMinecart) { } else if (entity instanceof EntityMinecart) {
this.a(entity, 160, 5, true); this.addEntity(entity, 160, 5, true);
} else if (entity instanceof EntityBoat) { } else if (entity instanceof EntityBoat) {
this.a(entity, 160, 5, true); this.addEntity(entity, 160, 5, true);
} else if (entity instanceof EntitySquid) { } else if (entity instanceof EntitySquid) {
this.a(entity, 160, 3, true); this.addEntity(entity, 160, 3, true);
} else if (entity instanceof IAnimal) { } else if (entity instanceof IAnimal) {
this.a(entity, 160, 3, true); this.addEntity(entity, 160, 3, true);
} else if (entity instanceof EntityTNTPrimed) { } else if (entity instanceof EntityTNTPrimed) {
this.a(entity, 160, 10, true); this.addEntity(entity, 160, 10, true);
} else if (entity instanceof EntityFallingSand) { } else if (entity instanceof EntityFallingSand) {
this.a(entity, 160, 20, true); this.addEntity(entity, 160, 20, true);
} else if (entity instanceof EntityPainting) { } else if (entity instanceof EntityPainting) {
this.a(entity, 160, Integer.MAX_VALUE, false); this.addEntity(entity, 160, Integer.MAX_VALUE, false);
} else if (entity instanceof EntityExperienceOrb) { } else if (entity instanceof EntityExperienceOrb) {
this.a(entity, 160, 20, true); this.addEntity(entity, 160, 20, true);
} }
} }
public void a(Entity entity, int i, int j) { public void addEntity(Entity entity, int i, int j) {
this.a(entity, i, j, false); this.addEntity(entity, i, j, false);
} }
// CraftBukkit - synchronized // CraftBukkit - synchronized
public synchronized void a(Entity entity, int i, int j, boolean flag) { public synchronized void addEntity(Entity entity, int i, int j, boolean flag) {
if (i > this.d) { if (i > this.d) {
i = this.d; i = this.d;
} }
if (this.b.b(entity.id)) { if (this.trackedEntities.b(entity.id)) {
// CraftBukkit - removed exception throw as tracking an already tracked entity theoretically shouldn't cause any issues. // CraftBukkit - removed exception throw as tracking an already tracked entity theoretically shouldn't cause any issues.
// throw new IllegalStateException("Entity is already tracked!"); // throw new IllegalStateException("Entity is already tracked!");
} else { } else {
EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(entity, i, j, flag); EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(entity, i, j, flag);
this.a.add(entitytrackerentry); this.a.add(entitytrackerentry);
this.b.a(entity.id, entitytrackerentry); this.trackedEntities.a(entity.id, entitytrackerentry);
entitytrackerentry.scanPlayers(this.c.getWorldServer(this.e).players); entitytrackerentry.scanPlayers(this.c.getWorldServer(this.e).players);
} }
} }
@ -99,7 +99,7 @@ public class EntityTracker {
} }
} }
EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry) this.b.d(entity.id); EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry) this.trackedEntities.d(entity.id);
if (entitytrackerentry1 != null) { if (entitytrackerentry1 != null) {
this.a.remove(entitytrackerentry1); this.a.remove(entitytrackerentry1);
@ -137,7 +137,7 @@ public class EntityTracker {
// CraftBukkit - synchronized // CraftBukkit - synchronized
public synchronized void a(Entity entity, Packet packet) { public synchronized void a(Entity entity, Packet packet) {
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.b.a(entity.id); EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.trackedEntities.a(entity.id);
if (entitytrackerentry != null) { if (entitytrackerentry != null) {
entitytrackerentry.a(packet); entitytrackerentry.a(packet);
@ -146,7 +146,7 @@ public class EntityTracker {
// CraftBukkit - synchronized // CraftBukkit - synchronized
public synchronized void sendPacketToEntity(Entity entity, Packet packet) { public synchronized void sendPacketToEntity(Entity entity, Packet packet) {
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.b.a(entity.id); EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) this.trackedEntities.a(entity.id);
if (entitytrackerentry != null) { if (entitytrackerentry != null) {
entitytrackerentry.b(packet); entitytrackerentry.b(packet);

Datei anzeigen

@ -108,7 +108,7 @@ public class EntityTrackerEntry {
this.a((Packet) object); this.a((Packet) object);
} }
DataWatcher datawatcher = this.tracker.al(); DataWatcher datawatcher = this.tracker.getDataWatcher();
if (datawatcher.a()) { if (datawatcher.a()) {
this.b((Packet) (new Packet40EntityMetadata(this.tracker.id, datawatcher))); this.b((Packet) (new Packet40EntityMetadata(this.tracker.id, datawatcher)));
@ -212,7 +212,7 @@ public class EntityTrackerEntry {
if (this.tracker instanceof EntityLiving) { if (this.tracker instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving) this.tracker; EntityLiving entityliving = (EntityLiving) this.tracker;
Iterator iterator = entityliving.ak().iterator(); Iterator iterator = entityliving.getEffects().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
MobEffect mobeffect = (MobEffect) iterator.next(); MobEffect mobeffect = (MobEffect) iterator.next();
@ -271,7 +271,7 @@ public class EntityTrackerEntry {
return new Packet23VehicleSpawn(this.tracker, 1); return new Packet23VehicleSpawn(this.tracker, 1);
} else if (this.tracker instanceof IAnimal) { } else if (this.tracker instanceof IAnimal) {
return new Packet24MobSpawn((EntityLiving) this.tracker); return new Packet24MobSpawn((EntityLiving) this.tracker);
} else if (this.tracker instanceof EntityFish) { } else if (this.tracker instanceof EntityFishingHook) {
return new Packet23VehicleSpawn(this.tracker, 90); return new Packet23VehicleSpawn(this.tracker, 90);
} else if (this.tracker instanceof EntityArrow) { } else if (this.tracker instanceof EntityArrow) {
Entity entity = ((EntityArrow) this.tracker).shooter; Entity entity = ((EntityArrow) this.tracker).shooter;
@ -286,9 +286,9 @@ public class EntityTrackerEntry {
Packet23VehicleSpawn packet23vehiclespawn = new Packet23VehicleSpawn(this.tracker, 63, shooter); Packet23VehicleSpawn packet23vehiclespawn = new Packet23VehicleSpawn(this.tracker, 63, shooter);
// CraftBukkit end // CraftBukkit end
packet23vehiclespawn.e = (int) (entityfireball.c * 8000.0D); packet23vehiclespawn.e = (int) (entityfireball.dirX * 8000.0D);
packet23vehiclespawn.f = (int) (entityfireball.d * 8000.0D); packet23vehiclespawn.f = (int) (entityfireball.dirY * 8000.0D);
packet23vehiclespawn.g = (int) (entityfireball.e * 8000.0D); packet23vehiclespawn.g = (int) (entityfireball.dirZ * 8000.0D);
return packet23vehiclespawn; return packet23vehiclespawn;
} else if (this.tracker instanceof EntityEgg) { } else if (this.tracker instanceof EntityEgg) {
return new Packet23VehicleSpawn(this.tracker, 62); return new Packet23VehicleSpawn(this.tracker, 62);

Datei anzeigen

@ -37,7 +37,7 @@ public class EntityWeatherStorm extends EntityWeather {
this.a = this.random.nextLong(); this.a = this.random.nextLong();
this.c = this.random.nextInt(3) + 1; this.c = this.random.nextInt(3) + 1;
// CraftBukkit // CraftBukkit
if (!isEffect && world.spawnMonsters >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) { if (!isEffect && world.difficulty >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
int i = MathHelper.floor(d0); int i = MathHelper.floor(d0);
int j = MathHelper.floor(d1); int j = MathHelper.floor(d1);
int k = MathHelper.floor(d2); int k = MathHelper.floor(d2);

Datei anzeigen

@ -69,7 +69,7 @@ public class EntityWolf extends EntityAnimal {
} }
protected String h() { protected String h() {
return this.isAngry() ? "mob.wolf.growl" : (this.random.nextInt(3) == 0 ? (this.isTamed() && this.datawatcher.b(18) < 10 ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); return this.isAngry() ? "mob.wolf.growl" : (this.random.nextInt(3) == 0 ? (this.isTamed() && this.datawatcher.getInt(18) < 10 ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark");
} }
protected String i() { protected String i() {
@ -382,7 +382,7 @@ public class EntityWolf extends EntityAnimal {
if (itemstack != null && Item.byId[itemstack.id] instanceof ItemFood) { if (itemstack != null && Item.byId[itemstack.id] instanceof ItemFood) {
ItemFood itemfood = (ItemFood) Item.byId[itemstack.id]; ItemFood itemfood = (ItemFood) Item.byId[itemstack.id];
if (itemfood.m() && this.datawatcher.b(18) < 20) { if (itemfood.m() && this.datawatcher.getInt(18) < 20) {
--itemstack.count; --itemstack.count;
this.c(itemfood.k(), RegainReason.EATING); // Craftbukkit this.c(itemfood.k(), RegainReason.EATING); // Craftbukkit
if (itemstack.count <= 0) { if (itemstack.count <= 0) {
@ -428,7 +428,7 @@ public class EntityWolf extends EntityAnimal {
} }
public String getOwnerName() { public String getOwnerName() {
return this.datawatcher.c(17); return this.datawatcher.getString(17);
} }
public void setOwnerName(String s) { public void setOwnerName(String s) {
@ -436,11 +436,11 @@ public class EntityWolf extends EntityAnimal {
} }
public boolean isSitting() { public boolean isSitting() {
return (this.datawatcher.a(16) & 1) != 0; return (this.datawatcher.getByte(16) & 1) != 0;
} }
public void setSitting(boolean flag) { public void setSitting(boolean flag) {
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.getByte(16);
if (flag) { if (flag) {
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 1))); this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 1)));
@ -450,11 +450,11 @@ public class EntityWolf extends EntityAnimal {
} }
public boolean isAngry() { public boolean isAngry() {
return (this.datawatcher.a(16) & 2) != 0; return (this.datawatcher.getByte(16) & 2) != 0;
} }
public void setAngry(boolean flag) { public void setAngry(boolean flag) {
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.getByte(16);
if (flag) { if (flag) {
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 2))); this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 2)));
@ -464,11 +464,11 @@ public class EntityWolf extends EntityAnimal {
} }
public boolean isTamed() { public boolean isTamed() {
return (this.datawatcher.a(16) & 4) != 0; return (this.datawatcher.getByte(16) & 4) != 0;
} }
public void setTamed(boolean flag) { public void setTamed(boolean flag) {
byte b0 = this.datawatcher.a(16); byte b0 = this.datawatcher.getByte(16);
if (flag) { if (flag) {
this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 4))); this.datawatcher.watch(16, Byte.valueOf((byte) (b0 | 4)));

Datei anzeigen

@ -27,7 +27,7 @@ public class FoodMetaData {
} }
public void a(EntityHuman entityhuman) { public void a(EntityHuman entityhuman) {
int i = entityhuman.world.spawnMonsters; int i = entityhuman.world.difficulty;
this.e = this.foodLevel; this.e = this.foodLevel;
if (this.exhaustionLevel > 4.0F) { if (this.exhaustionLevel > 4.0F) {

Datei anzeigen

@ -5,7 +5,7 @@ public class InventoryPlayer implements IInventory {
public ItemStack[] items = new ItemStack[36]; public ItemStack[] items = new ItemStack[36];
public ItemStack[] armor = new ItemStack[4]; public ItemStack[] armor = new ItemStack[4];
public int itemInHandIndex = 0; public int itemInHandIndex = 0;
public EntityHuman d; // CraftBukkit - private -> public public EntityHuman d;
private ItemStack f; private ItemStack f;
public boolean e = false; public boolean e = false;

Datei anzeigen

@ -27,7 +27,7 @@ public class ItemFishingRod extends Item {
// CraftBukkit end // CraftBukkit end
world.makeSound(entityhuman, "random.bow", 0.5F, 0.4F / (b.nextFloat() * 0.4F + 0.8F)); world.makeSound(entityhuman, "random.bow", 0.5F, 0.4F / (b.nextFloat() * 0.4F + 0.8F));
if (!world.isStatic) { if (!world.isStatic) {
world.addEntity(new EntityFish(world, entityhuman)); world.addEntity(new EntityFishingHook(world, entityhuman));
} }
entityhuman.v(); entityhuman.v();

Datei anzeigen

@ -39,7 +39,7 @@ public class ItemFood extends Item {
// CraftBukkit end // CraftBukkit end
if (!world.isStatic && this.bx > 0 && world.random.nextFloat() < this.bA) { if (!world.isStatic && this.bx > 0 && world.random.nextFloat() < this.bA) {
entityhuman.d(new MobEffect(this.bx, this.by * 20, this.bz)); entityhuman.addEffect(new MobEffect(this.bx, this.by * 20, this.bz));
} }
return itemstack; return itemstack;

Datei anzeigen

@ -102,7 +102,7 @@ public final class ItemStack {
} }
public boolean d() { public boolean d() {
return Item.byId[this.id].e() > 0; return Item.byId[this.id].getMaxDurability() > 0;
} }
public boolean usesData() { public boolean usesData() {
@ -126,7 +126,7 @@ public final class ItemStack {
} }
public int i() { public int i() {
return Item.byId[this.id].e(); return Item.byId[this.id].getMaxDurability();
} }
public void damage(int i, Entity entity) { public void damage(int i, Entity entity) {

Datei anzeigen

@ -229,9 +229,9 @@ public class MinecraftServer implements Runnable, ICommandListener {
world.tracker = new EntityTracker(this, dimension); world.tracker = new EntityTracker(this, dimension);
world.addIWorldAccess(new WorldManager(this, world)); world.addIWorldAccess(new WorldManager(this, world));
world.spawnMonsters = this.propertyManager.getInt("difficulty", 1); world.difficulty = this.propertyManager.getInt("difficulty", 1);
world.setSpawnFlags(this.propertyManager.getBoolean("spawn-monsters", true), this.spawnAnimals); world.setSpawnFlags(this.propertyManager.getBoolean("spawn-monsters", true), this.spawnAnimals);
world.p().d(j); world.p().setGameType(j);
this.worlds.add(world); this.worlds.add(world);
this.serverConfigurationManager.setPlayerFileData(this.worlds.toArray(new WorldServer[0])); this.serverConfigurationManager.setPlayerFileData(this.worlds.toArray(new WorldServer[0]));
} }
@ -312,7 +312,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
} }
WorldServer world = this.worlds.get(0); WorldServer world = this.worlds.get(0);
if (!world.canSave) { if (!world.savingDisabled) {
this.serverConfigurationManager.savePlayers(); this.serverConfigurationManager.savePlayers();
} }
// CraftBukkit end // CraftBukkit end
@ -339,7 +339,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
// CraftBukkit end // CraftBukkit end
} }
public void a() { public void safeShutdown() {
this.isRunning = false; this.isRunning = false;
} }
@ -464,7 +464,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
; ;
} }
worldserver.cleanUp(); worldserver.tickEntities();
} }
// } // CraftBukkit // } // CraftBukkit

Datei anzeigen

@ -91,14 +91,14 @@ public class NetLoginHandler extends NetHandler {
WorldServer worldserver = (WorldServer) entityplayer.world; // CraftBukkit WorldServer worldserver = (WorldServer) entityplayer.world; // CraftBukkit
ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
entityplayer.itemInWorldManager.b(worldserver.p().n()); entityplayer.itemInWorldManager.b(worldserver.p().getGameType());
NetServerHandler netserverhandler = new NetServerHandler(this.server, this.networkManager, entityplayer); NetServerHandler netserverhandler = new NetServerHandler(this.server, this.networkManager, entityplayer);
int i = entityplayer.id; int i = entityplayer.id;
long j = worldserver.getSeed(); long j = worldserver.getSeed();
int k = entityplayer.itemInWorldManager.a(); int k = entityplayer.itemInWorldManager.a();
byte b0 = (byte) worldserver.worldProvider.dimension; byte b0 = (byte) worldserver.worldProvider.dimension;
byte b1 = (byte) worldserver.spawnMonsters; byte b1 = (byte) worldserver.difficulty;
worldserver.getClass(); worldserver.getClass();
// CraftBukkit start -- Don't send a higher than 126 MaxPlayer size, otherwise the PlayerInfo window won't render correctly. // CraftBukkit start -- Don't send a higher than 126 MaxPlayer size, otherwise the PlayerInfo window won't render correctly.
@ -117,7 +117,7 @@ public class NetLoginHandler extends NetHandler {
netserverhandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch); netserverhandler.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
this.server.networkListenThread.a(netserverhandler); this.server.networkListenThread.a(netserverhandler);
netserverhandler.sendPacket(new Packet4UpdateTime(entityplayer.getPlayerTime())); // CraftBukkit - add support for player specific time netserverhandler.sendPacket(new Packet4UpdateTime(entityplayer.getPlayerTime())); // CraftBukkit - add support for player specific time
Iterator iterator = entityplayer.ak().iterator(); Iterator iterator = entityplayer.getEffects().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
MobEffect mobeffect = (MobEffect) iterator.next(); MobEffect mobeffect = (MobEffect) iterator.next();

Datei anzeigen

@ -863,9 +863,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
} else if (packet19entityaction.animation == 2) { } else if (packet19entityaction.animation == 2) {
this.player.setSneak(false); this.player.setSneak(false);
} else if (packet19entityaction.animation == 4) { } else if (packet19entityaction.animation == 4) {
this.player.g(true); this.player.setSprinting(true);
} else if (packet19entityaction.animation == 5) { } else if (packet19entityaction.animation == 5) {
this.player.g(false); this.player.setSprinting(false);
} else if (packet19entityaction.animation == 3) { } else if (packet19entityaction.animation == 3) {
this.player.a(false, true, true); this.player.a(false, true, true);
this.checkMovement = false; this.checkMovement = false;

Datei anzeigen

@ -90,8 +90,7 @@ public class PropertyManager {
} }
} }
public void b(String s, boolean flag) { public void setBoolean(String s, boolean flag) {
flag = this.getOverride(s, flag); // CraftBukkit
this.properties.setProperty(s, "" + flag); this.properties.setProperty(s, "" + flag);
this.savePropertiesFile(); this.savePropertiesFile();
} }

Datei anzeigen

@ -35,14 +35,14 @@ public class ServerConfigurationManager {
public int maxPlayers; // CraftBukkit - private -> public public int maxPlayers; // CraftBukkit - private -> public
public Set banByName = new HashSet(); // CraftBukkit - private -> public public Set banByName = new HashSet(); // CraftBukkit - private -> public
public Set banByIP = new HashSet(); // CraftBukkit - private -> public public Set banByIP = new HashSet(); // CraftBukkit - private -> public
private Set h = new HashSet(); private Set operators = new HashSet();
private Set i = new HashSet(); private Set whitelist = new HashSet();
private File j; private File j;
private File k; private File k;
private File l; private File l;
private File m; private File m;
public PlayerFileData playerFileData; // CraftBukkit - private - >public public PlayerFileData playerFileData; // CraftBukkit - private - >public
public boolean o; // Craftbukkit - private -> public public boolean hasWhitelist; // Craftbukkit - private -> public
private int p = 0; private int p = 0;
// CraftBukkit start // CraftBukkit start
@ -63,7 +63,7 @@ public class ServerConfigurationManager {
// CraftBukkit - removed playermanagers // CraftBukkit - removed playermanagers
this.maxPlayers = minecraftserver.propertyManager.getInt("max-players", 20); this.maxPlayers = minecraftserver.propertyManager.getInt("max-players", 20);
this.o = minecraftserver.propertyManager.getBoolean("white-list", false); this.hasWhitelist = minecraftserver.propertyManager.getBoolean("white-list", false);
this.i(); this.i();
this.k(); this.k();
this.m(); this.m();
@ -271,7 +271,7 @@ public class ServerConfigurationManager {
// CraftBukkit start // CraftBukkit start
byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId()); byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId());
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension, (byte) worldserver.spawnMonsters, worldserver.getSeed(), 128, entityplayer1.itemInWorldManager.a())); entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension, (byte) worldserver.difficulty, worldserver.getSeed(), 128, entityplayer1.itemInWorldManager.a()));
entityplayer1.spawnIn(worldserver); entityplayer1.spawnIn(worldserver);
entityplayer1.dead = false; entityplayer1.dead = false;
entityplayer1.netServerHandler.teleport(new Location(worldserver.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch)); entityplayer1.netServerHandler.teleport(new Location(worldserver.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch));
@ -375,12 +375,12 @@ public class ServerConfigurationManager {
return s; return s;
} }
public void a(String s) { public void addUserBan(String s) {
this.banByName.add(s.toLowerCase()); this.banByName.add(s.toLowerCase());
this.j(); this.j();
} }
public void b(String s) { public void removeUserBan(String s) {
this.banByName.remove(s.toLowerCase()); this.banByName.remove(s.toLowerCase());
this.j(); this.j();
} }
@ -418,12 +418,12 @@ public class ServerConfigurationManager {
} }
} }
public void c(String s) { public void addIpBan(String s) {
this.banByIP.add(s.toLowerCase()); this.banByIP.add(s.toLowerCase());
this.l(); this.l();
} }
public void d(String s) { public void removeIpBan(String s) {
this.banByIP.remove(s.toLowerCase()); this.banByIP.remove(s.toLowerCase());
this.l(); this.l();
} }
@ -461,8 +461,8 @@ public class ServerConfigurationManager {
} }
} }
public void e(String s) { public void addOp(String s) {
this.h.add(s.toLowerCase()); this.operators.add(s.toLowerCase());
this.n(); this.n();
// Craftbukkit start // Craftbukkit start
@ -473,8 +473,8 @@ public class ServerConfigurationManager {
// Craftbukkit end // Craftbukkit end
} }
public void f(String s) { public void removeOp(String s) {
this.h.remove(s.toLowerCase()); this.operators.remove(s.toLowerCase());
this.n(); this.n();
// Craftbukkit start // Craftbukkit start
@ -487,12 +487,12 @@ public class ServerConfigurationManager {
private void m() { private void m() {
try { try {
this.h.clear(); this.operators.clear();
BufferedReader bufferedreader = new BufferedReader(new FileReader(this.l)); BufferedReader bufferedreader = new BufferedReader(new FileReader(this.l));
String s = ""; String s = "";
while ((s = bufferedreader.readLine()) != null) { while ((s = bufferedreader.readLine()) != null) {
this.h.add(s.trim().toLowerCase()); this.operators.add(s.trim().toLowerCase());
} }
bufferedreader.close(); bufferedreader.close();
@ -505,7 +505,7 @@ public class ServerConfigurationManager {
private void n() { private void n() {
try { try {
PrintWriter printwriter = new PrintWriter(new FileWriter(this.l, false)); PrintWriter printwriter = new PrintWriter(new FileWriter(this.l, false));
Iterator iterator = this.h.iterator(); Iterator iterator = this.operators.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
String s = (String) iterator.next(); String s = (String) iterator.next();
@ -522,12 +522,12 @@ public class ServerConfigurationManager {
private void o() { private void o() {
try { try {
this.i.clear(); this.whitelist.clear();
BufferedReader bufferedreader = new BufferedReader(new FileReader(this.m)); BufferedReader bufferedreader = new BufferedReader(new FileReader(this.m));
String s = ""; String s = "";
while ((s = bufferedreader.readLine()) != null) { while ((s = bufferedreader.readLine()) != null) {
this.i.add(s.trim().toLowerCase()); this.whitelist.add(s.trim().toLowerCase());
} }
bufferedreader.close(); bufferedreader.close();
@ -539,7 +539,7 @@ public class ServerConfigurationManager {
private void p() { private void p() {
try { try {
PrintWriter printwriter = new PrintWriter(new FileWriter(this.m, false)); PrintWriter printwriter = new PrintWriter(new FileWriter(this.m, false));
Iterator iterator = this.i.iterator(); Iterator iterator = this.whitelist.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
String s = (String) iterator.next(); String s = (String) iterator.next();
@ -555,11 +555,11 @@ public class ServerConfigurationManager {
public boolean isWhitelisted(String s) { public boolean isWhitelisted(String s) {
s = s.trim().toLowerCase(); s = s.trim().toLowerCase();
return !this.o || this.h.contains(s) || this.i.contains(s); return !this.hasWhitelist || this.operators.contains(s) || this.whitelist.contains(s);
} }
public boolean isOp(String s) { public boolean isOp(String s) {
return this.h.contains(s.trim().toLowerCase()); return this.operators.contains(s.trim().toLowerCase());
} }
public EntityPlayer i(String s) { public EntityPlayer i(String s) {
@ -633,21 +633,21 @@ public class ServerConfigurationManager {
public void a(int i, int j, int k, TileEntity tileentity) {} public void a(int i, int j, int k, TileEntity tileentity) {}
public void k(String s) { public void addWhitelist(String s) {
this.i.add(s); this.whitelist.add(s);
this.p(); this.p();
} }
public void l(String s) { public void removeWhitelist(String s) {
this.i.remove(s); this.whitelist.remove(s);
this.p(); this.p();
} }
public Set e() { public Set getWhitelisted() {
return this.i; return this.whitelist;
} }
public void f() { public void reloadWhitelist() {
this.o(); this.o();
} }

Datei anzeigen

@ -31,11 +31,11 @@ import org.bukkit.block.BlockState;
public class World implements IBlockAccess { public class World implements IBlockAccess {
public final int a = 7; public final int heightBits = 7;
public final int b = 11; public final int heightBitsPlusFour = 11;
public final int c = 128; public final int height = 128;
public final int d = 127; public final int heightMinusOne = 127;
public final int e = 63; public final int seaLevel = 63;
public boolean f = false; public boolean f = false;
public List entityList = new ArrayList(); public List entityList = new ArrayList();
private List M = new ArrayList(); private List M = new ArrayList();
@ -59,7 +59,7 @@ public class World implements IBlockAccess {
public boolean suppressPhysics = false; public boolean suppressPhysics = false;
private long S = System.currentTimeMillis(); private long S = System.currentTimeMillis();
protected int u = 40; protected int u = 40;
public int spawnMonsters; public int difficulty;
public Random random = new Random(); public Random random = new Random();
public boolean x = false; public boolean x = false;
public WorldProvider worldProvider; // CraftBukkit - remove final public WorldProvider worldProvider; // CraftBukkit - remove final
@ -1038,7 +1038,7 @@ public class World implements IBlockAccess {
} }
} }
public void cleanUp() { public void tickEntities() {
int i; int i;
Entity entity; Entity entity;
@ -1604,7 +1604,7 @@ public class World implements IBlockAccess {
if (this.everyoneDeeplySleeping()) { if (this.everyoneDeeplySleeping()) {
boolean flag = false; boolean flag = false;
if (this.allowMonsters && this.spawnMonsters >= 1) { if (this.allowMonsters && this.difficulty >= 1) {
flag = SpawnerCreature.a(this, this.players); flag = SpawnerCreature.a(this, this.players);
} }

Datei anzeigen

@ -4,82 +4,82 @@ import java.util.List;
public class WorldData { public class WorldData {
private long a; private long seed;
private int b; private int spawnX;
private int c; private int spawnY;
private int d; private int spawnZ;
private long e; private long time;
private long f; private long lastPlayed;
private long g; private long sizeOnDisk;
private NBTTagCompound h; private NBTTagCompound playerData;
private int i; private int dimension;
public String name; // CraftBukkit - private -> public public String name; // CraftBukkit - private -> public
private int k; private int version;
private boolean l; private boolean isRaining;
private int m; private int rainTicks;
private boolean n; private boolean isThundering;
private int o; private int thunderTicks;
public int p; // CraftBukkit - private -> public private int gameType;
private boolean q; private boolean useMapFeatures;
public WorldData(NBTTagCompound nbttagcompound) { public WorldData(NBTTagCompound nbttagcompound) {
this.a = nbttagcompound.getLong("RandomSeed"); this.seed = nbttagcompound.getLong("RandomSeed");
this.p = nbttagcompound.e("GameType"); this.gameType = nbttagcompound.e("GameType");
if (nbttagcompound.hasKey("MapFeatures")) { if (nbttagcompound.hasKey("MapFeatures")) {
this.q = nbttagcompound.m("MapFeatures"); this.useMapFeatures = nbttagcompound.m("MapFeatures");
} else { } else {
this.q = true; this.useMapFeatures = true;
} }
this.b = nbttagcompound.e("SpawnX"); this.spawnX = nbttagcompound.e("SpawnX");
this.c = nbttagcompound.e("SpawnY"); this.spawnY = nbttagcompound.e("SpawnY");
this.d = nbttagcompound.e("SpawnZ"); this.spawnZ = nbttagcompound.e("SpawnZ");
this.e = nbttagcompound.getLong("Time"); this.time = nbttagcompound.getLong("Time");
this.f = nbttagcompound.getLong("LastPlayed"); this.lastPlayed = nbttagcompound.getLong("LastPlayed");
this.g = nbttagcompound.getLong("SizeOnDisk"); this.sizeOnDisk = nbttagcompound.getLong("SizeOnDisk");
this.name = nbttagcompound.getString("LevelName"); this.name = nbttagcompound.getString("LevelName");
this.k = nbttagcompound.e("version"); this.version = nbttagcompound.e("version");
this.m = nbttagcompound.e("rainTime"); this.rainTicks = nbttagcompound.e("rainTime");
this.l = nbttagcompound.m("raining"); this.isRaining = nbttagcompound.m("raining");
this.o = nbttagcompound.e("thunderTime"); this.thunderTicks = nbttagcompound.e("thunderTime");
this.n = nbttagcompound.m("thundering"); this.isThundering = nbttagcompound.m("thundering");
if (nbttagcompound.hasKey("Player")) { if (nbttagcompound.hasKey("Player")) {
this.h = nbttagcompound.k("Player"); this.playerData = nbttagcompound.k("Player");
this.i = this.h.e("Dimension"); this.dimension = this.playerData.e("Dimension");
} }
} }
public WorldData(WorldSettings worldsettings, String s) { public WorldData(WorldSettings worldsettings, String s) {
this.a = worldsettings.a(); this.seed = worldsettings.a();
this.p = worldsettings.b(); this.gameType = worldsettings.b();
this.q = worldsettings.c(); this.useMapFeatures = worldsettings.c();
this.name = s; this.name = s;
} }
public WorldData(WorldData worlddata) { public WorldData(WorldData worlddata) {
this.a = worlddata.a; this.seed = worlddata.seed;
this.p = worlddata.p; this.gameType = worlddata.gameType;
this.q = worlddata.q; this.useMapFeatures = worlddata.useMapFeatures;
this.b = worlddata.b; this.spawnX = worlddata.spawnX;
this.c = worlddata.c; this.spawnY = worlddata.spawnY;
this.d = worlddata.d; this.spawnZ = worlddata.spawnZ;
this.e = worlddata.e; this.time = worlddata.time;
this.f = worlddata.f; this.lastPlayed = worlddata.lastPlayed;
this.g = worlddata.g; this.sizeOnDisk = worlddata.sizeOnDisk;
this.h = worlddata.h; this.playerData = worlddata.playerData;
this.i = worlddata.i; this.dimension = worlddata.dimension;
this.name = worlddata.name; this.name = worlddata.name;
this.k = worlddata.k; this.version = worlddata.version;
this.m = worlddata.m; this.rainTicks = worlddata.rainTicks;
this.l = worlddata.l; this.isRaining = worlddata.isRaining;
this.o = worlddata.o; this.thunderTicks = worlddata.thunderTicks;
this.n = worlddata.n; this.isThundering = worlddata.isThundering;
} }
public NBTTagCompound a() { public NBTTagCompound a() {
NBTTagCompound nbttagcompound = new NBTTagCompound(); NBTTagCompound nbttagcompound = new NBTTagCompound();
this.a(nbttagcompound, this.h); this.a(nbttagcompound, this.playerData);
return nbttagcompound; return nbttagcompound;
} }
@ -102,66 +102,66 @@ public class WorldData {
} }
private void a(NBTTagCompound nbttagcompound, NBTTagCompound nbttagcompound1) { private void a(NBTTagCompound nbttagcompound, NBTTagCompound nbttagcompound1) {
nbttagcompound.setLong("RandomSeed", this.a); nbttagcompound.setLong("RandomSeed", this.seed);
nbttagcompound.a("GameType", this.p); nbttagcompound.a("GameType", this.gameType);
nbttagcompound.a("MapFeatures", this.q); nbttagcompound.a("MapFeatures", this.useMapFeatures);
nbttagcompound.a("SpawnX", this.b); nbttagcompound.a("SpawnX", this.spawnX);
nbttagcompound.a("SpawnY", this.c); nbttagcompound.a("SpawnY", this.spawnY);
nbttagcompound.a("SpawnZ", this.d); nbttagcompound.a("SpawnZ", this.spawnZ);
nbttagcompound.setLong("Time", this.e); nbttagcompound.setLong("Time", this.time);
nbttagcompound.setLong("SizeOnDisk", this.g); nbttagcompound.setLong("SizeOnDisk", this.sizeOnDisk);
nbttagcompound.setLong("LastPlayed", System.currentTimeMillis()); nbttagcompound.setLong("LastPlayed", System.currentTimeMillis());
nbttagcompound.setString("LevelName", this.name); nbttagcompound.setString("LevelName", this.name);
nbttagcompound.a("version", this.k); nbttagcompound.a("version", this.version);
nbttagcompound.a("rainTime", this.m); nbttagcompound.a("rainTime", this.rainTicks);
nbttagcompound.a("raining", this.l); nbttagcompound.a("raining", this.isRaining);
nbttagcompound.a("thunderTime", this.o); nbttagcompound.a("thunderTime", this.thunderTicks);
nbttagcompound.a("thundering", this.n); nbttagcompound.a("thundering", this.isThundering);
if (nbttagcompound1 != null) { if (nbttagcompound1 != null) {
nbttagcompound.a("Player", nbttagcompound1); nbttagcompound.a("Player", nbttagcompound1);
} }
} }
public long getSeed() { public long getSeed() {
return this.a; return this.seed;
} }
public int c() { public int c() {
return this.b; return this.spawnX;
} }
public int d() { public int d() {
return this.c; return this.spawnY;
} }
public int e() { public int e() {
return this.d; return this.spawnZ;
} }
public long f() { public long f() {
return this.e; return this.time;
} }
public long g() { public long g() {
return this.g; return this.sizeOnDisk;
} }
public int h() { public int h() {
return this.i; return this.dimension;
} }
public void a(long i) { public void a(long i) {
this.e = i; this.time = i;
} }
public void b(long i) { public void b(long i) {
this.g = i; this.sizeOnDisk = i;
} }
public void setSpawn(int i, int j, int k) { public void setSpawn(int i, int j, int k) {
this.b = i; this.spawnX = i;
this.c = j; this.spawnY = j;
this.d = k; this.spawnZ = k;
} }
public void a(String s) { public void a(String s) {
@ -169,54 +169,54 @@ public class WorldData {
} }
public int i() { public int i() {
return this.k; return this.version;
} }
public void a(int i) { public void a(int i) {
this.k = i; this.version = i;
} }
public boolean isThundering() { public boolean isThundering() {
return this.n; return this.isThundering;
} }
public void setThundering(boolean flag) { public void setThundering(boolean flag) {
this.n = flag; this.isThundering = flag;
} }
public int getThunderDuration() { public int getThunderDuration() {
return this.o; return this.thunderTicks;
} }
public void setThunderDuration(int i) { public void setThunderDuration(int i) {
this.o = i; this.thunderTicks = i;
} }
public boolean hasStorm() { public boolean hasStorm() {
return this.l; return this.isRaining;
} }
public void setStorm(boolean flag) { public void setStorm(boolean flag) {
this.l = flag; this.isRaining = flag;
} }
public int getWeatherDuration() { public int getWeatherDuration() {
return this.m; return this.rainTicks;
} }
public void setWeatherDuration(int i) { public void setWeatherDuration(int i) {
this.m = i; this.rainTicks = i;
} }
public int n() { public int getGameType() {
return this.p; return this.gameType;
} }
public boolean o() { public boolean o() {
return this.q; return this.useMapFeatures;
} }
public void d(int i) { public void setGameType(int i) {
this.p = i; this.gameType = i;
} }
} }

Datei anzeigen

@ -18,7 +18,7 @@ public class WorldServer extends World implements BlockChangeDelegate {
public ChunkProviderServer chunkProviderServer; public ChunkProviderServer chunkProviderServer;
public boolean weirdIsOpCache = false; public boolean weirdIsOpCache = false;
public boolean canSave; public boolean savingDisabled;
public final MinecraftServer server; // CraftBukkit - private -> public final public final MinecraftServer server; // CraftBukkit - private -> public final
private EntityList Q = new EntityList(); private EntityList Q = new EntityList();

Datei anzeigen

@ -154,7 +154,7 @@ public class CraftChunk implements Chunk {
if (includeBiome || includeBiomeTempRain) { if (includeBiome || includeBiomeTempRain) {
WorldChunkManager wcm = chunk.world.getWorldChunkManager(); WorldChunkManager wcm = chunk.world.getWorldChunkManager();
BiomeBase[] biomeBase = wcm.b((BiomeBase[])null, getX() << 4, getZ() << 4, 16, 16); BiomeBase[] biomeBase = wcm.getBiomes((BiomeBase[])null, getX() << 4, getZ() << 4, 16, 16);
if (includeBiome) { if (includeBiome) {
biome = new BiomeBase[256]; biome = new BiomeBase[256];
@ -164,10 +164,10 @@ public class CraftChunk implements Chunk {
if (includeBiomeTempRain) { if (includeBiomeTempRain) {
biomeTemp = new double[256]; biomeTemp = new double[256];
biomeRain = new double[256]; biomeRain = new double[256];
float[] dat = wcm.a((float[]) null, getX() << 4, getZ() << 4, 16, 16); float[] dat = wcm.getTemperatures((float[]) null, getX() << 4, getZ() << 4, 16, 16);
for(int i = 0; i < 256; i++) for(int i = 0; i < 256; i++)
biomeTemp[i] = dat[i]; biomeTemp[i] = dat[i];
dat = wcm.b((float[]) null, getX() << 4, getZ() << 4, 16, 16); dat = wcm.getWetness((float[]) null, getX() << 4, getZ() << 4, 16, 16);
for(int i = 0; i < 256; i++) for(int i = 0; i < 256; i++)
biomeRain[i] = dat[i]; biomeRain[i] = dat[i];
} }
@ -212,7 +212,7 @@ public class CraftChunk implements Chunk {
if (includeBiome || includeBiomeTempRain) { if (includeBiome || includeBiomeTempRain) {
WorldChunkManager wcm = world.getHandle().getWorldChunkManager(); WorldChunkManager wcm = world.getHandle().getWorldChunkManager();
BiomeBase[] biomeBase = wcm.b((BiomeBase[])null, x << 4, z << 4, 16, 16); BiomeBase[] biomeBase = wcm.getBiomes((BiomeBase[])null, x << 4, z << 4, 16, 16);
if (includeBiome) { if (includeBiome) {
biome = new BiomeBase[256]; biome = new BiomeBase[256];
@ -222,10 +222,10 @@ public class CraftChunk implements Chunk {
if (includeBiomeTempRain) { if (includeBiomeTempRain) {
biomeTemp = new double[256]; biomeTemp = new double[256];
biomeRain = new double[256]; biomeRain = new double[256];
float[] dat = wcm.a((float[]) null, x << 4, z << 4, 16, 16); float[] dat = wcm.getTemperatures((float[]) null, x << 4, z << 4, 16, 16);
for(int i = 0; i < 256; i++) for(int i = 0; i < 256; i++)
biomeTemp[i] = dat[i]; biomeTemp[i] = dat[i];
dat = wcm.b((float[]) null, x << 4, z << 4, 16, 16); dat = wcm.getWetness((float[]) null, x << 4, z << 4, 16, 16);
for(int i = 0; i < 256; i++) for(int i = 0; i < 256; i++)
biomeRain[i] = dat[i]; biomeRain[i] = dat[i];
} }

Datei anzeigen

@ -32,9 +32,9 @@ public class CraftOfflinePlayer implements OfflinePlayer {
if (value == isOp()) return; if (value == isOp()) return;
if (value) { if (value) {
server.getHandle().e(getName().toLowerCase()); server.getHandle().addOp(getName().toLowerCase());
} else { } else {
server.getHandle().f(getName().toLowerCase()); server.getHandle().removeOp(getName().toLowerCase());
} }
} }
@ -44,21 +44,21 @@ public class CraftOfflinePlayer implements OfflinePlayer {
public void setBanned(boolean value) { public void setBanned(boolean value) {
if (value) { if (value) {
server.getHandle().a(name.toLowerCase()); server.getHandle().addUserBan(name.toLowerCase());
} else { } else {
server.getHandle().b(name.toLowerCase()); server.getHandle().removeUserBan(name.toLowerCase());
} }
} }
public boolean isWhitelisted() { public boolean isWhitelisted() {
return server.getHandle().e().contains(name.toLowerCase()); return server.getHandle().getWhitelisted().contains(name.toLowerCase());
} }
public void setWhitelisted(boolean value) { public void setWhitelisted(boolean value) {
if (value) { if (value) {
server.getHandle().k(name.toLowerCase()); server.getHandle().addWhitelist(name.toLowerCase());
} else { } else {
server.getHandle().l(name.toLowerCase()); server.getHandle().removeWhitelist(name.toLowerCase());
} }
} }
} }

Datei anzeigen

@ -366,7 +366,7 @@ public final class CraftServer implements Server {
console.propertyManager = config; console.propertyManager = config;
boolean animals = config.getBoolean("spawn-animals", console.spawnAnimals); boolean animals = config.getBoolean("spawn-animals", console.spawnAnimals);
boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).spawnMonsters > 0); boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).difficulty > 0);
console.onlineMode = config.getBoolean("online-mode", console.onlineMode); console.onlineMode = config.getBoolean("online-mode", console.onlineMode);
console.spawnAnimals = config.getBoolean("spawn-animals", console.spawnAnimals); console.spawnAnimals = config.getBoolean("spawn-animals", console.spawnAnimals);
@ -374,7 +374,7 @@ public final class CraftServer implements Server {
console.allowFlight = config.getBoolean("allow-flight", console.allowFlight); console.allowFlight = config.getBoolean("allow-flight", console.allowFlight);
for (WorldServer world : console.worlds) { for (WorldServer world : console.worlds) {
world.spawnMonsters = monsters ? 1 : 0; world.difficulty = monsters ? 1 : 0;
world.setSpawnFlags(monsters, animals); world.setSpawnFlags(monsters, animals);
} }
@ -506,7 +506,7 @@ public final class CraftServer implements Server {
internal.tracker = new EntityTracker(console, dimension); internal.tracker = new EntityTracker(console, dimension);
internal.addIWorldAccess((IWorldAccess) new WorldManager(console, internal)); internal.addIWorldAccess((IWorldAccess) new WorldManager(console, internal));
internal.spawnMonsters = 1; internal.difficulty = 1;
internal.setSpawnFlags(true, true); internal.setSpawnFlags(true, true);
console.worlds.add(internal); console.worlds.add(internal);
@ -757,7 +757,7 @@ public final class CraftServer implements Server {
} }
public void shutdown() { public void shutdown() {
console.a(); console.safeShutdown();
} }
public int broadcast(String message, String permission) { public int broadcast(String message, String permission) {
@ -790,11 +790,11 @@ public final class CraftServer implements Server {
} }
public void banIP(String address) { public void banIP(String address) {
server.c(address); server.addIpBan(address);
} }
public void unbanIP(String address) { public void unbanIP(String address) {
server.d(address); server.removeIpBan(address);
} }
public Set<OfflinePlayer> getBannedPlayers() { public Set<OfflinePlayer> getBannedPlayers() {
@ -808,15 +808,14 @@ public final class CraftServer implements Server {
} }
public void setWhitelist(boolean value) { public void setWhitelist(boolean value) {
server.o = value; server.hasWhitelist = value;
console.propertyManager.b("white-list", value); console.propertyManager.setBoolean("white-list", value);
console.propertyManager.savePropertiesFile();
} }
public Set<OfflinePlayer> getWhitelistedPlayers() { public Set<OfflinePlayer> getWhitelistedPlayers() {
Set<OfflinePlayer> result = new HashSet<OfflinePlayer>(); Set<OfflinePlayer> result = new HashSet<OfflinePlayer>();
for (Object name : server.e()) { for (Object name : server.getWhitelisted()) {
result.add(getOfflinePlayer((String)name)); result.add(getOfflinePlayer((String)name));
} }
@ -824,11 +823,11 @@ public final class CraftServer implements Server {
} }
public void reloadWhitelist() { public void reloadWhitelist() {
server.f(); server.reloadWhitelist();
} }
public GameMode getDefaultGameMode() { public GameMode getDefaultGameMode() {
return GameMode.getByValue(console.worlds.get(0).worldData.p); return GameMode.getByValue(console.worlds.get(0).worldData.getGameType());
} }
public void setDefaultGameMode(GameMode mode) { public void setDefaultGameMode(GameMode mode) {
@ -837,7 +836,7 @@ public final class CraftServer implements Server {
} }
for (World world : getWorlds()) { for (World world : getWorlds()) {
((CraftWorld)world).getHandle().worldData.p = mode.getValue(); ((CraftWorld)world).getHandle().worldData.setGameType(mode.getValue());
} }
} }
} }

Datei anzeigen

@ -561,20 +561,20 @@ public class CraftWorld implements World {
} }
public void save() { public void save() {
boolean oldSave = world.canSave; boolean oldSave = world.savingDisabled;
world.canSave = false; world.savingDisabled = false;
world.save(true, null); world.save(true, null);
world.canSave = oldSave; world.savingDisabled = oldSave;
} }
public boolean isAutoSave() { public boolean isAutoSave() {
return !world.canSave; return !world.savingDisabled;
} }
public void setAutoSave(boolean value) { public void setAutoSave(boolean value) {
world.canSave = !value; world.savingDisabled = !value;
} }
public boolean hasStorm() { public boolean hasStorm() {
@ -767,7 +767,7 @@ public class CraftWorld implements World {
// what is this, I don't even // what is this, I don't even
} else if (Fish.class.isAssignableFrom(clazz)) { } else if (Fish.class.isAssignableFrom(clazz)) {
// this is not a fish, it's a bobber, and it's probably useless // this is not a fish, it's a bobber, and it's probably useless
entity = new EntityFish(world); entity = new EntityFishingHook(world);
entity.setLocation(x, y, z, pitch, yaw); entity.setLocation(x, y, z, pitch, yaw);
} }

Datei anzeigen

@ -83,7 +83,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof EntityEgg) { return new CraftEgg(server, (EntityEgg) entity); } else if (entity instanceof EntityEgg) { return new CraftEgg(server, (EntityEgg) entity); }
else if (entity instanceof EntityFallingSand) { return new CraftFallingSand(server, (EntityFallingSand) entity); } else if (entity instanceof EntityFallingSand) { return new CraftFallingSand(server, (EntityFallingSand) entity); }
else if (entity instanceof EntityFireball) { return new CraftFireball(server, (EntityFireball) entity); } else if (entity instanceof EntityFireball) { return new CraftFireball(server, (EntityFireball) entity); }
else if (entity instanceof EntityFish) { return new CraftFish(server, (EntityFish) entity); } else if (entity instanceof EntityFishingHook) { return new CraftFish(server, (EntityFishingHook) entity); }
else if (entity instanceof EntityItem) { return new CraftItem(server, (EntityItem) entity); } else if (entity instanceof EntityItem) { return new CraftItem(server, (EntityItem) entity); }
else if (entity instanceof EntityWeather) { else if (entity instanceof EntityWeather) {
if (entity instanceof EntityWeatherStorm) { if (entity instanceof EntityWeatherStorm) {

Datei anzeigen

@ -50,7 +50,7 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
} }
public Vector getDirection() { public Vector getDirection() {
return new Vector(((EntityFireball) getHandle()).c, ((EntityFireball) getHandle()).d, ((EntityFireball) getHandle()).e); return new Vector(((EntityFireball) getHandle()).dirX, ((EntityFireball) getHandle()).dirY, ((EntityFireball) getHandle()).dirZ);
} }
public void setDirection(Vector direction) { public void setDirection(Vector direction) {

Datei anzeigen

@ -1,6 +1,6 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityFish; import net.minecraft.server.EntityFishingHook;
import net.minecraft.server.EntityHuman; import net.minecraft.server.EntityHuman;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
@ -8,7 +8,7 @@ import org.bukkit.entity.Fish;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
public class CraftFish extends AbstractProjectile implements Fish { public class CraftFish extends AbstractProjectile implements Fish {
public CraftFish(CraftServer server, EntityFish entity) { public CraftFish(CraftServer server, EntityFishingHook entity) {
super(server, entity); super(server, entity);
} }
@ -18,8 +18,8 @@ public class CraftFish extends AbstractProjectile implements Fish {
} }
public LivingEntity getShooter() { public LivingEntity getShooter() {
if (((EntityFish) getHandle()).owner != null) { if (((EntityFishingHook) getHandle()).owner != null) {
return (LivingEntity) ((EntityFish) getHandle()).owner.getBukkitEntity(); return (LivingEntity) ((EntityFishingHook) getHandle()).owner.getBukkitEntity();
} }
return null; return null;
@ -28,7 +28,7 @@ public class CraftFish extends AbstractProjectile implements Fish {
public void setShooter(LivingEntity shooter) { public void setShooter(LivingEntity shooter) {
if (shooter instanceof CraftHumanEntity) { if (shooter instanceof CraftHumanEntity) {
((EntityFish) getHandle()).owner = (EntityHuman) ((CraftHumanEntity) shooter).entity; ((EntityFishingHook) getHandle()).owner = (EntityHuman) ((CraftHumanEntity) shooter).entity;
} }
} }

Datei anzeigen

@ -47,9 +47,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (value == isOp()) return; if (value == isOp()) return;
if (value) { if (value) {
server.getHandle().e(getName()); server.getHandle().addOp(getName());
} else { } else {
server.getHandle().f(getName()); server.getHandle().removeOp(getName());
} }
perm.recalculatePermissions(); perm.recalculatePermissions();
@ -299,11 +299,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public boolean isSprinting() { public boolean isSprinting() {
return getHandle().at(); return getHandle().isSprinting();
} }
public void setSprinting(boolean sprinting) { public void setSprinting(boolean sprinting) {
getHandle().g(sprinting); getHandle().setSprinting(sprinting);
} }
public void loadData() { public void loadData() {
@ -398,21 +398,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setBanned(boolean value) { public void setBanned(boolean value) {
if (value) { if (value) {
server.getHandle().a(getName().toLowerCase()); server.getHandle().addUserBan(getName().toLowerCase());
} else { } else {
server.getHandle().b(getName().toLowerCase()); server.getHandle().removeUserBan(getName().toLowerCase());
} }
} }
public boolean isWhitelisted() { public boolean isWhitelisted() {
return server.getHandle().e().contains(getName().toLowerCase()); return server.getHandle().getWhitelisted().contains(getName().toLowerCase());
} }
public void setWhitelisted(boolean value) { public void setWhitelisted(boolean value) {
if (value) { if (value) {
server.getHandle().k(getName().toLowerCase()); server.getHandle().addWhitelist(getName().toLowerCase());
} else { } else {
server.getHandle().l(getName().toLowerCase()); server.getHandle().removeWhitelist(getName().toLowerCase());
} }
} }