mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Co-authored-by: Martin Robertz <[email protected]> Co-authored-by: boubou19 <[email protected]>
120 lines
4.0 KiB
Java
120 lines
4.0 KiB
Java
/**
|
|
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
|
*
|
|
* ThaumicTinkerer 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)
|
|
*
|
|
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
|
* (http://www.minecraftforum.net/topic/1585216-)
|
|
*
|
|
* File Created @ [Dec 27, 2013, 6:36:19 PM (GMT)]
|
|
*/
|
|
package thaumic.tinkerer.common.block;
|
|
|
|
import java.util.List;
|
|
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.item.ItemBlock;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.tileentity.TileEntity;
|
|
import net.minecraft.util.AxisAlignedBB;
|
|
import net.minecraft.world.IBlockAccess;
|
|
import net.minecraft.world.World;
|
|
|
|
import thaumcraft.api.aspects.Aspect;
|
|
import thaumcraft.api.aspects.AspectList;
|
|
import thaumcraft.api.research.ResearchPage;
|
|
import thaumcraft.common.config.ConfigBlocks;
|
|
import thaumic.tinkerer.common.block.tile.TileCamo;
|
|
import thaumic.tinkerer.common.lib.LibBlockNames;
|
|
import thaumic.tinkerer.common.lib.LibResearch;
|
|
import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe;
|
|
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
|
|
import thaumic.tinkerer.common.research.IRegisterableResearch;
|
|
import thaumic.tinkerer.common.research.ResearchHelper;
|
|
import thaumic.tinkerer.common.research.TTResearchItem;
|
|
|
|
public class BlockPlatform extends BlockCamo {
|
|
|
|
public BlockPlatform() {
|
|
super(Material.wood);
|
|
setHardness(2.0F);
|
|
setResistance(5.0F);
|
|
setStepSound(Block.soundTypeWood);
|
|
}
|
|
|
|
@Override
|
|
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
|
|
List par6List, Entity par7Entity) {
|
|
if (par7Entity != null && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0)
|
|
&& (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking()))
|
|
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
|
}
|
|
|
|
@Override
|
|
public boolean getBlocksMovement(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public TileCamo createNewTileEntity(World world, int meta) {
|
|
return new TileCamo();
|
|
}
|
|
|
|
@Override
|
|
public String getBlockName() {
|
|
return LibBlockNames.PLATFORM;
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldRegister() {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldDisplayInTab() {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public Class<? extends ItemBlock> getItemBlock() {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public Class<? extends TileEntity> getTileEntity() {
|
|
return TileCamo.class;
|
|
}
|
|
|
|
@Override
|
|
public IRegisterableResearch getResearchItem() {
|
|
return (IRegisterableResearch) new TTResearchItem(
|
|
LibResearch.KEY_PLATFORM,
|
|
new AspectList().add(Aspect.SENSES, 2).add(Aspect.TREE, 1).add(Aspect.MOTION, 1),
|
|
-2,
|
|
6,
|
|
3,
|
|
new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_CLEANSING_TALISMAN)
|
|
.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_PLATFORM))
|
|
.setSecondary();
|
|
}
|
|
|
|
@Override
|
|
public ThaumicTinkererRecipe getRecipeItem() {
|
|
return new ThaumicTinkererArcaneRecipe(
|
|
LibResearch.KEY_PLATFORM,
|
|
LibResearch.KEY_PLATFORM,
|
|
new ItemStack(this, 2),
|
|
new AspectList().add(Aspect.AIR, 2).add(Aspect.ENTROPY, 4),
|
|
" S ",
|
|
"G G",
|
|
'G',
|
|
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6),
|
|
'S',
|
|
new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 7));
|
|
}
|
|
}
|