Skip to content

Commit

Permalink
Janky 1.20.5 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nea89o committed Apr 26, 2024
1 parent a496e3f commit e5f4ad3
Show file tree
Hide file tree
Showing 34 changed files with 15 additions and 1,729 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk 17
- name: setup jdk 21
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
java-version: 21
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.4.+'
id 'fabric-loom' version '1.6.+'
id 'maven-publish'
id 'checkstyle'
}
Expand Down Expand Up @@ -117,16 +117,16 @@ java {
withSourcesJar()
withJavadocJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

tasks.withType(JavaCompile) {
// 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
options.encoding = "UTF-8"
options.release.set 17
options.release.set 21
}

jar {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.1
loader_version=0.14.22
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10

# Mod Properties
mod_version = 9.2.2
mod_version = 9.2.3
maven_group = io.github.cottonmc
archives_base_name = LibGui

# Dependencies
fabric_version=0.89.2+1.20.2
fabric_version=0.97.6+1.20.5
jankson_version=6.0.0+j1.2.3
modmenu_version=8.0.0
modmenu_version=10.0.0-beta.1
libninepatch_version=1.2.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,6 @@ public ItemStack quickMove(PlayerEntity player, int index) {
/** WILL MODIFY toInsert! Returns true if anything was inserted. */
private boolean insertIntoExisting(ItemStack toInsert, Slot slot, PlayerEntity player) {
ItemStack curSlotStack = slot.getStack();
if (!curSlotStack.isEmpty() && ItemStack.canCombine(toInsert, curSlotStack) && slot.canInsert(toInsert)) {
int combinedAmount = curSlotStack.getCount() + toInsert.getCount();
int maxAmount = Math.min(toInsert.getMaxCount(), slot.getMaxItemCount(toInsert));
if (combinedAmount <= maxAmount) {
toInsert.setCount(0);
curSlotStack.setCount(combinedAmount);
slot.markDirty();
return true;
} else if (curSlotStack.getCount() < maxAmount) {
toInsert.decrement(maxAmount - curSlotStack.getCount());
curSlotStack.setCount(maxAmount);
slot.markDirty();
return true;
}
}
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,9 @@ public void send(Identifier message, Consumer<PacketByteBuf> writer) {
buf.writeVarInt(description.syncId);
buf.writeIdentifier(message);
writer.accept(buf);
description.getPacketSender().sendPacket(side == NetworkSide.SERVER ? SCREEN_MESSAGE_S2C : SCREEN_MESSAGE_C2S, buf);
}

public static void init() {
ServerPlayNetworking.registerGlobalReceiver(SCREEN_MESSAGE_C2S, (server, player, networkHandler, buf, responseSender) -> {
handle(server, player, buf);
});
}

public static void handle(Executor executor, PlayerEntity player, PacketByteBuf buf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ public class LibGuiClient implements ClientModInitializer {
public void onInitializeClient() {
config = loadConfig();

ClientPlayNetworking.registerGlobalReceiver(ScreenNetworkingImpl.SCREEN_MESSAGE_S2C, (client, networkHandler, buf, responseSender) -> {
ScreenNetworkingImpl.handle(client, client.player, buf);
});

LibGuiShaders.register();
Proxy.proxy = new ClientProxy();
}
Expand Down
9 changes: 2 additions & 7 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@
},
"mixins": ["mixins.libgui.json"],
"depends": {
"java": ">=17",
"fabricloader": ">=0.14.22",
"fabric-api-base": ">=0.4.4",
"fabric-lifecycle-events-v1": "^2.0.2",
"fabric-networking-api-v1": "^3.0.5",
"fabric-rendering-v1": "^3.0.6",
"java": ">=21",
"fabric-resource-loader-v0": "*",
"minecraft": ">=1.20.2",
"minecraft": ">=1.20.5",
"jankson": "^6.0.0",
"libninepatch": "^1.2.0"
},
Expand Down
37 changes: 0 additions & 37 deletions src/testMod/java/io/github/cottonmc/test/GuiBlock.java

This file was deleted.

43 changes: 0 additions & 43 deletions src/testMod/java/io/github/cottonmc/test/GuiBlockEntity.java

This file was deleted.

55 changes: 0 additions & 55 deletions src/testMod/java/io/github/cottonmc/test/GuiItem.java

This file was deleted.

Loading

0 comments on commit e5f4ad3

Please sign in to comment.