mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 12:19:48 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
83698cb73c
commit
84c2239244
561 files changed
+8872
-9300
No files matched your search
@@ -1,25 +1,17 @@
|
||||
package tconstruct;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.network.NetworkCheckHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.pulsar.config.ForgeCFG;
|
||||
import mantle.pulsar.control.PulseManager;
|
||||
|
||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import tconstruct.achievements.AchievementEvents;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.api.TConstructAPI;
|
||||
@@ -59,10 +51,21 @@ import tconstruct.weaponry.TinkerWeaponry;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.gen.SlimeIslandGen;
|
||||
import tconstruct.world.village.*;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.network.NetworkCheckHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
/**
|
||||
* TConstruct, the tool mod. Craft your tools with style, then modify until the
|
||||
* original is gone!
|
||||
* TConstruct, the tool mod. Craft your tools with style, then modify until the original is gone!
|
||||
*
|
||||
* @author mDiyo
|
||||
*/
|
||||
@@ -70,23 +73,24 @@ import tconstruct.world.village.*;
|
||||
modid = TConstruct.modID,
|
||||
name = "TConstruct",
|
||||
version = TConstruct.modVersion,
|
||||
dependencies =
|
||||
"required-after:Forge@[10.13.3.1384,11.14);" + "required-after:Mantle@[0.3.2,1.7.10),[1.7.10-0.3.2,);"
|
||||
+ // make sure we still have the 0.3.2 requirement, even without the 1.7.10 prefix
|
||||
"after:MineFactoryReloaded@[1.7.10R2.8.0RC7,);"
|
||||
+ "after:ThermalExpansion@[1.7.10R4.0.0RC2,);"
|
||||
+ "after:ThermalFoundation@[1.7.10R1.0.0RC3,);"
|
||||
+ "after:armourersWorkshop@[1.7.10-0.28.0,);"
|
||||
+ "after:CoFHAPI|energy;"
|
||||
+ "after:CoFHCore;"
|
||||
+ "after:battlegear2;"
|
||||
+ "after:ZeldaItemAPI;"
|
||||
+ "after:DynamicSkillsAPI;"
|
||||
+ "after:NotEnoughItems;"
|
||||
+ "after:Waila;"
|
||||
+ "before:GalacticraftCore;"
|
||||
+ "before:UndergroundBiomes")
|
||||
dependencies = "required-after:Forge@[10.13.3.1384,11.14);"
|
||||
+ "required-after:Mantle@[0.3.2,1.7.10),[1.7.10-0.3.2,);"
|
||||
+ // make sure we still have the 0.3.2 requirement, even without the 1.7.10 prefix
|
||||
"after:MineFactoryReloaded@[1.7.10R2.8.0RC7,);"
|
||||
+ "after:ThermalExpansion@[1.7.10R4.0.0RC2,);"
|
||||
+ "after:ThermalFoundation@[1.7.10R1.0.0RC3,);"
|
||||
+ "after:armourersWorkshop@[1.7.10-0.28.0,);"
|
||||
+ "after:CoFHAPI|energy;"
|
||||
+ "after:CoFHCore;"
|
||||
+ "after:battlegear2;"
|
||||
+ "after:ZeldaItemAPI;"
|
||||
+ "after:DynamicSkillsAPI;"
|
||||
+ "after:NotEnoughItems;"
|
||||
+ "after:Waila;"
|
||||
+ "before:GalacticraftCore;"
|
||||
+ "before:UndergroundBiomes")
|
||||
public class TConstruct {
|
||||
|
||||
public static final String modVersion = "GRADLETOKEN_VERSION";
|
||||
/** The value of one ingot in millibuckets */
|
||||
public static final int ingotLiquidValue = 144;
|
||||
@@ -112,7 +116,8 @@ public class TConstruct {
|
||||
|
||||
/* Loads modules in a way that doesn't clutter the @Mod list */
|
||||
public static PulseManager pulsar = new PulseManager(
|
||||
modID, new ForgeCFG("TinkersModules", "Modules: Disabling these will disable a chunk of the mod"));
|
||||
modID,
|
||||
new ForgeCFG("TinkersModules", "Modules: Disabling these will disable a chunk of the mod"));
|
||||
|
||||
public TConstruct() {
|
||||
if (Loader.isModLoaded("Natura")) {
|
||||
@@ -153,8 +158,9 @@ public class TConstruct {
|
||||
pulsar.registerPulse(new TinkerUBC());
|
||||
pulsar.registerPulse(new TinkerGears());
|
||||
pulsar.registerPulse(new TinkerRfTools());
|
||||
/*pulsar.registerPulse(new TinkerPrayers());
|
||||
pulsar.registerPulse(new TinkerCropify());*/
|
||||
/*
|
||||
* pulsar.registerPulse(new TinkerPrayers()); pulsar.registerPulse(new TinkerCropify());
|
||||
*/
|
||||
|
||||
TConstructRegistry.materialTab = new TConstructCreativeTab("TConstructMaterials");
|
||||
TConstructRegistry.toolTab = new TConstructCreativeTab("TConstructTools");
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package tconstruct.achievements;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
@@ -9,12 +7,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
|
||||
import tconstruct.items.tools.FryingPan;
|
||||
import tconstruct.library.event.ToolCraftedEvent;
|
||||
import tconstruct.library.tools.*;
|
||||
import tconstruct.tools.logic.ToolForgeLogic;
|
||||
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class AchievementEvents {
|
||||
|
||||
@SubscribeEvent
|
||||
public void toolCreate(ToolCraftedEvent event) {
|
||||
if (event.player != null) {
|
||||
@@ -24,8 +27,7 @@ public class AchievementEvents {
|
||||
TAchievements.triggerAchievement(event.player, "tconstruct.preparedFight");
|
||||
}
|
||||
|
||||
if (event.inventory instanceof ToolForgeLogic
|
||||
&& event.tool.getItem() instanceof ToolCore
|
||||
if (event.inventory instanceof ToolForgeLogic && event.tool.getItem() instanceof ToolCore
|
||||
&& ((ToolCore) event.tool.getItem()).durabilityTypeExtra() != 0) {
|
||||
TAchievements.triggerAchievement(event.player, "tconstruct.proTinkerer");
|
||||
}
|
||||
@@ -68,12 +70,14 @@ public class AchievementEvents {
|
||||
|
||||
@SubscribeEvent
|
||||
public void tooltip(ItemTooltipEvent event) {
|
||||
if (event.itemStack == null
|
||||
|| event.itemStack.getItem() == null
|
||||
if (event.itemStack == null || event.itemStack.getItem() == null
|
||||
|| !event.itemStack.hasTagCompound()
|
||||
|| !event.itemStack.getTagCompound().hasKey("frypanKill")) return;
|
||||
|| !event.itemStack.getTagCompound().hasKey("frypanKill"))
|
||||
return;
|
||||
|
||||
event.toolTip.add("" + ChatFormatting.DARK_PURPLE + ChatFormatting.ITALIC
|
||||
+ StatCollector.translateToLocal("frypankill.tooltip"));
|
||||
event.toolTip.add(
|
||||
"" + ChatFormatting.DARK_PURPLE
|
||||
+ ChatFormatting.ITALIC
|
||||
+ StatCollector.translateToLocal("frypankill.tooltip"));
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package tconstruct.achievements;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.AchievementPage;
|
||||
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
@@ -17,7 +19,8 @@ public class TAchievements {
|
||||
|
||||
/**
|
||||
* Adds an achievement and registers it, so there is no need to call .registerStat
|
||||
* @param name The name of the achievement
|
||||
*
|
||||
* @param name The name of the achievement
|
||||
* @param achievement The achievement
|
||||
*/
|
||||
public static void addAchievement(String name, Achievement achievement) {
|
||||
@@ -30,6 +33,7 @@ public class TAchievements {
|
||||
|
||||
/**
|
||||
* Returns a registered achievement
|
||||
*
|
||||
* @param name The name of the achievement
|
||||
* @return The achievement
|
||||
*/
|
||||
@@ -39,8 +43,9 @@ public class TAchievements {
|
||||
|
||||
/**
|
||||
* Grants the achievement
|
||||
*
|
||||
* @param player The player that earned the achievement
|
||||
* @param name The name of the achievement
|
||||
* @param name The name of the achievement
|
||||
*/
|
||||
public static void triggerAchievement(EntityPlayer player, String name) {
|
||||
if (!PHConstruct.achievementsEnabled) {
|
||||
@@ -123,13 +128,12 @@ public class TAchievements {
|
||||
addAchievement(
|
||||
"tconstruct.dualConvenience",
|
||||
new Achievement(
|
||||
"tconstruct.dualConvenience",
|
||||
"tconstruct.dualConvenience",
|
||||
0,
|
||||
7,
|
||||
new ItemStack(TinkerTools.titleIcon, 1, 4100),
|
||||
getAchievement("tconstruct.enemySlayer"))
|
||||
.setSpecial());
|
||||
"tconstruct.dualConvenience",
|
||||
"tconstruct.dualConvenience",
|
||||
0,
|
||||
7,
|
||||
new ItemStack(TinkerTools.titleIcon, 1, 4100),
|
||||
getAchievement("tconstruct.enemySlayer")).setSpecial());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,8 +147,9 @@ public class TAchievements {
|
||||
Achievement[] achievements = new Achievement[achievementsList.size()];
|
||||
|
||||
achievements = achievementsList.values().toArray(achievements);
|
||||
achievementsPage =
|
||||
new AchievementPage(StatCollector.translateToLocal("tconstruct.achievementPage.name"), achievements);
|
||||
achievementsPage = new AchievementPage(
|
||||
StatCollector.translateToLocal("tconstruct.achievementPage.name"),
|
||||
achievements);
|
||||
AchievementPage.registerAchievementPage(achievementsPage);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,19 @@
|
||||
package tconstruct.achievements.items;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.achievements.TAchievements;
|
||||
|
||||
public class CraftAchievementItem extends CraftingItem {
|
||||
|
||||
public String grantedAchievement;
|
||||
|
||||
public CraftAchievementItem(
|
||||
String[] names,
|
||||
String[] tex,
|
||||
String folder,
|
||||
String modTexturePrefix,
|
||||
CreativeTabs tab,
|
||||
public CraftAchievementItem(String[] names, String[] tex, String folder, String modTexturePrefix, CreativeTabs tab,
|
||||
String tachievement) {
|
||||
super(names, tex, folder, modTexturePrefix, tab);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public interface IPlayerExtendedInventoryWrapper {
|
||||
|
||||
IInventory getKnapsackInventory(EntityPlayer player);
|
||||
|
||||
IInventory getAccessoryInventory(EntityPlayer player);
|
||||
|
||||
@@ -3,6 +3,7 @@ package tconstruct.api;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class TConstructAPI {
|
||||
|
||||
public static String PROP_NAME;
|
||||
|
||||
public static IPlayerExtendedInventoryWrapper getInventoryWrapper(EntityPlayer player) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package tconstruct.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -9,6 +10,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockFalling extends Block {
|
||||
|
||||
public static boolean fallInstantly;
|
||||
|
||||
public BlockFalling() {
|
||||
@@ -26,8 +28,8 @@ public class BlockFalling extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(
|
||||
World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) {
|
||||
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_,
|
||||
Block p_149695_5_) {
|
||||
p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.tickRate(p_149695_1_));
|
||||
}
|
||||
|
||||
@@ -42,14 +44,13 @@ public class BlockFalling extends Block {
|
||||
if (func_149831_e(p_149830_1_, p_149830_2_, p_149830_3_ - 1, p_149830_4_) && p_149830_3_ >= 0) {
|
||||
byte b0 = 32;
|
||||
|
||||
if (!fallInstantly
|
||||
&& p_149830_1_.checkChunksExist(
|
||||
p_149830_2_ - b0,
|
||||
p_149830_3_ - b0,
|
||||
p_149830_4_ - b0,
|
||||
p_149830_2_ + b0,
|
||||
p_149830_3_ + b0,
|
||||
p_149830_4_ + b0)) {
|
||||
if (!fallInstantly && p_149830_1_.checkChunksExist(
|
||||
p_149830_2_ - b0,
|
||||
p_149830_3_ - b0,
|
||||
p_149830_4_ - b0,
|
||||
p_149830_2_ + b0,
|
||||
p_149830_3_ + b0,
|
||||
p_149830_4_ + b0)) {
|
||||
// if (!p_149830_1_.isRemote) {
|
||||
// EntityFallingBlock entityfallingblock = new
|
||||
// EntityFallingBlock(p_149830_1_,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package tconstruct.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.MantleBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -11,9 +12,12 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class SlabBase extends MantleBlock {
|
||||
|
||||
Block modelBlock;
|
||||
int startingMeta;
|
||||
int totalSize;
|
||||
@@ -32,8 +36,8 @@ public class SlabBase extends MantleBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(
|
||||
World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List arraylist, Entity entity) {
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List arraylist,
|
||||
Entity entity) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, arraylist, entity);
|
||||
}
|
||||
@@ -49,16 +53,8 @@ public class SlabBase extends MantleBlock {
|
||||
setBlockBounds(0.0F, minY, 0F, 1.0F, maxY, 1.0F);
|
||||
}
|
||||
|
||||
public int onBlockPlaced(
|
||||
World par1World,
|
||||
int blockX,
|
||||
int blockY,
|
||||
int blockZ,
|
||||
int side,
|
||||
float clickX,
|
||||
float clickY,
|
||||
float clickZ,
|
||||
int metadata) {
|
||||
public int onBlockPlaced(World par1World, int blockX, int blockY, int blockZ, int side, float clickX, float clickY,
|
||||
float clickZ, int metadata) {
|
||||
if (side == 1) return metadata;
|
||||
if (side == 0 || clickY >= 0.5F) return metadata | 8;
|
||||
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
package tconstruct.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.MantleBlock;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class TConstructBlock extends MantleBlock {
|
||||
|
||||
public String[] textureNames;
|
||||
public IIcon[] icons;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.logic;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -10,9 +10,12 @@ import net.minecraft.network.*;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class DryingRackLogic extends InventoryLogic {
|
||||
|
||||
int currentTime;
|
||||
int maxTime;
|
||||
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package tconstruct.blocks.slime;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.entity.BlueSlime;
|
||||
import tconstruct.world.entity.KingBlueSlime;
|
||||
import tconstruct.world.entity.SlimeBase;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class SlimeFluid extends BlockFluidClassic {
|
||||
|
||||
IIcon stillIcon;
|
||||
IIcon flowIcon;
|
||||
|
||||
@@ -40,8 +43,7 @@ public class SlimeFluid extends BlockFluidClassic {
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
if (rand.nextInt(100) == 0
|
||||
&& world.getBlockMetadata(x, y, z) == 0
|
||||
if (rand.nextInt(100) == 0 && world.getBlockMetadata(x, y, z) == 0
|
||||
&& world.checkNoEntityCollision(
|
||||
AxisAlignedBB.getBoundingBox(x - 1, y - 1, z - 1, x + 2, y + 2, z + 2))) {
|
||||
SlimeBase slime;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.slime;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -10,12 +10,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.*;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.blocks.TConstructBlock;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class SlimeGel extends TConstructBlock {
|
||||
|
||||
public SlimeGel() {
|
||||
super(Material.sponge, 0.5f, new String[] {"slimeblock_blue", "slimeblock_green", "slimeblock_purple"});
|
||||
super(Material.sponge, 0.5f, new String[] { "slimeblock_blue", "slimeblock_green", "slimeblock_purple" });
|
||||
setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package tconstruct.blocks.slime;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.*;
|
||||
|
||||
import mantle.blocks.MantleBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -13,14 +14,16 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.*;
|
||||
import net.minecraftforge.common.*;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class SlimeGrass extends MantleBlock {
|
||||
public String[] textureNames = {
|
||||
"slimegrass_green_top", "slimedirt_blue", "slimegrass_green_blue_side", "slimegrass_green_dirt_side"
|
||||
}; // green,
|
||||
// purple
|
||||
|
||||
public String[] textureNames = { "slimegrass_green_top", "slimedirt_blue", "slimegrass_green_blue_side",
|
||||
"slimegrass_green_dirt_side" }; // green,
|
||||
// purple
|
||||
public IIcon[] icons;
|
||||
|
||||
public SlimeGrass() {
|
||||
@@ -33,7 +36,7 @@ public class SlimeGrass extends MantleBlock {
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
if (meta == 1) // dirt
|
||||
return 0;
|
||||
return 0;
|
||||
else
|
||||
// slime dirt
|
||||
return 5;
|
||||
@@ -71,8 +74,8 @@ public class SlimeGrass extends MantleBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainPlant(
|
||||
IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plant) {
|
||||
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction,
|
||||
IPlantable plant) {
|
||||
EnumPlantType plantType = plant.getPlantType(world, x, y + 1, z);
|
||||
return plantType == EnumPlantType.Plains && plant.getPlant(world, x, y + 1, z) != Blocks.tallgrass;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.slime;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -9,12 +9,15 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class SlimeLeaves extends BlockLeaves {
|
||||
private static final String[] fastLeaves = new String[] {"slimeleaves_blue_fast"};
|
||||
private static final String[] fancyLeaves = new String[] {"slimeleaves_blue_fancy"};
|
||||
|
||||
private static final String[] fastLeaves = new String[] { "slimeleaves_blue_fast" };
|
||||
private static final String[] fancyLeaves = new String[] { "slimeleaves_blue_fancy" };
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] fastIcons;
|
||||
@@ -98,10 +101,9 @@ public class SlimeLeaves extends BlockLeaves {
|
||||
if (!world.isRemote) {
|
||||
int dropChance = 35;
|
||||
|
||||
/*if ((meta & 3) == 3)
|
||||
{
|
||||
j1 = 40;
|
||||
}*/
|
||||
/*
|
||||
* if ((meta & 3) == 3) { j1 = 40; }
|
||||
*/
|
||||
|
||||
if (fortune > 0) {
|
||||
dropChance -= 2 << fortune;
|
||||
@@ -134,6 +136,6 @@ public class SlimeLeaves extends BlockLeaves {
|
||||
|
||||
@Override
|
||||
public String[] func_150125_e() {
|
||||
return new String[] {"slime"};
|
||||
return new String[] { "slime" };
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.slime;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -11,14 +11,17 @@ import net.minecraft.item.*;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.gen.SlimeTreeGen;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class SlimeSapling extends BlockSapling {
|
||||
|
||||
public IIcon[] icons;
|
||||
public String[] textureNames = new String[] {"blue"};
|
||||
public String[] textureNames = new String[] { "blue" };
|
||||
|
||||
public SlimeSapling() {
|
||||
super();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.slime;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -11,10 +11,13 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.*;
|
||||
import net.minecraftforge.common.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class SlimeTallGrass extends BlockBush implements IShearable {
|
||||
private static final String[] grassTypes = new String[] {"slimegrass_blue_tall"};
|
||||
|
||||
private static final String[] grassTypes = new String[] { "slimegrass_blue_tall" };
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] iconArray;
|
||||
@@ -44,8 +47,7 @@ public class SlimeTallGrass extends BlockBush implements IShearable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the usual quantity dropped by the block plus a bonus of 1 to 'i'
|
||||
* (inclusive).
|
||||
* Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).
|
||||
*/
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int par1, Random par2Random) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.blocks.traps;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import mantle.blocks.MantleBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -10,10 +10,13 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.world.model.BarricadeRender;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class BarricadeBlock extends MantleBlock {
|
||||
|
||||
Block modelBlock;
|
||||
int modelMeta;
|
||||
|
||||
@@ -68,8 +71,8 @@ public class BarricadeBlock extends MantleBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
|
||||
float par8, float par9) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if ((stack != null) && (stack.getItem() == Item.getItemFromBlock(this)) && (!player.isSneaking())) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package tconstruct.blocks.traps;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.blocks.MantleBlock;
|
||||
import mantle.world.WorldHelper;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -18,9 +18,13 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Landmine extends MantleBlock {
|
||||
|
||||
/** The mob type that can trigger this pressure plate. */
|
||||
private final EnumCreatureType triggerMobType;
|
||||
|
||||
@@ -60,8 +64,8 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this
|
||||
* box can change after the pool has been cleared to be reused)
|
||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
||||
* cleared to be reused)
|
||||
*/
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
@@ -69,9 +73,8 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether
|
||||
* or not to render the shared face of two adjacent blocks and also whether
|
||||
* the player can attach torches, redstone wire, etc to this block.
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
@@ -79,8 +82,7 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False
|
||||
* (examples: signs, buttons, stairs, etc)
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
@@ -93,8 +95,7 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if its valid to put this block at the specified
|
||||
* coordinates. Args: world, x, y, z
|
||||
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
||||
*/
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||
@@ -103,9 +104,8 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which
|
||||
* neighbor changed (coordinates passed are their own) Args: x, y, z,
|
||||
* neighbor blockID
|
||||
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
||||
* their own) Args: x, y, z, neighbor blockID
|
||||
*/
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
|
||||
boolean var6 = !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4)
|
||||
@@ -130,8 +130,7 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered whenever an entity collides with this block (enters into the
|
||||
* block). Args: world, x, y, z, entity
|
||||
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
|
||||
*/
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
||||
@@ -143,8 +142,7 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there are mobs on the plate. If a mob is on the plate and it is
|
||||
* off, it turns it on, and vice versa.
|
||||
* Checks if there are mobs on the plate. If a mob is on the plate and it is off, it turns it on, and vice versa.
|
||||
*/
|
||||
private void setStateIfMobInteractsWithPlate(World world, int posX, int posY, int posZ) {
|
||||
boolean var5 = world.getBlockMetadata(posX, posY, posZ) == 1;
|
||||
@@ -177,11 +175,9 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/*
|
||||
* if (this.triggerMobType == EnumCreatureType.players) { var8 =
|
||||
* world.getEntitiesWithinAABB( EntityPlayer.class,
|
||||
* AxisAlignedBB.getBoundingBox((double) ((float) posX + var7),
|
||||
* (double) posY, (double) ((float) posZ + var7), (double) ((float)
|
||||
* (posX + 1) - var7), (double) posY + 0.25D, (double) ((float) (posZ +
|
||||
* if (this.triggerMobType == EnumCreatureType.players) { var8 = world.getEntitiesWithinAABB(
|
||||
* EntityPlayer.class, AxisAlignedBB.getBoundingBox((double) ((float) posX + var7), (double) posY, (double)
|
||||
* ((float) posZ + var7), (double) ((float) (posX + 1) - var7), (double) posY + 0.25D, (double) ((float) (posZ +
|
||||
* 1) - var7))); }
|
||||
*/
|
||||
|
||||
@@ -198,34 +194,25 @@ public class Landmine extends MantleBlock {
|
||||
WorldHelper.setBlockToAir(world, posX, posY, posZ);
|
||||
world.createExplosion(null, posX, posY, posZ, 2.0F, true);
|
||||
/*
|
||||
* par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1);
|
||||
* par1World.notifyBlocksOfNeighborChange(posX, posY, posZ,
|
||||
* this.blockID); par1World.notifyBlocksOfNeighborChange(posX, posY
|
||||
* - 1, posZ, this.blockID);
|
||||
* par1World.func_147479_m(posX, posY, posZ, posX,
|
||||
* posY, posZ); par1World.playSoundEffect((double)posX + 0.5D,
|
||||
* (double)posY + 0.1D, (double)posZ + 0.5D, "random.click", 0.3F,
|
||||
* 0.6F);
|
||||
* par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1); par1World.notifyBlocksOfNeighborChange(posX,
|
||||
* posY, posZ, this.blockID); par1World.notifyBlocksOfNeighborChange(posX, posY - 1, posZ, this.blockID);
|
||||
* par1World.func_147479_m(posX, posY, posZ, posX, posY, posZ); par1World.playSoundEffect((double)posX +
|
||||
* 0.5D, (double)posY + 0.1D, (double)posZ + 0.5D, "random.click", 0.3F, 0.6F);
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
* if (!var6 && var5) { par1World.setBlockMetadataWithNotify(posX, posY,
|
||||
* posZ, 0); par1World.notifyBlocksOfNeighborChange(posX, posY, posZ,
|
||||
* this.blockID); par1World.notifyBlocksOfNeighborChange(posX, posY - 1,
|
||||
* posZ, this.blockID); par1World.func_147479_m(posX,
|
||||
* posY, posZ, posX, posY, posZ); par1World.playSoundEffect((double)posX
|
||||
* + 0.5D, (double)posY + 0.1D, (double)posZ + 0.5D, "random.click",
|
||||
* 0.3F, 0.5F); }
|
||||
*
|
||||
* if (var6) { par1World.scheduleBlockUpdate(posX, posY, posZ,
|
||||
* this.blockID, this.tickRate()); }
|
||||
* if (!var6 && var5) { par1World.setBlockMetadataWithNotify(posX, posY, posZ, 0);
|
||||
* par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID);
|
||||
* par1World.notifyBlocksOfNeighborChange(posX, posY - 1, posZ, this.blockID); par1World.func_147479_m(posX,
|
||||
* posY, posZ, posX, posY, posZ); par1World.playSoundEffect((double)posX + 0.5D, (double)posY + 0.1D,
|
||||
* (double)posZ + 0.5D, "random.click", 0.3F, 0.5F); } if (var6) { par1World.scheduleBlockUpdate(posX, posY,
|
||||
* posZ, this.blockID, this.tickRate()); }
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* ejects contained items into the world, and notifies neighbours of an
|
||||
* update, as appropriate
|
||||
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
|
||||
*/
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
@@ -238,8 +225,7 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the blocks bounds based on its current state. Args: world, x, y,
|
||||
* z
|
||||
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
||||
*/
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
|
||||
@@ -265,8 +251,8 @@ public class Landmine extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the mobility information of the block, 0 = free, 1 = can't push
|
||||
* but can move over, 2 = total immobility and stop pistons
|
||||
* Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
|
||||
* and stop pistons
|
||||
*/
|
||||
@Override
|
||||
public int getMobilityFlag() {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package tconstruct.blocks.traps;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.blocks.MantleBlock;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -12,9 +13,11 @@ import net.minecraft.item.*;
|
||||
import net.minecraft.potion.*;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.model.PunjiRender;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class Punji extends MantleBlock {
|
||||
|
||||
@@ -38,8 +41,8 @@ public class Punji extends MantleBlock {
|
||||
|
||||
/* Right-click adds sticks */
|
||||
@Override
|
||||
public boolean onBlockActivated(
|
||||
World world, int x, int y, int z, EntityPlayer player, int par6, float hitX, float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
/*
|
||||
* if (world.isRemote) return false;
|
||||
*/
|
||||
@@ -72,9 +75,8 @@ public class Punji extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether
|
||||
* or not to render the shared face of two adjacent blocks and also whether
|
||||
* the player can attach torches, redstone wire, etc to this block.
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
@@ -82,8 +84,7 @@ public class Punji extends MantleBlock {
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False
|
||||
* (examples: signs, buttons, stairs, etc)
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
|
||||
@@ -3,14 +3,16 @@ package tconstruct.client;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.library.weaponry.IAmmo;
|
||||
|
||||
public class AmmoItemRenderer extends FlexibleToolRenderer {
|
||||
// public static FontRenderer fontRenderer;
|
||||
|
||||
public AmmoItemRenderer() {
|
||||
// super(true);
|
||||
// super(true);
|
||||
// fontRenderer = new FontRenderer(Minecraft.getMinecraft().gameSettings, new
|
||||
// ResourceLocation(Reference.RESOURCE, "textures/font/border_numbers.png"),
|
||||
// Minecraft.getMinecraft().renderEngine, false);
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import mantle.common.network.AbstractPacket;
|
||||
import modwarriors.notenoughkeys.api.Api;
|
||||
import modwarriors.notenoughkeys.api.KeyBindingPressedEvent;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyClient;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
@@ -23,11 +21,16 @@ import tconstruct.util.network.AccessoryInventoryPacket;
|
||||
import tconstruct.util.network.BeltPacket;
|
||||
import tconstruct.util.network.DoubleJumpPacket;
|
||||
import tconstruct.util.network.GogglePacket;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
|
||||
public class ArmorControls {
|
||||
|
||||
public static final String keybindCategory = "tconstruct.keybindings";
|
||||
public static final String[] keyDescs = new String[] {"key.tarmor", "key.tgoggles", "key.tbelt", "key.tzoom"};
|
||||
public static final String[] keyDescs = new String[] { "key.tarmor", "key.tgoggles", "key.tbelt", "key.tzoom" };
|
||||
public static KeyBinding armorKey = new KeyBinding(keyDescs[0], Keyboard.KEY_NONE, keybindCategory);
|
||||
public static KeyBinding toggleGoggles = new KeyBinding(keyDescs[1], Keyboard.KEY_NONE, keybindCategory);
|
||||
public static KeyBinding beltSwap = new KeyBinding(keyDescs[2], Keyboard.KEY_NONE, keybindCategory);
|
||||
@@ -51,7 +54,7 @@ public class ArmorControls {
|
||||
|
||||
public ArmorControls() {
|
||||
getVanillaKeyBindings();
|
||||
keys = new KeyBinding[] {armorKey, toggleGoggles, beltSwap, zoomKey, null, null};
|
||||
keys = new KeyBinding[] { armorKey, toggleGoggles, beltSwap, zoomKey, null, null };
|
||||
}
|
||||
|
||||
public void registerKeys() {
|
||||
@@ -122,8 +125,8 @@ public class ArmorControls {
|
||||
mc.thePlayer.motionY = 0.42D;
|
||||
mc.thePlayer.fallDistance = 0;
|
||||
if (mc.thePlayer.isPotionActive(Potion.jump)) {
|
||||
mc.thePlayer.motionY +=
|
||||
(float) (mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
|
||||
mc.thePlayer.motionY += (float) (mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1)
|
||||
* 0.1F;
|
||||
}
|
||||
midairJumps--;
|
||||
resetFallDamage();
|
||||
@@ -131,16 +134,12 @@ public class ArmorControls {
|
||||
if (!jumping) {
|
||||
jumping = mc.thePlayer.isAirBorne;
|
||||
ItemStack shoes = mc.thePlayer.getCurrentArmor(0);
|
||||
if (shoes != null
|
||||
&& shoes.hasTagCompound()
|
||||
&& shoes.getTagCompound().hasKey("TinkerArmor")) {
|
||||
if (shoes != null && shoes.hasTagCompound() && shoes.getTagCompound().hasKey("TinkerArmor")) {
|
||||
NBTTagCompound shoeTag = shoes.getTagCompound().getCompoundTag("TinkerArmor");
|
||||
midairJumps += shoeTag.getInteger("Double-Jump");
|
||||
}
|
||||
ItemStack wings = mc.thePlayer.getCurrentArmor(1);
|
||||
if (wings != null
|
||||
&& wings.hasTagCompound()
|
||||
&& wings.getTagCompound().hasKey("TinkerArmor")) {
|
||||
if (wings != null && wings.hasTagCompound() && wings.getTagCompound().hasKey("TinkerArmor")) {
|
||||
NBTTagCompound shoeTag = wings.getTagCompound().getCompoundTag("TinkerArmor");
|
||||
midairJumps += shoeTag.getInteger("Double-Jump");
|
||||
}
|
||||
@@ -150,10 +149,8 @@ public class ArmorControls {
|
||||
private void checkAndToggleNightVision() {
|
||||
ItemStack goggles = mc.thePlayer.getCurrentArmor(3);
|
||||
if (goggles != null && goggles.getItem() instanceof TravelGear) { // TODO: Genericize this
|
||||
if (goggles.hasTagCompound()
|
||||
&& goggles.getTagCompound()
|
||||
.getCompoundTag(((TravelGear) goggles.getItem()).getBaseTagName())
|
||||
.getBoolean("Night Vision")) {
|
||||
if (goggles.hasTagCompound() && goggles.getTagCompound()
|
||||
.getCompoundTag(((TravelGear) goggles.getItem()).getBaseTagName()).getBoolean("Night Vision")) {
|
||||
activeGoggles = !activeGoggles;
|
||||
PlayerAbilityHelper.toggleGoggles(mc.thePlayer, activeGoggles);
|
||||
toggleGoggles();
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,14 +1,16 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class BreakingFX extends EntityFX {
|
||||
|
||||
public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item) {
|
||||
this(par1World, par2, par4, par6, par8Item, 0);
|
||||
}
|
||||
@@ -21,16 +23,8 @@ public class BreakingFX extends EntityFX {
|
||||
this.particleScale /= 2.0F;
|
||||
}
|
||||
|
||||
public BreakingFX(
|
||||
World par1World,
|
||||
double par2,
|
||||
double par4,
|
||||
double par6,
|
||||
double par8,
|
||||
double par10,
|
||||
double par12,
|
||||
Item par14Item,
|
||||
int par15) {
|
||||
public BreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12,
|
||||
Item par14Item, int par15) {
|
||||
this(par1World, par2, par4, par6, par14Item, par15);
|
||||
this.motionX *= 0.10000000149011612D;
|
||||
this.motionY *= 0.10000000149011612D;
|
||||
@@ -46,8 +40,8 @@ public class BreakingFX extends EntityFX {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(
|
||||
Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6,
|
||||
float par7) {
|
||||
float f6 = ((float) this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F;
|
||||
float f7 = f6 + 0.015609375F;
|
||||
float f8 = ((float) this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F;
|
||||
@@ -67,12 +61,28 @@ public class BreakingFX extends EntityFX {
|
||||
float f14 = 1.0F;
|
||||
par1Tessellator.setColorOpaque_F(f14 * this.particleRed, f14 * this.particleGreen, f14 * this.particleBlue);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f6, f9);
|
||||
f11 - par3 * f10 - par6 * f10,
|
||||
f12 - par4 * f10,
|
||||
f13 - par5 * f10 - par7 * f10,
|
||||
f6,
|
||||
f9);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f6, f8);
|
||||
f11 - par3 * f10 + par6 * f10,
|
||||
f12 + par4 * f10,
|
||||
f13 - par5 * f10 + par7 * f10,
|
||||
f6,
|
||||
f8);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f7, f8);
|
||||
f11 + par3 * f10 + par6 * f10,
|
||||
f12 + par4 * f10,
|
||||
f13 + par5 * f10 + par7 * f10,
|
||||
f7,
|
||||
f8);
|
||||
par1Tessellator.addVertexWithUV(
|
||||
f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f7, f9);
|
||||
f11 + par3 * f10 - par6 * f10,
|
||||
f12 - par4 * f10,
|
||||
f13 + par5 * f10 - par7 * f10,
|
||||
f7,
|
||||
f9);
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
public class CustomBowRenderer implements IItemRenderer {
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
private final RenderBlocks renderBlocksInstance = new RenderBlocks();
|
||||
|
||||
@@ -39,9 +41,8 @@ public class CustomBowRenderer implements IItemRenderer {
|
||||
IIcon icon;
|
||||
if (living instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) living;
|
||||
if (player.getItemInUse() != null)
|
||||
icon = stack.getItem()
|
||||
.getIcon(stack, renderPass, player, player.getItemInUse(), player.getItemInUseCount());
|
||||
if (player.getItemInUse() != null) icon = stack.getItem()
|
||||
.getIcon(stack, renderPass, player, player.getItemInUse(), player.getItemInUseCount());
|
||||
else icon = living.getItemIcon(stack, renderPass);
|
||||
} else {
|
||||
icon = living.getItemIcon(stack, renderPass);
|
||||
|
||||
@@ -4,19 +4,21 @@ import java.awt.*;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheObliterator
|
||||
*
|
||||
* A class to create and draw true type fonts onto the Minecraft game
|
||||
* engine.
|
||||
* A class to create and draw true type fonts onto the Minecraft game engine.
|
||||
*/
|
||||
public class CustomFont {
|
||||
|
||||
private int texID;
|
||||
private final int[] xPos;
|
||||
private final int[] yPos;
|
||||
@@ -25,39 +27,29 @@ public class CustomFont {
|
||||
private final FontMetrics metrics;
|
||||
|
||||
/**
|
||||
* Instantiates the font, filling in default start and end character
|
||||
* parameters.
|
||||
* Instantiates the font, filling in default start and end character parameters.
|
||||
*
|
||||
* 'new CustomFont(ModLoader.getMinecraftInstance(), "Arial", 12);
|
||||
*
|
||||
* @param mc
|
||||
* The Minecraft instance for the font to be bound to.
|
||||
* @param fontName
|
||||
* The name of the font to be drawn.
|
||||
* @param size
|
||||
* The size of the font to be drawn.
|
||||
* @param mc The Minecraft instance for the font to be bound to.
|
||||
* @param fontName The name of the font to be drawn.
|
||||
* @param size The size of the font to be drawn.
|
||||
*/
|
||||
public CustomFont(Minecraft mc, Object font, int size) {
|
||||
this(mc, font, size, 0, 4000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates the font, pre-rendering a sprite font image by using a true
|
||||
* type font on a bitmap. Then allocating that bitmap to the Minecraft
|
||||
* rendering engine for later use.
|
||||
* Instantiates the font, pre-rendering a sprite font image by using a true type font on a bitmap. Then allocating
|
||||
* that bitmap to the Minecraft rendering engine for later use.
|
||||
*
|
||||
* 'new CustomFont(ModLoader.getMinecraftInstance(), "Arial", 12, 32, 126);'
|
||||
*
|
||||
* @param mc
|
||||
* The Minecraft instance for the font to be bound to.
|
||||
* @param fontName
|
||||
* The name of the font to be drawn.
|
||||
* @param size
|
||||
* The size of the font to be drawn.
|
||||
* @param startChar
|
||||
* The starting ASCII character id to be drawable. (Default 32)
|
||||
* @param endChar
|
||||
* The ending ASCII character id to be drawable. (Default 126)
|
||||
* @param mc The Minecraft instance for the font to be bound to.
|
||||
* @param fontName The name of the font to be drawn.
|
||||
* @param size The size of the font to be drawn.
|
||||
* @param startChar The starting ASCII character id to be drawable. (Default 32)
|
||||
* @param endChar The ending ASCII character id to be drawable. (Default 126)
|
||||
*/
|
||||
public CustomFont(Minecraft mc, Object font, int size, int startChar, int endChar) {
|
||||
this.startChar = startChar;
|
||||
@@ -75,12 +67,10 @@ public class CustomFont {
|
||||
if (font instanceof String) {
|
||||
String fontName = (String) font;
|
||||
if (fontName.contains("/"))
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontName))
|
||||
.deriveFont((float) size));
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontName)).deriveFont((float) size));
|
||||
else g.setFont(new Font(fontName, 0, size));
|
||||
} else if (font instanceof InputStream) {
|
||||
g.setFont(
|
||||
Font.createFont(Font.TRUETYPE_FONT, (InputStream) font).deriveFont((float) size));
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, (InputStream) font).deriveFont((float) size));
|
||||
} else if (font instanceof File) {
|
||||
g.setFont(Font.createFont(Font.TRUETYPE_FONT, (File) font).deriveFont((float) size));
|
||||
}
|
||||
@@ -120,16 +110,11 @@ public class CustomFont {
|
||||
/**
|
||||
* Draws a given string with an automatically calculated shadow below it.
|
||||
*
|
||||
* @param gui
|
||||
* The gui/subclass to be drawn on
|
||||
* @param text
|
||||
* The string to be drawn
|
||||
* @param x
|
||||
* The x position to start drawing
|
||||
* @param y
|
||||
* The y position to start drawing
|
||||
* @param color
|
||||
* The color of the non-shadowed text (Hex)
|
||||
* @param gui The gui/subclass to be drawn on
|
||||
* @param text The string to be drawn
|
||||
* @param x The x position to start drawing
|
||||
* @param y The y position to start drawing
|
||||
* @param color The color of the non-shadowed text (Hex)
|
||||
*/
|
||||
public void drawStringS(Gui gui, String text, int x, int y, int color) {
|
||||
int l = color & 0xff000000;
|
||||
@@ -142,16 +127,11 @@ public class CustomFont {
|
||||
/**
|
||||
* Draws a given string onto a gui/subclass.
|
||||
*
|
||||
* @param gui
|
||||
* The gui/subclass to be drawn on
|
||||
* @param text
|
||||
* The string to be drawn
|
||||
* @param x
|
||||
* The x position to start drawing
|
||||
* @param y
|
||||
* The y position to start drawing
|
||||
* @param color
|
||||
* The color of the non-shadowed text (Hex)
|
||||
* @param gui The gui/subclass to be drawn on
|
||||
* @param text The string to be drawn
|
||||
* @param x The x position to start drawing
|
||||
* @param y The y position to start drawing
|
||||
* @param color The color of the non-shadowed text (Hex)
|
||||
*/
|
||||
public void drawString(Gui gui, String text, int x, int y, int color) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -180,8 +160,7 @@ public class CustomFont {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the created FontMetrics which is used to retrive various
|
||||
* information about the True Type Font
|
||||
* Returns the created FontMetrics which is used to retrive various information about the True Type Font
|
||||
*
|
||||
* @return FontMetrics of the created font.
|
||||
*/
|
||||
@@ -192,8 +171,7 @@ public class CustomFont {
|
||||
/**
|
||||
* Gets the drawing width of a given string of string.
|
||||
*
|
||||
* @param text
|
||||
* The string to be measured
|
||||
* @param text The string to be measured
|
||||
* @return The width of the given string.
|
||||
*/
|
||||
public int getStringWidth(String text) {
|
||||
@@ -203,8 +181,7 @@ public class CustomFont {
|
||||
/**
|
||||
* Gets the drawing height of a given string of string.
|
||||
*
|
||||
* @param text
|
||||
* The string to be measured
|
||||
* @param text The string to be measured
|
||||
* @return The height of the given string.
|
||||
*/
|
||||
public int getStringHeight(String text) {
|
||||
@@ -212,13 +189,10 @@ public class CustomFont {
|
||||
}
|
||||
|
||||
/**
|
||||
* A method that returns a Rectangle that contains the width and height
|
||||
* demensions of the given string.
|
||||
* A method that returns a Rectangle that contains the width and height demensions of the given string.
|
||||
*
|
||||
* @param text
|
||||
* The string to be measured
|
||||
* @return Rectangle containing width and height that the text will consume
|
||||
* when drawn.
|
||||
* @param text The string to be measured
|
||||
* @return Rectangle containing width and height that the text will consume when drawn.
|
||||
*/
|
||||
private Rectangle getBounds(String text) {
|
||||
int w = 0;
|
||||
@@ -265,7 +239,11 @@ public class CustomFont {
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((x + 0), (y + height), 0, ((u + 0) * offsetWidth), ((v + height) * offsetHeight));
|
||||
tessellator.addVertexWithUV(
|
||||
(x + width), (y + height), 0, ((u + width) * offsetWidth), ((v + height) * offsetHeight));
|
||||
(x + width),
|
||||
(y + height),
|
||||
0,
|
||||
((u + width) * offsetWidth),
|
||||
((v + height) * offsetHeight));
|
||||
tessellator.addVertexWithUV((x + width), (y + 0), 0, ((u + width) * offsetWidth), ((v + 0) * offsetHeight));
|
||||
tessellator.addVertexWithUV((x + 0), (y + 0), 0, ((u + 0) * offsetWidth), ((v + 0) * offsetHeight));
|
||||
tessellator.draw();
|
||||
|
||||
@@ -6,12 +6,15 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
public class FlexibleToolRenderer implements IItemRenderer {
|
||||
|
||||
public float depth = 1 / 32f;
|
||||
|
||||
public void setDepth(float d) {
|
||||
@@ -248,19 +251,17 @@ public class FlexibleToolRenderer implements IItemRenderer {
|
||||
ToolCore tool = (ToolCore) item.getItem();
|
||||
|
||||
IIcon[] tempParts = new IIcon[iconParts];
|
||||
label:
|
||||
{
|
||||
label: {
|
||||
if (!isInventory && ent instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) ent;
|
||||
ItemStack itemInUse = player.getItemInUse();
|
||||
if (itemInUse != null) {
|
||||
int useCount = player.getItemInUseCount();
|
||||
for (int i = iconParts; i-- > 0; )
|
||||
tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
break label;
|
||||
}
|
||||
}
|
||||
for (int i = iconParts; i-- > 0; ) tempParts[i] = tool.getIcon(item, i);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i);
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.util.IIcon;
|
||||
|
||||
// required to fix Mojansg bugs...
|
||||
public class IconFlipped extends net.minecraft.client.renderer.IconFlipped {
|
||||
|
||||
private final IIcon baseIcon;
|
||||
private final boolean flipV;
|
||||
|
||||
|
||||
@@ -2,15 +2,20 @@ package tconstruct.client;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import javax.xml.parsers.*;
|
||||
|
||||
import mantle.client.SmallFontRenderer;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.init.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyClient;
|
||||
import tconstruct.armor.player.TPlayerStats;
|
||||
@@ -18,6 +23,7 @@ import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.tools.items.ManualInfo;
|
||||
|
||||
public class TProxyClient extends TProxyCommon {
|
||||
|
||||
public static DecimalFormat df = new DecimalFormat("##.#");
|
||||
|
||||
/* TODO: Split this class up into its respective parts */
|
||||
@@ -35,7 +41,10 @@ public class TProxyClient extends TProxyCommon {
|
||||
public void registerRenderer() {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
smallFontRenderer = new SmallFontRenderer(
|
||||
mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), mc.renderEngine, false);
|
||||
mc.gameSettings,
|
||||
new ResourceLocation("textures/font/ascii.png"),
|
||||
mc.renderEngine,
|
||||
false);
|
||||
}
|
||||
|
||||
public static Document diary;
|
||||
@@ -47,10 +56,7 @@ public class TProxyClient extends TProxyCommon {
|
||||
|
||||
public void readManuals() {
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
String CurrentLanguage = Minecraft.getMinecraft()
|
||||
.getLanguageManager()
|
||||
.getCurrentLanguage()
|
||||
.getLanguageCode();
|
||||
String CurrentLanguage = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
|
||||
|
||||
Document diary_cl = readManual("/assets/tinker/manuals/" + CurrentLanguage + "/diary.xml", dbFactory);
|
||||
Document volume1_cl = readManual("/assets/tinker/manuals/" + CurrentLanguage + "/firstday.xml", dbFactory);
|
||||
@@ -62,8 +68,8 @@ public class TProxyClient extends TProxyCommon {
|
||||
volume1 = volume1_cl != null ? volume1_cl : readManual("/assets/tinker/manuals/en_US/firstday.xml", dbFactory);
|
||||
volume2 = volume2_cl != null ? volume2_cl : readManual("/assets/tinker/manuals/en_US/materials.xml", dbFactory);
|
||||
smelter = smelter_cl != null ? smelter_cl : readManual("/assets/tinker/manuals/en_US/smeltery.xml", dbFactory);
|
||||
weaponry =
|
||||
weaponry_cl != null ? weaponry_cl : readManual("/assets/tinker/manuals/en_US/weaponry.xml", dbFactory);
|
||||
weaponry = weaponry_cl != null ? weaponry_cl
|
||||
: readManual("/assets/tinker/manuals/en_US/weaponry.xml", dbFactory);
|
||||
|
||||
initManualIcons();
|
||||
initManualRecipes();
|
||||
|
||||
@@ -6,11 +6,14 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
|
||||
public class ToolCoreRenderer implements IItemRenderer {
|
||||
|
||||
private final boolean isEntity;
|
||||
private final boolean noEntityTranslation;
|
||||
|
||||
@@ -66,19 +69,17 @@ public class ToolCoreRenderer implements IItemRenderer {
|
||||
// (requires more logic rewrite than it sounds like)
|
||||
|
||||
IIcon[] tempParts = new IIcon[iconParts];
|
||||
label:
|
||||
{
|
||||
label: {
|
||||
if (!isInventory && ent instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) ent;
|
||||
ItemStack itemInUse = player.getItemInUse();
|
||||
if (itemInUse != null) {
|
||||
int useCount = player.getItemInUseCount();
|
||||
for (int i = iconParts; i-- > 0; )
|
||||
tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount);
|
||||
break label;
|
||||
}
|
||||
}
|
||||
for (int i = iconParts; i-- > 0; ) tempParts[i] = tool.getIcon(item, i);
|
||||
for (int i = iconParts; i-- > 0;) tempParts[i] = tool.getIcon(item, i);
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
@@ -164,9 +165,8 @@ public class ToolCoreRenderer implements IItemRenderer {
|
||||
GL11.glTranslatef(0, -4 / 16f, 0);
|
||||
break;
|
||||
case ENTITY:
|
||||
if (!noEntityTranslation)
|
||||
GL11.glTranslatef(
|
||||
-0.5f, 0f, depth); // correction of the rotation point when items lie on the ground
|
||||
if (!noEntityTranslation) GL11.glTranslatef(-0.5f, 0f, depth); // correction of the rotation point
|
||||
// when items lie on the ground
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
package tconstruct.client.entity.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.mechworks.entity.item.ExplosivePrimed;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ExplosiveRender extends Render {
|
||||
|
||||
private final RenderBlocks blockRenderer = new RenderBlocks();
|
||||
|
||||
public ExplosiveRender() {
|
||||
this.shadowSize = 0.5F;
|
||||
}
|
||||
|
||||
public void renderPrimedTNT(
|
||||
ExplosivePrimed par1EntityTNTPrimed, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void renderPrimedTNT(ExplosivePrimed par1EntityTNTPrimed, double par2, double par4, double par6, float par8,
|
||||
float par9) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
float f2;
|
||||
@@ -67,8 +70,7 @@ public class ExplosiveRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called
|
||||
* unless you call Render.bindEntityTexture.
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
@@ -76,12 +78,10 @@ public class ExplosiveRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.blocks.BlockUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.*;
|
||||
@@ -11,14 +12,18 @@ import net.minecraft.client.renderer.texture.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.ArrowEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class ArrowRender extends Render {
|
||||
private static final ResourceLocation RES_ITEM_GLINT =
|
||||
new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
|
||||
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation(
|
||||
"textures/misc/enchanted_item_glint.png");
|
||||
private final RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
@@ -39,8 +44,8 @@ public class ArrowRender extends Render {
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(
|
||||
ArrowEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void doRenderItem(ArrowEntity par1ArrowEntity, double par2, double par4, double par6, float par8,
|
||||
float par9) {
|
||||
this.bindEntityTexture(par1ArrowEntity);
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1ArrowEntity.getEntityItem();
|
||||
@@ -61,10 +66,8 @@ public class ArrowRender extends Render {
|
||||
Block block;
|
||||
block = BlockUtils.getBlockFromItem(itemstack.getItem());
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0
|
||||
&& block != null
|
||||
&& RenderBlocks.renderItemIn3d(
|
||||
BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
if (itemstack.getItemSpriteNumber() == 0 && block != null
|
||||
&& RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
float f7 = 0.25F;
|
||||
@@ -136,26 +139,26 @@ public class ArrowRender extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(ArrowEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem(
|
||||
ArrowEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7) {
|
||||
private void renderDroppedItem(ArrowEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5,
|
||||
float par6, float par7) {
|
||||
renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0);
|
||||
}
|
||||
|
||||
private void renderDroppedItem(
|
||||
ArrowEntity arrow, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) {
|
||||
private void renderDroppedItem(ArrowEntity arrow, IIcon par2Icon, int par3, float par4, float par5, float par6,
|
||||
float par7, int pass) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (par2Icon == null) {
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
|
||||
ResourceLocation resourcelocation =
|
||||
texturemanager.getResourceLocation(arrow.getEntityItem().getItemSpriteNumber());
|
||||
ResourceLocation resourcelocation = texturemanager
|
||||
.getResourceLocation(arrow.getEntityItem().getItemSpriteNumber());
|
||||
par2Icon = ((TextureMap) texturemanager.getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
@@ -211,7 +214,14 @@ public class ArrowRender extends Render {
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
|
||||
ItemRenderer.renderItemIn2D(
|
||||
tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12);
|
||||
tessellator,
|
||||
f5,
|
||||
f6,
|
||||
f4,
|
||||
f7,
|
||||
par2Icon.getIconWidth(),
|
||||
par2Icon.getIconHeight(),
|
||||
f12);
|
||||
|
||||
if (itemstack.hasEffect(pass)) {
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
@@ -253,12 +263,10 @@ public class ArrowRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.*;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
@@ -9,12 +9,16 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.ArrowEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class ArrowRenderCustom extends Render {
|
||||
|
||||
private static final RenderItem renderer = new RenderItem();
|
||||
private final Random random = new Random();
|
||||
|
||||
@@ -30,7 +34,10 @@ public class ArrowRenderCustom extends Render {
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glRotatef(
|
||||
arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * par9 - 90.0F,
|
||||
0.0F,
|
||||
1.0F,
|
||||
0.0F);
|
||||
GL11.glRotatef(
|
||||
arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * par9 - 45.0F,
|
||||
0.0F,
|
||||
@@ -49,47 +56,33 @@ public class ArrowRenderCustom extends Render {
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
@@ -102,7 +95,7 @@ public class ArrowRenderCustom extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(ArrowEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.blocks.BlockUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
@@ -13,14 +14,18 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.DaggerEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class DaggerRender extends Render {
|
||||
private static final ResourceLocation RES_ITEM_GLINT =
|
||||
new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
|
||||
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation(
|
||||
"textures/misc/enchanted_item_glint.png");
|
||||
private final RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
@@ -41,8 +46,8 @@ public class DaggerRender extends Render {
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(
|
||||
DaggerEntity par1ArrowEntity, double par2, double par4, double par6, float par8, float par9) {
|
||||
public void doRenderItem(DaggerEntity par1ArrowEntity, double par2, double par4, double par6, float par8,
|
||||
float par9) {
|
||||
this.bindEntityTexture(par1ArrowEntity);
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1ArrowEntity.getEntityItem();
|
||||
@@ -62,10 +67,8 @@ public class DaggerRender extends Render {
|
||||
|
||||
Block block = BlockUtils.getBlockFromItem(itemstack.getItem());
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0
|
||||
&& block != null
|
||||
&& RenderBlocks.renderItemIn3d(
|
||||
BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
if (itemstack.getItemSpriteNumber() == 0 && block != null
|
||||
&& RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) {
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
if (renderInFrame) {
|
||||
@@ -153,26 +156,26 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(DaggerEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem(
|
||||
DaggerEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7) {
|
||||
private void renderDroppedItem(DaggerEntity par1ArrowEntity, IIcon par2Icon, int par3, float par4, float par5,
|
||||
float par6, float par7) {
|
||||
renderDroppedItem(par1ArrowEntity, par2Icon, par3, par4, par5, par6, par7, 0);
|
||||
}
|
||||
|
||||
private void renderDroppedItem(
|
||||
DaggerEntity dagger, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) {
|
||||
private void renderDroppedItem(DaggerEntity dagger, IIcon par2Icon, int par3, float par4, float par5, float par6,
|
||||
float par7, int pass) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (par2Icon == null) {
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
|
||||
ResourceLocation resourcelocation =
|
||||
texturemanager.getResourceLocation(dagger.getEntityItem().getItemSpriteNumber());
|
||||
ResourceLocation resourcelocation = texturemanager
|
||||
.getResourceLocation(dagger.getEntityItem().getItemSpriteNumber());
|
||||
par2Icon = ((TextureMap) texturemanager.getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
@@ -222,28 +225,27 @@ public class DaggerRender extends Render {
|
||||
GL11.glRotatef(90, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(rotation, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(
|
||||
tessellator, f5, f6, f4, f7, par2Icon.getIconWidth(), par2Icon.getIconHeight(), f12);
|
||||
tessellator,
|
||||
f5,
|
||||
f6,
|
||||
f4,
|
||||
f7,
|
||||
par2Icon.getIconWidth(),
|
||||
par2Icon.getIconHeight(),
|
||||
f12);
|
||||
|
||||
/*
|
||||
* if (itemstack.hasEffect(pass)) { GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
* GL11.glDisable(GL11.GL_LIGHTING);
|
||||
* this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT);
|
||||
* GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR,
|
||||
* GL11.GL_ONE); float f13 = 0.76F; GL11.glColor4f(0.5F * f13, 0.25F
|
||||
* * f13, 0.8F * f13, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
* GL11.glPushMatrix(); float f14 = 0.125F; GL11.glScalef(f14, f14,
|
||||
* f14); float f15 = (float) (Minecraft.getSystemTime() % 3000L) /
|
||||
* 3000.0F * 8.0F; GL11.glTranslatef(f15, 0.0F, 0.0F);
|
||||
* GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
* ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F,
|
||||
* 255, 255, f12); GL11.glPopMatrix(); GL11.glPushMatrix();
|
||||
* GL11.glScalef(f14, f14, f14); f15 = (float)
|
||||
* (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
|
||||
* GL11.glTranslatef(-f15, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F,
|
||||
* 0.0F, 1.0F); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F,
|
||||
* 1.0F, 1.0F, 255, 255, f12); GL11.glPopMatrix();
|
||||
* GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
* GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING);
|
||||
* if (itemstack.hasEffect(pass)) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING);
|
||||
* this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT); GL11.glEnable(GL11.GL_BLEND);
|
||||
* GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f13 = 0.76F; GL11.glColor4f(0.5F * f13, 0.25F *
|
||||
* f13, 0.8F * f13, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glPushMatrix(); float f14 = 0.125F;
|
||||
* GL11.glScalef(f14, f14, f14); float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
|
||||
* GL11.glTranslatef(f15, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
* ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); GL11.glPopMatrix();
|
||||
* GL11.glPushMatrix(); GL11.glScalef(f14, f14, f14); f15 = (float) (Minecraft.getSystemTime() % 4873L) /
|
||||
* 4873.0F * 8.0F; GL11.glTranslatef(-f15, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
||||
* ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); GL11.glPopMatrix();
|
||||
* GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING);
|
||||
* GL11.glDepthFunc(GL11.GL_LEQUAL); }
|
||||
*/
|
||||
}
|
||||
@@ -254,22 +256,13 @@ public class DaggerRender extends Render {
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false);
|
||||
}
|
||||
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5,
|
||||
boolean renderEffect) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) {
|
||||
Item k = par3ItemStack.getItem();
|
||||
int l = par3ItemStack.getItemDamage();
|
||||
IIcon iIcon = par3ItemStack.getIconIndex();
|
||||
@@ -279,8 +272,7 @@ public class DaggerRender extends Render {
|
||||
float f2;
|
||||
|
||||
Block block = BlockUtils.getBlockFromItem(k);
|
||||
if (par3ItemStack.getItemSpriteNumber() == 0
|
||||
&& block != null
|
||||
if (par3ItemStack.getItemSpriteNumber() == 0 && block != null
|
||||
&& RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(k).getRenderType())) {
|
||||
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GL11.glPushMatrix();
|
||||
@@ -309,8 +301,7 @@ public class DaggerRender extends Render {
|
||||
|
||||
for (int j1 = 0; j1 < k.getRenderPasses(l); ++j1) {
|
||||
par2TextureManager.bindTexture(
|
||||
par3ItemStack.getItemSpriteNumber() == 0
|
||||
? TextureMap.locationBlocksTexture
|
||||
par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture
|
||||
: TextureMap.locationItemsTexture);
|
||||
IIcon icon = k.getIcon(par3ItemStack, j1);
|
||||
int k1 = k.getColorFromItemStack(par3ItemStack, j1);
|
||||
@@ -332,13 +323,12 @@ public class DaggerRender extends Render {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
} else {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceLocation resourcelocation =
|
||||
par2TextureManager.getResourceLocation(par3ItemStack.getItemSpriteNumber());
|
||||
ResourceLocation resourcelocation = par2TextureManager
|
||||
.getResourceLocation(par3ItemStack.getItemSpriteNumber());
|
||||
par2TextureManager.bindTexture(resourcelocation);
|
||||
|
||||
if (iIcon == null) {
|
||||
iIcon = ((TextureMap)
|
||||
Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation))
|
||||
iIcon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation))
|
||||
.getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
@@ -382,32 +372,28 @@ public class DaggerRender extends Render {
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
if (par3ItemStack != null) {
|
||||
if (!ForgeHooksClient.renderInventoryItem(
|
||||
field_147909_c, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float)
|
||||
par5)) {
|
||||
field_147909_c,
|
||||
par2TextureManager,
|
||||
par3ItemStack,
|
||||
renderWithColor,
|
||||
zLevel,
|
||||
(float) par4,
|
||||
(float) par5)) {
|
||||
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Modders must handle this themselves if they use custom renderers!
|
||||
* if (par3ItemStack.hasEffect()) {
|
||||
* GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
* GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false);
|
||||
* par2TextureManager.bindTexture(RES_ITEM_GLINT); this.zLevel -=
|
||||
* 50.0F; GL11.glEnable(GL11.GL_BLEND);
|
||||
* GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
* GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); this.renderGlint(par4 *
|
||||
* 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
* GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true);
|
||||
* this.zLevel += 50.0F; GL11.glEnable(GL11.GL_LIGHTING);
|
||||
* GL11.glDepthFunc(GL11.GL_LEQUAL); }
|
||||
* Modders must handle this themselves if they use custom renderers! if (par3ItemStack.hasEffect()) {
|
||||
* GL11.glDepthFunc(GL11.GL_GREATER); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false);
|
||||
* par2TextureManager.bindTexture(RES_ITEM_GLINT); this.zLevel -= 50.0F; GL11.glEnable(GL11.GL_BLEND);
|
||||
* GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
* this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
* GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); this.zLevel += 50.0F;
|
||||
* GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); }
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -424,8 +410,7 @@ public class DaggerRender extends Render {
|
||||
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873))
|
||||
/ (3000.0F + (float) (j1 * 1873))
|
||||
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873))
|
||||
* 256.0F;
|
||||
float f3 = 0.0F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
@@ -437,7 +422,11 @@ public class DaggerRender extends Render {
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(
|
||||
par2 + 0, par3 + par5, this.zLevel, (f2 + (float) par5 * f4) * f, (f3 + (float) par5) * f1);
|
||||
par2 + 0,
|
||||
par3 + par5,
|
||||
this.zLevel,
|
||||
(f2 + (float) par5 * f4) * f,
|
||||
(f3 + (float) par5) * f1);
|
||||
tessellator.addVertexWithUV(
|
||||
par2 + par4,
|
||||
par3 + par5,
|
||||
@@ -451,44 +440,36 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, null);
|
||||
}
|
||||
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5,
|
||||
String par6Str) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5, String par6Str) {
|
||||
if (par3ItemStack != null) {
|
||||
if (par3ItemStack.stackSize > 1 || par6Str != null) {
|
||||
String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
par1FontRenderer.drawStringWithShadow(
|
||||
s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
|
||||
s1,
|
||||
par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1),
|
||||
par5 + 6 + 3,
|
||||
16777215);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (par3ItemStack.isItemDamaged()) {
|
||||
int k = (int) Math.round(13.0D
|
||||
- (double) par3ItemStack.getItemDamageForDisplay()
|
||||
* 13.0D
|
||||
int k = (int) Math.round(
|
||||
13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D
|
||||
/ (double) par3ItemStack.getMaxDamage());
|
||||
int l = (int) Math.round(255.0D
|
||||
- (double) par3ItemStack.getItemDamageForDisplay()
|
||||
* 255.0D
|
||||
int l = (int) Math.round(
|
||||
255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D
|
||||
/ (double) par3ItemStack.getMaxDamage());
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
@@ -508,8 +489,8 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a quad to the tesselator at the specified position with the set
|
||||
* width and height and color. Args: tessellator, x, y, width, height, color
|
||||
* Adds a quad to the tesselator at the specified position with the set width and height and color. Args:
|
||||
* tessellator, x, y, width, height, color
|
||||
*/
|
||||
private void renderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) {
|
||||
par1Tessellator.startDrawingQuads();
|
||||
@@ -537,12 +518,10 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
@@ -577,8 +556,7 @@ public class DaggerRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for a subclass to override how many rendered items appear in a
|
||||
* "mini item 3d stack"
|
||||
* Allows for a subclass to override how many rendered items appear in a "mini item 3d stack"
|
||||
*
|
||||
* @param stack
|
||||
* @return
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.*;
|
||||
import net.minecraft.client.renderer.texture.*;
|
||||
@@ -9,13 +9,17 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.client.ToolCoreRenderer;
|
||||
import tconstruct.tools.entity.DaggerEntity;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Deprecated
|
||||
public class DaggerRenderCustom extends Render {
|
||||
|
||||
private static final RenderItem renderer = new RenderItem();
|
||||
private static final ToolCoreRenderer toolCoreRenderer = new ToolCoreRenderer(true, true);
|
||||
private final Random random = new Random();
|
||||
@@ -49,9 +53,8 @@ public class DaggerRenderCustom extends Render {
|
||||
float rotation = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * par9;
|
||||
GL11.glRotatef(dagger.rotationYaw + 90, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(rotation * 15, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(
|
||||
-0.25f, -0.25f,
|
||||
0f); // translate to the middle. This makes it so that the dagger rotates around its center
|
||||
GL11.glTranslatef(-0.25f, -0.25f, 0f); // translate to the middle. This makes it so that the dagger rotates
|
||||
// around its center
|
||||
float shake = dagger.arrowShake - par9;
|
||||
if (shake > 0.0F) GL11.glRotatef(-MathHelper.sin(shake * 3) * shake, 0, 0, 1);
|
||||
// GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f);
|
||||
@@ -72,47 +75,33 @@ public class DaggerRenderCustom extends Render {
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or
|
||||
* damage on top of the item's image at the specified position.
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(
|
||||
FontRenderer par1FontRenderer,
|
||||
TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack,
|
||||
int par4,
|
||||
int par5) {
|
||||
public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager,
|
||||
ItemStack par3ItemStack, int par4, int par5) {
|
||||
renderer.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
@@ -125,7 +114,7 @@ public class DaggerRenderCustom extends Render {
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110796_a(DaggerEntity par1ArrowEntity) {
|
||||
return this.renderManager.renderEngine.getResourceLocation(
|
||||
par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
return this.renderManager.renderEngine
|
||||
.getResourceLocation(par1ArrowEntity.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -8,11 +7,15 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import tconstruct.tools.entity.LaunchedPotion;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LaunchedItemRender extends Render {
|
||||
|
||||
private final Item field_94151_a;
|
||||
private final int field_94150_f;
|
||||
|
||||
@@ -26,12 +29,10 @@ public class LaunchedItemRender extends Render {
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method,
|
||||
* always casting down its argument and then handing it off to a worker
|
||||
* function which does the actual work. In all probabilty, the class Render
|
||||
* is generic (Render<T extends Entity) and this method has signature public
|
||||
* void doRender(T entity, double d, double d1, double d2, float f, float
|
||||
* f1). But JAD is pre 1.5 so doesn't do that.
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public abstract class RangedRenderBase extends Render {
|
||||
|
||||
public RangedRenderBase() {}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,13 +2,16 @@ package tconstruct.client.pages;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
public class BlockCastPage extends BookPage {
|
||||
|
||||
String text;
|
||||
ItemStack[] icons;
|
||||
|
||||
@@ -18,8 +21,7 @@ public class BlockCastPage extends BookPage {
|
||||
if (nodes != null) text = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("recipe");
|
||||
if (nodes != null)
|
||||
icons = MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
|
||||
if (nodes != null) icons = MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,20 +36,31 @@ public class BlockCastPage extends BookPage {
|
||||
manual.renderitem.zLevel = 100;
|
||||
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 138) / 2, (localHeight + 110) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
(localWidth + 138) / 2,
|
||||
(localHeight + 110) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], (localWidth + 70) / 2, (localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
(localWidth + 70) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[2], (localWidth + 70) / 2, (localHeight + 110) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth + 70) / 2,
|
||||
(localHeight + 110) / 2);
|
||||
|
||||
if (icons[0].stackSize > 1)
|
||||
manual.renderitem.renderItemOverlayIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
(localWidth + 106) / 2,
|
||||
(localHeight + 74) / 2,
|
||||
String.valueOf(icons[0].stackSize));
|
||||
if (icons[0].stackSize > 1) manual.renderitem.renderItemOverlayIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
(localWidth + 106) / 2,
|
||||
(localHeight + 74) / 2,
|
||||
String.valueOf(icons[0].stackSize));
|
||||
|
||||
manual.renderitem.zLevel = 0;
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
|
||||
@@ -2,17 +2,21 @@ package tconstruct.client.pages;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.tools.ToolMaterial;
|
||||
import tconstruct.library.util.HarvestLevels;
|
||||
|
||||
public class MaterialPage extends BookPage {
|
||||
|
||||
String title;
|
||||
ItemStack[] icons;
|
||||
String iconText;
|
||||
@@ -29,8 +33,7 @@ public class MaterialPage extends BookPage {
|
||||
if (nodes != null) iconText = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("icon");
|
||||
if (nodes != null)
|
||||
icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
if (nodes != null) icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
|
||||
nodes = element.getElementsByTagName("toolmaterial");
|
||||
if (nodes != null && nodes.getLength() > 0)
|
||||
@@ -98,17 +101,28 @@ public class MaterialPage extends BookPage {
|
||||
// renderitem.renderItemAndEffectIntoGUI(fonts, getMC().renderEngine,
|
||||
// icons[0], localWidth + 50, localHeight + 0);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], localWidth + 108, localHeight + 50);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
localWidth + 108,
|
||||
localHeight + 50);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[2], localWidth + 108, localHeight + 82);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
localWidth + 108,
|
||||
localHeight + 82);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[3], localWidth + 108, localHeight + 114);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[3],
|
||||
localWidth + 108,
|
||||
localHeight + 114);
|
||||
manual.renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
String icon =
|
||||
icons[1].getTooltip(manual.getMC().thePlayer, false).get((0)).toString();
|
||||
String icon = icons[1].getTooltip(manual.getMC().thePlayer, false).get((0)).toString();
|
||||
if (isTranslatable) icon = StatCollector.translateToLocal(icon);
|
||||
int iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(icon, localWidth + 128, localHeight + 50 + iconOffset, 52, 0);
|
||||
@@ -118,9 +132,7 @@ public class MaterialPage extends BookPage {
|
||||
if (isTranslatable) icon = StatCollector.translateToLocal(icon);
|
||||
iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(
|
||||
icons[2].getTooltip(manual.getMC().thePlayer, false)
|
||||
.get((0))
|
||||
.toString(),
|
||||
icons[2].getTooltip(manual.getMC().thePlayer, false).get((0)).toString(),
|
||||
localWidth + 128,
|
||||
localHeight + 82 + iconOffset,
|
||||
52,
|
||||
@@ -131,9 +143,7 @@ public class MaterialPage extends BookPage {
|
||||
if (isTranslatable) icon = StatCollector.translateToLocal(icon);
|
||||
iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(
|
||||
icons[3].getTooltip(manual.getMC().thePlayer, false)
|
||||
.get((0))
|
||||
.toString(),
|
||||
icons[3].getTooltip(manual.getMC().thePlayer, false).get((0)).toString(),
|
||||
localWidth + 128,
|
||||
localHeight + 114 + iconOffset,
|
||||
52,
|
||||
@@ -141,8 +151,8 @@ public class MaterialPage extends BookPage {
|
||||
}
|
||||
|
||||
manual.fonts.drawString(durability + ": " + material.durability(), localWidth, localHeight + 40, 0);
|
||||
manual.fonts.drawString(
|
||||
handleModifier + ": " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
manual.fonts
|
||||
.drawString(handleModifier + ": " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
manual.fonts.drawString(
|
||||
fullToolDurability + ": " + (int) (material.durability() * material.handleDurability()),
|
||||
localWidth,
|
||||
@@ -151,19 +161,20 @@ public class MaterialPage extends BookPage {
|
||||
|
||||
manual.fonts.drawString(miningSpeed + ": " + material.toolSpeed() / 100f, localWidth, localHeight + 80, 0);
|
||||
manual.fonts.drawString(
|
||||
miningLevel + ": " + material.harvestLevel() + " ("
|
||||
+ HarvestLevels.getHarvestLevelName(material.harvestLevel()) + ")",
|
||||
miningLevel + ": "
|
||||
+ material.harvestLevel()
|
||||
+ " ("
|
||||
+ HarvestLevels.getHarvestLevelName(material.harvestLevel())
|
||||
+ ")",
|
||||
localWidth,
|
||||
localHeight + 90,
|
||||
0);
|
||||
int attack = material.attack();
|
||||
String heart = attack == 2 ? " " + heart_ : " " + hearts;
|
||||
if (attack % 2 == 0)
|
||||
manual.fonts.drawString(
|
||||
baseAttack + ": " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
else
|
||||
manual.fonts.drawString(
|
||||
baseAttack + ": " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
if (attack % 2 == 0) manual.fonts
|
||||
.drawString(baseAttack + ": " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
else manual.fonts
|
||||
.drawString(baseAttack + ": " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
|
||||
int offset = 0;
|
||||
String ability = material.ability();
|
||||
@@ -178,17 +189,26 @@ public class MaterialPage extends BookPage {
|
||||
manual.fonts.drawString(traitReinforced, localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
manual.fonts.drawString(
|
||||
reinforcedLevel + ": " + material.reinforced(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
reinforcedLevel + ": " + material.reinforced(),
|
||||
localWidth,
|
||||
localHeight + 120 + 10 * offset,
|
||||
0);
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (material.shoddy() > 0) {
|
||||
manual.fonts.drawString(
|
||||
stoneboundLevel + ": " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
stoneboundLevel + ": " + material.shoddy(),
|
||||
localWidth,
|
||||
localHeight + 120 + 10 * offset,
|
||||
0);
|
||||
offset++;
|
||||
} else if (material.shoddy() < 0) {
|
||||
manual.fonts.drawString(
|
||||
splinteringLevel + ": " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
splinteringLevel + ": " + -material.shoddy(),
|
||||
localWidth,
|
||||
localHeight + 120 + 10 * offset,
|
||||
0);
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package tconstruct.client.pages;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.*;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
public class ModifierPage extends BookPage {
|
||||
|
||||
String type;
|
||||
ItemStack[] icons;
|
||||
ItemStack[][] iconsMulti;
|
||||
@@ -31,10 +35,9 @@ public class ModifierPage extends BookPage {
|
||||
if (type.equals("travelmulti")) {
|
||||
List<ItemStack[]> stacks = new LinkedList<>();
|
||||
List<String> tools = new LinkedList<>();
|
||||
String[] suffixes = new String[] {"goggles", "vest", "wings", "boots", "glove", "belt"};
|
||||
String[] suffixes = new String[] { "goggles", "vest", "wings", "boots", "glove", "belt" };
|
||||
for (String suffix : suffixes) {
|
||||
ItemStack[] icons2 =
|
||||
MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent() + suffix);
|
||||
ItemStack[] icons2 = MantleClientRegistry.getRecipeIcons(nodes.item(0).getTextContent() + suffix);
|
||||
if (icons2 != null) {
|
||||
stacks.add(icons2);
|
||||
tools.add(suffix);
|
||||
@@ -78,8 +81,7 @@ public class ModifierPage extends BookPage {
|
||||
if (type.equals("travelmulti")) toolstack = toolMulti[counter];
|
||||
|
||||
// update displayed item
|
||||
if (iconsMulti != null
|
||||
&& iconsMulti.length > 0
|
||||
if (iconsMulti != null && iconsMulti.length > 0
|
||||
&& type.equals("travelmulti")
|
||||
&& System.currentTimeMillis() - lastUpdate > 1000) {
|
||||
lastUpdate = System.currentTimeMillis();
|
||||
@@ -104,14 +106,17 @@ public class ModifierPage extends BookPage {
|
||||
(localWidth + 130) / 2,
|
||||
(localHeight + 54) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], (localWidth + 18) / 2, (localHeight + 36) / 2);
|
||||
if (icons[2] != null)
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth + 18) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
(localWidth + 18) / 2,
|
||||
(localHeight + 36) / 2);
|
||||
if (icons[2] != null) manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth + 18) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
} else {
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
@@ -126,18 +131,29 @@ public class ModifierPage extends BookPage {
|
||||
(localWidth + 140) / 2,
|
||||
(localHeight + 54) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[1], (localWidth - 2) / 2, (localHeight + 36) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[1],
|
||||
(localWidth - 2) / 2,
|
||||
(localHeight + 36) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[2], (localWidth - 2) / 2, (localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[2],
|
||||
(localWidth - 2) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[3], (localWidth + 36) / 2, (localHeight + 36) / 2);
|
||||
if (icons[4] != null)
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[4],
|
||||
(localWidth + 36) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[3],
|
||||
(localWidth + 36) / 2,
|
||||
(localHeight + 36) / 2);
|
||||
if (icons[4] != null) manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[4],
|
||||
(localWidth + 36) / 2,
|
||||
(localHeight + 74) / 2);
|
||||
}
|
||||
manual.renderitem.zLevel = 0;
|
||||
|
||||
|
||||
@@ -2,13 +2,16 @@ package tconstruct.client.pages;
|
||||
|
||||
import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
import org.w3c.dom.*;
|
||||
|
||||
public class ToolPage extends BookPage {
|
||||
|
||||
String title;
|
||||
ItemStack[] icons;
|
||||
String[] iconText;
|
||||
@@ -35,8 +38,7 @@ public class ToolPage extends BookPage {
|
||||
}
|
||||
|
||||
nodes = element.getElementsByTagName("icon");
|
||||
if (nodes != null)
|
||||
icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
if (nodes != null) icons[0] = MantleClientRegistry.getManualIcon(nodes.item(0).getTextContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +62,11 @@ public class ToolPage extends BookPage {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
manual.renderitem.zLevel = 100;
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts, manual.getMC().renderEngine, icons[0], localWidth + 50, localHeight + 0);
|
||||
manual.fonts,
|
||||
manual.getMC().renderEngine,
|
||||
icons[0],
|
||||
localWidth + 50,
|
||||
localHeight + 0);
|
||||
for (int i = 1; i < icons.length; i++) {
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(
|
||||
manual.fonts,
|
||||
@@ -70,7 +76,11 @@ public class ToolPage extends BookPage {
|
||||
localHeight + 20 + 10 * size + 18 * i);
|
||||
int partOffset = iconText[i + 1].length() > 11 ? -3 : 0;
|
||||
manual.fonts.drawSplitString(
|
||||
iconText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i + partOffset, 44, 0);
|
||||
iconText[i + 1],
|
||||
localWidth + 140,
|
||||
localHeight + 24 + 10 * size + 18 * i + partOffset,
|
||||
44,
|
||||
0);
|
||||
}
|
||||
manual.renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
@@ -6,9 +6,11 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
public abstract class AbstractTab extends GuiButton {
|
||||
|
||||
ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png");
|
||||
ItemStack renderStack;
|
||||
RenderItem itemRenderer = new RenderItem();
|
||||
@@ -37,9 +39,17 @@ public abstract class AbstractTab extends GuiButton {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
this.itemRenderer.renderItemAndEffectIntoGUI(
|
||||
mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
|
||||
mc.fontRenderer,
|
||||
mc.renderEngine,
|
||||
renderStack,
|
||||
xPosition + 6,
|
||||
yPosition + 8);
|
||||
this.itemRenderer.renderItemOverlayIntoGUI(
|
||||
mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
|
||||
mc.fontRenderer,
|
||||
mc.renderEngine,
|
||||
renderStack,
|
||||
xPosition + 6,
|
||||
yPosition + 8);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
this.itemRenderer.zLevel = 0.0F;
|
||||
@@ -50,8 +60,7 @@ public abstract class AbstractTab extends GuiButton {
|
||||
|
||||
@Override
|
||||
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
|
||||
boolean inWindow = this.enabled
|
||||
&& this.visible
|
||||
boolean inWindow = this.enabled && this.visible
|
||||
&& mouseX >= this.xPosition
|
||||
&& mouseY >= this.yPosition
|
||||
&& mouseX < this.xPosition + this.width
|
||||
|
||||
@@ -2,9 +2,11 @@ package tconstruct.client.tabs;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import tconstruct.client.ArmorControls;
|
||||
|
||||
public class InventoryTabArmorExtended extends AbstractTab {
|
||||
|
||||
public InventoryTabArmorExtended() {
|
||||
super(0, 0, 0, new ItemStack(Items.diamond_chestplate));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package tconstruct.client.tabs;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import tconstruct.armor.*;
|
||||
import tconstruct.client.ArmorControls;
|
||||
|
||||
public class InventoryTabKnapsack extends AbstractTab {
|
||||
|
||||
public InventoryTabKnapsack() {
|
||||
super(0, 0, 0, new ItemStack(TinkerArmor.knapsack));
|
||||
}
|
||||
@@ -16,8 +18,7 @@ public class InventoryTabKnapsack extends AbstractTab {
|
||||
|
||||
@Override
|
||||
public boolean shouldAddToList() {
|
||||
return ArmorProxyClient.armorExtended != null
|
||||
&& ArmorProxyClient.armorExtended.inventory[2] != null
|
||||
return ArmorProxyClient.armorExtended != null && ArmorProxyClient.armorExtended.inventory[2] != null
|
||||
&& ArmorProxyClient.armorExtended.inventory[2].getItem() == TinkerArmor.knapsack;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class InventoryTabVanilla extends AbstractTab {
|
||||
|
||||
public InventoryTabVanilla() {
|
||||
super(0, 0, 0, new ItemStack(Blocks.crafting_table));
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
package tconstruct.client.tabs;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.network.play.client.C0DPacketCloseWindow;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.*;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.network.play.client.C0DPacketCloseWindow;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
|
||||
public class TabRegistry {
|
||||
|
||||
private static final ArrayList<AbstractTab> tabList = new ArrayList<>();
|
||||
|
||||
public static void registerTab(AbstractTab tab) {
|
||||
@@ -81,8 +84,7 @@ public class TabRegistry {
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
} else {
|
||||
// If NEI is not installed, offset the tabs
|
||||
return 60;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package tconstruct.common;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class TProxyCommon implements IGuiHandler {
|
||||
|
||||
public void initialize() {}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
public class MetadataItemBlock extends ItemBlock {
|
||||
|
||||
public MetadataItemBlock(Block b) {
|
||||
super(b);
|
||||
setMaxDamage(0);
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
package tconstruct.gadgets;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import java.util.Locale;
|
||||
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.gadgets.item.ItemSlimeBoots;
|
||||
import tconstruct.gadgets.item.ItemSlimeSling;
|
||||
import tconstruct.library.SlimeBounceHandler;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@Pulse(id = "Tinkers' Gadgets", description = "All the fun toys.", forced = true)
|
||||
public class TinkerGadgets {
|
||||
@@ -45,8 +49,18 @@ public class TinkerGadgets {
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(new ItemStack(slimeBoots), " ", "s s", "b b", 's', "slimeball", 'b', ore));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(slimeSling), "fbf", "s s", " s ", 'f', Items.string, 's', "slimeball", 'b', ore));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapedOreRecipe(
|
||||
new ItemStack(slimeSling),
|
||||
"fbf",
|
||||
"s s",
|
||||
" s ",
|
||||
'f',
|
||||
Items.string,
|
||||
's',
|
||||
"slimeball",
|
||||
'b',
|
||||
ore));
|
||||
TConstructRegistry.gadgetsTab.init(new ItemStack(slimeBoots));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package tconstruct.gadgets.item;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@@ -23,14 +21,18 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
|
||||
import tconstruct.library.SlimeBounceHandler;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.armor.ArmorPart;
|
||||
import tconstruct.tools.entity.FancyEntityItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemSlimeBoots extends ItemArmor implements ISpecialArmor {
|
||||
|
||||
public static ArmorMaterial SLIME_MATERIAL = EnumHelper.addArmorMaterial("SLIME", 100, new int[] {0, 0, 0, 0}, 0);
|
||||
public static ArmorMaterial SLIME_MATERIAL = EnumHelper.addArmorMaterial("SLIME", 100, new int[] { 0, 0, 0, 0 }, 0);
|
||||
|
||||
public final ArmorPart armorPart;
|
||||
protected final String textureFolder;
|
||||
@@ -178,8 +180,8 @@ public class ItemSlimeBoots extends ItemArmor implements ISpecialArmor {
|
||||
|
||||
// ISpecialArmor overrides
|
||||
@Override
|
||||
public ArmorProperties getProperties(
|
||||
EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
|
||||
int slot) {
|
||||
return new ArmorProperties(0, armor.getItemDamage() / 100, 100);
|
||||
}
|
||||
|
||||
@@ -217,10 +219,9 @@ public class ItemSlimeBoots extends ItemArmor implements ISpecialArmor {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
list.add("Boooounce!");
|
||||
list.add("Hold "
|
||||
+ (I18n.format(
|
||||
Minecraft.getMinecraft().gameSettings.keyBindSneak.getKeyDescription()))
|
||||
+ " to stop bouncing.");
|
||||
list.add(
|
||||
"Hold " + (I18n.format(Minecraft.getMinecraft().gameSettings.keyBindSneak.getKeyDescription()))
|
||||
+ " to stop bouncing.");
|
||||
}
|
||||
|
||||
/* Prevent armor from dying */
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package tconstruct.gadgets.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -14,11 +13,14 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.gadgets.TinkerGadgets;
|
||||
import tconstruct.library.SlimeBounceHandler;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.util.network.MovementUpdatePacket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemSlimeSling extends Item {
|
||||
|
||||
@@ -28,8 +30,7 @@ public class ItemSlimeSling extends Item {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed.
|
||||
* Args: itemStack, world, entityPlayer
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) {
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.CustomMaterial;
|
||||
import tconstruct.library.tools.FletchingMaterial;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.weaponry.TinkerWeaponry;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
@Deprecated
|
||||
public class Arrow extends ToolCore {
|
||||
@@ -85,7 +87,7 @@ public class Arrow extends ToolCore {
|
||||
|
||||
@Override
|
||||
public String[] getTraits() {
|
||||
return new String[] {"ammo"};
|
||||
return new String[] { "ammo" };
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,17 +154,8 @@ public class Arrow extends ToolCore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float clickX,
|
||||
float clickY,
|
||||
float clickZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float clickX, float clickY, float clickZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -212,9 +205,13 @@ public class Arrow extends ToolCore {
|
||||
}
|
||||
}
|
||||
int attack = (int) (tags.getCompoundTag("InfiTool").getInteger("Attack") * this.getDamageModifier());
|
||||
list.add("\u00A79+" + attack + " "
|
||||
+ StatCollector.translateToLocalFormatted("attribute.name.generic.attackDamage"));
|
||||
list.add("\u00A79+" + tags.getCompoundTag("InfiTool").getInteger("Attack") + " "
|
||||
+ StatCollector.translateToLocalFormatted("attribute.name.ammo.attackDamage"));
|
||||
list.add(
|
||||
"\u00A79+" + attack
|
||||
+ " "
|
||||
+ StatCollector.translateToLocalFormatted("attribute.name.generic.attackDamage"));
|
||||
list.add(
|
||||
"\u00A79+" + tags.getCompoundTag("InfiTool").getInteger("Attack")
|
||||
+ " "
|
||||
+ StatCollector.translateToLocalFormatted("attribute.name.ammo.attackDamage"));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,18 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.*;
|
||||
import tconstruct.tools.logic.EquipLogic;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class BattleSign extends Weapon {
|
||||
|
||||
public BattleSign() {
|
||||
super(1);
|
||||
this.setUnlocalizedName("InfiTool.Battlesign");
|
||||
@@ -68,17 +70,8 @@ public class BattleSign extends Weapon {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float clickX,
|
||||
float clickY,
|
||||
float clickZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float clickX, float clickY, float clickZ) {
|
||||
if (side == 0 || !player.isSneaking()) {
|
||||
return false;
|
||||
} else if (!world.getBlock(x, y, z).getMaterial().isSolid()) {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mods.battlegear2.api.PlayerEventChild;
|
||||
import mods.battlegear2.api.weapons.IBattlegearWeapon;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
@@ -19,15 +17,19 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import tconstruct.library.tools.AOEHarvestTool;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.weapons.IBattlegearWeapon"),
|
||||
@Optional.Interface(modid = "ZeldaItemAPI", iface = "zeldaswordskills.api.item.ISword")
|
||||
})
|
||||
@Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.weapons.IBattlegearWeapon"),
|
||||
@Optional.Interface(modid = "ZeldaItemAPI", iface = "zeldaswordskills.api.item.ISword") })
|
||||
public class Battleaxe extends AOEHarvestTool implements IBattlegearWeapon {
|
||||
|
||||
public Battleaxe() {
|
||||
super(4, 1, 1);
|
||||
this.setUnlocalizedName("InfiTool.Battleaxe");
|
||||
@@ -44,14 +46,14 @@ public class Battleaxe extends AOEHarvestTool implements IBattlegearWeapon {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(
|
||||
ItemStack itemstack, World world, Block b, int x, int y, int z, EntityLivingBase player) {
|
||||
public boolean onBlockDestroyed(ItemStack itemstack, World world, Block b, int x, int y, int z,
|
||||
EntityLivingBase player) {
|
||||
if (b != null && b.getMaterial() == Material.leaves) return false;
|
||||
|
||||
return AbilityHelper.onBlockChanged(itemstack, world, b, x, y, z, player, random);
|
||||
}
|
||||
|
||||
static Material[] materials = {Material.wood, Material.vine, Material.circuits, Material.cactus, Material.gourd};
|
||||
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus, Material.gourd };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem() {
|
||||
@@ -128,23 +130,14 @@ public class Battleaxe extends AOEHarvestTool implements IBattlegearWeapon {
|
||||
|
||||
@Override
|
||||
public String[] getTraits() {
|
||||
return new String[] {"weapon", "harvest", "melee", "slicing"};
|
||||
return new String[] { "weapon", "harvest", "melee", "slicing" };
|
||||
}
|
||||
|
||||
/* Battleaxe Specific */
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float clickX,
|
||||
float clickY,
|
||||
float clickZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float clickX, float clickY, float clickZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -239,8 +232,8 @@ public class Battleaxe extends AOEHarvestTool implements IBattlegearWeapon {
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "battlegear2")
|
||||
public boolean offhandAttackEntity(
|
||||
PlayerEventChild.OffhandAttackEvent event, ItemStack mainhandItem, ItemStack offhandItem) {
|
||||
public boolean offhandAttackEntity(PlayerEventChild.OffhandAttackEvent event, ItemStack mainhandItem,
|
||||
ItemStack offhandItem) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -267,9 +260,8 @@ public class Battleaxe extends AOEHarvestTool implements IBattlegearWeapon {
|
||||
public boolean allowOffhand(ItemStack mainhand, ItemStack offhand) {
|
||||
if (offhand == null) return true;
|
||||
|
||||
return (mainhand != null
|
||||
&& mainhand.getItem() != TinkerTools.cleaver
|
||||
&& mainhand.getItem() != TinkerTools.battleaxe)
|
||||
return (mainhand != null && mainhand.getItem() != TinkerTools.cleaver
|
||||
&& mainhand.getItem() != TinkerTools.battleaxe)
|
||||
&& (offhand.getItem() != TinkerTools.cleaver && offhand.getItem() != TinkerTools.battleaxe);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
@@ -12,6 +13,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.*;
|
||||
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.*;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
@@ -20,6 +22,7 @@ import tconstruct.util.config.PHConstruct;
|
||||
|
||||
@Deprecated
|
||||
public abstract class BowBase extends ToolCore {
|
||||
|
||||
public BowBase() {
|
||||
super(0);
|
||||
}
|
||||
@@ -106,7 +109,10 @@ public abstract class BowBase extends ToolCore {
|
||||
AbilityHelper.damageTool(stack, 1, player, false);
|
||||
}
|
||||
world.playSoundAtEntity(
|
||||
player, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + speedBase * 0.5F);
|
||||
player,
|
||||
"random.bow",
|
||||
1.0F,
|
||||
1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + speedBase * 0.5F);
|
||||
|
||||
if (creative) {
|
||||
arrowEntity.canBePickedUp = 2;
|
||||
@@ -148,8 +154,7 @@ public abstract class BowBase extends ToolCore {
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the action that specifies what animation to play when the items
|
||||
* is being used
|
||||
* returns the action that specifies what animation to play when the items is being used
|
||||
*/
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
@@ -157,8 +162,7 @@ public abstract class BowBase extends ToolCore {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is
|
||||
* pressed. Args: itemStack, world, entityPlayer
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer player) {
|
||||
@@ -171,8 +175,7 @@ public abstract class BowBase extends ToolCore {
|
||||
return event.result;
|
||||
}
|
||||
|
||||
if (player.capabilities.isCreativeMode
|
||||
|| player.inventory.hasItemStack(new ItemStack(Items.arrow))
|
||||
if (player.capabilities.isCreativeMode || player.inventory.hasItemStack(new ItemStack(Items.arrow))
|
||||
|| player.inventory.hasItemStack(new ItemStack(TinkerTools.arrow))) {
|
||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||
}
|
||||
@@ -188,34 +191,34 @@ public abstract class BowBase extends ToolCore {
|
||||
super.registerIcons(iconRegister);
|
||||
if (PHConstruct.minimalTextures) {
|
||||
headIcons1.clear();
|
||||
headIcons1.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(0) + "_1"));
|
||||
headIcons1
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(0) + "_1"));
|
||||
handleIcons1.clear();
|
||||
handleIcons1.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(2) + "_1"));
|
||||
handleIcons1
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(2) + "_1"));
|
||||
accessoryIcons1.clear();
|
||||
accessoryIcons1.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(3) + "_1"));
|
||||
accessoryIcons1
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(3) + "_1"));
|
||||
|
||||
headIcons2.clear();
|
||||
headIcons2.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(0) + "_2"));
|
||||
headIcons2
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(0) + "_2"));
|
||||
handleIcons2.clear();
|
||||
handleIcons2.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(2) + "_2"));
|
||||
handleIcons2
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(2) + "_2"));
|
||||
accessoryIcons2.clear();
|
||||
accessoryIcons2.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(3) + "_2"));
|
||||
accessoryIcons2
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(3) + "_2"));
|
||||
|
||||
headIcons3.clear();
|
||||
headIcons3.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(0) + "_3"));
|
||||
headIcons3
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(0) + "_3"));
|
||||
handleIcons3.clear();
|
||||
handleIcons3.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(2) + "_3"));
|
||||
handleIcons3
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(2) + "_3"));
|
||||
accessoryIcons3.clear();
|
||||
accessoryIcons3.put(
|
||||
-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(3) + "_3"));
|
||||
accessoryIcons3
|
||||
.put(-1, iconRegister.registerIcon("tinker:" + getDefaultFolder() + "/" + getIconSuffix(3) + "_3"));
|
||||
|
||||
// effect icons
|
||||
effectIcons1.clear();
|
||||
@@ -233,8 +236,7 @@ public abstract class BowBase extends ToolCore {
|
||||
accessoryIcons1.clear();
|
||||
extraIcons1.clear();
|
||||
effectIcons1.clear();
|
||||
Iterator<Map.Entry<Integer, String>> iterOne =
|
||||
headStrings.entrySet().iterator();
|
||||
Iterator<Map.Entry<Integer, String>> iterOne = headStrings.entrySet().iterator();
|
||||
while (iterOne.hasNext()) {
|
||||
Map.Entry<Integer, String> pairs = iterOne.next();
|
||||
headIcons1.put(pairs.getKey(), iconRegister.registerIcon(pairs.getValue() + "_1"));
|
||||
@@ -273,8 +275,7 @@ public abstract class BowBase extends ToolCore {
|
||||
accessoryIcons2.clear();
|
||||
extraIcons2.clear();
|
||||
effectIcons2.clear();
|
||||
Iterator<Map.Entry<Integer, String>> iterTwo =
|
||||
headStrings.entrySet().iterator();
|
||||
Iterator<Map.Entry<Integer, String>> iterTwo = headStrings.entrySet().iterator();
|
||||
while (iterTwo.hasNext()) {
|
||||
Map.Entry<Integer, String> pairs = iterTwo.next();
|
||||
headIcons2.put(pairs.getKey(), iconRegister.registerIcon(pairs.getValue() + "_2"));
|
||||
@@ -313,8 +314,7 @@ public abstract class BowBase extends ToolCore {
|
||||
accessoryIcons3.clear();
|
||||
extraIcons3.clear();
|
||||
effectIcons3.clear();
|
||||
Iterator<Map.Entry<Integer, String>> iterThree =
|
||||
headStrings.entrySet().iterator();
|
||||
Iterator<Map.Entry<Integer, String>> iterThree = headStrings.entrySet().iterator();
|
||||
while (iterThree.hasNext()) {
|
||||
Map.Entry<Integer, String> pairs = iterThree.next();
|
||||
headIcons3.put(pairs.getKey(), iconRegister.registerIcon(pairs.getValue() + "_3"));
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class Broadsword extends Weapon {
|
||||
|
||||
public Broadsword() {
|
||||
super(4);
|
||||
this.setUnlocalizedName("InfiTool.Broadsword");
|
||||
@@ -53,13 +55,9 @@ public class Broadsword extends Weapon {
|
||||
|
||||
/*
|
||||
* @Override
|
||||
*
|
||||
* @SideOnly(Side.CLIENT) public void onUpdate (ItemStack stack, World
|
||||
* world, Entity entity, int par4, boolean par5) { super.onUpdate(stack,
|
||||
* world, entity, par4, par5); if (entity instanceof EntityPlayerSP) {
|
||||
* EntityPlayerSP player = (EntityPlayerSP) entity; if (player.itemInUse !=
|
||||
* null && player.itemInUse.getItem() == this) {
|
||||
* player.movementInput.moveForward *= 5.0F; player.movementInput.moveStrafe
|
||||
* *= 5.0F; } } }
|
||||
* @SideOnly(Side.CLIENT) public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
|
||||
* { super.onUpdate(stack, world, entity, par4, par5); if (entity instanceof EntityPlayerSP) { EntityPlayerSP player
|
||||
* = (EntityPlayerSP) entity; if (player.itemInUse != null && player.itemInUse.getItem() == this) {
|
||||
* player.movementInput.moveForward *= 5.0F; player.movementInput.moveStrafe *= 5.0F; } } }
|
||||
*/
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -10,12 +9,15 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.crafting.Detailing.DetailInput;
|
||||
import tconstruct.library.tools.*;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
public class Chisel extends ToolCore {
|
||||
|
||||
public Chisel() {
|
||||
super(0);
|
||||
this.setUnlocalizedName("InfiTool.Chisel");
|
||||
@@ -49,17 +51,8 @@ public class Chisel extends ToolCore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int side,
|
||||
float clickX,
|
||||
float clickY,
|
||||
float clickZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float clickX, float clickY, float clickZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -188,6 +181,6 @@ public class Chisel extends ToolCore {
|
||||
|
||||
@Override
|
||||
public String[] getTraits() {
|
||||
return new String[] {"utility"};
|
||||
return new String[] { "utility" };
|
||||
}
|
||||
}
|
||||
Loaded 100 of 561 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user