diff --git a/gradle.properties b/gradle.properties index 7ab8e49e..c0fa2d36 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -mod_version = 1.2b.Beta Mid-Dev +mod_version = 1.2c.Beta Mid-Dev artifact_minecraft_version = 1.19.2 -forge_version = 43.3.13 +forge_version = 43.4.4 mc_version=1.19.2 minecraft_version=1.19.2 diff --git a/src/main/java/uwu/lopyluna/create_dd/DesireClient.java b/src/main/java/uwu/lopyluna/create_dd/DesireClient.java index 8e6d2477..e4d2ea00 100644 --- a/src/main/java/uwu/lopyluna/create_dd/DesireClient.java +++ b/src/main/java/uwu/lopyluna/create_dd/DesireClient.java @@ -12,8 +12,6 @@ import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import uwu.lopyluna.create_dd.infrastructure.client.DebugOutliner; import uwu.lopyluna.create_dd.infrastructure.gui.DesiresBaseConfigScreen; -import uwu.lopyluna.create_dd.infrastructure.ponder.DesirePonderTags; -import uwu.lopyluna.create_dd.infrastructure.ponder.DesiresPonderIndex; import uwu.lopyluna.create_dd.registry.DesiresParticleTypes; import static uwu.lopyluna.create_dd.DesiresCreate.MOD_ID; @@ -28,13 +26,14 @@ public static void onCtorClient(IEventBus modEventBus, IEventBus forgeEventBus) modEventBus.addListener(DesiresParticleTypes::registerFactories); } + @SuppressWarnings("removal") public static void clientInit(final FMLClientSetupEvent event) { ModLoadingContext.get().getActiveContainer().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((minecraft, screen) -> new DesiresBaseConfigScreen(screen, MOD_ID))); - DesirePonderTags.register(); - DesiresPonderIndex.register(); + //DesirePonderTags.register(); + //DesiresPonderIndex.register(); } diff --git a/src/main/java/uwu/lopyluna/create_dd/DesiresCreate.java b/src/main/java/uwu/lopyluna/create_dd/DesiresCreate.java index f2ca2444..f4c3c1e9 100644 --- a/src/main/java/uwu/lopyluna/create_dd/DesiresCreate.java +++ b/src/main/java/uwu/lopyluna/create_dd/DesiresCreate.java @@ -40,7 +40,7 @@ import java.util.Random; -@SuppressWarnings({"deprecation", "unused"}) +@SuppressWarnings({"removal", "deprecation", "unused"}) @Mod(DesiresCreate.MOD_ID) public class DesiresCreate { diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java index d7f4523f..0016fc4b 100644 --- a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java @@ -48,6 +48,7 @@ private static T register(Supplier factory, ModConfig. return config; } + @SuppressWarnings("removal") public static void register(ModLoadingContext context) { client = register(DClient::new, ModConfig.Type.CLIENT); common = register(DCommon::new, ModConfig.Type.COMMON); diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/data/DesiresDatagen.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/data/DesiresDatagen.java index e23120aa..fdad0584 100644 --- a/src/main/java/uwu/lopyluna/create_dd/infrastructure/data/DesiresDatagen.java +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/data/DesiresDatagen.java @@ -9,8 +9,6 @@ import uwu.lopyluna.create_dd.content.data_recipes.MechanicalCraftingRecipeGen; import uwu.lopyluna.create_dd.content.data_recipes.SequencedAssemblyRecipeGen; import uwu.lopyluna.create_dd.content.data_tags.DesiresRegistrateTags; -import uwu.lopyluna.create_dd.infrastructure.ponder.DesirePonderTags; -import uwu.lopyluna.create_dd.infrastructure.ponder.DesiresPonderIndex; import uwu.lopyluna.create_dd.registry.DesiresLangPartial; import java.util.function.BiConsumer; @@ -49,7 +47,7 @@ private static void providePartialLang(BiConsumer consumer) { } private static void providePonderLang() { - DesirePonderTags.register(); - DesiresPonderIndex.register(); + //DesirePonderTags.register(); + //DesiresPonderIndex.register(); } } diff --git a/src/main/java/uwu/lopyluna/create_dd/mixins/MixinEnchantmentHelper.java b/src/main/java/uwu/lopyluna/create_dd/mixins/MixinEnchantmentHelper.java new file mode 100644 index 00000000..4aa3d380 --- /dev/null +++ b/src/main/java/uwu/lopyluna/create_dd/mixins/MixinEnchantmentHelper.java @@ -0,0 +1,42 @@ +package uwu.lopyluna.create_dd.mixins; + +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.enchantment.Enchantment; +import net.minecraft.world.item.enchantment.EnchantmentHelper; +import net.minecraft.world.item.enchantment.Enchantments; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import uwu.lopyluna.create_dd.registry.DesiresTags; + +@Mixin(EnchantmentHelper.class) +public class MixinEnchantmentHelper { + + + @SuppressWarnings("deprecation") + @Inject(method = "getMobLooting(Lnet/minecraft/world/entity/LivingEntity;)I", at = @At(value = "HEAD"), cancellable = true) + private static void getMobLooting(LivingEntity pEntity, CallbackInfoReturnable cir) { + ItemStack stack = desires$isRightForItem(Enchantments.MOB_LOOTING, pEntity); + if (stack != ItemStack.EMPTY) + cir.setReturnValue((net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(Enchantments.MOB_LOOTING, stack) * 3) + 1); + } + + @SuppressWarnings("all") + @Unique + private static ItemStack desires$isRightForItem(Enchantment pEnchantment, LivingEntity pEntity) { + Iterable iterable = pEnchantment.getSlotItems(pEntity).values(); + if (iterable == null) { + return ItemStack.EMPTY; + } else { + ItemStack i = ItemStack.EMPTY; + for(ItemStack itemstack : iterable) { + if (!itemstack.isEmpty() && itemstack.is(DesiresTags.AllItemTags.ADDITIONAL_DROPS_TOOL.tag)) + i = itemstack; + } + return i; + } + } +} diff --git a/src/main/java/uwu/lopyluna/create_dd/mixins/MixinForgeHooks.java b/src/main/java/uwu/lopyluna/create_dd/mixins/MixinForgeHooks.java deleted file mode 100644 index 36e29d6e..00000000 --- a/src/main/java/uwu/lopyluna/create_dd/mixins/MixinForgeHooks.java +++ /dev/null @@ -1,31 +0,0 @@ -package uwu.lopyluna.create_dd.mixins; - -import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.ForgeHooks; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import uwu.lopyluna.create_dd.registry.DesiresTags; - -@Mixin(value = ForgeHooks.class, remap = false) -public class MixinForgeHooks { - - @ModifyExpressionValue(method = "getLootingLevel(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;)I", - at = @At(value = "INVOKE", target = - "Lnet/minecraft/world/item/enchantment/EnchantmentHelper;getMobLooting(Lnet/minecraft/world/entity/LivingEntity;)I")) - private static int create_dd$getMobLooting(int original, Entity target, Entity killer){ - ItemStack pTool = ((LivingEntity) killer).getItemInHand(((LivingEntity) killer).getUsedItemHand()); - return DesiresTags.AllItemTags.ADDITIONAL_DROPS_TOOL.matches(pTool) ? original * original * original + 1 : original; - } - - @ModifyExpressionValue(method = "getLootingLevel(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;)I", - at = @At(value = "INVOKE", target = - "Lnet/minecraftforge/common/ForgeHooks;getLootingLevel(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/damagesource/DamageSource;I)I")) - private static int create_dd$getLootingLevel(int original, Entity target, Entity killer){ - ItemStack pTool = ((LivingEntity) target).getItemInHand(((LivingEntity) target).getUsedItemHand()); - - return DesiresTags.AllItemTags.ADDITIONAL_DROPS_TOOL.matches(pTool) ? original * original * original + 1 : original; - } -} diff --git a/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java b/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java index b56196e9..f2e42c29 100644 --- a/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java +++ b/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java @@ -16,31 +16,31 @@ public class DesiresOreFeaturesEntries { public static final OreFeatureConfigEntry GABBRO_BLOB = - Objects.requireNonNull(create("gabbro_blob", 64, 0.85F, -64, 0).standardDatagenExt()) + Objects.requireNonNull(create("gabbro_blob", 64, 0.85F * 0.75f, -64, 0).standardDatagenExt()) .withBlocks(Couple.create(AllPaletteStoneTypes.GRANITE.baseBlock, DesiresPaletteStoneTypes.GABBRO.baseBlock)) .biomeTag(BiomeTags.IS_OVERWORLD) .parent(); public static final OreFeatureConfigEntry DOLOMITE_BLOB = - Objects.requireNonNull(create("dolomite_blob", 64, 0.85F, -64, 0).standardDatagenExt()) + Objects.requireNonNull(create("dolomite_blob", 64, 0.85F * 0.75f, -64, 0).standardDatagenExt()) .withBlocks(Couple.create(AllPaletteStoneTypes.DIORITE.baseBlock, DesiresPaletteStoneTypes.DOLOMITE.baseBlock)) .biomeTag(BiomeTags.IS_OVERWORLD) .parent(); public static final OreFeatureConfigEntry STRIATED_ERODED_OVERWORLD = - Objects.requireNonNull(create("striated_eroded_overworld", 24, 1 / 36f, -64, 0).layeredDatagenExt()) + Objects.requireNonNull(create("striated_eroded_overworld", 24, (1 / 36f) * 0.75f, -64, 0).layeredDatagenExt()) .withLayerPattern(DesiresLayerPatterns.SPACE_ROCK) .biomeTag(BiomeTags.IS_OVERWORLD) .parent(); public static final OreFeatureConfigEntry STRIATED_ERODED_NETHER = - Objects.requireNonNull(create("striated_eroded_nether", 24, 1 / 36f, 0, 100).layeredDatagenExt()) + Objects.requireNonNull(create("striated_eroded_nether", 24, (1 / 36f) * 0.75f, 0, 100).layeredDatagenExt()) .withLayerPattern(DesiresLayerPatterns.SPACE_ROCK) .biomeTag(BiomeTags.IS_NETHER) .parent(); public static final OreFeatureConfigEntry STRIATED_ORES_OCEANS = - Objects.requireNonNull(create("striated_ores_oceans", 32, 1 / 18f, -30, 70).layeredDatagenExt()) + Objects.requireNonNull(create("striated_ores_oceans", 32, (1 / 18f) * 0.75f, -30, 70).layeredDatagenExt()) .withLayerPattern(DesiresLayerPatterns.WEATHERED_LIMESTONE) .biomeTag(BiomeTags.IS_OCEAN) .parent(); diff --git a/src/main/resources/create_dd.mixins.json b/src/main/resources/create_dd.mixins.json index 3e267943..e44468d0 100644 --- a/src/main/resources/create_dd.mixins.json +++ b/src/main/resources/create_dd.mixins.json @@ -11,8 +11,8 @@ "MixinBlockFluidResBlock", "MixinClutchBlock", "MixinClutchBlockEntity", + "MixinEnchantmentHelper", "MixinFluidPropagator", - "MixinForgeHooks", "MixinGearshiftBlock", "MixinGearshiftBlockEntity", "MixinKineticBlockEntity",