mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Initial Commit
This commit is contained in:
1 parent
608de3ab70
commit
c2e61a2ef6
4 files changed
+42
-1
No files matched your search
@@ -25,8 +25,10 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import mantle.pulsar.config.ForgeCFG;
|
||||
import mantle.pulsar.control.PulseManager;
|
||||
import tconstruct.api.TConstructAPI;
|
||||
import tconstruct.armor.TinkerArmor;
|
||||
import tconstruct.armor.player.TPlayerHandler;
|
||||
import tconstruct.armor.player.TPlayerStats;
|
||||
import tconstruct.client.TControls;
|
||||
import tconstruct.common.TConstructCreativeTab;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
@@ -170,6 +172,8 @@ public class TConstruct
|
||||
MapGenStructureIO.func_143031_a(ComponentToolWorkshop.class, "TConstruct:ToolWorkshopStructure");
|
||||
MapGenStructureIO.func_143031_a(ComponentSmeltery.class, "TConstruct:SmelteryStructure");
|
||||
}
|
||||
|
||||
TConstructAPI.PROP_NAME=TPlayerStats.PROP_NAME;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package tconstruct.api;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public interface IPlayerExtendedInventoryWrapper
|
||||
{
|
||||
public IInventory getKnapsackInventory(EntityPlayer player);
|
||||
public IInventory getAccessoryInventory(EntityPlayer player);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package tconstruct.api;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class TConstructAPI
|
||||
{
|
||||
public static String PROP_NAME;
|
||||
|
||||
public static IPlayerExtendedInventoryWrapper getInventoryWrapper(EntityPlayer player)
|
||||
{
|
||||
return (IPlayerExtendedInventoryWrapper) player.getExtendedProperties(PROP_NAME);
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,15 @@ package tconstruct.armor.player;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import tconstruct.api.IPlayerExtendedInventoryWrapper;
|
||||
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;
|
||||
|
||||
public class TPlayerStats implements IExtendedEntityProperties //TODO: IExtendedEntityProperties is not appropriate!
|
||||
public class TPlayerStats implements IExtendedEntityProperties, IPlayerExtendedInventoryWrapper //TODO: IExtendedEntityProperties is not appropriate!
|
||||
{
|
||||
public static final String PROP_NAME = "TConstruct";
|
||||
|
||||
@@ -104,4 +106,16 @@ public class TPlayerStats implements IExtendedEntityProperties //TODO: IExtended
|
||||
return (TPlayerStats) player.getExtendedProperties(PROP_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getKnapsackInventory(EntityPlayer player)
|
||||
{
|
||||
return this.knapsack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getAccessoryInventory(EntityPlayer player)
|
||||
{
|
||||
return this.armor;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user