Initial push of the Inversion Pillars - this is before full implementation of features and before fixing the item model.

This commit is contained in:
WayofTime 2016-09-11 10:02:06 -04:00
parent 540e6941ef
commit 5c627d123c
10 changed files with 306 additions and 26 deletions

View file

@ -276,7 +276,8 @@ public class Constants
MASTER_ROUTING_NODE("BlockMasterRoutingNode"), MASTER_ROUTING_NODE("BlockMasterRoutingNode"),
OUTPUT_ROUTING_NODE("BlockOutputRoutingNode"), OUTPUT_ROUTING_NODE("BlockOutputRoutingNode"),
@Deprecated @Deprecated
PEDESTAL("BlockPedestal"), /** No longer included in the mod. */ PEDESTAL("BlockPedestal"),
/** No longer included in the mod. */
PHANTOM("BlockPhantom"), PHANTOM("BlockPhantom"),
RITUAL_CONTROLLER("BlockRitualController"), RITUAL_CONTROLLER("BlockRitualController"),
RITUAL_STONE("BlockRitualStone"), RITUAL_STONE("BlockRitualStone"),
@ -306,7 +307,8 @@ public class Constants
DEMON_STAIRS_2("BlockStairs2"), DEMON_STAIRS_2("BlockStairs2"),
DEMON_STAIRS_3("BlockStairs3"), DEMON_STAIRS_3("BlockStairs3"),
DEMON_LIGHT("BlockDemonLight"), DEMON_LIGHT("BlockDemonLight"),
INVERSION_PILLAR("BlockInversionPillar"); INVERSION_PILLAR("BlockInversionPillar"),
INVERSION_PILLAR_END("BlockInversionPillarEnd");
@Getter @Getter
private final String regName; private final String regName;

View file

