Skip to content

Commit

Permalink
1.4.6 prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
amaranth committed Dec 19, 2012
1 parent 2b1bb53 commit 7b52b9b
Show file tree
Hide file tree
Showing 253 changed files with 2,807 additions and 1,803 deletions.
2 changes: 1 addition & 1 deletion net/minecraft/server/BanList.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void save(boolean flag) {
PrintWriter printwriter = new PrintWriter(new FileWriter(this.b, false));

if (flag) {
printwriter.println("# Updated " + (new SimpleDateFormat()).format(new Date()) + " by Minecraft " + "1.4.5");
printwriter.println("# Updated " + (new SimpleDateFormat()).format(new Date()) + " by Minecraft " + "1.4.6");
printwriter.println("# victim name | ban date | banned by | banned until | reason");
printwriter.println();
}
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockBed.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuma
EntityHuman entityhuman2 = (EntityHuman) iterator.next();

if (entityhuman2.isSleeping()) {
ChunkCoordinates chunkcoordinates = entityhuman2.bZ;
ChunkCoordinates chunkcoordinates = entityhuman2.ca;

if (chunkcoordinates.x == i && chunkcoordinates.y == j && chunkcoordinates.z == k) {
entityhuman1 = entityhuman2;
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockCake.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
}

private void b(World world, int i, int j, int k, EntityHuman entityhuman) {
if (entityhuman.f(false)) {
if (entityhuman.g(false)) {
entityhuman.getFoodData().eat(2, 0.1F);
int l = world.getData(i, j, k) + 1;

Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public void remove(World world, int i, int j, int k, int l, int i1) {
entityitem.motY = (double) ((float) this.a.nextGaussian() * f3 + 0.2F);
entityitem.motZ = (double) ((float) this.a.nextGaussian() * f3);
if (itemstack.hasTag()) {
entityitem.itemStack.setTag((NBTTagCompound) itemstack.getTag().clone());
entityitem.getItemStack().setTag((NBTTagCompound) itemstack.getTag().clone());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockDeadBush.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public int getDropType(int i, Random random, int j) {
}

public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
if (!world.isStatic && entityhuman.bT() != null && entityhuman.bT().id == Item.SHEARS.id) {
if (!world.isStatic && entityhuman.bS() != null && entityhuman.bS().id == Item.SHEARS.id) {
entityhuman.a(StatisticList.C[this.id], 1);
this.b(world, i, j, k, new ItemStack(Block.DEAD_BUSH, 1, l));
} else {
Expand Down
6 changes: 3 additions & 3 deletions net/minecraft/server/BlockDispenser.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void remove(World world, int i, int j, int k, int l, int i1) {
EntityItem entityitem = new EntityItem(world, (double) ((float) i + f), (double) ((float) j + f1), (double) ((float) k + f2), new ItemStack(itemstack.id, k1, itemstack.getData()));

if (itemstack.hasTag()) {
entityitem.itemStack.setTag((NBTTagCompound) itemstack.getTag().clone());
entityitem.getItemStack().setTag((NBTTagCompound) itemstack.getTag().clone());
}

float f3 = 0.05F;
Expand All @@ -176,9 +176,9 @@ public void remove(World world, int i, int j, int k, int l, int i1) {

public static IPosition a(ISourceBlock isourceblock) {
EnumFacing enumfacing = EnumFacing.a(isourceblock.h());
double d0 = isourceblock.getX() + 0.6D * (double) enumfacing.c();
double d0 = isourceblock.getX() + 0.7D * (double) enumfacing.c();
double d1 = isourceblock.getY();
double d2 = isourceblock.getZ() + 0.6D * (double) enumfacing.e();
double d2 = isourceblock.getZ() + 0.7D * (double) enumfacing.e();

return new Position(d0, d1, d2);
}
Expand Down
1 change: 1 addition & 0 deletions net/minecraft/server/BlockDragonEgg.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class BlockDragonEgg extends Block {

public BlockDragonEgg(int i, int j) {
super(i, j, Material.DRAGON_EGG);
this.a(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F);
}

public void onPlace(World world, int i, int j, int k) {
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public boolean c(IBlockAccess iblockaccess, int i, int j, int k) {
return this.material != Material.LAVA;
}

public static float d(int i) {
public static float e(int i) {
if (i >= 8) {
i = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockFurnace.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void remove(World world, int i, int j, int k, int l, int i1) {
EntityItem entityitem = new EntityItem(world, (double) ((float) i + f), (double) ((float) j + f1), (double) ((float) k + f2), new ItemStack(itemstack.id, k1, itemstack.getData()));

if (itemstack.hasTag()) {
entityitem.itemStack.setTag((NBTTagCompound) itemstack.getTag().clone());
entityitem.getItemStack().setTag((NBTTagCompound) itemstack.getTag().clone());
}

float f3 = 0.05F;
Expand Down
6 changes: 5 additions & 1 deletion net/minecraft/server/BlockLeaves.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void dropNaturally(World world, int i, int j, int k, int l, float f, int
}

public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
if (!world.isStatic && entityhuman.bT() != null && entityhuman.bT().id == Item.SHEARS.id) {
if (!world.isStatic && entityhuman.bS() != null && entityhuman.bS().id == Item.SHEARS.id) {
entityhuman.a(StatisticList.C[this.id], 1);
this.b(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
} else {
Expand All @@ -171,4 +171,8 @@ public boolean c() {
public int a(int i, int j) {
return (j & 3) == 1 ? this.textureId + 80 : ((j & 3) == 3 ? this.textureId + 144 : this.textureId);
}

protected ItemStack f_(int i) {
return new ItemStack(this.id, 1, i & 3);
}
}
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockLever.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int getPlacedData(World world, int i, int j, int k, int l, float f, float
return k1 + j1;
}

public static int d(int i) {
public static int e(int i) {
switch (i) {
case 0:
return 0;
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockLongGrass.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public int getDropCount(int i, Random random) {
}

public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
if (!world.isStatic && entityhuman.bT() != null && entityhuman.bT().id == Item.SHEARS.id) {
if (!world.isStatic && entityhuman.bS() != null && entityhuman.bS().id == Item.SHEARS.id) {
entityhuman.a(StatisticList.C[this.id], 1);
this.b(world, i, j, k, new ItemStack(Block.LONG_GRASS, 1, l));
} else {
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockMinecartTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static final boolean e_(World world, int i, int j, int k) {
return l == Block.RAILS.id || l == Block.GOLDEN_RAIL.id || l == Block.DETECTOR_RAIL.id;
}

public static final boolean d(int i) {
public static final boolean e(int i) {
return i == Block.RAILS.id || i == Block.GOLDEN_RAIL.id || i == Block.DETECTOR_RAIL.id;
}

Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockSkull.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void a(World world, int i, int j, int k, TileEntitySkull tileentityskull)
if (!world.isStatic) {
entitywither = new EntityWither(world);
entitywither.setPositionRotation((double) i + 0.5D, (double) j - 1.45D, (double) (k + i1) + 1.5D, 90.0F, 0.0F);
entitywither.aw = 90.0F;
entitywither.ax = 90.0F;
entitywither.m();
world.addEntity(entitywither);
}
Expand Down
4 changes: 4 additions & 0 deletions net/minecraft/server/BlockSoil.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public void b(World world, int i, int j, int k, Random random) {

public void a(World world, int i, int j, int k, Entity entity, float f) {
if (!world.isStatic && world.random.nextFloat() < f - 0.5F) {
if (!(entity instanceof EntityHuman) && !world.getGameRules().getBoolean("mobGriefing")) {
return;
}

world.setTypeId(i, j, k, Block.DIRT.id);
}
}
Expand Down
4 changes: 2 additions & 2 deletions net/minecraft/server/BlockStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class BlockStep extends BlockStepAbstract {

public static final String[] a = new String[] { "stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick"};
public static final String[] a = new String[] { "stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick"};

public BlockStep(int i, boolean flag) {
super(i, flag, Material.STONE);
Expand All @@ -14,7 +14,7 @@ public BlockStep(int i, boolean flag) {
public int a(int i, int j) {
int k = j & 7;

return k == 0 ? (i <= 1 ? 6 : 5) : (k == 1 ? (i == 0 ? 208 : (i == 1 ? 176 : 192)) : (k == 2 ? 4 : (k == 3 ? 16 : (k == 4 ? Block.BRICK.textureId : (k == 5 ? Block.SMOOTH_BRICK.textureId : 6)))));
return k == 0 ? (i <= 1 ? 6 : 5) : (k == 1 ? (i == 0 ? 208 : (i == 1 ? 176 : 192)) : (k == 2 ? 4 : (k == 3 ? 16 : (k == 4 ? Block.BRICK.textureId : (k == 5 ? Block.SMOOTH_BRICK.textureId : (k == 6 ? Block.NETHER_BRICK.textureId : 6))))));
}

public int a(int i) {
Expand Down
6 changes: 5 additions & 1 deletion net/minecraft/server/BlockStepAbstract.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public boolean c() {
}

public int getPlacedData(World world, int i, int j, int k, int l, float f, float f1, float f2, int i1) {
return this.a ? 0 : (l != 0 && (l == 1 || (double) f1 <= 0.5D) ? i1 : i1 | 8);
return this.a ? i1 : (l != 0 && (l == 1 || (double) f1 <= 0.5D) ? i1 : i1 | 8);
}

public int a(Random random) {
Expand All @@ -71,4 +71,8 @@ public boolean b() {
}

public abstract String d(int i);

public int getDropData(World world, int i, int j, int k) {
return super.getDropData(world, i, j, k) & 7;
}
}
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockTNT.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void postBreak(World world, int i, int j, int k, int l) {
}

public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
if (entityhuman.bT() != null && entityhuman.bT().id == Item.FLINT_AND_STEEL.id) {
if (entityhuman.bS() != null && entityhuman.bS().id == Item.FLINT_AND_STEEL.id) {
this.postBreak(world, i, j, k, 1);
world.setTypeId(i, j, k, 0);
return true;
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockTripwire.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void remove(World world, int i, int j, int k, int l, int i1) {

public void a(World world, int i, int j, int k, int l, EntityHuman entityhuman) {
if (!world.isStatic) {
if (entityhuman.bT() != null && entityhuman.bT().id == Item.SHEARS.id) {
if (entityhuman.bS() != null && entityhuman.bS().id == Item.SHEARS.id) {
world.setData(i, j, k, l | 8);
}
}
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/BlockVine.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public int a(Random random) {
}

public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
if (!world.isStatic && entityhuman.bT() != null && entityhuman.bT().id == Item.SHEARS.id) {
if (!world.isStatic && entityhuman.bS() != null && entityhuman.bS().id == Item.SHEARS.id) {
entityhuman.a(StatisticList.C[this.id], 1);
this.b(world, i, j, k, new ItemStack(Block.VINE, 1, 0));
} else {
Expand Down
8 changes: 4 additions & 4 deletions net/minecraft/server/Chunk.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Chunk(World world, byte[] abyte, int i, int j) {
int k1 = j1 >> 4;

if (this.sections[k1] == null) {
this.sections[k1] = new ChunkSection(k1 << 4);
this.sections[k1] = new ChunkSection(k1 << 4, !world.worldProvider.f);
}

this.sections[k1].a(l, j1 & 15, i1, b0);
Expand Down Expand Up @@ -373,7 +373,7 @@ public boolean a(int i, int j, int k, int l, int i1) {
return false;
}

chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4);
chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4, !this.world.worldProvider.f);
flag = j >= k1;
}

Expand Down Expand Up @@ -474,14 +474,14 @@ public boolean b(int i, int j, int k, int l) {
public int getBrightness(EnumSkyBlock enumskyblock, int i, int j, int k) {
ChunkSection chunksection = this.sections[j >> 4];

return chunksection == null ? (this.d(i, j, k) ? enumskyblock.c : 0) : (enumskyblock == EnumSkyBlock.SKY ? chunksection.c(i, j & 15, k) : (enumskyblock == EnumSkyBlock.BLOCK ? chunksection.d(i, j & 15, k) : enumskyblock.c));
return chunksection == null ? (this.d(i, j, k) ? enumskyblock.c : 0) : (enumskyblock == EnumSkyBlock.SKY ? (this.world.worldProvider.f ? 0 : chunksection.c(i, j & 15, k)) : (enumskyblock == EnumSkyBlock.BLOCK ? chunksection.d(i, j & 15, k) : enumskyblock.c));
}

public void a(EnumSkyBlock enumskyblock, int i, int j, int k, int l) {
ChunkSection chunksection = this.sections[j >> 4];

if (chunksection == null) {
chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4);
chunksection = this.sections[j >> 4] = new ChunkSection(j >> 4 << 4, !this.world.worldProvider.f);
this.initLighting();
}

Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/ChunkProviderFlat.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public Chunk getOrCreateChunk(int i, int j) {
ChunkSection chunksection = chunk.i()[l];

if (chunksection == null) {
chunksection = new ChunkSection(k);
chunksection = new ChunkSection(k, !this.a.worldProvider.f);
chunk.i()[l] = chunksection;
}

Expand Down
18 changes: 14 additions & 4 deletions net/minecraft/server/ChunkRegionLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.List;
import java.util.Set;

public class ChunkRegionLoader implements IAsyncChunkSaver, IChunkLoader {
public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {

private List a = new ArrayList();
private Set b = new HashSet();
Expand Down Expand Up @@ -151,6 +151,7 @@ private void a(Chunk chunk, World world, NBTTagCompound nbttagcompound) {
nbttagcompound.setBoolean("TerrainPopulated", chunk.done);
ChunkSection[] achunksection = chunk.i();
NBTTagList nbttaglist = new NBTTagList("Sections");
boolean flag = !world.worldProvider.f;
ChunkSection[] achunksection1 = achunksection;
int i = achunksection.length;

Expand All @@ -168,8 +169,13 @@ private void a(Chunk chunk, World world, NBTTagCompound nbttagcompound) {
}

nbttagcompound1.setByteArray("Data", chunksection.j().a);
nbttagcompound1.setByteArray("SkyLight", chunksection.l().a);
nbttagcompound1.setByteArray("BlockLight", chunksection.k().a);
if (flag) {
nbttagcompound1.setByteArray("SkyLight", chunksection.l().a);
} else {
nbttagcompound1.setByteArray("SkyLight", new byte[chunksection.k().a.length]);
}

nbttaglist.add(nbttagcompound1);
}
}
Expand Down Expand Up @@ -242,20 +248,24 @@ private Chunk a(World world, NBTTagCompound nbttagcompound) {
NBTTagList nbttaglist = nbttagcompound.getList("Sections");
byte b0 = 16;
ChunkSection[] achunksection = new ChunkSection[b0];
boolean flag = !world.worldProvider.f;

for (int k = 0; k < nbttaglist.size(); ++k) {
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.get(k);
byte b1 = nbttagcompound1.getByte("Y");
ChunkSection chunksection = new ChunkSection(b1 << 4);
ChunkSection chunksection = new ChunkSection(b1 << 4, flag);

chunksection.a(nbttagcompound1.getByteArray("Blocks"));
if (nbttagcompound1.hasKey("Add")) {
chunksection.a(new NibbleArray(nbttagcompound1.getByteArray("Add"), 4));
}

chunksection.b(new NibbleArray(nbttagcompound1.getByteArray("Data"), 4));
chunksection.d(new NibbleArray(nbttagcompound1.getByteArray("SkyLight"), 4));
chunksection.c(new NibbleArray(nbttagcompound1.getByteArray("BlockLight"), 4));
if (flag) {
chunksection.d(new NibbleArray(nbttagcompound1.getByteArray("SkyLight"), 4));
}

chunksection.recalcBlockCounts();
achunksection[b1] = chunksection;
}
Expand Down
6 changes: 4 additions & 2 deletions net/minecraft/server/ChunkSection.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ public class ChunkSection {
private NibbleArray blockLight;
private NibbleArray skyLight;

public ChunkSection(int i) {
public ChunkSection(int i, boolean flag) {
this.yPos = i;
this.blockIds = new byte[4096];
this.blockData = new NibbleArray(this.blockIds.length, 4);
this.skyLight = new NibbleArray(this.blockIds.length, 4);
this.blockLight = new NibbleArray(this.blockIds.length, 4);
if (flag) {
this.skyLight = new NibbleArray(this.blockIds.length, 4);
}
}

public int a(int i, int j, int k) {
Expand Down
2 changes: 1 addition & 1 deletion net/minecraft/server/CommandAbstract.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static EntityPlayer c(ICommandListener icommandlistener, String s) {
if (entityplayer != null) {
return entityplayer;
} else {
entityplayer = MinecraftServer.getServer().getServerConfigurationManager().f(s);
entityplayer = MinecraftServer.getServer().getPlayerList().f(s);
if (entityplayer == null) {
throw new ExceptionPlayerNotFound();
} else {
Expand Down
8 changes: 4 additions & 4 deletions net/minecraft/server/CommandBan.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ public String a(ICommandListener icommandlistener) {
}

public boolean b(ICommandListener icommandlistener) {
return MinecraftServer.getServer().getServerConfigurationManager().getNameBans().isEnabled() && super.b(icommandlistener);
return MinecraftServer.getServer().getPlayerList().getNameBans().isEnabled() && super.b(icommandlistener);
}

public void b(ICommandListener icommandlistener, String[] astring) {
if (astring.length >= 1 && astring[0].length() > 0) {
EntityPlayer entityplayer = MinecraftServer.getServer().getServerConfigurationManager().f(astring[0]);
EntityPlayer entityplayer = MinecraftServer.getServer().getPlayerList().f(astring[0]);
BanEntry banentry = new BanEntry(astring[0]);

banentry.setSource(icommandlistener.getName());
if (astring.length >= 2) {
banentry.setReason(a(icommandlistener, astring, 1));
}

MinecraftServer.getServer().getServerConfigurationManager().getNameBans().add(banentry);
MinecraftServer.getServer().getPlayerList().getNameBans().add(banentry);
if (entityplayer != null) {
entityplayer.netServerHandler.disconnect("You are banned from this server.");
entityplayer.playerConnection.disconnect("You are banned from this server.");
}

a(icommandlistener, "commands.ban.success", new Object[] { astring[0]});
Expand Down
Loading

0 comments on commit 7b52b9b

Please sign in to comment.