Refactor everything to WayofTime.bloodmagic.*
This commit is contained in:
parent
46742a73d1
commit
096ba02450
771 changed files with 566 additions and 573 deletions
23
src/main/java/WayofTime/bloodmagic/block/BlockAltar.java
Normal file
23
src/main/java/WayofTime/bloodmagic/block/BlockAltar.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockAltar extends BlockContainer {
|
||||
|
||||
public BlockAltar() {
|
||||
super(Material.rock);
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".altar");
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
// return new TileAltar();
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class BlockLifeEssence extends BlockFluidClassic {
|
||||
|
||||
@Getter
|
||||
private static Fluid lifeEssence = new FluidLifeEssence();
|
||||
|
||||
public BlockLifeEssence() {
|
||||
super(lifeEssence, Material.water);
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".fluid.lifeEssence");
|
||||
|
||||
lifeEssence.setBlock(this);
|
||||
BloodMagicAPI.setLifeEssence(lifeEssence);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDisplace(IBlockAccess world, BlockPos blockPos) {
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.canDisplace(world, blockPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean displaceIfPossible(World world, BlockPos blockPos) {
|
||||
return !world.getBlockState(blockPos).getBlock().getMaterial().isLiquid() && super.displaceIfPossible(world, blockPos);
|
||||
}
|
||||
|
||||
public static class FluidLifeEssence extends Fluid {
|
||||
|
||||
public FluidLifeEssence() {
|
||||
super("lifeEssence", new ResourceLocation(BloodMagic.DOMAIN + "blocks/lifeEssenceStill"), new ResourceLocation(BloodMagic.DOMAIN + "blocks/lifeEssenceFlowing"));
|
||||
|
||||
setDensity(2000);
|
||||
setViscosity(2000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return Color.WHITE.getRGB();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedName(FluidStack fluidStack) {
|
||||
return StatCollector.translateToLocal("tile.BloodMagic.fluid.lifeEssence.name");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockRitualController extends BlockContainer {
|
||||
|
||||
public static final String[] names = { "master", "imperfect" };
|
||||
public static final PropertyInteger META = PropertyInteger.create("meta", 0, names.length - 1);
|
||||
|
||||
public BlockRitualController() {
|
||||
super(Material.rock);
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".stone.ritual.");
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setStepSound(soundTypeStone);
|
||||
setHardness(2.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < names.length; i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(META, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (Integer) state.getValue(META);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, META);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, this.getMetaFromState(world.getBlockState(pos)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return meta == 0 ? null : null;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue