Skip to content

Commit

Permalink
35 errors left
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Feb 3, 2014
1 parent 570eb9c commit 0fe91c2
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 53 deletions.
4 changes: 3 additions & 1 deletion resources/TConstruct_at.cfg
Expand Up @@ -8,6 +8,7 @@ public net.minecraft.entity.projectile.EntityArrow field_145791_d
public net.minecraft.entity.projectile.EntityArrow field_145792_e
public net.minecraft.entity.projectile.EntityArrow field_70254_i
public net.minecraft.entity.projectile.EntityArrow field_70252_j
public net.minecraft.entity.projectile.EntityArrow field_70253_h
public net.minecraft.entity.projectile.EntityArrow field_70257_an
public net.minecraft.entity.projectile.EntityArrow field_70255_ao
public net.minecraft.entity.projectile.EntityArrow field_70256_ap
Expand All @@ -24,9 +25,10 @@ public net.minecraft.block.BlockRailBase$Rail func_150650_a()I
public net.minecraft.client.gui.inventory.GuiContainer field_146999_f
public net.minecraft.client.gui.inventory.GuiContainer field_147009_r
# GuiScreen
public net.minecraft.client.gui.inventory.GuiScreen field_146292_n #buttonList
public net.minecraft.client.gui.GuiScreen field_146292_n #buttonList
# ThreadDownloadImageData
public net.minecraft.client.renderer.ThreadDownloadImageData field_110559_g #field_110559_g
public net.minecraft.client.renderer.ThreadDownloadImageData field_110560_d #field_110560_d
public net.minecraft.potion.PotionEffect field_76460_b

# needs to have a space at the end of every line or SS will derp
3 changes: 2 additions & 1 deletion src/main/java/tconstruct/blocks/SmelteryBlock.java
Expand Up @@ -227,7 +227,7 @@ public boolean func_149727_a (World world, int x, int y, int z, EntityPlayer pla
}

@Override
public TileEntity createTileEntity (World world, int metadata)
public TileEntity func_149915_a (World world, int metadata)
{
switch (metadata)
{
Expand Down Expand Up @@ -304,4 +304,5 @@ public void func_149749_a (World world, int x, int y, int z, Block block, int me
}
super.func_149749_a(world, x, y, z, block, meta);
}

}
3 changes: 2 additions & 1 deletion src/main/java/tconstruct/blocks/slime/SlimeGrass.java
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.util.ForgeDirection;
Expand Down Expand Up @@ -89,7 +90,7 @@ public void func_149666_a (Item b, CreativeTabs tab, List list)
}

@Override
public boolean canSustainPlant (World 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;
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/tconstruct/client/TClientTickHandler.java
Expand Up @@ -27,7 +27,7 @@ public TClientTickHandler()
@SubscribeEvent
public void onTick (ClientTickEvent event)
{

if (event.phase.equals(Phase.END) && event.type.equals(Type.RENDER))
{
TRepo.oreBerry.func_150122_b(Blocks.leaves.field_150121_P);
Expand All @@ -38,10 +38,10 @@ public void onTick (ClientTickEvent event)
}
}

/* @Override
public EnumSet<TickType> ticks ()
{
return EnumSet.of(TickType.RENDER);
}
*/
/* @Override
public EnumSet<TickType> ticks ()
{
return EnumSet.of(TickType.RENDER);
}
*/
}
36 changes: 15 additions & 21 deletions src/main/java/tconstruct/util/TCraftingHandler.java
Expand Up @@ -6,55 +6,49 @@
import tconstruct.library.tools.AbilityHelper;
import tconstruct.util.player.TPlayerStats;
import mantle.common.ComparisonHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;

public class TCraftingHandler implements ICraftingHandler
public class TCraftingHandler //implements ICraftingHandler
{

@Override
public void onCrafting (EntityPlayer player, ItemStack itemstack, IInventory craftMatrix)
@SubscribeEvent
public void onCrafting (ItemCraftedEvent event)//EntityPlayer player, ItemStack itemstack, IInventory craftMatrix)
{
Item item = itemstack.getItem();
if (!player.worldObj.isRemote)
Item item = event.crafting.getItem();
if (!event.player.worldObj.isRemote)
{
if (ComparisonHelper.areEquivalent(item,TRepo.toolStationWood))
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(event.player.getDisplayName());
NBTTagCompound tags = event.player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("materialManual") || !stats.materialManual)
{
stats.materialManual = true;
tags.setBoolean("materialManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.manualBook, 1, 1));
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TRepo.manualBook, 1, 1));
}
}
if (ComparisonHelper.areEquivalent(item,TRepo.smeltery) || ComparisonHelper.areEquivalent(item,TRepo.lavaTank))
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(event.player.getDisplayName());
NBTTagCompound tags = event.player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("smelteryManual") || !stats.smelteryManual)
{
stats.smelteryManual = true;
tags.setBoolean("smelteryManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.manualBook, 1, 2));
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TRepo.manualBook, 1, 2));
}
player.addStat(TAchievements.achievements.get("tconstruct.smelteryMaker"), 1);
event.player.addStat(TAchievements.achievements.get("tconstruct.smelteryMaker"), 1);
}

