Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
loader_version=0.14.13
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.24


# Mod Properties
mod_version = 1.2.6
mod_version = 1.2.6_1.20.2
maven_group = net.entityoutliner
archives_base_name = entity-outliner



# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.73.0+1.19.3
modmenu_version=5.0.2
fabric_version=0.91.0+1.20.2
modmenu_version=7.0.1

12 changes: 3 additions & 9 deletions src/main/java/net/entityoutliner/ui/ColorWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import java.util.Map;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
import net.minecraft.client.gui.widget.PressableWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.text.Text;
Expand Down Expand Up @@ -43,16 +41,12 @@ public void onPress() {
EntitySelector.outlinedEntityTypes.put(this.entityType, this.color);
}

public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) {
MinecraftClient minecraftClient = MinecraftClient.getInstance();
public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) {
RenderSystem.setShaderTexture(0, TEXTURE);
RenderSystem.enableDepthTest();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA);
drawTexture(matrices, this.getX(), this.getY(), this.isFocused() ? 20.0F : 0.0F, this.color.ordinal() * 20, 20, 20, 40, 180);
this.renderBackground(matrices, minecraftClient, mouseX, mouseY);
context.drawTexture(TEXTURE, this.getX(), this.getY(), this.isFocused() ? 20.0F : 0.0F, this.color.ordinal() * 20, 20, 20, 40, 180);
}

public enum Color {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/net/entityoutliner/ui/EntityListWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.widget.CheckboxWidget;
Expand All @@ -20,6 +19,7 @@
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.Language;
import net.minecraft.client.gui.DrawContext;

@Environment(EnvType.CLIENT)
public class EntityListWidget extends ElementListWidget<EntityListWidget.Entry> {
Expand Down Expand Up @@ -74,13 +74,13 @@ public static EntityListWidget.EntityEntry create(EntityType<?> entityType, int
);
}

public void render(MatrixStack matrices, int i, int j, int k, int l, int m, int n, int o, boolean bl, float f) {
public void render(DrawContext context, int i, int j, int k, int l, int m, int n, int o, boolean bl, float f) {
this.checkbox.setY(j);
this.checkbox.render(matrices, n, o, f);
this.checkbox.render(context, n, o, f);

if (this.children.contains(this.color)) {
this.color.setY(j);
this.color.render(matrices, n, o, f);
this.color.render(context, n, o, f);
}
}

Expand Down Expand Up @@ -151,8 +151,8 @@ public static EntityListWidget.HeaderEntry create(SpawnGroup category, TextRende
return new EntityListWidget.HeaderEntry(category, font, width, height);
}

public void render(MatrixStack matrices, int i, int j, int k, int l, int m, int n, int o, boolean bl, float f) {
DrawableHelper.drawCenteredText(matrices, this.font, this.title, this.width / 2, j + (this.height / 2) - (this.font.fontHeight / 2), 16777215);
public void render(DrawContext context, int i, int j, int k, int l, int m, int n, int o, boolean bl, float f) {
context.drawCenteredTextWithShadow(this.font, this.title, this.width / 2, j + (this.height / 2) - (this.font.fontHeight / 2), 16777215);
}

public List<? extends Element> children() {
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/net/entityoutliner/ui/EntitySelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.text.Text;
// import net.minecraft.util.registry.Registry;
import net.minecraft.registry.Registries;
import net.minecraft.client.gui.DrawContext;

public class EntitySelector extends Screen {
protected final Screen parent;
Expand Down Expand Up @@ -235,23 +236,22 @@ public void removed() {
}

public void tick() {
this.searchField.tick();
//this.searchField.tick(); //WTF is it??
}

public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
// Render dirt background
this.renderBackground(matrices);
this.renderBackground(context, mouseX, mouseY, delta);

// Render scrolling list
this.list.render(matrices, mouseX, mouseY, delta);
this.list.render(context, mouseX, mouseY, delta);

// Render our search bar
this.setFocused(this.searchField);
this.searchField.setTextFieldFocused(true);
this.searchField.render(matrices, mouseX, mouseY, delta);
this.searchField.render(context, mouseX, mouseY, delta);

// Render buttons
super.render(matrices, mouseX, mouseY, delta);
super.render(context, mouseX, mouseY, delta);
}

// Sends mouseDragged event to the scrolling list
Expand Down
9 changes: 4 additions & 5 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@
],

"depends": {
"fabricloader": ">=0.7.4",
"fabric": "*",
"fabric-lifecycle-events-v1": "*",
"fabric-key-binding-api-v1": "*",
"minecraft": ">=1.19"
"fabricloader": ">=0.14.22",
"fabric-api": "*",
"minecraft": "1.20.2",
"java": ">=17"
},
"suggests": {
"flamingo": "*"
Expand Down