diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java index 6118eb8b9..a7558fc74 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/SymmetryWandItem.java @@ -21,6 +21,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.IFluidState; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -38,6 +39,9 @@ import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.common.util.BlockSnapshot; +import net.minecraftforge.common.util.Constants.BlockFlags; +import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.network.PacketDistributor; @@ -227,7 +231,15 @@ public class SymmetryWandItem extends Item { if (BlockHelper.findAndRemoveInInventory(blockState, player, 1) == 0) continue; + BlockSnapshot blocksnapshot = BlockSnapshot.getBlockSnapshot(world, position); + IFluidState ifluidstate = world.getFluidState(position); + world.setBlockState(position, ifluidstate.getBlockState(), BlockFlags.UPDATE_NEIGHBORS); world.setBlockState(position, blockState); + if (ForgeEventFactory.onBlockPlace(player, blocksnapshot, Direction.UP)) { + blocksnapshot.restore(true, false); + continue; + } + targets.add(position); } } diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderTooltipHandler.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderTooltipHandler.java index 87c56e7f0..6209624bc 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderTooltipHandler.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderTooltipHandler.java @@ -98,12 +98,13 @@ public class PonderTooltipHandler { float renderPartialTicks = AnimationTickHolder.getPartialTicks(); if (lastHoveredStack != stack) return; - if (subject) { - toolTip.set(1, Lang.createTranslationTextComponent(SUBJECT) - .applyTextStyle(TextFormatting.GREEN)); - return; - } - toolTip.set(1, makeProgressBar(Math.min(1, holdWProgress.getValue(renderPartialTicks) * 8 / 7f))); + ITextComponent component = subject ? Lang.createTranslationTextComponent(SUBJECT) + .applyTextStyle(TextFormatting.GREEN) + : makeProgressBar(Math.min(1, holdWProgress.getValue(renderPartialTicks) * 8 / 7f)); + if (toolTip.size() < 2) + toolTip.add(component); + else + toolTip.set(1, component); } public static void handleTooltipColor(RenderTooltipEvent.Color event) { diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java index 1b75b6571..f9adefdfc 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java @@ -42,6 +42,7 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.LightType; import net.minecraft.world.World; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import net.minecraftforge.registries.ForgeRegistries; public class PonderWorld extends SchematicWorld { @@ -49,7 +50,9 @@ public class PonderWorld extends SchematicWorld { protected Map originalBlocks; protected Map originalTileEntities; protected List originalEntities; + protected PonderWorldParticles particles; + private final Map> particleFactories; int overrideLight; Selection mask; @@ -60,6 +63,10 @@ public class PonderWorld extends SchematicWorld { originalTileEntities = new HashMap<>(); originalEntities = new ArrayList<>(); particles = new PonderWorldParticles(this); + + // ParticleManager.factories - ATs don't seem to like this one + particleFactories = ObfuscationReflectionHelper.getPrivateValue(ParticleManager.class, + Minecraft.getInstance().particles, "field_178932_g"); } public void createBackup() { @@ -186,9 +193,8 @@ public class PonderWorld extends SchematicWorld { @SuppressWarnings("unchecked") private Particle makeParticle(T data, double x, double y, double z, double mx, double my, double mz) { - ParticleManager particleManager = Minecraft.getInstance().particles; ResourceLocation key = ForgeRegistries.PARTICLE_TYPES.getKey(data.getType()); - IParticleFactory iparticlefactory = (IParticleFactory) particleManager.factories.get(key); + IParticleFactory iparticlefactory = (IParticleFactory) particleFactories.get(key); return iparticlefactory == null ? null : iparticlefactory.makeParticle(data, this, x, y, z, mx, my, mz); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/Lang.java b/src/main/java/com/simibubi/create/foundation/utility/Lang.java index 479ae60e0..b30a4704d 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/Lang.java +++ b/src/main/java/com/simibubi/create/foundation/utility/Lang.java @@ -25,14 +25,13 @@ public class Lang { public static List translatedOptions(String prefix, String... keys) { List result = new ArrayList<>(keys.length); - for (String key : keys) { + for (String key : keys) result.add(translate(prefix + "." + key)); - } return result; } public static String asId(String name) { - return name.toLowerCase(Locale.ENGLISH); + return name.toLowerCase(Locale.ROOT); } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 75b9c48cb..c1616fc98 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -25,9 +25,6 @@ public net.minecraft.tileentity.BeaconTileEntity field_174909_f # beamSegments public net.minecraft.world.server.ServerTickList field_205374_d # pendingTickListEntriesHashSet public net.minecraft.world.server.ServerTickList field_205375_e # pendingTickListEntriesTreeSet -# Particle Manager -public net.minecraft.client.particle.ParticleManager field_178932_g # factories - # Lightmap information for instanced rendering public net.minecraft.client.renderer.LightTexture field_205112_c #resourceLocation public net.minecraft.client.Minecraft field_193996_ah #renderPartialTicksPaused