if (ComparisonHelper.areEquivalent(item,TRepo.craftingStationWood)){
player.addStat(TAchievements.achievements.get("tconstruct.betterCrafting"), 1);
event.player.addStat(TAchievements.achievements.get("tconstruct.betterCrafting"), 1);
}
}
}

@Override
public void onSmelting (EntityPlayer player, ItemStack item)
{
}

}
59 changes: 37 additions & 22 deletions src/main/java/tconstruct/util/player/TPlayerHandler.java
Expand Up @@ -2,11 +2,14 @@

import cpw.mods.fml.common.*;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.relauncher.Side;

import java.io.ByteArrayOutputStream;
import java.lang.ref.WeakReference;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;

import mantle.player.PlayerUtils;
import net.minecraft.entity.*;
import net.minecraft.entity.Entity.EnumEntitySize;
Expand All @@ -22,13 +25,37 @@
import tconstruct.util.config.PHConstruct;
import tconstruct.util.network.packet.PacketDoubleJump;

public class TPlayerHandler implements IPlayerTracker
public class TPlayerHandler
{
/* Player */
//public int hunger;

public ConcurrentHashMap<String, TPlayerStats> playerStats = new ConcurrentHashMap<String, TPlayerStats>();

@Override
@SubscribeEvent
public void PlayerLoggedInEvent (PlayerEvent event)
{
onPlayerLogin(event.player);
}

@SubscribeEvent
public void PlayerLoggedOutEvent (PlayerEvent event)
{
savePlayerStats(event.player, true);
}

@SubscribeEvent
public void onPlayerChangedDimension (PlayerEvent event)
{
savePlayerStats(event.player, false);
}
@SubscribeEvent
public void onPlayerRespawn (PlayerEvent event)
{
onPlayerRespawn(event.player);
}


public void onPlayerLogin (EntityPlayer entityplayer)
{
//TConstruct.logger.info("Player: "+entityplayer);
Expand Down Expand Up @@ -108,9 +135,9 @@ public void onPlayerLogin (EntityPlayer entityplayer)
PHConstruct.gregtech = false;
if (PHConstruct.lavaFortuneInteraction)
{
PlayerUtils.sendChatMessage(entityplayer,"Warning: Cross-mod Exploit Present!");
PlayerUtils.sendChatMessage(entityplayer,"Solution 1: Disable Reverse Smelting recipes from GregTech.");
PlayerUtils.sendChatMessage(entityplayer,"Solution 2: Disable Auto-Smelt/Fortune interaction from TConstruct.");
PlayerUtils.sendChatMessage(entityplayer, "Warning: Cross-mod Exploit Present!");
PlayerUtils.sendChatMessage(entityplayer, "Solution 1: Disable Reverse Smelting recipes from GregTech.");
PlayerUtils.sendChatMessage(entityplayer, "Solution 2: Disable Auto-Smelt/Fortune interaction from TConstruct.");
}
}

Expand All @@ -131,22 +158,11 @@ void updateClientPlayer (ByteArrayOutputStream bos, EntityPlayer player)
PacketDispatcher.sendPacketToPlayer(packet, (Player) player);
*/
//TODO find out what packet needs to be used here (and make sure that player actually is a playerMP and this gets called)
if(player instanceof EntityPlayerMP){
TConstruct.packetPipeline.sendTo(new PacketDoubleJump(), (EntityPlayerMP)player);
}
}

@Override
public void onPlayerLogout (EntityPlayer entityplayer)
{
savePlayerStats(entityplayer, true);
}

@Override
public void onPlayerChangedDimension (EntityPlayer entityplayer)
{
savePlayerStats(entityplayer, false);
//TODO find out what packet needs to be used here (and make sure that player actually is a playerMP and this gets called)
if (player instanceof EntityPlayerMP)
{
TConstruct.packetPipeline.sendTo(new PacketDoubleJump(), (EntityPlayerMP) player);
}
}

void savePlayerStats (EntityPlayer player, boolean clean)
Expand All @@ -169,7 +185,6 @@ void savePlayerStats (EntityPlayer player, boolean clean)
}
}

@Override
public void onPlayerRespawn (EntityPlayer entityplayer)
{
//Boom!
Expand Down

0 comments on commit 0fe91c2

Please sign in to comment.