Commits
md_5 authored 7745d45de92
1 - | From 6c97425d256842a87fefd636af5854d0fe315086 Mon Sep 17 00:00:00 2001 |
1 + | From 701131eeaff795c9a7745ee77f668266db96b9f8 Mon Sep 17 00:00:00 2001 |
2 2 | From: md_5 <md_5@live.com.au> |
3 3 | Date: Sun, 1 Dec 2013 15:10:48 +1100 |
4 4 | Subject: [PATCH] mc-dev imports |
5 5 | ​ |
6 6 | Imported files which are only modified by Spigot, not upstream. Files here should be completely unmodified aside from trivial changes such as adding throws statements to ensure proper compilation. You may need to add unrelated files in order to ensure a compilable result in the face of synthetic methods. |
7 7 | ​ |
8 8 | diff --git a/src/main/java/net/minecraft/server/AttributeRanged.java b/src/main/java/net/minecraft/server/AttributeRanged.java |
9 9 | new file mode 100644 |
10 10 | index 0000000..130597c |
11 11 | --- /dev/null |
41 41 | + |
42 42 | + public String g() { |
43 43 | + return this.c; |
44 44 | + } |
45 45 | + |
46 46 | + public double a(double d0) { |
47 47 | + d0 = MathHelper.a(d0, this.a, this.b); |
48 48 | + return d0; |
49 49 | + } |
50 50 | +} |
51 - | diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java |
52 - | new file mode 100644 |
53 - | index 0000000..863cba4 |
54 - | --- /dev/null |
55 - | +++ b/src/main/java/net/minecraft/server/BlockTNT.java |
56 - | |
57 - | +package net.minecraft.server; |
58 - | + |
59 - | +import javax.annotation.Nullable; |
60 - | + |
61 - | +public class BlockTNT extends Block { |
62 - | + |
63 - | + public static final BlockStateBoolean EXPLODE = BlockStateBoolean.of("explode"); |
64 - | + |
65 - | + public BlockTNT() { |
66 - | + super(Material.TNT); |
67 - | + this.w(this.blockStateList.getBlockData().set(BlockTNT.EXPLODE, Boolean.valueOf(false))); |
68 - | + this.a(CreativeModeTab.d); |
69 - | + } |
70 - | + |
71 - | + public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) { |
72 - | + super.onPlace(world, blockposition, iblockdata); |
73 - | + if (world.isBlockIndirectlyPowered(blockposition)) { |
74 - | + this.postBreak(world, blockposition, iblockdata.set(BlockTNT.EXPLODE, Boolean.valueOf(true))); |
75 - | + world.setAir(blockposition); |
76 - | + } |
77 - | + |
78 - | + } |
79 - | + |
80 - | + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Block block) { |
81 - | + if (world.isBlockIndirectlyPowered(blockposition)) { |
82 - | + this.postBreak(world, blockposition, iblockdata.set(BlockTNT.EXPLODE, Boolean.valueOf(true))); |
83 - | + world.setAir(blockposition); |
84 - | + } |
85 - | + |
86 - | + } |
87 - | + |
88 - | + public void wasExploded(World world, BlockPosition blockposition, Explosion explosion) { |
89 - | + if (!world.isClientSide) { |
90 - | + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); |
91 - | + |
92 - | + entitytntprimed.setFuseTicks((short) (world.random.nextInt(entitytntprimed.getFuseTicks() / 4) + entitytntprimed.getFuseTicks() / 8)); |
93 - | + world.addEntity(entitytntprimed); |
94 - | + } |
95 - | + } |
96 - | + |
97 - | + public void postBreak(World world, BlockPosition blockposition, IBlockData iblockdata) { |
98 - | + this.a(world, blockposition, iblockdata, (EntityLiving) null); |
99 - | + } |
100 - | + |
101 - | + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityLiving entityliving) { |
102 - | + if (!world.isClientSide) { |
103 - | + if (((Boolean) iblockdata.get(BlockTNT.EXPLODE)).booleanValue()) { |
104 - | + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), entityliving); |
105 - | + |
106 - | + world.addEntity(entitytntprimed); |
107 - | + world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gz, SoundCategory.BLOCKS, 1.0F, 1.0F); |
108 - | + } |
109 - | + |
110 - | + } |
111 - | + } |
112 - | + |
113 - | + public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) { |
114 - | + if (itemstack != null && (itemstack.getItem() == Items.FLINT_AND_STEEL || itemstack.getItem() == Items.FIRE_CHARGE)) { |
115 - | + this.a(world, blockposition, iblockdata.set(BlockTNT.EXPLODE, Boolean.valueOf(true)), (EntityLiving) entityhuman); |
116 - | + world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11); |
117 - | + if (itemstack.getItem() == Items.FLINT_AND_STEEL) { |
118 - | + itemstack.damage(1, entityhuman); |
119 - | + } else if (!entityhuman.abilities.canInstantlyBuild) { |
120 - | + --itemstack.count; |
121 - | + } |
122 - | + |
123 - | + return true; |
124 - | + } else { |
125 - | + return super.interact(world, blockposition, iblockdata, entityhuman, enumhand, itemstack, enumdirection, f, f1, f2); |
126 - | + } |
127 - | + } |
128 - | + |
129 - | + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { |
130 - | + if (!world.isClientSide && entity instanceof EntityArrow) { |
131 - | + EntityArrow entityarrow = (EntityArrow) entity; |
132 - | + |
133 - | + if (entityarrow.isBurning()) { |
134 - | + this.a(world, blockposition, world.getType(blockposition).set(BlockTNT.EXPLODE, Boolean.valueOf(true)), entityarrow.shooter instanceof EntityLiving ? (EntityLiving) entityarrow.shooter : null); |
135 - | + world.setAir(blockposition); |
136 - | + } |
137 - | + } |
138 - | + |
139 - | + } |
140 - | + |
141 - | + public boolean a(Explosion explosion) { |
142 - | + return false; |
143 - | + } |
144 - | + |
145 - | + public IBlockData fromLegacyData(int i) { |
146 - | + return this.getBlockData().set(BlockTNT.EXPLODE, Boolean.valueOf((i & 1) > 0)); |
147 - | + } |
148 - | + |
149 - | + public int toLegacyData(IBlockData iblockdata) { |
150 - | + return ((Boolean) iblockdata.get(BlockTNT.EXPLODE)).booleanValue() ? 1 : 0; |
151 - | + } |
152 - | + |
153 - | + protected BlockStateList getStateList() { |
154 - | + return new BlockStateList(this, new IBlockState[] { BlockTNT.EXPLODE}); |
155 - | + } |
156 - | +} |
157 51 | diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java |
158 52 | new file mode 100644 |
159 53 | index 0000000..e44fc86 |
160 54 | --- /dev/null |
161 55 | +++ b/src/main/java/net/minecraft/server/CommandDispatcher.java |
162 56 | |
163 57 | +package net.minecraft.server; |
164 58 | + |
165 59 | +import java.util.Iterator; |
166 60 | + |