Skip to content

Commit

Permalink
Merge pull request #196
Browse files Browse the repository at this point in the history
v5.2.2+1.20.6
  • Loading branch information
skycatminepokie authored Jun 27, 2024
2 parents 05ecdc1 + 468eb82 commit 214ec6f
Show file tree
Hide file tree
Showing 40 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: 17
java-version: 21

- name: Make Gradle Wrapper Executable
if: ${{ runner.os != 'Windows' }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ on:
- closed
branches:
- master
- 1_20_2
workflow_dispatch:

env:
MINECRAFT_VERSION: 1.20.6
MINECRAFT_VERSION: 1.21
JAVA_VERSION: 21
VERSION: 5.2.2+1.20.6
VERSION: 5.2.2+1.21
VERSION_TYPE: beta

permissions:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
}

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

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11

# Mod Properties
mod_version=5.2.2+1.20.6
mod_version=5.2.2+1.21
maven_group=com.skycat
archives_base_name=mystical
modid=mystical

# Dependencies
fabric_version=0.98.0+1.20.6
fabric_version=0.100.3+1.21
# https://maven.wispforest.io/io/wispforest/owo-lib/
owo_version=0.12.8+1.20.5
server_translations_version=2.3.0+1.20.5-rc2
owo_version=0.12.10+1.21
server_translations_version=2.3.1+1.21-pre2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.StatusEffectSpriteManager;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -22,7 +23,7 @@
public abstract class InGameHudMixin {

@Inject(method = "renderStatusEffectOverlay", at = @At(value = "INVOKE", target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V", shift = At.Shift.BEFORE))
private void mystical_renderFakeStatusEffects(DrawContext context, float tickDelta, CallbackInfo ci, @Local(ordinal = 0) int beneficialEffects, @Local(ordinal = 1) int harmfulEffects, @Local(ordinal = 0) List<Runnable> list) {
private void mystical_renderFakeStatusEffects(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci, @Local(ordinal = 0) int beneficialEffects, @Local(ordinal = 1) int harmfulEffects, @Local(ordinal = 0) List<Runnable> list) {
// Adapted from original method
StatusEffectSpriteManager spriteManager = MinecraftClient.getInstance().getStatusEffectSpriteManager();
for (Spell spell : MysticalClient.HUD_MANAGER.getCachedSpells()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/skycat/mystical/MysticalCriteria.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class MysticalCriteria {
public static final MakeHavenCriterion MAKE_HAVEN_CRITERION = Criteria.register(MakeHavenCriterion.ID.toTranslationKey(), new MakeHavenCriterion());
public static final SpellCuredCriterion SPELL_CURED_CRITERION = Criteria.register(SpellCuredCriterion.ID.toTranslationKey(), new SpellCuredCriterion());
public static final @NotNull Identifier PREVENTED_BREAKING_CRITERION_ID = Objects.requireNonNull(Identifier.of(Mystical.MOD_ID, "prevented_breaking"));
public static final @NotNull Identifier PREVENTED_BREAKING_CRITERION_ID = Objects.requireNonNull(Identifier.tryParse(Mystical.MOD_ID, "prevented_breaking"));
public static final ItemCriterion PREVENTED_BREAKING_CRITERION = Criteria.register(PREVENTED_BREAKING_CRITERION_ID.toTranslationKey(), new ItemCriterion());
public static void init() {}
}
14 changes: 7 additions & 7 deletions src/main/java/com/skycat/mystical/MysticalTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import net.minecraft.util.Identifier;

public class MysticalTags {
public static final TagKey<EntityType<?>> BOSSES = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "bosses"));
public static final TagKey<EntityType<?>> ZOMBIE_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "zombie_variants"));
public static final TagKey<EntityType<?>> SKELETON_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "skeleton_variants"));
public static final TagKey<EntityType<?>> ENDERMAN_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "enderman_variants"));
public static final TagKey<EntityType<?>> EVOKER_SUMMONABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "evoker_summonable"));
public static final TagKey<EntityType<?>> RANDOM_EGG_SPAWNABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier(Mystical.MOD_ID, "random_egg_spawnable"));
public static final TagKey<Block> GLAZED_TERRACOTTA = TagKey.of(RegistryKeys.BLOCK, new Identifier(Mystical.MOD_ID, "glazed_terracotta"));
public static final TagKey<EntityType<?>> BOSSES = TagKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(Mystical.MOD_ID, "bosses"));
public static final TagKey<EntityType<?>> ZOMBIE_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(Mystical.MOD_ID, "zombie_variants"));
public static final TagKey<EntityType<?>> SKELETON_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(Mystical.MOD_ID, "skeleton_variants"));
public static final TagKey<EntityType<?>> ENDERMAN_VARIANTS = TagKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(Mystical.MOD_ID, "enderman_variants"));
public static final TagKey<EntityType<?>> EVOKER_SUMMONABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(Mystical.MOD_ID, "evoker_summonable"));
public static final TagKey<EntityType<?>> RANDOM_EGG_SPAWNABLE = TagKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(Mystical.MOD_ID, "random_egg_spawnable"));
public static final TagKey<Block> GLAZED_TERRACOTTA = TagKey.of(RegistryKeys.BLOCK, Identifier.of(Mystical.MOD_ID, "glazed_terracotta"));
public static void init() {}
}
1 change: 1 addition & 0 deletions src/main/java/com/skycat/mystical/SaveState.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mojang.serialization.codecs.RecordCodecBuilder;
import com.skycat.mystical.spell.SpellHandler;
import com.skycat.mystical.util.Utils;
import java.util.Optional;
import net.minecraft.datafixer.DataFixTypes;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtOps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.Optional;