@ -5,7 +5,11 @@ import java.util.List;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutablePair;
@ -20,7 +24,7 @@ import WayofTime.bloodmagic.tile.TileInversionPillar;
public class BlockInversionPillar extends BlockStringContainer implements IVariantProvider public class BlockInversionPillar extends BlockStringContainer implements IVariantProvider
{ {
public static final String[] names = { "raw" }; public static final String[] names = { "raw", "corrosive", "destructive", "vengeful", "steadfast" };
public BlockInversionPillar() public BlockInversionPillar()
{ {
@ -34,6 +38,36 @@ public class BlockInversionPillar extends BlockStringContainer implements IVaria
setHarvestLevel("pickaxe", 2); setHarvestLevel("pickaxe", 2);
} }
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
{
return false;
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isVisuallyOpaque()
{
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
@Override @Override
public List<Pair<Integer, String>> getVariants() public List<Pair<Integer, String>> getVariants()
{ {

View file

@ -0,0 +1,75 @@
package WayofTime.bloodmagic.block;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.block.base.BlockString;
import WayofTime.bloodmagic.client.IVariantProvider;
public class BlockInversionPillarEnd extends BlockString implements IVariantProvider
{
public static final String[] names = { "raw_bottom", "raw_top", "corrosive_bottom", "corrosive_top", "destructive_bottom", "destructive_top", "vengeful_bottom", "vengeful_top", "steadfast_bottom", "steadfast_top" };
public BlockInversionPillarEnd()
{
super(Material.ROCK, names);
setUnlocalizedName(Constants.Mod.MODID + ".inversionpillarend.");
setCreativeTab(BloodMagic.tabBloodMagic);
setHardness(2.0F);
setResistance(5.0F);
setSoundType(SoundType.STONE);
setHarvestLevel("pickaxe", 2);
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
{
return false;
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isVisuallyOpaque()
{
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
@Override
public List<Pair<Integer, String>> getVariants()
{
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++)
ret.add(new ImmutablePair<Integer, String>(i, "type=" + names[i]));
return ret;
}
}

View file

@ -129,9 +129,9 @@ public class WorldDemonWillHandler
DemonWillHolder currentWill = willChunk.getCurrentWill(); DemonWillHolder currentWill = willChunk.getCurrentWill();
double fill = Math.min(amount, max - currentWill.getWill(type)); double fill = Math.min(amount, max - currentWill.getWill(type));
if (!doFill) if (!doFill || fill <= 0)
{ {
return fill; return fill > 0 ? fill : 0;
} }
fill = currentWill.addWill(type, amount, max); fill = currentWill.addWill(type, amount, max);

View file

@ -0,0 +1,27 @@
package WayofTime.bloodmagic.item.block;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.block.BlockInversionPillar;
public class ItemBlockInversionPillar extends ItemBlock
{
public ItemBlockInversionPillar(Block block)
{
super(block);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack stack)
{
return super.getUnlocalizedName(stack) + BlockInversionPillar.names[stack.getItemDamage()];
}
@Override
public int getMetadata(int meta)
{
return meta;
}
}

View file

@ -0,0 +1,27 @@
package WayofTime.bloodmagic.item.block;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.block.BlockInversionPillarEnd;
public class ItemBlockInversionPillarEnd extends ItemBlock
{
public ItemBlockInversionPillarEnd(Block block)
{
super(block);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack stack)
{
return super.getUnlocalizedName(stack) + BlockInversionPillarEnd.names[stack.getItemDamage()];
}
@Override
public int getMetadata(int meta)
{
return meta;
}
}

View file

@ -33,6 +33,7 @@ import WayofTime.bloodmagic.block.BlockDimensionalPortal;
import WayofTime.bloodmagic.block.BlockIncenseAltar; import WayofTime.bloodmagic.block.BlockIncenseAltar;
import WayofTime.bloodmagic.block.BlockInputRoutingNode; import WayofTime.bloodmagic.block.BlockInputRoutingNode;
import WayofTime.bloodmagic.block.BlockInversionPillar; import WayofTime.bloodmagic.block.BlockInversionPillar;
import WayofTime.bloodmagic.block.BlockInversionPillarEnd;
import WayofTime.bloodmagic.block.BlockItemRoutingNode; import WayofTime.bloodmagic.block.BlockItemRoutingNode;
import WayofTime.bloodmagic.block.BlockLifeEssence; import WayofTime.bloodmagic.block.BlockLifeEssence;
import WayofTime.bloodmagic.block.BlockMasterRoutingNode; import WayofTime.bloodmagic.block.BlockMasterRoutingNode;
@ -56,6 +57,8 @@ import WayofTime.bloodmagic.item.block.ItemBlockDemonLight;
import WayofTime.bloodmagic.item.block.ItemBlockDemonPillarBase; import WayofTime.bloodmagic.item.block.ItemBlockDemonPillarBase;
import WayofTime.bloodmagic.item.block.ItemBlockDemonPillarCapBase; import WayofTime.bloodmagic.item.block.ItemBlockDemonPillarCapBase;
import WayofTime.bloodmagic.item.block.ItemBlockDemonWallBase; import WayofTime.bloodmagic.item.block.ItemBlockDemonWallBase;
import WayofTime.bloodmagic.item.block.ItemBlockInversionPillar;
import WayofTime.bloodmagic.item.block.ItemBlockInversionPillarEnd;
import WayofTime.bloodmagic.item.block.ItemBlockMimic; import WayofTime.bloodmagic.item.block.ItemBlockMimic;
import WayofTime.bloodmagic.item.block.ItemBlockPath; import WayofTime.bloodmagic.item.block.ItemBlockPath;
import WayofTime.bloodmagic.item.block.ItemBlockRitualController; import WayofTime.bloodmagic.item.block.ItemBlockRitualController;
@ -130,6 +133,7 @@ public class ModBlocks
public static final Block DEMON_STAIRS_2; public static final Block DEMON_STAIRS_2;
public static final Block DEMON_STAIRS_3; public static final Block DEMON_STAIRS_3;
public static final Block INVERSION_PILLAR; public static final Block INVERSION_PILLAR;
public static final Block INVERSION_PILLAR_END;
static static
{ {
@ -167,25 +171,26 @@ public class ModBlocks
MIMIC = registerBlock(new ItemBlockMimic(new BlockMimic()), Constants.BloodMagicBlock.MIMIC.getRegName()); MIMIC = registerBlock(new ItemBlockMimic(new BlockMimic()), Constants.BloodMagicBlock.MIMIC.getRegName());
DEMON_BRICK_1 = registerBlock(new ItemBlockDemonBase(new BlockDemonBase("bricks1", new String[]{"brick1_raw", "brick1_corrosive", "brick1_destructive", "brick1_vengeful", "brick1_steadfast", "brick2_raw", "brick2_corrosive", "brick2_destructive", "brick2_vengeful", "brick2_steadfast", "brick3_raw", "brick3_corrosive", "brick3_destructive", "brick3_vengeful", "brick3_steadfast"})), Constants.BloodMagicBlock.DEMON_BRICK_1.getRegName()); DEMON_BRICK_1 = registerBlock(new ItemBlockDemonBase(new BlockDemonBase("bricks1", new String[] { "brick1_raw", "brick1_corrosive", "brick1_destructive", "brick1_vengeful", "brick1_steadfast", "brick2_raw", "brick2_corrosive", "brick2_destructive", "brick2_vengeful", "brick2_steadfast", "brick3_raw", "brick3_corrosive", "brick3_destructive", "brick3_vengeful", "brick3_steadfast" })), Constants.BloodMagicBlock.DEMON_BRICK_1.getRegName());
DEMON_BRICK_2 = registerBlock(new ItemBlockDemonBase(new BlockDemonBase("bricks2", new String[]{"smallbrick_raw", "smallbrick_corrosive", "smallbrick_destructive", "smallbrick_vengeful", "smallbrick_steadfast", "tile_raw", "tile_corrosive", "tile_destructive", "tile_vengeful", "tile_steadfast", "tilespecial_raw", "tilespecial_corrosive", "tilespecial_destructive", "tilespecial_vengeful", "tilespecial_steadfast"})), Constants.BloodMagicBlock.DEMON_BRICK_2.getRegName()); DEMON_BRICK_2 = registerBlock(new ItemBlockDemonBase(new BlockDemonBase("bricks2", new String[] { "smallbrick_raw", "smallbrick_corrosive", "smallbrick_destructive", "smallbrick_vengeful", "smallbrick_steadfast", "tile_raw", "tile_corrosive", "tile_destructive", "tile_vengeful", "tile_steadfast", "tilespecial_raw", "tilespecial_corrosive", "tilespecial_destructive", "tilespecial_vengeful", "tilespecial_steadfast" })), Constants.BloodMagicBlock.DEMON_BRICK_2.getRegName());
DEMON_EXTRAS = registerBlock(new ItemBlockDemonBase(new BlockDemonBase("extras", new String[]{"stone_raw", "stone_corrosive", "stone_destructive", "stone_vengeful", "stone_steadfast", "polished_raw", "polished_corrosive", "polished_destructive", "polished_vengeful", "polished_steadfast", "metal_raw", "metal_corrosive", "metal_destructive", "metal_vengeful", "metal_steadfast"})), Constants.BloodMagicBlock.DEMON_BLOCK_EXTRA.getRegName()); DEMON_EXTRAS = registerBlock(new ItemBlockDemonBase(new BlockDemonBase("extras", new String[] { "stone_raw", "stone_corrosive", "stone_destructive", "stone_vengeful", "stone_steadfast", "polished_raw", "polished_corrosive", "polished_destructive", "polished_vengeful", "polished_steadfast", "metal_raw", "metal_corrosive", "metal_destructive", "metal_vengeful", "metal_steadfast" })), Constants.BloodMagicBlock.DEMON_BLOCK_EXTRA.getRegName());
DEMON_PILLAR_1 = registerBlock(new ItemBlockDemonPillarBase(new BlockDemonPillarBase("pillar1", Material.ROCK, new String[]{"raw", "corrosive", "destructive", "vengeful", "steadfast"})), Constants.BloodMagicBlock.DEMON_PILLAR_1.getRegName()); DEMON_PILLAR_1 = registerBlock(new ItemBlockDemonPillarBase(new BlockDemonPillarBase("pillar1", Material.ROCK, new String[] { "raw", "corrosive", "destructive", "vengeful", "steadfast" })), Constants.BloodMagicBlock.DEMON_PILLAR_1.getRegName());
DEMON_PILLAR_2 = registerBlock(new ItemBlockDemonPillarBase(new BlockDemonPillarBase("pillar2", Material.ROCK, new String[]{"raw", "corrosive", "destructive", "vengeful", "steadfast"})), Constants.BloodMagicBlock.DEMON_PILLAR_2.getRegName()); DEMON_PILLAR_2 = registerBlock(new ItemBlockDemonPillarBase(new BlockDemonPillarBase("pillar2", Material.ROCK, new String[] { "raw", "corrosive", "destructive", "vengeful", "steadfast" })), Constants.BloodMagicBlock.DEMON_PILLAR_2.getRegName());
DEMON_PILLAR_CAP_1 = registerBlock(new ItemBlockDemonPillarCapBase(new BlockDemonPillarCapBase("pillarCap1", Material.ROCK, new String[]{"raw", "corrosive"})), Constants.BloodMagicBlock.DEMON_PILLAR_CAP_1.getRegName()); DEMON_PILLAR_CAP_1 = registerBlock(new ItemBlockDemonPillarCapBase(new BlockDemonPillarCapBase("pillarCap1", Material.ROCK, new String[] { "raw", "corrosive" })), Constants.BloodMagicBlock.DEMON_PILLAR_CAP_1.getRegName());
DEMON_PILLAR_CAP_2 = registerBlock(new ItemBlockDemonPillarCapBase(new BlockDemonPillarCapBase("pillarCap2", Material.ROCK, new String[]{"destructive", "vengeful"})), Constants.BloodMagicBlock.DEMON_PILLAR_CAP_2.getRegName()); DEMON_PILLAR_CAP_2 = registerBlock(new ItemBlockDemonPillarCapBase(new BlockDemonPillarCapBase("pillarCap2", Material.ROCK, new String[] { "destructive", "vengeful" })), Constants.BloodMagicBlock.DEMON_PILLAR_CAP_2.getRegName());
DEMON_PILLAR_CAP_3 = registerBlock(new ItemBlockDemonPillarCapBase(new BlockDemonPillarCapBase("pillarCap3", Material.ROCK, new String[]{"steadfast"})), Constants.BloodMagicBlock.DEMON_PILLAR_CAP_3.getRegName()); DEMON_PILLAR_CAP_3 = registerBlock(new ItemBlockDemonPillarCapBase(new BlockDemonPillarCapBase("pillarCap3", Material.ROCK, new String[] { "steadfast" })), Constants.BloodMagicBlock.DEMON_PILLAR_CAP_3.getRegName());
DEMON_LIGHT = registerBlock(new ItemBlockDemonLight(new BlockDemonLight()), Constants.BloodMagicBlock.DEMON_LIGHT.getRegName()); DEMON_LIGHT = registerBlock(new ItemBlockDemonLight(new BlockDemonLight()), Constants.BloodMagicBlock.DEMON_LIGHT.getRegName());
DEMON_WALL_1 = registerBlock(new ItemBlockDemonWallBase(new BlockDemonWallBase("wall1", Material.ROCK, new String[]{"brick_raw", "brick_corrosive", "brick_destructive", "brick_vengeful", "brick_steadfast", "smallbrick_raw", "smallbrick_corrosive", "smallbrick_destructive", "smallbrick_vengeful", "smallbrick_steadfast", "large_raw", "large_corrosive", "large_destructive", "large_vengeful", "large_steadfast"})), Constants.BloodMagicBlock.DEMON_WALL_1.getRegName()); DEMON_WALL_1 = registerBlock(new ItemBlockDemonWallBase(new BlockDemonWallBase("wall1", Material.ROCK, new String[] { "brick_raw", "brick_corrosive", "brick_destructive", "brick_vengeful", "brick_steadfast", "smallbrick_raw", "smallbrick_corrosive", "smallbrick_destructive", "smallbrick_vengeful", "smallbrick_steadfast", "large_raw", "large_corrosive", "large_destructive", "large_vengeful", "large_steadfast" })), Constants.BloodMagicBlock.DEMON_WALL_1.getRegName());
DEMON_STAIRS_1 = registerBlock(new ItemDemonStairsBase(new BlockDemonStairsBase("stairs1", Material.ROCK, new String[]{"raw", "corrosive"})), Constants.BloodMagicBlock.DEMON_STAIRS_1.getRegName()); DEMON_STAIRS_1 = registerBlock(new ItemDemonStairsBase(new BlockDemonStairsBase("stairs1", Material.ROCK, new String[] { "raw", "corrosive" })), Constants.BloodMagicBlock.DEMON_STAIRS_1.getRegName());
DEMON_STAIRS_2 = registerBlock(new ItemDemonStairsBase(new BlockDemonStairsBase("stairs2", Material.ROCK, new String[]{"destructive", "vengeful"})), Constants.BloodMagicBlock.DEMON_STAIRS_2.getRegName()); DEMON_STAIRS_2 = registerBlock(new ItemDemonStairsBase(new BlockDemonStairsBase("stairs2", Material.ROCK, new String[] { "destructive", "vengeful" })), Constants.BloodMagicBlock.DEMON_STAIRS_2.getRegName());
DEMON_STAIRS_3 = registerBlock(new ItemDemonStairsBase(new BlockDemonStairsBase("stairs3", Material.ROCK, new String[]{"steadfast"})), Constants.BloodMagicBlock.DEMON_STAIRS_3.getRegName()); DEMON_STAIRS_3 = registerBlock(new ItemDemonStairsBase(new BlockDemonStairsBase("stairs3", Material.ROCK, new String[] { "steadfast" })), Constants.BloodMagicBlock.DEMON_STAIRS_3.getRegName());
INVERSION_PILLAR = registerBlock(new ItemBlock(new BlockInversionPillar()), Constants.BloodMagicBlock.INVERSION_PILLAR.getRegName()); INVERSION_PILLAR = registerBlock(new ItemBlockInversionPillar(new BlockInversionPillar()), Constants.BloodMagicBlock.INVERSION_PILLAR.getRegName());
INVERSION_PILLAR_END = registerBlock(new ItemBlockInversionPillarEnd(new BlockInversionPillarEnd()), Constants.BloodMagicBlock.INVERSION_PILLAR_END.getRegName());
} }
public static void init() public static void init()

View file

@ -85,9 +85,9 @@ public class TileInversionPillar extends TileTicking
System.out.println("Increasing radius!"); System.out.println("Increasing radius!");
} }
if (currentInversion >= inversionToAddPillar) if (currentInfectionRadius >= 10 && currentInversion >= inversionToAddPillar)
{ {
//TODO: Spawn pillar
} }
} }
} }
@ -140,7 +140,7 @@ public class TileInversionPillar extends TileTicking
if (totalGeneratedWill > 0) if (totalGeneratedWill > 0)
{ {
WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, totalGeneratedWill, maxWillForChunk, true); WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, totalGeneratedWill, maxWillForChunk, true); //TODO: Find out why this method doesn't work.
} }
} }

