Skip to content

Commit

Permalink
chore: add support for 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
OptiJava committed Aug 5, 2024
1 parent 3a2b644 commit cada8b6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ preprocess {
def mc1193 = createNode('1.19.3' , 1_19_03, 'yarn')
def mc1201 = createNode('1.20.1' , 1_20_01, 'yarn')
def mc1204 = createNode('1.20.4' , 1_20_04, 'yarn')
def mc1210 = createNode('1.21' , 1_21, 'yarn')
def mc1210 = createNode('1.21' , 1_21_00, 'yarn')

mc117 .link(mc118, null)
mc118 .link(mc1193, null)
Expand Down
6 changes: 4 additions & 2 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ version = simple_version + '-' + project.minecraft_version

group = project.maven_group


if (project.mcVersion >= 11800) {
if (mcVersion >= 12005) {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
} else if (project.mcVersion >= 11800) {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
} else if (project.mcVersion >= 11700) {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Gradle Configurations
org.gradle.jvmargs=-Xmx3g
org.gradle.jvmargs=-Xmx2560M
org.gradle.parallel=true

# Fabric Configurations
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ public void injectOnDeath(DamageSource source, CallbackInfo ci) {
if (OptCarpetSettings.removeAllCurseOfBindingArmorWhenPlayerDeadInWall && ((ServerPlayerEntity) (Object)this).world.getGameRules().getBoolean(GameRules.KEEP_INVENTORY) && Objects.equals(source.getName(), "inWall")) {
//#endif
for (ItemStack armor : ((ServerPlayerEntity) (Object)this).getArmorItems()) {
//#if MC >= 12100
//$$ if (EnchantmentHelper.hasAnyEnchantmentsWith(armor, net.minecraft.component.EnchantmentEffectComponentTypes.PREVENT_EQUIPMENT_DROP)) {
//$$ armor.setCount(0);
//$$ }
//#else
if (EnchantmentHelper.getLevel(Enchantments.BINDING_CURSE, armor) > 0) {
armor.setCount(0);
}
//#endif
}
}
}
Expand Down

0 comments on commit cada8b6

Please sign in to comment.