| @@ -1,19 +1,19 @@ | ||
| package com.mcmoddev.poweradvantage3; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.init.ModItems; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
|
|
||
| public class PowerAdvantageTab extends CreativeTabs { | ||
|
|
||
| public static PowerAdvantageTab TAB = new PowerAdvantageTab(); | ||
|
|
||
| public PowerAdvantageTab() { | ||
| super("poweradvantage3.name"); | ||
| } | ||
|
|
||
| @Override | ||
| public Item getTabIconItem() { | ||
| return ModItems.WRENCH; | ||
| } | ||
| } |
| @@ -0,0 +1,48 @@ | ||
| package com.mcmoddev.poweradvantage3; | ||
|
|
||
| import net.minecraft.item.EnumDyeColor; | ||
| import net.minecraft.util.IStringSerializable; | ||
| import net.minecraft.util.text.TextFormatting; | ||
|
|
||
| public class Tier { | ||
|
|
||
|
|
||
| public enum BaseTier implements IStringSerializable { | ||
| BASIC(EnumDyeColor.LIME, TextFormatting.GREEN); | ||
|
|
||
| public EnumDyeColor dyeColor; | ||
| public TextFormatting textFormatting; | ||
|
|
||
| BaseTier(EnumDyeColor dyeColor, TextFormatting textFormatting) { | ||
| this.dyeColor = dyeColor; | ||
| this.textFormatting = textFormatting; | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return name().toLowerCase(); | ||
| } | ||
| } | ||
|
|
||
| public enum FluidPipeTier implements ITier { | ||
| BASIC(1000,100) | ||
| ; | ||
|
|
||
| public int pipeCapacity; | ||
| public int pipePullAmount; | ||
|
|
||
| FluidPipeTier(int pipeCapacity, int pipePullAmount) { | ||
| this.pipeCapacity = pipeCapacity; | ||
| this.pipePullAmount = pipePullAmount; | ||
| } | ||
|
|
||
| @Override | ||
| public BaseTier getBaseTier() { | ||
| return BaseTier.values()[ordinal()]; | ||
| } | ||
| } | ||
|
|
||
| public interface ITier { | ||
| BaseTier getBaseTier(); | ||
| } | ||
| } |
| @@ -0,0 +1,14 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| import com.google.common.collect.Sets; | ||
| import net.minecraft.world.World; | ||
|
|
||
| import java.util.LinkedHashSet; | ||
|
|
||
| public class BaseNetwork<ACC, NET extends BaseNetwork<ACC,NET>> { | ||
| public LinkedHashSet<ITileTransmitter<ACC, NET>> transmitters = Sets.newLinkedHashSet(); | ||
|
|
||
| protected World worldObj = null; | ||
|
|
||
|
|
||
| } |
| @@ -0,0 +1,7 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| import net.minecraftforge.fluids.FluidStack; | ||
|
|
||
| public class FluidNetwork extends BaseNetwork<FluidStack,FluidNetwork> { | ||
|
|
||
| } |
| @@ -1,11 +1,11 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| import net.minecraft.item.EnumDyeColor; | ||
| import net.minecraft.util.math.BlockPos; | ||
| import net.minecraft.world.IBlockAccess; | ||
|
|
||
| public interface IPaintable { | ||
| EnumDyeColor getColor(IBlockAccess world, BlockPos pos); | ||
|
|
||
| void setColor(EnumDyeColor color, IBlockAccess world, BlockPos pos); | ||
| } |
| @@ -1,10 +1,8 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| import net.minecraft.item.EnumDyeColor; | ||
| import net.minecraft.item.ItemStack; | ||
|
|
||
| public interface IPaintableItem { | ||
| EnumDyeColor getColor(ItemStack stack); | ||
| } |
| @@ -0,0 +1,5 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| public interface ITileTransmitter<ACC, NET extends BaseNetwork<ACC,NET>> extends ITransmitter { | ||
|
|
||
| } |
| @@ -0,0 +1,5 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| public interface ITransmitter { | ||
| NetType getType(); | ||
| } |
| @@ -0,0 +1,4 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| public interface IWrenchable { | ||
| } |
| @@ -0,0 +1,10 @@ | ||
| package com.mcmoddev.poweradvantage3.api; | ||
|
|
||
| public enum NetType { | ||
| ENERGY, | ||
| ITEM, | ||
| FLUID, | ||
| GAS | ||
|
|
||
| ; | ||
| } |
| @@ -1,45 +1,45 @@ | ||
| package com.mcmoddev.poweradvantage3.block; | ||
|
|
||
| import com.mcmoddev.lib.util.TileHelper; | ||
| import com.mcmoddev.poweradvantage3.tile.TileConveyor; | ||
| import net.minecraft.block.Block; | ||
| import net.minecraft.block.material.Material; | ||
| import net.minecraft.block.properties.PropertyBool; | ||
| import net.minecraft.block.properties.PropertyDirection; | ||
| import net.minecraft.block.state.BlockStateContainer; | ||
| import net.minecraft.block.state.IBlockState; | ||
| import net.minecraft.util.EnumFacing; | ||
| import net.minecraft.util.math.BlockPos; | ||
| import net.minecraft.world.IBlockAccess; | ||
|
|
||
| public class BlockConveyor extends Block { | ||
|
|
||
| public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); | ||
| public static final PropertyBool SIDE_L = PropertyBool.create("side_l"); | ||
| public static final PropertyBool SIDE_R = PropertyBool.create("side_r"); | ||
|
|
||
| public BlockConveyor() { | ||
| super(Material.IRON); | ||
| setDefaultState(blockState.getBaseState() | ||
| .withProperty(FACING, EnumFacing.NORTH) | ||
| .withProperty(SIDE_L, true) | ||
| .withProperty(SIDE_R, true) | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| protected BlockStateContainer createBlockState() { | ||
| return new BlockStateContainer(this, FACING, SIDE_L, SIDE_R); | ||
| } | ||
|
|
||
| @Override | ||
| public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { | ||
| TileConveyor tile = TileHelper.getTileEntity(worldIn, pos, TileConveyor.class); | ||
| if (tile == null) | ||
| return getDefaultState(); | ||
| return state | ||
| .withProperty(FACING, tile.getFacing()) | ||
| .withProperty(SIDE_L, tile.connectedLeft()) | ||
| .withProperty(SIDE_R, tile.connectedRight()); | ||
| } | ||
| } |
| @@ -1,50 +1,50 @@ | ||
| package com.mcmoddev.poweradvantage3.block; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageTab; | ||
| import net.minecraft.block.Block; | ||
| import net.minecraft.block.material.Material; | ||
| import net.minecraft.block.properties.PropertyDirection; | ||
| import net.minecraft.block.state.BlockStateContainer; | ||
| import net.minecraft.block.state.IBlockState; | ||
| import net.minecraft.entity.EntityLivingBase; | ||
| import net.minecraft.item.ItemBlock; | ||
| import net.minecraft.util.EnumFacing; | ||
| import net.minecraft.util.math.BlockPos; | ||
| import net.minecraft.world.World; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
|
|
||
| public class BlockPneumaticController extends Block { | ||
| public static final PropertyDirection FACING = PropertyDirection.create("facing"); | ||
|
|
||
| public BlockPneumaticController() { | ||
| super(Material.IRON); | ||
| setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); | ||
| setUnlocalizedName("poweradvantage3.pneumatic_controller"); | ||
| setRegistryName("pneumatic_controller"); | ||
| setCreativeTab(PowerAdvantageTab.TAB); | ||
| GameRegistry.register(this); | ||
| GameRegistry.register(new ItemBlock(this).setHasSubtypes(true).setRegistryName(getRegistryName())); | ||
| } | ||
|
|
||
| @Override | ||
| public IBlockState getStateFromMeta(int meta) { | ||
| return getDefaultState().withProperty(FACING, EnumFacing.getFront(meta)); | ||
| } | ||
|
|
||
| @Override | ||
| public int getMetaFromState(IBlockState state) { | ||
| return state.getValue(FACING).getIndex(); | ||
| } | ||
|
|
||
| @Override | ||
| protected BlockStateContainer createBlockState() { | ||
| return new BlockStateContainer(this, FACING); | ||
| } | ||
|
|
||
| @Override | ||
| public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { | ||
| if (placer.isSneaking()) | ||
| return getDefaultState().withProperty(FACING, facing); | ||
| return getDefaultState().withProperty(FACING, facing.getOpposite()); | ||
| } | ||
| } |
| @@ -1,195 +1,195 @@ | ||
| package com.mcmoddev.poweradvantage3.block; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageTab; | ||
| import net.minecraft.block.Block; | ||
| import net.minecraft.block.material.Material; | ||
| import net.minecraft.block.properties.PropertyEnum; | ||
| import net.minecraft.block.state.BlockStateContainer; | ||
| import net.minecraft.block.state.IBlockState; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.entity.Entity; | ||
| import net.minecraft.entity.EntityLivingBase; | ||
| import net.minecraft.entity.player.EntityPlayer; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemBlock; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraft.util.*; | ||
| import net.minecraft.util.math.BlockPos; | ||
| import net.minecraft.world.Explosion; | ||
| import net.minecraft.world.IBlockAccess; | ||
| import net.minecraft.world.World; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class BlockScaffolding extends Block { | ||
|
|
||
| public static final PropertyEnum<Type> TYPE = PropertyEnum.create("type", Type.class); | ||
|
|
||
| public BlockScaffolding() { | ||
| super(Material.WOOD); | ||
| setUnlocalizedName("poweradvantage3.scaffolding"); | ||
| setRegistryName("scaffolding"); | ||
| setCreativeTab(PowerAdvantageTab.TAB); | ||
| setDefaultState(blockState.getBaseState().withProperty(TYPE, Type.WOOD)); | ||
| GameRegistry.register(this); | ||
| GameRegistry.register(new ScaffItemBlock(this)); | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) { | ||
| for (Type type : Type.values()) | ||
| list.add(new ItemStack(itemIn, 1, type.ordinal())); | ||
| } | ||
|
|
||
| @Override | ||
| public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { | ||
| super.neighborChanged(state, worldIn, pos, blockIn); | ||
| } | ||
|
|
||
| @Override | ||
| public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { | ||
| return blockState.getValue(TYPE).getResistance(); | ||
| } | ||
|
|
||
| @Override | ||
| public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) { | ||
| return world.getBlockState(pos).getValue(TYPE).getResistance() / 5.0F; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { | ||
| return (state.getValue(TYPE) == Type.IRON && entity instanceof EntityPlayer) || (state.getValue(TYPE) == Type.WOOD); | ||
| } | ||
|
|
||
| @Override | ||
| public Material getMaterial(IBlockState state) { | ||
| return state.getValue(TYPE).getMaterial(); | ||
| } | ||
|
|
||
| @Override | ||
| public IBlockState getStateFromMeta(int meta) { | ||
| return getDefaultState().withProperty(TYPE, Type.get(meta)); | ||
| } | ||
|
|
||
| @Override | ||
| public int getMetaFromState(IBlockState state) { | ||
| return state.getValue(TYPE).ordinal(); | ||
| } | ||
|
|
||
| @Override | ||
| protected BlockStateContainer createBlockState() { | ||
| return new BlockStateContainer(this, TYPE); | ||
| } | ||
|
|
||
| @SideOnly(Side.CLIENT) | ||
| public BlockRenderLayer getBlockLayer() { | ||
| return BlockRenderLayer.CUTOUT; | ||
| } | ||
|
|
||
| public boolean isFullCube(IBlockState state) { | ||
| return false; | ||
| } | ||
|
|
||
| public boolean isOpaqueCube(IBlockState state) { | ||
| return false; | ||
| } | ||
|
|
||
| public enum Type implements IStringSerializable { | ||
| WOOD(Material.WOOD, 2.0F, 4.0F), | ||
| IRON(Material.IRON, 3.0F, 6.0F); | ||
| private final Material material; | ||
| private final float hardness; | ||
| private final float resistance; | ||
|
|
||
| Type(Material material, float hardness, float resistance) { | ||
| this.material = material; | ||
| this.hardness = hardness; | ||
| this.resistance = resistance; | ||
| } | ||
|
|
||
| public static Type get(int i) { | ||
| if (i >= values().length) | ||
| i = 0; | ||
| return values()[i]; | ||
| } | ||
|
|
||
| public Material getMaterial() { | ||
| return material; | ||
| } | ||
|
|
||
| public float getHardness() { | ||
| return hardness; | ||
| } | ||
|
|
||
| public float getResistance() { | ||
| return resistance; | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return name().toLowerCase(); | ||
| } | ||
| } | ||
|
|
||
| public class ScaffItemBlock extends ItemBlock { | ||
| public ScaffItemBlock(Block block) { | ||
| super(block); | ||
| setRegistryName(block.getRegistryName()); | ||
| setHasSubtypes(true); | ||
| } | ||
|
|
||
| @Override | ||
| public int getMetadata(int damage) { | ||
| return damage; | ||
| } | ||
|
|
||
| @Override | ||
| public int getMetadata(ItemStack stack) { | ||
| return super.getMetadata(stack); | ||
| } | ||
|
|
||
| @Override | ||
| public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { | ||
| IBlockState iblockstate = worldIn.getBlockState(pos); | ||
| Block block = iblockstate.getBlock(); | ||
| if (!playerIn.isSneaking() && block == this.block) { | ||
| if (hitY > 0.7) { | ||
| int heightLeft = 255 - pos.getY(); | ||
| for (int i = 0; i < heightLeft; i++) { | ||
| IBlockState uState = worldIn.getBlockState(pos.up(i)); | ||
| if (uState.getBlock().isReplaceable(worldIn, pos.up(i))) { | ||
| worldIn.setBlockState(pos.up(i), this.block.getStateFromMeta(stack.getMetadata())); | ||
| return EnumActionResult.SUCCESS; | ||
| } else if (uState.getBlock() != this.block) | ||
| break; | ||
| } | ||
| } else if (hitY < 0.3) { | ||
| int heightLeft = pos.getY(); | ||
| for (int i = 0; i < heightLeft; i++) { | ||
| IBlockState dState = worldIn.getBlockState(pos.down(i)); | ||
| if (dState.getBlock().isReplaceable(worldIn, pos.down(i))) { | ||
| worldIn.setBlockState(pos.down(i), this.block.getStateFromMeta(stack.getMetadata())); | ||
| return EnumActionResult.SUCCESS; | ||
| } else if (dState.getBlock() != this.block) { | ||
| int heightLeft2 = 255 - pos.getY(); | ||
| for (int i2 = 0; i2 < heightLeft2; i2++) { | ||
| IBlockState uState = worldIn.getBlockState(pos.up(i2)); | ||
| if (uState.getBlock().isReplaceable(worldIn, pos.up(i2))) { | ||
| worldIn.setBlockState(pos.up(i2), this.block.getStateFromMeta(stack.getMetadata())); | ||
| return EnumActionResult.SUCCESS; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
| return super.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ); | ||
| } | ||
| } | ||
|
|
||
| } |
| @@ -1,72 +1,72 @@ | ||
| package com.mcmoddev.poweradvantage3.block; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.tile.TileTank; | ||
| import net.minecraft.block.Block; | ||
| import net.minecraft.block.ITileEntityProvider; | ||
| import net.minecraft.block.material.Material; | ||
| import net.minecraft.block.state.IBlockState; | ||
| import net.minecraft.item.ItemBlock; | ||
| import net.minecraft.tileentity.TileEntity; | ||
| import net.minecraft.util.BlockRenderLayer; | ||
| import net.minecraft.util.EnumBlockRenderType; | ||
| import net.minecraft.util.EnumFacing; | ||
| import net.minecraft.util.math.BlockPos; | ||
| import net.minecraft.world.IBlockAccess; | ||
| import net.minecraft.world.World; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import javax.annotation.Nonnull; | ||
|
|
||
| public class BlockTank extends Block implements ITileEntityProvider { | ||
| public BlockTank() { | ||
| super(Material.GLASS); | ||
| setUnlocalizedName("poweradvantage3.tank"); | ||
| setRegistryName("tank"); | ||
| GameRegistry.register(this); | ||
| GameRegistry.register(new ItemBlock(this).setRegistryName(getRegistryName())); | ||
| GameRegistry.registerTileEntity(TileTank.class, "tank"); | ||
| } | ||
|
|
||
| @Override | ||
| public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) { | ||
| TileEntity te = world.getTileEntity(pos); | ||
| if (te instanceof TileTank && ((TileTank) te).tank.getFluid() != null && ((TileTank) te).tank.getFluidAmount() > 0) | ||
| return ((TileTank) te).tank.getFluid().getFluid().getLuminosity(((TileTank) te).tank.getFluid()); | ||
| return super.getLightValue(state, world, pos); | ||
| } | ||
|
|
||
| @Nonnull | ||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public BlockRenderLayer getBlockLayer() { | ||
| return BlockRenderLayer.CUTOUT_MIPPED; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isBlockNormalCube(IBlockState blockState) { | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isOpaqueCube(IBlockState blockState) { | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| public EnumBlockRenderType getRenderType(IBlockState state) { | ||
| return EnumBlockRenderType.MODEL; | ||
| } | ||
|
|
||
| @Override | ||
| public TileEntity createNewTileEntity(World worldIn, int meta) { | ||
| return new TileTank(); | ||
| } | ||
| } |
| @@ -0,0 +1,4 @@ | ||
| package com.mcmoddev.poweradvantage3.block; | ||
|
|
||
| public class BlockTube { | ||
| } |
| @@ -1,14 +1,14 @@ | ||
| package com.mcmoddev.poweradvantage3.client; | ||
|
|
||
| import net.minecraft.entity.player.EntityPlayer; | ||
| import net.minecraft.inventory.Container; | ||
|
|
||
| public class ContainerManual extends Container { | ||
| public ContainerManual() { | ||
| } | ||
|
|
||
| @Override | ||
| public boolean canInteractWith(EntityPlayer playerIn) { | ||
| return true; | ||
| } | ||
| } |
| @@ -1,74 +1,73 @@ | ||
| package com.mcmoddev.poweradvantage3.client; | ||
|
|
||
| import net.minecraft.client.gui.inventory.GuiContainer; | ||
| import net.minecraft.client.renderer.GlStateManager; | ||
| import net.minecraft.client.renderer.RenderHelper; | ||
| import net.minecraft.init.Blocks; | ||
| import net.minecraft.inventory.Container; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraft.util.ResourceLocation; | ||
| import org.lwjgl.opengl.GL11; | ||
|
|
||
| public class GuiManual extends GuiContainer { | ||
| private static final ResourceLocation CRAFTING = new ResourceLocation("poweradvantage3", "textures/gui/manual/crafting.png"); | ||
| private static final ResourceLocation INVERTED = new ResourceLocation("poweradvantage3", "textures/gui/manual/inverted.png"); | ||
| private static final ResourceLocation NORMAL = new ResourceLocation("poweradvantage3", "textures/gui/manual/normal.png"); | ||
|
|
||
| public GuiManual(Container container) { | ||
| super(container); | ||
| xSize = 292; | ||
| ySize = 180; | ||
| } | ||
|
|
||
| @Override | ||
| public void initGui() { | ||
| super.initGui(); | ||
| } | ||
|
|
||
| @Override | ||
| protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { | ||
| this.mc.getTextureManager().bindTexture(INVERTED); | ||
| drawTexturedModalRect(guiLeft, guiTop, 0, 0, 146, 180); | ||
| this.mc.getTextureManager().bindTexture(NORMAL); | ||
| drawTexturedModalRect(guiLeft + 146, guiTop, 0, 0, 146, 180); | ||
| this.mc.getTextureManager().bindTexture(CRAFTING); | ||
| drawTexturedModalRect(guiLeft + 146, guiTop, 0, 0, 146, 180); | ||
|
|
||
| } | ||
|
|
||
| @Override | ||
| protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { | ||
| super.drawGuiContainerForegroundLayer(mouseX, mouseY); | ||
| String title = "Bedrock Infinite"; | ||
| fontRendererObj.drawString(title, (float) (218 - fontRendererObj.getStringWidth(title) / 2), (float) 18, 0x3B3E4E, false); | ||
|
|
||
| ItemStack stack = new ItemStack(Blocks.BEDROCK); | ||
|
|
||
| drawItem(stack, 210, 32); | ||
|
|
||
| drawItem(stack, 210, 75); | ||
| drawItem(stack, 189, 75); | ||
| drawItem(stack, 231, 75); | ||
|
|
||
| drawItem(stack, 210, 96); | ||
| drawItem(stack, 189, 96); | ||
| drawItem(stack, 231, 96); | ||
|
|
||
| drawItem(stack, 210, 117); | ||
| drawItem(stack, 189, 117); | ||
| drawItem(stack, 231, 117); | ||
| } | ||
|
|
||
| public void drawItem(ItemStack stack, int x, int y) { | ||
| if (stack == null) | ||
| stack = new ItemStack(Blocks.BEDROCK); | ||
| GlStateManager.pushMatrix(); | ||
| GL11.glEnable(GL11.GL_BLEND); | ||
| GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); | ||
| RenderHelper.enableGUIStandardItemLighting(); | ||
| itemRender.renderItemAndEffectIntoGUI(stack, x, y); | ||
| GL11.glDisable(GL11.GL_LIGHTING); | ||
| GlStateManager.popMatrix(); | ||
| } | ||
| } |
| @@ -1,4 +1,4 @@ | ||
| package com.mcmoddev.poweradvantage3.client; | ||
|
|
||
| import com.google.common.base.Charsets; | ||
| import net.minecraft.client.Minecraft; | ||
| @@ -1,11 +1,11 @@ | ||
| package com.mcmoddev.poweradvantage3.client; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.tile.TileTank; | ||
| import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; | ||
|
|
||
| public class TankTESR extends TileEntitySpecialRenderer<TileTank> { | ||
| @Override | ||
| public void renderTileEntityAt(TileTank te, double x, double y, double z, float partialTicks, int destroyStage) { | ||
|
|
||
| } | ||
| } |
| @@ -1,32 +1,32 @@ | ||
| package com.mcmoddev.poweradvantage3.entity; | ||
|
|
||
| import net.minecraft.entity.EntityLivingBase; | ||
| import net.minecraft.entity.projectile.EntityThrowable; | ||
| import net.minecraft.util.math.RayTraceResult; | ||
| import net.minecraft.world.World; | ||
|
|
||
| public class EntityDynamite extends EntityThrowable { | ||
| public EntityDynamite(World worldIn) { | ||
| super(worldIn); | ||
| } | ||
|
|
||
| public EntityDynamite(World worldIn, double x, double y, double z) { | ||
| super(worldIn, x, y, z); | ||
| } | ||
|
|
||
| public EntityDynamite(World worldIn, EntityLivingBase throwerIn) { | ||
| super(worldIn, throwerIn); | ||
| } | ||
|
|
||
| @Override | ||
| protected void onImpact(RayTraceResult result) { | ||
| world.createExplosion(this, | ||
| result.getBlockPos().getX(), | ||
| result.getBlockPos().getY(), | ||
| result.getBlockPos().getZ(), | ||
| 2.0F, | ||
| true | ||
| ); | ||
| this.setDead(); | ||
| } | ||
| } |
| @@ -1,28 +1,28 @@ | ||
| package com.mcmoddev.poweradvantage3.fluid; | ||
|
|
||
| import net.minecraft.block.material.Material; | ||
| import net.minecraft.util.math.BlockPos; | ||
| import net.minecraft.world.IBlockAccess; | ||
| import net.minecraft.world.World; | ||
| import net.minecraftforge.fluids.BlockFluidClassic; | ||
| import net.minecraftforge.fluids.Fluid; | ||
|
|
||
| public class BlockFluidBase extends BlockFluidClassic { | ||
| public BlockFluidBase(Fluid fluid, Material material) { | ||
| super(fluid, material); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean canDisplace(IBlockAccess world, BlockPos pos) { | ||
| if (world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid()) | ||
| return false; | ||
| return super.canDisplace(world, pos); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean displaceIfPossible(World world, BlockPos pos) { | ||
| if (world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid()) | ||
| return false; | ||
| return super.displaceIfPossible(world, pos); | ||
| } | ||
| } |
| @@ -1,13 +1,13 @@ | ||
| package com.mcmoddev.poweradvantage3.fluid; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantage; | ||
| import net.minecraft.block.material.Material; | ||
| import net.minecraftforge.fluids.Fluid; | ||
|
|
||
| public class BlockFluidPowerAdvantage extends BlockFluidBase { | ||
| public BlockFluidPowerAdvantage(Fluid fluid, Material material, String name) { | ||
| super(fluid, material); | ||
| setUnlocalizedName(name); | ||
| PowerAdvantage.PROXY.registerFluidRender(this, name); | ||
| } | ||
| } |
| @@ -1,15 +1,15 @@ | ||
| package com.mcmoddev.poweradvantage3.fluid; | ||
|
|
||
| import net.minecraft.util.ResourceLocation; | ||
| import net.minecraftforge.fluids.Fluid; | ||
| import net.minecraftforge.fluids.FluidRegistry; | ||
|
|
||
| public class PowerAdvantageFluid extends Fluid { | ||
| public PowerAdvantageFluid(String fluidName) { | ||
| super(fluidName, | ||
| new ResourceLocation("poweradvantage3:blocks/fluid/fluid_" + fluidName.replaceFirst("fluid", "") + "_still"), | ||
| new ResourceLocation("poweradvantage3:blocks/fluid/fluid_" + fluidName.replaceFirst("fluid", "") + "_flow") | ||
| ); | ||
| FluidRegistry.addBucketForFluid(this); | ||
| } | ||
| } |
| @@ -1,13 +1,13 @@ | ||
| package com.mcmoddev.poweradvantage3.init; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.block.BlockScaffolding; | ||
| import net.minecraft.block.Block; | ||
|
|
||
| public class ModBlocks { | ||
| public static Block SCAFFOLDING; | ||
| public static Block TUBE; | ||
|
|
||
| public static void register() { | ||
| SCAFFOLDING = new BlockScaffolding(); | ||
| } | ||
| } |
| @@ -1,39 +1,41 @@ | ||
| package com.mcmoddev.poweradvantage3.init; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.fluid.BlockFluidBase; | ||
| import com.mcmoddev.poweradvantage3.fluid.BlockFluidPowerAdvantage; | ||
| import com.mcmoddev.poweradvantage3.fluid.PowerAdvantageFluid; | ||
| import net.minecraft.block.Block; | ||
| import net.minecraft.block.material.Material; | ||
| import net.minecraft.item.ItemBlock; | ||
| import net.minecraftforge.fluids.Fluid; | ||
| import net.minecraftforge.fluids.FluidRegistry; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
|
|
||
| public class ModFluids { | ||
|
|
||
| public static Fluid OIL = new PowerAdvantageFluid("fluidoil"); | ||
| public static BlockFluidBase BLOCK_OIL; | ||
| public static Fluid FUEL = new PowerAdvantageFluid("fluidfuel"); | ||
| public static BlockFluidBase BLOCK_FUEL; | ||
| public static Fluid STEAM = new PowerAdvantageFluid("fluidsteam").setGaseous(true); | ||
| public static BlockFluidBase BLOCK_STEAM; | ||
| public static Fluid OXYGEN = new PowerAdvantageFluid("gasoxygen").setGaseous(true); | ||
| public static BlockFluidBase BLOCK_OXYGEN; | ||
|
|
||
| public static void register() { | ||
| FluidRegistry.registerFluid(OIL); | ||
| BLOCK_OIL = registerBlock(new BlockFluidPowerAdvantage(OIL, Material.WATER, "poweradvantage3.oil"), "poweradvantage3.oil"); | ||
|
|
||
| FluidRegistry.registerFluid(FUEL); | ||
| BLOCK_FUEL = registerBlock(new BlockFluidPowerAdvantage(FUEL, Material.WATER, "poweradvantage3.fuel"), "poweradvantage3.fuel"); | ||
|
|
||
| FluidRegistry.registerFluid(STEAM); | ||
| BLOCK_STEAM = registerBlock(new BlockFluidPowerAdvantage(STEAM, Material.WATER, "poweradvantage3.steam"), "poweradvantage3.steam"); | ||
| } | ||
|
|
||
| public static <T extends Block> T registerBlock(T block, String name) { | ||
| block.setRegistryName(name); | ||
| GameRegistry.register(block); | ||
| GameRegistry.register(new ItemBlock(block), block.getRegistryName()); | ||
| return block; | ||
| } | ||
| } |
| @@ -1,74 +1,76 @@ | ||
| package com.mcmoddev.poweradvantage3.init; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.item.ItemDynamite; | ||
| import com.mcmoddev.poweradvantage3.item.resource.*; | ||
| import com.mcmoddev.poweradvantage3.item.tool.ItemManual; | ||
| import com.mcmoddev.poweradvantage3.item.tool.ItemScrewdriver; | ||
| import com.mcmoddev.poweradvantage3.item.tool.ItemWrench; | ||
| import com.mcmoddev.poweradvantage3.item.tool.gem.*; | ||
| import com.mcmoddev.poweradvantage3.item.tool.paint.ItemPaintbrush; | ||
| import com.mcmoddev.poweradvantage3.item.tool.paint.ItemPaintcan; | ||
| import com.mcmoddev.poweradvantage3.misc.Crystal; | ||
| import net.minecraft.item.Item; | ||
|
|
||
| public class ModItems { | ||
| public static ItemCasing CASING; | ||
| public static ItemPlate PLATE; | ||
| public static ItemDensePlate DENSE_PLATE; | ||
| public static ItemSmallDust SMALLDUST; | ||
| public static ItemCrushed CRUSHED; | ||
| public static ItemPurified PURIFIED; | ||
| public static ItemPaintbrush PAINTBRUSH; | ||
| public static ItemCrystal CRYSTAL; | ||
| public static ItemPaintcan PAINTCAN; | ||
| public static Item WRENCH; | ||
| public static Item SCREWDRIVER; | ||
| public static ItemFluidCell FLUID_CELL; | ||
| public static ItemManual MANUAL; | ||
| public static ItemDynamite DYNAMITE; | ||
|
|
||
| public static GemAxe RUBY_AXE; | ||
| public static GemAxe SAPPHIRE_AXE; | ||
|
|
||
| public static GemPickaxe RUBY_PICKAXE; | ||
| public static GemPickaxe SAPPHIRE_PICKAXE; | ||
|
|
||
| public static GemSword RUBY_SWORD; | ||
| public static GemSword SAPPHIRE_SWORD; | ||
|
|
||
| public static GemHoe RUBY_HOE; | ||
| public static GemHoe SAPPHIRE_HOE; | ||
|
|
||
| public static GemShovel RUBY_SHOVEL; | ||
| public static GemShovel SAPPHIRE_SHOVEL; | ||
|
|
||
| public static void register() { | ||
| MANUAL = new ItemManual(); | ||
| FLUID_CELL = new ItemFluidCell(); | ||
| CASING = new ItemCasing(); | ||
| PLATE = new ItemPlate(); | ||
| DENSE_PLATE = new ItemDensePlate(); | ||
| PAINTBRUSH = new ItemPaintbrush(); | ||
| PAINTCAN = new ItemPaintcan(); | ||
| SMALLDUST = new ItemSmallDust(); | ||
| CRUSHED = new ItemCrushed(); | ||
| PURIFIED = new ItemPurified(); | ||
| WRENCH = new ItemWrench(); | ||
| CRYSTAL = new ItemCrystal(); | ||
| SCREWDRIVER = new ItemScrewdriver(); | ||
| DYNAMITE = new ItemDynamite(); | ||
|
|
||
| RUBY_AXE = new GemAxe(Crystal.RUBY); | ||
| SAPPHIRE_AXE = new GemAxe(Crystal.SAPPHIRE); | ||
|
|
||
| RUBY_SHOVEL = new GemShovel(Crystal.RUBY); | ||
| SAPPHIRE_SHOVEL = new GemShovel(Crystal.SAPPHIRE); | ||
|
|
||
| RUBY_PICKAXE = new GemPickaxe(Crystal.RUBY); | ||
| SAPPHIRE_PICKAXE = new GemPickaxe(Crystal.SAPPHIRE); | ||
|
|
||
| RUBY_SWORD = new GemSword(Crystal.RUBY); | ||
| SAPPHIRE_SWORD = new GemSword(Crystal.SAPPHIRE); | ||
|
|
||
| RUBY_HOE = new GemHoe(Crystal.RUBY); | ||
| SAPPHIRE_HOE = new GemHoe(Crystal.SAPPHIRE); | ||
| } | ||
| } |
| @@ -0,0 +1,25 @@ | ||
| package com.mcmoddev.poweradvantage3.init; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import com.mcmoddev.poweradvantage3.misc.MaterialType; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.oredict.OreDictionary; | ||
|
|
||
| public class ModOreDicts { | ||
| public static void register() { | ||
| for (Material material : Material.values()) { | ||
| if (material.canBe(MaterialType.CASING)) | ||
| OreDictionary.registerOre("casing" + material.getOreDict(), new ItemStack(ModItems.CASING)); | ||
| if (material.canBe(MaterialType.CRUSHED)) | ||
| OreDictionary.registerOre("crushed" + material.getOreDict(), new ItemStack(ModItems.CRUSHED)); | ||
| if (material.canBe(MaterialType.PURIFIED)) | ||
| OreDictionary.registerOre("crushedPurified" + material.getOreDict(), new ItemStack(ModItems.PURIFIED)); | ||
| if (material.canBe(MaterialType.PLATE)) | ||
| OreDictionary.registerOre("plate" + material.getOreDict(), new ItemStack(ModItems.PLATE)); | ||
| if (material.canBe(MaterialType.DENSE_PLATE)) | ||
| OreDictionary.registerOre("plateDense" + material.getOreDict(), new ItemStack(ModItems.DENSE_PLATE)); | ||
| if (material.canBe(MaterialType.SMALL_DUST)) | ||
| OreDictionary.registerOre("dustTiny" + material.getOreDict(), new ItemStack(ModItems.SMALLDUST)); | ||
| } | ||
| } | ||
| } |
| @@ -1,111 +1,109 @@ | ||
| package com.mcmoddev.poweradvantage3.init; | ||
|
|
||
| import com.mcmoddev.lib.common.MMDLibRegistry; | ||
| import com.mcmoddev.poweradvantage3.block.BlockScaffolding; | ||
| import com.mcmoddev.poweradvantage3.item.ItemDynamite; | ||
| import com.mcmoddev.poweradvantage3.misc.Crystal; | ||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import net.minecraft.block.Block; | ||
| import net.minecraft.client.renderer.block.model.ModelResourceLocation; | ||
| import net.minecraft.item.EnumDyeColor; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraftforge.client.model.ModelLoader; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| @SideOnly(Side.CLIENT) | ||
| public class RegisterJsonModels { | ||
|
|
||
| public static void registerModels() { | ||
| items(); | ||
| blocks(); | ||
| } | ||
|
|
||
| private static void blocks() { | ||
| for (BlockScaffolding.Type type : BlockScaffolding.Type.values()) | ||
| register(ModBlocks.SCAFFOLDING, type.ordinal(), "block/" + type.getName() + "_scaffolding"); | ||
| } | ||
|
|
||
| public static void registerColor() { | ||
| MMDLibRegistry.registerItemColour(ModItems.CASING, ModItems.CASING); | ||
| MMDLibRegistry.registerItemColour(ModItems.DENSE_PLATE, ModItems.DENSE_PLATE); | ||
| MMDLibRegistry.registerItemColour(ModItems.PLATE, ModItems.PLATE); | ||
| MMDLibRegistry.registerItemColour(ModItems.SMALLDUST, ModItems.SMALLDUST); | ||
| MMDLibRegistry.registerItemColour(ModItems.PURIFIED, ModItems.PURIFIED); | ||
| MMDLibRegistry.registerItemColour(ModItems.CRUSHED, ModItems.CRUSHED); | ||
| MMDLibRegistry.registerItemColour(ModItems.PAINTBRUSH, ModItems.PAINTBRUSH); | ||
| MMDLibRegistry.registerItemColour(ModItems.PAINTCAN, ModItems.PAINTCAN); | ||
| MMDLibRegistry.registerItemColour(ModItems.CRYSTAL, ModItems.CRYSTAL); | ||
|
|
||
| MMDLibRegistry.registerItemColour(ModItems.SAPPHIRE_AXE, ModItems.SAPPHIRE_AXE); | ||
| MMDLibRegistry.registerItemColour(ModItems.RUBY_AXE, ModItems.RUBY_AXE); | ||
|
|
||
| MMDLibRegistry.registerItemColour(ModItems.SAPPHIRE_PICKAXE, ModItems.SAPPHIRE_PICKAXE); | ||
| MMDLibRegistry.registerItemColour(ModItems.RUBY_PICKAXE, ModItems.RUBY_PICKAXE); | ||
|
|
||
| MMDLibRegistry.registerItemColour(ModItems.SAPPHIRE_SWORD, ModItems.SAPPHIRE_SWORD); | ||
| MMDLibRegistry.registerItemColour(ModItems.RUBY_SWORD, ModItems.RUBY_SWORD); | ||
|
|
||
| MMDLibRegistry.registerItemColour(ModItems.SAPPHIRE_HOE, ModItems.SAPPHIRE_HOE); | ||
| MMDLibRegistry.registerItemColour(ModItems.RUBY_HOE, ModItems.RUBY_HOE); | ||
|
|
||
| MMDLibRegistry.registerItemColour(ModItems.SAPPHIRE_SHOVEL, ModItems.SAPPHIRE_SHOVEL); | ||
| MMDLibRegistry.registerItemColour(ModItems.RUBY_SHOVEL, ModItems.RUBY_SHOVEL); | ||
| } | ||
|
|
||
| private static void items() { | ||
| register(ModItems.SCREWDRIVER, "tool/screwdriver"); | ||
| register(ModItems.MANUAL, "tool/manual"); | ||
| register(ModItems.WRENCH, "tool/wrench"); | ||
|
|
||
| register(ModItems.SAPPHIRE_AXE, "tool/gem/axe"); | ||
| register(ModItems.RUBY_AXE, "tool/gem/axe"); | ||
| register(ModItems.SAPPHIRE_PICKAXE, "tool/gem/pickaxe"); | ||
| register(ModItems.RUBY_PICKAXE, "tool/gem/pickaxe"); | ||
| register(ModItems.SAPPHIRE_HOE, "tool/gem/hoe"); | ||
| register(ModItems.RUBY_HOE, "tool/gem/hoe"); | ||
| register(ModItems.SAPPHIRE_SWORD, "tool/gem/sword"); | ||
| register(ModItems.RUBY_SWORD, "tool/gem/sword"); | ||
| register(ModItems.SAPPHIRE_SHOVEL, "tool/gem/shovel"); | ||
| register(ModItems.RUBY_SHOVEL, "tool/gem/shovel"); | ||
|
|
||
| for (Crystal material : Crystal.values()) | ||
| register(ModItems.CRYSTAL, material.ordinal(), "resource/crystal"); | ||
| for (Material material : Material.values()) | ||
| register(ModItems.CASING, material.ordinal(), "resource/casing"); | ||
| for (Material material : Material.values()) | ||
| register(ModItems.DENSE_PLATE, material.ordinal(), "resource/dense_plate"); | ||
| for (Material material : Material.values()) | ||
| register(ModItems.PLATE, material.ordinal(), "resource/plate"); | ||
| for (Material material : Material.values()) | ||
| register(ModItems.SMALLDUST, material.ordinal(), "resource/small_dust"); | ||
| for (Material material : Material.values()) | ||
| register(ModItems.CRUSHED, material.ordinal(), "resource/crushed"); | ||
| for (Material material : Material.values()) | ||
| register(ModItems.PURIFIED, material.ordinal(), "resource/purified"); | ||
| for (EnumDyeColor color : EnumDyeColor.values()) | ||
| register(ModItems.PAINTBRUSH, color.getMetadata(), "tool/paintbrush"); | ||
| for (EnumDyeColor color : EnumDyeColor.values()) | ||
| register(ModItems.PAINTCAN, color.getMetadata(), "tool/paintcan"); | ||
| for (ItemDynamite.Type type : ItemDynamite.Type.values()) | ||
| register(ModItems.DYNAMITE, type.ordinal(), "dynamite/" + type.name().toLowerCase()); | ||
| } | ||
|
|
||
| private static void register(Item item, String name) { | ||
| register(item, 0, name); | ||
| } | ||
|
|
||
| private static void register(Item item, int meta, String name) { | ||
| ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation("poweradvantage3:" + name, "inventory")); | ||
| } | ||
|
|
||
| private static void register(Block block, int meta, String name) { | ||
| register(Item.getItemFromBlock(block), meta, name); | ||
| } | ||
|
|
||
| private static void register(Block block, String name) { | ||
| register(block, 0, name); | ||
| } | ||
| } |
| @@ -0,0 +1,9 @@ | ||
| package com.mcmoddev.poweradvantage3.integration.mcmp; | ||
|
|
||
| import net.minecraftforge.fml.common.Loader; | ||
|
|
||
| public class IntegrationMCMP { | ||
| public static boolean isLoaded() { | ||
| return Loader.isModLoaded("mcmultipart"); | ||
| } | ||
| } |
| @@ -0,0 +1,11 @@ | ||
| package com.mcmoddev.poweradvantage3.integration.mcmp; | ||
|
|
||
| import mcmultipart.api.addon.IMCMPAddon; | ||
| import mcmultipart.api.multipart.IMultipartRegistry; | ||
|
|
||
| public class PAMCMPAddon implements IMCMPAddon { | ||
| @Override | ||
| public void registerParts(IMultipartRegistry registry) { | ||
|
|
||
| } | ||
| } |
| @@ -1,64 +1,64 @@ | ||
| package com.mcmoddev.poweradvantage3.item; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.entity.EntityDynamite; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.entity.player.EntityPlayer; | ||
| import net.minecraft.init.SoundEvents; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraft.stats.StatList; | ||
| import net.minecraft.util.ActionResult; | ||
| import net.minecraft.util.EnumActionResult; | ||
| import net.minecraft.util.EnumHand; | ||
| import net.minecraft.util.SoundCategory; | ||
| import net.minecraft.world.World; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemDynamite extends Item { | ||
|
|
||
| public ItemDynamite() { | ||
| setHasSubtypes(true); | ||
| setRegistryName("dynamite"); | ||
| setUnlocalizedName("poweradvantage3.dynamite"); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { | ||
| if (!playerIn.capabilities.isCreativeMode) { | ||
| --itemStackIn.stackSize; | ||
| } | ||
| worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.UI_BUTTON_CLICK, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); | ||
| if (!worldIn.isRemote) { | ||
| EntityDynamite dynamite = new EntityDynamite(worldIn, playerIn); | ||
| dynamite.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F); | ||
| worldIn.spawnEntity(dynamite); | ||
| } | ||
|
|
||
| playerIn.addStat(StatList.getObjectUseStats(this)); | ||
| return ActionResult.newResult(EnumActionResult.SUCCESS, itemStackIn); | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Type type : Type.values()) | ||
| subItems.add(new ItemStack(itemIn, 1, type.ordinal())); | ||
| } | ||
|
|
||
| public enum Type { | ||
| NORMAL, | ||
| FIREY, | ||
| STICKY; | ||
|
|
||
| public static Type byMeta(int meta) { | ||
| if (meta >= values().length) | ||
| meta = 0; | ||
| return values()[meta]; | ||
| } | ||
| } | ||
| } |
| @@ -1,44 +1,44 @@ | ||
| package com.mcmoddev.poweradvantage3.item.resource; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageResourceTab; | ||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import com.mcmoddev.poweradvantage3.misc.MaterialType; | ||
| import net.minecraft.client.renderer.color.IItemColor; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemCasing extends Item implements IItemColor { | ||
| public ItemCasing() { | ||
| setUnlocalizedName("poweradvantage3.casing"); | ||
| setRegistryName("casing"); | ||
| setCreativeTab(PowerAdvantageResourceTab.TAB); | ||
| setHasSubtypes(true); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public String getItemStackDisplayName(ItemStack stack) { | ||
| return Material.getMaterial(stack.getMetadata()).translateServer() + " " + super.getItemStackDisplayName(stack); | ||
| } | ||
|
|
||
| @Override | ||
| public int getColorFromItemstack(ItemStack stack, int tintIndex) { | ||
| if (tintIndex == 0) | ||
| return Material.getMaterial(stack.getMetadata()).getRGB(); | ||
| return 0; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Material material : Material.values()) | ||
| if (material.canBe(MaterialType.CASING)) | ||
| subItems.add(new ItemStack(itemIn, 1, material.ordinal())); | ||
| } | ||
| } |
| @@ -1,44 +1,44 @@ | ||
| package com.mcmoddev.poweradvantage3.item.resource; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageResourceTab; | ||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import com.mcmoddev.poweradvantage3.misc.MaterialType; | ||
| import net.minecraft.client.renderer.color.IItemColor; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemCrushed extends Item implements IItemColor { | ||
| public ItemCrushed() { | ||
| setUnlocalizedName("poweradvantage3.crushed"); | ||
| setRegistryName("crushed"); | ||
| setCreativeTab(PowerAdvantageResourceTab.TAB); | ||
| setHasSubtypes(true); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public String getItemStackDisplayName(ItemStack stack) { | ||
| return String.format(super.getItemStackDisplayName(stack), Material.getMaterial(stack.getMetadata()).translateServer()); | ||
| } | ||
|
|
||
| @Override | ||
| public int getColorFromItemstack(ItemStack stack, int tintIndex) { | ||
| if (tintIndex == 1) | ||
| return Material.getMaterial(stack.getMetadata()).getRGB(); | ||
| return 0xFFFFFF; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Material material : Material.values()) | ||
| if (material.canBe(MaterialType.CRUSHED)) | ||
| subItems.add(new ItemStack(itemIn, 1, material.ordinal())); | ||
| } | ||
| } |
| @@ -1,42 +1,42 @@ | ||
| package com.mcmoddev.poweradvantage3.item.resource; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageResourceTab; | ||
| import com.mcmoddev.poweradvantage3.misc.Crystal; | ||
| import net.minecraft.client.renderer.color.IItemColor; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemCrystal extends Item implements IItemColor { | ||
| public ItemCrystal() { | ||
| setUnlocalizedName("poweradvantage3.crystal"); | ||
| setRegistryName("crystal"); | ||
| setCreativeTab(PowerAdvantageResourceTab.TAB); | ||
| setHasSubtypes(true); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public String getItemStackDisplayName(ItemStack stack) { | ||
| return String.format(super.getItemStackDisplayName(stack), Crystal.getMaterial(stack.getMetadata()).translateServer()); | ||
| } | ||
|
|
||
| @Override | ||
| public int getColorFromItemstack(ItemStack stack, int tintIndex) { | ||
| if (tintIndex == 0) | ||
| return Crystal.getMaterial(stack.getMetadata()).getRGB(); | ||
| return 0xFFFFFF; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Crystal material : Crystal.values()) | ||
| subItems.add(new ItemStack(itemIn, 1, material.ordinal())); | ||
| } | ||
| } |
| @@ -1,44 +1,44 @@ | ||
| package com.mcmoddev.poweradvantage3.item.resource; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageResourceTab; | ||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import com.mcmoddev.poweradvantage3.misc.MaterialType; | ||
| import net.minecraft.client.renderer.color.IItemColor; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemDensePlate extends Item implements IItemColor { | ||
| public ItemDensePlate() { | ||
| setUnlocalizedName("poweradvantage3.denseplate"); | ||
| setRegistryName("denseplate"); | ||
| setCreativeTab(PowerAdvantageResourceTab.TAB); | ||
| setHasSubtypes(true); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public String getItemStackDisplayName(ItemStack stack) { | ||
| return Material.getMaterial(stack.getMetadata()).translateServer() + " " + super.getItemStackDisplayName(stack); | ||
| } | ||
|
|
||
| @Override | ||
| public int getColorFromItemstack(ItemStack stack, int tintIndex) { | ||
| if (tintIndex == 0) | ||
| return Material.getMaterial(stack.getMetadata()).getRGB(); | ||
| return 0; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Material material : Material.values()) | ||
| if (material.canBe(MaterialType.DENSE_PLATE)) | ||
| subItems.add(new ItemStack(itemIn, 1, material.ordinal())); | ||
| } | ||
| } |
| @@ -1,44 +1,44 @@ | ||
| package com.mcmoddev.poweradvantage3.item.resource; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageResourceTab; | ||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import com.mcmoddev.poweradvantage3.misc.MaterialType; | ||
| import net.minecraft.client.renderer.color.IItemColor; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemPlate extends Item implements IItemColor { | ||
| public ItemPlate() { | ||
| setUnlocalizedName("poweradvantage3.plate"); | ||
| setRegistryName("plate"); | ||
| setCreativeTab(PowerAdvantageResourceTab.TAB); | ||
| setHasSubtypes(true); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public String getItemStackDisplayName(ItemStack stack) { | ||
| return Material.getMaterial(stack.getMetadata()).translateServer() + " " + super.getItemStackDisplayName(stack); | ||
| } | ||
|
|
||
| @Override | ||
| public int getColorFromItemstack(ItemStack stack, int tintIndex) { | ||
| if (tintIndex == 0) | ||
| return Material.getMaterial(stack.getMetadata()).getRGB(); | ||
| return 0; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Material material : Material.values()) | ||
| if (material.canBe(MaterialType.PLATE)) | ||
| subItems.add(new ItemStack(itemIn, 1, material.ordinal())); | ||
| } | ||
| } |
| @@ -1,44 +1,44 @@ | ||
| package com.mcmoddev.poweradvantage3.item.resource; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageResourceTab; | ||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import com.mcmoddev.poweradvantage3.misc.MaterialType; | ||
| import net.minecraft.client.renderer.color.IItemColor; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemPurified extends Item implements IItemColor { | ||
| public ItemPurified() { | ||
| setUnlocalizedName("poweradvantage3.purified"); | ||
| setRegistryName("purified"); | ||
| setCreativeTab(PowerAdvantageResourceTab.TAB); | ||
| setHasSubtypes(true); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public String getItemStackDisplayName(ItemStack stack) { | ||
| return String.format(super.getItemStackDisplayName(stack), Material.getMaterial(stack.getMetadata()).translateServer()); | ||
| } | ||
|
|
||
| @Override | ||
| public int getColorFromItemstack(ItemStack stack, int tintIndex) { | ||
| if (tintIndex == 0) | ||
| return Material.getMaterial(stack.getMetadata()).getRGB(); | ||
| return 0xFFFFFF; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Material material : Material.values()) | ||
| if (material.canBe(MaterialType.PURIFIED)) | ||
| subItems.add(new ItemStack(itemIn, 1, material.ordinal())); | ||
| } | ||
| } |
| @@ -1,44 +1,44 @@ | ||
| package com.mcmoddev.poweradvantage3.item.resource; | ||
|
|
||
| import com.mcmoddev.poweradvantage3.PowerAdvantageResourceTab; | ||
| import com.mcmoddev.poweradvantage3.misc.Material; | ||
| import com.mcmoddev.poweradvantage3.misc.MaterialType; | ||
| import net.minecraft.client.renderer.color.IItemColor; | ||
| import net.minecraft.creativetab.CreativeTabs; | ||
| import net.minecraft.item.Item; | ||
| import net.minecraft.item.ItemStack; | ||
| import net.minecraftforge.fml.common.registry.GameRegistry; | ||
| import net.minecraftforge.fml.relauncher.Side; | ||
| import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ItemSmallDust extends Item implements IItemColor { | ||
| public ItemSmallDust() { | ||
| setUnlocalizedName("poweradvantage3.smalldust"); | ||
| setRegistryName("smalldust"); | ||
| setCreativeTab(PowerAdvantageResourceTab.TAB); | ||
| setHasSubtypes(true); | ||
| GameRegistry.register(this); | ||
| } | ||
|
|
||
| @Override | ||
| public String getItemStackDisplayName(ItemStack stack) { | ||
| return String.format(super.getItemStackDisplayName(stack), Material.getMaterial(stack.getMetadata()).translateServer()); | ||
| } | ||
|
|
||
| @Override | ||
| public int getColorFromItemstack(ItemStack stack, int tintIndex) { | ||
| if (tintIndex == 0) | ||
| return Material.getMaterial(stack.getMetadata()).getRGB(); | ||
| return 0; | ||
| } | ||
|
|
||
| @Override | ||
| @SideOnly(Side.CLIENT) | ||
| public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { | ||
| for (Material material : Material.values()) | ||
| if (material.canBe(MaterialType.SMALL_DUST)) | ||
| subItems.add(new ItemStack(itemIn, 1, material.ordinal())); | ||
| } | ||
| } |
| @@ -1,9 +1,9 @@ | ||
| package com.mcmoddev.poweradvantage3.item.tool; | ||
|
|
||
| import net.minecraft.item.ItemAxe; | ||
|
|
||
| public class BaseAxe extends ItemAxe { | ||
| public BaseAxe(ToolMaterial material, float damage, float speed) { | ||
| super(material, damage, speed); | ||
| } | ||
| } |