[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-28 18:04:28 -08:00
1 parent 83698cb73c
commit 84c2239244
561 files changed
+8872 -9300

No files matched your search

@@ -1,21 +1,24 @@
package tconstruct.armor;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.TConstruct;
import tconstruct.armor.items.TravelGear;
import tconstruct.armor.player.TPlayerStats;
import tconstruct.library.modifier.IModifyable;
import tconstruct.util.network.HealthUpdatePacket;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
public class ArmorAbilities {
public static List<String> stepBoostedPlayers = new ArrayList<>();
// ItemStack prevFeet;
double prevMotionY;
@@ -39,8 +42,8 @@ public class ArmorAbilities {
ItemStack feet = player.getCurrentArmor(0);
if (feet != null && feet.hasTagCompound()) {
if (feet.getItem() instanceof IModifyable && !player.isSneaking()) {
NBTTagCompound tag =
feet.getTagCompound().getCompoundTag(((IModifyable) feet.getItem()).getBaseTagName());
NBTTagCompound tag = feet.getTagCompound()
.getCompoundTag(((IModifyable) feet.getItem()).getBaseTagName());
int sole = tag.getInteger("Slimy Soles");
if (sole > 0) {
if (!player.isSneaking() && player.onGround && prevMotionY < -0.4)
@@ -49,17 +52,12 @@ public class ArmorAbilities {
}
prevMotionY = player.motionY;
}
/* Former step height boost handling
if (feet != prevFeet)
{
if (prevFeet != null && prevFeet.getItem() instanceof TravelGear)
player.stepHeight -= 0.6f;
if (feet != null && feet.getItem() instanceof TravelGear)
player.stepHeight += 0.6f;
prevFeet = feet;
}*/
boolean stepBoosted =
stepBoostedPlayers.contains(player.getGameProfile().getName());
/*
* Former step height boost handling if (feet != prevFeet) { if (prevFeet != null && prevFeet.getItem()
* instanceof TravelGear) player.stepHeight -= 0.6f; if (feet != null && feet.getItem() instanceof TravelGear)
* player.stepHeight += 0.6f; prevFeet = feet; }
*/
boolean stepBoosted = stepBoostedPlayers.contains(player.getGameProfile().getName());
if (stepBoosted) player.stepHeight = 1.1f;
if (!stepBoosted && feet != null && feet.getItem() instanceof TravelGear) {
stepBoostedPlayers.add(player.getGameProfile().getName());
@@ -68,11 +66,10 @@ public class ArmorAbilities {
player.stepHeight -= 0.6f;
}
// TODO: Proper minimap support
/*ItemStack stack = player.inventory.getStackInSlot(8);
if (stack != null && stack.getItem() instanceof ItemMap)
{
stack.getItem().onUpdate(stack, player.worldObj, player, 8, true);
}*/
/*
* ItemStack stack = player.inventory.getStackInSlot(8); if (stack != null && stack.getItem() instanceof
* ItemMap) { stack.getItem().onUpdate(stack, player.worldObj, player, 8, true); }
*/
}
@SubscribeEvent
@@ -82,7 +79,7 @@ public class ArmorAbilities {
// this callback is only called serverside
float oldHealth = event.player.getHealth();
// tell the client to update its hp
TConstruct.packetPipeline.sendTo(
new HealthUpdatePacket(oldHealth), (net.minecraft.entity.player.EntityPlayerMP) event.player);
TConstruct.packetPipeline
.sendTo(new HealthUpdatePacket(oldHealth), (net.minecraft.entity.player.EntityPlayerMP) event.player);
}
}
@@ -1,10 +1,9 @@
package tconstruct.armor;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.Random;
import mantle.lib.client.MantleClientRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.model.ModelBiped;
@@ -29,6 +28,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.common.MinecraftForge;
import tconstruct.armor.gui.ArmorExtendedGui;
import tconstruct.armor.gui.KnapsackGui;
import tconstruct.armor.items.TravelGear;
@@ -50,8 +50,12 @@ import tconstruct.library.client.TConstructClientRegistry;
import tconstruct.library.crafting.ModifyBuilder;
import tconstruct.tools.TinkerTools;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class ArmorProxyClient extends ArmorProxyCommon {
public static WingModel wings = new WingModel();
public static BootBump bootbump = new BootBump();
public static HiddenPlayerModel glove = new HiddenPlayerModel(0.25F, 4);
@@ -127,16 +131,8 @@ public class ArmorProxyClient extends ArmorProxyCommon {
new ItemStack(Blocks.piston),
null);
ItemStack[] recipe = new ItemStack[] {
new ItemStack(TinkerWorld.slimeGel, 1, 0),
new ItemStack(Items.ender_pearl),
feather,
feather,
feather,
feather,
feather,
feather
};
ItemStack[] recipe = new ItemStack[] { new ItemStack(TinkerWorld.slimeGel, 1, 0),
new ItemStack(Items.ender_pearl), feather, feather, feather, feather, feather, feather };
ItemStack modWings = ModifyBuilder.instance.modifyItem(wings, recipe);
MantleClientRegistry.registerManualLargeRecipe(
"featherfall",
@@ -160,7 +156,10 @@ public class ArmorProxyClient extends ArmorProxyCommon {
new ItemStack(Blocks.piston),
null);
TConstructClientRegistry.registerManualModifier(
"waterwalk", boots.copy(), new ItemStack(Blocks.waterlily), new ItemStack(Blocks.waterlily));
"waterwalk",
boots.copy(),
new ItemStack(Blocks.waterlily),
new ItemStack(Blocks.waterlily));
TConstructClientRegistry.registerManualModifier("leadboots", boots.copy(), new ItemStack(Blocks.iron_block));
TConstructClientRegistry.registerManualModifier(
"slimysoles",
@@ -169,8 +168,8 @@ public class ArmorProxyClient extends ArmorProxyCommon {
new ItemStack(TinkerWorld.slimePad, 1, 0));
ItemStack gloves = TinkerArmor.travelGlove.getDefaultItem();
TConstructClientRegistry.registerManualModifier(
"glovehaste", gloves.copy(), redstone, new ItemStack(Blocks.redstone_block));
TConstructClientRegistry
.registerManualModifier("glovehaste", gloves.copy(), redstone, new ItemStack(Blocks.redstone_block));
// MantleClientRegistry.registerManualSmallRecipe("gloveclimb", gloves.copy(), new ItemStack(Items.slime_ball),
// new ItemStack(Blocks.web), new ItemStack(TinkerTools.materials, 1, 25), null);
TConstructClientRegistry.registerManualModifier(
@@ -379,11 +378,23 @@ public class ArmorProxyClient extends ArmorProxyCommon {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(
par1 + 0, par2 + par6, this.zLevel, (float) (par3 + 0) * f, (float) (par4 + par6) * f1);
par1 + 0,
par2 + par6,
this.zLevel,
(float) (par3 + 0) * f,
(float) (par4 + par6) * f1);
tessellator.addVertexWithUV(
par1 + par5, par2 + par6, this.zLevel, (float) (par3 + par5) * f, (float) (par4 + par6) * f1);
par1 + par5,
par2 + par6,
this.zLevel,
(float) (par3 + par5) * f,
(float) (par4 + par6) * f1);
tessellator.addVertexWithUV(
par1 + par5, par2 + 0, this.zLevel, (float) (par3 + par5) * f, (float) (par4 + 0) * f1);
par1 + par5,
par2 + 0,
this.zLevel,
(float) (par3 + par5) * f,
(float) (par4 + 0) * f1);
tessellator.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (float) (par3 + 0) * f, (float) (par4 + 0) * f1);
tessellator.draw();
}
@@ -449,7 +460,9 @@ public class ArmorProxyClient extends ArmorProxyCommon {
if (player.isRiding() && player.ridingEntity instanceof EntityLivingBase) {
EntityLivingBase entitylivingbase1 = (EntityLivingBase) player.ridingEntity;
yawOffset = this.interpolateRotation(
entitylivingbase1.prevRenderYawOffset, entitylivingbase1.renderYawOffset, partialTick);
entitylivingbase1.prevRenderYawOffset,
entitylivingbase1.renderYawOffset,
partialTick);
pitch = MathHelper.wrapAngleTo180_float(yawRotation - yawOffset);
if (pitch < -85.0F) {
@@ -469,8 +482,8 @@ public class ArmorProxyClient extends ArmorProxyCommon {
pitch = this.handleRotationFloat(player, partialTick);
float bodyRotation = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTick;
float limbSwing =
player.prevLimbSwingAmount + (player.limbSwingAmount - player.prevLimbSwingAmount) * partialTick;
float limbSwing = player.prevLimbSwingAmount
+ (player.limbSwingAmount - player.prevLimbSwingAmount) * partialTick;
float limbSwingMod = player.limbSwing - player.limbSwingAmount * (1.0F - partialTick);
// TPlayerStats stats = TPlayerStats.get(player);
ArmorExtended armor = ArmorProxyClient.armorExtended; // TODO: Do this for every player, not just the client
@@ -479,8 +492,7 @@ public class ArmorProxyClient extends ArmorProxyCommon {
ModelBiped model = item.getArmorModel(player, armor.inventory[1], 4);
if (item instanceof IAccessoryModel) {
this.mc
.getTextureManager()
this.mc.getTextureManager()
.bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1));
model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick);
model.render(
@@ -499,8 +511,7 @@ public class ArmorProxyClient extends ArmorProxyCommon {
ModelBiped model = item.getArmorModel(player, armor.inventory[3], 5);
if (item instanceof IAccessoryModel) {
this.mc
.getTextureManager()
this.mc.getTextureManager()
.bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1));
model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick);
model.render(
@@ -1,15 +1,17 @@
package tconstruct.armor;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import tconstruct.TConstruct;
import tconstruct.armor.inventory.*;
import tconstruct.armor.player.TPlayerStats;
import tconstruct.common.TProxyCommon;
import cpw.mods.fml.common.network.IGuiHandler;
public class ArmorProxyCommon implements IGuiHandler {
public static final int inventoryGui = 100;
public static final int armorGuiID = 101;
public static final int knapsackGuiID = 102;
@@ -1,10 +1,11 @@
package tconstruct.armor;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
public class ArmorTickHandler {
@@ -13,14 +14,15 @@ public class ArmorTickHandler {
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void tickEnd(ClientTickEvent event) {
/*TinkerWorld.oreBerry.setGraphicsLevel(Blocks.leaves.field_150121_P);
TinkerWorld.oreBerrySecond.setGraphicsLevel(Blocks.leaves.field_150121_P);
TinkerWorld.slimeLeaves.setGraphicsLevel(Blocks.leaves.field_150121_P);*/
/*
* TinkerWorld.oreBerry.setGraphicsLevel(Blocks.leaves.field_150121_P);
* TinkerWorld.oreBerrySecond.setGraphicsLevel(Blocks.leaves.field_150121_P);
* TinkerWorld.slimeLeaves.setGraphicsLevel(Blocks.leaves.field_150121_P);
*/
if (mc.thePlayer != null && mc.thePlayer.onGround) ArmorProxyClient.controlInstance.landOnGround();
}
/*
* @Override public EnumSet<TickType> ticks () { return
* EnumSet.of(TickType.RENDER); }
* @Override public EnumSet<TickType> ticks () { return EnumSet.of(TickType.RENDER); }
*/
}
@@ -5,6 +5,7 @@ import net.minecraft.entity.player.*;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import net.minecraft.potion.*;
import tconstruct.armor.player.*;
import tconstruct.util.config.PHConstruct;
+213 -200
View File
@@ -1,11 +1,9 @@
package tconstruct.armor;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
import java.util.EnumSet;
import mantle.pulsar.pulse.*;
import net.minecraft.block.Block;
import net.minecraft.init.*;
import net.minecraft.item.*;
@@ -14,6 +12,7 @@ import net.minecraft.util.StatCollector;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.ShapedOreRecipe;
import tconstruct.TConstruct;
import tconstruct.armor.blocks.DryingRack;
import tconstruct.armor.items.*;
@@ -27,10 +26,15 @@ import tconstruct.modifiers.armor.*;
import tconstruct.modifiers.tools.ModAttack;
import tconstruct.tools.TinkerTools;
import tconstruct.world.TinkerWorld;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(TConstruct.modID)
@Pulse(id = "Tinkers' Armory", description = "Modifyable armors, such as the traveller's gear.")
public class TinkerArmor {
@SidedProxy(clientSide = "tconstruct.armor.ArmorProxyClient", serverSide = "tconstruct.armor.ArmorProxyCommon")
public static ArmorProxyCommon proxy;
@@ -41,12 +45,9 @@ public class TinkerArmor {
public static Block dryingRack;
// Wearables
/*
public static Item heavyHelmet;
public static Item heavyChestplate;
public static Item heavyPants;
public static Item heavyBoots;
public static Item glove;
*/
* public static Item heavyHelmet; public static Item heavyChestplate; public static Item heavyPants; public static
* Item heavyBoots; public static Item glove;
*/
public static Item knapsack;
public static Item heartCanister;
// Armor - basic
@@ -99,15 +100,15 @@ public class TinkerArmor {
GameRegistry.registerItem(TinkerArmor.knapsack, "knapsack");
LiquidCasting basinCasting = TConstruct.getBasinCasting();
TinkerArmor.materialWood = EnumHelper.addArmorMaterial("WOOD", 2, new int[] {1, 2, 2, 1}, 3);
TinkerArmor.helmetWood =
new ArmorBasic(TinkerArmor.materialWood, 0, "wood").setUnlocalizedName("tconstruct.helmetWood");
TinkerArmor.chestplateWood =
new ArmorBasic(TinkerArmor.materialWood, 1, "wood").setUnlocalizedName("tconstruct.chestplateWood");
TinkerArmor.leggingsWood =
new ArmorBasic(TinkerArmor.materialWood, 2, "wood").setUnlocalizedName("tconstruct.leggingsWood");
TinkerArmor.bootsWood =
new ArmorBasic(TinkerArmor.materialWood, 3, "wood").setUnlocalizedName("tconstruct.bootsWood");
TinkerArmor.materialWood = EnumHelper.addArmorMaterial("WOOD", 2, new int[] { 1, 2, 2, 1 }, 3);
TinkerArmor.helmetWood = new ArmorBasic(TinkerArmor.materialWood, 0, "wood")
.setUnlocalizedName("tconstruct.helmetWood");
TinkerArmor.chestplateWood = new ArmorBasic(TinkerArmor.materialWood, 1, "wood")
.setUnlocalizedName("tconstruct.chestplateWood");
TinkerArmor.leggingsWood = new ArmorBasic(TinkerArmor.materialWood, 2, "wood")
.setUnlocalizedName("tconstruct.leggingsWood");
TinkerArmor.bootsWood = new ArmorBasic(TinkerArmor.materialWood, 3, "wood")
.setUnlocalizedName("tconstruct.bootsWood");
GameRegistry.registerItem(TinkerArmor.helmetWood, "helmetWood");
GameRegistry.registerItem(TinkerArmor.chestplateWood, "chestplateWood");
GameRegistry.registerItem(TinkerArmor.leggingsWood, "leggingsWood");
@@ -149,10 +150,10 @@ public class TinkerArmor {
private void craftingTableRecipes() {
// Armor Recipes
Object[] helm = new String[] {"www", "w w"};
Object[] chest = new String[] {"w w", "www", "www"};
Object[] pants = new String[] {"www", "w w", "w w"};
Object[] shoes = new String[] {"w w", "w w"};
Object[] helm = new String[] { "www", "w w" };
Object[] chest = new String[] { "w w", "www", "www" };
Object[] pants = new String[] { "www", "w w", "w w" };
Object[] shoes = new String[] { "w w", "w w" };
GameRegistry.addRecipe(new ShapedOreRecipe(TinkerArmor.helmetWood, helm, 'w', "logWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(TinkerArmor.chestplateWood, chest, 'w', "logWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(TinkerArmor.leggingsWood, pants, 'w', "logWood"));
@@ -166,18 +167,27 @@ public class TinkerArmor {
// GameRegistry.addRecipe(new ShapedOreRecipe(new
// ItemStack(TRepo.heartCanister, 1, 0), "##", "##", '#',
// "ingotNaturalAluminum"));
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(TinkerArmor.heartCanister, 1, 0), " # ", "#B#", " # ", '#', "ingotTin", 'B', Items.bone));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerArmor.heartCanister, 1, 0),
" # ",
"#B#",
" # ",
'#',
"ingotTin",
'B',
Items.bone));
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(TinkerArmor.diamondApple),
" d ",
"d#d",
" d ",
'd',
"gemDiamond",
'#',
new ItemStack(Items.apple)));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerArmor.diamondApple),
" d ",
"d#d",
" d ",
'd',
"gemDiamond",
'#',
new ItemStack(Items.apple)));
GameRegistry.addShapelessRecipe(
new ItemStack(TinkerArmor.heartCanister, 1, 2),
new ItemStack(TinkerArmor.diamondApple),
@@ -185,7 +195,8 @@ public class TinkerArmor {
new ItemStack(TinkerArmor.heartCanister, 1, 0),
new ItemStack(TinkerArmor.heartCanister, 1, 1));
GameRegistry.addShapelessRecipe(
new ItemStack(TinkerArmor.heartCanister, 1, 1), new ItemStack(TinkerArmor.heartCanister, 1, 3));
new ItemStack(TinkerArmor.heartCanister, 1, 1),
new ItemStack(TinkerArmor.heartCanister, 1, 3));
GameRegistry.addShapelessRecipe(
new ItemStack(TinkerArmor.heartCanister, 1, 4),
new ItemStack(TinkerArmor.heartCanister, 1, 2),
@@ -194,17 +205,18 @@ public class TinkerArmor {
// GameRegistry.addShapelessRecipe(new ItemStack(heartCanister, 1, 6), new ItemStack(heartCanister, 1, 0), new
// ItemStack(heartCanister, 1, 4), new ItemStack(heartCanister, 1, 5));
GameRegistry.addRecipe(new ShapedOreRecipe(
new ItemStack(TinkerArmor.knapsack, 1, 0),
"###",
"rmr",
"###",
'#',
new ItemStack(Items.leather),
'r',
new ItemStack(TinkerTools.toughRod, 1, 2),
'm',
"ingotGold"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerArmor.knapsack, 1, 0),
"###",
"rmr",
"###",
'#',
new ItemStack(Items.leather),
'r',
new ItemStack(TinkerTools.toughRod, 1, 2),
'm',
"ingotGold"));
ItemStack aluBrass = new ItemStack(TinkerTools.materials, 1, 14);
GameRegistry.addRecipe(
new ItemStack(TinkerArmor.knapsack, 1, 0),
@@ -218,60 +230,74 @@ public class TinkerArmor {
'm',
aluBrass);
// Drying Rack Recipes
GameRegistry.addRecipe(
new ShapedOreRecipe(new ItemStack(TinkerArmor.dryingRack, 1, 0), "bbb", 'b', "slabWood"));
GameRegistry
.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerArmor.dryingRack, 1, 0), "bbb", 'b', "slabWood"));
// Temporary recipes
ItemStack leather = new ItemStack(Items.leather);
ItemStack glass = new ItemStack(Blocks.glass);
ItemStack string = new ItemStack(Items.string);
GameRegistry.addRecipe(new ShapedOreRecipe(
travelGoggles.getDefaultItem(),
"# #",
"q#q",
"g g",
'#',
leather,
'q',
"blockGlass",
'g',
"ingotGold"));
GameRegistry.addRecipe(new ShapedOreRecipe(
travelWings.getDefaultItem(),
"g g",
"i#i",
"i i",
'#',
Items.ender_pearl,
'g',
"ingotGold",
'i',
"ingotBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(
travelVest.getDefaultItem(),
"#w#",
"#i#",
"#w#",
'#',
leather,
'i',
"ingotAluminum",
'w',
new ItemStack(Blocks.wool, 1, Short.MAX_VALUE)));
GameRegistry.addRecipe(new ShapedOreRecipe(
travelBoots.getDefaultItem(), "#s#", "#i#", "#s#", '#', leather, 's', string, 'i', "ingotAluminum"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
travelGoggles.getDefaultItem(),
"# #",
"q#q",
"g g",
'#',
leather,
'q',
"blockGlass",
'g',
"ingotGold"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
travelWings.getDefaultItem(),
"g g",
"i#i",
"i i",
'#',
Items.ender_pearl,
'g',
"ingotGold",
'i',
"ingotBronze"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
travelVest.getDefaultItem(),
"#w#",
"#i#",
"#w#",
'#',
leather,
'i',
"ingotAluminum",
'w',
new ItemStack(Blocks.wool, 1, Short.MAX_VALUE)));
GameRegistry.addRecipe(
new ShapedOreRecipe(
travelBoots.getDefaultItem(),
"#s#",
"#i#",
"#s#",
'#',
leather,
's',
string,
'i',
"ingotAluminum"));
GameRegistry.addShapedRecipe(travelGlove.getDefaultItem(), " #", "###", " ##", '#', leather);
GameRegistry.addRecipe(new ShapedOreRecipe(
travelBelt.getDefaultItem(),
"###",
"ici",
"###",
'#',
leather,
'c',
"chestWood",
'i',
"ingotAluminum"));
GameRegistry.addRecipe(
new ShapedOreRecipe(
travelBelt.getDefaultItem(),
"###",
"ici",
"###",
'#',
leather,
'c',
"chestWood",
'i',
"ingotAluminum"));
}
protected static void addRecipesForDryingRack() {
@@ -284,9 +310,13 @@ public class TinkerArmor {
DryingRackRecipes.addDryingRecipe(Items.fish, 20 * 60 * 5, new ItemStack(TinkerArmor.jerky, 1, 4));
DryingRackRecipes.addDryingRecipe(Items.rotten_flesh, 20 * 60 * 5, new ItemStack(TinkerArmor.jerky, 1, 5));
DryingRackRecipes.addDryingRecipe(
new ItemStack(TinkerWorld.strangeFood, 1, 0), 20 * 60 * 5, new ItemStack(TinkerArmor.jerky, 1, 6));
new ItemStack(TinkerWorld.strangeFood, 1, 0),
20 * 60 * 5,
new ItemStack(TinkerArmor.jerky, 1, 6));
DryingRackRecipes.addDryingRecipe(
new ItemStack(TinkerWorld.strangeFood, 1, 1), 20 * 60 * 5, new ItemStack(TinkerArmor.jerky, 1, 7));
new ItemStack(TinkerWorld.strangeFood, 1, 1),
20 * 60 * 5,
new ItemStack(TinkerArmor.jerky, 1, 7));
// DryingRackRecipes.addDryingRecipe(new ItemStack(TRepo.jerky, 1, 5),
// 20 * 60 * 10, Item.leather);
@@ -298,130 +328,113 @@ public class TinkerArmor {
// Travel gear modifiers
// MultiType
ModifyBuilder.registerModifier(
new TravelModDoubleJump(EnumSet.of(ArmorPart.Legs, ArmorPart.Feet), new ItemStack[] {
new ItemStack(Items.ghast_tear),
new ItemStack(TinkerWorld.slimeGel, 1, 0),
new ItemStack(Blocks.piston)
}));
new TravelModDoubleJump(
EnumSet.of(ArmorPart.Legs, ArmorPart.Feet),
new ItemStack[] { new ItemStack(Items.ghast_tear), new ItemStack(TinkerWorld.slimeGel, 1, 0),
new ItemStack(Blocks.piston) }));
ModifyBuilder.registerModifier(
new TravelModDoubleJump(EnumSet.of(ArmorPart.Legs, ArmorPart.Feet), new ItemStack[] {
new ItemStack(Items.ghast_tear),
new ItemStack(TinkerWorld.slimeGel, 1, 1),
new ItemStack(Blocks.piston)
}));
ModifyBuilder.registerModifier(new AModInteger(
4,
"Moss",
EnumSet.of(ArmorPart.Legs, ArmorPart.Feet, ArmorPart.Chest, ArmorPart.Head),
new ItemStack[] {new ItemStack(TinkerTools.materials, 1, 6)},
3,
"\u00a72",
StatCollector.translateToLocal("modifier.tool.moss")));
new TravelModDoubleJump(
EnumSet.of(ArmorPart.Legs, ArmorPart.Feet),
new ItemStack[] { new ItemStack(Items.ghast_tear), new ItemStack(TinkerWorld.slimeGel, 1, 1),
new ItemStack(Blocks.piston) }));
ModifyBuilder.registerModifier(
new AModInteger(
4,
"Moss",
EnumSet.of(ArmorPart.Legs, ArmorPart.Feet, ArmorPart.Chest, ArmorPart.Head),
new ItemStack[] { new ItemStack(TinkerTools.materials, 1, 6) },
3,
"\u00a72",
StatCollector.translateToLocal("modifier.tool.moss")));
ModifyBuilder.registerModifier(new TravelModRepair());
TConstructRegistry.registerActiveArmorMod(new ActiveTinkerArmor());
// Head
ModifyBuilder.registerModifier(new AModBoolean(
0,
"Night Vision",
EnumSet.of(ArmorPart.Head),
new ItemStack[] {
new ItemStack(Items.flint_and_steel),
new ItemStack(Items.potionitem, 1, 8198),
new ItemStack(Items.golden_carrot)
},
"\u00a78",
"Night Vision"));
ModifyBuilder.registerModifier(
new AModBoolean(
0,
"Night Vision",
EnumSet.of(ArmorPart.Head),
new ItemStack[] { new ItemStack(Items.flint_and_steel),
new ItemStack(Items.potionitem, 1, 8198), new ItemStack(Items.golden_carrot) },
"\u00a78",
"Night Vision"));
// Chest
ModifyBuilder.registerModifier(new AModInteger(
0,
"Perfect Dodge",
EnumSet.of(ArmorPart.Chest),
new ItemStack[] {
new ItemStack(Items.ender_eye), new ItemStack(Items.ender_pearl), new ItemStack(Items.sugar)
},
1,
"\u00a7d",
"Perfect Dodge"));
ModifyBuilder.registerModifier(new AModBoolean(
1,
"Stealth",
EnumSet.of(ArmorPart.Chest),
new ItemStack[] {
new ItemStack(Items.fermented_spider_eye),
new ItemStack(Items.ender_eye),
new ItemStack(Items.potionitem, 1, 8206),
new ItemStack(Items.golden_carrot)
},
"\u00a78",
"Stealth"));
ModifyBuilder.registerModifier(
new AModInteger(
0,
"Perfect Dodge",
EnumSet.of(ArmorPart.Chest),
new ItemStack[] { new ItemStack(Items.ender_eye), new ItemStack(Items.ender_pearl),
new ItemStack(Items.sugar) },
1,
"\u00a7d",
"Perfect Dodge"));
ModifyBuilder.registerModifier(
new AModBoolean(
1,
"Stealth",
EnumSet.of(ArmorPart.Chest),
new ItemStack[] { new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.ender_eye),
new ItemStack(Items.potionitem, 1, 8206), new ItemStack(Items.golden_carrot) },
"\u00a78",
"Stealth"));
// Wings
ItemStack feather = new ItemStack(Items.feather);
ModifyBuilder.registerModifier(new AModInteger(
1,
"Feather Fall",
EnumSet.of(ArmorPart.Legs),
new ItemStack[] {
new ItemStack(TinkerWorld.slimeGel, 1, 0),
new ItemStack(Items.ender_pearl),
feather,
feather,
feather,
feather,
feather,
feather
},
1,
"\u00a7f",
"Feather Fall"));
ModifyBuilder.registerModifier(new AModInteger(
1,
"Feather Fall",
EnumSet.of(ArmorPart.Legs),
new ItemStack[] {
new ItemStack(TinkerWorld.slimeGel, 1, 1),
new ItemStack(Items.ender_pearl),
feather,
feather,
feather,
feather,
feather,
feather
},
1,
"\u00a7f",
"Feather Fall"));
ModifyBuilder.registerModifier(
new AModInteger(
1,
"Feather Fall",
EnumSet.of(ArmorPart.Legs),
new ItemStack[] { new ItemStack(TinkerWorld.slimeGel, 1, 0), new ItemStack(Items.ender_pearl),
feather, feather, feather, feather, feather, feather },
1,
"\u00a7f",
"Feather Fall"));
ModifyBuilder.registerModifier(
new AModInteger(
1,
"Feather Fall",
EnumSet.of(ArmorPart.Legs),
new ItemStack[] { new ItemStack(TinkerWorld.slimeGel, 1, 1), new ItemStack(Items.ender_pearl),
feather, feather, feather, feather, feather, feather },
1,
"\u00a7f",
"Feather Fall"));
// Feet
ModifyBuilder.registerModifier(new AModBoolean(
1,
"WaterWalk",
EnumSet.of(ArmorPart.Feet),
new ItemStack[] {new ItemStack(Blocks.waterlily), new ItemStack(Blocks.waterlily)},
"\u00a79",
"Water-Walking"));
ModifyBuilder.registerModifier(new AModLeadBoots(new ItemStack[] {new ItemStack(Blocks.iron_block)}));
ModifyBuilder.registerModifier(new AModInteger(
3,
"Slimy Soles",
EnumSet.of(ArmorPart.Feet),
new ItemStack[] {new ItemStack(TinkerWorld.slimePad, 1, 0), new ItemStack(TinkerWorld.slimePad, 1, 0)},
1,
"\u00a7a",
"Slimy Soles"));
ModifyBuilder.registerModifier(
new AModBoolean(
1,
"WaterWalk",
EnumSet.of(ArmorPart.Feet),
new ItemStack[] { new ItemStack(Blocks.waterlily), new ItemStack(Blocks.waterlily) },
"\u00a79",
"Water-Walking"));
ModifyBuilder.registerModifier(new AModLeadBoots(new ItemStack[] { new ItemStack(Blocks.iron_block) }));
ModifyBuilder.registerModifier(
new AModInteger(
3,
"Slimy Soles",
EnumSet.of(ArmorPart.Feet),
new ItemStack[] { new ItemStack(TinkerWorld.slimePad, 1, 0),
new ItemStack(TinkerWorld.slimePad, 1, 0) },
1,
"\u00a7a",
"Slimy Soles"));
// Glove
ModifyBuilder.registerModifier(
new GloveSpeed(1, new ItemStack[] {redstoneItem, redstoneBlock}, new int[] {1, 9}));
new GloveSpeed(1, new ItemStack[] { redstoneItem, redstoneBlock }, new int[] { 1, 9 }));
// ModifyBuilder.registerModifier(new GloveClimb(new ItemStack[] { new ItemStack(Items.slime_ball), new
// ItemStack(Blocks.web), new ItemStack(TinkerTools.materials, 1, 25) }));
modAttackGlove = new ModAttack(
"Quartz",
2,
new ItemStack[] {new ItemStack(Items.quartz), new ItemStack(Blocks.quartz_block, 1, Short.MAX_VALUE)},
new int[] {1, 4},
new ItemStack[] { new ItemStack(Items.quartz), new ItemStack(Blocks.quartz_block, 1, Short.MAX_VALUE) },
new int[] { 1, 4 },
50,
50,
"Accessory");
@@ -1,7 +1,7 @@
package tconstruct.armor;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.Locale;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.IMob;
@@ -12,12 +12,14 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import tconstruct.TConstruct;
import tconstruct.armor.items.TravelWings;
import tconstruct.armor.player.TPlayerStats;
import tconstruct.library.modifier.IModifyable;
import tconstruct.util.config.PHConstruct;
import tconstruct.util.network.ArmourGuiSyncPacket;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class TinkerArmorEvents {
@@ -27,8 +29,7 @@ public class TinkerArmorEvents {
if (!event.entityLiving.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) return;
if (TConstruct.random.nextInt(200) == 0
&& event.entityLiving instanceof IMob
if (TConstruct.random.nextInt(200) == 0 && event.entityLiving instanceof IMob
&& event.source.damageType.equals("player")) {
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 1);
EntityItem entityitem = new EntityItem(
@@ -67,9 +68,8 @@ public class TinkerArmorEvents {
if (event.entityPlayer == null) return;
ItemStack glove = TPlayerStats.get(event.entityPlayer).armor.getStackInSlot(1);
if (event.entityPlayer
.worldObj
.isRemote) { // todo: sync extended inventory with clients so this stuff and rendering is done
if (event.entityPlayer.worldObj.isRemote) { // todo: sync extended inventory with clients so this stuff and
// rendering is done
// properly...
if (ArmorProxyClient.armorExtended != null) glove = ArmorProxyClient.armorExtended.getStackInSlot(1);
else glove = null;
@@ -97,8 +97,8 @@ public class TinkerArmorEvents {
public void slimefall(LivingFallEvent event) {
ItemStack boots = event.entityLiving.getEquipmentInSlot(1);
if (boots != null && boots.getItem() instanceof IModifyable) {
NBTTagCompound tag =
boots.getTagCompound().getCompoundTag(((IModifyable) boots.getItem()).getBaseTagName());
NBTTagCompound tag = boots.getTagCompound()
.getCompoundTag(((IModifyable) boots.getItem()).getBaseTagName());
int sole = tag.getInteger("Slimy Soles");
if (sole > 0) {
event.distance /= (1 + sole);
@@ -1,8 +1,9 @@
package tconstruct.armor.blocks;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.blocks.abstracts.InventoryBlock;
import net.minecraft.block.material.Material;
import net.minecraft.entity.*;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,11 +12,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.world.*;
import tconstruct.TConstruct;
import tconstruct.armor.modelblock.DryingRackRender;
import tconstruct.blocks.logic.DryingRackLogic;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.AbilityHelper;
import cpw.mods.fml.relauncher.*;
public class DryingRack extends InventoryBlock {
@@ -63,8 +66,8 @@ public class DryingRack extends InventoryBlock {
/* Activation */
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float clickX,
float clickY, float clickZ) {
return activateDryingRack(world, x, y, z, player);
}
@@ -175,8 +178,8 @@ public class DryingRack extends InventoryBlock {
}
@Override
public void addCollisionBoxesToList(
World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) {
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list,
Entity entity) {
this.setBlockBoundsBasedOnState(world, x, y, z);
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
}
@@ -189,15 +192,8 @@ public class DryingRack extends InventoryBlock {
@Override
public String[] getTextureNames() {
return new String[] {
"castingtable_top",
"castingtable_side",
"castingtable_bottom",
"faucet",
"blockcast_top",
"blockcast_side",
"blockcast_bottom"
};
return new String[] { "castingtable_top", "castingtable_side", "castingtable_bottom", "faucet", "blockcast_top",
"blockcast_side", "blockcast_bottom" };
}
@Override
@@ -234,48 +230,33 @@ public class DryingRack extends InventoryBlock {
}
/*
* @Override public boolean shouldSideBeRendered (IBlockAccess
* par1IBlockAccess, int par2, int par3, int par4, int par5) { return true;
* }
* @Override public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int
* par5) { return true; }
*/
/*
* @Override public void getSubBlocks (int id, CreativeTabs tab, List list)
* { for (int iter = 0; iter < 3; iter++) { list.add(new ItemStack(id, 1,
* iter)); } }
* @Override public void getSubBlocks (int id, CreativeTabs tab, List list) { for (int iter = 0; iter < 3; iter++) {
* list.add(new ItemStack(id, 1, iter)); } }
*/
/*
* @Override public void setBlockBoundsBasedOnState (IBlockAccess world, int
* x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); if (meta
* != 1) { this.setBlockBounds(0, 0, 0, 1, 1, 1); } else { FaucetLogic logic
* = (FaucetLogic) world.getBlockTileEntity(x, y, z); float xMin = 0.25F;
* float xMax = 0.75F; float zMin = 0.25F; float zMax = 0.75F;
*
* switch (logic.getRenderDirection()) { case 2: zMin = 0.625F; zMax = 1.0F;
* break; case 3: zMax = 0.375F; zMin = 0F; break; case 4: xMin = 0.625F;
* xMax = 1.0F; break; case 5: xMax = 0.375F; xMin = 0F; break; }
*
* this.setBlockBounds(xMin, 0.25F, zMin, xMax, 0.625F, zMax); } }
* @Override public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z) { int meta =
* world.getBlockMetadata(x, y, z); if (meta != 1) { this.setBlockBounds(0, 0, 0, 1, 1, 1); } else { FaucetLogic
* logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); float xMin = 0.25F; float xMax = 0.75F; float zMin =
* 0.25F; float zMax = 0.75F; switch (logic.getRenderDirection()) { case 2: zMin = 0.625F; zMax = 1.0F; break; case
* 3: zMax = 0.375F; zMin = 0F; break; case 4: xMin = 0.625F; xMax = 1.0F; break; case 5: xMax = 0.375F; xMin = 0F;
* break; } this.setBlockBounds(xMin, 0.25F, zMin, xMax, 0.625F, zMax); } }
*/
/*
* @Override public AxisAlignedBB getCollisionBoundingBoxFromPool (World
* world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z);
* if (meta != 1) { return AxisAlignedBB.getBoundingBox(x, y, z, x +
* 1, y + 1, z + 1); } else { FaucetLogic logic = (FaucetLogic)
* world.getBlockTileEntity(x, y, z); if (logic != null) { float xMin =
* 0.25F; float xMax = 0.75F; float zMin = 0.25F; float zMax = 0.75F;
*
* switch (logic.getRenderDirection()) { case 2: zMin = 0.625F; zMax = 1.0F;
* break; case 3: zMax = 0.375F; zMin = 0F; break; case 4: xMin = 0.625F;
* xMax = 1.0F; break; case 5: xMax = 0.375F; xMin = 0F; break; }
*
* return AxisAlignedBB.getBoundingBox((double) ((float) x + xMin),
* (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x +
* xMax), (double) y + 0.625, (double) ((float) z + zMax)); } }
*
* return super.getCollisionBoundingBoxFromPool(world, x, y, z); }
* @Override public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) { int meta =
* world.getBlockMetadata(x, y, z); if (meta != 1) { return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z +
* 1); } else { FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); if (logic != null) { float xMin
* = 0.25F; float xMax = 0.75F; float zMin = 0.25F; float zMax = 0.75F; switch (logic.getRenderDirection()) { case
* 2: zMin = 0.625F; zMax = 1.0F; break; case 3: zMax = 0.375F; zMin = 0F; break; case 4: xMin = 0.625F; xMax =
* 1.0F; break; case 5: xMax = 0.375F; xMin = 0F; break; } return AxisAlignedBB.getBoundingBox((double) ((float) x +
* xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, (double)
* ((float) z + zMax)); } } return super.getCollisionBoundingBoxFromPool(world, x, y, z); }
*/
/* Redstone */
@@ -5,12 +5,15 @@ import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.*;
import tconstruct.armor.inventory.ArmorExtendedContainer;
import tconstruct.armor.player.ArmorExtended;
import tconstruct.client.tabs.*;
public class ArmorExtendedGui extends InventoryEffectRenderer {
public InventoryPlayer inv;
public ArmorExtended stats;
@@ -140,9 +143,7 @@ public class ArmorExtendedGui extends InventoryEffectRenderer {
}
/*
* protected void keyTyped(char par1, int par2) { if (par2 ==
* TControls.armorKey.keyCode) { this.mc.thePlayer.closeScreen(); }
*
* super.keyTyped(par1, par2); }
* protected void keyTyped(char par1, int par2) { if (par2 == TControls.armorKey.keyCode) {
* this.mc.thePlayer.closeScreen(); } super.keyTyped(par1, par2); }
*/
}
@@ -3,12 +3,15 @@ package tconstruct.armor.gui;
import net.minecraft.client.renderer.InventoryEffectRenderer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.*;
import org.lwjgl.opengl.GL11;
import tconstruct.armor.inventory.KnapsackContainer;
import tconstruct.armor.player.KnapsackInventory;
import tconstruct.client.tabs.*;
public class KnapsackGui extends InventoryEffectRenderer {
public InventoryPlayer inv;
public KnapsackInventory stats;
@@ -44,8 +47,8 @@ public class KnapsackGui extends InventoryEffectRenderer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRendererObj.drawString(StatCollector.translateToLocal("inventory.knapsack"), 8, 6, 0x404040);
fontRendererObj.drawString(
StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 4, 0x404040);
fontRendererObj
.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 4, 0x404040);
}
private static final ResourceLocation background = new ResourceLocation("tinker", "textures/gui/knapsack.png");
@@ -60,9 +63,7 @@ public class KnapsackGui extends InventoryEffectRenderer {
}
/*
* protected void keyTyped(char par1, int par2) { if (par2 ==
* TControls.armorKey.keyCode) { this.mc.thePlayer.closeScreen(); }
*
* super.keyTyped(par1, par2); }
* protected void keyTyped(char par1, int par2) { if (par2 == TControls.armorKey.keyCode) {
* this.mc.thePlayer.closeScreen(); } super.keyTyped(par1, par2); }
*/
}
@@ -3,10 +3,12 @@ package tconstruct.armor.inventory;
import net.minecraft.entity.player.*;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import tconstruct.armor.player.ArmorExtended;
import tconstruct.smeltery.inventory.ActiveContainer;
public class ArmorExtendedContainer extends ActiveContainer {
public InventoryPlayer invPlayer;
public ArmorExtended armor;
@@ -24,13 +26,14 @@ public class ArmorExtendedContainer extends ActiveContainer {
this.addSlotToContainer(new SlotAccessory(armor, 5, 152, 35, 10));
this.addSlotToContainer(new SlotAccessory(armor, 6, 152, 17, 10));
for (int playerArmor = 0; playerArmor < 4; ++playerArmor) {
this.addSlotToContainer(new SlotArmorCopy(
this,
inventoryplayer,
inventoryplayer.getSizeInventory() - 1 - playerArmor,
98,
8 + playerArmor * 18,
playerArmor));
this.addSlotToContainer(
new SlotArmorCopy(
this,
inventoryplayer,
inventoryplayer.getSizeInventory() - 1 - playerArmor,
98,
8 + playerArmor * 18,
playerArmor));
}
for (int column = 0; column < 3; column++) {
@@ -3,9 +3,11 @@ package tconstruct.armor.inventory;
import net.minecraft.entity.player.*;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import tconstruct.armor.player.KnapsackInventory;
public class KnapsackContainer extends Container {
public KnapsackInventory backpack;
public int progress = 0;
public int fuel = 0;
@@ -2,9 +2,11 @@ package tconstruct.armor.inventory;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import tconstruct.library.accessory.IAccessory;
public class SlotAccessory extends Slot {
private final int slotID;
private final int slotStackLimit;
@@ -1,20 +1,20 @@
package tconstruct.armor.inventory;
import cpw.mods.fml.relauncher.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.*;
public class SlotArmorCopy extends Slot {
/**
* The armor type that can be placed on that slot, it uses the same values
* of armorType field on ItemArmor.
* The armor type that can be placed on that slot, it uses the same values of armorType field on ItemArmor.
*/
final int armorType;
/**
* The parent class of this clot, ContainerPlayer, SlotArmor is a Anon inner
* class.
* The parent class of this clot, ContainerPlayer, SlotArmor is a Anon inner class.
*/
final Container parent;
@@ -25,8 +25,8 @@ public class SlotArmorCopy extends Slot {
}
/**
* Returns the maximum stack size for a given slot (usually the same as
* getInventoryStackLimit(), but 1 in the case of armor slots)
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
* of armor slots)
*/
@Override
public int getSlotStackLimit() {
@@ -34,8 +34,7 @@ public class SlotArmorCopy extends Slot {
}
/**
* Check if the stack is a valid item for this slot. Always true beside for
* the armor slots.
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
@Override
public boolean isItemValid(ItemStack par1ItemStack) {
@@ -2,6 +2,7 @@ package tconstruct.armor.inventory;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import tconstruct.mechworks.landmine.behavior.Behavior;
public class SlotBehavedOnly extends Slot {
@@ -2,9 +2,11 @@ package tconstruct.armor.inventory;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import tconstruct.library.accessory.IHealthAccessory;
public class SlotCanister extends Slot {
private final int slotID;
public SlotCanister(IInventory par2IInventory, int par3, int par4, int par5) {
@@ -13,8 +15,8 @@ public class SlotCanister extends Slot {
}
/**
* Returns the maximum stack size for a given slot (usually the same as
* getInventoryStackLimit(), but 1 in the case of armor slots)
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
* of armor slots)
*/
@Override
public int getSlotStackLimit() {
@@ -22,8 +24,7 @@ public class SlotCanister extends Slot {
}
/**
* Check if the stack is a valid item for this slot. Always true beside for
* the armor slots.
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
@Override
public boolean isItemValid(ItemStack par1ItemStack) {
@@ -2,16 +2,18 @@ package tconstruct.armor.inventory;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import tconstruct.armor.items.Knapsack;
public class SlotKnapsack extends Slot {
public SlotKnapsack(IInventory par2IInventory, int par3, int par4, int par5) {
super(par2IInventory, par3, par4, par5);
}
/**
* Returns the maximum stack size for a given slot (usually the same as
* getInventoryStackLimit(), but 1 in the case of armor slots)
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
* of armor slots)
*/
@Override
public int getSlotStackLimit() {
@@ -19,8 +21,7 @@ public class SlotKnapsack extends Slot {
}
/**
* Check if the stack is a valid item for this slot. Always true beside for
* the armor slots.
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
@Override
public boolean isItemValid(ItemStack par1ItemStack) {
@@ -10,8 +10,7 @@ public class SlotOnlyTake extends Slot {
}
/**
* Check if the stack is a valid item for this slot. Always true beside for
* the armor slots.
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
@Override
public boolean isItemValid(ItemStack stack) {
@@ -1,6 +1,7 @@
package tconstruct.armor.inventory;
import mantle.blocks.BlockUtils;
import net.minecraft.block.Block;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -4,13 +4,14 @@ import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
public class SlotUnused extends Slot {
public SlotUnused(IInventory par2IInventory, int par3, int par4, int par5) {
super(par2IInventory, par3, par4, par5);
}
/**
* Returns the maximum stack size for a given slot (usually the same as
* getInventoryStackLimit(), but 1 in the case of armor slots)
* Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case
* of armor slots)
*/
@Override
public int getSlotStackLimit() {
@@ -18,8 +19,7 @@ public class SlotUnused extends Slot {
}
/**
* Check if the stack is a valid item for this slot. Always true beside for
* the armor slots.
* Check if the stack is a valid item for this slot. Always true beside for the armor slots.
*/
@Override
public boolean isItemValid(ItemStack par1ItemStack) {
@@ -15,12 +15,12 @@ public class ArmorBasic extends ItemArmor {
@Override
public void registerIcons(IIconRegister par1IconRegister) {
this.itemIcon = par1IconRegister.registerIcon("tinker:armor/" + textureName + "_"
+ (this.armorType == 0
? "helmet"
: this.armorType == 1
? "chestplate"
: this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet"));
this.itemIcon = par1IconRegister.registerIcon(
"tinker:armor/" + textureName
+ "_"
+ (this.armorType == 0 ? "helmet"
: this.armorType == 1 ? "chestplate"
: this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet"));
}
@Override
@@ -1,13 +1,16 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import tconstruct.library.*;
import cpw.mods.fml.relauncher.*;
public class ArmorPattern extends CraftingItem implements ItemBlocklike {
@@ -38,7 +41,7 @@ public class ArmorPattern extends CraftingItem implements ItemBlocklike {
baseIcon = iconRegister.registerIcon("tinker:" + folder + "armor_cast");
}
private static final String[] patternName = new String[] {"helmet", "chestplate", "leggings", "boots"};
private static final String[] patternName = new String[] { "helmet", "chestplate", "leggings", "boots" };
@Override
public void getSubItems(Item block, CreativeTabs tab, List list) {
@@ -1,6 +1,5 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.*;
@@ -8,10 +7,13 @@ import net.minecraft.potion.*;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.*;
public class DiamondApple extends ItemFood {
public IIcon[] icons;
public String[] textureNames = new String[] {"food/apple_diamond"};
public String[] itemNames = new String[] {"apple.diamond"};
public String[] textureNames = new String[] { "food/apple_diamond" };
public String[] itemNames = new String[] { "apple.diamond" };
public DiamondApple() {
super(4, 2.0F, false);
@@ -64,9 +66,7 @@ public class DiamondApple extends ItemFood {
@Override
public String getUnlocalizedName(ItemStack itemstack) {
return "item.food."
+ itemNames[
(itemstack.getItemDamage() >= itemNames.length || itemstack.getItemDamage() < 0)
? (0)
: (itemstack.getItemDamage())];
+ itemNames[(itemstack.getItemDamage() >= itemNames.length || itemstack.getItemDamage() < 0) ? (0)
: (itemstack.getItemDamage())];
}
}
@@ -2,9 +2,11 @@ package tconstruct.armor.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import tconstruct.library.TConstructRegistry;
public class Glove extends Item {
public Glove() {
super();
this.setCreativeTab(TConstructRegistry.materialTab);
@@ -1,31 +1,27 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.*;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import tconstruct.armor.player.*;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.accessory.IHealthAccessory;
import cpw.mods.fml.relauncher.*;
public class HeartCanister extends CraftingItem implements IHealthAccessory {
public HeartCanister() {
super(
new String[] {"empty", "miniheart.red", "red", "miniheart.yellow", "yellow", "miniheart.green", "green"
},
new String[] {
"canister_empty",
"miniheart_red",
"canister_red",
"miniheart_yellow",
"canister_yellow",
"miniheart_green",
"canister_green"
},
new String[] { "empty", "miniheart.red", "red", "miniheart.yellow", "yellow", "miniheart.green",
"green" },
new String[] { "canister_empty", "miniheart_red", "canister_red", "miniheart_yellow", "canister_yellow",
"miniheart_green", "canister_green" },
"",
"tinker",
TConstructRegistry.materialTab);
+11 -16
View File
@@ -1,31 +1,26 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.*;
import net.minecraft.util.*;
import net.minecraft.world.World;
import tconstruct.world.items.SpecialFood;
import cpw.mods.fml.relauncher.*;
public class Jerky extends SpecialFood {
public static String[] textureNames =
new String[] {"beef", "chicken", "pork", "mutton", "fish", "monster", "blueslime", "blood"};
public static String[] itemNames = new String[] {
"jerky.beef",
"jerky.chicken",
"jerky.pig",
"jerky.sheep",
"jerky.fish",
"jerky.zombie",
"jerky.blueslime",
"jerky.blood"
};
public static int[] hunger = new int[] {8, 6, 8, 6, 5, 4, 6, 4};
public static float[] saturation = new float[] {1.0f, 0.8f, 1.0f, 0.8f, 0.8f, 0.4f, 1.0f, 0.4f};
public static int[] overhaulHunger = new int[] {1, 1, 1, 1, 1, 1, 1, 1};
public static String[] textureNames = new String[] { "beef", "chicken", "pork", "mutton", "fish", "monster",
"blueslime", "blood" };
public static String[] itemNames = new String[] { "jerky.beef", "jerky.chicken", "jerky.pig", "jerky.sheep",
"jerky.fish", "jerky.zombie", "jerky.blueslime", "jerky.blood" };
public static int[] hunger = new int[] { 8, 6, 8, 6, 5, 4, 6, 4 };
public static float[] saturation = new float[] { 1.0f, 0.8f, 1.0f, 0.8f, 0.8f, 0.4f, 1.0f, 0.4f };
public static int[] overhaulHunger = new int[] { 1, 1, 1, 1, 1, 1, 1, 1 };
public Jerky(boolean hungerOverhaul) {
super(hungerOverhaul ? overhaulHunger : hunger, saturation, itemNames, textureNames);
@@ -1,18 +1,26 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.accessory.IAccessory;
import cpw.mods.fml.relauncher.*;
public class Knapsack extends CraftingItem implements IAccessory {
public Knapsack() {
super(new String[] {"knapsack"}, new String[] {"knapsack"}, "armor/", "tinker", TConstructRegistry.materialTab);
super(
new String[] { "knapsack" },
new String[] { "knapsack" },
"armor/",
"tinker",
TConstructRegistry.materialTab);
this.setMaxStackSize(10);
}
@@ -31,15 +39,11 @@ public class Knapsack extends CraftingItem implements IAccessory {
// TODO feel fix this so that stuff ticks in backpacks
/*
* @Override public void onArmorTickUpdate (World world, EntityPlayer
* player, ItemStack itemStack) { TPlayerStats stats =
* TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
* KnapsackInventory inv = stats.knapsack;
*
* if (stats != null && inv != null) { for (int i = 0; i <
* inv.getSizeInventory(); i++) { if (inv.getStackInSlot(i) != null) {
* inv.getStackInSlot(i).getItem().onUpdate(inv.getStackInSlot(i),
* player.worldObj, player, i, false); } } } }
* @Override public void onArmorTickUpdate (World world, EntityPlayer player, ItemStack itemStack) { TPlayerStats
* stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName()); KnapsackInventory inv = stats.knapsack;
* if (stats != null && inv != null) { for (int i = 0; i < inv.getSizeInventory(); i++) { if (inv.getStackInSlot(i)
* != null) { inv.getStackInSlot(i).getItem().onUpdate(inv.getStackInSlot(i), player.worldObj, player, i, false); }
* } } }
*/
}
@@ -1,6 +1,5 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -10,11 +9,14 @@ import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.*;
public class TArmorBase extends ItemArmor
// implements ISpecialArmor
{
IIcon[] icons;
String[] iconNames = {"wood_boots"};
String[] iconNames = { "wood_boots" };
// static Minecraft mc = Minecraft.getMinecraft();
// private ModelBiped modelArmor;
@@ -33,21 +35,15 @@ public class TArmorBase extends ItemArmor
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {}
/**
* Called by RenderBiped and RenderPlayer to determine the armor texture
* that should be use for the currently equiped item. This will only be
* called on instances of ItemArmor.
* Called by RenderBiped and RenderPlayer to determine the armor texture that should be use for the currently
* equiped item. This will only be called on instances of ItemArmor.
*
* Returning null from this function will use the default value.
*
* @param stack
* ItemStack for the equpt armor
* @param entity
* The entity wearing the armor
* @param slot
* The slot the armor is in
* @param layer
* The render layer, either 1 or 2, 2 is only used for CLOTH
* armor by default
* @param stack ItemStack for the equpt armor
* @param entity The entity wearing the armor
* @param slot The slot the armor is in
* @param layer The render layer, either 1 or 2, 2 is only used for CLOTH armor by default
* @return Path of texture to bind, or null to use default
*/
@Override
@@ -59,12 +55,9 @@ public class TArmorBase extends ItemArmor
/**
* Override this method to have an item handle its own armor rendering.
*
* @param entityLiving
* The entity wearing the armor
* @param itemStack
* The itemStack to render the model of
* @param armorSlot
* 0=head, 1=torso, 2=legs, 3=feet
* @param entityLiving The entity wearing the armor
* @param itemStack The itemStack to render the model of
* @param armorSlot 0=head, 1=torso, 2=legs, 3=feet
*
* @return A ModelBiped to render instead of the default
*/
@@ -97,17 +90,11 @@ public class TArmorBase extends ItemArmor
}
/*
* @Override public ArmorProperties getProperties (EntityLiving player,
* ItemStack armor, DamageSource source, double damage, int slot) { // TODO
* Auto-generated method stub return null; }
*
* @Override public int getArmorDisplay (EntityPlayer player, ItemStack
* armor, int slot) { // TODO Auto-generated method stub return 0; }
*
* @Override public void damageArmor (EntityLiving entity, ItemStack stack,
* DamageSource source, int damage, int slot) { // TODO Auto-generated
* method stub
*
* }
* @Override public ArmorProperties getProperties (EntityLiving player, ItemStack armor, DamageSource source, double
* damage, int slot) { // TODO Auto-generated method stub return null; }
* @Override public int getArmorDisplay (EntityPlayer player, ItemStack armor, int slot) { // TODO Auto-generated
* method stub return 0; }
* @Override public void damageArmor (EntityLiving entity, ItemStack stack, DamageSource source, int damage, int
* slot) { // TODO Auto-generated method stub }
*/
}
@@ -1,7 +1,7 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.settings.GameSettings;
@@ -10,11 +10,14 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import tconstruct.armor.ArmorProxyClient;
import tconstruct.client.ArmorControls;
import tconstruct.library.accessory.*;
import cpw.mods.fml.relauncher.*;
public class TravelBelt extends AccessoryCore implements IAccessoryModel {
public TravelBelt() {
super("travelgear/travel_belt");
}
@@ -48,7 +51,8 @@ public class TravelBelt extends AccessoryCore implements IAccessoryModel {
if (!stack.hasTagCompound()) return;
list.add("\u00a76" + StatCollector.translateToLocal("armor.travelbelt.ability"));
list.add("\u00a76" + StatCollector.translateToLocal("armor.travelbelt.control")
+ GameSettings.getKeyDisplayString(ArmorControls.beltSwap.getKeyCode()));
list.add(
"\u00a76" + StatCollector.translateToLocal("armor.travelbelt.control")
+ GameSettings.getKeyDisplayString(ArmorControls.beltSwap.getKeyCode()));
}
}
@@ -1,8 +1,7 @@
package tconstruct.armor.items;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.*;
import java.util.List;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.settings.GameSettings;
@@ -13,16 +12,17 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import tconstruct.armor.ArmorProxyClient;
import tconstruct.armor.TinkerArmor;
import tconstruct.library.armor.*;
import thaumcraft.api.IGoggles;
import thaumcraft.api.nodes.IRevealer;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.*;
@Optional.InterfaceList({
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer"),
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles")
})
@Optional.InterfaceList({ @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer"),
@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles") })
public class TravelGear extends ArmorCore implements IRevealer, IGoggles {
public TravelGear(ArmorPart part) {
@@ -100,12 +100,14 @@ public class TravelGear extends ArmorCore implements IRevealer, IGoggles {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("tinker:" + textureFolder + "/" + textureName + "_"
+ (this.armorType == 0
? "goggles"
: this.armorType == 1
? "vest"
: this.armorType == 2 ? "wings" : this.armorType == 3 ? "boots" : "helmet"));
this.itemIcon = iconRegister.registerIcon(
"tinker:" + textureFolder
+ "/"
+ textureName
+ "_"
+ (this.armorType == 0 ? "goggles"
: this.armorType == 1 ? "vest"
: this.armorType == 2 ? "wings" : this.armorType == 3 ? "boots" : "helmet"));
registerModifiers(iconRegister);
}
@@ -121,16 +123,16 @@ public class TravelGear extends ArmorCore implements IRevealer, IGoggles {
@Override
@SideOnly(Side.CLIENT)
protected void registerModifiers(IIconRegister iconRegister) // temporary
{
{
switch (armorType) {
case 0:
modifiers = new IIcon[5];
modifiers[0] =
iconRegister.registerIcon("tinker:" + textureFolder + "/" + "goggles" + "_" + "nightvision");
modifiers[1] =
iconRegister.registerIcon("tinker:" + textureFolder + "/" + "goggles" + "_" + "thaumic1");
modifiers[2] =
iconRegister.registerIcon("tinker:" + textureFolder + "/" + "goggles" + "_" + "thaumic2");
modifiers[0] = iconRegister
.registerIcon("tinker:" + textureFolder + "/" + "goggles" + "_" + "nightvision");
modifiers[1] = iconRegister
.registerIcon("tinker:" + textureFolder + "/" + "goggles" + "_" + "thaumic1");
modifiers[2] = iconRegister
.registerIcon("tinker:" + textureFolder + "/" + "goggles" + "_" + "thaumic2");
modifiers[4] = iconRegister.registerIcon("tinker:" + textureFolder + "/" + "goggles" + "_" + "moss");
break;
case 1:
@@ -141,19 +143,19 @@ public class TravelGear extends ArmorCore implements IRevealer, IGoggles {
break;
case 2:
modifiers = new IIcon[5];
modifiers[0] =
iconRegister.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "doublejump");
modifiers[1] =
iconRegister.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "featherfall");
modifiers[0] = iconRegister
.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "doublejump");
modifiers[1] = iconRegister
.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "featherfall");
modifiers[4] = iconRegister.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "moss");
break;
case 3:
modifiers = new IIcon[5];
modifiers[0] =
iconRegister.registerIcon("tinker:" + textureFolder + "/" + "boots" + "_" + "doublejump");
modifiers[0] = iconRegister
.registerIcon("tinker:" + textureFolder + "/" + "boots" + "_" + "doublejump");
modifiers[1] = iconRegister.registerIcon("tinker:" + textureFolder + "/" + "boots" + "_" + "waterwalk");
modifiers[2] =
iconRegister.registerIcon("tinker:" + textureFolder + "/" + "boots" + "_" + "leadweight");
modifiers[2] = iconRegister
.registerIcon("tinker:" + textureFolder + "/" + "boots" + "_" + "leadweight");
modifiers[3] = iconRegister.registerIcon("tinker:" + textureFolder + "/" + "boots" + "_" + "slimysole");
modifiers[4] = iconRegister.registerIcon("tinker:" + textureFolder + "/" + "boots" + "_" + "moss");
break;
@@ -166,10 +168,14 @@ public class TravelGear extends ArmorCore implements IRevealer, IGoggles {
switch (armorPart) {
case Head:
list.add("\u00a76" + StatCollector.translateToLocal("armor.travelgoggles.ability")
+ GameSettings.getKeyDisplayString(tconstruct.client.ArmorControls.zoomKey.getKeyCode()));
list.add("\u00a76" + StatCollector.translateToLocal("armor.travelgoggles.toggleabilities")
+ GameSettings.getKeyDisplayString(tconstruct.client.ArmorControls.toggleGoggles.getKeyCode()));
list.add(
"\u00a76" + StatCollector.translateToLocal("armor.travelgoggles.ability")
+ GameSettings
.getKeyDisplayString(tconstruct.client.ArmorControls.zoomKey.getKeyCode()));
list.add(
"\u00a76" + StatCollector.translateToLocal("armor.travelgoggles.toggleabilities")
+ GameSettings.getKeyDisplayString(
tconstruct.client.ArmorControls.toggleGoggles.getKeyCode()));
break;
case Chest:
list.add("\u00a76" + StatCollector.translateToLocal("armor.travelvest.ability"));
@@ -1,15 +1,17 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.*;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import tconstruct.armor.ArmorProxyClient;
import tconstruct.library.accessory.*;
import cpw.mods.fml.relauncher.*;
public class TravelGlove extends AccessoryCore implements IAccessoryModel {
public TravelGlove() {
super("travelgear/travel_glove");
}
@@ -44,6 +46,6 @@ public class TravelGlove extends AccessoryCore implements IAccessoryModel {
@Override
public String[] getTraits() {
return new String[] {"accessory", "glove"};
return new String[] { "accessory", "glove" };
}
}
@@ -1,7 +1,5 @@
package tconstruct.armor.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -9,8 +7,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import tconstruct.library.armor.ArmorPart;
import tconstruct.tools.TinkerTools;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TravelWings extends TravelGear {
@@ -26,10 +27,10 @@ public class TravelWings extends TravelGear {
modifiers[0] = IIconRegister.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "doublejump");
modifiers[1] = IIconRegister.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "featherfall");
modifiers[4] = IIconRegister.registerIcon("tinker:" + textureFolder + "/" + "wings" + "_" + "moss");
/*modifiers = new IIcon[3];
modifiers[0] = IIconRegister.registerIcon(base + "slimewings");
modifiers[1] = IIconRegister.registerIcon(base + "piston");
modifiers[2] = IIconRegister.registerIcon(base + "pearl");*/
/*
* modifiers = new IIcon[3]; modifiers[0] = IIconRegister.registerIcon(base + "slimewings"); modifiers[1] =
* IIconRegister.registerIcon(base + "piston"); modifiers[2] = IIconRegister.registerIcon(base + "pearl");
*/
}
@Override
@@ -4,6 +4,7 @@ import net.minecraft.client.model.*;
import net.minecraft.entity.Entity;
public class BeltModel extends ModelBiped {
ModelRenderer Buckle;
ModelRenderer FrontRight;
ModelRenderer FrontLeft;
@@ -57,11 +58,9 @@ public class BeltModel extends ModelBiped {
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
bipedBody.render(f5);
// Buckle.render(f5);
/*FrontRight.render(f5);
FrontLeft.render(f5);
SideRight.render(f5);
SideLeft.render(f5);
Back.render(f5);*/
/*
* FrontRight.render(f5); FrontLeft.render(f5); SideRight.render(f5); SideLeft.render(f5); Back.render(f5);
*/
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
@@ -3,6 +3,7 @@ package tconstruct.armor.model;
import net.minecraft.client.model.*;
public class BootBump extends ModelBiped {
ModelRenderer rightBump;
ModelRenderer leftBump;
@@ -3,6 +3,7 @@ package tconstruct.armor.model;
import net.minecraft.client.model.ModelBiped;
public class HiddenPlayerModel extends ModelBiped {
public HiddenPlayerModel(float size, int slot) {
super(size, 0, 64, 32);
@@ -1,6 +1,7 @@
package tconstruct.armor.model;
import java.util.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.texture.TextureManager;
@@ -8,7 +9,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import tconstruct.armor.items.ArmorPattern;
public class RenderArmorCast implements IItemRenderer {
@@ -36,8 +39,7 @@ public class RenderArmorCast implements IItemRenderer {
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
RenderBlocks renderer = Minecraft.getMinecraft().renderGlobal.renderBlocksRg;
Tessellator tessellator = Tessellator.instance;
IIcon baseIcon = item.getItem() instanceof ArmorPattern
? ((ArmorPattern) item.getItem()).getBaseIcon()
IIcon baseIcon = item.getItem() instanceof ArmorPattern ? ((ArmorPattern) item.getItem()).getBaseIcon()
: item.getIconIndex();
GL11.glPushMatrix();
switch (type) {
@@ -87,8 +89,8 @@ public class RenderArmorCast implements IItemRenderer {
tessellator.draw();
}
public void renderSelectedCube(
Tessellator tessellator, RenderBlocks renderer, IIcon icon, List<ForgeDirection> sidesToRender) {
public void renderSelectedCube(Tessellator tessellator, RenderBlocks renderer, IIcon icon,
List<ForgeDirection> sidesToRender) {
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0F, 0F);
if (sidesToRender.contains(ForgeDirection.WEST)) renderer.renderFaceXNeg(null, 0F, 0F, 0F, icon);
@@ -138,15 +140,8 @@ public class RenderArmorCast implements IItemRenderer {
GL11.glPopMatrix();
}
public static void renderItemIn2D(
Tessellator par0Tessellator,
float par1,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) {
public static void renderItemIn2D(Tessellator par0Tessellator, float par1, float par2, float par3, float par4,
float par5, float par6, float par7) {
par0Tessellator.startDrawingQuads();
par0Tessellator.setNormal(0.0F, 0.0F, 1.0F);
par0Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, par1, par4);
@@ -5,6 +5,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
public class WingModel extends ModelBiped {
ModelRenderer WingBaseRight;
ModelRenderer WingEdgeRight;
ModelRenderer WingInsetRight;
@@ -1,13 +1,16 @@
package tconstruct.armor.modelblock;
import cpw.mods.fml.client.registry.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.*;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import tconstruct.util.ItemHelper;
import cpw.mods.fml.client.registry.*;
public class DryingRackRender implements ISimpleBlockRenderingHandler {
public static int model = RenderingRegistry.getNextAvailableRenderId();
@Override
@@ -19,8 +22,8 @@ public class DryingRackRender implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID,
RenderBlocks renderer) {
if (modelID == model) {
int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 0) {
@@ -1,13 +1,15 @@
package tconstruct.armor.modelblock;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.*;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import tconstruct.blocks.logic.DryingRackLogic;
import tconstruct.tools.entity.FancyEntityItem;
import cpw.mods.fml.relauncher.*;
/* Special renderer, only used for drawing tools */
@@ -1,11 +1,8 @@
package tconstruct.armor.player;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
import java.lang.ref.WeakReference;
import java.util.UUID;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
@@ -15,9 +12,15 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import tconstruct.library.accessory.IHealthAccessory;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
public class ArmorExtended implements IInventory {
public ItemStack[] inventory = new ItemStack[7];
public WeakReference<EntityPlayer> parent;
public UUID globalID = UUID.fromString("B243BE32-DC1B-4C53-8D13-8752D5C69D5B");
@@ -104,8 +107,7 @@ public class ArmorExtended implements IInventory {
recalculateHealth(player, stats);
/*
* if (inventory[2] == null && stats.knapsack != null) {
* stats.knapsack.unequipItems(); }
* if (inventory[2] == null && stats.knapsack != null) { stats.knapsack.unequipItems(); }
*/
}
@@ -125,14 +127,13 @@ public class ArmorExtended implements IInventory {
int healthChange = bonusHP - prevHealth;
if (healthChange != 0) {
IAttributeInstance attributeinstance =
player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth);
IAttributeInstance attributeinstance = player.getAttributeMap()
.getAttributeInstance(SharedMonsterAttributes.maxHealth);
try {
attributeinstance.removeModifier(attributeinstance.getModifier(globalID));
} catch (Exception ignored) {
}
attributeinstance.applyModifier(
new AttributeModifier(globalID, "tconstruct.heartCanister", bonusHP, 0));
} catch (Exception ignored) {}
attributeinstance
.applyModifier(new AttributeModifier(globalID, "tconstruct.heartCanister", bonusHP, 0));
}
} else if (parent != null && parent.get() != null) {
int prevHealth = stats.bonusHealth;
@@ -140,12 +141,11 @@ public class ArmorExtended implements IInventory {
stats.bonusHealth = bonusHP;
int healthChange = bonusHP - prevHealth;
if (healthChange != 0) {
IAttributeInstance attributeinstance =
player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth);
IAttributeInstance attributeinstance = player.getAttributeMap()
.getAttributeInstance(SharedMonsterAttributes.maxHealth);
try {
attributeinstance.removeModifier(attributeinstance.getModifier(globalID));
} catch (Exception ignored) {
}
} catch (Exception ignored) {}
}
}
}
@@ -2,13 +2,10 @@ package tconstruct.armor.player;
public class ArmorExtendedClient extends ArmorExtended {
/*
* public void recalculateSkills(EntityPlayer player, TPlayerStats stats) {
* TConstruct.logger.info("Client skills"); if (inventory[1] != null &&
* inventory[1].getItem() == TContent.glove) { if
* (TProxyClient.skillList.size() < 1) { try {
* TProxyClient.skillList.add(SkillRegistry
* .skills.get("Wall Building").copy()); } catch (Exception e) {
* e.printStackTrace(); } } } else { if (TProxyClient.skillList.size() > 0)
* { TProxyClient.skillList.remove(0); } } }
* public void recalculateSkills(EntityPlayer player, TPlayerStats stats) { TConstruct.logger.info("Client skills");
* if (inventory[1] != null && inventory[1].getItem() == TContent.glove) { if (TProxyClient.skillList.size() < 1) {
* try { TProxyClient.skillList.add(SkillRegistry .skills.get("Wall Building").copy()); } catch (Exception e) {
* e.printStackTrace(); } } } else { if (TProxyClient.skillList.size() > 0) { TProxyClient.skillList.remove(0); } }
* }
*/
}
@@ -1,8 +1,7 @@
package tconstruct.armor.player;
import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import java.lang.ref.WeakReference;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,7 +10,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
public class KnapsackInventory implements IInventory {
public ItemStack[] inventory = new ItemStack[27];
public WeakReference<EntityPlayer> parent;
@@ -1,15 +1,12 @@
package tconstruct.armor.player;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
import cpw.mods.fml.relauncher.Side;
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import mantle.player.PlayerUtils;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.*;
import net.minecraft.entity.Entity.EnumEntitySize;
@@ -20,10 +17,16 @@ import net.minecraft.nbt.*;
import net.minecraftforge.event.entity.EntityEvent;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
import tconstruct.TConstruct;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.tools.TinkerTools;
import tconstruct.util.config.PHConstruct;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
import cpw.mods.fml.relauncher.Side;
// TODO: Redesign this class
public class TPlayerHandler {
@@ -151,8 +154,8 @@ public class TPlayerHandler {
if (PHConstruct.lavaFortuneInteraction) {
PlayerUtils.sendChatMessage(player, "Warning: Cross-mod Exploit Present!");
PlayerUtils.sendChatMessage(player, "Solution 1: Disable Reverse Smelting recipes from GregTech.");
PlayerUtils.sendChatMessage(
player, "Solution 2: Disable Auto-Smelt/Fortune interaction from TConstruct.");
PlayerUtils
.sendChatMessage(player, "Solution 2: Disable Auto-Smelt/Fortune interaction from TConstruct.");
}
}
}
@@ -202,7 +205,7 @@ public class TPlayerHandler {
@SubscribeEvent
public void livingFall(LivingFallEvent evt) // Only for negating fall damage
{
{
if (evt.entityLiving instanceof EntityPlayer) {
evt.distance -= 1;
}
@@ -249,8 +252,8 @@ public class TPlayerHandler {
/* Modify Player */
public void updateSize(String user, float offset) {
/*
* EntityPlayer player = getEntityPlayer(user); setEntitySize(0.6F,
* offset, player); player.yOffset = offset - 0.18f;
* EntityPlayer player = getEntityPlayer(user); setEntitySize(0.6F, offset, player); player.yOffset = offset -
* 0.18f;
*/
}
@@ -1,18 +1,21 @@
package tconstruct.armor.player;
import java.lang.ref.WeakReference;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;
import tconstruct.api.IPlayerExtendedInventoryWrapper;
public class TPlayerStats
implements IExtendedEntityProperties,
IPlayerExtendedInventoryWrapper // TODO: IExtendedEntityProperties is not appropriate!
public class TPlayerStats implements IExtendedEntityProperties, IPlayerExtendedInventoryWrapper // TODO:
// IExtendedEntityProperties
// is not appropriate!
{
public static final String PROP_NAME = "TConstruct";
public WeakReference<EntityPlayer> player;