The Flaming Sword and Phoenix Bow now make properly make mobs drop cooked items when killed in one hit.

This commit is contained in:
bconlon 2020-07-13 00:34:52 -07:00
parent 98b311d4b1
commit b3843ae4d4
2 changed files with 20 additions and 4 deletions

View file

@ -35,9 +35,7 @@ import net.minecraft.world.WorldServer;
import net.minecraftforge.event.entity.EntityStruckByLightningEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.*;
import com.legacy.aether.blocks.BlocksAether;
import com.legacy.aether.blocks.portal.BlockAetherPortal;
@ -53,7 +51,6 @@ import com.legacy.aether.registry.achievements.AchievementsAether;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import net.minecraftforge.event.entity.player.PlayerWakeUpEvent;
import net.minecraftforge.event.world.WorldEvent;
public class
@ -250,6 +247,24 @@ AetherEventHandler {
}
}
@SubscribeEvent
public void onEntityAttack(AttackEntityEvent event)
{
if (event.entityPlayer.getHeldItem().getItem() == ItemsAether.flaming_sword)
{
if (event.target.canAttackWithItem())
{
if (!event.target.hitByEntity(event.entityPlayer))
{
if (event.target instanceof EntityLivingBase)
{
event.target.setFire(30);
}
}
}
}
}
public boolean isGravititeTool(Item stackID) {
return stackID == ItemsAether.gravitite_shovel || stackID == ItemsAether.gravitite_axe || stackID == ItemsAether.gravitite_pickaxe;
}

View file

@ -170,6 +170,7 @@ public class ItemPhoenixBow extends ItemBow {
public EntityPhoenixArrow createArrow(World worldIn, float distance, ItemStack stack, EntityLivingBase shooter) {
EntityPhoenixArrow entityPhoenixArrow = new EntityPhoenixArrow(worldIn, shooter, distance);
entityPhoenixArrow.setFire(1200);
return entityPhoenixArrow;
}