diff --git a/build.gradle b/build.gradle index 8a0ceca1f..bfcd53bf2 100644 --- a/build.gradle +++ b/build.gradle @@ -16,13 +16,13 @@ apply plugin: 'org.spongepowered.mixin' version = '1.6.1' group = 'com.majruszsdifficulty' -archivesBaseName = 'majruszs-difficulty-1.19.3' +archivesBaseName = 'majruszs-difficulty-1.19.2' // Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16. java.toolchain.languageVersion = JavaLanguageVersion.of(17) minecraft { - mappings channel: 'official', version: '1.19.3' + mappings channel: 'official', version: '1.19.2' accessTransformer = file( 'src/main/resources/META-INF/accesstransformer.cfg' ) // Currently, this location cannot be changed from the default. @@ -76,8 +76,8 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.19.3-44.0.18' - implementation fg.deobf( 'com.mlib:majrusz-library-1.19.3:3.1.0' ) + minecraft 'net.minecraftforge:forge:1.19.2-43.2.0' + implementation fg.deobf( 'com.mlib:majrusz-library-1.19.2:3.1.0' ) } // Example for how to get properties into the manifest for reading at runtime. diff --git a/libs/majrusz-library-1.19.3-3.1.0.jar b/libs/majrusz-library-1.19.2-3.1.0.jar similarity index 79% rename from libs/majrusz-library-1.19.3-3.1.0.jar rename to libs/majrusz-library-1.19.2-3.1.0.jar index dde1ad02f..caa8f0a55 100644 Binary files a/libs/majrusz-library-1.19.3-3.1.0.jar and b/libs/majrusz-library-1.19.2-3.1.0.jar differ diff --git a/src/main/java/com/majruszsdifficulty/CreativeModeTabs.java b/src/main/java/com/majruszsdifficulty/CreativeModeTabs.java deleted file mode 100644 index cf9219833..000000000 --- a/src/main/java/com/majruszsdifficulty/CreativeModeTabs.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.majruszsdifficulty; - -import com.majruszsdifficulty.items.UndeadArmorItem; -import com.mlib.annotations.AutoInstance; -import com.mlib.items.CreativeModeTabHelper; -import net.minecraft.network.chat.Component; -import net.minecraft.world.flag.FeatureFlagSet; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; - -import java.util.function.Supplier; -import java.util.stream.Stream; - -@AutoInstance -public class CreativeModeTabs { - public CreativeModeTabs() { - var primary = CreativeModeTabHelper.newTab( FMLJavaModLoadingContext.get(), Registries.getLocation( "primary" ) ); - primary.accept( builder->builder.title( Component.translatable( "itemGroup.majruszsdifficulty.primary" ) ) - .icon( ()->new ItemStack( Registries.BATTLE_STANDARD.get() ) ) - .displayItems( this::definePrimaryItems ) ); - - var treasureBags = CreativeModeTabHelper.newTab( FMLJavaModLoadingContext.get(), Registries.getLocation( "treasure_bags" ) ); - treasureBags.accept( builder->builder.title( Component.translatable( "itemGroup.majruszsdifficulty.treasure_bags" ) ) - .displayItems( this::defineTreasureBagItems ) - .withTabFactory( TreasureBag::new ) ); - } - - private void definePrimaryItems( FeatureFlagSet flagSet, CreativeModeTab.Output output, boolean hasPermissions ) { - Stream.of( - new ItemStack( Registries.BANDAGE.get() ), - new ItemStack( Registries.GOLDEN_BANDAGE.get() ), - - new ItemStack( Registries.CLOTH.get() ), - new ItemStack( Registries.BATTLE_STANDARD.get() ), - UndeadArmorItem.constructItem( UndeadArmorItem.HELMET_ID ), - UndeadArmorItem.constructItem( UndeadArmorItem.CHESTPLATE_ID ), - UndeadArmorItem.constructItem( UndeadArmorItem.LEGGINGS_ID ), - UndeadArmorItem.constructItem( UndeadArmorItem.BOOTS_ID ), - - new ItemStack( Registries.INFESTED_END_STONE_ITEM.get() ), - new ItemStack( Registries.ENDERIUM_SHARD_ORE_ITEM.get() ), - new ItemStack( Registries.ENDERIUM_BLOCK_ITEM.get() ), - new ItemStack( Registries.ENDERIUM_SHARD.get() ), - new ItemStack( Registries.ENDERIUM_INGOT.get() ), - new ItemStack( Registries.ENDERIUM_HELMET.get() ), - new ItemStack( Registries.ENDERIUM_CHESTPLATE.get() ), - new ItemStack( Registries.ENDERIUM_LEGGINGS.get() ), - new ItemStack( Registries.ENDERIUM_BOOTS.get() ), - new ItemStack( Registries.ENDERIUM_SWORD.get() ), - new ItemStack( Registries.ENDERIUM_PICKAXE.get() ), - new ItemStack( Registries.ENDERIUM_AXE.get() ), - new ItemStack( Registries.ENDERIUM_SHOVEL.get() ), - new ItemStack( Registries.ENDERIUM_HOE.get() ), - - new ItemStack( Registries.ILLUSIONER_SPAWN_EGG.get() ), - new ItemStack( Registries.CREEPERLING_SPAWN_EGG.get() ), - new ItemStack( Registries.TANK_SPAWN_EGG.get() ), - new ItemStack( Registries.CURSED_ARMOR_SPAWN_EGG.get() ), - new ItemStack( Registries.BLACK_WIDOW_SPAWN_EGG.get() ) - ).forEach( output::accept ); - } - - private void defineTreasureBagItems( FeatureFlagSet flagSet, CreativeModeTab.Output output, boolean hasPermissions ) { - Stream.of( - new ItemStack( Registries.FISHING_TREASURE_BAG.get() ), - notImplemented(), - notImplemented(), - - new ItemStack( Registries.UNDEAD_ARMY_TREASURE_BAG.get() ), - notImplemented(), - notImplemented(), - - new ItemStack( Registries.PILLAGER_TREASURE_BAG.get() ), - new ItemStack( Registries.RECALL_POTION.get() ), - new ItemStack( Registries.BAD_OMEN_POTION.get() ), - - new ItemStack( Registries.ELDER_GUARDIAN_TREASURE_BAG.get() ), - notImplemented(), - notImplemented(), - - new ItemStack( Registries.WARDEN_TREASURE_BAG.get() ), - notImplemented(), - notImplemented(), - - new ItemStack( Registries.WITHER_TREASURE_BAG.get() ), - new ItemStack( Registries.WITHER_SWORD.get() ), - notImplemented(), - - new ItemStack( Registries.ENDER_DRAGON_TREASURE_BAG.get() ), - new ItemStack( Registries.ENDERIUM_SHARD_LOCATOR.get() ), - new ItemStack( Registries.ENDER_POUCH.get() ) - ).forEach( output::accept ); - } - - int counter = 0; - private ItemStack notImplemented() { - ItemStack itemStack = new ItemStack( Items.DIRT ).setHoverName( Component.translatable( "Coming soon..." ) ); - itemStack.getOrCreateTagElement( String.format( "dirt_%d", ++counter ) ); // items must be unique, so well... - - return itemStack; - } - - private static class TreasureBag extends CreativeModeTab { - final Supplier< ItemStack > currentIcon; - - protected TreasureBag( Builder builder ) { - super( builder ); - - this.currentIcon = CreativeModeTabHelper.buildMultiIcon( Stream.of( - Registries.FISHING_TREASURE_BAG, - Registries.UNDEAD_ARMY_TREASURE_BAG, - Registries.PILLAGER_TREASURE_BAG, - Registries.ELDER_GUARDIAN_TREASURE_BAG, - Registries.WARDEN_TREASURE_BAG, - Registries.WITHER_TREASURE_BAG, - Registries.ENDER_DRAGON_TREASURE_BAG - ) ); - } - - @Override - public ItemStack getIconItem() { - return this.currentIcon.get(); - } - } -} diff --git a/src/main/java/com/majruszsdifficulty/Registries.java b/src/main/java/com/majruszsdifficulty/Registries.java index ec499c969..3063d07cf 100644 --- a/src/main/java/com/majruszsdifficulty/Registries.java +++ b/src/main/java/com/majruszsdifficulty/Registries.java @@ -21,6 +21,7 @@ import com.mlib.commands.Command; import com.mlib.config.ConfigGroup; import com.mlib.gamemodifiers.GameModifier; +import com.mlib.items.CreativeModeTabHelper; import com.mlib.registries.RegistryHelper; import com.mlib.triggers.BasicTrigger; import net.minecraft.advancements.CriteriaTriggers; @@ -36,6 +37,7 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.SpawnPlacements; +import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.SpawnEggItem; import net.minecraft.world.level.Level; @@ -62,7 +64,10 @@ import java.util.function.Supplier; import java.util.stream.Stream; +import static com.majruszsdifficulty.MajruszsDifficulty.MOD_ID; import static com.majruszsdifficulty.MajruszsDifficulty.SERVER_CONFIG; +import static net.minecraft.core.Registry.LOOT_FUNCTION_REGISTRY; +import static net.minecraft.core.Registry.LOOT_FUNCTION_TYPE; public class Registries { private static final RegistryHelper HELPER = new RegistryHelper( MajruszsDifficulty.MOD_ID ); @@ -82,7 +87,7 @@ public class Registries { static final DeferredRegister< MobEffect > MOB_EFFECTS = HELPER.create( ForgeRegistries.Keys.MOB_EFFECTS ); static final DeferredRegister< ParticleType< ? > > PARTICLE_TYPES = HELPER.create( ForgeRegistries.Keys.PARTICLE_TYPES ); static final DeferredRegister< SoundEvent > SOUNDS_EVENTS = HELPER.create( ForgeRegistries.Keys.SOUND_EVENTS ); - static final DeferredRegister< LootItemFunctionType > LOOT_FUNCTIONS = HELPER.create( net.minecraft.core.registries.Registries.LOOT_FUNCTION_TYPE ); + static final DeferredRegister< LootItemFunctionType > LOOT_FUNCTIONS = HELPER.create( LOOT_FUNCTION_REGISTRY ); // Entities public static final RegistryObject< EntityType< CreeperlingEntity > > CREEPERLING = ENTITY_TYPES.register( "creeperling", CreeperlingEntity.createSupplier() ); @@ -136,7 +141,7 @@ public class Registries { static Supplier< SpawnEggItem > createEggSupplier( Supplier< ? extends EntityType< ? extends Mob > > type, int backgroundColor, int highlightColor ) { - return ()->new ForgeSpawnEggItem( type, backgroundColor, highlightColor, new Item.Properties() ); + return ()->new ForgeSpawnEggItem( type, backgroundColor, highlightColor, new Item.Properties().tab( ITEM_GROUP ) ); } // Fake items (just to display icons etc.) @@ -162,6 +167,7 @@ static Supplier< SpawnEggItem > createEggSupplier( Supplier< ? extends EntityTyp // Misc static final List< Command > COMMANDS; + public static final CreativeModeTab ITEM_GROUP = CreativeModeTabHelper.newTab( "majruszsdifficulty.primary", BATTLE_STANDARD ); public static UndeadArmyManager UNDEAD_ARMY_MANAGER; public static GameDataSaver GAME_DATA_SAVER; @@ -177,7 +183,7 @@ static Supplier< SpawnEggItem > createEggSupplier( Supplier< ? extends EntityTyp public static final RegistryObject< SoundEvent > UNDEAD_ARMY_WAVE_STARTED = register( "undead_army.wave_started" ); static RegistryObject< SoundEvent > register( String name ) { - return SOUNDS_EVENTS.register( name, ()->SoundEvent.createVariableRangeEvent( getLocation( name ) ) ); + return SOUNDS_EVENTS.register( name, ()->new SoundEvent( getLocation( name ) ) ); } // Loot Functions diff --git a/src/main/java/com/majruszsdifficulty/gamemodifiers/list/CreeperSplitIntoCreeperlings.java b/src/main/java/com/majruszsdifficulty/gamemodifiers/list/CreeperSplitIntoCreeperlings.java index 1fb0f6856..17c4e526f 100644 --- a/src/main/java/com/majruszsdifficulty/gamemodifiers/list/CreeperSplitIntoCreeperlings.java +++ b/src/main/java/com/majruszsdifficulty/gamemodifiers/list/CreeperSplitIntoCreeperlings.java @@ -61,7 +61,7 @@ private void spawnCreeperlings( OnExplosion.Data data ) { for( int i = 0; i < creeperlingsAmount; ++i ) { BlockPos position = creeper.blockPosition().offset( Random.getRandomVector3i( -2, 2, -1, 1, -2, 2 ) ); CreeperlingEntity creeperling = Registries.CREEPERLING.get() - .spawn( level, ( CompoundTag )null, null, position, MobSpawnType.SPAWNER, true, true ); + .spawn( level, ( CompoundTag )null, null, null, position, MobSpawnType.SPAWNER, true, true ); if( creeperling != null ) creeperling.setTarget( creeper.getTarget() ); } diff --git a/src/main/java/com/majruszsdifficulty/gamemodifiers/list/SpawnPlayerZombie.java b/src/main/java/com/majruszsdifficulty/gamemodifiers/list/SpawnPlayerZombie.java index ee7715b8f..933bfa99b 100644 --- a/src/main/java/com/majruszsdifficulty/gamemodifiers/list/SpawnPlayerZombie.java +++ b/src/main/java/com/majruszsdifficulty/gamemodifiers/list/SpawnPlayerZombie.java @@ -58,7 +58,7 @@ private void spawnZombie( OnDeath.Data data ) { assert data.level != null; Player player = ( Player )data.target; EntityType< ? extends Zombie > zombieType = getZombieType( data.attacker ); - Zombie zombie = ( Zombie )zombieType.spawn( data.level, ( CompoundTag )null, null, player.blockPosition(), MobSpawnType.EVENT, true, true ); + Zombie zombie = ( Zombie )zombieType.spawn( data.level, ( CompoundTag )null, null, null, player.blockPosition(), MobSpawnType.EVENT, true, true ); if( zombie == null ) return; diff --git a/src/main/java/com/majruszsdifficulty/gamemodifiers/list/TurnSkeletonIntoWitherSkeleton.java b/src/main/java/com/majruszsdifficulty/gamemodifiers/list/TurnSkeletonIntoWitherSkeleton.java index e009608a3..ad359144c 100644 --- a/src/main/java/com/majruszsdifficulty/gamemodifiers/list/TurnSkeletonIntoWitherSkeleton.java +++ b/src/main/java/com/majruszsdifficulty/gamemodifiers/list/TurnSkeletonIntoWitherSkeleton.java @@ -58,7 +58,7 @@ private void spawnWitherSkeleton( OnDeath.Data data ) { ParticleHandler.SOUL.spawn( data.level, position, 100, ParticleHandler.offset( 1.0f ) ); } if( slider.isFinished() ) { - EntityType.WITHER_SKELETON.spawn( data.level, ( CompoundTag )null, null, new BlockPos( data.target.position() ), MobSpawnType.EVENT, true, true ); + EntityType.WITHER_SKELETON.spawn( data.level, ( CompoundTag )null, null, null, new BlockPos( data.target.position() ), MobSpawnType.EVENT, true, true ); } } ); } diff --git a/src/main/java/com/majruszsdifficulty/items/BadOmenPotionItem.java b/src/main/java/com/majruszsdifficulty/items/BadOmenPotionItem.java index 354a57a43..c616bbb40 100644 --- a/src/main/java/com/majruszsdifficulty/items/BadOmenPotionItem.java +++ b/src/main/java/com/majruszsdifficulty/items/BadOmenPotionItem.java @@ -1,5 +1,6 @@ package com.majruszsdifficulty.items; +import com.majruszsdifficulty.Registries; import com.mlib.Utility; import com.mlib.items.ItemHelper; import com.mlib.mobeffects.MobEffectHelper; @@ -24,7 +25,7 @@ public class BadOmenPotionItem extends Item { static final String TOOLTIP_ID = "item.majruszsdifficulty.bad_omen_potion.effect"; public BadOmenPotionItem() { - super( new Properties().rarity( Rarity.UNCOMMON ).stacksTo( 16 ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).stacksTo( 16 ) ); } @Override diff --git a/src/main/java/com/majruszsdifficulty/items/BandageItem.java b/src/main/java/com/majruszsdifficulty/items/BandageItem.java index 665923de6..bb3e2499e 100644 --- a/src/main/java/com/majruszsdifficulty/items/BandageItem.java +++ b/src/main/java/com/majruszsdifficulty/items/BandageItem.java @@ -37,7 +37,7 @@ public class BandageItem extends Item { static final String TOOLTIP_ID = "item.majruszsdifficulty.bandage.effect"; public BandageItem( Rarity rarity ) { - super( new Properties().stacksTo( 16 ).rarity( rarity ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).stacksTo( 16 ).rarity( rarity ) ); } public BandageItem() { diff --git a/src/main/java/com/majruszsdifficulty/items/ClothItem.java b/src/main/java/com/majruszsdifficulty/items/ClothItem.java index eb6db612f..d8e2a6547 100644 --- a/src/main/java/com/majruszsdifficulty/items/ClothItem.java +++ b/src/main/java/com/majruszsdifficulty/items/ClothItem.java @@ -1,10 +1,30 @@ package com.majruszsdifficulty.items; +import com.majruszsdifficulty.Registries; +import net.minecraft.core.NonNullList; +import net.minecraft.util.Mth; +import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; + +import java.util.stream.Stream; /** Cloth required to make Undead Army Battle Standard. */ public class ClothItem extends Item { public ClothItem() { - super( new Properties() ); + super( new Properties().tab( Registries.ITEM_GROUP ) ); + } + + @Override + public void fillItemCategory( CreativeModeTab itemGroup, NonNullList< ItemStack > itemStacks ) { + if( !this.allowedIn( itemGroup ) ) + return; + + Stream.of( + UndeadArmorItem.constructItem( UndeadArmorItem.HELMET_ID ), + UndeadArmorItem.constructItem( UndeadArmorItem.CHESTPLATE_ID ), + UndeadArmorItem.constructItem( UndeadArmorItem.LEGGINGS_ID ), + UndeadArmorItem.constructItem( UndeadArmorItem.BOOTS_ID ) + ).forEach( itemStacks::add ); } } diff --git a/src/main/java/com/majruszsdifficulty/items/EndShardItem.java b/src/main/java/com/majruszsdifficulty/items/EndShardItem.java index cba308448..e9f159202 100644 --- a/src/main/java/com/majruszsdifficulty/items/EndShardItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EndShardItem.java @@ -6,6 +6,6 @@ public class EndShardItem extends Item { public EndShardItem() { - super( new Properties().rarity( Rarity.UNCOMMON ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ) ); } } diff --git a/src/main/java/com/majruszsdifficulty/items/EndShardLocatorItem.java b/src/main/java/com/majruszsdifficulty/items/EndShardLocatorItem.java index 1ef0c934d..2f06c7e9e 100644 --- a/src/main/java/com/majruszsdifficulty/items/EndShardLocatorItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EndShardLocatorItem.java @@ -27,7 +27,7 @@ public class EndShardLocatorItem extends Item { private static final float INVALID_DISTANCE = 9001.0f; public EndShardLocatorItem() { - super( new Properties().rarity( Rarity.UNCOMMON ).stacksTo( 1 ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).stacksTo( 1 ) ); } @OnlyIn( Dist.CLIENT ) diff --git a/src/main/java/com/majruszsdifficulty/items/EnderPouchItem.java b/src/main/java/com/majruszsdifficulty/items/EnderPouchItem.java index eceda97b3..ff8a25f6c 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderPouchItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderPouchItem.java @@ -1,5 +1,6 @@ package com.majruszsdifficulty.items; +import com.majruszsdifficulty.Registries; import com.mlib.effects.SoundHandler; import com.mlib.gamemodifiers.contexts.OnPlayerInteract; import net.minecraft.stats.Stats; @@ -11,7 +12,7 @@ public class EnderPouchItem extends Item { public EnderPouchItem() { - super( new Properties().stacksTo( 1 ).rarity( Rarity.UNCOMMON ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).stacksTo( 1 ).rarity( Rarity.UNCOMMON ) ); new OnPlayerInteract.Context( this::openEnderChest ) .addCondition( data->data.itemStack.getItem() instanceof EnderPouchItem ); diff --git a/src/main/java/com/majruszsdifficulty/items/EnderiumArmorItem.java b/src/main/java/com/majruszsdifficulty/items/EnderiumArmorItem.java index 7bde6b683..298cfa873 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderiumArmorItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderiumArmorItem.java @@ -13,6 +13,7 @@ public class EnderiumArmorItem extends ArmorItem { public EnderiumArmorItem( EquipmentSlot slot ) { super( CustomArmorMaterial.END, slot, new Item.Properties() + .tab( Registries.ITEM_GROUP ) .rarity( Rarity.UNCOMMON ) .fireResistant() ); } diff --git a/src/main/java/com/majruszsdifficulty/items/EnderiumAxeItem.java b/src/main/java/com/majruszsdifficulty/items/EnderiumAxeItem.java index f8127c2e3..8ca33635d 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderiumAxeItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderiumAxeItem.java @@ -6,6 +6,6 @@ public class EnderiumAxeItem extends AxeItem { public EnderiumAxeItem() { - super( CustomItemTier.END, 6.0f, -3.1f, new Properties().rarity( Rarity.UNCOMMON ).fireResistant() ); + super( CustomItemTier.END, 6.0f, -3.1f, new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).fireResistant() ); } } \ No newline at end of file diff --git a/src/main/java/com/majruszsdifficulty/items/EnderiumHoeItem.java b/src/main/java/com/majruszsdifficulty/items/EnderiumHoeItem.java index 98b36e553..164e2687a 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderiumHoeItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderiumHoeItem.java @@ -1,5 +1,6 @@ package com.majruszsdifficulty.items; +import com.majruszsdifficulty.Registries; import com.mlib.annotations.AutoInstance; import com.mlib.gamemodifiers.contexts.OnFarmlandTillCheck; import com.mlib.gamemodifiers.contexts.OnItemAttributeTooltip; @@ -11,7 +12,7 @@ public class EnderiumHoeItem extends HoeItem { public EnderiumHoeItem() { - super( CustomItemTier.END, -5, 0.0f, new Properties().rarity( Rarity.UNCOMMON ).fireResistant() ); + super( CustomItemTier.END, -5, 0.0f, new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).fireResistant() ); } @AutoInstance diff --git a/src/main/java/com/majruszsdifficulty/items/EnderiumIngotItem.java b/src/main/java/com/majruszsdifficulty/items/EnderiumIngotItem.java index 922d5837e..b7765b740 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderiumIngotItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderiumIngotItem.java @@ -6,6 +6,6 @@ public class EnderiumIngotItem extends Item { public EnderiumIngotItem() { - super( new Properties().rarity( Rarity.UNCOMMON ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ) ); } } diff --git a/src/main/java/com/majruszsdifficulty/items/EnderiumPickaxeItem.java b/src/main/java/com/majruszsdifficulty/items/EnderiumPickaxeItem.java index 519b68fb4..31166f3ad 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderiumPickaxeItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderiumPickaxeItem.java @@ -6,6 +6,6 @@ public class EnderiumPickaxeItem extends PickaxeItem { public EnderiumPickaxeItem() { - super( CustomItemTier.END, 1, -2.8f, new Properties().rarity( Rarity.UNCOMMON ).fireResistant() ); + super( CustomItemTier.END, 1, -2.8f, new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).fireResistant() ); } } diff --git a/src/main/java/com/majruszsdifficulty/items/EnderiumShovelItem.java b/src/main/java/com/majruszsdifficulty/items/EnderiumShovelItem.java index 41d64e113..40be01eb8 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderiumShovelItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderiumShovelItem.java @@ -6,6 +6,6 @@ public class EnderiumShovelItem extends ShovelItem { public EnderiumShovelItem() { - super( CustomItemTier.END, 1.5f, -3.0f, new Properties().rarity( Rarity.UNCOMMON ).fireResistant() ); + super( CustomItemTier.END, 1.5f, -3.0f, new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).fireResistant() ); } } diff --git a/src/main/java/com/majruszsdifficulty/items/EnderiumSwordItem.java b/src/main/java/com/majruszsdifficulty/items/EnderiumSwordItem.java index 3e812753f..6f1bbe452 100644 --- a/src/main/java/com/majruszsdifficulty/items/EnderiumSwordItem.java +++ b/src/main/java/com/majruszsdifficulty/items/EnderiumSwordItem.java @@ -6,6 +6,6 @@ public class EnderiumSwordItem extends SwordItem { public EnderiumSwordItem() { - super( CustomItemTier.END, 4, -2.6f, new Properties().rarity( Rarity.UNCOMMON ).fireResistant() ); + super( CustomItemTier.END, 4, -2.6f, new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).fireResistant() ); } } diff --git a/src/main/java/com/majruszsdifficulty/items/RecallPotionItem.java b/src/main/java/com/majruszsdifficulty/items/RecallPotionItem.java index da45aa855..f90055fe2 100644 --- a/src/main/java/com/majruszsdifficulty/items/RecallPotionItem.java +++ b/src/main/java/com/majruszsdifficulty/items/RecallPotionItem.java @@ -1,5 +1,6 @@ package com.majruszsdifficulty.items; +import com.majruszsdifficulty.Registries; import com.mlib.Utility; import com.mlib.items.ItemHelper; import com.mlib.levels.LevelHelper; @@ -25,7 +26,7 @@ public class RecallPotionItem extends Item { static final String TOOLTIP_ID = "item.majruszsdifficulty.recall_potion.effect"; public RecallPotionItem() { - super( new Properties().rarity( Rarity.UNCOMMON ).stacksTo( 16 ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ).stacksTo( 16 ) ); } @Override diff --git a/src/main/java/com/majruszsdifficulty/items/TreasureBagItem.java b/src/main/java/com/majruszsdifficulty/items/TreasureBagItem.java index 20bfc934f..faa01169a 100644 --- a/src/main/java/com/majruszsdifficulty/items/TreasureBagItem.java +++ b/src/main/java/com/majruszsdifficulty/items/TreasureBagItem.java @@ -59,7 +59,7 @@ public static LootContext generateLootContext( Player player ) { } public TreasureBagItem( ResourceLocation location, TreasureBagConfig config ) { - super( new Properties().stacksTo( 16 ).rarity( Rarity.UNCOMMON ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).stacksTo( 16 ).rarity( Rarity.UNCOMMON ) ); this.lootTableLocation = location; this.config = config; TREASURE_BAGS.add( this ); diff --git a/src/main/java/com/majruszsdifficulty/items/UndeadBattleStandardItem.java b/src/main/java/com/majruszsdifficulty/items/UndeadBattleStandardItem.java index c06e25451..b73df643a 100644 --- a/src/main/java/com/majruszsdifficulty/items/UndeadBattleStandardItem.java +++ b/src/main/java/com/majruszsdifficulty/items/UndeadBattleStandardItem.java @@ -24,7 +24,7 @@ public class UndeadBattleStandardItem extends Item { private final static String TOOLTIP_TRANSLATION_KEY_3 = "item.majruszsdifficulty.undead_battle_standard.item_tooltip3"; public UndeadBattleStandardItem() { - super( new Properties().stacksTo( 1 ).rarity( Rarity.UNCOMMON ) ); + super( new Properties().tab( Registries.ITEM_GROUP ).stacksTo( 1 ).rarity( Rarity.UNCOMMON ) ); } @Override diff --git a/src/main/java/com/majruszsdifficulty/items/WitherSwordItem.java b/src/main/java/com/majruszsdifficulty/items/WitherSwordItem.java index 10dc9c312..e6c3b5807 100644 --- a/src/main/java/com/majruszsdifficulty/items/WitherSwordItem.java +++ b/src/main/java/com/majruszsdifficulty/items/WitherSwordItem.java @@ -18,7 +18,7 @@ public class WitherSwordItem extends SwordItem { public WitherSwordItem() { - super( CustomItemTier.WITHER, 3, -2.4f, new Properties().rarity( Rarity.UNCOMMON ) ); + super( CustomItemTier.WITHER, 3, -2.4f, new Properties().tab( Registries.ITEM_GROUP ).rarity( Rarity.UNCOMMON ) ); } @AutoInstance diff --git a/src/main/java/com/majruszsdifficulty/models/CursedArmorModel.java b/src/main/java/com/majruszsdifficulty/models/CursedArmorModel.java index e106b5f82..d0414de8f 100644 --- a/src/main/java/com/majruszsdifficulty/models/CursedArmorModel.java +++ b/src/main/java/com/majruszsdifficulty/models/CursedArmorModel.java @@ -8,7 +8,7 @@ import net.minecraft.client.model.geom.ModelPart; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import org.joml.Vector3f; +import com.mojang.math.Vector3f; @OnlyIn( Dist.CLIENT ) public class CursedArmorModel< Type extends CursedArmorEntity > extends HumanoidModel< Type > { diff --git a/src/main/java/com/majruszsdifficulty/models/TankModel.java b/src/main/java/com/majruszsdifficulty/models/TankModel.java index db4f5a2fd..e304088a4 100644 --- a/src/main/java/com/majruszsdifficulty/models/TankModel.java +++ b/src/main/java/com/majruszsdifficulty/models/TankModel.java @@ -12,7 +12,7 @@ import net.minecraft.util.Mth; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import org.joml.Vector3f; +import com.mojang.math.Vector3f; @OnlyIn( Dist.CLIENT ) public class TankModel< Type extends TankEntity > extends HierarchicalModel< Type > { diff --git a/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmy.java b/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmy.java index 2760097d3..f9d8861e4 100644 --- a/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmy.java +++ b/src/main/java/com/majruszsdifficulty/undeadarmy/UndeadArmy.java @@ -291,7 +291,7 @@ private void spawnWaveEnemies() { for( Pair< BlockPos, EntityType< ? > > spawnInfo : this.spawnInfoList ) { BlockPos randomPosition = spawnInfo.getFirst(); EntityType< ? > entityType = spawnInfo.getSecond(); - Entity entity = entityType.create( this.level, null, null, randomPosition, MobSpawnType.EVENT, true, true ); + Entity entity = entityType.create( this.level, null, null, null, randomPosition, MobSpawnType.EVENT, true, true ); if( !( entity instanceof Mob monster ) ) continue; @@ -315,7 +315,7 @@ private void spawnWaveEnemies() { int z = this.positionToAttack.getZ() + this.direction.z * SPAWN_RADIUS; for( ServerPlayer player : getNearbyPlayers() ) - player.connection.send( new ClientboundSoundPacket( Registries.UNDEAD_ARMY_WAVE_STARTED.getHolder().get(), SoundSource.NEUTRAL, x, player.getY(), z, 64.0f, 1.0f, Random.nextInt() ) ); + player.connection.send( new ClientboundSoundPacket( Registries.UNDEAD_ARMY_WAVE_STARTED.getHolder().get().get(), SoundSource.NEUTRAL, x, player.getY(), z, 64.0f, 1.0f, Random.nextInt() ) ); this.undeadToKill = Math.max( this.undeadToKill, 1 ); } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 960b4a163..9422ebc4d 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader = "javafml" -loaderVersion = "[44,)" +loaderVersion = "[43,)" license = "MIT License" issueTrackerURL = "https://github.com/Majrusz/MajruszsProgressiveDifficultyMod/issues" @@ -17,14 +17,14 @@ issueTrackerURL = "https://github.com/Majrusz/MajruszsProgressiveDifficultyMod/i [[dependencies.majruszsdifficulty]] modId = "forge" mandatory = true - versionRange = "[44.0.0,)" + versionRange = "[43.2.0,)" ordering = "NONE" side = "BOTH" [[dependencies.majruszsdifficulty]] modId = "minecraft" mandatory = true - versionRange = "[1.19.3,1.20)" + versionRange = "[1.19.2,1.20)" ordering = "NONE" side = "BOTH"