View file

@ -1,16 +1,54 @@
{ {
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"textures": { }, "textures": {
"model": "cube_all", "texture": "bloodmagic:models/pillar_mid",
"uvlock": true "particle": "#texture"
},
"transform" : "forge:default-block",
"model": "bloodmagic:pillar_mid"
}, },
"variants": { "variants": {
"type": { "type": {
"raw": { "raw": {
"textures": { "textures": {
"all": "bloodmagic:blocks/WoodBrickPath"
} },
"transform": {
"translation": [ 0, -0.46875, 0 ]
}
},
"corrosive": {
"textures": {
"texture": "bloodmagic:models/pillar_mid_c"
},
"transform": {
"translation": [ 0, -0.46875, 0 ]
}
},
"vengeful": {
"textures": {
"texture": "bloodmagic:models/pillar_mid_v"
},
"transform": {
"translation": [ 0, -0.46875, 0 ]
}
},
"destructive": {
"textures": {
"texture": "bloodmagic:models/pillar_mid_d"
},
"transform": {
"translation": [ 0, -0.46875, 0 ]
}
},
"steadfast": {
"textures": {
"texture": "bloodmagic:models/pillar_mid_s"
},
"transform": {
"translation": [ 0, -0.46875, 0 ]
}
} }
} }
} }

