diff --git a/dependencies.gradle b/dependencies.gradle index 6335cc00..6455362e 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,8 +1,9 @@ // Add your dependencies here dependencies { - implementation('com.github.GTNewHorizons:GTNHLib:0.3.3:dev') - implementation('com.github.GTNewHorizons:NotEnoughItems:2.6.14-GTNH:dev') + implementation('com.github.GTNewHorizons:GTNHLib:0.4.3:dev') + implementation('com.github.GTNewHorizons:NotEnoughItems:2.6.26-GTNH:dev') compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') + compileOnly('com.github.GTNewHorizons:Mobs-Info:0.4.2-GTNH:dev') } diff --git a/gradle.properties b/gradle.properties index 3d0f2a7b..6f208ea4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -85,6 +85,11 @@ accessTransformersFile = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = false +# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main. +# This can speed up compile times thanks to not running the mixin annotation processor on all input sources. +# Mixin classes will have access to "main" classes, but not the other way around. +separateMixinSourceSet = + # Adds some debug arguments like verbose output and class export. usesMixinDebug = false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136..2c352119 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4413138..09523c0e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf13..f5feea6d 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # 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 +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30db..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/settings.gradle b/settings.gradle index 731d57d0..242692e5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.24' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.26' } diff --git a/src/main/java/chylex/hee/entity/boss/EntityMiniBossFireFiend.java b/src/main/java/chylex/hee/entity/boss/EntityMiniBossFireFiend.java index 51345899..2f7948b3 100644 --- a/src/main/java/chylex/hee/entity/boss/EntityMiniBossFireFiend.java +++ b/src/main/java/chylex/hee/entity/boss/EntityMiniBossFireFiend.java @@ -4,6 +4,8 @@ import java.util.Iterator; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityFlying; import net.minecraft.entity.EntityLivingBase; @@ -19,6 +21,9 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +import com.kuba6000.mobsinfo.api.IMobInfoProvider; +import com.kuba6000.mobsinfo.api.MobDrop; + import chylex.hee.HardcoreEnderExpansion; import chylex.hee.entity.GlobalMobData.IIgnoreEnderGoo; import chylex.hee.entity.RandomNameGenerator; @@ -35,8 +40,11 @@ import chylex.hee.system.util.BlockPosM; import chylex.hee.system.util.DragonUtil; import chylex.hee.system.util.MathUtil; +import cpw.mods.fml.common.Optional; -public class EntityMiniBossFireFiend extends EntityFlying implements IBossDisplayData, IIgnoreEnderGoo { +@Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobInfoProvider", modid = "mobsinfo") +public class EntityMiniBossFireFiend extends EntityFlying + implements IBossDisplayData, IIgnoreEnderGoo, IMobInfoProvider { private static final byte ATTACK_NONE = 0, ATTACK_FIREBALLS = 1, ATTACK_FLAMES = 2; @@ -64,8 +72,8 @@ public EntityMiniBossFireFiend(World world) { @Override protected void entityInit() { super.entityInit(); - dataWatcher.addObject(16, Byte.valueOf((byte) 0)); - dataWatcher.addObject(17, Byte.valueOf((byte) 0)); + dataWatcher.addObject(16, (byte) 0); + dataWatcher.addObject(17, (byte) 0); } @Override @@ -295,11 +303,18 @@ public void setHealth(float newHealth) { @Override protected void dropFewItems(boolean recentlyHit, int looting) { + // ANY CHANGE MADE IN HERE MUST ALSO BE MADE IN provideDropsInformation! for (int a = 0; a < 80; a++) entityDropItem( new ItemStack(ItemList.essence, 3, EssenceType.FIERY.getItemDamage()), rand.nextFloat() * height); } + @Optional.Method(modid = "mobsinfo") + @Override + public void provideDropsInformation(@Nonnull ArrayList drops) { + drops.add(MobDrop.create(new ItemStack(ItemList.essence, 3 * 80, EssenceType.FIERY.getItemDamage()))); + } + @Override public void knockBack(Entity entity, float damage, double xPower, double zPower) { super.knockBack(entity, damage, xPower, zPower); diff --git a/src/main/java/chylex/hee/mechanics/MiscEvents.java b/src/main/java/chylex/hee/mechanics/MiscEvents.java index 690df5db..99703aea 100644 --- a/src/main/java/chylex/hee/mechanics/MiscEvents.java +++ b/src/main/java/chylex/hee/mechanics/MiscEvents.java @@ -1,5 +1,10 @@ package chylex.hee.mechanics; +import java.util.ArrayList; +import java.util.Arrays; + +import javax.annotation.Nonnull; + import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.monster.EntitySilverfish; @@ -12,16 +17,23 @@ import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.player.EntityInteractEvent; +import com.kuba6000.mobsinfo.api.IChanceModifier; +import com.kuba6000.mobsinfo.api.IMobExtraInfoProvider; +import com.kuba6000.mobsinfo.api.MobDrop; +import com.kuba6000.mobsinfo.api.MobRecipe; + import chylex.hee.entity.item.EntityItemDragonEgg; import chylex.hee.init.ItemList; import chylex.hee.item.ItemTransferenceGem; import chylex.hee.mechanics.enhancements.EnhancementHandler; import chylex.hee.mechanics.enhancements.types.TransferenceGemEnhancements; import chylex.hee.system.util.ItemUtil; +import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -public class MiscEvents { +@Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobExtraInfoProvider", modid = "mobsinfo") +public class MiscEvents implements IMobExtraInfoProvider { /* * Dragon Egg entity join world @@ -53,6 +65,7 @@ public void onEntityJoinWorld(EntityJoinWorldEvent e) { */ @SubscribeEvent public void onLivingDrops(LivingDropsEvent e) { + // ANY CHANGE MADE IN HERE MUST ALSO BE MADE IN provideDropsInformation! if (e.entity.worldObj.isRemote /* || SpectralEssenceHandler.handleMobDeath(e) */ || !e.recentlyHit) return; if (e.entity.getClass() == EntitySilverfish.class @@ -78,6 +91,28 @@ public void onLivingDrops(LivingDropsEvent e) { } } + @Optional.Method(modid = "mobsinfo") + @Override + public void provideExtraDropsInformation(@Nonnull String entityString, @Nonnull ArrayList drops, + @Nonnull MobRecipe recipe) { + if (recipe.entity.getClass() == EntitySilverfish.class) { + MobDrop drop = new MobDrop( + new ItemStack(ItemList.silverfish_blood), + MobDrop.DropType.Normal, + 179, + null, + null, + false, + false); + drop.variableChance = true; + drop.chanceModifiers.addAll( + Arrays.asList( + new IChanceModifier.NormalChance(1.79d), + new IChanceModifier.OrUsing(Items.golden_sword, 7.14d))); + drops.add(drop); + } + } + /* * Right-clicking on item frame, mob and item with Transference Gem */