Skip to content

Commit

Permalink
Update to 1.21.3, reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita51bot committed Nov 19, 2024
1 parent 01a5e6d commit 47af00f
Show file tree
Hide file tree
Showing 35 changed files with 289 additions and 298 deletions.
15 changes: 8 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ loom {
config.setIdeConfigGenerated(true) // generate IDE tasks for running client, server and testmod, datagen if those are present
config.setRunDir("../../runs/${config.environment}") // use different run directory for all environments

if (config.getEnvironment() == "client") { // setting player properties from "./players/personal.properties" file
if (config.getEnvironment() == "client") {
// setting player properties from "./players/personal.properties" file
if (playerNickname != null && pathToSpongeMixin.toString() != "none") {
config.programArgs("--username", playerNickname.toString())
}
Expand Down Expand Up @@ -267,9 +268,9 @@ publishMods {
def isTesting = Boolean.parseBoolean(prop("test_publish)").toString())
def isServer = Boolean.parseBoolean(prop("is_for_server)").toString())
def versionName = "[${currentMultiVersion.toVersionRange()}] ${prop("mod_name")} v${prop("mod_version")}"
def bl = providers.environmentVariable("CURSEFORGE_API_KEY").getOrNull() == null
def bl2 = providers.environmentVariable("MODRINTH_API_KEY").getOrNull() == null
def bl3 = isTesting || bl || bl2
def curseForgeApiKeyIsPresent = providers.environmentVariable("CURSEFORGE_API_KEY").getOrNull() == null
def modrinthApiKeyIsPresent = providers.environmentVariable("MODRINTH_API_KEY").getOrNull() == null
def bl3 = isTesting || curseForgeApiKeyIsPresent || modrinthApiKeyIsPresent

println "[PublishMods] Configuring '${versionName}' for publishing"
displayName = versionName
Expand Down Expand Up @@ -395,7 +396,7 @@ UUID getUUID(Object uuid) {
int getJavaVersionAsInteger(String minecraftVersion) {
return stonecutter.compare("1.20.5", minecraftVersion) == 1 ?
stonecutter.compare("1.18", minecraftVersion) == 1 ?
stonecutter.compare("1.17", minecraftVersion) == 1 ?
stonecutter.compare("1.16.5", minecraftVersion) == 1 ?
8
:
16
Expand All @@ -416,7 +417,7 @@ Properties getPersonalProperties() {
for (line in personalPropertiesFile.readLines()) {
def key = "absolute_path_to_sponge_mixin"
if (line.startsWith(key)) {
def substring = line.substring(key.length()+1)
def substring = line.substring(key.length() + 1)
if (!substring.isEmpty()) {
personalProperties.setProperty(key, substring)
}
Expand All @@ -430,7 +431,7 @@ Properties getPersonalProperties() {
MultiVersion getCurrentMultiVersion(String minecraftVersion) {
def versions = prop("publication_versions").toString().split(" ")
for (version in versions) {
def split = version.substring(0, version.length()-1).split("\\[")
def split = version.substring(0, version.length() - 1).split("\\[")
def project = split[0]
if (project == minecraftVersion) {
def supportedVersionsString = split[1]
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lombok_version = 1.18.32

# Multi-Versions Properties
# Verified version: 1.20 1.20.1 1.20.2 1.20.3 1.20.4 1.20.5 1.20.6 1.21
multi_versions = 1.20.1 1.21 1.21.1 1.21.2 1.21.3
multi_versions = 1.16.5 1.17 1.17.1 1.18 1.18.1 1.18.2 1.19 1.19.1 1.19.2 1.19.3 1.19.4 1.20 1.20.1 1.20.3 1.20.4 1.20.5 1.20.6 1.21 1.21.1 1.21.2 1.21.3

# Build Dependencies
build.yarn = [VERSIONED]
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/lopymine/patpat/PatPat.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class PatPat implements ModInitializer {
@Getter
private static PatPatServerConfig config = PatPatServerConfig.getInstance();

public static void info(String text, Object... args) { // TODO
public static void info(String text, Object... args) {
//? >=1.17 {
LOGGER.info(text, args);
//?} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import lombok.Getter;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;

import com.mojang.datafixers.util.Either;
import com.mojang.serialization.Codec;
Expand All @@ -13,7 +12,6 @@
@Getter
public class SoundConfig {
public static final SoundConfig PATPAT_SOUND = new SoundConfig("patpat");
public static final SoundConfig LOPI_SOUND = new SoundConfig("lopi");

public static final Codec<SoundConfig> CODEC = RecordCodecBuilder.create(instance -> instance.group(
Codec.STRING.xmap(SoundUtils::getSoundEvent, SoundUtils::getTypeId).fieldOf("id").forGetter(SoundConfig::getSound),
Expand All @@ -32,7 +30,7 @@ public class SoundConfig {
return null;
}, soundConfig -> {
if ((soundConfig.getMinPitch() == 1.0F) && (soundConfig.getMaxPitch() == 1.0F) && (soundConfig.getVolume() == 1.0F)) {
return Either.right(soundConfig.getSound().id().toString());
return Either.right(soundConfig.getSound()./*? <1.21.2 {*//*getId()*//*?} else {*/id()/*?}*/.toString());
}
return Either.left(soundConfig);
});
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/net/lopymine/patpat/mixin/EntityRenderStateMixin.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.lopymine.patpat.mixin;

//? >=1.21.2 {
import net.lopymine.patpat.utils.mixin.EntityRenderStateWithParent;
import net.minecraft.client.render.entity.state.EntityRenderState;
import net.minecraft.entity.Entity;
Expand All @@ -9,31 +10,30 @@
@Mixin(EntityRenderState.class)
public class EntityRenderStateMixin implements EntityRenderStateWithParent {

@Unique
private Entity entity;
@Unique
private Entity entity;

@Unique
private float tickDelta;
@Unique
private float tickDelta;

@Override
public void patPat$setEntity(Entity entity) {
this.entity = entity;
}
@Override
public void patPat$setEntity(Entity entity) {
this.entity = entity;
}

@Override
public Entity patPat$getEntity() {
return this.entity;
}

@Override
public void patPat$setTickDelta(float tickDelta) {
this.tickDelta = tickDelta;
}

@Override
public float patPat$getTickDelta() {
return this.tickDelta;
}
@Override
public Entity patPat$getEntity() {
return this.entity;
}

@Override
public void patPat$setTickDelta(float tickDelta) {
this.tickDelta = tickDelta;
}

@Override
public float patPat$getTickDelta() {
return this.tickDelta;
}
}
//?}
Loading

0 comments on commit 47af00f

Please sign in to comment.