--- a/net/minecraft/client/particle/ParticleManager.java +++ b/net/minecraft/client/particle/ParticleManager.java @@ -65,7 +65,7 @@ private final Queue field_178933_d = Queues.newArrayDeque(); private final TextureManager field_78877_c; private final Random field_78875_d = new Random(); - private final Int2ObjectMap> field_178932_g = new Int2ObjectOpenHashMap<>(); + private final Map> field_178932_g = new java.util.HashMap<>(); private final Queue field_187241_h = Queues.newArrayDeque(); private final Map field_215242_i = Maps.newHashMap(); private final AtlasTexture field_215243_j = new AtlasTexture(AtlasTexture.field_215262_g); @@ -143,13 +143,13 @@ } public void func_199283_a(ParticleType p_199283_1_, IParticleFactory p_199283_2_) { - this.field_178932_g.put(Registry.field_212632_u.func_148757_b(p_199283_1_), p_199283_2_); + this.field_178932_g.put(Registry.field_212632_u.func_177774_c(p_199283_1_), p_199283_2_); } public void func_215234_a(ParticleType p_215234_1_, ParticleManager.IParticleMetaFactory p_215234_2_) { ParticleManager.AnimatedSpriteImpl particlemanager$animatedspriteimpl = new ParticleManager.AnimatedSpriteImpl(); this.field_215242_i.put(Registry.field_212632_u.func_177774_c(p_215234_1_), particlemanager$animatedspriteimpl); - this.field_178932_g.put(Registry.field_212632_u.func_148757_b(p_215234_1_), p_215234_2_.create(particlemanager$animatedspriteimpl)); + this.field_178932_g.put(Registry.field_212632_u.func_177774_c(p_215234_1_), p_215234_2_.create(particlemanager$animatedspriteimpl)); } public CompletableFuture func_215226_a(IFutureReloadListener.IStage p_215226_1_, IResourceManager p_215226_2_, IProfiler p_215226_3_, IProfiler p_215226_4_, Executor p_215226_5_, Executor p_215226_6_) { @@ -238,11 +238,12 @@ @Nullable private Particle func_199927_b(T p_199927_1_, double p_199927_2_, double p_199927_4_, double p_199927_6_, double p_199927_8_, double p_199927_10_, double p_199927_12_) { - IParticleFactory iparticlefactory = (IParticleFactory) this.field_178932_g.get(Registry.field_212632_u.func_148757_b(p_199927_1_.func_197554_b())); + IParticleFactory iparticlefactory = (IParticleFactory) this.field_178932_g.get(Registry.field_212632_u.func_177774_c(p_199927_1_.func_197554_b())); return iparticlefactory == null ? null : iparticlefactory.func_199234_a(p_199927_1_, this.field_78878_a, p_199927_2_, p_199927_4_, p_199927_6_, p_199927_8_, p_199927_10_, p_199927_12_); } public void func_78873_a(Particle p_78873_1_) { + if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs. this.field_187241_h.add(p_78873_1_); } @@ -312,7 +313,8 @@ RenderSystem.pushMatrix(); RenderSystem.multMatrix(p_228345_1_.func_227866_c_().func_227870_a_()); - for(IParticleRenderType iparticlerendertype : field_215241_b) { + for(IParticleRenderType iparticlerendertype : this.field_78876_b.keySet()) { // Forge: allow custom IParticleRenderType's + if (iparticlerendertype == IParticleRenderType.field_217606_f) continue; Iterable iterable = this.field_78876_b.get(iparticlerendertype); if (iterable != null) { RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); @@ -351,7 +353,7 @@ } public void func_180533_a(BlockPos p_180533_1_, BlockState p_180533_2_) { - if (!p_180533_2_.func_196958_f()) { + if (!p_180533_2_.isAir(this.field_78878_a, p_180533_1_) && !p_180533_2_.addDestroyEffects(this.field_78878_a, p_180533_1_, this)) { VoxelShape voxelshape = p_180533_2_.func_196954_c(this.field_78878_a, p_180533_1_); double d0 = 0.25D; voxelshape.func_197755_b((p_228348_3_, p_228348_5_, p_228348_7_, p_228348_9_, p_228348_11_, p_228348_13_) -> { @@ -423,6 +425,12 @@ return String.valueOf(this.field_78876_b.values().stream().mapToInt(Collection::size).sum()); } + public void addBlockHitEffects(BlockPos pos, net.minecraft.util.math.BlockRayTraceResult target) { + BlockState state = field_78878_a.func_180495_p(pos); + if (!state.addHitEffects(field_78878_a, target, this)) + func_180532_a(pos, target.func_216354_b()); + } + @OnlyIn(Dist.CLIENT) class AnimatedSpriteImpl implements IAnimatedSprite { private List field_217594_b;