mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-24 04:38:33 +01:00
Compare commits
No commits in common. "2c8a6159880ad7f5226447e86fbc46befc4a319f" and "8a984911f61012cf786f1e9117a5ee370feb289c" have entirely different histories.
2c8a615988
...
8a984911f6
11 changed files with 41 additions and 107 deletions
|
@ -3,12 +3,12 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
- name: Clone repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
|
@ -16,7 +16,7 @@ jobs:
|
|||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ hashFiles('**/build.gradle', '**/gradle-wrapper.properties', '**/gradle.properties') }}
|
||||
key: ${{ hashFiles('**/build.gradle', '**/gradle-wrapper.properties') }}
|
||||
- name: Build
|
||||
run: |
|
||||
chmod +x ./gradlew
|
||||
|
@ -25,4 +25,4 @@ jobs:
|
|||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Mod Jar
|
||||
path: build/libs/**.jar
|
||||
path: build/libs/**.jar
|
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
|
@ -1,39 +0,0 @@
|
|||
on:
|
||||
push:
|
||||
tags: ["*"]
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
- name: Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ hashFiles('**/build.gradle', '**/gradle-wrapper.properties', '**/gradle.properties') }}
|
||||
- name: Grab Changelog from Commit Message Body
|
||||
run: |
|
||||
changelog=$(echo -e "$MESSAGE" | sed -n '/^$/,$p' | sed '1d')
|
||||
echo -e "$changelog"
|
||||
{
|
||||
echo 'CHANGELOG<<EOF'
|
||||
echo -e "$changelog"
|
||||
echo EOF
|
||||
} >> "$GITHUB_ENV"
|
||||
env:
|
||||
MESSAGE: ${{ github.event.head_commit.message }}
|
||||
- name: Release
|
||||
run: |
|
||||
chmod +x ./gradlew
|
||||
./gradlew publishMods --no-daemon
|
||||
env:
|
||||
MR_TOKEN: ${{ secrets.MR_TOKEN }}
|
||||
CF_TOKEN: ${{ secrets.CF_TOKEN }}
|
28
build.gradle
28
build.gradle
|
@ -4,7 +4,6 @@ plugins {
|
|||
id 'idea'
|
||||
id 'maven-publish'
|
||||
id 'net.neoforged.gradle.userdev' version '7.0.163'
|
||||
id 'me.modmuss50.mod-publish-plugin' version "0.7.4"
|
||||
}
|
||||
|
||||
tasks.named('wrapper', Wrapper).configure {
|
||||
|
@ -167,30 +166,3 @@ idea {
|
|||
downloadJavadoc = true
|
||||
}
|
||||
}
|
||||
|
||||
publishMods {
|
||||
def cfToken = providers.environmentVariable("CF_TOKEN")
|
||||
def mrToken = providers.environmentVariable("MR_TOKEN")
|
||||
dryRun = !cfToken.isPresent() || !mrToken.isPresent()
|
||||
changelog = providers.environmentVariable("CHANGELOG").orElse("")
|
||||
version = mod_version
|
||||
type = me.modmuss50.mpp.ReleaseType.valueOf(mod_release_state)
|
||||
file = jar.archiveFile
|
||||
modLoaders.add("neoforge")
|
||||
|
||||
modrinth {
|
||||
accessToken = mrToken
|
||||
projectId = "4cJkN3aF"
|
||||
minecraftVersions.add(minecraft_version)
|
||||
requires("patchouli")
|
||||
optional("curios-continuation")
|
||||
}
|
||||
|
||||
curseforge {
|
||||
accessToken = cfToken
|
||||
projectId = "306626"
|
||||
minecraftVersions.add(minecraft_version)
|
||||
requires("patchouli")
|
||||
optional("curios-continuation")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@ mod_name=NaturesAura
|
|||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=MIT
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=41.4
|
||||
mod_release_state=BETA
|
||||
mod_version=41.3
|
||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||
# This should match the base package used for the mod sources.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
|
|
@ -285,7 +285,7 @@ public final class Helper {
|
|||
}
|
||||
|
||||
// This is how @ObjectHolder SHOULD work...
|
||||
public static <T> void populateObjectHolders(Class<?> clazz, Registry<T> registry, boolean useHolders) {
|
||||
public static <T> void populateObjectHolders(Class<?> clazz, Registry<T> registry) {
|
||||
for (var entry : clazz.getFields()) {
|
||||
if (!Modifier.isStatic(entry.getModifiers()))
|
||||
continue;
|
||||
|
@ -295,7 +295,7 @@ public final class Helper {
|
|||
continue;
|
||||
}
|
||||
try {
|
||||
entry.set(null, useHolders ? registry.getHolder(location).orElseThrow() : registry.get(location));
|
||||
entry.set(null, registry.get(location));
|
||||
} catch (IllegalAccessException e) {
|
||||
NaturesAura.LOGGER.error(e);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class BreathlessEffect implements IDrainSpotEffect {
|
|||
return;
|
||||
var entities = level.getEntitiesOfClass(LivingEntity.class, this.bb);
|
||||
for (var entity : entities)
|
||||
entity.addEffect(new MobEffectInstance(ModPotions.BREATHLESS, 300, this.amp));
|
||||
entity.addEffect(new MobEffectInstance(Holder.direct(ModPotions.BREATHLESS), 300, this.amp));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,21 @@
|
|||
/*package de.ellpeck.naturesaura.enchant;
|
||||
package de.ellpeck.naturesaura.enchant;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.server.ReloadableServerRegistries;
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import net.minecraft.core.HolderSet;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.EquipmentSlotGroup;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
|
||||
public final class ModEnchantments {
|
||||
|
||||
public static Holder<Enchantment> AURA_MENDING;
|
||||
public static final Enchantment AURA_MENDING = Enchantment.enchantment(
|
||||
Enchantment.definition(
|
||||
HolderSet.direct(BuiltInRegistries.ITEM.holders().filter(i -> new ItemStack(i).getCapability(NaturesAuraAPI.AURA_RECHARGE_CAPABILITY) == null).toList()),
|
||||
// same values as unbreaking, except for the max level
|
||||
5, 1, Enchantment.dynamicCost(5, 8), Enchantment.dynamicCost(55, 8), 2, EquipmentSlotGroup.ANY)
|
||||
).build(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending"));
|
||||
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -2,12 +2,15 @@ package de.ellpeck.naturesaura.items;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Axis;
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import de.ellpeck.naturesaura.api.render.ITrinketItem;
|
||||
import de.ellpeck.naturesaura.enchant.ModEnchantments;
|
||||
import de.ellpeck.naturesaura.reg.ICustomCreativeTab;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
@ -38,14 +41,12 @@ public class ItemAuraCache extends ItemImpl implements ITrinketItem, ICustomCrea
|
|||
if (recharge != null) {
|
||||
if (recharge.rechargeFromContainer(container, itemSlot, i, player.getInventory().selected == i))
|
||||
break;
|
||||
}
|
||||
// TODO fix enchantments, https://gist.github.com/ChampionAsh5357/d895a7b1a34341e19c80870720f9880f#the-enchantment-datapack-object
|
||||
/*else if (stack.getEnchantmentLevel(ModEnchantments.AURA_MENDING) > 0) {
|
||||
} else if (stack.getEnchantmentLevel(Holder.direct(ModEnchantments.AURA_MENDING)) > 0) {
|
||||
var mainSize = player.getInventory().items.size();
|
||||
var isArmor = i >= mainSize && i < mainSize + player.getInventory().armor.size();
|
||||
if ((isArmor || player.getInventory().selected == i) && Helper.rechargeAuraItem(stack, container, 1000))
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package de.ellpeck.naturesaura.potion;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
|
||||
@SuppressWarnings("NonConstantFieldWithUpperCaseName")
|
||||
public final class ModPotions {
|
||||
|
||||
public static Holder<MobEffect> BREATHLESS;
|
||||
public static MobEffect BREATHLESS;
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class PotionBreathless extends PotionImpl {
|
|||
|
||||
@SubscribeEvent
|
||||
public void onHeal(LivingHealEvent event) {
|
||||
var effect = event.getEntity().getEffect(ModPotions.BREATHLESS);
|
||||
var effect = event.getEntity().getEffect(Holder.direct(this));
|
||||
if (effect == null)
|
||||
return;
|
||||
var chance = (effect.getAmplifier() + 1) / 15F;
|
||||
|
|
|
@ -12,6 +12,7 @@ import de.ellpeck.naturesaura.blocks.tiles.BlockEntityImpl;
|
|||
import de.ellpeck.naturesaura.blocks.tiles.ModBlockEntities;
|
||||
import de.ellpeck.naturesaura.compat.Compat;
|
||||
import de.ellpeck.naturesaura.compat.patchouli.PatchouliCompat;
|
||||
import de.ellpeck.naturesaura.enchant.ModEnchantments;
|
||||
import de.ellpeck.naturesaura.entities.*;
|
||||
import de.ellpeck.naturesaura.gen.LevelGenAncientTree;
|
||||
import de.ellpeck.naturesaura.gen.LevelGenAuraBloom;
|
||||
|
@ -28,16 +29,13 @@ import de.ellpeck.naturesaura.recipes.ModRecipes;
|
|||
import de.ellpeck.naturesaura.renderers.PlayerLayerTrinkets;
|
||||
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
|
||||
import net.minecraft.client.resources.PlayerSkin;
|
||||
import net.minecraft.core.HolderSet;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.EquipmentSlotGroup;
|
||||
import net.minecraft.world.entity.MobCategory;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
@ -152,7 +150,7 @@ public final class ModRegistry {
|
|||
new BlockImpl("sky_ingot_block", Block.Properties.of().sound(SoundType.METAL).strength(4F)),
|
||||
new BlockImpl("depth_ingot_block", Block.Properties.of().sound(SoundType.METAL).strength(6F))
|
||||
);
|
||||
Helper.populateObjectHolders(ModBlocks.class, event.getRegistry(), false);
|
||||
Helper.populateObjectHolders(ModBlocks.class, BuiltInRegistries.BLOCK);
|
||||
});
|
||||
|
||||
event.register(Registries.ITEM, h -> {
|
||||
|
@ -237,7 +235,7 @@ public final class ModRegistry {
|
|||
new ItemArmor("depth_pants", ModArmorMaterial.DEPTH, ArmorItem.Type.LEGGINGS),
|
||||
new ItemArmor("depth_shoes", ModArmorMaterial.DEPTH, ArmorItem.Type.BOOTS)
|
||||
);
|
||||
Helper.populateObjectHolders(ModItems.class, event.getRegistry(), false);
|
||||
Helper.populateObjectHolders(ModItems.class, BuiltInRegistries.ITEM);
|
||||
});
|
||||
|
||||
event.register(Registries.BLOCK_ENTITY_TYPE, h -> {
|
||||
|
@ -248,12 +246,12 @@ public final class ModRegistry {
|
|||
if (item instanceof ModTileType<?> type)
|
||||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, type.getBaseName()), type.type);
|
||||
}
|
||||
Helper.populateObjectHolders(ModBlockEntities.class, event.getRegistry(), false);
|
||||
Helper.populateObjectHolders(ModBlockEntities.class, BuiltInRegistries.BLOCK_ENTITY_TYPE);
|
||||
});
|
||||
|
||||
event.register(Registries.MOB_EFFECT, h -> {
|
||||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "breathless"), new PotionBreathless());
|
||||
Helper.populateObjectHolders(ModPotions.class, event.getRegistry(), true);
|
||||
Helper.populateObjectHolders(ModPotions.class, BuiltInRegistries.MOB_EFFECT);
|
||||
});
|
||||
|
||||
event.register(Registries.MENU, h -> {
|
||||
|
@ -269,18 +267,12 @@ public final class ModRegistry {
|
|||
IItemHandler handler = ILevelData.getOverworldData(inv.player.level()).getEnderStorage(data.readUtf());
|
||||
return new ContainerEnderCrate(ModContainers.ENDER_ACCESS, windowId, inv.player, handler);
|
||||
}));
|
||||
Helper.populateObjectHolders(ModContainers.class, event.getRegistry(), false);
|
||||
Helper.populateObjectHolders(ModContainers.class, BuiltInRegistries.MENU);
|
||||
});
|
||||
|
||||
/* event.register(Registries.ENCHANTMENT, h -> {
|
||||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending"), Enchantment.enchantment(
|
||||
Enchantment.definition(
|
||||
HolderSet.direct(BuiltInRegistries.ITEM.holders().filter(i -> new ItemStack(i).getCapability(NaturesAuraAPI.AURA_RECHARGE_CAPABILITY) == null).toList()),
|
||||
// same values as unbreaking, except for the max level
|
||||
5, 1, Enchantment.dynamicCost(5, 8), Enchantment.dynamicCost(55, 8), 2, EquipmentSlotGroup.ANY)
|
||||
).build(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending")));
|
||||
Helper.populateObjectHolders(ModEnchantments.class, event.getRegistry(), true);
|
||||
});*/
|
||||
event.register(Registries.ENCHANTMENT, h -> {
|
||||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mending"), ModEnchantments.AURA_MENDING);
|
||||
});
|
||||
|
||||
event.register(Registries.ENTITY_TYPE, h -> {
|
||||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "mover_cart"), EntityType.Builder
|
||||
|
@ -299,7 +291,7 @@ public final class ModRegistry {
|
|||
.of(EntityStructureFinder::new, MobCategory.MISC)
|
||||
.sized(0.5F, 0.5F).setShouldReceiveVelocityUpdates(true)
|
||||
.setTrackingRange(64).setUpdateInterval(2).fireImmune().build(NaturesAura.MOD_ID + ":structure_finder"));
|
||||
Helper.populateObjectHolders(ModEntities.class, event.getRegistry(), false);
|
||||
Helper.populateObjectHolders(ModEntities.class, BuiltInRegistries.ENTITY_TYPE);
|
||||
});
|
||||
|
||||
event.register(Registries.FEATURE, h -> {
|
||||
|
@ -310,7 +302,7 @@ public final class ModRegistry {
|
|||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "aura_mushroom"), new LevelGenAuraBloom(ModBlocks.AURA_MUSHROOM, 20, false));
|
||||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "ancient_tree"), new LevelGenAncientTree());
|
||||
h.register(ResourceLocation.fromNamespaceAndPath(NaturesAura.MOD_ID, "nether_wart_mushroom"), new LevelGenNetherWartMushroom());
|
||||
Helper.populateObjectHolders(ModFeatures.class, event.getRegistry(), false);
|
||||
Helper.populateObjectHolders(ModFeatures.class, BuiltInRegistries.FEATURE);
|
||||
});
|
||||
|
||||
event.register(Registries.RECIPE_TYPE, h -> {
|
||||
|
|
Loading…
Reference in a new issue