Added the Ender Overseer block.

This commit is contained in:
Lizbeth Rika committed 2014-07-30 14:29:22 +01:00
1 parent 8705c88615
commit 5e4c91b91d
12 files changed
+152 -3

No files matched your search

@@ -0,0 +1,72 @@
/**
* 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 a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 30, 2014, 1:05:07 PM (GMT)]
*/
package vazkii.botania.common.block;
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.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.tile.TileEnderEye;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockEnderEye extends BlockModContainer implements ILexiconable {
IIcon iconOff, iconOn;
protected BlockEnderEye() {
super(Material.iron);
setHardness(3F);
setResistance(10F);
setStepSound(soundTypeMetal);
setBlockName(LibBlockNames.ENDER_EYE_BLOCK);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
iconOff = IconHelper.forBlock(par1IconRegister, this, 0);
iconOn = IconHelper.forBlock(par1IconRegister, this, 1);
}
@Override
public IIcon getIcon(int side, int meta) {
return meta == 0 ? iconOff : iconOn;
}
@Override
public boolean canProvidePower() {
return true;
}
@Override
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
return world.getBlockMetadata(x, y, z);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEnderEye();
}
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.enderEyeBlock;
}
}
@@ -102,6 +102,7 @@ import vazkii.botania.common.block.tile.TileAltar;
import vazkii.botania.common.block.tile.TileBifrost;
import vazkii.botania.common.block.tile.TileCraftCrate;
import vazkii.botania.common.block.tile.TileEnchanter;
import vazkii.botania.common.block.tile.TileEnderEye;
import vazkii.botania.common.block.tile.TileForestEye;
import vazkii.botania.common.block.tile.TileManaBeacon;
import vazkii.botania.common.block.tile.TileMiniIsland;
@@ -166,6 +167,7 @@ public final class ModBlocks {
public static Block reedBlock;
public static Block thatch;
public static Block customBrick;
public static Block enderEye;
public static Block livingwoodStairs;
public static Block livingwoodSlab;
@@ -281,7 +283,8 @@ public final class ModBlocks {
reedBlock = new BlockReeds();
thatch = new BlockThatch();
customBrick = new BlockCustomBrick();
enderEye = new BlockEnderEye();
livingwoodStairs = new BlockLivingwoodStairs();
livingwoodSlab = new BlockLivingwoodSlab(false);
livingwoodSlabFull = new BlockLivingwoodSlab(true);
@@ -456,6 +459,7 @@ public final class ModBlocks {
registerTile(TileMiniIsland.class, LibBlockNames.MINI_ISLAND);
registerTile(TileTinyPotato.class, LibBlockNames.TINY_POTATO);
registerTile(TileSpawnerClaw.class, LibBlockNames.SPAWNER_CLAW);
registerTile(TileEnderEye.class, LibBlockNames.ENDER_EYE_BLOCK);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_PUREDAISY, SubTilePureDaisy.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MANASTAR, SubTileManastar.class);
@@ -0,0 +1,53 @@
/**
* 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 a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 30, 2014, 1:10:34 PM (GMT)]
*/
package vazkii.botania.common.block.tile;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import vazkii.botania.common.item.equipment.tool.ToolCommons;
public class TileEnderEye extends TileMod {
@Override
public void updateEntity() {
if(worldObj.isRemote)
return;
int meta = getBlockMetadata();
int range = 80;
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range, yCoord + range, zCoord + range));
boolean looking = false;
for(EntityPlayer player : players) {
ItemStack helm = player.getCurrentArmor(3);
if(helm != null && helm.getItem() == Item.getItemFromBlock(Blocks.pumpkin))
continue;
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64);
if(pos != null && pos.blockX == xCoord && pos.blockY == yCoord && pos.blockZ == zCoord) {
looking = true;
break;
}
}
int newMeta = looking ? 15 : 0;
if(newMeta != meta)
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
}
}
@@ -77,6 +77,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.vineBall);
addBlock(ModBlocks.forestDrum);
addBlock(ModBlocks.forestEye);
addBlock(ModBlocks.enderEye);
addItem(ModItems.spawnerMover);
addBlock(ModBlocks.spawnerClaw);
@@ -180,6 +180,7 @@ public final class ModCrafingRecipes {
public static IRecipe recipeRoofTile;
public static IRecipe recipeAzulejo;
public static List<IRecipe> recipesAzulejoCycling;
public static IRecipe recipeEnderEyeBlock;
public static void init() {
// Lexicon Recipe
@@ -1108,6 +1109,14 @@ public final class ModCrafingRecipes {
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.customBrick, 1, 4 + (i == 11 ? 0 : i + 1)), new ItemStack(ModBlocks.customBrick, 1, 4 + i));
recipesAzulejoCycling = BotaniaAPI.getLatestAddedRecipes(12);
// Ender Overseer Recipe
GameRegistry.addRecipe(new ItemStack(ModBlocks.enderEye),
"RER", "EOE", "RER",
'R', new ItemStack(Items.redstone),
'E', new ItemStack(Items.ender_eye),
'O', new ItemStack(Blocks.obsidian));
recipeEnderEyeBlock = BotaniaAPI.getLatestAddedRecipe();
// Mana and Terrasteel Block Recipes
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
"III", "III", "III",
@@ -109,8 +109,6 @@ public final class ToolCommons {
float f7 = f4 * f5;
float f8 = f3 * f5;
double d3 = range;
if (player instanceof EntityPlayerMP)
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3);
return world.rayTraceBlocks(vec3, vec31, par3);
}
@@ -117,6 +117,7 @@ public final class LexiconData {
public static LexiconEntry gatherDrum;
public static LexiconEntry spawnerClaw;
public static LexiconEntry craftCrate;
public static LexiconEntry enderEyeBlock;
public static LexiconEntry manaBlaster;
public static LexiconEntry grassSeeds;
@@ -412,6 +413,9 @@ public final class LexiconData {
craftCrate = new ALexiconEntry(LibLexicon.DEVICE_CRAFT_CRATE, categoryDevices);
craftCrate.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipePlaceholder), new PageText("3"), new PageText("4"), new PageImage("5", LibResources.ENTRY_CRAFT_CRATE), new PageCraftingRecipe("6", ModCrafingRecipes.recipeCraftCrate));
enderEyeBlock = new BLexiconEntry(LibLexicon.DEVICE_ENDER_EYE_BLOCK, categoryDevices);
enderEyeBlock.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeEnderEyeBlock));
// TOOLS ENTRIES
manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools);
manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManaBlaster));
@@ -54,6 +54,7 @@ public final class LibBlockNames {
public static final String REED_BLOCK = "reedBlock";
public static final String THATCH = "thatch";
public static final String CUSTOM_BRICK = "customBrick";
public static final String ENDER_EYE_BLOCK = "enderEyeBlock";
public static final String SPECIAL_FLOWER_PREFIX = FLOWER + ".";
@@ -94,6 +94,7 @@ public final class LibLexicon {
public static final String DEVICE_GATHER_DRUM = "gatherDrum";
public static final String DEVICE_SPAWNER_CLAW = "spawnerClaw";
public static final String DEVICE_CRAFT_CRATE = "craftCrate";
public static final String DEVICE_ENDER_EYE_BLOCK = "enderEyeBlock";
public static final String TOOL_MANA_BLASTER = "manaBlaster";
public static final String TOOL_GRASS_SEEDS = "grassSeeds";
+6
View File
@@ -384,6 +384,7 @@ tile.botania:customBrick12.name=Azulejo
tile.botania:customBrick13.name=Azulejo
tile.botania:customBrick14.name=Azulejo
tile.botania:customBrick15.name=Azulejo
tile.botania:enderEyeBlock.name=Ender Overseer
# FLOWER NAMES
tile.botania:flower..name=Botania Flower
@@ -1139,6 +1140,11 @@ botania.page.craftCrate4=Right clicking the crate with a &1Wand of the Forest&0
botania.page.craftCrate5=An example of crafting a &1Diamond Pickaxe&0
botania.page.craftCrate6=Made in Portugal
# -- ENDER OVERSEER
botania.entry.enderEyeBlock=Ender Overseer
botania.page.enderEyeBlock0=The eyes of an &4Enderman&0 have an interesting sensitivity to being watched. A block out of these will simply output a &4redstone signal&0 if a player within a 64 block radius is looking directly at it.<br>Of course, wearing a &1Pumpkin&0 negates this effect.
botania.page.enderEyeBlock1=MY BRAND
# - MYSTICAL INSTRUMENTS
# -- MANA BLASTER
botania.entry.manaBlaster=Mana Blaster
File renamed without changes.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB