}
}
dependencies {
- classpath "net.fabricmc:fabric-loom:0.2.7-SNAPSHOT"
+ classpath "net.fabricmc:fabric-loom:0.8-SNAPSHOT"
}
}
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 {
}
}
+java {
+ toolchain {
+ languageVersion = JavaLanguageVersion.of(16)
+ }
+ withSourcesJar()
+}
+
jar {
manifest {
attributes([
name=bbor
buildVersion=2.4
# leave a space to reduce merge conflicts on version change
-mcVersion=1.16.3
+mcVersion=1.17.1
#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
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;
}
@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);
}
public void clearFocus() {
this.setFocused(false);
}
+
+ @Override
+ public void appendNarrations(NarrationMessageBuilder builder) {
+ }
}
@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);
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;
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;
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;
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;
}
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)
}
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)
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;
}
};
- 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);
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);
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;
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;
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) {
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));
}
}
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) {
}
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));
}
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;
if (result != null) {
results.add(result);
}
- }
+ }*/
return results;
}
}
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 {
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;
@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);
});
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 {
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();
}
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() {
}
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() {
}
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);
}
}
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);
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) {
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();
}
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);
}
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);
}
}
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)));
}
}
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;
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);
}
}
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;
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;
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);
{
"required": true,
"minVersion": "0.8",
- "compatibilityLevel": "JAVA_8",
+ "compatibilityLevel": "JAVA_16",
"target": "@env(DEFAULT)",
"package": "com.irtimaled.bbor.mixin",
"refmap": "mixins.bbor.refmap.json",