public class MakeHavenCriterion extends AbstractCriterion<MakeHavenCriterion.Conditions> {
public static final @NotNull Identifier ID = Objects.requireNonNull(Identifier.of("mystical", "make_haven"));
public static final @NotNull Identifier ID = Objects.requireNonNull(Identifier.tryParse("mystical", "make_haven"));

@Override
public Codec<MakeHavenCriterion.Conditions> getConditionsCodec() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.Optional;

public class SpellCuredCriterion extends AbstractCriterion<SpellCuredCriterion.Conditions> {
public static final @NotNull Identifier ID = Objects.requireNonNull(Identifier.of("mystical", "spell_cured")); // TODO: Figure out where this goes
public static final @NotNull Identifier ID = Objects.requireNonNull(Identifier.tryParse("mystical", "spell_cured")); // TODO: Figure out where this goes

@Override
public Codec<com.skycat.mystical.advancement.SpellCuredCriterion.Conditions> getConditionsCodec() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected static int newRandomSpellCommand(CommandContext<ServerCommandSource> c
protected static int newSpellCommand(CommandContext<ServerCommandSource> context) {
String spell = context.getArgument("spell", String.class);
Utils.log(Utils.translateString("text.mystical.logging.newSpellCommand"), Mystical.CONFIG.newSpellCommandLogLevel());
ConsequenceFactory<?> factory = Spells.getShortNameToFactory().get(spell);
ConsequenceFactory<?> factory = Spells.getShortNameToFactory().get(spell); // TODO: if spell null, error
if (factory.getWeight() == 0) {
context.getSource().sendFeedback(Utils.translatableSupplier("text.mystical.command.mystical.spell.new.spell.warnDisabled"), false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void generateAdvancement(RegistryWrapper.WrapperLookup wrapperLookup, Con
Items.DRAGON_BREATH,
Utils.translatable(EnglishLangProvider.getKeyForAdvancementTranslation(CURE_SPELL_ADVANCEMENT_ID) + ".title"), // Inefficient due to calculating the key multiple times? Yes. Do I care? Not really, no.
Utils.translatable(EnglishLangProvider.getKeyForAdvancementTranslation(CURE_SPELL_ADVANCEMENT_ID) + ".description"),
Identifier.of("minecraft", "textures/block/purpur_block.png"),
Identifier.tryParse("minecraft", "textures/block/purpur_block.png"),
AdvancementFrame.TASK,
false,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected void configure(RegistryWrapper.WrapperLookup arg) {
.add(EntityType.WITHER)
.add(EntityType.WARDEN)
.add(EntityType.ELDER_GUARDIAN)
.addOptionalTag(new Identifier("c:bosses"));
.addOptionalTag(Identifier.of("c:bosses"));
getOrCreateTagBuilder(MysticalTags.ZOMBIE_VARIANTS)
.add(EntityType.ZOMBIE)
.add(EntityType.HUSK)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.skycat.mystical.mixin;


import com.skycat.mystical.Mystical;
import com.skycat.mystical.MysticalTags;
import com.skycat.mystical.spell.consequence.EnderTypeChangeConsequence;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.util.Identifier;
import net.minecraft.world.SpawnHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -31,7 +32,7 @@ private static void mystical_giveSpeedBoost(CallbackInfo ci, @Local(ordinal = 0)
((TurboMobsConsequence) spell.getConsequence()).entityType.equals(mobEntity.getType())) { // Make sure it applies to this type // TODO: Chance
EntityAttributeInstance attributeInstance = mobEntity.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED);
if (attributeInstance != null) {
attributeInstance.addPersistentModifier(new EntityAttributeModifier("Mystical speed boost", 0.5, EntityAttributeModifier.Operation.ADD_MULTIPLIED_BASE)); // TODO: Config
attributeInstance.addPersistentModifier(new EntityAttributeModifier(Identifier.of(Mystical.MOD_ID, "turbo_mob"), 0.5, EntityAttributeModifier.Operation.ADD_MULTIPLIED_BASE)); // TODO: Config
Utils.log(Utils.translateString(TurboMobsConsequence.FACTORY.getDescriptionKey()), Mystical.CONFIG.turboMobs.logLevel());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.Objects;

public record ActiveSpellsPacket(List<Spell> spells) implements CustomPayload {
public static final @NotNull Identifier IDENTIFIER = Objects.requireNonNull(Identifier.of(Mystical.MOD_ID, "active_spells"));
public static final @NotNull Identifier IDENTIFIER = Objects.requireNonNull(Identifier.tryParse(Mystical.MOD_ID, "active_spells"));
public static final CustomPayload.Id<ActiveSpellsPacket> ID = new CustomPayload.Id<>(IDENTIFIER);
public static final PacketCodec<RegistryByteBuf, ActiveSpellsPacket> CODEC = PacketCodecs.codec(Spell.CODEC.listOf()).xmap(ActiveSpellsPacket::new, ActiveSpellsPacket::spells).cast();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.registry.Registries;
import net.minecraft.text.MutableText;
import org.jetbrains.annotations.NotNull;

import java.util.Optional;
import java.util.Random;

public class TurboMobsConsequence extends SpellConsequence { // TODO: Tests
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/skycat/mystical/test/MysticalTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.skycat.mystical.util.Utils;
import net.fabricmc.fabric.api.gametest.v1.FabricGameTest;
import net.minecraft.registry.Registries;
import net.minecraft.registry.entry.RegistryEntryList.Named;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.test.*;

Expand Down Expand Up @@ -135,7 +134,7 @@ public void testHavenAll(TestContext context) {
* ...again.
*/
@SuppressWarnings("OptionalGetWithoutIsPresent") // Don't care, just fail please ty
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE)
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE, batchId = "defaultBatch")
public static void testTags(TestContext context) { // TODO: Move this to MysticalTags if a good way can be found
var bosses = Registries.ENTITY_TYPE.getEntryList(MysticalTags.BOSSES).get();
bosses.get(0); // Throws IndexOutOfBoundsException if empty.
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"depends": {
"fabricloader": ">=0.15.0",
"fabric": "*",
"minecraft": "1.20.6",
"minecraft": "1.21",
"fabric-permissions-api-v0": "*",
"owo-lib": ">=0.12.8+1.20.5"
"owo-lib": ">=0.12.10+1.21"
},
"suggests": {
"modmenu": "*"
Expand Down

0 comments on commit 214ec6f

Please sign in to comment.