View file

@ -0,0 +1,72 @@
{
"forge_marker": 1,
"defaults": {
"textures": {
"texture": "bloodmagic:models/pillar_base",
"particle": "#texture"
},
"transform" : "forge:default-block",
"model": "bloodmagic:pillar_bottom"
},
"variants": {
"type": {
"raw_bottom": {
"textures": {
}
},
"raw_top": {
"textures": {
},
"model": "bloodmagic:pillar_top"
},
"corrosive_bottom": {
"textures": {
"texture": "bloodmagic:models/pillar_base_c"
}
},
"corrosive_top": {
"textures": {
"texture": "bloodmagic:models/pillar_base_c"
},
"model": "bloodmagic:pillar_top"
},
"destructive_bottom": {
"textures": {
"texture": "bloodmagic:models/pillar_base_d"
}
},
"destructive_top": {
"textures": {
"texture": "bloodmagic:models/pillar_base_d"
},
"model": "bloodmagic:pillar_top"
},
"vengeful_bottom": {
"textures": {
"texture": "bloodmagic:models/pillar_base_v"
}
},
"vengeful_top": {
"textures": {
"texture": "bloodmagic:models/pillar_base_v"
},
"model": "bloodmagic:pillar_top"
},
"steadfast_bottom": {
"textures": {
"texture": "bloodmagic:models/pillar_base_s"
}
},
"steadfast_top": {
"textures": {
"texture": "bloodmagic:models/pillar_base_s"
},
"model": "bloodmagic:pillar_top"
}
}
}
}