Skip to content

Commit

Permalink
Merged 1.2.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Majrusz authored Aug 13, 2023
2 parents eb21f74 + 8a2433b commit bbd3d65
Show file tree
Hide file tree
Showing 49 changed files with 180 additions and 149 deletions.
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
versions_minecraft=1.20
versions_minecraft_range=[1.20,1.21)
versions_forge=46.0.1
versions_forge_range=[46.0.1,)
versions_mod=1.2.2
versions_mlib=4.3.0
versions_mlib_range=[4.3.0,5.0.0)
versions_difficulty=1.7.6
versions_difficulty_range=[1.7.6,)
versions_curios=5.2.0-beta.2+1.20
versions_curios_range=[5.2.0-beta.2+1.20,)
versions_minecraft=1.20.1
versions_minecraft_range=[1.20.1,1.21)
versions_forge=47.1.0
versions_forge_range=[47.1.0,)
versions_mod=1.2.3
versions_mlib=5.0.0
versions_mlib_range=[5.0.0,6.0.0)
versions_difficulty=1.8.0
versions_difficulty_range=[1.8.0,)
versions_curios=5.2.0-beta.3+1.20.1
versions_curios_range=[5.2.0-beta.3+1.20.1,)
Binary file removed libs/majrusz-library-1.20-4.3.0.jar
Binary file not shown.
Binary file added libs/majrusz-library-1.20.1-5.0.0.jar
Binary file not shown.
Binary file removed libs/majruszs-difficulty-1.20-1.7.6.jar
Binary file not shown.
Binary file added libs/majruszs-difficulty-1.20.1-1.8.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.majruszsaccessories;

import com.mlib.config.ConfigHandler;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;

