Skip to content

Commit

Permalink
fix issue regarding interaction with worksite while on a team. Closes
Browse files Browse the repository at this point in the history
#84  
fix a few code minor formatting areas
add right-click chat output to a waterwheel generator
  • Loading branch information
shadowmage45 committed Sep 16, 2014
1 parent 54df696 commit d3e8117
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraftforge.common.util.ForgeDirection;
import net.shadowmage.ancientwarfare.automation.config.AWAutomationStatics;
import net.shadowmage.ancientwarfare.core.interfaces.IInteractableTile;
Expand Down Expand Up @@ -135,6 +136,13 @@ public boolean canOutput(ForgeDirection towards)
@Override
public boolean onBlockClicked(EntityPlayer player)
{
if(!player.worldObj.isRemote)
{
String key = "guistrings.automation.current_energy";
String value = String.format("%.2f", storedEnergy);
ChatComponentTranslation chat = new ChatComponentTranslation(key, new Object[]{value});
player.addChatComponentMessage(chat);
}
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.shadowmage.ancientwarfare.automation.item.ItemWorksiteUpgrade;
import net.shadowmage.ancientwarfare.core.block.BlockRotationHandler.IRotatableTile;
import net.shadowmage.ancientwarfare.core.config.AWCoreStatics;
import net.shadowmage.ancientwarfare.core.config.AWLog;
import net.shadowmage.ancientwarfare.core.interfaces.IInteractableTile;
import net.shadowmage.ancientwarfare.core.interfaces.IOwnable;
import net.shadowmage.ancientwarfare.core.interfaces.ITorque.ITorqueReceiver;
Expand Down Expand Up @@ -324,7 +325,7 @@ public final Team getTeam()
{
if(owningPlayer!=null)
{
worldObj.getScoreboard().getPlayersTeam(owningPlayer);
return worldObj.getScoreboard().getPlayersTeam(owningPlayer);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ public boolean onBlockClicked(EntityPlayer player)
if(!player.worldObj.isRemote)
{
NetworkHandler.INSTANCE.openGui(player, NetworkHandler.GUI_WORKSITE_ANIMAL_FARM, xCoord, yCoord, zCoord);
return true;
}
return true;
}
Expand Down

0 comments on commit d3e8117

Please sign in to comment.