mirror of
https://github.com/dje4321/TerrafirmaPunk-Tweaks.git
synced 2024-11-16 14:09:39 +00:00
Fix player damage and health potions
Vanilla player damage and health potions are scaled to TFC health
This commit is contained in:
parent
e4b7abe4a7
commit
f72606f44c
@ -1,6 +1,6 @@
|
||||
minecraft_version=1.7.10
|
||||
forge_version=10.13.4.1558-1.7.10
|
||||
tfc_version=0.79.27
|
||||
mod_version=1.01
|
||||
mod_version=1.02
|
||||
mod_id=TerraFirmaPunkTweaks
|
||||
group_name=com.onewolfe.tfptweaks
|
Binary file not shown.
BIN
builds/[1.7.10]TerraFirmaPunkTweaks-1.02.jar
Normal file
BIN
builds/[1.7.10]TerraFirmaPunkTweaks-1.02.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
builds/[1.7.10]TerraFirmaPunkTweaks-deobf-1.02.jar
Normal file
BIN
builds/[1.7.10]TerraFirmaPunkTweaks-deobf-1.02.jar
Normal file
Binary file not shown.
Binary file not shown.
@ -5,11 +5,15 @@ import java.util.Random;
|
||||
import com.bioxx.tfc.api.TFCBlocks;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.event.entity.living.LivingHealEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
|
||||
public class PlayerHandler
|
||||
@ -33,4 +37,23 @@ public class PlayerHandler
|
||||
player.inventory.addItemStackToInventory(new ItemStack(TFCBlocks.chest, 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDamaged(LivingHurtEvent event)
|
||||
{
|
||||
if(event.ammount <= 20 && event.entity instanceof EntityPlayer)
|
||||
{
|
||||
event.ammount = event.ammount * 50;
|
||||
|
||||
if(event.source == DamageSource.magic && (event.entityLiving.getHealth() - event.ammount) <= 0)
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onHeal(LivingHealEvent event)
|
||||
{
|
||||
if(event.amount > 1 && event.amount < 9)
|
||||
event.amount = event.amount * 50;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user