mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Decorative monocle and panes.
This commit is contained in:
1 parent
228c606237
commit
606917e04b
18 files changed
+243
-14
No files matched your search
@@ -50,6 +50,7 @@ import vazkii.botania.api.wiki.IWikiProvider;
|
||||
import vazkii.botania.api.wiki.WikiHooks;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
@@ -145,10 +146,9 @@ public final class HUDHandler {
|
||||
profiler.endSection();
|
||||
}*/
|
||||
|
||||
ItemStack amulet = PlayerHandler.getPlayerBaubles(mc.thePlayer).getStackInSlot(0);
|
||||
if(amulet != null && amulet.getItem() == ModItems.monocle) {
|
||||
if(Botania.proxy.isClientPlayerWearingMonocle()) {
|
||||
profiler.startSection("monocle");
|
||||
ItemMonocle.renderHUD(event.resolution, mc.thePlayer, amulet);
|
||||
ItemMonocle.renderHUD(event.resolution, mc.thePlayer);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@ import vazkii.botania.common.entity.EntitySpark;
|
||||
import vazkii.botania.common.entity.EntityThornChakram;
|
||||
import vazkii.botania.common.entity.EntityVineBall;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMonocle;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
@@ -348,10 +349,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public boolean isClientPlayerWearingMonocle() {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
|
||||
ItemStack stack = inv.getStackInSlot(0);
|
||||
return stack != null && stack.getItem() instanceof IBurstViewerBauble;
|
||||
return ItemMonocle.hasMonocle(Minecraft.getMinecraft().thePlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,9 @@ import vazkii.botania.common.block.decor.Block18Stone;
|
||||
import vazkii.botania.common.block.decor.BlockPavement;
|
||||
import vazkii.botania.common.block.decor.biomestone.BlockBiomeStoneA;
|
||||
import vazkii.botania.common.block.decor.biomestone.BlockBiomeStoneB;
|
||||
import vazkii.botania.common.block.decor.panes.BlockAlfglassPane;
|
||||
import vazkii.botania.common.block.decor.panes.BlockBifrostPane;
|
||||
import vazkii.botania.common.block.decor.panes.BlockManaglassPane;
|
||||
import vazkii.botania.common.block.decor.quartz.BlockSpecialQuartz;
|
||||
import vazkii.botania.common.block.decor.quartz.BlockSpecialQuartzSlab;
|
||||
import vazkii.botania.common.block.decor.quartz.BlockSpecialQuartzStairs;
|
||||
@@ -183,6 +186,10 @@ public final class ModFluffBlocks {
|
||||
public static Block enderBrickSlab;
|
||||
public static Block enderBrickSlabFull;
|
||||
public static Block enderBrickStairs;
|
||||
|
||||
public static Block managlassPane;
|
||||
public static Block alfglassPane;
|
||||
public static Block bifrostPane;
|
||||
|
||||
public static void init() {
|
||||
livingwoodStairs = new BlockLivingwoodStairs();
|
||||
@@ -309,6 +316,10 @@ public final class ModFluffBlocks {
|
||||
enderBrickSlabFull = new BlockEnderBrickSlab(true);
|
||||
enderBrickStairs = new BlockEnderBrickStairs();
|
||||
|
||||
managlassPane = new BlockManaglassPane();
|
||||
alfglassPane = new BlockAlfglassPane();
|
||||
bifrostPane = new BlockBifrostPane();
|
||||
|
||||
if(ConfigHandler.darkQuartzEnabled) {
|
||||
((BlockModSlab) darkQuartzSlab).register();
|
||||
((BlockModSlab) darkQuartzSlabFull).register();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class BlockElfGlass extends BlockManaGlass implements IElvenItem, ILexico
|
||||
icons = new IIcon[ICON_COUNT];
|
||||
for(int i = 0; i < ICON_COUNT; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
blockIcon = icons[0];
|
||||
blockIcon = IconHelper.forBlock(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Sep 30, 2015, 10:17:02 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.panes;
|
||||
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class BlockAlfglassPane extends BlockModPane {
|
||||
|
||||
public BlockAlfglassPane() {
|
||||
super(ModBlocks.elfGlass);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Sep 30, 2015, 10:18:50 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.panes;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.client.render.block.InterpolatedIcon;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class BlockBifrostPane extends BlockModPane {
|
||||
|
||||
public BlockBifrostPane() {
|
||||
super(ModBlocks.bifrostPerm);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void loadTextures(TextureStitchEvent.Pre event) {
|
||||
if(event.map.getTextureType() == 0) {
|
||||
TextureAtlasSprite icon = new InterpolatedIcon("botania:bifrostPermPane");
|
||||
if(event.map.setTextureEntry("botania:bifrostPermPane", icon))
|
||||
iconTop = icon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Sep 30, 2015, 10:16:46 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.panes;
|
||||
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class BlockManaglassPane extends BlockModPane {
|
||||
|
||||
public BlockManaglassPane() {
|
||||
super(ModBlocks.manaGlass);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Sep 30, 2015, 10:01:17 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.panes;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.block.ItemBlockMod;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPane;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockModPane extends BlockPane {
|
||||
|
||||
Block source;
|
||||
public IIcon iconTop;
|
||||
|
||||
public BlockModPane(Block source) {
|
||||
super("", "", Material.glass, false);
|
||||
this.source = source;
|
||||
setBlockName(source.getUnlocalizedName().replaceAll("tile.", "") + "Pane");
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setHardness(0.3F);
|
||||
setStepSound(soundTypeGlass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
iconTop = IconHelper.forBlock(reg, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 18;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public IIcon func_150097_e() {
|
||||
return source.getIcon(0, 0);
|
||||
}
|
||||
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side >= 2 ? iconTop : source.getIcon(side, meta);
|
||||
}
|
||||
|
||||
public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block == ModBlocks.elfGlass || block == ModBlocks.manaGlass || block == ModBlocks.bifrostPerm || super.canPaneConnectTo(world, x, y, z, dir);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,6 +84,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.openBucket);
|
||||
addItem(ModItems.rainbowRod);
|
||||
addBlock(ModBlocks.bifrostPerm);
|
||||
addBlock(ModFluffBlocks.bifrostPane);
|
||||
addItem(ModItems.tornadoRod);
|
||||
addItem(ModItems.fireRod);
|
||||
addItem(ModItems.smeltRod);
|
||||
@@ -152,8 +153,10 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
|
||||
addBlock(ModBlocks.dreamwood);
|
||||
addBlock(ModBlocks.manaGlass);
|
||||
addBlock(ModFluffBlocks.managlassPane);
|
||||
addBlock(ModBlocks.elfGlass);
|
||||
|
||||
addBlock(ModFluffBlocks.alfglassPane);
|
||||
|
||||
addItem(ModItems.glassPick);
|
||||
addItem(ModItems.manasteelPick);
|
||||
addItem(ModItems.manasteelShovel);
|
||||
|
||||
@@ -2083,6 +2083,11 @@ public final class ModCraftingRecipes {
|
||||
for(int i = 0; i < 4; i++)
|
||||
addWall(ModFluffBlocks.stone, i, ModFluffBlocks.stoneWall, i);
|
||||
|
||||
// Pane Recipes
|
||||
addPane(ModBlocks.manaGlass, ModFluffBlocks.managlassPane);
|
||||
addPane(ModBlocks.elfGlass, ModFluffBlocks.alfglassPane);
|
||||
addPane(ModBlocks.bifrostPerm, ModFluffBlocks.bifrostPane);
|
||||
|
||||
// Biome Stone Recipes
|
||||
for(int i = 0; i < 8; i++) {
|
||||
GameRegistry.addSmelting(new ItemStack(ModFluffBlocks.biomeStoneA, 1, i + 8), new ItemStack(ModFluffBlocks.biomeStoneA, 1, i), 0.1F);
|
||||
@@ -2169,6 +2174,12 @@ public final class ModCraftingRecipes {
|
||||
"BBB", "BBB",
|
||||
'B', new ItemStack(block, 1, blockMeta));
|
||||
}
|
||||
|
||||
private static void addPane(Block block, Block pane) {
|
||||
GameRegistry.addRecipe(new ItemStack(pane, 16),
|
||||
"BBB", "BBB",
|
||||
'B', new ItemStack(block, 1));
|
||||
}
|
||||
|
||||
private static IRecipe addQuartzRecipes(int meta, Item req, Block block, Block stairs, Block slab) {
|
||||
GameRegistry.addRecipe(new ItemStack(block),
|
||||
|
||||
@@ -20,23 +20,25 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityNote;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.item.IBaubleRender;
|
||||
import vazkii.botania.api.item.IBurstViewerBauble;
|
||||
import vazkii.botania.api.item.ICosmeticAttachable;
|
||||
import vazkii.botania.api.item.ICosmeticBauble;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, IBaubleRender {
|
||||
public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosmeticBauble {
|
||||
|
||||
private static final String[] NOTES = new String[] {
|
||||
"F#", "G", "G#", "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#",
|
||||
@@ -71,7 +73,7 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, IBaub
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) {
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
MovingObjectPosition pos = mc.objectMouseOver;
|
||||
if(pos == null)
|
||||
@@ -106,5 +108,25 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, IBaub
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(text, x + 20, y + 4, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public static boolean hasMonocle(EntityPlayer player) {
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ItemStack stack = PlayerHandler.getPlayerBaubles(player).getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
Item item = stack.getItem();
|
||||
if(item instanceof IBurstViewerBauble)
|
||||
return true;
|
||||
|
||||
if(item instanceof ICosmeticAttachable) {
|
||||
ICosmeticAttachable attach = (ICosmeticAttachable) item;
|
||||
ItemStack cosmetic = attach.getCosmeticItem(stack);
|
||||
if(cosmetic != null && cosmetic.getItem() instanceof IBurstViewerBauble)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -934,7 +934,7 @@ public final class LexiconData {
|
||||
judgementCloaks.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeHolyCloak), new PageCraftingRecipe("3", ModCraftingRecipes.recipeUnholyCloak));
|
||||
|
||||
monocle = new BLexiconEntry(LibLexicon.BAUBLE_MONOCLE, categoryBaubles);
|
||||
monocle.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeMonocle));
|
||||
monocle.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeMonocle));
|
||||
|
||||
swapRing = new BLexiconEntry(LibLexicon.BAUBLE_SWAP_RING, categoryBaubles);
|
||||
swapRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeSwapRing));
|
||||
|
||||
Reference in new issue
Block a user