use of cpw.mods.fml.relauncher.SideOnly in project Armourers-Workshop by RiskyKen.
the class ContainerArmourLibrary method updateSkinName.
@SideOnly(Side.CLIENT)
public void updateSkinName(int slotId) {
Minecraft mc = Minecraft.getMinecraft();
GuiScreen screen = mc.currentScreen;
if (screen != null && screen instanceof GuiSkinLibrary) {
GuiSkinLibrary libScreen = (GuiSkinLibrary) screen;
ItemStack stack = getSlot(36).getStack();
if (stack == null) {
libScreen.setFileName("");
} else {
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(stack);
if (skinPointer != null) {
if (ClientSkinCache.INSTANCE.isSkinInCache(skinPointer)) {
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
String skinName = skin.getCustomName();
if (!StringUtils.isNullOrEmpty(skinName)) {
libScreen.setFileName(skinName);
}
}
}
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project Armourers-Workshop by RiskyKen.
the class AbstractModItemArmour method getArmorModel.
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack stack, int armorSlot) {
if (!SkinNBTHelper.stackHasSkinData(stack)) {
return null;
}
SkinPointer skinData = SkinNBTHelper.getSkinPointerFromStack(stack);
AbstractModelSkin targetModel = null;
SkinModelRenderer emr = SkinModelRenderer.INSTANCE;
Skin data = emr.getCustomArmourItemData(skinData);
if (data == null) {
return null;
}
targetModel = emr.getModelForEquipmentType(data.getSkinType());
if (targetModel == null) {
return null;
}
targetModel.npcSkinData = data;
targetModel.npcDyeData = skinData.getSkinDye();
return targetModel;
}
use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.
the class SearchUpgradeHandler method render2D.
@Override
@SideOnly(Side.CLIENT)
public void render2D(float partialTicks, boolean helmetEnabled) {
ItemStack searchStack = ItemPneumaticArmor.getSearchedStack(FMLClientHandler.instance().getClient().thePlayer.getCurrentArmor(3));
List<String> textList = new ArrayList<String>();
if (searchStack == null) {
textList.add("press '" + Keyboard.getKeyName(KeyHandler.getInstance().keybindOpenOptions.getKeyCode()) + "' to configure");
} else {
textList.add(searchStack.getDisplayName() + " (" + totalSearchedItemCount + " found)");
}
searchInfo.setText(textList);
}
use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.
the class SearchUpgradeHandler method update.
@Override
@SideOnly(Side.CLIENT)
public void update(EntityPlayer player, int rangeUpgrades) {
ticksExisted++;
ItemStack searchStack = ItemPneumaticArmor.getSearchedStack(player.getCurrentArmor(3));
if (ticksExisted % 20 == 0) {
List<EntityItem> items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, EntityTrackUpgradeHandler.getAABBFromRange(player, rangeUpgrades));
searchedItems.clear();
for (EntityItem item : items) {
if (item.getEntityItem() != null && searchStack != null) {
if (item.getEntityItem().isItemEqual(searchStack))
searchedItems.put(item, item.getEntityItem().stackSize);
else {
List<ItemStack> inventoryItems = PneumaticCraftUtils.getStacksInItem(item.getEntityItem());
int itemCount = 0;
for (ItemStack inventoryItem : inventoryItems) {
if (inventoryItem.isItemEqual(searchStack)) {
itemCount += inventoryItem.stackSize;
}
}
if (itemCount > 0)
searchedItems.put(item, itemCount);
}
}
}
totalSearchedItemCount = searchedItemCounter;
searchedItemCounter = 0;
for (Integer itemCount : searchedItems.values()) {
searchedItemCounter += itemCount;
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.
the class CoordTrackUpgradeHandler method navigateToSurface.
@SideOnly(Side.CLIENT)
public EnumNavigationResult navigateToSurface(EntityPlayer player) {
World worldObj = player.worldObj;
int y = worldObj.getHeightValue((int) player.posX, (int) player.posZ);
PathEntity path = worldObj.getEntityPathToXYZ(player, (int) player.posX, y, (int) player.posZ, SEARCH_RANGE, true, true, false, true);
EnumNavigationResult result = path != null ? EnumNavigationResult.EASY_PATH : EnumNavigationResult.DRONE_PATH;
if (path != null) {
for (int i = 0; i < path.getCurrentPathLength(); i++) {
PathPoint pathPoint = path.getPathPointFromIndex(i);
if (worldObj.canBlockSeeTheSky(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)) {
coordTracker = new RenderCoordWireframe(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
navigator = new RenderNavigator(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
return EnumNavigationResult.EASY_PATH;
}
}
}
path = getDronePath(player, (int) player.posX, y, (int) player.posZ);
if (path != null) {
for (int i = 0; i < path.getCurrentPathLength(); i++) {
PathPoint pathPoint = path.getPathPointFromIndex(i);
if (worldObj.canBlockSeeTheSky(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)) {
coordTracker = new RenderCoordWireframe(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
navigator = new RenderNavigator(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
return EnumNavigationResult.DRONE_PATH;
}
}
}
return EnumNavigationResult.NO_PATH;
}
Aggregations