some update from months ago that I can't remember.
This commit is contained in:
parent
b6daf58058
commit
d786d41d11
|
@ -67,6 +67,10 @@ public class SMovingArmorModel extends ModelPlayer implements IArmorModel {
|
||||||
visibleSection = value;
|
visibleSection = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the models various rotation angles then renders the model.
|
* Sets the models various rotation angles then renders the model.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,12 +16,12 @@ import net.machinemuse.utils.ElectricItemUtils;
|
||||||
import net.machinemuse.utils.MuseCommonStrings;
|
import net.machinemuse.utils.MuseCommonStrings;
|
||||||
import net.machinemuse.utils.MuseItemUtils;
|
import net.machinemuse.utils.MuseItemUtils;
|
||||||
import net.machinemuse.utils.MuseStringUtils;
|
import net.machinemuse.utils.MuseStringUtils;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.WeightedRandom;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -45,6 +45,10 @@ public abstract class ItemElectricArmor extends ItemArmor implements IModularIte
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public int getColorFromItemStack(ItemStack itemStack, int par2) {
|
public int getColorFromItemStack(ItemStack itemStack, int par2) {
|
||||||
|
|
||||||
|
WeightedRandom.Item test;
|
||||||
|
|
||||||
|
|
||||||
return getColorFromItemStack(itemStack).getInt();
|
return getColorFromItemStack(itemStack).getInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,14 +97,9 @@ public abstract class ItemPowerArmor extends ItemElectricArmor implements ISpeci
|
||||||
return ModuleManager.tagHasModule(itemTag, TintModule.RED_TINT) || ModuleManager.tagHasModule(itemTag, TintModule.GREEN_TINT) || ModuleManager.tagHasModule(itemTag, TintModule.BLUE_TINT);
|
return ModuleManager.tagHasModule(itemTag, TintModule.RED_TINT) || ModuleManager.tagHasModule(itemTag, TintModule.GREEN_TINT) || ModuleManager.tagHasModule(itemTag, TintModule.BLUE_TINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
double getHeatResistance(EntityPlayer player, ItemStack stack) {
|
|
||||||
return MuseHeatUtils.getMaxHeat(stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getArmorDouble(EntityPlayer player, ItemStack stack) {
|
public double getArmorDouble(EntityPlayer player, ItemStack stack) {
|
||||||
double totalArmor = 0;
|
double totalArmor = 0;
|
||||||
NBTTagCompound props = MuseItemUtils.getMuseItemTag(stack);
|
|
||||||
double energy = ElectricItemUtils.getPlayerEnergy(player);
|
double energy = ElectricItemUtils.getPlayerEnergy(player);
|
||||||
double physArmor = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_VALUE_PHYSICAL);
|
double physArmor = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_VALUE_PHYSICAL);
|
||||||
double enerArmor = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_VALUE_ENERGY);
|
double enerArmor = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_VALUE_ENERGY);
|
||||||
|
@ -160,7 +155,6 @@ public abstract class ItemPowerArmor extends ItemElectricArmor implements ISpeci
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||||
NBTTagCompound itemProperties = MuseItemUtils.getMuseItemTag(stack);
|
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
if (source == MuseHeatUtils.overheatDamage) {
|
if (source == MuseHeatUtils.overheatDamage) {
|
||||||
} else if (source.isFireDamage()) {
|
} else if (source.isFireDamage()) {
|
||||||
|
|
|
@ -18,7 +18,6 @@ import net.machinemuse.utils.MuseCommonStrings;
|
||||||
import net.machinemuse.utils.MuseItemUtils;
|
import net.machinemuse.utils.MuseItemUtils;
|
||||||
import net.machinemuse.utils.MuseStringUtils;
|
import net.machinemuse.utils.MuseStringUtils;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
|
|
|
@ -39,10 +39,8 @@ public class SprintAssistModule extends PowerModuleBase implements IToggleableMo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerTickActive(EntityPlayer player, ItemStack item) {
|
public void onPlayerTickActive(EntityPlayer player, ItemStack item) {
|
||||||
double motionX = player.posX - player.lastTickPosX;
|
double horzMovement = player.distanceWalkedModified - player.prevDistanceWalkedModified;
|
||||||
double motionY = player.posY - player.lastTickPosY;
|
|
||||||
double motionZ = player.posZ - player.lastTickPosZ;
|
|
||||||
double horzMovement = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
|
||||||
double totalEnergy = ElectricItemUtils.getPlayerEnergy(player);
|
double totalEnergy = ElectricItemUtils.getPlayerEnergy(player);
|
||||||
if (player.isSprinting()) {
|
if (player.isSprinting()) {
|
||||||
double exhaustion = Math.round(horzMovement * 100.0F) * 0.01;
|
double exhaustion = Math.round(horzMovement * 100.0F) * 0.01;
|
||||||
|
|
|
@ -41,6 +41,8 @@ public class ElectricItemUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void drainPlayerEnergy(EntityPlayer player, double drainAmount) {
|
public static void drainPlayerEnergy(EntityPlayer player, double drainAmount) {
|
||||||
|
if (player.capabilities.isCreativeMode)
|
||||||
|
return;
|
||||||
double drainleft = drainAmount;
|
double drainleft = drainAmount;
|
||||||
for (ElectricAdapter adapter: electricItemsEquipped(player))
|
for (ElectricAdapter adapter: electricItemsEquipped(player))
|
||||||
if (drainleft > 0)
|
if (drainleft > 0)
|
||||||
|
|
|
@ -55,6 +55,9 @@ public class MuseHeatUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void heatPlayer(EntityPlayer player, double heatDegrees) {
|
public static void heatPlayer(EntityPlayer player, double heatDegrees) {
|
||||||
|
if (player.capabilities.isCreativeMode)
|
||||||
|
return;
|
||||||
|
|
||||||
List<ItemStack> items = MuseItemUtils.getModularItemsInInventory(player);
|
List<ItemStack> items = MuseItemUtils.getModularItemsInInventory(player);
|
||||||
if (player.isUsingItem()) {
|
if (player.isUsingItem()) {
|
||||||
items.remove(player.getCurrentEquippedItem());
|
items.remove(player.getCurrentEquippedItem());
|
||||||
|
|
Loading…
Reference in a new issue