Skip to content

Commit

Permalink
1.21.1!
Browse files Browse the repository at this point in the history
  • Loading branch information
MerchantPug committed Oct 15, 2024
1 parent e322871 commit 469b7ae
Show file tree
Hide file tree
Showing 78 changed files with 2,711 additions and 116 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'

- uses: gradle/wrapper-validation-action@v1
- uses: gradle/actions/wrapper-validation@v4

- uses: gradle/[email protected]
- uses: gradle/actions/[email protected]
with:
arguments: clean build

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Apathy

Overconfigurable port/rewrite of Apathetic Mobs for ~~Fabric~~ Fabric and Forge ~~1.16~~ ~~1.17~~ ~~1.18~~ ~~1.18.2~~ ~~1.19.4~~ ~~1.18.2 again?~~ ~~1.18.2 and 1.19.4~~ ~~1.18.2 and 1.19.2 and 1.19.4~~ 1.16.5 (not forge) and 1.18.2 and 1.19.2 and 1.19.4. Are you happy yet.
Overconfigurable port/rewrite of Apathetic Mobs for ~~Fabric~~ Fabric and (Neo)Forge ~~1.16~~ ~~1.17~~ ~~1.18~~ ~~1.18.2~~ ~~1.19.4~~ ~~1.18.2 again?~~ ~~1.18.2 and 1.19.4~~ ~~1.18.2 and 1.19.2 and 1.19.4~~ ~~1.16.5 (not forge) and 1.18.2 and 1.19.2 and 1.19.4~~ 1.16.5 (not forge) and 1.18.2 and 1.19.2 and 1.19.4 and 1.20.1 and 1.21.1. Are you happy yet.

For documentation, view the `docs/2.x/` folder.

Expand All @@ -13,7 +13,7 @@ For documentation, view the `docs/2.x/` folder.
Versions prior to 2.5 were developed separately, one codebase per version. Maintaining that was difficult, so everything is now in a giant Gradle subproject. This is also unwieldy but in a different way - if you're having trouble fitting the damn thing into RAM, comment out a few subprojects from `settings.gradle`.

