-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45b3521
commit f3bbd32
Showing
29 changed files
with
612 additions
and
94 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/java/mrthomas20121/tinkers_reforged/Tools/SwordGladius.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/mrthomas20121/tinkers_reforged/Tools/SwordGreatSword.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/mrthomas20121/tinkers_reforged/Tools/SwordKhopesh.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/mrthomas20121/tinkers_reforged/Tools/ToolClub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/mrthomas20121/tinkers_reforged/Tools/ToolRunicKnife.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/mrthomas20121/tinkers_reforged/Traits/TraitFey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package mrthomas20121.tinkers_reforged.Traits; | ||
|
||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.event.entity.player.PlayerEvent; | ||
import slimeknights.tconstruct.library.modifiers.ModifierAspect; | ||
import slimeknights.tconstruct.library.traits.AbstractTraitLeveled; | ||
|
||
public class TraitFey extends AbstractTraitLeveled { | ||
private int boost = 2; | ||
public TraitFey() | ||
{ | ||
super("ref_fey", 0x67AFAF, 3, 0); | ||
this.aspects.add(ModifierAspect.harvestOnly); | ||
} | ||
@Override | ||
public void miningSpeed(ItemStack tool, PlayerEvent.BreakSpeed event) { | ||
float originalSpeed = event.getOriginalSpeed(); | ||
event.setNewSpeed(originalSpeed+ (boost+levels) ); | ||
} | ||
@Override | ||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) { | ||
return newDamage+ (boost+levels); | ||
} | ||
|
||
@Override | ||
public int onToolHeal(ItemStack tool, int amount, int newAmount, EntityLivingBase entity) { | ||
return newAmount+ (boost+levels); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/mrthomas20121/tinkers_reforged/Traits/TraitLiving.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package mrthomas20121.tinkers_reforged.Traits; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.event.entity.living.LivingHurtEvent; | ||
import slimeknights.tconstruct.library.traits.AbstractTrait; | ||
|
||
public class TraitLiving extends AbstractTrait { | ||
public TraitLiving() | ||
{ | ||
super("ref_living", 0x0); | ||
} | ||
|
||
@Override | ||
public void onBlock(ItemStack tool, EntityPlayer player, LivingHurtEvent event) { | ||
if(player.getHealth() != player.getMaxHealth()) player.heal(2); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/mrthomas20121/tinkers_reforged/Traits/TraitManaBoost.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package mrthomas20121.tinkers_reforged.Traits; | ||
|
||
import baubles.api.BaublesApi; | ||
import baubles.api.cap.IBaublesItemHandler; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.NonNullList; | ||
import slimeknights.tconstruct.library.traits.AbstractTrait; | ||
import slimeknights.tconstruct.library.utils.ToolHelper; | ||
import vazkii.botania.api.mana.ManaItemHandler; | ||
|
||
public class TraitManaBoost extends AbstractTrait { | ||
public TraitManaBoost() | ||
{ | ||
super("ref_mana_boost", 0x0); | ||
} | ||
|
||
@Override | ||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) { | ||
|
||
int tempDamage = 0; | ||
|
||
if(player instanceof EntityPlayer) | ||
{ | ||
EntityPlayer entityPlayer = (EntityPlayer)player; | ||
IBaublesItemHandler baubleInv = BaublesApi.getBaublesHandler(entityPlayer);; | ||
NonNullList<ItemStack> manaStacks = entityPlayer.inventory.mainInventory; | ||
for(ItemStack manaStack: manaStacks) | ||
{ | ||
if(tool.isItemDamaged()) | ||
{ | ||
if(ManaItemHandler.requestManaExact(manaStack, entityPlayer, tool.getMaxDamage(), true)) tempDamage = 15; | ||
} | ||
} | ||
int size = baubleInv.getSlots(); | ||
for(int slot = 0; slot < size; slot++) | ||
{ | ||
ItemStack stackInSlot = baubleInv.getStackInSlot(slot); | ||
if(!stackInSlot.isEmpty()) | ||
{ | ||
if(tool.isItemDamaged() && tempDamage == 0) | ||
{ | ||
if(ManaItemHandler.requestManaExact(stackInSlot, entityPlayer, tool.getMaxDamage(), true)) tempDamage = 15; | ||
} | ||
} | ||
|
||
} | ||
} | ||
if(tempDamage > 0) return newDamage+tempDamage; | ||
return newDamage; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/mrthomas20121/tinkers_reforged/Traits/TraitManaInfusion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package mrthomas20121.tinkers_reforged.Traits; | ||
|
||
import baubles.api.BaublesApi; | ||
import baubles.api.cap.IBaublesItemHandler; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.NonNullList; | ||
import net.minecraft.world.World; | ||
import slimeknights.tconstruct.library.traits.AbstractTrait; | ||
import slimeknights.tconstruct.library.utils.ToolHelper; | ||
import vazkii.botania.api.mana.ManaItemHandler; | ||
|
||
import java.util.List; | ||
|
||
public class TraitManaInfusion extends AbstractTrait { | ||
public TraitManaInfusion() | ||
{ | ||
super("ref_mana_infusion", 0x0); | ||
} | ||
|
||
@Override | ||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) { | ||
if(isSelected) | ||
{ | ||
if(entity instanceof EntityPlayer) | ||
{ | ||
EntityPlayer player = (EntityPlayer)entity; | ||
IBaublesItemHandler baubleInv = BaublesApi.getBaublesHandler(player);; | ||
NonNullList<ItemStack> manaStacks = player.inventory.mainInventory; | ||
for(ItemStack manaStack: manaStacks) | ||
{ | ||
if(tool.isItemDamaged()) | ||
{ | ||
if(ManaItemHandler.requestManaExact(manaStack, player, 100, true)) ToolHelper.repairTool(tool, 10); | ||
} | ||
} | ||
int size = baubleInv.getSlots(); | ||
for(int slot = 0; slot < size; slot++) | ||
{ | ||
ItemStack stackInSlot = baubleInv.getStackInSlot(slot); | ||
if(!stackInSlot.isEmpty()) | ||
{ | ||
if(tool.isItemDamaged()) | ||
{ | ||
if(ManaItemHandler.requestManaExact(stackInSlot, player, 100, true)) ToolHelper.repairTool(tool, 10); | ||
} | ||
} | ||
|
||
} | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.