|
1 | 1 | --- a/net/minecraft/block/Block.java
|
2 | 2 | +++ b/net/minecraft/block/Block.java
|
3 |
| -@@ -74,11 +74,13 @@ |
| 3 | +@@ -75,9 +75,10 @@ |
4 | 4 | import org.apache.logging.log4j.LogManager;
|
5 | 5 | import org.apache.logging.log4j.Logger;
|
6 | 6 |
|
7 | 7 | -public class Block implements IItemProvider {
|
8 | 8 | +public class Block extends net.minecraftforge.registries.ForgeRegistryEntry<Block> implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock {
|
9 | 9 | protected static final Logger field_196273_d = LogManager.getLogger();
|
10 |
| - private static final ResourceLocation field_176230_a = new ResourceLocation("air"); |
11 |
| -- public static final RegistryNamespacedDefaultedByKey<ResourceLocation, Block> field_149771_c = new RegistryNamespacedDefaultedByKey<ResourceLocation, Block>(field_176230_a); |
12 |
| -- public static final ObjectIntIdentityMap<IBlockState> field_176229_d = new ObjectIntIdentityMap<IBlockState>(); |
13 |
| -+ @Deprecated //Forge: Do not use, use ForgeRegistries |
14 |
| -+ public static final RegistryNamespacedDefaultedByKey<ResourceLocation, Block> field_149771_c = net.minecraftforge.registries.GameData.getWrapperDefaulted(Block.class); |
| 10 | +- public static final ObjectIntIdentityMap<IBlockState> field_176229_d = new ObjectIntIdentityMap<>(); |
15 | 11 | + @Deprecated //Forge: Do not use, use GameRegistry
|
16 | 12 | + public static final ObjectIntIdentityMap<IBlockState> field_176229_d = net.minecraftforge.registries.GameData.getBlockStateIDMap();
|
| 13 | + private static final EnumFacing[] field_212556_a = new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.DOWN, EnumFacing.UP}; |
17 | 14 | protected final int field_149784_t;
|
18 | 15 | protected final float field_149782_v;
|
19 |
| - protected final float field_149781_w; |
20 |
| -@@ -316,7 +318,7 @@ |
| 16 | +@@ -298,7 +299,7 @@ |
21 | 17 |
|
22 | 18 | @Deprecated
|
23 | 19 | public boolean func_196253_a(IBlockState p_196253_1_, BlockItemUseContext p_196253_2_) {
|
|
26 | 22 | }
|
27 | 23 |
|
28 | 24 | @Deprecated
|
29 |
| -@@ -328,8 +330,9 @@ |
| 25 | +@@ -310,8 +311,9 @@ |
30 | 26 | return this.field_149789_z;
|
31 | 27 | }
|
32 | 28 |
|
|
37 | 33 | }
|
38 | 34 |
|
39 | 35 | @Deprecated
|
40 |
| -@@ -340,11 +343,11 @@ |
| 36 | +@@ -322,11 +324,11 @@ |
41 | 37 | @Deprecated
|
42 | 38 | @OnlyIn(Dist.CLIENT)
|
43 | 39 | public int func_185484_c(IBlockState p_185484_1_, IWorldReader p_185484_2_, BlockPos p_185484_3_) {
|
|
51 | 47 | } else {
|
52 | 48 | return i;
|
53 | 49 | }
|
54 |
| -@@ -486,8 +489,12 @@ |
| 50 | +@@ -468,8 +470,12 @@ |
55 | 51 |
|
56 | 52 | @Deprecated
|
57 | 53 | public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
|
|
64 | 60 | public int func_196264_a(IBlockState p_196264_1_, Random p_196264_2_) {
|
65 | 61 | return 1;
|
66 | 62 | }
|
67 |
| -@@ -502,30 +509,30 @@ |
| 63 | +@@ -484,30 +490,30 @@ |
68 | 64 | if (f == -1.0F) {
|
69 | 65 | return 0.0F;
|
70 | 66 | } else {
|
|
109 | 105 | float f = 0.5F;
|
110 | 106 | double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
|
111 | 107 | double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
|
112 |
| -@@ -547,6 +554,7 @@ |
| 108 | +@@ -529,6 +535,7 @@ |
113 | 109 |
|
114 | 110 | }
|
115 | 111 |
|
116 | 112 | + @Deprecated //Forge: State sensitive version
|
117 | 113 | public float func_149638_a() {
|
118 | 114 | return this.field_149781_w;
|
119 | 115 | }
|
120 |
| -@@ -561,7 +569,7 @@ |
| 116 | +@@ -543,7 +550,7 @@ |
121 | 117 | }
|
122 | 118 | }
|
123 | 119 |
|
|
126 | 122 | }
|
127 | 123 |
|
128 | 124 | public void func_180652_a(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) {
|
129 |
| -@@ -615,16 +623,22 @@ |
| 125 | +@@ -597,16 +604,22 @@ |
130 | 126 | public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
|
131 | 127 | p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
|
132 | 128 | p_180657_2_.func_71020_j(0.005F);
|
|
151 | 147 | protected boolean func_149700_E() {
|
152 | 148 | return this.func_176223_P().func_185917_h() && !this.func_149716_u();
|
153 | 149 | }
|
154 |
| -@@ -681,6 +695,7 @@ |
| 150 | +@@ -663,6 +676,7 @@ |
155 | 151 | p_176216_2_.field_70181_x = 0.0D;
|
156 | 152 | }
|
157 | 153 |
|
158 | 154 | + @Deprecated // Forge: Use more sensitive version below: getPickBlock
|
159 | 155 | public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
|
160 | 156 | return new ItemStack(this);
|
161 | 157 | }
|
162 |
| -@@ -755,6 +770,7 @@ |
| 158 | +@@ -737,6 +751,7 @@ |
163 | 159 | }
|
164 | 160 | }
|
165 | 161 |
|
166 | 162 | + @Deprecated //Forge: Use more sensitive version {@link IForgeBlockState#getSoundType(IWorldReader, BlockPos, Entity) }
|
167 | 163 | public SoundType func_185467_w() {
|
168 | 164 | return this.field_149762_H;
|
169 | 165 | }
|
170 |
| -@@ -776,11 +792,11 @@ |
| 166 | +@@ -758,11 +773,11 @@ |
171 | 167 | }
|
172 | 168 |
|
173 | 169 | public static boolean func_196252_e(Block p_196252_0_) {
|
|
181 | 177 | }
|
182 | 178 |
|
183 | 179 | public static void func_149671_p() {
|
184 |
| -@@ -1147,7 +1163,7 @@ |
185 |
| - func_196254_a("chiseled_quartz_block", new Block(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_151677_p).func_200943_b(0.8F))); |
186 |
| - func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_151677_p).func_200943_b(0.8F))); |
187 |
| - func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Builder.func_200950_a(block42))); |
188 |
| -- func_196254_a("activator_rail", new BlockRailPowered(Block.Builder.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e))); |
189 |
| -+ func_196254_a("activator_rail", new BlockRailPowered(Block.Builder.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true)); |
190 |
| - func_196254_a("dropper", new BlockDropper(Block.Builder.func_200945_a(Material.field_151576_e).func_200943_b(3.5F))); |
191 |
| - func_196254_a("white_terracotta", new Block(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_193561_M).func_200948_a(1.25F, 4.2F))); |
192 |
| - func_196254_a("orange_terracotta", new Block(Block.Builder.func_200949_a(Material.field_151576_e, MapColor.field_193562_N).func_200948_a(1.25F, 4.2F))); |
193 |
| -@@ -1464,6 +1480,7 @@ |
194 |
| - func_196254_a("structure_block", new BlockStructure(Block.Builder.func_200949_a(Material.field_151573_f, MapColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F))); |
195 |
| - field_149771_c.func_177776_a(); |
| 180 | +@@ -1129,7 +1144,7 @@ |
| 181 | + func_196254_a("chiseled_quartz_block", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F))); |
| 182 | + func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F))); |
| 183 | + func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Properties.func_200950_a(block42))); |
| 184 | +- func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e))); |
| 185 | ++ func_196254_a("activator_rail", new BlockRailPowered(Block.Properties.func_200945_a(Material.field_151594_q).func_200942_a().func_200943_b(0.7F).func_200947_a(SoundType.field_185852_e), true)); |
| 186 | + func_196254_a("dropper", new BlockDropper(Block.Properties.func_200945_a(Material.field_151576_e).func_200943_b(3.5F))); |
| 187 | + func_196254_a("white_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193561_M).func_200948_a(1.25F, 4.2F))); |
| 188 | + func_196254_a("orange_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193562_N).func_200948_a(1.25F, 4.2F))); |
| 189 | +@@ -1455,6 +1470,7 @@ |
| 190 | + func_196254_a("bubble_column", new BlockBubbleColumn(Block.Properties.func_200945_a(Material.field_203244_i).func_200942_a())); |
| 191 | + func_196254_a("structure_block", new BlockStructure(Block.Properties.func_200949_a(Material.field_151573_f, MaterialColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F))); |
196 | 192 |
|
197 | 193 | + if(false) // Processed in GameData.BlockCallbacks#onBake
|
198 |
| - for(Block block80 : field_149771_c) { |
199 |
| - for(IBlockState iblockstate : block80.func_176194_O().func_177619_a()) { |
| 194 | + for(Block block85 : IRegistry.field_212618_g) { |
| 195 | + for(IBlockState iblockstate : block85.func_176194_O().func_177619_a()) { |
200 | 196 | field_176229_d.func_195867_b(iblockstate);
|
201 |
| -@@ -1604,4 +1621,83 @@ |
| 197 | +@@ -1594,4 +1610,83 @@ |
202 | 198 | return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c);
|
203 | 199 | }
|
204 | 200 | }
|
|
0 commit comments