]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/commitdiff
Get 1.17.1 building
authorIrtimaled <irtimaled@gmail.com>
Mon, 26 Jul 2021 02:38:26 +0000 (19:38 -0700)
committerIrtimaled <irtimaled@gmail.com>
Mon, 26 Jul 2021 03:52:14 +0000 (20:52 -0700)
21 files changed:
build.gradle
gradle.properties
gradle/wrapper/gradle-wrapper.properties
src/main/java/com/irtimaled/bbor/client/gui/AbstractControl.java
src/main/java/com/irtimaled/bbor/client/gui/AbstractSlider.java
src/main/java/com/irtimaled/bbor/client/gui/ControlList.java
src/main/java/com/irtimaled/bbor/client/gui/ListScreen.java
src/main/java/com/irtimaled/bbor/client/interop/NBTStructureLoader.java
src/main/java/com/irtimaled/bbor/client/interop/TileEntitiesHelper.java
src/main/java/com/irtimaled/bbor/client/keyboard/CustomKeyBinding.java
src/main/java/com/irtimaled/bbor/client/keyboard/KeyListener.java
src/main/java/com/irtimaled/bbor/client/providers/BeaconProvider.java
src/main/java/com/irtimaled/bbor/client/renderers/RenderHelper.java
src/main/java/com/irtimaled/bbor/client/renderers/Renderer.java
src/main/java/com/irtimaled/bbor/common/StructureProcessor.java
src/main/java/com/irtimaled/bbor/common/interop/CommonInterop.java
src/main/java/com/irtimaled/bbor/mixin/client/MixinGameSettings.java
src/main/java/com/irtimaled/bbor/mixin/client/gui/screen/MixinOptionsScreen.java
src/main/java/com/irtimaled/bbor/mixin/client/settings/MixinKeyBinding.java
src/main/java/com/irtimaled/bbor/mixin/resource/MixinResourcePackManager.java
src/main/resources/mixins.bbor.json

index 095cb593d8c3653b96c7da1f8bdd485cfcb50223..05c2fea285dff075930ea8836c8e224c2c7fe511 100644 (file)
@@ -7,7 +7,7 @@ buildscript {
         }
     }
     dependencies {
-        classpath "net.fabricmc:fabric-loom:0.2.7-SNAPSHOT"
+        classpath "net.fabricmc:fabric-loom:0.8-SNAPSHOT"
     }
 }
 
@@ -19,13 +19,24 @@ group 'com.irtimaled'
 version project.buildVersion + '-' + project.mcVersion
 archivesBaseName = 'BBOutlineReloaded'
 
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
+sourceCompatibility = JavaVersion.VERSION_16
+targetCompatibility = JavaVersion.VERSION_16
+
+tasks.withType(JavaCompile).configureEach {
+    // ensure that the encoding is set to UTF-8, no matter what the system default is
+    // this fixes some edge cases with special characters not displaying correctly
+    // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
+    // If Javadoc is generated, this must be specified in that task too.
+    it.options.encoding = "UTF-8"
+
+    // Minecraft 1.17 (21w19a) upwards uses Java 16.
+    it.options.release = 16
+}
 
 dependencies {
     minecraft 'com.mojang:minecraft:' + project.mcVersion
-    mappings 'net.fabricmc:yarn:' + project.mcVersion + '+build.27'
-    modCompile 'net.fabricmc:fabric-loader:0.9.3+build.207'
+    mappings 'net.fabricmc:yarn:' + project.mcVersion + '+build.1:v2'
+    modImplementation 'net.fabricmc:fabric-loader:0.11.6'
 }
 
 minecraft {
@@ -38,6 +49,13 @@ processResources {
     }
 }
 
