Skip to content

Commit

Permalink
Revert to 1.19.4
Browse files Browse the repository at this point in the history
(Can I please stop accidentally pushing new MC versions on old branches)
  • Loading branch information
Mrbysco committed Jun 26, 2023
1 parent 756bc56 commit 67aaabf
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 156 deletions.
10 changes: 3 additions & 7 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,31 @@ body:
- label: I am crashing and can provide my crash report(s)
- label: I am using the latest version of the mod
- type: input
id: loader-info
id: forge-info
attributes:
label: Loader version
placeholder: ex. Forge 36.2.0 / Fabric 0.14.12
description: Please be as specific as possible, latest is not a valid version
label: Forge version
placeholder: ex. 36.2.0
validations:
required: true
- type: input
id: minecraft-info
attributes:
label: Minecraft version
placeholder: ex. 1.16.5
description: Please be as specific as possible, latest is not a valid version
validations:
required: true
- type: input
id: mod-info
attributes:
label: Mod version
placeholder: ex. 0.0.1
description: Please be as specific as possible, latest is not a valid version
validations:
required: true
- type: input
id: java-info
attributes:
label: Java version
placeholder: ex. Java 8 update 51
description: Please be as specific as possible, latest is not a valid version
validations:
required: true
- type: textarea
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: ForgeArtifact
path: ./forge/build/libs/*.jar
path: ./Forge/build/libs/*.jar
- uses: actions/upload-artifact@v3
with:
name: FabricArtifact
path: ./fabric/build/libs/*.jar
path: ./Fabric/build/libs/*.jar
- name: Publish To Curseforge
if: contains(github.event.head_commit.message, '[publish]') || contains(github.event.head_commit.message, '[curseforge]')
env:
Expand Down
32 changes: 22 additions & 10 deletions Common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
plugins {
id 'idea'
id 'java'
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
id 'maven-publish'
id 'org.spongepowered.gradle.vanilla'
}

base {
archivesName = "${mod_name}-common-${minecraft_version}"
}
archivesBaseName = "${mod_name}-common-${minecraft_version}"

minecraft {
version(minecraft_version)
if (file("src/main/resources/${mod_id}.accesswidener").exists()) {
accessWideners(file("src/main/resources/${mod_id}.accesswidener"))
runs {
if (project.hasProperty('common_runs_enabled') ? project.findProperty('common_runs_enabled').toBoolean() : true) {

server(project.hasProperty('common_server_run_name') ? project.findProperty('common_server_run_name') : 'vanilla_server') {
workingDirectory(this.file("run"))
}
client(project.hasProperty('common_client_run_name') ? project.findProperty('common_client_run_name') : 'vanilla_client') {
workingDirectory(this.file("run"))
}
}
}
}

dependencies {
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.4'
}

processResources {
def buildProps = project.properties.clone()

filesMatching(['pack.mcmeta']) {
expand buildProps
}
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId base.archivesName.get()
artifactId project.archivesBaseName
version project.version
artifact jar
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.mrbysco.armorposer.client.gui;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mrbysco.armorposer.Reference;
import com.mrbysco.armorposer.client.gui.widgets.NumberFieldWidget;
import com.mrbysco.armorposer.client.gui.widgets.ToggleButton;
import com.mrbysco.armorposer.platform.Services;
import com.mrbysco.armorposer.util.ArmorStandData;
import net.minecraft.client.GameNarrator;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.EditBox;
import net.minecraft.client.gui.screens.Screen;
Expand Down Expand Up @@ -73,7 +73,7 @@ public void init() {
}

// rotation textbox
this.rotationTextField = new NumberFieldWidget(this.font, 1 + offsetX, 1 + offsetY + (this.toggleButtons.length * 22), 38, 17, Component.translatable("armorposer.gui.label.rotation"));
this.rotationTextField = new NumberFieldWidget(this.font, 1 + offsetX, 1 + offsetY + (this.toggleButtons.length * 22), 38, 17, Component.translatable("field.rotation"));
this.rotationTextField.setValue(String.valueOf((int) this.armorStandData.rotation));
this.rotationTextField.setMaxLength(4);
this.addWidget(this.rotationTextField);
Expand All @@ -88,7 +88,7 @@ public void init() {
int height = 17;
String value = String.valueOf((int) this.armorStandData.pose[i]);

this.poseTextFields[i] = new NumberFieldWidget(this.font, x, y, width, height, Component.literal(value));
this.poseTextFields[i] = new NumberFieldWidget(this.font, x, y, width, height, Component.translatable("field.%s", i));
this.poseTextFields[i].setValue(value);
this.poseTextFields[i].setMaxLength(4);
this.addWidget(this.poseTextFields[i]);
Expand Down Expand Up @@ -132,16 +132,16 @@ public void init() {
}

@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(guiGraphics);
public void render(PoseStack matrixStack, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(matrixStack);

// gui title
guiGraphics.drawCenteredString(this.font, Component.translatable("armorposer.gui.title"), this.width / 2, 20, 0xFFFFFF);
this.drawCenteredString(matrixStack, this.font, Component.translatable("armorposer.gui.title"), this.width / 2, 20, 0xFFFFFF);

// textboxes
this.rotationTextField.render(guiGraphics, mouseX, mouseY, partialTicks);
this.rotationTextField.render(matrixStack, mouseX, mouseY, partialTicks);
for (EditBox textField : this.poseTextFields)
textField.render(guiGraphics, mouseX, mouseY, partialTicks);
textField.render(matrixStack, mouseX, mouseY, partialTicks);

int offsetY = 50;

Expand All @@ -150,23 +150,23 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia
for (int i = 0; i < this.buttonLabels.length; i++) {
int x = offsetX;
int y = offsetY + (i * 22) + (10 - (this.font.lineHeight / 2));
guiGraphics.drawString(this.font, this.buttonLabels[i], x, y, 0xA0A0A0, false);
this.drawString(matrixStack, this.font, this.buttonLabels[i], x, y, 0xA0A0A0);
}

// right column labels
offsetX = this.width - 20 - 100;
// x, y, z
guiGraphics.drawString(this.font, "X", offsetX, 37, 0xA0A0A0, false);
guiGraphics.drawString(this.font, "Y", offsetX + (35), 37, 0xA0A0A0, false);
guiGraphics.drawString(this.font, "Z", offsetX + (2 * 35), 37, 0xA0A0A0, false);
this.drawString(matrixStack, this.font, "X", offsetX, 37, 0xA0A0A0);
this.drawString(matrixStack, this.font, "Y", offsetX + (35), 37, 0xA0A0A0);
this.drawString(matrixStack, this.font, "Z", offsetX + (2 * 35), 37, 0xA0A0A0);
// pose textboxes
for (int i = 0; i < this.sliderLabels.length; i++) {
int x = offsetX - this.font.width(this.sliderLabels[i]) - 10;
int y = offsetY + (i * 22) + (10 - (this.font.lineHeight / 2));
guiGraphics.drawString(this.font, this.sliderLabels[i], x, y, 0xA0A0A0, false);
this.drawString(matrixStack, this.font, this.sliderLabels[i], x, y, 0xA0A0A0);
}

super.render(guiGraphics, mouseX, mouseY, partialTicks);
super.render(matrixStack, mouseX, mouseY, partialTicks);
}

@Override
Expand Down
10 changes: 6 additions & 4 deletions Common/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"pack": {
"description": "${mod_name} resources",
"pack_format": 15
}
"pack": {
"description": "${mod_name} resources",
"pack_format": 13,
"forge:client_resources_pack_format": 13,
"forge:server_data_pack_format": 12
}
}
44 changes: 18 additions & 26 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
plugins {
id 'java'
id 'idea'
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'maven-publish'
id 'fabric-loom'
id 'com.matthewprenger.cursegradle'
id 'com.modrinth.minotaur'
id 'idea'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.modrinth.minotaur' version "2.+"
}

base {
archivesName = "${mod_name}-fabric-${minecraft_version}"
}
archivesBaseName = "${mod_name}-fabric-${minecraft_version}"

repositories {
maven {
Expand All @@ -28,7 +25,8 @@ dependencies {
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation project(":common")
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
implementation project(":Common")

modApi("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
Expand All @@ -37,12 +35,6 @@ dependencies {
}

loom {
if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) {
accessWidenerPath.set(project(":common").file("src/main/resources/${mod_id}.accesswidener"))
}
mixin {
defaultRefmapName.set("${mod_id}.refmap.json")
}
runs {
client {
client()
Expand All @@ -59,25 +51,25 @@ loom {
}
}

tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).configureEach {
source(project(":common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}

processResources {
from project(":common").sourceSets.main.resources
from project(":Common").sourceSets.main.resources
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

tasks.withType(JavaCompile) {
source(project(":Common").sourceSets.main.allSource)
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId base.archivesName.get()
artifactId project.archivesBaseName
version project.version
from components.java
}
Expand Down
6 changes: 2 additions & 4 deletions Fabric/src/main/java/com/mrbysco/armorposer/ArmorPoser.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.mrbysco.armorposer.config.PoserConfig;
import com.mrbysco.armorposer.handlers.EventHandler;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.ConfigHolder;
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.UseItemCallback;
Expand All @@ -16,18 +15,17 @@
import java.util.UUID;

public class ArmorPoser implements ModInitializer {
public static ConfigHolder<PoserConfig> config;

@Override
public void onInitialize() {
config = AutoConfig.register(PoserConfig.class, Toml4jConfigSerializer::new);
AutoConfig.register(PoserConfig.class, Toml4jConfigSerializer::new);

CommonClass.init();

UseItemCallback.EVENT.register((player, world, hand) -> EventHandler.onPlayerRightClickItem(player, hand));

ServerPlayNetworking.registerGlobalReceiver(Reference.SYNC_PACKET_ID, (server, player, handler, buf, responseSender) -> {
final ServerLevel world = player.serverLevel();
final ServerLevel world = player.getLevel();

UUID standUUID = buf.readUUID();
CompoundTag data = buf.readNbt();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.mrbysco.armorposer.handlers;

import com.mrbysco.armorposer.ArmorPoser;
import com.mrbysco.armorposer.Reference;
import com.mrbysco.armorposer.config.PoserConfig;
import me.shedaniel.autoconfig.AutoConfig;
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.network.FriendlyByteBuf;
Expand All @@ -22,9 +22,9 @@ public class EventHandler {

public static InteractionResult onPlayerEntityInteractSpecific(Player player, Entity target, InteractionHand hand) {
if (target instanceof ArmorStand armorstand) {
PoserConfig config = ArmorPoser.config.get();
PoserConfig config = AutoConfig.getConfigHolder(PoserConfig.class).getConfig();
if (config.general.enableConfigGui && player.isShiftKeyDown()) {
if (hand == InteractionHand.MAIN_HAND && !player.level().isClientSide) {
if (hand == InteractionHand.MAIN_HAND && !player.getLevel().isClientSide) {
FriendlyByteBuf buf = PacketByteBufs.create();
buf.writeInt(armorstand.getId());
ServerPlayNetworking.send((ServerPlayer) player, Reference.SCREEN_PACKET_ID, buf);
Expand All @@ -36,7 +36,7 @@ public static InteractionResult onPlayerEntityInteractSpecific(Player player, En
ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND);
if (!stack.isEmpty() && stack.getItem() == Items.NAME_TAG && stack.hasCustomHoverName()) {
cancelRightClick = true;
if (hand == InteractionHand.MAIN_HAND && !player.level().isClientSide) {
if (hand == InteractionHand.MAIN_HAND && !player.getLevel().isClientSide) {
armorstand.setCustomName(stack.getHoverName());
armorstand.setCustomNameVisible(true);
}
Expand Down
7 changes: 5 additions & 2 deletions Fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
"depends": {
"fabricloader": ">=0.14",
"fabric": "*",
"minecraft": "~1.20",
"minecraft": ">=1.19.4",
"java": ">=17",
"cloth-config": ">=11"
"cloth-config": ">=10"
},
"suggests": {
"another-mod": "*"
}
}

Loading

0 comments on commit 67aaabf

Please sign in to comment.