forked from virt-mirrors/Sit
Compare commits
19 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f774802d69 | ||
![]() |
2c4dc72f42 | ||
![]() |
65431280a3 | ||
![]() |
2e7967699e | ||
![]() |
a971fa9926 | ||
![]() |
b5eaf3df7a | ||
![]() |
41abc4d361 | ||
![]() |
a9399fcbf9 | ||
![]() |
08788456b2 | ||
![]() |
fda08029bb | ||
![]() |
2b661a0fa8 | ||
![]() |
32a4b0006a | ||
![]() |
8b7b3d39ec | ||
![]() |
78f7d81d93 | ||
![]() |
77f59e7b6a | ||
![]() |
7bf178a1d2 | ||
![]() |
32356d0c6d | ||
![]() |
ada03ba40e | ||
![]() |
a7b70323e4 |
9 changed files with 26 additions and 31 deletions
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '1.8-SNAPSHOT'
|
id 'fabric-loom' version '1.10-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'com.modrinth.minotaur' version '2.+'
|
id 'com.modrinth.minotaur' version '2.+'
|
||||||
id 'net.darkhax.curseforgegradle' version '1.1.+'
|
id 'net.darkhax.curseforgegradle' version '1.1.+'
|
||||||
|
@ -14,8 +14,8 @@ base {
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://maven.terraformersmc.com/releases/" }
|
maven { url = "https://maven.terraformersmc.com/releases/" }
|
||||||
maven { url "https://maven.isxander.dev/releases" }
|
maven { url = "https://maven.isxander.dev/releases" }
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
|
@ -33,7 +33,7 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
filteringCharset "UTF-8"
|
filteringCharset = "UTF-8"
|
||||||
|
|
||||||
var replaceProperties = [
|
var replaceProperties = [
|
||||||
version : project.version,
|
version : project.version,
|
||||||
|
|
|
@ -4,16 +4,16 @@ org.gradle.parallel=true
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/develop
|
# check these on https://fabricmc.net/develop
|
||||||
min_minecraft_version=1.21.4
|
min_minecraft_version=1.20.6
|
||||||
minecraft_version=1.21.4
|
minecraft_version=1.20.6
|
||||||
yarn_mappings=1.21.4+build.8
|
yarn_mappings=1.20.6+build.3
|
||||||
loader_version=0.16.10
|
loader_version=0.15.11
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.2.3+1.21.4
|
mod_version=1.2.3+1.20.6
|
||||||
maven_group=one.oth3r
|
maven_group=one.oth3r
|
||||||
file_name=sit!
|
file_name=sit!
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.116.1+1.21.4
|
fabric_version=0.100.4+1.20.6
|
||||||
modmenu_version=13.0.0-beta.1
|
modmenu_version=10.0.0-beta.1
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class CustomBlock {
|
||||||
for (String tag : blockTags) {
|
for (String tag : blockTags) {
|
||||||
// substring to remove # and if needed, !
|
// substring to remove # and if needed, !
|
||||||
// if there is a math for the NOT(!) tag, return false
|
// if there is a math for the NOT(!) tag, return false
|
||||||
if (tag.startsWith("!") && blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.of(tag.substring(2))))) return false;
|
if (tag.startsWith("!") && blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), new Identifier(tag.substring(2))))) return false;
|
||||||
// if there is a match, return true
|
// if there is a match, return true
|
||||||
if (blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.tryParse(tag.substring(1))))) tagCheck = true;
|
if (blockState.isIn(TagKey.of(Registries.BLOCK.getKey(), Identifier.tryParse(tag.substring(1))))) tagCheck = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,10 +53,10 @@ public class CustomItem {
|
||||||
// if a NOT tag
|
// if a NOT tag
|
||||||
if (tag.startsWith("!")) {
|
if (tag.startsWith("!")) {
|
||||||
// if there is a math for the NOT(!) tag, return false
|
// if there is a math for the NOT(!) tag, return false
|
||||||
if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), Identifier.of(tag.substring(2))))) return false;
|
if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), new Identifier(tag.substring(2))))) return false;
|
||||||
}
|
}
|
||||||
// else (normal tag), if there is a match, set tagCheck to true
|
// else (normal tag), if there is a match, set tagCheck to true
|
||||||
else if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), Identifier.of(tag.substring(1))))) tagCheck = true;
|
else if (itemStack.isIn(TagKey.of(Registries.ITEM.getKey(), new Identifier(tag.substring(1))))) tagCheck = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// not returning true in the loop because there might be a (!) not tag that the item might fall into, after the item was already in another tag
|
// not returning true in the loop because there might be a (!) not tag that the item might fall into, after the item was already in another tag
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.tooltip.Tooltip;
|
import net.minecraft.client.gui.tooltip.Tooltip;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
import net.minecraft.client.render.RenderLayer;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
@ -21,10 +20,12 @@ public class ClickableImageWidget extends ButtonWidget {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
protected void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
|
context.setShaderColor(1.0f, 1.0f, 1.0f, this.alpha);
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.enableDepthTest();
|
RenderSystem.enableDepthTest();
|
||||||
context.drawTexture(RenderLayer::getGuiTextured, image,
|
context.drawTexture(image,
|
||||||
this.getX(), this.getY(), 0.0f, 0.0f, this.getWidth(), this.getHeight(), this.getWidth(), this.getHeight());
|
this.getX(), this.getY(), 0.0f, 0.0f, this.getWidth(), this.getHeight(), this.getWidth(), this.getHeight());
|
||||||
|
context.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,11 @@ import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
|
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
import net.minecraft.client.render.RenderLayer;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.math.ColorHelper;
|
|
||||||
import one.oth3r.sit.file.FileData;
|
import one.oth3r.sit.file.FileData;
|
||||||
import one.oth3r.sit.utl.Data;
|
import one.oth3r.sit.utl.Data;
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
public class ConfigScreen extends Screen {
|
public class ConfigScreen extends Screen {
|
||||||
protected final Screen parent;
|
protected final Screen parent;
|
||||||
|
|
||||||
|
@ -38,13 +34,13 @@ public class ConfigScreen extends Screen {
|
||||||
|
|
||||||
|
|
||||||
TextureButtonWidget issuesButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.issues"),
|
TextureButtonWidget issuesButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.issues"),
|
||||||
ConfirmLinkScreen.opening(this, URI.create("https://github.com/Oth3r/Sit/issues")), true)
|
ConfirmLinkScreen.opening(this, "https://github.com/Oth3r/Sit/issues"), true)
|
||||||
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "issues"), 15, 15).build());
|
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "issues"), 15, 15).build());
|
||||||
issuesButton.setPosition(this.width / 2 - 125, startY + 72 + 12);
|
issuesButton.setPosition(this.width / 2 - 125, startY + 72 + 12);
|
||||||
|
|
||||||
|
|
||||||
this.addDrawableChild(ButtonWidget.builder(Text.translatable("sit!.gui.button.website"),
|
this.addDrawableChild(ButtonWidget.builder(Text.translatable("sit!.gui.button.website"),
|
||||||
ConfirmLinkScreen.opening(this, URI.create("https://modrinth.com/mod/sit!"))
|
ConfirmLinkScreen.opening(this, "https://modrinth.com/mod/sit!")
|
||||||
).dimensions(this.width / 2 - 100, startY + 72 + 12, 98, 20).build());
|
).dimensions(this.width / 2 - 100, startY + 72 + 12, 98, 20).build());
|
||||||
|
|
||||||
this.addDrawableChild(ButtonWidget.builder(Text.translatable("gui.done"), (button) -> {
|
this.addDrawableChild(ButtonWidget.builder(Text.translatable("gui.done"), (button) -> {
|
||||||
|
@ -52,7 +48,7 @@ public class ConfigScreen extends Screen {
|
||||||
}).dimensions(this.width / 2 + 2, startY + 72 + 12, 98, 20).build());
|
}).dimensions(this.width / 2 + 2, startY + 72 + 12, 98, 20).build());
|
||||||
|
|
||||||
TextureButtonWidget donateButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.donate"),
|
TextureButtonWidget donateButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.donate"),
|
||||||
ConfirmLinkScreen.opening(this, URI.create("https://Ko-fi.com/oth3r")), true)
|
ConfirmLinkScreen.opening(this, "https://Ko-fi.com/oth3r"), true)
|
||||||
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "donate"), 15, 15).build());
|
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "donate"), 15, 15).build());
|
||||||
donateButton.setPosition(this.width / 2 + 105, startY + 72 + 12);
|
donateButton.setPosition(this.width / 2 + 105, startY + 72 + 12);
|
||||||
}
|
}
|
||||||
|
@ -73,8 +69,8 @@ public class ConfigScreen extends Screen {
|
||||||
private void renderBanner(DrawContext context, int x, int y, float alpha) {
|
private void renderBanner(DrawContext context, int x, int y, float alpha) {
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
|
|
||||||
context.drawTexture(RenderLayer::getGuiTextured,Identifier.of(Data.MOD_ID, "textures/gui/banner.png"),
|
context.drawTexture(Identifier.of(Data.MOD_ID, "textures/gui/banner.png"),
|
||||||
x, y, 0.0f, 0.0f, 128, 72, 128, 72, ColorHelper.getWhite(alpha));
|
x, y, 0.0f, 0.0f, 128, 72, 128, 72);
|
||||||
|
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import net.minecraft.client.font.TextRenderer;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.tooltip.Tooltip;
|
import net.minecraft.client.gui.tooltip.Tooltip;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
import net.minecraft.client.render.RenderLayer;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
@ -30,7 +29,7 @@ public class TextureButtonWidget extends ButtonWidget {
|
||||||
super.renderWidget(context, mouseX, mouseY, delta);
|
super.renderWidget(context, mouseX, mouseY, delta);
|
||||||
int x = this.getX() + this.getWidth() / 2 - this.textureWidth / 2;
|
int x = this.getX() + this.getWidth() / 2 - this.textureWidth / 2;
|
||||||
int y = this.getY() + this.getHeight() / 2 - this.textureHeight / 2;
|
int y = this.getY() + this.getHeight() / 2 - this.textureHeight / 2;
|
||||||
context.drawGuiTexture(RenderLayer::getGuiTextured, this.texture, x, y, this.textureWidth, this.textureHeight);
|
context.drawGuiTexture(this.texture, x, y, this.textureWidth, this.textureHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class UnderConstructionScreen<T extends CustomFile<T>> extends Screen {
|
||||||
protected void init() {
|
protected void init() {
|
||||||
int startY = this.height / 5-4;
|
int startY = this.height / 5-4;
|
||||||
ButtonWidget foxPNG = this.addDrawableChild(new ClickableImageWidget(70,70,140,140, Tooltip.of(Text.of("Art by @bunnestbun")),
|
ButtonWidget foxPNG = this.addDrawableChild(new ClickableImageWidget(70,70,140,140, Tooltip.of(Text.of("Art by @bunnestbun")),
|
||||||
Identifier.of(Data.MOD_ID, "textures/gui/fox.png"), ConfirmLinkScreen.opening(this, URI.create("https://www.instagram.com/bunnestbun/"))));
|
Identifier.of(Data.MOD_ID, "textures/gui/fox.png"), ConfirmLinkScreen.opening(this, "https://www.instagram.com/bunnestbun/")));
|
||||||
foxPNG.setPosition(this.width / 2 - (foxPNG.getWidth()/2), startY-35);
|
foxPNG.setPosition(this.width / 2 - (foxPNG.getWidth()/2), startY-35);
|
||||||
|
|
||||||
ButtonWidget openFileButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.file"),
|
ButtonWidget openFileButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.file"),
|
||||||
|
@ -38,7 +38,7 @@ public class UnderConstructionScreen<T extends CustomFile<T>> extends Screen {
|
||||||
openFileButton.setPosition(this.width / 2 - 70, startY+110);
|
openFileButton.setPosition(this.width / 2 - 70, startY+110);
|
||||||
|
|
||||||
TextureButtonWidget folderButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.folder"),
|
TextureButtonWidget folderButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.folder"),
|
||||||
(button) -> Util.getOperatingSystem().open(Paths.get(this.file.getFile().getParent())), true)
|
(button) -> Util.getOperatingSystem().open(this.file.getFile().getParent()), true)
|
||||||
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "folder"), 15, 15).build());
|
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "folder"), 15, 15).build());
|
||||||
folderButton.setPosition(this.width / 2 + 50, startY + 110);
|
folderButton.setPosition(this.width / 2 + 50, startY + 110);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ import net.minecraft.entity.decoration.DisplayEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.consume.UseAction;
|
|
||||||
import net.minecraft.registry.Registries;
|
import net.minecraft.registry.Registries;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
@ -322,7 +321,7 @@ public class Utl {
|
||||||
player.sendMessage(messageTag().append(Utl.lang("sit!.chat.purged",Utl.lang("sit!.chat.purged.total",count).styled(
|
player.sendMessage(messageTag().append(Utl.lang("sit!.chat.purged",Utl.lang("sit!.chat.purged.total",count).styled(
|
||||||
style -> style.withColor(Colors.LIGHT_GRAY).withItalic(true)
|
style -> style.withColor(Colors.LIGHT_GRAY).withItalic(true)
|
||||||
)).styled(
|
)).styled(
|
||||||
style -> style.withColor(Colors.GREEN)
|
style -> style.withColor(Formatting.GREEN)
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue