2014-12-06 05:47:37 +01:00
|
|
|
From 341f3417d0859e5ffede7045f1f81dfe43b12d0d Mon Sep 17 00:00:00 2001
|
2014-07-23 05:04:05 +02:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
2014-11-28 02:17:45 +01:00
|
|
|
Date: Thu, 27 Nov 2014 23:53:56 -0600
|
2014-07-23 05:04:05 +02:00
|
|
|
Subject: [PATCH] mc-dev imports
|
|
|
|
|
|
|
|
|
2014-08-31 21:44:52 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java
|
|
|
|
new file mode 100644
|
2014-11-28 02:17:45 +01:00
|
|
|
index 0000000..063177d
|
2014-08-31 21:44:52 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java
|
2014-11-28 02:17:45 +01:00
|
|
|
@@ -0,0 +1,120 @@
|
2014-08-31 21:44:52 +02:00
|
|
|
+package net.minecraft.server;
|
|
|
|
+
|
|
|
|
+public abstract class BlockMinecartTrackAbstract extends Block {
|
|
|
|
+
|
|
|
|
+ protected final boolean a;
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public static boolean d(World world, BlockPosition blockposition) {
|
|
|
|
+ return d(world.getType(blockposition));
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public static boolean d(IBlockData iblockdata) {
|
|
|
|
+ Block block = iblockdata.getBlock();
|
|
|
|
+
|
|
|
|
+ return block == Blocks.RAIL || block == Blocks.GOLDEN_RAIL || block == Blocks.DETECTOR_RAIL || block == Blocks.ACTIVATOR_RAIL;
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected BlockMinecartTrackAbstract(boolean flag) {
|
|
|
|
+ super(Material.ORIENTABLE);
|
|
|
|
+ this.a = flag;
|
|
|
|
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
|
|
|
+ this.a(CreativeModeTab.e);
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public AxisAlignedBB a(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean c() {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public MovingObjectPosition a(World world, BlockPosition blockposition, Vec3D vec3d, Vec3D vec3d1) {
|
|
|
|
+ this.updateShape(world, blockposition);
|
|
|
|
+ return super.a(world, blockposition, vec3d, vec3d1);
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void updateShape(IBlockAccess iblockaccess, BlockPosition blockposition) {
|
|
|
|
+ IBlockData iblockdata = iblockaccess.getType(blockposition);
|
|
|
|
+ EnumTrackPosition enumtrackposition = iblockdata.getBlock() == this ? (EnumTrackPosition) iblockdata.get(this.l()) : null;
|
2014-08-31 21:44:52 +02:00
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if (enumtrackposition != null && enumtrackposition.c()) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F);
|
|
|
|
+ } else {
|
|
|
|
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
|
|
|
|
+ }
|
2014-11-28 02:17:45 +01:00
|
|
|
+
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean d() {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public boolean canPlace(World world, BlockPosition blockposition) {
|
|
|
|
+ return World.a((IBlockAccess) world, blockposition.down());
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ if (!world.isStatic) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ iblockdata = this.a(world, blockposition, iblockdata, true);
|
2014-08-31 21:44:52 +02:00
|
|
|
+ if (this.a) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.doPhysics(world, blockposition, iblockdata, this);
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
2014-11-28 02:17:45 +01:00
|
|
|
+
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void doPhysics(World world, BlockPosition blockposition, IBlockData iblockdata, Block block) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ if (!world.isStatic) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ EnumTrackPosition enumtrackposition = (EnumTrackPosition) iblockdata.get(this.l());
|
2014-08-31 21:44:52 +02:00
|
|
|
+ boolean flag = false;
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if (!World.a((IBlockAccess) world, blockposition.down())) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if (enumtrackposition == EnumTrackPosition.ASCENDING_EAST && !World.a((IBlockAccess) world, blockposition.east())) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ flag = true;
|
2014-11-28 02:17:45 +01:00
|
|
|
+ } else if (enumtrackposition == EnumTrackPosition.ASCENDING_WEST && !World.a((IBlockAccess) world, blockposition.west())) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ flag = true;
|
2014-11-28 02:17:45 +01:00
|
|
|
+ } else if (enumtrackposition == EnumTrackPosition.ASCENDING_NORTH && !World.a((IBlockAccess) world, blockposition.north())) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ flag = true;
|
2014-11-28 02:17:45 +01:00
|
|
|
+ } else if (enumtrackposition == EnumTrackPosition.ASCENDING_SOUTH && !World.a((IBlockAccess) world, blockposition.south())) {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (flag) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.b(world, blockposition, iblockdata, 0);
|
|
|
|
+ world.setAir(blockposition);
|
2014-08-31 21:44:52 +02:00
|
|
|
+ } else {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.b(world, blockposition, iblockdata, block);
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
2014-11-28 02:17:45 +01:00
|
|
|
+
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ protected void b(World world, BlockPosition blockposition, IBlockData iblockdata, Block block) {}
|
2014-08-31 21:44:52 +02:00
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ protected IBlockData a(World world, BlockPosition blockposition, IBlockData iblockdata, boolean flag) {
|
|
|
|
+ return world.isStatic ? iblockdata : (new MinecartTrackLogic(this, world, blockposition, iblockdata)).a(world.isBlockIndirectlyPowered(blockposition), flag).b();
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public int i() {
|
2014-08-31 21:44:52 +02:00
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
+ super.remove(world, blockposition, iblockdata);
|
|
|
|
+ if (((EnumTrackPosition) iblockdata.get(this.l())).c()) {
|
|
|
|
+ world.applyPhysics(blockposition.up(), this);
|
2014-08-31 21:44:52 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.a) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ world.applyPhysics(blockposition, this);
|
|
|
|
+ world.applyPhysics(blockposition.down(), this);
|
2014-10-25 06:41:49 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public abstract IBlockState l();
|
2014-10-25 06:41:49 +02:00
|
|
|
+}
|
2015-01-04 00:35:46 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000..a4b50fe
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
|
|
|
|
@@ -0,0 +1,94 @@
|
|
|
|
+package net.minecraft.server;
|
|
|
|
+
|
|
|
|
+public class ItemBlock extends Item {
|
|
|
|
+
|
|
|
|
+ protected final Block a;
|
|
|
|
+
|
|
|
|
+ public ItemBlock(Block block) {
|
|
|
|
+ this.a = block;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ItemBlock b(String s) {
|
|
|
|
+ super.c(s);
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) {
|
|
|
|
+ IBlockData iblockdata = world.getType(blockposition);
|
|
|
|
+ Block block = iblockdata.getBlock();
|
|
|
|
+
|
|
|
|
+ if (block == Blocks.SNOW_LAYER && ((Integer) iblockdata.get(BlockSnow.LAYERS)).intValue() < 1) {
|
|
|
|
+ enumdirection = EnumDirection.UP;
|
|
|
|
+ } else if (!block.f(world, blockposition)) {
|
|
|
|
+ blockposition = blockposition.shift(enumdirection);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (itemstack.count == 0) {
|
|
|
|
+ return false;
|
|
|
|
+ } else if (!entityhuman.a(blockposition, enumdirection, itemstack)) {
|
|
|
|
+ return false;
|
|
|
|
+ } else if (blockposition.getY() == 255 && this.a.getMaterial().isBuildable()) {
|
|
|
|
+ return false;
|
|
|
|
+ } else if (world.a(this.a, blockposition, false, enumdirection, (Entity) null, itemstack)) {
|
|
|
|
+ int i = this.filterData(itemstack.getData());
|
|
|
|
+ IBlockData iblockdata1 = this.a.getPlacedState(world, blockposition, enumdirection, f, f1, f2, i, entityhuman);
|
|
|
|
+
|
|
|
|
+ if (world.setTypeAndData(blockposition, iblockdata1, 3)) {
|
|
|
|
+ iblockdata1 = world.getType(blockposition);
|
|
|
|
+ if (iblockdata1.getBlock() == this.a) {
|
|
|
|
+ a(world, blockposition, itemstack);
|
|
|
|
+ this.a.postPlace(world, blockposition, iblockdata1, entityhuman, itemstack);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ world.makeSound((double) ((float) blockposition.getX() + 0.5F), (double) ((float) blockposition.getY() + 0.5F), (double) ((float) blockposition.getZ() + 0.5F), this.a.stepSound.getPlaceSound(), (this.a.stepSound.getVolume1() + 1.0F) / 2.0F, this.a.stepSound.getVolume2() * 0.8F);
|
|
|
|
+ --itemstack.count;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean a(World world, BlockPosition blockposition, ItemStack itemstack) {
|
|
|
|
+ if (itemstack.hasTag() && itemstack.getTag().hasKeyOfType("BlockEntityTag", 10)) {
|
|
|
|
+ TileEntity tileentity = world.getTileEntity(blockposition);
|
|
|
|
+
|
|
|
|
+ if (tileentity != null) {
|
|
|
|
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
|
|
|
|
+ NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttagcompound.clone();
|
|
|
|
+
|
|
|
|
+ tileentity.b(nbttagcompound);
|
|
|
|
+ NBTTagCompound nbttagcompound2 = (NBTTagCompound) itemstack.getTag().get("BlockEntityTag");
|
|
|
|
+
|
|
|
|
+ nbttagcompound.a(nbttagcompound2);
|
|
|
|
+ nbttagcompound.setInt("x", blockposition.getX());
|
|
|
|
+ nbttagcompound.setInt("y", blockposition.getY());
|
|
|
|
+ nbttagcompound.setInt("z", blockposition.getZ());
|
|
|
|
+ if (!nbttagcompound.equals(nbttagcompound1)) {
|
|
|
|
+ tileentity.a(nbttagcompound);
|
|
|
|
+ tileentity.update();
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String e_(ItemStack itemstack) {
|
|
|
|
+ return this.a.a();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getName() {
|
|
|
|
+ return this.a.a();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Block d() {
|
|
|
|
+ return this.a;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Item c(String s) {
|
|
|
|
+ return this.b(s);
|
|
|
|
+ }
|
|
|
|
+}
|
2014-08-31 19:31:44 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/MobEffectAttackDamage.java b/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
|
|
|
|
new file mode 100644
|
2014-11-28 02:17:45 +01:00
|
|
|
index 0000000..620685a
|
2014-08-31 19:31:44 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MobEffectAttackDamage.java
|
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
+package net.minecraft.server;
|
|
|
|
+
|
|
|
|
+public class MobEffectAttackDamage extends MobEffectList {
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ protected MobEffectAttackDamage(int i, MinecraftKey minecraftkey, boolean flag, int j) {
|
|
|
|
+ super(i, minecraftkey, flag, j);
|
2014-08-31 19:31:44 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public double a(int i, AttributeModifier attributemodifier) {
|
|
|
|
+ return this.id == MobEffectList.WEAKNESS.id ? (double) (-0.5F * (float) (i + 1)) : 1.3D * (double) (i + 1);
|
|
|
|
+ }
|
|
|
|
+}
|
2014-12-06 05:47:37 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000..985e437
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java
|
|
|
|
@@ -0,0 +1,31 @@
|
|
|
|
+package net.minecraft.server;
|
|
|
|
+
|
|
|
|
+public class PacketPlayOutPlayerListHeaderFooter implements Packet {
|
|
|
|
+
|
|
|
|
+ private IChatBaseComponent a;
|
|
|
|
+ private IChatBaseComponent b;
|
|
|
|
+
|
|
|
|
+ public PacketPlayOutPlayerListHeaderFooter() {}
|
|
|
|
+
|
|
|
|
+ public PacketPlayOutPlayerListHeaderFooter(IChatBaseComponent ichatbasecomponent) {
|
|
|
|
+ this.a = ichatbasecomponent;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void a(PacketDataSerializer packetdataserializer) {
|
|
|
|
+ this.a = packetdataserializer.d();
|
|
|
|
+ this.b = packetdataserializer.d();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void b(PacketDataSerializer packetdataserializer) {
|
|
|
|
+ packetdataserializer.a(this.a);
|
|
|
|
+ packetdataserializer.a(this.b);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void a(PacketListenerPlayOut packetlistenerplayout) {
|
|
|
|
+ packetlistenerplayout.a(this);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void a(PacketListener packetlistener) {
|
|
|
|
+ this.a((PacketListenerPlayOut) packetlistener);
|
|
|
|
+ }
|
|
|
|
+}
|
2014-08-12 02:36:08 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
|
|
|
|
new file mode 100644
|
2014-11-28 02:17:45 +01:00
|
|
|
index 0000000..794cdc8
|
2014-08-12 02:36:08 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
|
2014-11-28 02:17:45 +01:00
|
|
|
@@ -0,0 +1,87 @@
|
2014-08-12 02:36:08 +02:00
|
|
|
+package net.minecraft.server;
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+public class TileEntityEnderChest extends TileEntity implements IUpdatePlayerListBox {
|
2014-08-12 02:36:08 +02:00
|
|
|
+
|
|
|
|
+ public float a;
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public float f;
|
|
|
|
+ public int g;
|
|
|
|
+ private int h;
|
2014-08-12 02:36:08 +02:00
|
|
|
+
|
|
|
|
+ public TileEntityEnderChest() {}
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void c() {
|
|
|
|
+ if (++this.h % 20 * 4 == 0) {
|
|
|
|
+ this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.g);
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.f = this.a;
|
|
|
|
+ int i = this.position.getX();
|
|
|
|
+ int j = this.position.getY();
|
|
|
|
+ int k = this.position.getZ();
|
2014-08-12 02:36:08 +02:00
|
|
|
+ float f = 0.1F;
|
|
|
|
+ double d0;
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if (this.g > 0 && this.a == 0.0F) {
|
|
|
|
+ double d1 = (double) i + 0.5D;
|
2014-08-12 02:36:08 +02:00
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ d0 = (double) k + 0.5D;
|
|
|
|
+ this.world.makeSound(d1, (double) j + 0.5D, d0, "random.chestopen", 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if (this.g == 0 && this.a > 0.0F || this.g > 0 && this.a < 1.0F) {
|
2014-08-12 02:36:08 +02:00
|
|
|
+ float f1 = this.a;
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if (this.g > 0) {
|
2014-08-12 02:36:08 +02:00
|
|
|
+ this.a += f;
|
|
|
|
+ } else {
|
|
|
|
+ this.a -= f;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.a > 1.0F) {
|
|
|
|
+ this.a = 1.0F;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ float f2 = 0.5F;
|
|
|
|
+
|
|
|
|
+ if (this.a < f2 && f1 >= f2) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ d0 = (double) i + 0.5D;
|
|
|
|
+ double d2 = (double) k + 0.5D;
|
2014-08-12 02:36:08 +02:00
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.world.makeSound(d0, (double) j + 0.5D, d2, "random.chestclosed", 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.a < 0.0F) {
|
|
|
|
+ this.a = 0.0F;
|
|
|
|
+ }
|
|
|
|
+ }
|
2014-11-28 02:17:45 +01:00
|
|
|
+
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean c(int i, int j) {
|
|
|
|
+ if (i == 1) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.g = j;
|
2014-08-12 02:36:08 +02:00
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return super.c(i, j);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void y() {
|
|
|
|
+ this.E();
|
|
|
|
+ super.y();
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void b() {
|
|
|
|
+ ++this.g;
|
|
|
|
+ this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.g);
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void d() {
|
|
|
|
+ --this.g;
|
|
|
|
+ this.world.playBlockAction(this.position, Blocks.ENDER_CHEST, 1, this.g);
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean a(EntityHuman entityhuman) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ return this.world.getTileEntity(this.position) != this ? false : entityhuman.e((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D;
|
2014-08-12 02:36:08 +02:00
|
|
|
+ }
|
|
|
|
+}
|
2014-08-12 04:43:04 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityLightDetector.java b/src/main/java/net/minecraft/server/TileEntityLightDetector.java
|
|
|
|
new file mode 100644
|
2014-11-28 02:17:45 +01:00
|
|
|
index 0000000..7b6f8ae
|
2014-08-12 04:43:04 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityLightDetector.java
|
2014-11-28 02:17:45 +01:00
|
|
|
@@ -0,0 +1,16 @@
|
2014-08-12 04:43:04 +02:00
|
|
|
+package net.minecraft.server;
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+public class TileEntityLightDetector extends TileEntity implements IUpdatePlayerListBox {
|
2014-08-12 04:43:04 +02:00
|
|
|
+
|
|
|
|
+ public TileEntityLightDetector() {}
|
|
|
|
+
|
2014-11-28 02:17:45 +01:00
|
|
|
+ public void c() {
|
2014-08-12 04:43:04 +02:00
|
|
|
+ if (this.world != null && !this.world.isStatic && this.world.getTime() % 20L == 0L) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.e = this.w();
|
|
|
|
+ if (this.e instanceof BlockDaylightDetector) {
|
|
|
|
+ ((BlockDaylightDetector) this.e).d(this.world, this.position);
|
2014-08-12 04:43:04 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
2014-11-28 02:17:45 +01:00
|
|
|
+
|
2014-08-12 04:43:04 +02:00
|
|
|
+ }
|
|
|
|
+}
|
2014-12-19 23:35:01 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Slot.java b/src/main/java/net/minecraft/server/Slot.java
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000..375989f
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Slot.java
|
|
|
|
@@ -0,0 +1,79 @@
|
|
|
|
+package net.minecraft.server;
|
|
|
|
+
|
|
|
|
+public class Slot {
|
|
|
|
+
|
|
|
|
+ public final int index;
|
|
|
|
+ public final IInventory inventory;
|
|
|
|
+ public int rawSlotIndex;
|
|
|
|
+ public int f;
|
|
|
|
+ public int g;
|
|
|
|
+
|
|
|
|
+ public Slot(IInventory iinventory, int i, int j, int k) {
|
|
|
|
+ this.inventory = iinventory;
|
|
|
|
+ this.index = i;
|
|
|
|
+ this.f = j;
|
|
|
|
+ this.g = k;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void a(ItemStack itemstack, ItemStack itemstack1) {
|
|
|
|
+ if (itemstack != null && itemstack1 != null) {
|
|
|
|
+ if (itemstack.getItem() == itemstack1.getItem()) {
|
|
|
|
+ int i = itemstack1.count - itemstack.count;
|
|
|
|
+
|
|
|
|
+ if (i > 0) {
|
|
|
|
+ this.a(itemstack, i);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected void a(ItemStack itemstack, int i) {}
|
|
|
|
+
|
|
|
|
+ protected void c(ItemStack itemstack) {}
|
|
|
|
+
|
|
|
|
+ public void a(EntityHuman entityhuman, ItemStack itemstack) {
|
|
|
|
+ this.f();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isAllowed(ItemStack itemstack) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ItemStack getItem() {
|
|
|
|
+ return this.inventory.getItem(this.index);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean hasItem() {
|
|
|
|
+ return this.getItem() != null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void set(ItemStack itemstack) {
|
|
|
|
+ this.inventory.setItem(this.index, itemstack);
|
|
|
|
+ this.f();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void f() {
|
|
|
|
+ this.inventory.update();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public int getMaxStackSize() {
|
|
|
|
+ return this.inventory.getMaxStackSize();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public int getMaxStackSize(ItemStack itemstack) {
|
|
|
|
+ return this.getMaxStackSize();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ItemStack a(int i) {
|
|
|
|
+ return this.inventory.splitStack(this.index, i);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean a(IInventory iinventory, int i) {
|
|
|
|
+ return iinventory == this.inventory && i == this.index;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isAllowed(EntityHuman entityhuman) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+}
|
2014-07-23 05:04:05 +02:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|