+java {
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(16)
+    }
+    withSourcesJar()
+}
+
 jar {
     manifest {
         attributes([
index dc62e0be62a928b38523812ded22138d6f32d752..341f34c2671ec8e5662d3df96f055af77b60aa21 100644 (file)
@@ -1,4 +1,4 @@
 name=bbor
 buildVersion=2.4
 # leave a space to reduce merge conflicts on version change
-mcVersion=1.16.3
+mcVersion=1.17.1
index f78ba29908cbdb5ae7ed6d6d4c2119c035fd4d1f..c4c1514bbdeea96077f96f5c2440dc49f89e4347 100644 (file)
@@ -1,5 +1,5 @@
 #Tue May 26 09:16:06 PDT 2020
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStorePath=wrapper/dists
index 01db585e620dea0f11533aaa0a9ec7510188cd46..df1a538b5349a0903985a162f9090efda7874e25 100644 (file)
@@ -1,13 +1,14 @@
 package com.irtimaled.bbor.client.gui;
 
 import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.gui.widget.AbstractButtonWidget;
+import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
+import net.minecraft.client.gui.widget.ClickableWidget;
 import net.minecraft.client.util.math.MatrixStack;
 import net.minecraft.text.LiteralText;
 
 import java.awt.*;
 
-abstract class AbstractControl extends AbstractButtonWidget implements IControl {
+abstract class AbstractControl extends ClickableWidget implements IControl {
     private static final int PADDING = 4;
     protected final MinecraftClient minecraft;
 
@@ -38,7 +39,7 @@ abstract class AbstractControl extends AbstractButtonWidget implements IControl
     }
 
     @Override
-    protected void renderBg(MatrixStack matrixStack, MinecraftClient minecraft, int mouseX, int mouseY) {
+    protected void renderBackground(MatrixStack matrixStack, MinecraftClient minecraft, int mouseX, int mouseY) {
         if (active) renderBackground(matrixStack, mouseX, mouseY);
     }
 
@@ -65,4 +66,8 @@ abstract class AbstractControl extends AbstractButtonWidget implements IControl
     public void clearFocus() {
         this.setFocused(false);
     }
+
+    @Override
+    public void appendNarrations(NarrationMessageBuilder builder) {
+    }
 }
index f527fef67197ebab501c4870a6b8a0ecfe373ae1..1a3c1f544806de743c052b100cb2e2062d31b37a 100644 (file)
@@ -18,7 +18,7 @@ abstract class AbstractSlider extends AbstractControl {
 
     @Override
     protected void renderBackground(MatrixStack matrixStack, int mouseX, int mouseY) {
-        this.minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
+        this.minecraft.getTextureManager().bindTexture(WIDGETS_TEXTURE);
         int hoverState = super.getYImage(this.isHovered());
         this.drawTexture(matrixStack, this.x + (int) getProgressPercentage(), this.y, 0, 46 + hoverState * 20, 4, this.height);
         this.drawTexture(matrixStack, this.x + (int) getProgressPercentage() + 4, this.y, 196, 46 + hoverState * 20, 4, 20);
index 80554db10d5027a701ad8ff21d6f0ff5958b0615..b031531d1c7ec1bd7ff4932fae920796da4b4a84 100644 (file)
@@ -3,7 +3,6 @@ package com.irtimaled.bbor.client.gui;
 import com.irtimaled.bbor.client.renderers.RenderHelper;
 import com.irtimaled.bbor.client.renderers.Renderer;
 import com.irtimaled.bbor.common.MathHelper;
-import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.DrawableHelper;
 import net.minecraft.client.util.math.MatrixStack;
 
@@ -18,7 +17,6 @@ public class ControlList extends DrawableHelper implements IControlSet {
     protected final List<ControlListEntry> entries = new ArrayList<>();
     private final int scrollBarLeft;
     private final int listHeight;
-    private final MinecraftClient minecraft;
     private final int width;
     private final int height;
     private final int top;
@@ -32,7 +30,6 @@ public class ControlList extends DrawableHelper implements IControlSet {
     private boolean isDragging;
 
     ControlList(int width, int height, int top, int bottom) {
-        this.minecraft = MinecraftClient.getInstance();
         this.width = width;
         this.scrollBarLeft = width - 6;
         this.height = height;
@@ -157,7 +154,7 @@ public class ControlList extends DrawableHelper implements IControlSet {
         this.amountScrolled = MathHelper.clamp(this.amountScrolled, 0.0D, this.getMaxScroll());
 
         RenderHelper.disableLighting();
-        RenderHelper.disableFog();
+        // RenderHelper.disableFog();
         if (!transparentBackground) drawListBackground();
 
         int listTop = this.top + PADDING - (int) this.amountScrolled;
@@ -190,7 +187,7 @@ public class ControlList extends DrawableHelper implements IControlSet {
     }
 
     private void drawListBackground() {
-        this.minecraft.getTextureManager().bindTexture(DrawableHelper.OPTIONS_BACKGROUND_TEXTURE);
+        RenderHelper.setTexture(DrawableHelper.OPTIONS_BACKGROUND_TEXTURE);
         Renderer.startTextured()
                 .setColor(32, 32, 32)
                 .setAlpha(255)
@@ -222,7 +219,7 @@ public class ControlList extends DrawableHelper implements IControlSet {
     }
 
     private void overlayBackground(int top, int bottom) {
-        this.minecraft.getTextureManager().bindTexture(DrawableHelper.OPTIONS_BACKGROUND_TEXTURE);
+        RenderHelper.setTexture(DrawableHelper.OPTIONS_BACKGROUND_TEXTURE);
         Renderer.startTextured()
                 .setColor(64, 64, 64)
                 .setAlpha(255)
index 9655563bcab7f6c838938ffb6c047c6290e0e6a2..d97b546182b179b2e5bef69da6983292f38b17ed 100644 (file)
@@ -8,6 +8,8 @@ import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.util.math.MatrixStack;
 import net.minecraft.text.LiteralText;
 
+import java.util.List;
+
 public abstract class ListScreen extends Screen {
     private final Screen lastScreen;
     private static final String version = Versions.build;
@@ -40,9 +42,9 @@ public abstract class ListScreen extends Screen {
             }
         };
 
-        this.children.add(this.searchField);
-        this.children.add(this.controlList);
-        this.children.add(this.doneButton);
+        this.addDrawableChild(this.searchField);
+        ((List<Element>)this.children()).add(controlList);
+        this.addDrawableChild(this.doneButton);
     }
 
     protected abstract ControlList buildList(int top, int bottom);
@@ -55,7 +57,7 @@ public abstract class ListScreen extends Screen {
     protected void render(MatrixStack matrixStack, int mouseX, int mouseY) {
         this.controlList.render(matrixStack, mouseX, mouseY);
 
-        this.drawCenteredString(matrixStack, this.textRenderer, this.title.asString(), this.width / 2, 8, 16777215);
+        this.drawCenteredText(matrixStack, this.textRenderer, this.title.asString(), this.width / 2, 8, 16777215);
         this.searchField.render(matrixStack, mouseX, mouseY);
         this.doneButton.render(matrixStack, mouseX, mouseY);
 
index 7591e51b3c7ea967adb3331da5aa794e06544585..b0c76ec3582e7760650a5fc097fb5e9b17c03423 100644 (file)
@@ -5,8 +5,9 @@ import com.irtimaled.bbor.common.ReflectionHelper;
 import com.irtimaled.bbor.common.events.StructuresLoaded;
 import com.irtimaled.bbor.common.models.DimensionId;
 import net.minecraft.client.MinecraftClient;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.nbt.ListTag;
+import net.minecraft.nbt.NbtCompound;
+import net.minecraft.nbt.NbtList;
+import net.minecraft.server.world.ServerWorld;
 import net.minecraft.structure.StructureManager;
 import net.minecraft.structure.StructurePiece;
 import net.minecraft.structure.StructureStart;
@@ -14,10 +15,7 @@ import net.minecraft.util.math.BlockBox;
 import net.minecraft.util.math.BlockPos;
 import net.minecraft.util.math.ChunkPos;
 import net.minecraft.util.registry.DynamicRegistryManager;
-import net.minecraft.world.FeatureUpdater;
-import net.minecraft.world.PersistentStateManager;
-import net.minecraft.world.StructureWorldAccess;
-import net.minecraft.world.World;
+import net.minecraft.world.*;
 import net.minecraft.world.biome.Biome;
 import net.minecraft.world.dimension.DimensionType;
 import net.minecraft.world.gen.StructureAccessor;
@@ -81,9 +79,9 @@ class NBTStructureLoader {
         return this.legacyStructureDataUtil;
     }
 
-    private CompoundTag loadStructureStarts(int chunkX, int chunkZ) {
+    private NbtCompound loadStructureStarts(int chunkX, int chunkZ) {
         try {
-            CompoundTag compound = this.chunkLoader.readChunk(chunkX, chunkZ);
+            NbtCompound compound = this.chunkLoader.readChunk(chunkX, chunkZ);
             if (compound == null) return null;
             int dataVersion = compound.contains("DataVersion", 99) ? compound.getInt("DataVersion") : -1;
             if (dataVersion < 1493) {
@@ -102,12 +100,12 @@ class NBTStructureLoader {
 
         if (!loadedChunks.add(String.format("%s,%s", chunkX, chunkZ))) return;
 
-        CompoundTag structureStarts = loadStructureStarts(chunkX, chunkZ);
+        NbtCompound structureStarts = loadStructureStarts(chunkX, chunkZ);
         if (structureStarts == null || structureStarts.getSize() == 0) return;
 
         Map<String, StructureStart<?>> structureStartMap = new HashMap<>();
         for (String key : structureStarts.getKeys()) {
-            CompoundTag compound = structureStarts.getCompound(key);
+            NbtCompound compound = structureStarts.getCompound(key);
             if (compound.contains("BB")) {
                 structureStartMap.put(key, new SimpleStructureStart(compound));
             }
@@ -117,33 +115,31 @@ class NBTStructureLoader {
     }
 
     private static class SimpleStructureStart extends StructureStart<FeatureConfig> {
-        SimpleStructureStart(CompoundTag compound) {
+        SimpleStructureStart(NbtCompound compound) {
             super(null,
-                    0,
-                    0,
-                    new BlockBox(compound.getIntArray("BB")),
-                    0,
-                    0);
+                    null,
+                    0, 0);
 
-            ListTag children = compound.getList("Children", 10);
+            NbtList children = compound.getList("Children", 10);
             for (int index = 0; index < children.size(); ++index) {
-                CompoundTag child = children.getCompound(index);
+                NbtCompound child = children.getCompound(index);
                 if (child.contains("BB")) this.children.add(new SimpleStructurePiece(child));
             }
         }
 
         @Override
-        public void init(DynamicRegistryManager dynamicRegistryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, int i, int j, Biome biome, FeatureConfig featureConfig) {
+        public void init(DynamicRegistryManager registryManager, ChunkGenerator chunkGenerator, StructureManager manager, ChunkPos pos, Biome biome, FeatureConfig config, HeightLimitView world) {
+
         }
     }
 
     private static class SimpleStructurePiece extends StructurePiece {
-        SimpleStructurePiece(CompoundTag compound) {
+        SimpleStructurePiece(NbtCompound compound) {
             super(null, compound);
         }
 
         @Override
-        protected void toNbt(CompoundTag compoundTag) {
+        protected void writeNbt(ServerWorld world, NbtCompound nbt) {
 
         }
 
@@ -163,7 +159,7 @@ class NBTStructureLoader {
             this.regionFileCache = creator.apply(file, false);
         }
 
-        public CompoundTag readChunk(int chunkX, int chunkZ) throws IOException {
+        public NbtCompound readChunk(int chunkX, int chunkZ) throws IOException {
             if (regionFileCache == null) return null;
             return regionFileCache.getTagAt(new ChunkPos(chunkX, chunkZ));
         }
index f778d31c6420a2581e8fd77007dfc20fd5b53c85..ba54e38ded969164b00b5c675762ef85486c30b1 100644 (file)
@@ -12,10 +12,10 @@ import java.util.function.Function;
 
 public class TileEntitiesHelper {
     public static <T extends BlockEntity, S extends AbstractBoundingBox> Iterable<S> map(Class<T> clazz, Function<T, S> map) {
-        Collection<BlockEntity> tileEntities = MinecraftClient.getInstance().world.blockEntities;
+        //Collection<BlockEntity> tileEntities = MinecraftClient.getInstance().world.blockEntities;
 
         Set<S> results = new HashSet<>();
-        for (BlockEntity tileEntity : tileEntities) {
+        /*for (BlockEntity tileEntity : tileEntities) {
             T typed = TypeHelper.as(tileEntity, clazz);
             if (typed == null) {
                 continue;
@@ -24,7 +24,7 @@ public class TileEntitiesHelper {
             if (result != null) {
                 results.add(result);
             }
-        }
+        }*/
         return results;
     }
 }
index ffdb16fc45eec00998d64c9422511bf9239dcb39..0f43967ae22ffaf6618e7e9a1973768f807e7168 100644 (file)
@@ -1,6 +1,6 @@
 package com.irtimaled.bbor.client.keyboard;
 
-import net.minecraft.client.options.KeyBinding;
+import net.minecraft.client.option.KeyBinding;
 import net.minecraft.client.util.InputUtil;
 
 class CustomKeyBinding extends KeyBinding {
index 0039d75afd87d516ce9b8d96fb8bd4351723996c..0a7bd4107d92f133cefb6ca36eb5928e3d18fa0c 100644 (file)
@@ -1,7 +1,7 @@
 package com.irtimaled.bbor.client.keyboard;
 
 import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.options.KeyBinding;
+import net.minecraft.client.option.KeyBinding;
 import net.minecraft.client.util.InputUtil;
 import org.lwjgl.glfw.GLFW;
 
index 8b8cb0e31af28a0496d512a6e73e1e81c1fd10e6..8c9fb3fa359c762d68a494387ecf637cb0ddda90 100644 (file)
@@ -18,7 +18,7 @@ public class BeaconProvider implements IBoundingBoxProvider<BoundingBoxBeacon> {
     @Override
     public Iterable<BoundingBoxBeacon> get(DimensionId dimensionId) {
         return TileEntitiesHelper.map(BeaconBlockEntity.class, beacon -> {
-            int levels = beacon.getLevel();
+            int levels = beacon.getBeamSegments().size();
             Coords coords = new Coords(beacon.getPos());
             return BoundingBoxBeacon.from(coords, levels);
         });
index f21183aadace9d5172597179e8245d49413a840f..ecad189913e901b1d043131fe11f93221e9f1ec7 100644 (file)
@@ -1,8 +1,10 @@
 package com.irtimaled.bbor.client.renderers;
 
 import com.irtimaled.bbor.client.config.ConfigManager;
-import com.mojang.blaze3d.platform.GlStateManager;
+import com.mojang.blaze3d.systems.RenderSystem;
 import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.render.GameRenderer;
+import net.minecraft.util.Identifier;
 import org.lwjgl.opengl.GL11;
 
 public class RenderHelper {
@@ -11,36 +13,42 @@ public class RenderHelper {
     public static final int LINE_LOOP = GL11.GL_LINE_LOOP;
     public static final int POINTS = GL11.GL_POINTS;
 
+    //public static final VertexFormat.DrawMode CUSTOM = ReflectionHelper.getPrivateInstanceBuilder(VertexFormat.DrawMode.class,)
     public static void beforeRender() {
         enableBlend();
-        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+        RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
         lineWidth2();
         disableTexture();
-        GlStateManager.disableCull();
+        RenderSystem.disableCull();
         enableDepthTest();
 
         if (ConfigManager.alwaysVisible.get()) {
-            GlStateManager.clear(GL11.GL_DEPTH_BUFFER_BIT, MinecraftClient.IS_SYSTEM_MAC);
+            RenderSystem.clear(GL11.GL_DEPTH_BUFFER_BIT, MinecraftClient.IS_SYSTEM_MAC);
         }
     }
 
+    public static void setTexture(Identifier texture) {
+        RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
+        RenderSystem.setShaderTexture(0, texture);
+    }
+
     public static void afterRender() {
         polygonModeFill();
-        GlStateManager.enableCull();
+        RenderSystem.enableCull();
         enableTexture();
     }
 
     public static void beforeRenderFont(OffsetPoint offsetPoint) {
-        GlStateManager.pushMatrix();
+       // RenderSystem.pushMatrix();
         polygonModeFill();
-        GlStateManager.translated(offsetPoint.getX(), offsetPoint.getY() + 0.002D, offsetPoint.getZ());
-        GlStateManager.normal3f(0.0F, 1.0F, 0.0F);
-        GlStateManager.rotatef(0.0F, 0.0F, 1.0F, 0.0F);
-        GlStateManager.rotatef(90.0F, 1.0F, 0.0F, 0.0F);
-        GlStateManager.scalef(-0.0175F, -0.0175F, 0.0175F);
+        //RenderSystem.translated(offsetPoint.getX(), offsetPoint.getY() + 0.002D, offsetPoint.getZ());
+        //RenderSystem.normal3f(0.0F, 1.0F, 0.0F);
+        //RenderSystem.rotatef(0.0F, 0.0F, 1.0F, 0.0F);
+        //RenderSystem.rotatef(90.0F, 1.0F, 0.0F, 0.0F);
+        //RenderSystem.scalef(-0.0175F, -0.0175F, 0.0175F);
         enableTexture();
         enableBlend();
-        GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
+        RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
 
         depthMaskTrue();
     }
@@ -48,56 +56,52 @@ public class RenderHelper {
     public static void afterRenderFont() {
         disableTexture();
         disableBlend();
-        GlStateManager.popMatrix();
+        //RenderSystem.popMatrix();
         enableDepthTest();
     }
 
     public static void disableLighting() {
-        GlStateManager.disableLighting();
+        //RenderSystem.disableLighting();
     }
 
     public static void disableDepthTest() {
-        GlStateManager.disableDepthTest();
+        RenderSystem.disableDepthTest();
     }
 
     public static void enableDepthTest() {
-        GlStateManager.enableDepthTest();
-    }
-
-    public static void disableFog() {
-        GlStateManager.disableFog();
+        RenderSystem.enableDepthTest();
     }
 
     public static void disableBlend() {
-        GlStateManager.disableBlend();
+        RenderSystem.disableBlend();
     }
 
     public static void enableBlend() {
-        GlStateManager.enableBlend();
+        RenderSystem.enableBlend();
     }
 
     public static void disableAlphaTest() {
-        GlStateManager.disableAlphaTest();
+        //RenderSystem.disableAlphaTest();
     }
 
     public static void enableAlphaTest() {
-        GlStateManager.enableAlphaTest();
+        //RenderSystem.enableAlphaTest();
     }
 
     public static void disableTexture() {
-        GlStateManager.disableTexture();
+        RenderSystem.disableTexture();
     }
 
     public static void enableTexture() {
-        GlStateManager.enableTexture();
+        RenderSystem.enableTexture();
     }
 
     public static void shadeModelSmooth() {
-        GlStateManager.shadeModel(GL11.GL_SMOOTH);
+        //RenderSystem.shadeModel(GL11.GL_SMOOTH);
     }
 
     public static void shadeModelFlat() {
-        GlStateManager.shadeModel(GL11.GL_FLAT);
+        //RenderSystem.shadeModel(GL11.GL_FLAT);
     }
 
     public static void enablePointSmooth() {
@@ -105,27 +109,27 @@ public class RenderHelper {
     }
 
     public static void lineWidth2() {
-        GlStateManager.lineWidth(2f);
+        RenderSystem.lineWidth(2f);
     }
 
     public static void polygonModeLine() {
-        GlStateManager.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
+        RenderSystem.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
     }
 
     public static void polygonModeFill() {
-        GlStateManager.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
+        RenderSystem.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
     }
 
     public static void polygonOffsetMinusOne() {
-        GlStateManager.polygonOffset(-1.f, -1.f);
+        RenderSystem.polygonOffset(-1.f, -1.f);
     }
 
     public static void enablePolygonOffsetLine() {
-        GlStateManager.enableLineOffset();
+        //RenderSystem.enableLineOffset();
     }
 
     public static void depthMaskTrue() {
-        GlStateManager.depthMask(true);
+        RenderSystem.depthMask(true);
     }
 
     public static void pointSize5() {
@@ -133,14 +137,14 @@ public class RenderHelper {
     }
 
     public static void blendFuncGui() {
-        GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ZERO, GL11.GL_ONE);
+        RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ZERO, GL11.GL_ONE);
     }
 
     public static void depthFuncAlways() {
-        GlStateManager.depthFunc(GL11.GL_ALWAYS);
+        RenderSystem.depthFunc(GL11.GL_ALWAYS);
     }
 
     public static void depthFuncLessEqual() {
-        GlStateManager.depthFunc(GL11.GL_LEQUAL);
+        RenderSystem.depthFunc(GL11.GL_LEQUAL);
     }
 }
index 104eda470ad4b72c956e0ab4ed82ca5e1e7e1679..b5540004791c418ef36a4453053e15a50f1bfaf7 100644 (file)
@@ -12,23 +12,23 @@ public class Renderer {
     private final int glMode;
 
     static Renderer startLines() {
-        return new Renderer(RenderHelper.LINES, VertexFormats.POSITION_COLOR);
+        return new Renderer(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR);
     }
 
     static Renderer startLineLoop() {
-        return new Renderer(RenderHelper.LINE_LOOP, VertexFormats.POSITION_COLOR);
+        return new Renderer(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR);
     }
 
     static Renderer startQuads() {
-        return new Renderer(RenderHelper.QUADS, VertexFormats.POSITION_COLOR);
+        return new Renderer(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
     }
 
     static Renderer startPoints() {
-        return new Renderer(RenderHelper.POINTS, VertexFormats.POSITION_COLOR);
+        return new Renderer(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);
     }
 
     public static Renderer startTextured() {
-        return new Renderer(RenderHelper.QUADS, VertexFormats.POSITION_TEXTURE_COLOR);
+        return new Renderer(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR);
     }
 
     private static final Tessellator tessellator = new Tessellator(2097152);
@@ -39,9 +39,9 @@ public class Renderer {
     private int blue;
     private int alpha;
 
-    private Renderer(int glMode, VertexFormat vertexFormat) {
+    private Renderer(VertexFormat.DrawMode glMode, VertexFormat vertexFormat) {
         bufferBuilder.begin(glMode, vertexFormat);
-        this.glMode = glMode;
+        this.glMode = glMode.mode;
     }
 
     public Renderer setColor(Color color) {
@@ -90,7 +90,7 @@ public class Renderer {
 
     public void render() {
         if (glMode == RenderHelper.QUADS) {
-            bufferBuilder.sortQuads((float) Camera.getX(), (float) Camera.getY(), (float) Camera.getZ());
+            bufferBuilder.setCameraPosition((float) Camera.getX(), (float) Camera.getY(), (float) Camera.getZ());
         }
         tessellator.draw();
     }
index 86c7dba8f7694c4dba755cd088af36c15bb24d0c..29ba726df909f57699058e5c37df1515deb44b36 100644 (file)
@@ -27,7 +27,9 @@ class StructureProcessor {
     private void addStructures(BoundingBoxType type, StructureStart<?> structureStart) {
         if (structureStart == null) return;
 
-        BlockBox bb = structureStart.getBoundingBox();
+        if (structureStart.hasNoChildren()) return;
+
+        BlockBox bb = structureStart.setBoundingBoxFromChildren();
         if (bb == null) return;
 
         AbstractBoundingBox boundingBox = buildStructure(bb, type);
@@ -41,8 +43,8 @@ class StructureProcessor {
     }
 
     private AbstractBoundingBox buildStructure(BlockBox bb, BoundingBoxType type) {
-        Coords min = new Coords(bb.minX, bb.minY, bb.minZ);
-        Coords max = new Coords(bb.maxX, bb.maxY, bb.maxZ);
+        Coords min = new Coords(bb.getMinX(), bb.getMinY(), bb.getMinZ());
+        Coords max = new Coords(bb.getMaxX(), bb.getMaxY(), bb.getMaxZ());
         return BoundingBoxCuboid.from(min, max, type);
     }
 
index 21aebc1ebb827585b7f20f21f0f17ae97b63f8ef..1bf7448155c3d9e5fc382dcf5dda6584c06e1e33 100644 (file)
@@ -48,10 +48,10 @@ public class CommonInterop {
     }
 
     public static void playerLoggedOut(ServerPlayerEntity player) {
-        EventBus.publish(new PlayerLoggedOut(player.getEntityId()));
+        EventBus.publish(new PlayerLoggedOut(player.getId()));
     }
 
     public static void playerSubscribed(ServerPlayerEntity player) {
-        EventBus.publish(new PlayerSubscribed(player.getEntityId(), new ServerPlayer(player)));
+        EventBus.publish(new PlayerSubscribed(player.getId(), new ServerPlayer(player)));
     }
 }
index 96b81d2591284b15915a187e43ae0d13ce254ab3..fc3691a7d7718635c9d0b310eb0c1e371aa469f2 100644 (file)
@@ -2,8 +2,8 @@ package com.irtimaled.bbor.mixin.client;
 
 import com.irtimaled.bbor.client.ClientProxy;
 import com.irtimaled.bbor.client.keyboard.KeyListener;
-import net.minecraft.client.options.GameOptions;
-import net.minecraft.client.options.KeyBinding;
+import net.minecraft.client.option.GameOptions;
+import net.minecraft.client.option.KeyBinding;
 import org.apache.commons.lang3.ArrayUtils;
 import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
index bb03b7a20b8a704d4b7e6ebcf84736591dd970d2..3edd2126070bb97ba74c0daa53ea8ae6768f19a2 100644 (file)
@@ -1,31 +1,49 @@
 package com.irtimaled.bbor.mixin.client.gui.screen;
 
+import com.google.common.collect.Lists;
 import com.irtimaled.bbor.client.gui.SettingsScreenButton;
+import com.irtimaled.bbor.common.TypeHelper;
+import net.minecraft.client.gui.Drawable;
+import net.minecraft.client.gui.Element;
+import net.minecraft.client.gui.Selectable;
 import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.options.OptionsScreen;
-import net.minecraft.client.gui.widget.AbstractButtonWidget;
+import net.minecraft.client.gui.screen.option.OptionsScreen;
+import net.minecraft.client.gui.widget.ClickableWidget;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.injection.At;
 import org.spongepowered.asm.mixin.injection.Inject;
 import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
 
+import java.util.List;
+
 @Mixin(OptionsScreen.class)
 public class MixinOptionsScreen extends Screen {
     private MixinOptionsScreen() {
         super(null);
     }
 
+    private final List<ClickableWidget> buttons = Lists.newArrayList();
+
+    @Override
+    protected <T extends Element & Drawable & Selectable> T addDrawableChild(T drawableElement) {
+        ClickableWidget widget = TypeHelper.as(drawableElement, ClickableWidget.class);
+        if(widget != null) {
+            buttons.add(widget);
+        }
+
+        return super.addDrawableChild(drawableElement);
+    }
+
     @Inject(method = "init", at = @At("RETURN"))
     private void initGui(CallbackInfo ci) {
         //shuffle middle buttons up by 12 px to make space
         int top = this.height / 6 + 42;
         int bottom = this.height / 6 + 168;
-        for (AbstractButtonWidget button : buttons) {
+        for (ClickableWidget button : buttons) {
             if (button.y >= top && button.y < bottom)
                 button.y -= 12;
         }
         SettingsScreenButton button = new SettingsScreenButton(this.width / 2 - 155, top + 84, 150, "BBOR", this);
-        this.buttons.add(this.buttons.size() - 1, button);
-        this.children.add(this.children.size() - 1, button);
+        this.addDrawableChild(button);
     }
 }
index c539332b0bbff147eeb571046e181d4c3b0a237b..e0f63d01d95fa32ea29e834487f6bcc17d38b7e7 100644 (file)
@@ -1,7 +1,7 @@
 package com.irtimaled.bbor.mixin.client.settings;
 
 import com.irtimaled.bbor.client.keyboard.KeyListener;
-import net.minecraft.client.options.KeyBinding;
+import net.minecraft.client.option.KeyBinding;
 import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Shadow;
index cc99033713f8baa3edae519be6e04fb9a3319918..78f2dcec0e8c72f492df9bdb8e075a23e0d2aff2 100644 (file)
@@ -1,10 +1,7 @@
 package com.irtimaled.bbor.mixin.resource;
 
 import com.google.common.collect.ImmutableMap;
-import net.minecraft.resource.DefaultResourcePack;
-import net.minecraft.resource.ResourcePackManager;
-import net.minecraft.resource.ResourcePackProfile;
-import net.minecraft.resource.ResourcePackSource;
+import net.minecraft.resource.*;
 import org.spongepowered.asm.mixin.Final;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Shadow;
@@ -28,7 +25,7 @@ public class MixinResourcePackManager {
     private void afterConstructor(CallbackInfo ci) {
         resourcePackProfile = ResourcePackProfile.of(BBOR,
                 true,
-                () -> new DefaultResourcePack(BBOR),
+                () -> new DefaultResourcePack(VanillaDataPackProvider.DEFAULT_PACK_METADATA, BBOR),
                 this.profileFactory,
                 ResourcePackProfile.InsertionPosition.BOTTOM,
                 ResourcePackSource.PACK_SOURCE_BUILTIN);
index 340651ad319618c34356213c4862ee388f6a315a..f093cdcd6022c5105e00ede146419f56ddc7a5b3 100644 (file)
@@ -1,7 +1,7 @@
 {
   "required": true,
   "minVersion": "0.8",
-  "compatibilityLevel": "JAVA_8",
+  "compatibilityLevel": "JAVA_16",
   "target": "@env(DEFAULT)",
   "package": "com.irtimaled.bbor.mixin",
   "refmap": "mixins.bbor.refmap.json",