mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 04:10:07 +00:00
Improve wood blocks
This commit is contained in:
1 parent
3ed915f9d5
commit
a990ce3dc9
33 files changed
+465
-1604
No files matched your search
@@ -7,7 +7,7 @@ import binnie.botany.api.IFlower;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.botany.ceramic.BlockCeramic;
|
||||
import binnie.botany.ceramic.BlockCeramicPatterned;
|
||||
import binnie.botany.ceramic.BlockStained;
|
||||
import binnie.botany.ceramic.BlockStainedGlass;
|
||||
import binnie.botany.ceramic.brick.BlockCeramicBrick;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.core.BotanyGUI;
|
||||
@@ -90,7 +90,7 @@ public class Botany extends AbstractMod {
|
||||
public static ItemClay clay;
|
||||
public static BlockCeramic ceramic;
|
||||
public static BlockCeramicPatterned ceramicTile;
|
||||
public static BlockStained stained;
|
||||
public static BlockStainedGlass stained;
|
||||
public static BlockCeramicBrick ceramicBrick;
|
||||
|
||||
public static final float AGE_CHANCE = 0.2f;
|
||||
|
||||
+26
-6
@@ -2,10 +2,11 @@ package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.core.util.TileUtil;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -24,11 +25,13 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockStained extends Block implements IBlockMetadata, IColoredBlock {
|
||||
public BlockStained() {
|
||||
public class BlockStainedGlass extends Block implements IBlockMetadata, IColoredBlock {
|
||||
public BlockStainedGlass() {
|
||||
super(Material.GLASS);
|
||||
this.setCreativeTab(CreativeTabBotany.instance);
|
||||
this.setRegistryName("stained");
|
||||
@@ -55,17 +58,34 @@ public class BlockStained extends Block implements IBlockMetadata, IColoredBlock
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
Block block2 = blockAccess.getBlockState(pos.offset(side)).getBlock();
|
||||
Block block3 = blockAccess.getBlockState(pos).getBlock();
|
||||
return block3 != this && block3 != ExtraTrees.blockStained && super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
return true/*block3 != this && block3 != ExtraTrees.blockStained && super.shouldSideBeRendered(blockState, blockAccess, pos, side)*/;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
return BlockMetadata.getBlockDropped(this, world, pos);
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, pos);
|
||||
if (tile != null && !tile.hasDroppedBlock()) {
|
||||
int meta = getDroppedMeta(getMetaFromState(state), tile.getTileMetadata());
|
||||
list.add(TileEntityMetadata.getItemStack(this, meta));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, pos);
|
||||
List<ItemStack> drops = new ArrayList<>();
|
||||
TileCeramic ceramic = TileUtil.getTile(world, pos, TileCeramic.class);
|
||||
if (ceramic != null) {
|
||||
drops = Collections.singletonList(ceramic.getStack());
|
||||
}
|
||||
boolean hasBeenBroken = world.setBlockToAir(pos);
|
||||
if (hasBeenBroken && BinnieCore.proxy.isSimulating(world) && drops.size() > 0 && (player == null || !player.capabilities.isCreativeMode)) {
|
||||
for (ItemStack drop : drops) {
|
||||
spawnAsEntity(world, pos, drop);
|
||||
}
|
||||
}
|
||||
return hasBeenBroken;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -10,9 +10,6 @@ import binnie.botany.api.gardening.IBlockSoil;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.BlockGrass;
|
||||
import net.minecraft.block.BlockGrassPath;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
@@ -57,7 +54,8 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
switch (side){
|
||||
case UP:
|
||||
@@ -77,11 +75,13 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
/**
|
||||
* Used to determine ambient occlusion and culling when rebuilding chunks for render
|
||||
*/
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isFullCube(IBlockState state){
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.ceramic.BlockCeramic;
|
||||
import binnie.botany.ceramic.BlockCeramicPatterned;
|
||||
import binnie.botany.ceramic.BlockStained;
|
||||
import binnie.botany.ceramic.BlockStainedGlass;
|
||||
import binnie.botany.ceramic.CeramicTileRecipe;
|
||||
import binnie.botany.ceramic.ItemCeramic;
|
||||
import binnie.botany.ceramic.PigmentRecipe;
|
||||
@@ -47,26 +47,20 @@ public class ModuleGardening implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
Botany.proxy.registerBlock(Botany.plant = new BlockPlant());
|
||||
Botany.proxy.registerItem(new ItemWeed(Botany.plant).setRegistryName(Botany.plant.getRegistryName()));
|
||||
Botany.plant = new BlockPlant();
|
||||
Botany.proxy.registerBlock(Botany.plant, new ItemWeed(Botany.plant));
|
||||
Botany.soil = new BlockSoil(EnumSoilType.SOIL, "soil", false);
|
||||
Botany.proxy.registerBlock(Botany.soil);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.soil).setRegistryName(Botany.soil.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.soil, new ItemSoil(Botany.soil));
|
||||
Botany.loam = new BlockSoil(EnumSoilType.LOAM, "loam", false);
|
||||
Botany.proxy.registerBlock(Botany.loam);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.loam).setRegistryName(Botany.loam.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.loam, new ItemSoil(Botany.loam));
|
||||
Botany.flowerbed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed", false);
|
||||
Botany.proxy.registerBlock(Botany.flowerbed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.flowerbed).setRegistryName(Botany.flowerbed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.flowerbed, new ItemSoil(Botany.flowerbed));
|
||||
Botany.soilNoWeed = new BlockSoil(EnumSoilType.SOIL, "soilNoWeed", true);
|
||||
Botany.proxy.registerBlock(Botany.soilNoWeed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.soilNoWeed).setRegistryName(Botany.soilNoWeed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.soilNoWeed, new ItemSoil(Botany.soilNoWeed));
|
||||
Botany.loamNoWeed = new BlockSoil(EnumSoilType.LOAM, "loamNoWeed", true);
|
||||
Botany.proxy.registerBlock(Botany.loamNoWeed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.loamNoWeed).setRegistryName(Botany.loamNoWeed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.loamNoWeed, new ItemSoil(Botany.loamNoWeed));
|
||||
Botany.flowerbedNoWeed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbedNoWeed", true);
|
||||
Botany.proxy.registerBlock(Botany.flowerbedNoWeed);
|
||||
Botany.proxy.registerItem(new ItemSoil(Botany.flowerbedNoWeed).setRegistryName(Botany.flowerbedNoWeed.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.flowerbedNoWeed, new ItemSoil(Botany.flowerbedNoWeed));
|
||||
Botany.soilMeter = new ItemSoilMeter();
|
||||
Botany.proxy.registerItem(Botany.soilMeter);
|
||||
Botany.insulatedTube = new ItemInsulatedTube();
|
||||
@@ -88,20 +82,16 @@ public class ModuleGardening implements IInitializable {
|
||||
Botany.clay = new ItemClay();
|
||||
Botany.proxy.registerItem(Botany.clay);
|
||||
Botany.ceramic = new BlockCeramic();
|
||||
Botany.proxy.registerBlock(Botany.ceramic);
|
||||
Botany.proxy.registerItem(new ItemCeramic(Botany.ceramic).setRegistryName(Botany.ceramic.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.ceramic, new ItemCeramic(Botany.ceramic));
|
||||
BinnieCore.proxy.registerTileEntity(TileCeramic.class, "botany.tile.ceramic");
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramic), new ItemMetadataRenderer());
|
||||
Botany.stained = new BlockStained();
|
||||
Botany.proxy.registerBlock(Botany.stained);
|
||||
Botany.proxy.registerItem(new ItemMetadata(Botany.stained).setRegistryName(Botany.stained.getRegistryName()));
|
||||
Botany.stained = new BlockStainedGlass();
|
||||
Botany.proxy.registerBlock(Botany.stained, new ItemMetadata(Botany.stained));
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.stained), new ItemMetadataRenderer());
|
||||
Botany.ceramicTile = new BlockCeramicPatterned();
|
||||
Botany.proxy.registerBlock(Botany.ceramicTile);
|
||||
Botany.proxy.registerItem(new ItemMetadata(Botany.ceramicTile).setRegistryName(Botany.ceramicTile.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.ceramicTile, new ItemMetadata(Botany.ceramicTile));
|
||||
Botany.ceramicBrick = new BlockCeramicBrick();
|
||||
Botany.proxy.registerBlock(Botany.ceramicBrick);
|
||||
Botany.proxy.registerItem(new ItemCeramicBrick(Botany.ceramicBrick).setRegistryName(Botany.ceramicBrick.getRegistryName()));
|
||||
Botany.proxy.registerBlock(Botany.ceramicBrick, new ItemCeramicBrick(Botany.ceramicBrick));
|
||||
GameRegistry.registerTileEntity(TileCeramicBrick.class, "");
|
||||
BinnieCore.proxy.registerTileEntity(TileCeramicBrick.class, "botany.tile.ceramicBrick");
|
||||
// BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicTile), new MultipassItemRenderer());
|
||||
|
||||
Reference in new issue
Block a user