* `core` - Truly version-independent code, only depends on a (slightly old version of) google gson. Lowest-common-denominator code.
* `core-plus-minecraft-1.16.5-thru-1.20` - Code that depends on only the common subset of Minecraft 1.16.5, 1.18.2, 1.19.2, and 1.19.4 (using the [crossroad](https://github.com/CrackedPolishedBlackstoneBricksMC/crossroad) jar intersection tool).
* `core-plus-minecraft-1.16.5-thru-1.21.1` - Code that depends on only the common subset of Minecraft 1.16.5, 1.18.2, 1.19.2, 1.19.4, 1.20.1 and 1.21.1 (using the [crossroad](https://github.com/CrackedPolishedBlackstoneBricksMC/crossroad) jar intersection tool).
* `common-xxx` - Allows accessing Minecraft (through [minivan](https://github.com/CrackedPolishedBlackstoneBricksMC/minivan), formerly [VanillaGradle](https://github.com/SpongePowered/VanillaGradle)) and writing the code of mixins. Contains glue between the version-independent core and the Minecraft version in question.
* Technically `core-plus-minecraft` can also write mixins, but IDE support is weak; my intersection tool currently doesn't emit method bodies
* `fabric-xxx` and `forge-xxx` - Can refer to Minecraft as well as features from the specific modloader. This is generally just a tiny bit of glue code, initialization using modloader services, platform-specific mixins, blah blah.
Expand Down
8 changes: 4 additions & 4 deletions common-1.16.5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath "agency.highlysuspect:minivan:0.2"
classpath "agency.highlysuspect:minivan:0.5"
}
}

evaluationDependsOn(":core") // fuck gradle episode 151905105
evaluationDependsOn(":core-plus-minecraft-1.16.5-thru-1.20.1") // fuck gradle episode 151905105
evaluationDependsOn(":core-plus-minecraft-1.16.5-thru-1.21.1") // fuck gradle episode 151905105

apply plugin: "java"
apply plugin: "agency.highlysuspect.minivan"
Expand Down Expand Up @@ -41,12 +41,12 @@ dependencies {
compileOnly "org.jetbrains:annotations:24.0.1"

implementation project(":core")
implementation project(":core-plus-minecraft-1.16.5-thru-1.20.1")
implementation project(":core-plus-minecraft-1.16.5-thru-1.21.1")
}

processResources {
from project(":core").sourceSets.main.resources
from project(":core-plus-minecraft-1.16.5-thru-1.20.1").sourceSets.main.resources
from project(":core-plus-minecraft-1.16.5-thru-1.21.1").sourceSets.main.resources
}

tasks.withType(GenerateModuleMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,34 @@
import agency.highlysuspect.apathy.core.wrapper.DragonDuck;
import agency.highlysuspect.apathy.coreplusminecraft.ApathyPlusMinecraft;
import agency.highlysuspect.apathy.coreplusminecraft.PlayerSetManagerGuts;
import com.google.gson.JsonElement;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.critereon.LocationPredicate;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentUtils;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerAdvancements;
import net.minecraft.server.ServerAdvancementManager;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.Tag;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.Scoreboard;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
Expand Down Expand Up @@ -103,7 +113,52 @@ public void sendSuccess(CommandContext<CommandSourceStack> cmd, Supplier<Compone
public ServerLevel serverLevel(Entity ent) {
return (ServerLevel) ent.level;
}


@Override
public ResourceLocation resource(String str) {
return new ResourceLocation(str);
}

@Override
public ResourceKey<MobEffect> invisibilityResourceKey() {
return Registry.MOB_EFFECT.getResourceKey(MobEffects.INVISIBILITY).orElseThrow(RuntimeException::new);
}

@Override
public boolean hasEffect(LivingEntity entity, ResourceKey<MobEffect> effect) {
return entity.hasEffect(Registry.MOB_EFFECT.getOrThrow(effect));
}

@Override
public int getPlayerScore(Scoreboard scoreboard, Entity entity, Objective objective) {
return scoreboard.hasPlayerScore(entity.getScoreboardName(), objective) ? scoreboard.getOrCreatePlayerScore(entity.getScoreboardName(), objective).getScore() : 0;
}

@Override
public boolean isLocationPredicateAny(LocationPredicate predicate) {
return predicate == LocationPredicate.ANY;
}

@Override
public boolean doesAdvancementExist(ServerAdvancementManager manager, ResourceLocation id) {
return manager.getAdvancement(id) != null;
}

@Override
public boolean isAdvancementDone(PlayerAdvancements playerAdvancements, ServerAdvancementManager manager, ResourceLocation id) {
return playerAdvancements.getOrStartProgress(manager.getAdvancement(id)).isDone();
}

@Override
public JsonElement serializeLocationPredicate(LocationPredicate predicate) {
return predicate.serializeToJson();
}

@Override
public LocationPredicate deserializeLocationPredicate(JsonElement json) {
return LocationPredicate.fromJson(json);
}

public void noticePlayerAttack(Player player, Entity provoked) {
Level level = player.level;
if(level.isClientSide) return;
Expand Down
8 changes: 4 additions & 4 deletions common-1.18.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath "agency.highlysuspect:minivan:0.2"
classpath "agency.highlysuspect:minivan:0.5"
}
}

evaluationDependsOn(":core") // fuck gradle episode 151905105
evaluationDependsOn(":core-plus-minecraft-1.16.5-thru-1.20.1") // fuck gradle episode 151905105
evaluationDependsOn(":core-plus-minecraft-1.16.5-thru-1.21.1") // fuck gradle episode 151905105

apply plugin: "java"
apply plugin: "agency.highlysuspect.minivan"
Expand Down Expand Up @@ -40,12 +40,12 @@ dependencies {
compileOnly "org.jetbrains:annotations:24.0.1"

implementation project(":core")
implementation project(":core-plus-minecraft-1.16.5-thru-1.20.1")
implementation project(":core-plus-minecraft-1.16.5-thru-1.21.1")
}

processResources {
from project(":core").sourceSets.main.resources
from project(":core-plus-minecraft-1.16.5-thru-1.20.1").sourceSets.main.resources
from project(":core-plus-minecraft-1.16.5-thru-1.21.1").sourceSets.main.resources
}

tasks.withType(GenerateModuleMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,34 @@
import agency.highlysuspect.apathy.core.wrapper.DragonDuck;
import agency.highlysuspect.apathy.coreplusminecraft.ApathyPlusMinecraft;
import agency.highlysuspect.apathy.coreplusminecraft.PlayerSetManagerGuts;
import com.google.gson.JsonElement;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.critereon.LocationPredicate;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentUtils;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerAdvancements;
import net.minecraft.server.ServerAdvancementManager;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.TagKey;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.Scoreboard;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
Expand Down Expand Up @@ -101,7 +111,52 @@ public void sendSuccess(CommandContext<CommandSourceStack> cmd, Supplier<Compone
public ServerLevel serverLevel(Entity ent) {
return (ServerLevel) ent.level;
}


@Override
public ResourceLocation resource(String str) {
return new ResourceLocation(str);
}

@Override
public ResourceKey<MobEffect> invisibilityResourceKey() {
return Registry.MOB_EFFECT.getResourceKey(MobEffects.INVISIBILITY).orElseThrow(RuntimeException::new);
}

@Override
public boolean hasEffect(LivingEntity entity, ResourceKey<MobEffect> effect) {
return entity.hasEffect(Registry.MOB_EFFECT.getOrThrow(effect));
}

@Override
public int getPlayerScore(Scoreboard scoreboard, Entity entity, Objective objective) {
return scoreboard.hasPlayerScore(entity.getScoreboardName(), objective) ? scoreboard.getOrCreatePlayerScore(entity.getScoreboardName(), objective).getScore() : 0;
}

@Override
public boolean isLocationPredicateAny(LocationPredicate predicate) {
return predicate == LocationPredicate.ANY;
}

@Override
public boolean doesAdvancementExist(ServerAdvancementManager manager, ResourceLocation id) {
return manager.getAdvancement(id) != null;
}

@Override
public boolean isAdvancementDone(PlayerAdvancements playerAdvancements, ServerAdvancementManager manager, ResourceLocation id) {
return playerAdvancements.getOrStartProgress(manager.getAdvancement(id)).isDone();
}

@Override
public JsonElement serializeLocationPredicate(LocationPredicate predicate) {
return predicate.serializeToJson();
}

@Override
public LocationPredicate deserializeLocationPredicate(JsonElement json) {
return LocationPredicate.fromJson(json);
}

public void noticePlayerAttack(Player player, Entity provoked) {
Level level = player.level;
if(level.isClientSide) return;
Expand Down
6 changes: 3 additions & 3 deletions common-1.19.2-begrudgingly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath "agency.highlysuspect:minivan:0.2"
classpath "agency.highlysuspect:minivan:0.5"
}
}

Expand Down Expand Up @@ -37,12 +37,12 @@ dependencies {
compileOnly "org.jetbrains:annotations:24.0.1"

implementation project(":core")
implementation project(":core-plus-minecraft-1.16.5-thru-1.20.1")
implementation project(":core-plus-minecraft-1.16.5-thru-1.21.1")
}

processResources {
from project(":core").sourceSets.main.resources
from project(":core-plus-minecraft-1.16.5-thru-1.20.1").sourceSets.main.resources
from project(":core-plus-minecraft-1.16.5-thru-1.21.1").sourceSets.main.resources
}

tasks.withType(GenerateModuleMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,35 @@
import agency.highlysuspect.apathy.coreplusminecraft.ApathyPlusMinecraft;
import agency.highlysuspect.apathy.coreplusminecraft.MinecraftConv;
import agency.highlysuspect.apathy.coreplusminecraft.PlayerSetManagerGuts;
import com.google.gson.JsonElement;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.critereon.LocationPredicate;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentUtils;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerAdvancements;
import net.minecraft.server.ServerAdvancementManager;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.tags.TagKey;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.monster.warden.Warden;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.Scoreboard;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
Expand Down Expand Up @@ -105,7 +115,52 @@ public void sendSuccess(CommandContext<CommandSourceStack> cmd, Supplier<Compone
public ServerLevel serverLevel(Entity ent) {
return (ServerLevel) ent.level;
}


@Override
public ResourceLocation resource(String str) {
return new ResourceLocation(str);
}

@Override
public ResourceKey<MobEffect> invisibilityResourceKey() {
return Registry.MOB_EFFECT.getResourceKey(MobEffects.INVISIBILITY).orElseThrow(RuntimeException::new);
}

@Override
public boolean hasEffect(LivingEntity entity, ResourceKey<MobEffect> effect) {
return entity.hasEffect(Registry.MOB_EFFECT.getOrThrow(effect));
}

@Override
public int getPlayerScore(Scoreboard scoreboard, Entity entity, Objective objective) {
return scoreboard.hasPlayerScore(entity.getScoreboardName(), objective) ? scoreboard.getOrCreatePlayerScore(entity.getScoreboardName(), objective).getScore() : 0;
}

@Override
public boolean isLocationPredicateAny(LocationPredicate predicate) {
return predicate == LocationPredicate.ANY;
}

@Override
public boolean doesAdvancementExist(ServerAdvancementManager manager, ResourceLocation id) {
return manager.getAdvancement(id) != null;
}

@Override
public boolean isAdvancementDone(PlayerAdvancements playerAdvancements, ServerAdvancementManager manager, ResourceLocation id) {
return playerAdvancements.getOrStartProgress(manager.getAdvancement(id)).isDone();
}

@Override
public JsonElement serializeLocationPredicate(LocationPredicate predicate) {
return predicate.serializeToJson();
}

@Override
public LocationPredicate deserializeLocationPredicate(JsonElement json) {
return LocationPredicate.fromJson(json);
}

public void noticePlayerAttack(Player player, Entity provoked) {
Level level = player.level;
if(level.isClientSide) return;
Expand Down
Loading

0 comments on commit 469b7ae

Please sign in to comment.