forked from TAIGA/TAIGA
Added first two Material Traits (onBlock not in use actual, caused of Mojangs rework of blocking ability on weapons)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.sosnitzka.ztic_addon.util.traits;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||
|
||||
/**
|
||||
* Created by Robert on 14.05.2016.
|
||||
*/
|
||||
public class TraitInstable extends AbstractTrait {
|
||||
|
||||
|
||||
public TraitInstable() {
|
||||
super("instable", TextFormatting.DARK_RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||
if (player.getHealth() > 2) {
|
||||
world.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), 3, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.sosnitzka.ztic_addon.util.traits;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||
|
||||
/**
|
||||
* Created by Robert on 14.05.2016.
|
||||
*/
|
||||
public class TraitResonance extends AbstractTrait {
|
||||
|
||||
|
||||
public TraitResonance() {
|
||||
super("resonance", TextFormatting.AQUA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlock(ItemStack tool, EntityPlayer player, LivingHurtEvent event) {
|
||||
player.addChatComponentMessage(new TextComponentString(event.getEntity() + " " + event.getEntityLiving()));
|
||||
|
||||
// event.getEntityLiving().knockBack(event.getEntityLiving(), 20f, 20f, 20f);
|
||||
// event.getSource().getEntity()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user