MinecraftForge / ForgeFlower

Forge's modifications to FernFlower. Fixing various bugs/inconsistencies. Main Repo: https://github.com/MinecraftForge/FernFlower
Apache License 2.0
80 stars 44 forks source link

Decompile output is inconsistent between Java 17 and 19 #130

Closed jpenilla closed 1 year ago

jpenilla commented 1 year ago

The following is a diff from running the latest FF on Java 17 vs 19.

diff --git a/17/net/minecraft/world/level/border/WorldBorder.java b/19/net/minecraft/world/level/border/WorldBorder.java
index 28fd83b..0dff02b 100644
--- a/17/net/minecraft/world/level/border/WorldBorder.java
+++ b/19/net/minecraft/world/level/border/WorldBorder.java
@@ -15,7 +15,7 @@ import net.minecraft.world.phys.shapes.Shapes;
 import net.minecraft.world.phys.shapes.VoxelShape;

 public class WorldBorder {
-    public static final double MAX_SIZE = 5.9999968E7D;
+    public static final double MAX_SIZE = (double)5.999997E7F;
     public static final double MAX_CENTER_COORDINATE = 2.9999984E7D;
     private final List<BorderChangeListener> listeners = Lists.newArrayList();
     private double damagePerBlock = 0.2D;
@@ -25,8 +25,8 @@ public class WorldBorder {
     private double centerX;
     private double centerZ;
     int absoluteMaxSize = 29999984;
-    private WorldBorder.BorderExtent extent = new WorldBorder.StaticBorderExtent(5.9999968E7D);
-    public static final WorldBorder.Settings DEFAULT_SETTINGS = new WorldBorder.Settings(0.0D, 0.0D, 0.2D, 5.0D, 5, 15, 5.9999968E7D, 0L, 0.0D);
+    private WorldBorder.BorderExtent extent = new WorldBorder.StaticBorderExtent((double)5.999997E7F);
+    public static final WorldBorder.Settings DEFAULT_SETTINGS = new WorldBorder.Settings(0.0D, 0.0D, 0.2D, 5.0D, 5, 15, (double)5.999997E7F, 0L, 0.0D);

     public boolean isWithinBounds(BlockPos pos) {
         return (double)(pos.getX() + 1) > this.getMinX() && (double)pos.getX() < this.getMaxX() && (double)(pos.getZ() + 1) > this.getMinZ() && (double)pos.getZ() < this.getMaxZ();

This is likely caused by https://bugs.openjdk.org/browse/JDK-8291475