-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Creative RF Source and EU Source
- Loading branch information
Showing
23 changed files
with
775 additions
and
126 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
50 changes: 47 additions & 3 deletions
50
src/main/java/huige233/transcend/compat/tinkers/TraitArmorFlawless.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 |
---|---|---|
@@ -1,23 +1,67 @@ | ||
package huige233.transcend.compat.tinkers; | ||
|
||
import c4.conarm.common.armor.utils.ArmorTagUtil; | ||
import c4.conarm.lib.armor.ArmorNBT; | ||
import c4.conarm.lib.traits.AbstractArmorTrait; | ||
import com.google.common.collect.Collections2; | ||
import com.google.common.collect.Lists; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.MobEffects; | ||
import net.minecraft.inventory.EntityEquipmentSlot; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.potion.PotionEffect; | ||
import net.minecraft.util.DamageSource; | ||
import net.minecraft.util.text.TextFormatting; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.event.entity.living.LivingDamageEvent; | ||
import net.minecraftforge.event.entity.living.LivingHurtEvent; | ||
import slimeknights.tconstruct.library.utils.TagUtil; | ||
|
||
import java.util.List; | ||
|
||
public class TraitArmorFlawless extends AbstractArmorTrait { | ||
public static final TraitArmorFlawless a = new TraitArmorFlawless(); | ||
public TraitArmorFlawless() { | ||
super("flawless",TextFormatting.DARK_GRAY); | ||
super("flawless",0x777777); | ||
MinecraftForge.EVENT_BUS.register(this); | ||
} | ||
|
||
public float onHurt(ItemStack armor,EntityPlayer player, DamageSource source, float damage, float newDamage, LivingHurtEvent evt){ | ||
return 0.0f; | ||
return damage-1000; | ||
} | ||
|
||
public float onDamaged(ItemStack armor, EntityPlayer player, DamageSource source, float damage, float newDamage, LivingDamageEvent evt) { | ||
return 0.0f; | ||
if (player.getHealth() - newDamage <= 0.0F && random.nextFloat() <= 0.1F) { | ||
player.heal(2.0F); | ||
evt.setCanceled(true); | ||
} | ||
return damage-1000; | ||
} | ||
|
||
@Override | ||
public void onArmorTick(ItemStack armor, World world, EntityPlayer player){ | ||
player.setAir(300); | ||
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 300, 0, false, false)); | ||
player.capabilities.allowFlying = true; | ||
player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 300, 14, false, false)); | ||
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 300, 14, false, false)); | ||
player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 300, 2, false, false)); | ||
player.addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST, 300, 2, false, false)); | ||
player.stepHeight=0.6f; | ||
player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 300, 9, false, false)); | ||
if(player.isBurning()) { | ||
player.extinguish(); | ||
} | ||
} | ||
|
||
@Override | ||
public void applyEffect(NBTTagCompound rootCompound, NBTTagCompound modifierTag) { | ||
super.applyEffect(rootCompound, modifierTag); | ||
ArmorNBT data = ArmorTagUtil.getArmorStats(rootCompound); | ||
ArmorNBT orginal = ArmorTagUtil.getOriginalArmorStats(rootCompound); | ||
data.modifiers += orginal.modifiers + 10; | ||
TagUtil.setToolTag(rootCompound,data.get()); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
src/main/java/huige233/transcend/compat/tinkers/TraitArmorTranscend.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,75 @@ | ||
package huige233.transcend.compat.tinkers; | ||
|
||
import c4.conarm.common.armor.traits.TraitVoltaic; | ||
import c4.conarm.common.armor.utils.ArmorTagUtil; | ||
import c4.conarm.lib.armor.ArmorNBT; | ||
import c4.conarm.lib.traits.AbstractArmorTrait; | ||
import com.google.common.collect.Collections2; | ||
import com.google.common.collect.Lists; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.MobEffects; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.potion.PotionEffect; | ||
import net.minecraft.util.DamageSource; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.event.entity.living.LivingHurtEvent; | ||
import slimeknights.tconstruct.library.modifiers.ModifierNBT; | ||
import slimeknights.tconstruct.library.utils.ModifierTagHolder; | ||
import slimeknights.tconstruct.library.utils.TagUtil; | ||
|
||
import java.util.List; | ||
|
||
public class TraitArmorTranscend extends AbstractArmorTrait { | ||
public static final TraitArmorTranscend a = new TraitArmorTranscend(); | ||
public TraitArmorTranscend() { | ||
super("transcend",0xF8F8FF); | ||
MinecraftForge.EVENT_BUS.register(this); | ||
} | ||
|
||
@Override | ||
public float onHurt(ItemStack armor, EntityPlayer player, DamageSource source, float damage, float newDamage, LivingHurtEvent evt){ | ||
evt.setCanceled(true); | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int onArmorDamage(ItemStack armor, DamageSource source, int damage, int newDamage, EntityPlayer player, int slot) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void onArmorTick(ItemStack armor, World world, EntityPlayer player){ | ||
player.setAir(300); | ||
player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 300, 14, false, false)); | ||
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 300, 0, false, false)); | ||
player.capabilities.allowFlying = true; | ||
player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 300, 14, false, false)); | ||
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 300, 14, false, false)); | ||
List<PotionEffect> effects = Lists.newArrayList(player.getActivePotionEffects()); | ||
for(PotionEffect potion : Collections2.filter(effects, potion -> potion.getPotion().isBadEffect())) { | ||
player.removePotionEffect(potion.getPotion()); | ||
} | ||
player.getFoodStats().addStats(20, 20.0f); | ||
player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 300, 2, false, false)); | ||
player.addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST, 300, 2, false, false)); | ||
player.stepHeight=3; | ||
player.setFire(0); | ||
player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 300, 9, false, false)); | ||
player.addPotionEffect(new PotionEffect(MobEffects.HASTE, 300, 44, false, false)); | ||
if(player.isBurning()) { | ||
player.extinguish(); | ||
} | ||
} | ||
|
||
@Override | ||
public void applyEffect(NBTTagCompound rootCompound, NBTTagCompound modifierTag) { | ||
super.applyEffect(rootCompound, modifierTag); | ||
ArmorNBT data = ArmorTagUtil.getArmorStats(rootCompound); | ||
ArmorNBT orginal = ArmorTagUtil.getOriginalArmorStats(rootCompound); | ||
data.modifiers += orginal.modifiers + 100; | ||
TagUtil.setToolTag(rootCompound,data.get()); | ||
rootCompound.setBoolean("Unbreakable", true); | ||
} | ||
} |
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.