init
This commit is contained in:
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Disable autocrlf on generated files, they always generate with LF
|
||||||
|
# Add any extra files or paths here to make git stop saying they
|
||||||
|
# are changed when only line endings change.
|
||||||
|
src/generated/**/.cache/cache text eol=lf
|
||||||
|
src/generated/**/*.json text eol=lf
|
||||||
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# eclipse
|
||||||
|
bin
|
||||||
|
*.launch
|
||||||
|
.settings
|
||||||
|
.metadata
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
|
||||||
|
# idea
|
||||||
|
out
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# gradle
|
||||||
|
build
|
||||||
|
.gradle
|
||||||
|
|
||||||
|
# other
|
||||||
|
eclipse
|
||||||
|
run
|
||||||
|
|
||||||
|
# Files from Forge MDK
|
||||||
|
forge*changelog.txt
|
||||||
65
CREDITS.txt
Normal file
65
CREDITS.txt
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
Minecraft Forge: Credits/Thank You
|
||||||
|
|
||||||
|
Forge is a set of tools and modifications to the Minecraft base game code to assist
|
||||||
|
mod developers in creating new and exciting content. It has been in development for
|
||||||
|
several years now, but I would like to take this time thank a few people who have
|
||||||
|
helped it along its way.
|
||||||
|
|
||||||
|
First, the people who originally created the Forge projects way back in Minecraft
|
||||||
|
alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptiance
|
||||||
|
of me taking over the project, who knows what Minecraft modding would be today.
|
||||||
|
|
||||||
|
Secondly, someone who has worked with me, and developed some of the core features
|
||||||
|
that allow modding to be as functional, and as simple as it is, cpw. For developing
|
||||||
|
FML, which stabilized the client and server modding ecosystem. As well as the base
|
||||||
|
loading system that allows us to modify Minecraft's code as elegently as possible.
|
||||||
|
|
||||||
|
Mezz, who has stepped up as the issue and pull request manager. Helping to keep me
|
||||||
|
sane as well as guiding the community into creating better additions to Forge.
|
||||||
|
|
||||||
|
Searge, Bspks, Fesh0r, ProfMobious, and all the rest over on the MCP team {of which
|
||||||
|
I am a part}. For creating some of the core tools needed to make Minecraft modding
|
||||||
|
both possible, and as stable as can be.
|
||||||
|
On that note, here is some specific information of the MCP data we use:
|
||||||
|
* Minecraft Coder Pack (MCP) *
|
||||||
|
Forge Mod Loader and Minecraft Forge have permission to distribute and automatically
|
||||||
|
download components of MCP and distribute MCP data files. This permission is not
|
||||||
|
transitive and others wishing to redistribute the Minecraft Forge source independently
|
||||||
|
should seek permission of MCP or remove the MCP data files and request their users
|
||||||
|
to download MCP separately.
|
||||||
|
|
||||||
|
And lastly, the countless community members who have spent time submitting bug reports,
|
||||||
|
pull requests, and just helping out the community in general. Thank you.
|
||||||
|
|
||||||
|
--LexManos
|
||||||
|
|
||||||
|
=========================================================================
|
||||||
|
|
||||||
|
This is Forge Mod Loader.
|
||||||
|
|
||||||
|
You can find the source code at all times at https://github.com/MinecraftForge/MinecraftForge/tree/1.12.x/src/main/java/net/minecraftforge/fml
|
||||||
|
|
||||||
|
This minecraft mod is a clean open source implementation of a mod loader for minecraft servers
|
||||||
|
and minecraft clients.
|
||||||
|
|
||||||
|
The code is authored by cpw.
|
||||||
|
|
||||||
|
It began by partially implementing an API defined by the client side ModLoader, authored by Risugami.
|
||||||
|
https://www.minecraftforum.net/topic/75440-
|
||||||
|
This support has been dropped as of Minecraft release 1.7, as Risugami no longer maintains ModLoader.
|
||||||
|
|
||||||
|
It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge.
|
||||||
|
https://minecraftforge.net/
|
||||||
|
|
||||||
|
Additionally, it contains an implementation of topological sort based on that
|
||||||
|
published at http://keithschwarz.com/interesting/code/?dir=topological-sort
|
||||||
|
|
||||||
|
It also contains code from the Maven project for performing versioned dependency
|
||||||
|
resolution. http://maven.apache.org/
|
||||||
|
|
||||||
|
It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/
|
||||||
|
with credit to it's authors.
|
||||||
|
|
||||||
|
Forge Mod Loader downloads components from the Minecraft Coder Pack
|
||||||
|
(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team.
|
||||||
|
|
||||||
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 sillyangel
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
1
README.txt
Normal file
1
README.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
more spear enchantments for forge 1.0.1+1.21.11 (as of now)
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments;
|
||||||
|
|
||||||
|
import dev.sillyangel.more_spear_enchantments.enchantment.ModEnchantmentEffects;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public final class MoreSpearEnchantments {
|
||||||
|
public static final String MOD_ID = "more_spear_enchantments";
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
LOGGER.info("Initializing More Spear Enchantments");
|
||||||
|
ModEnchantmentEffects.registerModEnchantmentEffects();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.enchantment;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import dev.architectury.registry.registries.DeferredRegister;
|
||||||
|
import dev.architectury.registry.registries.RegistrySupplier;
|
||||||
|
import dev.sillyangel.more_spear_enchantments.MoreSpearEnchantments;
|
||||||
|
import dev.sillyangel.more_spear_enchantments.enchantment.effect.*;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.registry.RegistryKey;
|
||||||
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class ModEnchantmentEffects {
|
||||||
|
// Deferred register for enchantment effect types
|
||||||
|
public static final DeferredRegister<MapCodec<? extends EnchantmentEntityEffect>> ENCHANTMENT_ENTITY_EFFECTS =
|
||||||
|
DeferredRegister.create(MoreSpearEnchantments.MOD_ID, RegistryKeys.ENCHANTMENT_ENTITY_EFFECT_TYPE);
|
||||||
|
|
||||||
|
// Enchantment registry keys
|
||||||
|
public static final RegistryKey<Enchantment> THUNDERING = of("thundering");
|
||||||
|
public static final RegistryKey<Enchantment> WITHERING = of("withering");
|
||||||
|
public static final RegistryKey<Enchantment> POISONING = of("poisoning");
|
||||||
|
public static final RegistryKey<Enchantment> CRIPPLING = of("crippling");
|
||||||
|
|
||||||
|
// Register enchantment effect types
|
||||||
|
public static final RegistrySupplier<MapCodec<LightningEnchantmentEffect>> LIGHTNING_EFFECT =
|
||||||
|
ENCHANTMENT_ENTITY_EFFECTS.register("lightning", () -> LightningEnchantmentEffect.CODEC);
|
||||||
|
public static final RegistrySupplier<MapCodec<PoisonEnchantmentEffect>> POISON_EFFECT =
|
||||||
|
ENCHANTMENT_ENTITY_EFFECTS.register("poison", () -> PoisonEnchantmentEffect.CODEC);
|
||||||
|
public static final RegistrySupplier<MapCodec<WitheringEnchantmentEffect>> WITHERING_EFFECT =
|
||||||
|
ENCHANTMENT_ENTITY_EFFECTS.register("withering", () -> WitheringEnchantmentEffect.CODEC);
|
||||||
|
public static final RegistrySupplier<MapCodec<CripplingEnchantmentEffect>> CRIPPLING_EFFECT =
|
||||||
|
ENCHANTMENT_ENTITY_EFFECTS.register("crippling", () -> CripplingEnchantmentEffect.CODEC);
|
||||||
|
|
||||||
|
private static RegistryKey<Enchantment> of(String path) {
|
||||||
|
Identifier id = Identifier.of(MoreSpearEnchantments.MOD_ID, path);
|
||||||
|
return RegistryKey.of(RegistryKeys.ENCHANTMENT, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerModEnchantmentEffects() {
|
||||||
|
MoreSpearEnchantments.LOGGER.info("Registering EnchantmentEffects for " + MoreSpearEnchantments.MOD_ID);
|
||||||
|
ENCHANTMENT_ENTITY_EFFECTS.register();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record CripplingEnchantmentEffect(EnchantmentLevelBasedValue duration) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<CripplingEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("duration").forGetter(CripplingEnchantmentEffect::duration)
|
||||||
|
).apply(instance, CripplingEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
int Duration = (int) (this.duration.getValue(level) * 50); // Convert to ticks
|
||||||
|
int slownessAmplifier = level - 1; // Level 1 = Slowness 0, Level 2 = Slowness I, Level 3 = Slowness II
|
||||||
|
int weaknessAmplifier = level - 1; // Level 1 = Weakness 0, Level 2 = Weakness I, Level 3 = Weakness II
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.SLOWNESS,
|
||||||
|
Duration,
|
||||||
|
slownessAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.WEAKNESS,
|
||||||
|
Duration,
|
||||||
|
weaknessAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityType;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.SpawnReason;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record LightningEnchantmentEffect(EnchantmentLevelBasedValue amount) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<LightningEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("amount").forGetter(LightningEnchantmentEffect::amount)
|
||||||
|
).apply(instance, LightningEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
float numStrikes = this.amount.getValue(level);
|
||||||
|
|
||||||
|
for (float i = 0; i < numStrikes; i++) {
|
||||||
|
BlockPos position = victim.getBlockPos();
|
||||||
|
EntityType.LIGHTNING_BOLT.spawn(world, position, SpawnReason.TRIGGERED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record PoisonEnchantmentEffect(EnchantmentLevelBasedValue duration) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<PoisonEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("duration").forGetter(PoisonEnchantmentEffect::duration)
|
||||||
|
).apply(instance, PoisonEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
int poisonDuration = (int) (this.duration.getValue(level) * 40); // Convert to ticks
|
||||||
|
int poisonAmplifier = level - 2; // Level 1 = Poison 0, Level 2 = Poison I, Level 3 = Poison II
|
||||||
|
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.POISON,
|
||||||
|
poisonDuration,
|
||||||
|
poisonAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record WitheringEnchantmentEffect(EnchantmentLevelBasedValue duration) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<WitheringEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("duration").forGetter(WitheringEnchantmentEffect::duration)
|
||||||
|
).apply(instance, WitheringEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
int witherDuration = (int) (this.duration.getValue(level) * 40); // Convert to ticks
|
||||||
|
int witherAmplifier = level - 2; // Level 1 = Wither 0, Level 2 = Wither I, Level 3 = Wither II
|
||||||
|
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.WITHER,
|
||||||
|
witherDuration,
|
||||||
|
witherAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric;
|
||||||
|
|
||||||
|
import dev.sillyangel.more_spear_enchantments.fabric.datagen.ModItemTagProvider;
|
||||||
|
import dev.sillyangel.more_spear_enchantments.fabric.enchantment.ModEnchantmentGenerator;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||||
|
|
||||||
|
public class MoreSpearEnchantmentsDataGenerator implements DataGeneratorEntrypoint {
|
||||||
|
@Override
|
||||||
|
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
|
||||||
|
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();
|
||||||
|
|
||||||
|
pack.addProvider(ModItemTagProvider::new);
|
||||||
|
pack.addProvider(ModEnchantmentGenerator::new);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric;
|
||||||
|
|
||||||
|
import dev.sillyangel.more_spear_enchantments.MoreSpearEnchantments;
|
||||||
|
import net.fabricmc.api.ModInitializer;
|
||||||
|
|
||||||
|
public class MoreSpearEnchantmentsFabric implements ModInitializer {
|
||||||
|
@Override
|
||||||
|
public void onInitialize() {
|
||||||
|
// Run our common setup
|
||||||
|
MoreSpearEnchantments.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.client;
|
||||||
|
|
||||||
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
|
|
||||||
|
public final class MoreSpearEnchantmentsFabricClient implements ClientModInitializer {
|
||||||
|
@Override
|
||||||
|
public void onInitializeClient() {
|
||||||
|
// This entrypoint is suitable for setting up client-specific logic, such as rendering.
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.datagen;
|
||||||
|
|
||||||
|
import dev.sillyangel.more_spear_enchantments.util.ModTags;
|
||||||
|
import dev.sillyangel.more_spear_enchantments.MoreSpearEnchantments;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.registry.RegistryWrapper;
|
||||||
|
import net.minecraft.registry.tag.ItemTags;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||||
|
public ModItemTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
|
||||||
|
super(output, completableFuture);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
|
||||||
|
valueLookupBuilder(ModTags.Items.SPEARS)
|
||||||
|
.add(Items.WOODEN_SPEAR)
|
||||||
|
.add(Items.STONE_SPEAR)
|
||||||
|
.add(Items.COPPER_SPEAR)
|
||||||
|
.add(Items.IRON_SPEAR)
|
||||||
|
.add(Items.GOLDEN_SPEAR)
|
||||||
|
.add(Items.DIAMOND_SPEAR)
|
||||||
|
.add(Items.NETHERITE_SPEAR);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.enchantment;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import dev.sillyangel.more_spear_enchantments.MoreSpearEnchantments;
|
||||||
|
import dev.sillyangel.more_spear_enchantments.enchantment.effect.*;
|
||||||
|
import net.minecraft.registry.Registries;
|
||||||
|
import net.minecraft.registry.Registry;
|
||||||
|
import net.minecraft.registry.RegistryKey;
|
||||||
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
|
||||||
|
public class ModEnchantmentEffects {
|
||||||
|
public static final RegistryKey<Enchantment> THUNDERING = of("thundering");
|
||||||
|
public static final RegistryKey<Enchantment> WITHERING = of("withering");
|
||||||
|
public static final RegistryKey<Enchantment> POISONING = of("poisoning");
|
||||||
|
public static final RegistryKey<Enchantment> CRIPPLING = of("crippling");
|
||||||
|
|
||||||
|
|
||||||
|
private static RegistryKey<Enchantment> of(String path) {
|
||||||
|
Identifier id = Identifier.of(MoreSpearEnchantments.MOD_ID, path);
|
||||||
|
return RegistryKey.of(RegistryKeys.ENCHANTMENT, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static <T extends EnchantmentEntityEffect> MapCodec<T> register(String id, MapCodec<T> codec) {
|
||||||
|
return Registry.register(Registries.ENCHANTMENT_ENTITY_EFFECT_TYPE, Identifier.of(MoreSpearEnchantments.MOD_ID, id), codec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerModEnchantmentEffects() {
|
||||||
|
MoreSpearEnchantments.LOGGER.info("Registering EnchantmentEffects for " + MoreSpearEnchantments.MOD_ID);
|
||||||
|
|
||||||
|
register("lightning", LightningEnchantmentEffect.CODEC);
|
||||||
|
register("poison", PoisonEnchantmentEffect.CODEC);
|
||||||
|
register("withering", WitheringEnchantmentEffect.CODEC);
|
||||||
|
register("crippling", CripplingEnchantmentEffect.CODEC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.enchantment;
|
||||||
|
|
||||||
|
import dev.sillyangel.more_spear_enchantments.util.ModTags;
|
||||||
|
import dev.sillyangel.more_spear_enchantments.enchantment.effect.*;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
|
||||||
|
import net.fabricmc.fabric.api.resource.conditions.v1.ResourceCondition;
|
||||||
|
import net.minecraft.registry.RegistryWrapper;
|
||||||
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.registry.RegistryKey;
|
||||||
|
import net.minecraft.enchantment.Enchantment;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEffectTarget;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.component.type.AttributeModifierSlot;
|
||||||
|
import net.minecraft.component.EnchantmentEffectComponentTypes;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class ModEnchantmentGenerator extends FabricDynamicRegistryProvider {
|
||||||
|
public ModEnchantmentGenerator(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||||
|
super(output, registriesFuture);
|
||||||
|
System.out.println("REGISTERING ENCHANTS");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) {
|
||||||
|
// Our new enchantment, "Thundering."
|
||||||
|
register(entries, ModEnchantmentEffects.THUNDERING, Enchantment.builder(
|
||||||
|
Enchantment.definition(
|
||||||
|
registries.getOrThrow(RegistryKeys.ITEM).getOrThrow(ModTags.Items.SPEARS),
|
||||||
|
// this is the "weight" or probability of our enchantment showing up in the table
|
||||||
|
10,
|
||||||
|
// the maximum level of the enchantment
|
||||||
|
3,
|
||||||
|
// base cost for level 1 of the enchantment, and min levels required for something higher
|
||||||
|
Enchantment.leveledCost(1, 10),
|
||||||
|
// same fields as above but for max cost
|
||||||
|
Enchantment.leveledCost(1, 15),
|
||||||
|
// anvil cost
|
||||||
|
5,
|
||||||
|
// valid slots
|
||||||
|
AttributeModifierSlot.HAND
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.addEffect(
|
||||||
|
// enchantment occurs POST_ATTACK
|
||||||
|
EnchantmentEffectComponentTypes.POST_ATTACK,
|
||||||
|
EnchantmentEffectTarget.ATTACKER,
|
||||||
|
EnchantmentEffectTarget.VICTIM,
|
||||||
|
new LightningEnchantmentEffect(EnchantmentLevelBasedValue.linear(0.4f, 0.2f)) // scale the enchantment linearly.
|
||||||
|
)
|
||||||
|
);
|
||||||
|
register(entries, ModEnchantmentEffects.POISONING, Enchantment.builder(
|
||||||
|
Enchantment.definition(
|
||||||
|
registries.getOrThrow(RegistryKeys.ITEM).getOrThrow(ModTags.Items.SPEARS),
|
||||||
|
10,
|
||||||
|
3,
|
||||||
|
Enchantment.leveledCost(1, 10),
|
||||||
|
Enchantment.leveledCost(1, 15),
|
||||||
|
5,
|
||||||
|
AttributeModifierSlot.HAND
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.addEffect(
|
||||||
|
EnchantmentEffectComponentTypes.POST_ATTACK,
|
||||||
|
EnchantmentEffectTarget.ATTACKER,
|
||||||
|
EnchantmentEffectTarget.VICTIM,
|
||||||
|
new PoisonEnchantmentEffect(EnchantmentLevelBasedValue.linear(3.0f, 1.0f)) // 3s base, +1s per level
|
||||||
|
)
|
||||||
|
);
|
||||||
|
// Our new enchantment, "Withering."
|
||||||
|
register(entries, ModEnchantmentEffects.WITHERING, Enchantment.builder(
|
||||||
|
Enchantment.definition(
|
||||||
|
registries.getOrThrow(RegistryKeys.ITEM).getOrThrow(ModTags.Items.SPEARS),
|
||||||
|
10,
|
||||||
|
3,
|
||||||
|
Enchantment.leveledCost(1, 10),
|
||||||
|
Enchantment.leveledCost(1, 15),
|
||||||
|
5,
|
||||||
|
AttributeModifierSlot.HAND
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.addEffect(
|
||||||
|
EnchantmentEffectComponentTypes.POST_ATTACK,
|
||||||
|
EnchantmentEffectTarget.ATTACKER,
|
||||||
|
EnchantmentEffectTarget.VICTIM,
|
||||||
|
new WitheringEnchantmentEffect(EnchantmentLevelBasedValue.linear(2.0f, 1.0f)) // 2s base, +1s per level
|
||||||
|
)
|
||||||
|
);
|
||||||
|
// Our new enchantment, "Crippling."
|
||||||
|
register(entries, ModEnchantmentEffects.CRIPPLING, Enchantment.builder(
|
||||||
|
Enchantment.definition(
|
||||||
|
registries.getOrThrow(RegistryKeys.ITEM).getOrThrow(ModTags.Items.SPEARS),
|
||||||
|
10,
|
||||||
|
3,
|
||||||
|
Enchantment.leveledCost(1, 10),
|
||||||
|
Enchantment.leveledCost(1, 15),
|
||||||
|
5,
|
||||||
|
AttributeModifierSlot.HAND
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.addEffect(
|
||||||
|
EnchantmentEffectComponentTypes.POST_ATTACK,
|
||||||
|
EnchantmentEffectTarget.ATTACKER,
|
||||||
|
EnchantmentEffectTarget.VICTIM,
|
||||||
|
new CripplingEnchantmentEffect(EnchantmentLevelBasedValue.linear(2.0f, 1.0f)) // 2s base, +1s per leve
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void register(Entries entries, RegistryKey<Enchantment> key, Enchantment.Builder builder, ResourceCondition... resourceConditions) {
|
||||||
|
entries.add(key, builder.build(key.getValue()), resourceConditions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "ModEnchantmentGenerator";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record CripplingEnchantmentEffect(EnchantmentLevelBasedValue duration) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<CripplingEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("duration").forGetter(CripplingEnchantmentEffect::duration)
|
||||||
|
).apply(instance, CripplingEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
int Duration = (int) (this.duration.getValue(level) * 50); // Convert to ticks
|
||||||
|
int slownessAmplifier = level - 1; // Level 1 = Slowness 0, Level 2 = Slowness I, Level 3 = Slowness II
|
||||||
|
int weaknessAmplifier = level - 1; // Level 1 = Weakness 0, Level 2 = Weakness I, Level 3 = Weakness II
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.SLOWNESS,
|
||||||
|
Duration,
|
||||||
|
slownessAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.WEAKNESS,
|
||||||
|
Duration,
|
||||||
|
weaknessAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityType;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.SpawnReason;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record LightningEnchantmentEffect(EnchantmentLevelBasedValue amount) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<LightningEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("amount").forGetter(LightningEnchantmentEffect::amount)
|
||||||
|
).apply(instance, LightningEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
float numStrikes = this.amount.getValue(level);
|
||||||
|
|
||||||
|
for (float i = 0; i < numStrikes; i++) {
|
||||||
|
BlockPos position = victim.getBlockPos();
|
||||||
|
EntityType.LIGHTNING_BOLT.spawn(world, position, SpawnReason.TRIGGERED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record PoisonEnchantmentEffect(EnchantmentLevelBasedValue duration) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<PoisonEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("duration").forGetter(PoisonEnchantmentEffect::duration)
|
||||||
|
).apply(instance, PoisonEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
int poisonDuration = (int) (this.duration.getValue(level) * 40); // Convert to ticks
|
||||||
|
int poisonAmplifier = level - 2; // Level 1 = Poison 0, Level 2 = Poison I, Level 3 = Poison II
|
||||||
|
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.POISON,
|
||||||
|
poisonDuration,
|
||||||
|
poisonAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.enchantment.effect;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||||
|
import net.minecraft.entity.effect.StatusEffects;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.enchantment.EnchantmentEffectContext;
|
||||||
|
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
|
||||||
|
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public record WitheringEnchantmentEffect(EnchantmentLevelBasedValue duration) implements EnchantmentEntityEffect {
|
||||||
|
public static final MapCodec<WitheringEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||||
|
instance.group(
|
||||||
|
EnchantmentLevelBasedValue.CODEC.fieldOf("duration").forGetter(WitheringEnchantmentEffect::duration)
|
||||||
|
).apply(instance, WitheringEnchantmentEffect::new)
|
||||||
|
);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void apply(ServerWorld world, int level, EnchantmentEffectContext context, Entity target, Vec3d pos) {
|
||||||
|
if (target instanceof LivingEntity victim) {
|
||||||
|
if (context.owner() != null && context.owner() instanceof PlayerEntity player) {
|
||||||
|
int witherDuration = (int) (this.duration.getValue(level) * 40); // Convert to ticks
|
||||||
|
int witherAmplifier = level - 2; // Level 1 = Wither 0, Level 2 = Wither I, Level 3 = Wither II
|
||||||
|
|
||||||
|
victim.addStatusEffect(new StatusEffectInstance(
|
||||||
|
StatusEffects.WITHER,
|
||||||
|
witherDuration,
|
||||||
|
witherAmplifier,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapCodec<? extends EnchantmentEntityEffect> getCodec() {
|
||||||
|
return CODEC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.fabric.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(MinecraftServer.class)
|
||||||
|
public class ExampleMixin {
|
||||||
|
@Inject(at = @At("HEAD"), method = "loadWorld")
|
||||||
|
private void init(CallbackInfo info) {
|
||||||
|
// This code is injected into the start of MinecraftServer.loadWorld()V
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments.util;
|
||||||
|
|
||||||
|
import dev.sillyangel.more_spear_enchantments.MoreSpearEnchantments;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.registry.tag.TagKey;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class ModTags {
|
||||||
|
public static class Blocks {
|
||||||
|
|
||||||
|
private static TagKey<Block> createTag(String name) {
|
||||||
|
return TagKey.of(RegistryKeys.BLOCK, Identifier.of(MoreSpearEnchantments.MOD_ID, name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Items {
|
||||||
|
public static final TagKey<Item> SPEARS = createTag("spears");
|
||||||
|
|
||||||
|
private static TagKey<Item> createTag(String name) {
|
||||||
|
return TagKey.of(RegistryKeys.ITEM, Identifier.of(MoreSpearEnchantments.MOD_ID, name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
46
arch/fabric.mod.json
Normal file
46
arch/fabric.mod.json
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"id": "more_spear_enchantments",
|
||||||
|
"version": "${version}",
|
||||||
|
"name": "More Spear Enchantments",
|
||||||
|
"description": "m",
|
||||||
|
"authors": [
|
||||||
|
"sillyangel"
|
||||||
|
],
|
||||||
|
"contact": {
|
||||||
|
"homepage": "https://sillyangel.dev/",
|
||||||
|
"sources": "https://git.sillyangel.dev/angel/more-spear-enchants"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"icon": "assets/more_spear_enchantments/icon.png",
|
||||||
|
"environment": "*",
|
||||||
|
"entrypoints": {
|
||||||
|
"main": [
|
||||||
|
"dev.sillyangel.more_spear_enchantments.fabric.MoreSpearEnchantmentsFabric"
|
||||||
|
],
|
||||||
|
"client": [
|
||||||
|
"dev.sillyangel.more_spear_enchantments.fabric.client.MoreSpearEnchantmentsFabricClient"
|
||||||
|
],
|
||||||
|
"fabric-datagen": [
|
||||||
|
"dev.sillyangel.more_spear_enchantments.fabric.MoreSpearEnchantmentsDataGenerator"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mixins": [
|
||||||
|
"more_spear_enchantments.mixins.json"
|
||||||
|
],
|
||||||
|
"depends": {
|
||||||
|
"fabricloader": ">=0.18.3",
|
||||||
|
"minecraft": "~1.21.11",
|
||||||
|
"java": ">=21",
|
||||||
|
"architectury": ">=19.0.1",
|
||||||
|
"fabric-api": "*"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"modmenu": {
|
||||||
|
"links": {
|
||||||
|
"modmenu.discord": "https://discord.gg/gAfcZURgvJ"
|
||||||
|
},
|
||||||
|
"update_checker": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
0
arch/icon.png
Normal file
0
arch/icon.png
Normal file
38
arch/neoforge.mods.toml
Normal file
38
arch/neoforge.mods.toml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
modLoader = "javafml"
|
||||||
|
loaderVersion = "[10,)"
|
||||||
|
issueTrackerURL = "https://git.sillyangel.dev/angel/more-spear-enchants/issues"
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
|
[[mods]]
|
||||||
|
modId = "more_spear_enchantments"
|
||||||
|
version = "${version}"
|
||||||
|
displayName = "More Spear Enchantments"
|
||||||
|
authors = "sillyangel"
|
||||||
|
description = '''
|
||||||
|
more enchantments for the newly added spear from the Mounts of Mayhem update.
|
||||||
|
'''
|
||||||
|
logoFile = "icon.png"
|
||||||
|
|
||||||
|
[[dependencies.more_spear_enchantments]]
|
||||||
|
modId = "neoforge"
|
||||||
|
type = "required"
|
||||||
|
versionRange = "[21.11,)"
|
||||||
|
ordering = "NONE"
|
||||||
|
side = "BOTH"
|
||||||
|
|
||||||
|
[[dependencies.more_spear_enchantments]]
|
||||||
|
modId = "minecraft"
|
||||||
|
type = "required"
|
||||||
|
versionRange = "[1.21.11,)"
|
||||||
|
ordering = "NONE"
|
||||||
|
side = "BOTH"
|
||||||
|
|
||||||
|
[[dependencies.more_spear_enchantments]]
|
||||||
|
modId = "architectury"
|
||||||
|
type = "required"
|
||||||
|
versionRange = "[19.0.1,)"
|
||||||
|
ordering = "AFTER"
|
||||||
|
side = "BOTH"
|
||||||
|
|
||||||
|
[[mixins]]
|
||||||
|
config = "more_spear_enchantments.mixins.json"
|
||||||
236
build.gradle
Normal file
236
build.gradle
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
plugins {
|
||||||
|
id 'eclipse'
|
||||||
|
id 'idea'
|
||||||
|
id 'maven-publish'
|
||||||
|
id 'net.minecraftforge.gradle' version '[6.0.46,6.2)'
|
||||||
|
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
|
||||||
|
}
|
||||||
|
|
||||||
|
version = mod_version
|
||||||
|
group = mod_group_id
|
||||||
|
|
||||||
|
base {
|
||||||
|
archivesName = mod_id
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mojang ships Java 21 to end users in 1.20.5+, so your mod should target Java 21.
|
||||||
|
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
|
||||||
|
|
||||||
|
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
|
||||||
|
minecraft {
|
||||||
|
// The mappings can be changed at any time and must be in the following format.
|
||||||
|
// Channel: Version:
|
||||||
|
// official MCVersion Official field/method names from Mojang mapping files
|
||||||
|
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
|
||||||
|
//
|
||||||
|
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
|
||||||
|
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
|
||||||
|
//
|
||||||
|
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
|
mappings channel: mapping_channel, version: mapping_version
|
||||||
|
|
||||||
|
// Forge 1.20.6 and newer use official mappings at runtime, so we shouldn't reobf from official to SRG
|
||||||
|
reobf = false
|
||||||
|
|
||||||
|
// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
|
||||||
|
// In most cases, it is not necessary to enable.
|
||||||
|
// enableEclipsePrepareRuns = true
|
||||||
|
// enableIdeaPrepareRuns = true
|
||||||
|
|
||||||
|
// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
|
||||||
|
// It is REQUIRED to be set to true for this template to function.
|
||||||
|
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
|
||||||
|
copyIdeResources = true
|
||||||
|
|
||||||
|
// When true, this property will add the folder name of all declared run configurations to generated IDE run configurations.
|
||||||
|
// The folder name can be set on a run configuration using the "folderName" property.
|
||||||
|
// By default, the folder name of a run configuration is the name of the Gradle project containing it.
|
||||||
|
// generateRunFolders = true
|
||||||
|
|
||||||
|
// This property enables access transformers for use in development, applied to the Minecraft artifact.
|
||||||
|
// The access transformer file can be anywhere in the project.
|
||||||
|
// However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge.
|
||||||
|
// This default location is a best practice to automatically put the file in the right place in the final jar.
|
||||||
|
// See https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/ for more information.
|
||||||
|
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
|
|
||||||
|
// Default run configurations.
|
||||||
|
// These can be tweaked, removed, or duplicated as needed.
|
||||||
|
runs {
|
||||||
|
// applies to all the run configs below
|
||||||
|
configureEach {
|
||||||
|
workingDirectory project.file('run')
|
||||||
|
|
||||||
|
// Optional additional logging. The markers can be added/remove as needed, separated by commas.
|
||||||
|
// "SCAN": For mods scan.
|
||||||
|
// "REGISTRIES": For firing of registry events.
|
||||||
|
// "REGISTRYDUMP": For getting the contents of all registries.
|
||||||
|
// property 'forge.logging.markers', 'REGISTRIES'
|
||||||
|
|
||||||
|
property 'forge.logging.console.level', 'debug'
|
||||||
|
|
||||||
|
// Recommended for development - enables more descriptive errors at the cost of slower startup and registration.
|
||||||
|
property 'eventbus.api.strictRuntimeChecks', 'true'
|
||||||
|
|
||||||
|
// arg "-mixin.config=${mod_id}.mixins.json"
|
||||||
|
}
|
||||||
|
|
||||||
|
client {
|
||||||
|
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
|
||||||
|
property 'forge.enabledGameTestNamespaces', mod_id
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
property 'forge.enabledGameTestNamespaces', mod_id
|
||||||
|
args '--nogui'
|
||||||
|
}
|
||||||
|
|
||||||
|
// This run config launches GameTestServer and runs all registered gametests, then exits.
|
||||||
|
// By default, the server will crash when no gametests are provided.
|
||||||
|
// The gametest system is also enabled by default for other run configs under the /test command.
|
||||||
|
gameTestServer {
|
||||||
|
property 'forge.enabledGameTestNamespaces', mod_id
|
||||||
|
}
|
||||||
|
|
||||||
|
data {
|
||||||
|
// example of overriding the workingDirectory set in configureEach above
|
||||||
|
workingDirectory project.file('run-data')
|
||||||
|
|
||||||
|
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
||||||
|
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Include resources generated by data generators.
|
||||||
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
// Put repositories for dependencies here
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
name = 'Forge'
|
||||||
|
url = 'https://maven.minecraftforge.net'
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = 'Minecraft libraries'
|
||||||
|
url = 'https://libraries.minecraft.net'
|
||||||
|
}
|
||||||
|
exclusiveContent {
|
||||||
|
forRepository {
|
||||||
|
maven {
|
||||||
|
name = 'Sponge'
|
||||||
|
url = 'https://repo.spongepowered.org/repository/maven-public'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filter {
|
||||||
|
includeGroupAndSubgroups('org.spongepowered')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
|
||||||
|
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
|
||||||
|
// flatDir {
|
||||||
|
// dir 'libs'
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// Specify the version of Minecraft to use.
|
||||||
|
// Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
|
||||||
|
// The "userdev" classifier will be requested and setup by ForgeGradle.
|
||||||
|
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
|
||||||
|
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
|
||||||
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
|
// Forge 1.21.6+ uses EventBus 7, which shifts most of its runtime validation to compile-time via an annotation processor
|
||||||
|
// to improve performance in production environments. This line is required to enable said compile-time validation
|
||||||
|
// in your development environment, helping you catch issues early.
|
||||||
|
annotationProcessor 'net.minecraftforge:eventbus-validator:7.0-beta.12'
|
||||||
|
|
||||||
|
// Example mod dependency with JEI
|
||||||
|
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
|
||||||
|
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
|
||||||
|
// compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
|
||||||
|
// runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}"
|
||||||
|
|
||||||
|
// Example mod dependency using a mod jar from ./libs with a flat dir repository
|
||||||
|
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
|
||||||
|
// The group id is ignored when searching -- in this case, it is "blank"
|
||||||
|
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
|
||||||
|
|
||||||
|
// For more info:
|
||||||
|
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||||
|
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||||
|
}
|
||||||
|
|
||||||
|
// This block of code expands all declared replace properties in the specified resource targets.
|
||||||
|
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
|
||||||
|
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
|
||||||
|
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
|
||||||
|
tasks.named('processResources', ProcessResources) {
|
||||||
|
var replaceProperties = [
|
||||||
|
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
|
||||||
|
forge_version: forge_version, forge_version_range: forge_version_range,
|
||||||
|
loader_version_range: loader_version_range,
|
||||||
|
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
|
||||||
|
mod_authors: mod_authors, mod_description: mod_description,
|
||||||
|
]
|
||||||
|
inputs.properties replaceProperties
|
||||||
|
|
||||||
|
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
|
||||||
|
expand replaceProperties + [project: project]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Example for how to get properties into the manifest for reading at runtime.
|
||||||
|
tasks.named('jar', Jar) {
|
||||||
|
manifest {
|
||||||
|
attributes([
|
||||||
|
'Specification-Title' : mod_id,
|
||||||
|
'Specification-Vendor' : mod_authors,
|
||||||
|
'Specification-Version' : '1', // We are version 1 of ourselves
|
||||||
|
'Implementation-Title' : project.name,
|
||||||
|
'Implementation-Version' : project.jar.archiveVersion,
|
||||||
|
'Implementation-Vendor' : mod_authors
|
||||||
|
])
|
||||||
|
// attributes['MixinConfigs'] = "${mod_id}.mixins.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Example configuration to allow publishing using the maven-publish plugin
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
register('mavenJava', MavenPublication) {
|
||||||
|
artifact jar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url "file://${project.projectDir}/mcmodsrepo"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
||||||
|
}
|
||||||
|
|
||||||
|
// IntelliJ no longer downloads javadocs and sources by default, this tells Gradle to force IntelliJ to do it.
|
||||||
|
idea.module { downloadJavadoc = downloadSources = true }
|
||||||
|
|
||||||
|
eclipse {
|
||||||
|
// Run everytime eclipse builds the code
|
||||||
|
//autoBuildTasks genEclipseRuns
|
||||||
|
// Run when importing the project
|
||||||
|
synchronizationTasks 'genEclipseRuns'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merge the resources and classes into the same directory, because Java expects modules to be in a single directory.
|
||||||
|
// And if we have it in multiple we have to do performance intensive hacks like having the UnionFileSystem
|
||||||
|
// This will eventually be migrated to ForgeGradle so modders don't need to manually do it. But that is later.
|
||||||
|
sourceSets.each {
|
||||||
|
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
|
||||||
|
it.output.resourcesDir = dir
|
||||||
|
it.java.destinationDirectory = dir
|
||||||
|
}
|
||||||
577
changelog.txt
Normal file
577
changelog.txt
Normal file
@@ -0,0 +1,577 @@
|
|||||||
|
1.21.11 Changelog
|
||||||
|
61.0
|
||||||
|
====
|
||||||
|
- 61.0.3 Fix not being able to sleep. Steve is very tired. (#10736)
|
||||||
|
- 61.0.2 Fix AT lines which didn't work on some old dev environments. Closes #10735
|
||||||
|
- 61.0.1 Bump S2S, fixes patches in UserDev. Closes #1011
|
||||||
|
- 61.0.0 1.21.11 Mounts of Mayhem Release
|
||||||
|
Lots of rendering related changes, specifically for BackedQuad and IQuadTransformers.
|
||||||
|
Removed our deprecated model generators, modders should have been using vanilla's for a while.
|
||||||
|
|
||||||
|
60.1
|
||||||
|
====
|
||||||
|
- 60.1.5 Expose movevector field for usage with MovementInputUpdateEvent (#10732)
|
||||||
|
- 60.1.4 Mark applyServerBinpatches as a dependency of BundleList.
|
||||||
|
Fixes shim jar config
|
||||||
|
- 60.1.3 Split setup and publish commands in actions
|
||||||
|
- 60.1.2 Github Actions
|
||||||
|
- 60.1.1 Fix `BusGroup.DEFAULT` not being trimmed after mod loading completes, also trim mod BusGroups now too (#10721)
|
||||||
|
Saves some memory by trimming various backing collections of loaded EventBuses on the default BusGroup
|
||||||
|
- 60.1.0 1.21.10 RB
|
||||||
|
|
||||||
|
60.0
|
||||||
|
====
|
||||||
|
- 60.0.21 Add `c:nuggets/copper` item tag (#10716)
|
||||||
|
- 60.0.20 Fix ItemStack in RenderTooltipEvent always EMPTY, merges RenderTooltipEvent.Background into .Pre (#10655) (#10702)
|
||||||
|
- 60.0.19 Provide LevelRenderState during frame pass construction Addresses #10867 (#10688)
|
||||||
|
- 60.0.18 Make Mixin dev mode check a little looser (#10713)
|
||||||
|
- 60.0.17 Expand hooks for custom shears (#10704)
|
||||||
|
Fix shearing leads with custom shears (interacting with entity & leash knot)
|
||||||
|
Fix shearing poppy from copper golem for custom shears
|
||||||
|
- 60.0.16 Introduce MixinExtras as an included, optional dependency (#10709)
|
||||||
|
Declare ME in userdev config as an effective compile transitive
|
||||||
|
Co-authored-by: LexManos <LexManos@gmail.com>
|
||||||
|
- 60.0.15 Add workaround for Mixin bug. Closes #10710
|
||||||
|
- 60.0.14 Fix ROIMFS not being on boot classloader for dedicated server.
|
||||||
|
- 60.0.13 Add support for Forge shipping with JarInJar options. (#10683)
|
||||||
|
These are optional libraries that are only loaded when requested by mods.
|
||||||
|
Includes new ReadOnlyInMemoryFileSystem to improve performance of JarInJar parsing.
|
||||||
|
- 60.0.12 Remove generic from AttachCapabilitiesEvent to help prevent modders from having unchecked casts. Closes #10707
|
||||||
|
- 60.0.11 Fix misaligned patch in DedicatedServer
|
||||||
|
- 60.0.10 Revert "Remove runtime mods.toml string substitution (#10698)" (#10701)
|
||||||
|
This reverts commit fc80e3028943237e60024d513f274a30c8457e71, 17ce723edf3f8e53c206db0c0d8838f041db5a04, and 0e6341a23eb206aa946fde648b6429d09e1c8481.
|
||||||
|
- 60.0.9 Add support for custom particle groups (#10692)
|
||||||
|
- 60.0.8 Fix Minecraft version being incorrectly included in Forge mods.toml (#10700)
|
||||||
|
- 60.0.7 Fix universal jar missing Forge version (#10699)
|
||||||
|
- 60.0.6 Remove runtime mods.toml string substitution (#10698)
|
||||||
|
- 60.0.5 Fix Manually created RegistryObjects not being populated. Closes #10686
|
||||||
|
This partially reverts commit 1268d4c3a8acd9f780d2048d5a527206707f8e35.
|
||||||
|
But makes the classes package private so nobody can access.
|
||||||
|
- 60.0.4 Simplify ModLoader#hasCompletedState, some more cleanup to FML internals
|
||||||
|
- 60.0.3 Skip processing vanilla classes in RuntimeDistCleaner when running on a client (#10682)
|
||||||
|
- 60.0.2 Require CapabilityToken subclasses to be anonymous (#10681)
|
||||||
|
- 60.0.1 Improve event javadocs based on community feedback, apply jSpecify to more events
|
||||||
|
- 60.0.0 1.21.10
|
||||||
|
|
||||||
|
59.0
|
||||||
|
====
|
||||||
|
- 59.0.5 Bump EventBus for more javadocs
|
||||||
|
- 59.0.4 Make `BuildCreativeModeTabContentsEvent` a record
|
||||||
|
- 59.0.3 Fix CustomizeGuiOverlayEvent mistakenly being a RecordEvent
|
||||||
|
- 59.0.2 Move more events away from the mod BusGroup (#10676)
|
||||||
|
Also adds more validation to strict mode. See the GitHub PR for further details.
|
||||||
|
- 59.0.1 Add the new vanilla info object to Keyboard and Mouse related events.
|
||||||
|
- 59.0.0 Minecraft 1.21.9 update.
|
||||||
|
There a lot of performance improvements related to events.
|
||||||
|
No more InheritableEvent for abstract events that you shouldn't add listeners to anyway, like EntityEvent. Use their sub-events.
|
||||||
|
Made a lot more events records and interfaces. Mostly just a binary break, but has better performance.
|
||||||
|
Mod bus posting methods are now static, no more ModLoader.get() for those.
|
||||||
|
ObjectHolder was removed, use RegistryObject.
|
||||||
|
Changed RuntimeEnumExtender to only target Minecraft classes. If you want other modders to interact with your API, use an Interface instead of Enum.
|
||||||
|
Moved some abstract event methods to only the relevant sub-events now, e.g. can no longer check the side of a ClientTickEvent, because it'll always be client
|
||||||
|
Rendering has changed a lot, they now batch most things together so that the game will render faster.
|
||||||
|
RenderHighlightEvent changed a lot
|
||||||
|
See https://github.com/MinecraftForge/MinecraftForge-Experimental/tree/1.21.9-dev for unsquashed commits.
|
||||||
|
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
|
||||||
|
|
||||||
|
58.1
|
||||||
|
====
|
||||||
|
- 58.1.6 Fix Crafters not inserting into IItemHandlers. Closes #10667
|
||||||
|
- 58.1.5 Optimize ConcatenatedListView's Iterator and fix hidden CreativeTabs taking up page space.
|
||||||
|
- 58.1.4 [1.21.8] Deprecate global `IExtensibleEnum` support (#10662)
|
||||||
|
This is intended for use with Minecraft classes only. Mod devs can support extending enums through other, more efficient means, such as converting their enum to a record and having static final fields of instances that correspond to each enum value.
|
||||||
|
- 58.1.3 Fix alpha channel of creative mode tab title color (#10661)
|
||||||
|
- 58.1.2 Deprecate JS CoreMods, remove Forge's usages of them (#10659)
|
||||||
|
- 58.1.1 Replace Blocks.FARMLAND checks with instanceof FarmBlock (#10647)
|
||||||
|
- 58.1.0 1.21.8 RB 1
|
||||||
|
|
||||||
|
58.0
|
||||||
|
====
|
||||||
|
- 58.0.10 Add event for adding framepasses (#10612)
|
||||||
|
- 58.0.9 Add ForgeLayeredDraw & AddGuiOverlayLayersEvent as API for gui overlay management. (#10579) (#10611)
|
||||||
|
- 58.0.8 Fix Inactivated activator rails, acting like inactivated powered rails. Closes #10643
|
||||||
|
- 58.0.7 Fix Redstone power propagating between powered and activator rails. Fixed #10642
|
||||||
|
- 58.0.6 Optimize VillagerTradingManager, avoid redundant work. Closes #10577
|
||||||
|
- 58.0.5 Minor cleanup to FML, fix double parsing of mods.toml (#10597)
|
||||||
|
- 58.0.4 Update GradleUtils to 2.6.4 (#10600)
|
||||||
|
- 58.0.3 Sync deps with MC (#10596)
|
||||||
|
- 58.0.2 Allow command suggestions/autocomplete to search all modded paths at once without namespace provided (#10593)
|
||||||
|
- 58.0.1 Optimise WorldWorkerManager (#10578)
|
||||||
|
- 58.0.0 1.21.8 - Intel Graphic Fixes
|
||||||
|
|
||||||
|
57.0
|
||||||
|
====
|
||||||
|
- 57.0.3 Fix crash when clicking links in modlist without being in-world.
|
||||||
|
- 57.0.2 Use vanilla's entrypoint for GameTest servers
|
||||||
|
- 57.0.1 Fix Forge error screen not rendering text correctly. Closes #10569
|
||||||
|
- 57.0.0 Minecraft 1.21.7 - Lava Chickens!
|
||||||
|
|
||||||
|
56.0
|
||||||
|
====
|
||||||
|
- 56.0.9 Bump ASM and EventBus
|
||||||
|
Improves support for Java 25 and better stability of the compile-time EventBus checks, respectively.
|
||||||
|
Co-Authored-By: LexManos <LexManos@gmail.com>
|
||||||
|
- 56.0.8 Add WanderTradesEvent#Pool Constructor with List<ItemListing> and int directly (#10566)
|
||||||
|
- 56.0.7 Fix client commands not working when using clickable commands.
|
||||||
|
- 56.0.6 Add Event for Picture in Picture renderers registration.
|
||||||
|
- 56.0.5 Make more events records
|
||||||
|
- 56.0.4 Fix posting cancellable child events with non-cancellable inheritable parents
|
||||||
|
Also made more events SelfDestructing to save a tad more memory
|
||||||
|
- 56.0.3 Fix wrong order in filter vanilla commands patch. Fixes #10563
|
||||||
|
- 56.0.2 Fix not being able to break blocks in survival. Closes #10561
|
||||||
|
- 56.0.1 Fix bug with strict bulk registration
|
||||||
|
See EventBus#89 for more details
|
||||||
|
- 56.0.0 1.21.6 - New EventBus 7
|
||||||
|
A full rewrite and redesign of the library that offers much better performance, new features and fixes all previous design flaws
|
||||||
|
See the migration guide here: https://gist.github.com/PaintNinja/ad82c224aecee25efac1ea3e2cf19b91
|
||||||
|
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
|
||||||
|
|
||||||
|
55.0
|
||||||
|
====
|
||||||
|
- 55.0.23 Update MDK to fix OOM error and aid getting Mixin setup (#10559)
|
||||||
|
- 55.0.22 Remove legacy patch that caused tripwires to create a loop. Fixes #10558
|
||||||
|
- 55.0.21 Fix warped and crimson fungi not being able to be placed on nylium. (#10544)
|
||||||
|
Fix other PlantType parity issues, add test for all vanilla PlantType blocks.
|
||||||
|
Co-authored-by: LexManos <LexManos@gmail.com>
|
||||||
|
- 55.0.20 Fix modded keybidings being reset to default when reloading. Fixes: #10531
|
||||||
|
- 55.0.19 Deprecate GatherDataEvent.validate() as validation always happens. And made ExistingFileHelper always function. Closes #10516
|
||||||
|
- 55.0.18 Call getToolModifiedState for AXE_STRIP and AXE_WAX_OFF.
|
||||||
|
- 55.0.17 Fix Wood Stripping sound not playing. Fixes #10525
|
||||||
|
- 55.0.16 Fix dedicated server not loading default language files. Fixes #10555
|
||||||
|
- 55.0.15 Make Loot Function without builders Constructors public (#10521)
|
||||||
|
- 55.0.14 Ensure changes from keyboard in ForgeSlider behave as changes from mouse (#10554)
|
||||||
|
- 55.0.13 Add YourKit mention
|
||||||
|
- 55.0.12 Fix creative inventory not displaying item categories correctly. Fixes #10524
|
||||||
|
- 55.0.11 Make unbound tags non-fatal due to Mojang's registry loading order issues. Closes #10524
|
||||||
|
- 55.0.10 Fix PlayerEquipmentInvWrapper offset. Closes #10532
|
||||||
|
- 55.0.9 Deprecate `DistExecutor` for removal (#10198)
|
||||||
|
- 55.0.8 Cleanup early display's internals a bit more (#10538)
|
||||||
|
- 55.0.7 Add ChunkEvent.LightingCalculated, fixes #8354 (#10533)
|
||||||
|
- 55.0.6 Seal most event hierarchies (#10515)
|
||||||
|
Most events in Forge are not designed to be extended by mod devs but technically allowed it before this PR, leading to a risk of unintentional breaking changes for those that do.
|
||||||
|
If you need to extend a Forge event, please let us know so that we can explicitly support that and design it with extending in mind. Note that this change does not affect making your own events that directly extend from EventBus' `Event` class.
|
||||||
|
- 55.0.5 Fix NPE when breeze deflects a projectile (#10535)
|
||||||
|
- 55.0.4 Fix Swords and Pickaxes not using ToolActions (#10520)
|
||||||
|
- 55.0.3 Fix bundles causing crash upon inserting item. Closes #10509
|
||||||
|
- 55.0.2 Add DeferredRegistryData to help with generating data driven registry entries.
|
||||||
|
Revive GameTest system and make all but one Forge Test mod pass.
|
||||||
|
- 55.0.1 Fix Mod List Screen's render layout and scroll bars.
|
||||||
|
- 55.0.0 Minecraft 1.21.5
|
||||||
|
Co-authored-by: Ven <tudurap.com@gmail.com>
|
||||||
|
Co-authored-by: Jonathing <me@jonathing.me>
|
||||||
|
|
||||||
|
54.1
|
||||||
|
====
|
||||||
|
- 54.1.3 Add Pumpkin Block and Item Tags (#10482)
|
||||||
|
- 54.1.2 Add '#forge:chorus_additionally_grows_on' tag for similar mechanics to '#minecraft:azalea_grows_on' but for chorus (#10459)
|
||||||
|
- 54.1.1 Fix Hanging Pale Moss not dropping with modded shears (#10414)
|
||||||
|
- 54.1.0 1.21.4 RB 1
|
||||||
|
https://forums.minecraftforge.net/topic/154394-forge-541-minecraft-1214/
|
||||||
|
|
||||||
|
54.0
|
||||||
|
====
|
||||||
|
- 54.0.38 Fix corrupted and invalidly symlinked worlds crashing on level select (#10406)
|
||||||
|
- 54.0.37 Add fast graphics render type to block model jsons (#10394)
|
||||||
|
Make modded leaves behave like vanilla leaves by default (Fixes #10389)
|
||||||
|
- 54.0.36 Add updated tag context to AddReloadListenerEvent (#10412)
|
||||||
|
Fixes using custom tags in GlobalLootModifiers.
|
||||||
|
- 54.0.35 Give ItemStack context to IForgeItem.getCapabilityProvider (#10404)
|
||||||
|
- 54.0.34 Re-introduce ItemStack Capabilities (#10324)
|
||||||
|
- 54.0.33 Fix redstone updates for comparators going up/down incorrectly. Related: #9973
|
||||||
|
- 54.0.32 Fix forced chunks never being ticked by the server (#10325)
|
||||||
|
- 54.0.31 Fix redstone update order not matching vanilla. (#10392)
|
||||||
|
- 54.0.30 Fix game test structure rotations being inconsistant (#10391)
|
||||||
|
- 54.0.29 Re-introduce IForgeItem.damageItem when an item takes damage, Fixes #10344 (#10371)
|
||||||
|
- 54.0.28 Gate client test mods behind clientSideOnly (#10390)
|
||||||
|
- 54.0.27 Fix issue with superclass event listeners by updating EventBus (#10384)
|
||||||
|
- 54.0.26 Bump dependencies, most notably EventBus (#10370)
|
||||||
|
- CoreMods 5.2.4 -> 5.2.6
|
||||||
|
- EventBus 6.2.15 -> 6.2.26
|
||||||
|
- Reduced memory usage
|
||||||
|
- Further performance improvements
|
||||||
|
- Fixed EventBus#39, unregistered listeners are now immediately reclaimable by the GC
|
||||||
|
- Apache MavenArtifact 3.8.5 -> 3.8.8
|
||||||
|
- NightConfig 3.7.3 -> 3.7.4
|
||||||
|
- 54.0.25 Fix shield disabling being completely ignored (#10316)
|
||||||
|
- 54.0.24 Update Gradle to 8.12.1
|
||||||
|
- 54.0.23 Fix JOpt Simple by updating ModLauncher (#10347)
|
||||||
|
- 54.0.22 GameTestHelper additions (#10338)
|
||||||
|
Co-authored-by: LexManos <LexManos@gmail.com>
|
||||||
|
- 54.0.21 Add `c:flowers`, `c:flowers/tall`, and `c:flowers/small` block and item tags (#10335)
|
||||||
|
Co-authored-by: TelepathicGrunt <40846040+telepathicgrunt@users.noreply.github.com>
|
||||||
|
- 54.0.20 Fix JOpt Simple needing a strict version requirement declaration (#10311)
|
||||||
|
- 54.0.19 Fix incorrect method reference in TntBlock.explode() (#10326)
|
||||||
|
- 54.0.18 Fix issues in VillagerTrades.EmeraldsForVillagerTypeItem related to custom Villager Types (#10298)
|
||||||
|
Add VillagerType#registerBiomeType
|
||||||
|
- 54.0.17 Fix render_type in block models not being used. Fixes #10294
|
||||||
|
- 54.0.16 Bump dependencies (#10274)
|
||||||
|
- EventBus 6.2.8 -> 6.2.15
|
||||||
|
- Bootstrap 2.1.7 -> 2.1.8
|
||||||
|
- SecureModules 2.2.20 -> 2.2.21
|
||||||
|
- AccessTransformers 8.2.0 -> 8.2.1
|
||||||
|
- ModLauncher 10.2.2 -> 10.2.3
|
||||||
|
These bumps include further clean-up and optimisations.
|
||||||
|
- 54.0.15 Simplify Title Screen Brandings (#10287)
|
||||||
|
- 54.0.14 Clean and fix Forge's internal coremods, fixes finalizeSpawn hook. (#10271)
|
||||||
|
- 54.0.13 Update jline for better darwin/arm64 support Fixes #10107 (#10279)
|
||||||
|
- 54.0.12 Bump CoreMods to 5.2.4 (#10262)
|
||||||
|
- 54.0.11 Allow mipmap lowering to be disabled (#10242)
|
||||||
|
- 54.0.10 Manage FileWatcher instance per ConfigFileTypeHandler (#10213)
|
||||||
|
- 54.0.9 Skip processing Forge classes in `RuntimeDistCleaner` (#10199)
|
||||||
|
Mod classes are still transformed as usual
|
||||||
|
- 54.0.8 Skip Forge classes in the RuntimeEnumExtender transformer (#10197)
|
||||||
|
Mod classes are still transformed as usual
|
||||||
|
- 54.0.7 Add hooks for using Vanilla's new Client data generator (#10206)
|
||||||
|
Add new hook for custom block models that do not have real blocks backing them
|
||||||
|
Some workspace cleanup fixing log4j annotation processor
|
||||||
|
- 54.0.6 Deprecate `@ObjectHolder`, add a couple of fast-paths (#10195)
|
||||||
|
- 54.0.5 Bump Bootstrap which has a slight performance boost during dev time.
|
||||||
|
- 54.0.4 Speed up mod annotation scanning by ~30%
|
||||||
|
- 54.0.3 Skip Vanilla classes for the CapabilityTokenSubclass transformer (#10196)
|
||||||
|
- 54.0.2 Simplify memory usage display on loading screen (#10193)
|
||||||
|
Co-authored-by: TelepathicGrunt <40846040+telepathicgrunt@users.noreply.github.com>
|
||||||
|
- 54.0.1 Fix custom particles causing crash
|
||||||
|
- 54.0.0 Minecraft 1.21.4
|
||||||
|
|
||||||
|
53.0
|
||||||
|
====
|
||||||
|
- 53.0.25 Remove debug code. Closes #10182
|
||||||
|
- 53.0.24 Pass the Holder<Enchantment> to Item.canApplyAtEnchantingTable. Closes #10181
|
||||||
|
- 53.0.23 Fix incorrect patch
|
||||||
|
- 53.0.22 Change vanilla registry order to last-seen. Closes #10179
|
||||||
|
- 53.0.21 Call IUnbakedGeometry.bake from BlockModel Closes #10178
|
||||||
|
- 53.0.20 Cleanup some warnings
|
||||||
|
- 53.0.19 Fix not being able to swim in lava
|
||||||
|
- 53.0.18 Move mdk back to com/example/examplemod to align with what people expect.
|
||||||
|
- 53.0.17 Move MDK example to test sourceset and fix Item/Block registration example. Closes #10139
|
||||||
|
- 53.0.16 Added support for using optional tags on Forge registries
|
||||||
|
Add DeferredRegister.key(name) helper function to make ResourceKey creation easier
|
||||||
|
Fix TagManager not binding tags
|
||||||
|
Fix Unbound Tag Exception when modders register tags during Register events Closes #10154
|
||||||
|
- 53.0.15 Fix empty tag conditional recipe test
|
||||||
|
- 53.0.14 Fixed missed call to getFriction hook in AbstractBoat
|
||||||
|
- 53.0.13 Pass player argument when firing `OnDatapackSyncEvent` (#10170)
|
||||||
|
- 53.0.12 Cleanup lifecycle transitions
|
||||||
|
Fix mod ordering for multi-mod jars
|
||||||
|
Make dependency resolution issues easier to debug/diagnose
|
||||||
|
- 53.0.11 Bump CoreMods to 5.2 (#10156)
|
||||||
|
Full Changelog:
|
||||||
|
https://gist.github.com/Jonathing/c3ad28b2a048ac839a7baba5417ee870
|
||||||
|
The key features are:
|
||||||
|
- ES6 language support
|
||||||
|
- Thoroughly updated ASMAPI, with full documentation
|
||||||
|
- Bug fixes (some optional for backwards-compatibility)
|
||||||
|
- Partial internal code cleanup
|
||||||
|
- 53.0.10 Fix PlayerRenderer#render invoking RenderLivingEvent and not RenderPlayerEvent (#10167)
|
||||||
|
- 53.0.9 Fix Powered Rails acting like Activator Rails due to misaligned patch
|
||||||
|
- 53.0.8 Properly allow normal mods.toml mods to specify the module names and use a full module-info.
|
||||||
|
Make FMLModContainer read and apply Add-Opens and Add-Exports manifest entries from mod files.
|
||||||
|
Forge is now the `net.minecraftforge.forge` module instead of `forge`
|
||||||
|
https://forums.minecraftforge.net/topic/153333-proper-java-module-support-in-forge-mods/
|
||||||
|
- 53.0.7 Fix LootTableLoadEvent not being fired. Closes #10144
|
||||||
|
- 53.0.6 Fix items with use durations of 0 being repeatedly used when use button is held down. Fixed #10150
|
||||||
|
- 53.0.5 Add AT for BlockEntityType constructor. (#10149)
|
||||||
|
- 53.0.4 Add `c:stripped_logs` and `c:stripped_woods` tags (#10146)
|
||||||
|
- 53.0.3 Bump CoreMods and ASM (#10145)
|
||||||
|
CoreMods 5.1.13 changelog: https://gist.github.com/Jonathing/905d142447ecef670526ae27243adbba
|
||||||
|
- 53.0.2 Remove redundant rendering options (#10140)
|
||||||
|
- 53.0.1 Fix pause menu having a black background, reverts PR #10115
|
||||||
|
- 53.0.0 1.21.3 update
|
||||||
|
|
||||||
|
52.0
|
||||||
|
====
|
||||||
|
- 52.0.22 Add `c:foods/pie` tag (#10135)
|
||||||
|
Replaces `forge:foods/pie`, which is now deprecated.
|
||||||
|
- 52.0.21 Fix back-compat with legacy `forge:` tags (#10126)
|
||||||
|
- 52.0.20 Implement the de-facto common tags, add many new Forge tags (#9955)
|
||||||
|
https://forums.minecraftforge.net/topic/152815-common-tags-in-forge/
|
||||||
|
- 52.0.19 Patch BlockEntity.java to use getType Method (#10124)
|
||||||
|
- 52.0.18 Fix and cleanup RuntimeDistCleaner
|
||||||
|
- 52.0.17 Sync component registry ids
|
||||||
|
Fix deprecation typo
|
||||||
|
Bump ModLauncher (better stack traces)
|
||||||
|
Set Automatic-Module-Name
|
||||||
|
- 52.0.16 Fix layering of translucent sprites being broken by re-adding blur call Mojang removed (#10115)
|
||||||
|
- 52.0.15 Cleanup length and size checks (#10108)
|
||||||
|
- 52.0.14 Update vulnerable `eclipse` dependency (#10109)
|
||||||
|
- 52.0.13 Add and fire SystemMessageReceivedEvent
|
||||||
|
Replaces ClientChatReceivedEvent.System which was not fired due to Mojang changing ChatType to a registry.
|
||||||
|
- 52.0.12 Fix highlighted item tooltip rendering twice. Closes #10112
|
||||||
|
- 52.0.11 Fix Network hooks not being initialized on GameTestServer (#10081)
|
||||||
|
Add rudimentary custom networking tests.
|
||||||
|
- 52.0.10 Fix inverted logic in TagEmptyCondition (#10069)
|
||||||
|
- 52.0.9 [1.21.1] Optionally supply `FMLJavaModLoadingContext` as a param to mod constructors (#10074)
|
||||||
|
Also made `FMLJavaModLoadingContext` extend `ModLoadingContext`. See the PR description for example usage.
|
||||||
|
- 52.0.8 Fix issues with `QuadBakingVertexConsumer` and Forge's OBJ loader (#10065)
|
||||||
|
- 52.0.7 Fire `OnDatapackSyncEvent` when a player joins a server (#10076)
|
||||||
|
- 52.0.6 Add a few Method Helpers onto ResourceKey to make getting Data Driven Entries Simpler (#10071)
|
||||||
|
- 52.0.5 Fix network channels not initializing during server transfers. Closes #10067
|
||||||
|
- 52.0.4 [1.21.1] ModLoading cleanup and optimisations (#10052)
|
||||||
|
- 52.0.3 Properly ignore unknown mod files (#10063)
|
||||||
|
- 52.0.2 Add level access to Item.TooltipContext if available.
|
||||||
|
- 52.0.1 Load mods that declare explicit 1.21 compatibility as 1.21.1 is a minor bugfix.
|
||||||
|
- 52.0.0 1.21.1
|
||||||
|
|
||||||
|
51.0
|
||||||
|
====
|
||||||
|
- 51.0.33 Removed unneeded boat patch related to MC-119811 (#10061)
|
||||||
|
- 51.0.32 Fix network sync of custom datapack registries.
|
||||||
|
Add gametest to verify that it functions.
|
||||||
|
- 51.0.31 Add a way to render tooltips from Formatted text and TooltipComponents elements (#10056)
|
||||||
|
- 51.0.30 Fix custom creative tabs with search listing all items instead of just their own.
|
||||||
|
- 51.0.29 Patch CropBlock to use instanceOf FarmBlock check instead of hard coding to Blocks.FARMLAND (#10044)
|
||||||
|
- 51.0.28 Fix ItemStack sensitive getDefaultAttributeModifiers not being called.
|
||||||
|
- 51.0.27 Add missed @user_jvm_args.txt to run.bat
|
||||||
|
- 51.0.26 Fix `onPlaceItemIntoWorld` always resetting item stack when in creative mode (#10047)
|
||||||
|
- 51.0.25 Fix matrix stack translations for `RenderHighlightEvent` (#10050)
|
||||||
|
- 51.0.24 Fix Global Loot Modifier deserialization not having registry access. Closes #10042 and #10043
|
||||||
|
- 51.0.23 Bump Mixin to 0.8.7 and allocate more ram to java compile tasks.
|
||||||
|
- 51.0.22 Use the new `fire()` and Result#isAllowed/isDenied/isDefault methods from EventBus (#10028)
|
||||||
|
- 51.0.21 Some build cleanup
|
||||||
|
- 51.0.20 Make HangingSignBlockEntity useable with custom BlockEntityTypes. #10038
|
||||||
|
- 51.0.19 Send last PoseStack pos to RenderLevelStageEvent AFTER_PARTICLES stage. Fixes #10031
|
||||||
|
- 51.0.18 Fix compile errors in MDK (#10029)
|
||||||
|
- 51.0.17 Fix converting dirt to mud consumes whole bottle (not just emptying) Closes #10027
|
||||||
|
- 51.0.16 Add support for named sub-caps
|
||||||
|
- 51.0.15 Fix conditional checking swallowing decoding errors when loading registry entries from datapacks. Fixes #9995
|
||||||
|
- 51.0.14 Apply license headers
|
||||||
|
- 51.0.13 Some code cleanup in ModInfo/ModFileInfo to use less streams and make things easier to debug.
|
||||||
|
- 51.0.12 Bump NightConfig to 3.7.3, to fix toml sub-configs being completely broken. Fixes #10015
|
||||||
|
- 51.0.11 Make ForgeSpawnEgg assume color is opaque if alpha is set to 0.
|
||||||
|
Fixes "invisible" spawn eggs by default, but still allows modders to specify partial transparency.
|
||||||
|
- 51.0.10 Fixed perspective rendering in SeparateTransformsModel (#10014)
|
||||||
|
- 51.0.9 Fix missed PartEntity patch in Player.attack (#10011)
|
||||||
|
- 51.0.8 Choose default JarJar mod file type based on parent JAR Closes #9939
|
||||||
|
- 51.0.7 Fixed falling block entities not rendering as moving blocks (#10006)
|
||||||
|
- 51.0.6 Bump Night Config, Should fix #9122
|
||||||
|
- 51.0.5 Fix ClientTickEvent not firing properly.
|
||||||
|
- 51.0.4 Change tick event to have pre/post classes (#9890)
|
||||||
|
- 51.0.3 Fix Bogged and Wolf armor not being shearable by custom shears. Closes #10005
|
||||||
|
- 51.0.2 Set team city branch
|
||||||
|
- 51.0.1 Remove Non-HolderLookup methods from INBTSerializeable and mark it as deprecated in favor of using Vanilla's new Component system. Closes #9998
|
||||||
|
- 51.0.0 1.21 Update
|
||||||
|
Co-authored-by: RealMangoRage <64402114+RealMangorage@users.noreply.github.com>
|
||||||
|
Co-authored-by: Daniel Norris <dnorris443@gmail.com>
|
||||||
|
Co-authored-by: Ven <tudurap.com@gmail.com>
|
||||||
|
|
||||||
|
50.1
|
||||||
|
====
|
||||||
|
- 50.1.3 Cleanup FML Bindings (#10004)
|
||||||
|
- 50.1.2 Fix NPE when calling ForgeHooks.getDefaultCreatorModId(ItemStack) on Spawn Eggs. Closes #10002
|
||||||
|
- 50.1.1 Fix boat travel distance being incorrect. Closes #9997
|
||||||
|
- 50.1.0 1.20.6 RB 1
|
||||||
|
https://forums.minecraftforge.net/topic/149458-forge-501-minecraft-1206/
|
||||||
|
|
||||||
|
50.0
|
||||||
|
====
|
||||||
|
- 50.0.37 Fix minor typo in MDK build.gradle
|
||||||
|
- 50.0.36 Fire EntityInteractSpecific on server side. Closes #9984
|
||||||
|
- 50.0.35 Unlock wrapped registries when firing register events.
|
||||||
|
- 50.0.34 Update Bootstrap to improve the Java version check error message (#9990)
|
||||||
|
- 50.0.33 Minor cleanup to ModListScreen and VersionChecker (#9988)
|
||||||
|
- 50.0.32 Prevent the `@OnlyIn` being misused on `@EventBusSubscriber` and `@Mod` annotated classes (#9891)
|
||||||
|
- 50.0.31 Fix CustomizeGuiOverlayEvent.DebugText and CustomizeGuiOverlayEvent.Chat not being fired. (#9982)
|
||||||
|
- 50.0.30 Actually fix creative tab count, IDE didn't save the file before regenning patches.
|
||||||
|
- 50.0.29 Move Creative Inventory page count to fix issue with partially transparent tooltips. Closes #9983
|
||||||
|
- 50.0.28 Make OpenContainer and SpawnEntity packets process on main game thread.
|
||||||
|
- 50.0.27 Add File.exists check to ConfigFileTypeHandler. Closes #9976
|
||||||
|
- 50.0.26 Fix crash when reloading a world that uses custom placed features. Closes #9979
|
||||||
|
- 50.0.25 Fix NPE in HurtByTargetGoal when mods set targets to null. Closes #7853
|
||||||
|
- 50.0.24 Fix RenderHandEvent firing with incorrect hand and item for offhand items. (#9977)
|
||||||
|
- 50.0.23 Fix screen layering and re-add the test. (#9978)
|
||||||
|
- 50.0.22 Add GatherComponentsEvent (#9944)
|
||||||
|
- 50.0.21 Fix powered rails not propogating correctly.
|
||||||
|
- 50.0.20 Remove ICustomPacket and add PayloadChannel. (#9972)
|
||||||
|
New PayloadChannel that uses the vanilla payload Type for packet distinction
|
||||||
|
Implement the minecraft:register/unregister channels using the new PayloadChannel
|
||||||
|
New generic channel builder function allowing people to implement channels however they want.
|
||||||
|
- 50.0.19 Implement entity aware armor model and texture hooks. Closes #9960
|
||||||
|
- 50.0.18 Fix finalizeSpawn's return value not being used correctly. Closes #9964
|
||||||
|
- 50.0.17 Fix Biome patch change that caused our field redirect coremod to not function correctly.
|
||||||
|
- 50.0.16 Make RegistryObject.getHolder lazy, Should help cases where vanilla registries use holders from other vanilla registries. Closes #9961
|
||||||
|
- 50.0.15 Ignore jar files in the mods folder that are not Forge mods. Closes #9968
|
||||||
|
- 50.0.14 Fix canceling MobSpawnEvent.FinalizeSpawn causing a NPE closes #9971
|
||||||
|
- 50.0.13 Fix potion brewing having arguments reversed. Closes #9970
|
||||||
|
- 50.0.12 Fix Melons/Pumpkins not growing correctly.
|
||||||
|
- 50.0.11 Some patch cleanup (#9951)
|
||||||
|
- 50.0.10 Filter paths discovered by ServiceProvider in ClasspathLocator. Closes #9899
|
||||||
|
- 50.0.9 Update SimpleChannel to make StreamCodecs easier (#9959)
|
||||||
|
Rework networking so that RegistryFriendlyByteBuf is useable for modders
|
||||||
|
Simple support for StreamCodec in SimpleChannel
|
||||||
|
Codecify all Forge packets
|
||||||
|
Make simpler builder pattern for SimpleChannel. Will eventually deprecate the old MessageBuilder as it's verbose and poorly written.
|
||||||
|
Co-authored-by: MrCrayfish <4958241+MrCrayfish@users.noreply.github.com>
|
||||||
|
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
|
||||||
|
- 50.0.8 Fix shields not working correctly. Fixes #9966
|
||||||
|
- 50.0.7 Fix RenderTarget stencil patch location. Fixes #9965
|
||||||
|
- 50.0.6 Add ModelLayers patch back (#9962)
|
||||||
|
- 50.0.5 Fix canApplyAtEnchantingTable null pointer, Closes #9956
|
||||||
|
Bump SecureModules for package info and multi-release jar fixes.
|
||||||
|
- 50.0.4 Remove zombie chance config options (#9950)
|
||||||
|
- 50.0.3 Remove deprecated compressLanIPv6Addresses config option (#9949)
|
||||||
|
LAN IPv6 addresses are always compressed these days, so this config option is redundant
|
||||||
|
- 50.0.2 Fix custom payloads not being handled on the server in the game state. Closes #9948
|
||||||
|
Fix villagers not opening trade guis. Closes #9946
|
||||||
|
- 50.0.1 Fix MDK by bumping FG and disabling reobf tasks
|
||||||
|
Fix LAN server IPs being duplicated
|
||||||
|
Fix connecting to vanilla servers due to misapplied patch.
|
||||||
|
- 50.0.0 1.20.6 Initial Update
|
||||||
|
New Decompiler
|
||||||
|
Runtime Official mappings
|
||||||
|
ItemStacks arnt Capability providers anymore, use Vanilla's system.
|
||||||
|
Co-authored-by: RealMangoRage <64402114+RealMangorage@users.noreply.github.com>
|
||||||
|
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
|
||||||
|
|
||||||
|
49.0
|
||||||
|
====
|
||||||
|
- 49.0.49 Make non-Forge mods.toml detection more robust (#9935)
|
||||||
|
- 49.0.48 Fix early window crash when parsing some forms of options.txt (#9933)
|
||||||
|
- 49.0.47 Fix edge-case regression with single-jar multiloader mods (#9931)
|
||||||
|
- 49.0.46 Add ClientPauseChangeEvent (#9905)
|
||||||
|
- 49.0.45 Improve mod loading errors (#9870)
|
||||||
|
- 49.0.44 Early display fixes/workarounds for buggy drivers (#9921)
|
||||||
|
- 49.0.43 Prevent registering null tiers (#9895)
|
||||||
|
Makes it easier to identify broken mods, as it moves the crash to when the broken mod in question registers the tier, rather than when any mod tries getting the tier.
|
||||||
|
- 49.0.42 Add helper method to `OnDatapackSyncEvent` (#9901)
|
||||||
|
Co-authored-by: blockingHD <9372035+blockinghd@users.noreply.github.com>
|
||||||
|
- 49.0.41 Fix NPE when acceptableValues in defineInList() does not allow nulls, fixes #9300 (#9903)
|
||||||
|
- 49.0.40 [1.20.x] Add ByteValue, ShortValue and FloatValue to ForgeConfigSpec, cleanup code (#9902)
|
||||||
|
- 49.0.39 Add Leaves method to ModelProvider.java (#9887)
|
||||||
|
- 49.0.38 Bump bootstrap
|
||||||
|
- 49.0.37 Fix level data not loading from existing worlds. Whole system needs a re-write.
|
||||||
|
- 49.0.36 Fix modlist size
|
||||||
|
- 49.0.35 Bump Bootstrap
|
||||||
|
- 49.0.34 Optimize Entity capabilities a bit by reordering conditions (#9886)
|
||||||
|
- 49.0.33 [1.20.x] Make common config screen registration tasks easier (#9884)
|
||||||
|
- 49.0.32 [1.20.4] Add CPU usage config option to early window, hide it by default (#9866)
|
||||||
|
- 49.0.31 Fix DatapackBuiltinEntriesProvider issues with forge registries, Fixes #9874
|
||||||
|
- 49.0.30 Readded DatapackBuiltinEntriesProvider (#9848)
|
||||||
|
- 49.0.29 Fix slightly offset mods screen link positioning (#9860)
|
||||||
|
Co-authored-by: Dennis C <11262040+XFactHD@users.noreply.github.com>
|
||||||
|
- 49.0.28 Fix DNS SRV record lookup not working by hacking the module system. Closes #9846
|
||||||
|
- 49.0.27 Add null check to DimensionDataStorage. Fixes #9859
|
||||||
|
- 49.0.26 Fix cases where LivingConversionEvents were not fired for vanilla conversions. Closes #9850
|
||||||
|
- 49.0.25 Update licenser plugin, and re-run it. Closes #9855
|
||||||
|
- 49.0.24 Fix background music looping when it shouldn't
|
||||||
|
- 49.0.23 Fix Criterion Test Mod
|
||||||
|
- 49.0.22 Improve help text on server Java check failure
|
||||||
|
- 49.0.21 [1.20.4] Restore the option of server run scripts (#9849)
|
||||||
|
Executable server jar is still a thing, but the run scripts are restored as an option for those that prefer it.
|
||||||
|
- 49.0.20 [1.20.x] More buildscript clean-up (#9845)
|
||||||
|
- 49.0.19 Fixed Spelling error in credits.txt (#9694)
|
||||||
|
- 49.0.18 Bump JarJar to fix more issues with UnionFileSystem assumptions.
|
||||||
|
- 49.0.17 Criterion test mod + unit test (#9744)
|
||||||
|
- 49.0.16 Fix launcher version name missing - between `forge` and the version. Closes #9843
|
||||||
|
- 49.0.15 Bump JarJar and SecureModule to fix issue with jars containing [] in their name. Closes #9842
|
||||||
|
- 49.0.14 Only add sorted/deduplicated mods to the classpath.
|
||||||
|
Fixes some mods causing the Forge error displays to break. Closes #9833
|
||||||
|
- 49.0.13 Improve server panel compatibility (#9836)
|
||||||
|
- 49.0.12 Make common DisplayTest registration tasks easier (#9822)
|
||||||
|
- 49.0.11 Cleanup Explosion patch but keep bin compatibility by using asm hacks. Closes #9817
|
||||||
|
- 49.0.10 Bump SecureModules, Closes #9820
|
||||||
|
- 49.0.9 Support pack overlay system. Closes #9818
|
||||||
|
- 49.0.8 Fix Server bundle
|
||||||
|
- 49.0.7 Optimise ForgeConfigSpec and make Range public (#9810)
|
||||||
|
- 49.0.6 Add `clientSideOnly` feature to mods.toml (#9804)
|
||||||
|
- 49.0.5 Add impl. of `IModFileInfo#showAsDataPack` (#9802)
|
||||||
|
- 49.0.4 Get rid of LibraryFinder
|
||||||
|
- 49.0.3 1.20.4 - Minor bug fix from Mojang
|
||||||
|
- 49.0.2 Fix java version check in bootstrap shim
|
||||||
|
- 49.0.1 1.20.3 Initial Update
|
||||||
|
https://forums.minecraftforge.net/topic/139822-forge-490-minecraft-1203/
|
||||||
|
- 49.0.0 Revive executable jars for the dedicated server
|
||||||
|
This has a minor change to development time build scripts. So developers, check the MDK
|
||||||
|
|
||||||
|
48.1
|
||||||
|
====
|
||||||
|
- 48.1.0 1.20.2 RB 1 - https://forums.minecraftforge.net/topic/139824-forge-481-minecraft-1202/
|
||||||
|
|
||||||
|
48.0
|
||||||
|
====
|
||||||
|
- 48.0.49 Implemented ClientPauseEvent/Hook (#9782)
|
||||||
|
- 48.0.48 Datagen addOptionalTag/s methods that allow passing the TagKey itself instead of passing the location (#9807)
|
||||||
|
- 48.0.47 Deprecate EntityRenderersEvent.AddLayers functions that hard case to LivingEntityRenderers as the backing maps do not guarantee that type. Closes #9683
|
||||||
|
- 48.0.46 Fix TagLoader error not printing tag name correctly. Closes #9693
|
||||||
|
- 48.0.45 Fix LoadingErrorScreen inner headers are not centered. Closes #9687
|
||||||
|
- 48.0.44 Rework KeyModifiers system to properly allow keybinds to be triggered when multiple modifiers are pressed.
|
||||||
|
Fix setting keybinds whel using keyboard inputs to select the menu. Closes #9793
|
||||||
|
- 48.0.43 Fix KeyModifiers not being properly taken into account. Closes #9806
|
||||||
|
- 48.0.42 Don't turn off VSync when rendering from Minecraft context (#9800)
|
||||||
|
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
|
||||||
|
- 48.0.41 [1.20.x] Fix rare crash with early display window, fixes #9673 (#9798)
|
||||||
|
Co-Authored-By: embeddedt <42941056+embeddedt@users.noreply.github.com>
|
||||||
|
- 48.0.40 Move Chunk Watch/Unwatch events to fire after sync packets have been sent to the client (#9790)
|
||||||
|
This makes sure that modders who send extra chunk data will have clients who know about the chunk.
|
||||||
|
- 48.0.39 Add more sanitization to the ChannelListManager because other projects like to impose arbitrary critical restrictions. Closes #9789 #9772
|
||||||
|
- 48.0.38 Fix tag loading being unordered. Closes #9774
|
||||||
|
- 48.0.37 Fix texture UV values for obj models. Closes #9737 (#9767)
|
||||||
|
- 48.0.36 Gradle 8.4 (#9778)
|
||||||
|
- 48.0.35 Make Ingredient check for invalidation on getItems(), invalidate ingredients on tags update (#9688)
|
||||||
|
- 48.0.34 Improve mod description formatting in mods screen (#9768)
|
||||||
|
- 48.0.33 Fix lowcode implementation version, now that it's actually labeling the correct package.
|
||||||
|
- 48.0.32 Buildscript cleanup and organization.
|
||||||
|
Updated to use newer libraries that reduce the command line arguments needed to run the game.
|
||||||
|
Fix issues in the SecureModule's classloader that caused resources to not be seen when they are on parent module layers.
|
||||||
|
- 48.0.31 Fix @GameTestGenerator not functioning correctly. Closes #9748
|
||||||
|
- 48.0.30 Optimise registries by using fastutils collections to minimize boxing. (#9749)
|
||||||
|
- 48.0.29 Minor MDK changes (#9750)
|
||||||
|
- 48.0.28 Improve mod loading error message for errors inside mod constructors (#9751)
|
||||||
|
- 48.0.27 Add a CrashReportAnalyser that tries to identify the mod that crashed the game (#9732)
|
||||||
|
- 48.0.26 Fix potential threading issue when registering CriteriaTriggers. Closes #9745
|
||||||
|
- 48.0.25 Move to a cache based crowdin solution instead of hitting the api every build.
|
||||||
|
- 48.0.24 Fix Melon/Pumpkin stems having wrong plat type causing them to remain after trampling farmland. Fixes #9495
|
||||||
|
- 48.0.23 Fix loot tables not having their ids set.
|
||||||
|
- 48.0.22 Make horses and llama's fire LivingFallEvent. Fixes #9743
|
||||||
|
- 48.0.21 Fix advancement screen being too dark. Fixes #9727
|
||||||
|
- 48.0.20 Fix ConditionalCodec having an inverted test. Closes #9742
|
||||||
|
Remove clean project on CI.
|
||||||
|
Bump FG version to fix transitive issue on module path.
|
||||||
|
- 48.0.19 More buildscript work
|
||||||
|
Fixed ignoreList for client and server.
|
||||||
|
Lazy configured a few more tasks
|
||||||
|
Fixed early loading screen hardcoded names.. why?
|
||||||
|
- 48.0.18 Bump guava to module path for jimfs. Fixes dedicated server.
|
||||||
|
- 48.0.17 Revive custom ingredient types.
|
||||||
|
- 48.0.16 Revive ConditionalRecipe and ConditionalAdvancement.
|
||||||
|
Also directly add conditional support to all vanilla recipe data generators.
|
||||||
|
- 48.0.15 Rewrite our GameTest hooks to be sane.
|
||||||
|
Add game test to GlobalLootModifierTest which validates the smelting modifiers.
|
||||||
|
Removed FakePlayer system, it's broken and needs a major rewrite.
|
||||||
|
- 48.0.14 Cleanup FMLLoader and Launch Handlers.
|
||||||
|
Cleanup some of the build.gradle
|
||||||
|
Start work on restructuring test mods. They are now treated as their own jars, as well as having their mods.toml auto-generated. No more mods.toml conflicts!
|
||||||
|
Add pattern matching support to Data run modlist.
|
||||||
|
- 48.0.13 Fix Slot Index for Inventory Ticking Items (#9736)
|
||||||
|
- 48.0.12 Make default Entity.getAddPacket automatically use Forge's enhanced spawn packet if nessasary.
|
||||||
|
This spawn packet needs to be re-designed, it is effectively only there to hook into creating the new entity instance. This will be re-evaluated during the cleanup in 1.21+
|
||||||
|
- 48.0.11 Optimise path filter in mod loading (#9710)
|
||||||
|
Co-authored-by: embeddedt <42941056+embeddedt@users.noreply.github.com>
|
||||||
|
- 48.0.10 Fix ignitedByLava making blocks permanently flammable (#9735) Fixes #9730
|
||||||
|
- 48.0.9 Some BackgroundScanHandler code cleanup. Closes #9713
|
||||||
|
- 48.0.8 Fix missed patch causing new onInventoryTick method to not be called.
|
||||||
|
- 48.0.7 Fixed PlayerDestroyItemEvent not triggering for Fishing Rods (#9729)
|
||||||
|
- 48.0.6 Fix migration error causing nether and end portals to not function properly.
|
||||||
|
- 48.0.5 Optimise `ForgeRegistry#validateContent` by removing optimization that ModLauncher broke. (#9715)
|
||||||
|
- 48.0.4 Fix double message encoding in `Channel#toVanillaPacket` #9721 (#9722)
|
||||||
|
Fix OpenContainer message not resetting reader index of additional data.
|
||||||
|
- 48.0.3 Make CriteriaTriggers#register public again. Closes #9723
|
||||||
|
- 48.0.2 Fix Hunger bar rendering incorrectly. Fixes #9725
|
||||||
|
- 48.0.1 Send known channels to the server when they send us theirs.
|
||||||
|
- 48.0.0 1.20.2 Release
|
||||||
|
|
||||||
|
47.999
|
||||||
|
======
|
||||||
|
- 47.999.12 Enable ForgeLootTableProvider.
|
||||||
|
- 47.999.11 Global Loot Modifiers
|
||||||
|
- 47.999.10 Move old tests.
|
||||||
|
- 47.999.9 1.20.2-rc2
|
||||||
|
- 47.999.8 1.20.2-rc1
|
||||||
|
- 47.999.7 1.20.2-pre4
|
||||||
|
- 47.999.6 1.20.2-pre3
|
||||||
|
- 47.999.5 Use official mappings for in-repo patches, will be converted to SRG during build.
|
||||||
|
- 47.999.4 1.20.2-pre2
|
||||||
|
- 47.999.3 Fix debug overlay text not rendering.
|
||||||
|
- 47.999.2 Make SimpleChannel use a varInt for the discriminator allowing essentially unlimited packets.
|
||||||
|
- 47.999.1 Rewrite networking.
|
||||||
|
- 47.999.0 1.20.2-pre1
|
||||||
|
|
||||||
66
gradle.properties
Normal file
66
gradle.properties
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# Sets default memory used for Gradle commands. Can be overridden by user or command line properties.
|
||||||
|
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||||
|
org.gradle.jvmargs=-Xmx3G
|
||||||
|
org.gradle.daemon=false
|
||||||
|
|
||||||
|
# In the case that Gradle needs to fork to recompile, this will set the memory for that process.
|
||||||
|
systemProp.net.minecraftforge.gradle.repo.recompile.fork=true
|
||||||
|
systemProp.net.minecraftforge.gradle.repo.recompile.fork.args=-Xmx5G
|
||||||
|
|
||||||
|
# Opts-out of ForgeGradle automatically adding mavenCentral(), Forge's maven and MC libs maven to the repositories block
|
||||||
|
systemProp.net.minecraftforge.gradle.repo.attach=false
|
||||||
|
|
||||||
|
|
||||||
|
## Environment Properties
|
||||||
|
|
||||||
|
# The Minecraft version must agree with the Forge version to get a valid artifact
|
||||||
|
minecraft_version=1.21.11
|
||||||
|
# The Minecraft version range can use any release version of Minecraft as bounds.
|
||||||
|
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
|
||||||
|
# as they do not follow standard versioning conventions.
|
||||||
|
minecraft_version_range=[1.21.11,1.22)
|
||||||
|
# The Forge version must agree with the Minecraft version to get a valid artifact
|
||||||
|
forge_version=61.0.3
|
||||||
|
# The Forge version range can use any version of Forge as bounds or match the loader version range
|
||||||
|
forge_version_range=[61,)
|
||||||
|
# The loader version range can only use the major version of Forge/FML as bounds
|
||||||
|
loader_version_range=[61,)
|
||||||
|
# The mapping channel to use for mappings.
|
||||||
|
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
|
||||||
|
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
|
||||||
|
#
|
||||||
|
# | Channel | Version | |
|
||||||
|
# |-----------|----------------------|--------------------------------------------------------------------------------|
|
||||||
|
# | official | MCVersion | Official field/method names from Mojang mapping files |
|
||||||
|
# | parchment | YYYY.MM.DD-MCVersion | Open community-sourced parameter names and javadocs layered on top of official |
|
||||||
|
#
|
||||||
|
# You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
|
||||||
|
# See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
|
||||||
|
#
|
||||||
|
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
|
||||||
|
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
|
||||||
|
mapping_channel=parchment
|
||||||
|
# The mapping version to query from the mapping channel.
|
||||||
|
# This must match the format required by the mapping channel.
|
||||||
|
mapping_version=2025.12.20-1.21.11
|
||||||
|
|
||||||
|
|
||||||
|
## Mod Properties
|
||||||
|
|
||||||
|
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
|
||||||
|
# Must match the String constant located in the main mod class annotated with @Mod.
|
||||||
|
mod_id=more_spear_enchantments
|
||||||
|
# The human-readable display name for the mod.
|
||||||
|
mod_name=More Spear Enchantments
|
||||||
|
# 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=1.0.1
|
||||||
|
# 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
|
||||||
|
mod_group_id=dev.sillyangel.more_spear_enchantments
|
||||||
|
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
|
||||||
|
mod_authors=sillyangel
|
||||||
|
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
|
||||||
|
mod_description=more enchantments for the newly added spear from the Mounts of Mayhem update.
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
249
gradlew
vendored
Executable file
249
gradlew
vendored
Executable file
@@ -0,0 +1,249 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "$( uname )" in #(
|
||||||
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
|
Darwin* ) darwin=true ;; #(
|
||||||
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
|
NONSTOP* ) nonstop=true ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
|
else
|
||||||
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD=java
|
||||||
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
|
# * args from the command line
|
||||||
|
# * the main class name
|
||||||
|
# * -classpath
|
||||||
|
# * -D...appname settings
|
||||||
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
92
gradlew.bat
vendored
Normal file
92
gradlew.bat
vendored
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%"=="" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
17
settings.gradle
Normal file
17
settings.gradle
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
maven {
|
||||||
|
name = 'MinecraftForge'
|
||||||
|
url = 'https://maven.minecraftforge.net/'
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = 'ParchmentMC'
|
||||||
|
url = 'https://maven.parchmentmc.org/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments;
|
||||||
|
|
||||||
|
import net.minecraft.resources.Identifier;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraftforge.common.ForgeConfigSpec;
|
||||||
|
import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.event.config.ModConfigEvent;
|
||||||
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
// An example config class. This is not required, but it's a good idea to have one to keep your config organized.
|
||||||
|
// Demonstrates how to use Forge's config APIs
|
||||||
|
@Mod.EventBusSubscriber(modid = MoreSpearEnchantments.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||||
|
public class Config {
|
||||||
|
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
|
||||||
|
|
||||||
|
private static final ForgeConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER
|
||||||
|
.comment("Whether to log the dirt block on common setup")
|
||||||
|
.define("logDirtBlock", true);
|
||||||
|
|
||||||
|
private static final ForgeConfigSpec.IntValue MAGIC_NUMBER = BUILDER
|
||||||
|
.comment("A magic number")
|
||||||
|
.defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE);
|
||||||
|
|
||||||
|
public static final ForgeConfigSpec.ConfigValue<String> MAGIC_NUMBER_INTRODUCTION = BUILDER
|
||||||
|
.comment("What you want the introduction message to be for the magic number")
|
||||||
|
.define("magicNumberIntroduction", "The magic number is... ");
|
||||||
|
|
||||||
|
// a list of strings that are treated as resource locations for items
|
||||||
|
private static final ForgeConfigSpec.ConfigValue<List<? extends String>> ITEM_STRINGS = BUILDER
|
||||||
|
.comment("A list of items to log on common setup.")
|
||||||
|
.defineListAllowEmpty("items", List.of("minecraft:iron_ingot"), Config::validateItemName);
|
||||||
|
|
||||||
|
static final ForgeConfigSpec SPEC = BUILDER.build();
|
||||||
|
|
||||||
|
public static boolean logDirtBlock;
|
||||||
|
public static int magicNumber;
|
||||||
|
public static String magicNumberIntroduction;
|
||||||
|
public static Set<Item> items;
|
||||||
|
|
||||||
|
private static boolean validateItemName(final Object obj) {
|
||||||
|
return obj instanceof final String itemName && ForgeRegistries.ITEMS.containsKey(Identifier.tryParse(itemName));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
static void onLoad(final ModConfigEvent event) {
|
||||||
|
logDirtBlock = LOG_DIRT_BLOCK.get();
|
||||||
|
magicNumber = MAGIC_NUMBER.get();
|
||||||
|
magicNumberIntroduction = MAGIC_NUMBER_INTRODUCTION.get();
|
||||||
|
|
||||||
|
// convert the list of strings into a set of items
|
||||||
|
items = ITEM_STRINGS.get().stream()
|
||||||
|
.map(itemName -> ForgeRegistries.ITEMS.getValue(Identifier.tryParse(itemName)))
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package dev.sillyangel.more_spear_enchantments;
|
||||||
|
|
||||||
|
import com.mojang.logging.LogUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
|
import net.minecraft.world.food.FoodProperties;
|
||||||
|
import net.minecraft.world.item.BlockItem;
|
||||||
|
import net.minecraft.world.item.CreativeModeTab;
|
||||||
|
import net.minecraft.world.item.CreativeModeTabs;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
|
import net.minecraft.world.level.material.MapColor;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
|
||||||
|
import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.config.ModConfig;
|
||||||
|
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
|
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||||
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
|
import net.minecraftforge.registries.RegistryObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
// The value here should match an entry in the META-INF/mods.toml file
|
||||||
|
@Mod(MoreSpearEnchantments.MODID)
|
||||||
|
public final class MoreSpearEnchantments {
|
||||||
|
// Define mod id in a common place for everything to reference
|
||||||
|
public static final String MODID = "examplemod";
|
||||||
|
// Directly reference a slf4j logger
|
||||||
|
private static final Logger LOGGER = LogUtils.getLogger();
|
||||||
|
// Create a Deferred Register to hold Blocks which will all be registered under the "examplemod" namespace
|
||||||
|
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
|
||||||
|
// Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace
|
||||||
|
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
|
||||||
|
// Create a Deferred Register to hold CreativeModeTabs which will all be registered under the "examplemod" namespace
|
||||||
|
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
|
||||||
|
|
||||||
|
// Creates a new Block with the id "examplemod:example_block", combining the namespace and path
|
||||||
|
public static final RegistryObject<Block> EXAMPLE_BLOCK = BLOCKS.register("example_block",
|
||||||
|
() -> new Block(BlockBehaviour.Properties.of()
|
||||||
|
.setId(BLOCKS.key("example_block"))
|
||||||
|
.mapColor(MapColor.STONE)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
// Creates a new BlockItem with the id "examplemod:example_block", combining the namespace and path
|
||||||
|
public static final RegistryObject<Item> EXAMPLE_BLOCK_ITEM = ITEMS.register("example_block",
|
||||||
|
() -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties().setId(ITEMS.key("example_block")))
|
||||||
|
);
|
||||||
|
|
||||||
|
// Creates a new food item with the id "examplemod:example_id", nutrition 1 and saturation 2
|
||||||
|
public static final RegistryObject<Item> EXAMPLE_ITEM = ITEMS.register("example_item",
|
||||||
|
() -> new Item(new Item.Properties()
|
||||||
|
.setId(ITEMS.key("example_item"))
|
||||||
|
.food(new FoodProperties.Builder()
|
||||||
|
.alwaysEdible()
|
||||||
|
.nutrition(1)
|
||||||
|
.saturationModifier(2f)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Creates a creative tab with the id "examplemod:example_tab" for the example item, that is placed after the combat tab
|
||||||
|
public static final RegistryObject<CreativeModeTab> EXAMPLE_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder()
|
||||||
|
.withTabsBefore(CreativeModeTabs.COMBAT)
|
||||||
|
.icon(() -> EXAMPLE_ITEM.get().getDefaultInstance())
|
||||||
|
.displayItems((parameters, output) -> {
|
||||||
|
output.accept(EXAMPLE_ITEM.get()); // Add the example item to the tab. For your own tabs, this method is preferred over the event
|
||||||
|
}).build());
|
||||||
|
|
||||||
|
public MoreSpearEnchantments(FMLJavaModLoadingContext context) {
|
||||||
|
var modBusGroup = context.getModBusGroup();
|
||||||
|
|
||||||
|
// Register the commonSetup method for modloading
|
||||||
|
FMLCommonSetupEvent.getBus(modBusGroup).addListener(this::commonSetup);
|
||||||
|
|
||||||
|
// Register the Deferred Register to the mod event bus so blocks get registered
|
||||||
|
BLOCKS.register(modBusGroup);
|
||||||
|
// Register the Deferred Register to the mod event bus so items get registered
|
||||||
|
ITEMS.register(modBusGroup);
|
||||||
|
// Register the Deferred Register to the mod event bus so tabs get registered
|
||||||
|
CREATIVE_MODE_TABS.register(modBusGroup);
|
||||||
|
|
||||||
|
// Register the item to a creative tab
|
||||||
|
BuildCreativeModeTabContentsEvent.BUS.addListener(MoreSpearEnchantments::addCreative);
|
||||||
|
|
||||||
|
// Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
|
||||||
|
context.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||||
|
// Some common setup code
|
||||||
|
LOGGER.info("HELLO FROM COMMON SETUP");
|
||||||
|
|
||||||
|
if (Config.logDirtBlock)
|
||||||
|
LOGGER.info("DIRT BLOCK >> {}", ForgeRegistries.BLOCKS.getKey(Blocks.DIRT));
|
||||||
|
|
||||||
|
LOGGER.info(Config.magicNumberIntroduction + Config.magicNumber);
|
||||||
|
|
||||||
|
Config.items.forEach((item) -> LOGGER.info("ITEM >> {}", item.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the example block item to the building blocks tab
|
||||||
|
private static void addCreative(BuildCreativeModeTabContentsEvent event) {
|
||||||
|
if (event.getTabKey() == CreativeModeTabs.BUILDING_BLOCKS)
|
||||||
|
event.accept(EXAMPLE_BLOCK_ITEM);
|
||||||
|
}
|
||||||
|
|
||||||
|
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
|
||||||
|
@Mod.EventBusSubscriber(modid = MODID, value = Dist.CLIENT)
|
||||||
|
public static class ClientModEvents {
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onClientSetup(FMLClientSetupEvent event) {
|
||||||
|
// Some client setup code
|
||||||
|
LOGGER.info("HELLO FROM CLIENT SETUP");
|
||||||
|
LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
73
src/main/resources/META-INF/mods.toml
Normal file
73
src/main/resources/META-INF/mods.toml
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
# This is an example mods.toml file. It contains the data relating to the loading mods.
|
||||||
|
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
|
||||||
|
# The overall format is standard TOML format, v0.5.0.
|
||||||
|
# Note that there are a couple of TOML lists in this file.
|
||||||
|
# Find more information on toml format here: https://github.com/toml-lang/toml
|
||||||
|
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||||
|
modLoader="javafml" #mandatory
|
||||||
|
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||||
|
loaderVersion="${loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||||
|
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
|
||||||
|
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
||||||
|
license="${mod_license}"
|
||||||
|
# A URL to refer people to when problems occur with this mod
|
||||||
|
issueTrackerURL="https://git.sillyangel.dev/angel/more-spear-enchants-forge/issues" #optional
|
||||||
|
# If your mod is purely client-side and has no multiplayer functionality (be it dedicated servers or Open to LAN),
|
||||||
|
# set this to true, and Forge will set the correct displayTest for you and skip loading your mod on dedicated servers.
|
||||||
|
#clientSideOnly=true #optional - defaults to false if absent
|
||||||
|
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||||
|
[[mods]] #mandatory
|
||||||
|
# The modid of the mod
|
||||||
|
modId="${mod_id}" #mandatory
|
||||||
|
# The version number of the mod
|
||||||
|
version="${mod_version}" #mandatory
|
||||||
|
# A display name for the mod
|
||||||
|
displayName="${mod_name}" #mandatory
|
||||||
|
# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/
|
||||||
|
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
|
||||||
|
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||||
|
displayURL="https://modrinth.com/mod/more-spear-enchantments/" #optional
|
||||||
|
# A file name (in the root of the mod JAR) containing a logo for display
|
||||||
|
logoFile="icon.png" #optional
|
||||||
|
# A text field displayed in the mod UI
|
||||||
|
#credits="" #optional
|
||||||
|
# A text field displayed in the mod UI
|
||||||
|
authors="${mod_authors}" #optional
|
||||||
|
# Display Test controls the display for your mod in the server connection screen
|
||||||
|
# MATCH_VERSION means that your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod.
|
||||||
|
# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod.
|
||||||
|
# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component.
|
||||||
|
# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value.
|
||||||
|
# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself.
|
||||||
|
#displayTest="MATCH_VERSION" # if nothing is specified, MATCH_VERSION is the default when clientSideOnly=false, otherwise IGNORE_ALL_VERSION when clientSideOnly=true (#optional)
|
||||||
|
|
||||||
|
# The description text for the mod (multi line!) (#mandatory)
|
||||||
|
description='''${mod_description}'''
|
||||||
|
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||||
|
[[dependencies.${mod_id}]] #optional
|
||||||
|
# the modid of the dependency
|
||||||
|
modId="forge" #mandatory
|
||||||
|
# Does this dependency have to exist - if not, ordering below must be specified
|
||||||
|
mandatory=true #mandatory
|
||||||
|
# The version range of the dependency
|
||||||
|
versionRange="${forge_version_range}" #mandatory
|
||||||
|
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
|
||||||
|
# BEFORE - This mod is loaded BEFORE the dependency
|
||||||
|
# AFTER - This mod is loaded AFTER the dependency
|
||||||
|
ordering="NONE"
|
||||||
|
# Side this dependency is applied on - BOTH, CLIENT, or SERVER
|
||||||
|
side="BOTH"
|
||||||
|
# Here's another dependency
|
||||||
|
[[dependencies.${mod_id}]]
|
||||||
|
modId="minecraft"
|
||||||
|
mandatory=true
|
||||||
|
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||||
|
versionRange="${minecraft_version_range}"
|
||||||
|
ordering="NONE"
|
||||||
|
side="BOTH"
|
||||||
|
|
||||||
|
# Features are specific properties of the game environment, that you may want to declare you require. This example declares
|
||||||
|
# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't
|
||||||
|
# stop your mod loading on the server for example.
|
||||||
|
#[features.${mod_id}]
|
||||||
|
#openGLVersion="[3.2,)"
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"anvil_cost": 5,
|
||||||
|
"description": {
|
||||||
|
"translate": "enchantment.more_spear_enchantments.crippling"
|
||||||
|
},
|
||||||
|
"effects": {
|
||||||
|
"minecraft:post_attack": [
|
||||||
|
{
|
||||||
|
"affected": "victim",
|
||||||
|
"effect": {
|
||||||
|
"type": "more_spear_enchantments:crippling",
|
||||||
|
"duration": {
|
||||||
|
"type": "minecraft:linear",
|
||||||
|
"base": 2.0,
|
||||||
|
"per_level_above_first": 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enchanted": "attacker"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"max_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 15
|
||||||
|
},
|
||||||
|
"max_level": 3,
|
||||||
|
"min_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 10
|
||||||
|
},
|
||||||
|
"slots": [
|
||||||
|
"hand"
|
||||||
|
],
|
||||||
|
"supported_items": "#more_spear_enchantments:spears",
|
||||||
|
"weight": 10
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"anvil_cost": 5,
|
||||||
|
"description": {
|
||||||
|
"translate": "enchantment.more_spear_enchantments.poisoning"
|
||||||
|
},
|
||||||
|
"effects": {
|
||||||
|
"minecraft:post_attack": [
|
||||||
|
{
|
||||||
|
"affected": "victim",
|
||||||
|
"effect": {
|
||||||
|
"type": "more_spear_enchantments:poison",
|
||||||
|
"duration": {
|
||||||
|
"type": "minecraft:linear",
|
||||||
|
"base": 3.0,
|
||||||
|
"per_level_above_first": 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enchanted": "attacker"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"max_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 15
|
||||||
|
},
|
||||||
|
"max_level": 3,
|
||||||
|
"min_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 10
|
||||||
|
},
|
||||||
|
"slots": [
|
||||||
|
"hand"
|
||||||
|
],
|
||||||
|
"supported_items": "#more_spear_enchantments:spears",
|
||||||
|
"weight": 10
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"anvil_cost": 5,
|
||||||
|
"description": {
|
||||||
|
"translate": "enchantment.more_spear_enchantments.thundering"
|
||||||
|
},
|
||||||
|
"effects": {
|
||||||
|
"minecraft:post_attack": [
|
||||||
|
{
|
||||||
|
"affected": "victim",
|
||||||
|
"effect": {
|
||||||
|
"type": "more_spear_enchantments:lightning",
|
||||||
|
"amount": {
|
||||||
|
"type": "minecraft:linear",
|
||||||
|
"base": 0.4,
|
||||||
|
"per_level_above_first": 0.2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enchanted": "attacker"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"max_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 15
|
||||||
|
},
|
||||||
|
"max_level": 3,
|
||||||
|
"min_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 10
|
||||||
|
},
|
||||||
|
"slots": [
|
||||||
|
"hand"
|
||||||
|
],
|
||||||
|
"supported_items": "#more_spear_enchantments:spears",
|
||||||
|
"weight": 10
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"anvil_cost": 5,
|
||||||
|
"description": {
|
||||||
|
"translate": "enchantment.more_spear_enchantments.withering"
|
||||||
|
},
|
||||||
|
"effects": {
|
||||||
|
"minecraft:post_attack": [
|
||||||
|
{
|
||||||
|
"affected": "victim",
|
||||||
|
"effect": {
|
||||||
|
"type": "more_spear_enchantments:withering",
|
||||||
|
"duration": {
|
||||||
|
"type": "minecraft:linear",
|
||||||
|
"base": 2.0,
|
||||||
|
"per_level_above_first": 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enchanted": "attacker"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"max_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 15
|
||||||
|
},
|
||||||
|
"max_level": 3,
|
||||||
|
"min_cost": {
|
||||||
|
"base": 1,
|
||||||
|
"per_level_above_first": 10
|
||||||
|
},
|
||||||
|
"slots": [
|
||||||
|
"hand"
|
||||||
|
],
|
||||||
|
"supported_items": "#more_spear_enchantments:spears",
|
||||||
|
"weight": 10
|
||||||
|
}
|
||||||
BIN
src/main/resources/assets/more_spear_enchantments/icon.png
Normal file
BIN
src/main/resources/assets/more_spear_enchantments/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"enchantment.more_spear_enchantments.thundering": "Storm o' Thunder",
|
||||||
|
"enchantment.more_spear_enchantments.withering": "Rot o' Doom",
|
||||||
|
"enchantment.more_spear_enchantments.crippling": "Crippled Legs",
|
||||||
|
"enchantment.more_spear_enchantments.poisoning": "Venom'd Blade"
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"enchantment.more_spear_enchantments.thundering": "ƃuᴉɹǝpunɥꓕ",
|
||||||
|
"enchantment.more_spear_enchantments.withering": "ƃuᴉɹǝɥʇᴉM",
|
||||||
|
"enchantment.more_spear_enchantments.crippling": "ƃuᴉlddᴉɹƆ",
|
||||||
|
"enchantment.more_spear_enchantments.poisoning": "ƃuᴉuosuᴉԀ"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"enchantment.more_spear_enchantments.thundering": "Thundering",
|
||||||
|
"enchantment.more_spear_enchantments.withering": "Withering",
|
||||||
|
"enchantment.more_spear_enchantments.crippling": "Crippling",
|
||||||
|
"enchantment.more_spear_enchantments.poisoning": "Poisoning"
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"enchantment.more_spear_enchantments.thundering": "Tronante",
|
||||||
|
"enchantment.more_spear_enchantments.withering": "Marchitante",
|
||||||
|
"enchantment.more_spear_enchantments.crippling": "Lisiador",
|
||||||
|
"enchantment.more_spear_enchantments.poisoning": "Envenenamiento"
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"enchantment.more_spear_enchantments.thundering": "Tonnerre",
|
||||||
|
"enchantment.more_spear_enchantments.withering": "Flétrissure",
|
||||||
|
"enchantment.more_spear_enchantments.crippling": "Estropiant",
|
||||||
|
"enchantment.more_spear_enchantments.poisoning": "Empoisonnement"
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"minecraft:wooden_spear",
|
||||||
|
"minecraft:stone_spear",
|
||||||
|
"minecraft:copper_spear",
|
||||||
|
"minecraft:iron_spear",
|
||||||
|
"minecraft:golden_spear",
|
||||||
|
"minecraft:diamond_spear",
|
||||||
|
"minecraft:netherite_spear"
|
||||||
|
]
|
||||||
|
}
|
||||||
10
src/main/resources/pack.mcmeta
Normal file
10
src/main/resources/pack.mcmeta
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"pack": {
|
||||||
|
"description": "${mod_id} resources",
|
||||||
|
"max_format": 94,
|
||||||
|
"min_format": [
|
||||||
|
94,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user