Skip to content

Commit

Permalink
Allow ITNT and PowderBarrels to make AE singularities (GregTechCEu#2442)
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers authored Apr 4, 2024
1 parent f33da7f commit 7e01d33
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/gregtech/common/EventHandlers.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import gregtech.api.util.BlockUtility;
import gregtech.api.util.CapesRegistry;
import gregtech.api.util.GTUtility;
import gregtech.api.util.Mods;
import gregtech.api.util.VirtualTankRegistry;
import gregtech.api.worldgen.bedrockFluids.BedrockFluidVeinSaveData;
import gregtech.common.entities.EntityGTExplosive;
Expand All @@ -23,6 +24,7 @@

import net.minecraft.block.state.IBlockState;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
Expand Down Expand Up @@ -63,6 +65,8 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.ItemHandlerHelper;

import appeng.entity.EntitySingularity;

@Mod.EventBusSubscriber(modid = GTValues.MODID)
public class EventHandlers {

Expand Down Expand Up @@ -381,8 +385,12 @@ public static void onFurnaceFuelBurnTime(FurnaceFuelBurnTimeEvent event) {
public static void onExplosionDetonate(ExplosionEvent.Detonate event) {
if (event.getExplosion().exploder instanceof EntityGTExplosive explosive) {
if (explosive.dropsAllBlocks()) {
event.getAffectedEntities().removeIf(entity -> entity instanceof EntityItem);
event.getAffectedEntities().removeIf(entity -> entity instanceof EntityItem && !checkAEEntity(entity));
}
}
}

private static boolean checkAEEntity(Entity entity) {
return Mods.AppliedEnergistics2.isModLoaded() && entity instanceof EntitySingularity;
}
}

0 comments on commit 7e01d33

Please sign in to comment.