@Mod( MajruszsAccessories.MOD_ID )
public class MajruszsAccessories {
public static final String MOD_ID = "majruszsaccessories";
public static final String NAME = "Majrusz's Accessories";
public static final ConfigHandler SERVER_CONFIG = new ConfigHandler( ModConfig.Type.SERVER );

public MajruszsAccessories() {
Integration.initialize();
Expand Down
26 changes: 10 additions & 16 deletions src/main/java/com/majruszsaccessories/Registries.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
import com.majruszsaccessories.recipes.AccessoryRecipe;
import com.majruszsaccessories.recipes.BoostAccessoriesRecipe;
import com.majruszsaccessories.recipes.CombineAccessoriesRecipe;
import com.mlib.annotations.AnnotationHandler;
import com.mlib.gamemodifiers.ModConfigs;
import com.mlib.registries.RegistryHelper;
import com.mlib.triggers.BasicTrigger;
import com.mlib.config.ConfigHandler;
import com.mlib.contexts.base.ModConfigs;
import com.mlib.modhelper.ModHelper;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
Expand All @@ -25,10 +24,11 @@
import top.theillusivec4.curios.api.CuriosApi;
import top.theillusivec4.curios.api.SlotTypeMessage;

import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class Registries {
private static final RegistryHelper HELPER = new RegistryHelper( MajruszsAccessories.MOD_ID );
public static final ModHelper HELPER = ModHelper.create( MajruszsAccessories.MOD_ID );

// Configs
public static final ConfigHandler SERVER_CONFIG = HELPER.createConfig( ModConfig.Type.SERVER );

static {
ModConfigs.init( SERVER_CONFIG, Groups.DEFAULT );
Expand Down Expand Up @@ -68,19 +68,13 @@ public class Registries {
// Misc
public static final ResourceLocation ACCESSORY_SLOT_TEXTURE = Registries.getLocation( "item/empty_accessory_slot" );
public static final RegistryObject< Item > BOOSTER_OVERLAY = ITEMS.register( "booster_icon", BoosterOverlay::new );
public static final BasicTrigger BASIC_TRIGGER = HELPER.registerBasicTrigger();

static {
new AnnotationHandler( MajruszsAccessories.MOD_ID );
}

public static void initialize() {
FMLJavaModLoadingContext loadingContext = FMLJavaModLoadingContext.get();
final IEventBus modEventBus = loadingContext.getModEventBus();

HELPER.registerAll();
modEventBus.addListener( Registries::onEnqueueIMC );
SERVER_CONFIG.register( ModLoadingContext.get() );

HELPER.register();
}

public static ResourceLocation getLocation( String register ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.majruszsaccessories.common.ItemBase;
import com.majruszsaccessories.gamemodifiers.contexts.OnAccessoryTooltip;
import com.majruszsaccessories.gamemodifiers.contexts.OnItemRender;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.contexts.OnTradeSetup;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.OnTradeSetup;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.world.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void onCraftedBy( ItemStack itemStack, Level level, Player player ) {
holder.setRandomBonus();
}
if( holder.hasBoosterTag() && player instanceof ServerPlayer serverPlayer ) {
Registries.BASIC_TRIGGER.trigger( serverPlayer, "booster_used" );
Registries.HELPER.triggerAchievement( serverPlayer, "booster_used" );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.majruszsaccessories.accessories.components.MoreChestLoot;
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.CustomConditions;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.math.Range;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import com.majruszsaccessories.accessories.components.FishingLureBonus;
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.CustomConditions;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.gamemodifiers.contexts.OnItemFished;
import com.mlib.contexts.OnItemFished;
import com.mlib.math.Range;
import net.minecraft.world.entity.npc.VillagerProfession;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import com.majruszsaccessories.accessories.components.EnhanceTamedAnimal;
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.CustomConditions;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.gamemodifiers.contexts.OnAnimalTame;
import com.mlib.contexts.OnAnimalTame;
import com.mlib.math.Range;
import net.minecraft.world.entity.npc.VillagerProfession;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import com.majruszsaccessories.accessories.components.SpawnTwins;
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.CustomConditions;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.gamemodifiers.contexts.OnBabySpawn;
import com.mlib.contexts.OnBabySpawn;
import com.mlib.math.Range;
import net.minecraft.world.entity.npc.VillagerProfession;

Expand Down
27 changes: 2 additions & 25 deletions src/main/java/com/majruszsaccessories/accessories/LuckyRock.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package com.majruszsaccessories.accessories;

import com.majruszsaccessories.Integration;
import com.majruszsaccessories.Registries;
import com.majruszsaccessories.accessories.components.AccessoryComponent;
import com.majruszsaccessories.accessories.components.ExtraStoneLoot;
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.CustomConditions;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.contexts.OnLootTableCustomLoad;
import com.mlib.math.Range;
import net.minecraft.world.entity.npc.VillagerProfession;

Expand All @@ -23,7 +20,6 @@ public LuckyRock() {

this.name( "LuckyRock" )
.add( ExtraStoneLoot.create() )
.add( EnderiumShardsCompatibility.create() ) // adds Enderium Shards (from Majrusz's Progressive Difficulty) to loot table
.add( TradeOffer.create( VillagerProfession.MASON, 5 ) )
.add( DropChance.create() );
}
Expand All @@ -36,31 +32,12 @@ public static ISupplier create() {
protected DropChance( Supplier< AccessoryItem > item, ConfigGroup group ) {
super( item );

DoubleConfig chance = new DoubleConfig( 0.0002, Range.CHANCE );
DoubleConfig chance = new DoubleConfig( 0.0005, Range.CHANCE );
chance.name( "drop_chance" ).comment( "Chance for Lucky Rock to drop when mining stone." );

ExtraStoneLoot.OnStoneMined.listen( this::addToGeneratedLoot )
.addCondition( CustomConditions.dropChance( chance, data->data.entity ) )
.insertTo( group );
}
}

static class EnderiumShardsCompatibility extends AccessoryComponent {
public static ISupplier create() {
return EnderiumShardsCompatibility::new;
}

protected EnderiumShardsCompatibility( Supplier< AccessoryItem > item, ConfigGroup group ) {
super( item );

OnLootTableCustomLoad.listen( this::addLoot )
.addCondition( Condition.predicate( data->ExtraStoneLoot.LOOT_THE_END.equals( data.name ) ) )
.addCondition( Condition.predicate( Integration::isProgressiveDifficultyInstalled ) )
.insertTo( group );
}

private void addLoot( OnLootTableCustomLoad.Data data ) {
data.addEntry( 0, com.majruszsdifficulty.Registries.ENDERIUM_SHARD.get(), 1, 0 );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.majruszsaccessories.Registries;
import com.majruszsaccessories.accessories.components.*;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import net.minecraft.world.entity.npc.VillagerProfession;

@AutoInstance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import com.majruszsaccessories.accessories.components.EnhancedPotions;
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.CustomConditions;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.contexts.OnLoot;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.OnLoot;
import com.mlib.math.Range;
import net.minecraft.world.entity.monster.Witch;
import net.minecraft.world.entity.npc.VillagerProfession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import com.majruszsaccessories.accessories.components.DoubleCrops;
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.contexts.OnAccessoryDropChance;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.Priority;
import com.mlib.gamemodifiers.contexts.OnLoot;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.base.Priority;
import com.mlib.contexts.OnLoot;
import com.mlib.math.Range;
import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.level.block.Blocks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import com.majruszsaccessories.accessories.components.TradeOffer;
import com.majruszsaccessories.gamemodifiers.CustomConditions;
import com.mlib.Utility;
import com.mlib.annotations.AutoInstance;
import com.mlib.modhelper.AutoInstance;
import com.mlib.blocks.BlockHelper;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.config.StringListConfig;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.contexts.OnLoot;
import com.mlib.gamemodifiers.contexts.OnPlayerInteract;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.OnLoot;
import com.mlib.contexts.OnPlayerInteract;
import com.mlib.math.Range;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.effects.ParticleHandler;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.Context;
import com.mlib.gamemodifiers.contexts.OnLoot;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.base.Context;
import com.mlib.contexts.OnLoot;
import com.mlib.math.Range;
import net.minecraft.world.entity.LivingEntity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.effects.ParticleHandler;
import com.mlib.gamemodifiers.contexts.OnAnimalTame;
import com.mlib.contexts.OnAnimalTame;
import com.mlib.math.Range;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.config.IntegerConfig;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.contexts.OnPotionBrewed;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.OnPotionBrewed;
import com.mlib.math.Range;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.effects.ParticleHandler;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.Context;
import com.mlib.gamemodifiers.Priority;
import com.mlib.gamemodifiers.contexts.OnLoot;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.base.Context;
import com.mlib.contexts.base.Priority;
import com.mlib.contexts.OnLoot;
import com.mlib.levels.LevelHelper;
import com.mlib.loot.LootHelper;
import com.mlib.math.Range;
Expand Down Expand Up @@ -59,7 +59,7 @@ private void addExtraLoot( OnLoot.Data data ) {

private static List< ItemStack > generateLoot( LivingEntity entity ) {
return LootHelper.getLootTable( getLootTableLocation( entity ) )
.getRandomItems( LootHelper.toGiftParams( entity, getLootTableLocation( entity ) ) );
.getRandomItems( LootHelper.toGiftParams( entity ) );
}

private static ResourceLocation getLootTableLocation( LivingEntity entity ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import com.mlib.attributes.AttributeHandler;
import com.mlib.config.ConfigGroup;
import com.mlib.config.IntegerConfig;
import com.mlib.gamemodifiers.Condition;
import com.mlib.gamemodifiers.contexts.OnPlayerTick;
import com.mlib.contexts.base.Condition;
import com.mlib.contexts.OnPlayerTick;
import com.mlib.math.Range;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.majruszsaccessories.tooltip.TooltipHelper;
import com.mlib.config.ConfigGroup;
import com.mlib.config.DoubleConfig;
import com.mlib.gamemodifiers.contexts.OnFishingTimeSet;
import com.mlib.contexts.OnFishingTimeSet;
import com.mlib.math.Range;

import java.util.function.Supplier;
Expand Down
Loading

0 comments on commit bbd3d65

Please sign in to comment.