mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 20:22:12 +00:00
Added XP obelisk to use / drain liquid XP.
This commit is contained in:
1 parent
adcbb1010b
commit
e75d98ca17
9 files changed
+137
-14
No files matched your search
@@ -104,6 +104,9 @@ import crazypants.enderio.machine.tank.TankItemRenderer;
|
||||
import crazypants.enderio.machine.tank.TileTank;
|
||||
import crazypants.enderio.machine.vacuum.BlockVacuumChest;
|
||||
import crazypants.enderio.machine.vacuum.VacuumChestRenderer;
|
||||
import crazypants.enderio.machine.xp.BlockExperianceObelisk;
|
||||
import crazypants.enderio.machine.xp.ExperienceObliskRenderer;
|
||||
import crazypants.enderio.machine.xp.TileExperianceOblisk;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.FusedQuartzFrameRenderer;
|
||||
import crazypants.enderio.material.FusedQuartzRenderer;
|
||||
@@ -221,13 +224,16 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(attRen);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAttractor.class, attRen);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockAttractor), attRen);
|
||||
|
||||
|
||||
|
||||
SpawnGuardRenderer sgr = new SpawnGuardRenderer();
|
||||
BlockSpawnGuard.renderId = BlockAttractor.renderId;
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnGuard.class, sgr);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockSpawnGuard), sgr);
|
||||
|
||||
|
||||
ExperienceObliskRenderer eor = new ExperienceObliskRenderer();
|
||||
BlockExperianceObelisk.renderId = BlockAttractor.renderId;
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileExperianceOblisk.class, eor);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockExperianceOblisk), eor);
|
||||
|
||||
if(Config.useCombustionGenModel) {
|
||||
CombustionGeneratorModelRenderer cgmr = new CombustionGeneratorModelRenderer();
|
||||
|
||||
@@ -106,6 +106,7 @@ import crazypants.enderio.machine.still.VatRecipeManager;
|
||||
import crazypants.enderio.machine.tank.BlockTank;
|
||||
import crazypants.enderio.machine.vacuum.BlockVacuumChest;
|
||||
import crazypants.enderio.machine.wireless.BlockWirelessCharger;
|
||||
import crazypants.enderio.machine.xp.BlockExperianceObelisk;
|
||||
import crazypants.enderio.machine.xp.ItemXpTransfer;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.BlockDarkIronBars;
|
||||
@@ -208,6 +209,7 @@ public class EnderIO {
|
||||
public static BlockSoulBinder blockSoulFuser;
|
||||
public static BlockAttractor blockAttractor;
|
||||
public static BlockSpawnGuard blockSpawnGuard;
|
||||
public static BlockExperianceObelisk blockExperianceOblisk;
|
||||
|
||||
public static BlockKillerJoe blockKillerJoe;
|
||||
|
||||
@@ -309,6 +311,7 @@ public class EnderIO {
|
||||
blockKillerJoe = BlockKillerJoe.create();
|
||||
blockAttractor = BlockAttractor.create();
|
||||
blockSpawnGuard = BlockSpawnGuard.create();
|
||||
blockExperianceOblisk = BlockExperianceObelisk.create();
|
||||
blockEnchanter = BlockEnchanter.create();
|
||||
|
||||
blockDarkSteelPressurePlate = BlockDarkSteelPressurePlate.create();
|
||||
|
||||
@@ -55,6 +55,7 @@ public enum ModObject {
|
||||
blockSliceAndSplice,
|
||||
blockAttractor,
|
||||
blockSpawnGuard,
|
||||
blockExperienceObelisk,
|
||||
|
||||
blockPoweredSpawner,
|
||||
itemBrokenSpawner,
|
||||
|
||||
@@ -219,6 +219,12 @@ public class MachineRecipes {
|
||||
GameRegistry
|
||||
.addShapedRecipe(aversion, " c ", "ese", "sms", 's', soularium, 'm', machineChassi, 'c', tormentedEnderman, 'e', energeticAlloy);
|
||||
|
||||
//Experience
|
||||
ItemStack xp = new ItemStack(EnderIO.blockExperianceOblisk);
|
||||
ItemStack xpItem = new ItemStack(EnderIO.itemXpTransfer);
|
||||
GameRegistry
|
||||
.addShapedRecipe(aversion, " x ", " s ", "sms", 's', soularium, 'm', machineChassi, 'x', xpItem);
|
||||
|
||||
ClearConfigRecipe inst = new ClearConfigRecipe();
|
||||
MinecraftForge.EVENT_BUS.register(inst);
|
||||
GameRegistry.addRecipe(inst);
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
|
||||
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.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.xp.IHaveExperience;
|
||||
import crazypants.render.IconUtil;
|
||||
|
||||
public class BlockExperianceObelisk extends BlockEio implements IResourceTooltipProvider {
|
||||
|
||||
public static BlockExperianceObelisk create() {
|
||||
BlockExperianceObelisk res = new BlockExperianceObelisk();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
public static int renderId;
|
||||
|
||||
private BlockExperianceObelisk() {
|
||||
super(ModObject.blockExperienceObelisk.unlocalisedName, TileExperianceOblisk.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(ForgeDirection.getOrientation(side) == ForgeDirection.UP){
|
||||
return EnderIO.blockAttractor.getIcon(side,0);
|
||||
}
|
||||
return EnderIO.blockAttractor.getOnIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightOpacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
ItemXpTransfer.onActivated(player, world, x, y - 1, z, side);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.item.skull.BlockEndermanSkull;
|
||||
import crazypants.enderio.machine.attractor.AttractorRenderer;
|
||||
import crazypants.enderio.machine.spawnguard.TileSpawnGuard;
|
||||
|
||||
public class ExperienceObliskRenderer extends AttractorRenderer {
|
||||
|
||||
private ItemStack stack = new ItemStack(EnderIO.itemXpTransfer);
|
||||
|
||||
@Override
|
||||
protected ItemStack getFloatingStack(TileEntity te, double x, double y, double z, float tick) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,6 +43,10 @@ public class ItemXpTransfer extends Item implements IResourceTooltipProvider {
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
|
||||
return onActivated(player, world, x, y, z, side);
|
||||
}
|
||||
|
||||
public static boolean onActivated(EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
if(world.isRemote) {
|
||||
return false;
|
||||
}
|
||||
@@ -67,7 +71,7 @@ public class ItemXpTransfer extends Item implements IResourceTooltipProvider {
|
||||
return res;
|
||||
}
|
||||
|
||||
private boolean tranferFromBlockToPlayer(EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
public static boolean tranferFromBlockToPlayer(EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(!(te instanceof IFluidHandler)) {
|
||||
return false;
|
||||
@@ -94,7 +98,7 @@ public class ItemXpTransfer extends Item implements IResourceTooltipProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean tranferFromPlayerToBlock(EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
public static boolean tranferFromPlayerToBlock(EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
|
||||
if(player.experienceTotal <= 0) {
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileExperianceOblisk extends TileEntity {
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user