mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
Catch up to 1.5, fix heart rendering
This commit is contained in:
1 parent
76d72dfcb1
commit
cfe61da4e3
29 files changed
+386
-779
No files matched your search
@@ -1,10 +1,7 @@
|
||||
package tconstruct.util.player;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@@ -19,12 +16,9 @@ import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.skill.Skill;
|
||||
import tconstruct.skill.SkillRegistry;
|
||||
import tconstruct.util.PHConstruct;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.IPlayerTracker;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -77,10 +71,6 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
}
|
||||
}
|
||||
|
||||
/*stats.skillList = new ArrayList<Skill>();
|
||||
stats.skillList.add(SkillRegistry.getSkill("Wall Building"));*/
|
||||
//stats.armor.recalculateSkills(entityplayer, stats);
|
||||
|
||||
playerStats.put(entityplayer.username, stats);
|
||||
|
||||
if (PHConstruct.gregtech)
|
||||
@@ -94,19 +84,7 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
}
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("GregTech_Addon") || Loader.isModLoaded("GregTech-Addon"))
|
||||
{
|
||||
if (entityplayer.username.equals("GregoriousT") || entityplayer.username.equals("gregorioust"))
|
||||
entityplayer.addChatMessage("Quit being a dick.");
|
||||
else
|
||||
{
|
||||
entityplayer.addChatMessage("\u00A74!!!WARNING!!! \u00A7fGREGTECH PRESENT!! VANILLA MINECRAFT MAY BE IRREPARABLY DAMAGED");
|
||||
entityplayer.addChatMessage("\u00A74!!!WARNING!!! \u00A7fGREGTECH PRESENT!! MODS MAY NOT FUNCTION PROPERLY");
|
||||
}
|
||||
}
|
||||
|
||||
updatePlayerInventory(entityplayer, stats);
|
||||
sendSkills(entityplayer, stats);
|
||||
}
|
||||
|
||||
void updatePlayerInventory (EntityPlayer entityplayer, TPlayerStats stats)
|
||||
@@ -114,32 +92,6 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
|
||||
}
|
||||
|
||||
void sendSkills (EntityPlayer entityplayer, TPlayerStats stats)
|
||||
{
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
List<Skill> skills = stats.skillList;
|
||||
|
||||
try
|
||||
{
|
||||
outputStream.writeByte(1);
|
||||
outputStream.writeInt(skills.size());
|
||||
|
||||
for (Skill skill : stats.skillList)
|
||||
{
|
||||
outputStream.writeInt(skill.getSkillID());
|
||||
outputStream.writeBoolean(skill.getActive());
|
||||
}
|
||||
//outputStream.writeByte(key);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
updateClientPlayer(bos, entityplayer);
|
||||
}
|
||||
|
||||
void updateClientPlayer (ByteArrayOutputStream bos, EntityPlayer player)
|
||||
{
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
@@ -150,19 +102,6 @@ public class TPlayerHandler implements IPlayerTracker
|
||||
PacketDispatcher.sendPacketToPlayer(packet, (Player) player);
|
||||
}
|
||||
|
||||
public void activateSkill (EntityPlayer player, int slot)
|
||||
{
|
||||
TPlayerStats stats = getPlayerStats(player.username);
|
||||
if (stats.skillList.size() > slot)
|
||||
{
|
||||
Skill skill = stats.skillList.get(slot);
|
||||
if (skill != null)
|
||||
{
|
||||
skill.activate(player, player.worldObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerLogout (EntityPlayer entityplayer)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user