Skip to content

Commit

Permalink
Last of the formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
ProxyNeko authored and ProxyNeko committed May 8, 2020
1 parent ad0141d commit 8dddc80
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 63 deletions.
8 changes: 4 additions & 4 deletions src/main/java/panda/gotwood/GotWood.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import panda.gotwood.registry.MasterRegistrar;

@Mod(
modid = GotWood.MODID,
name = GotWood.NAME,
version = GotWood.VERSION)
modid = GotWood.MODID,
name = GotWood.NAME,
version = GotWood.VERSION)
public class GotWood {

//TODO Setup new gradle scripts and mod info -ProxyNeko
//TODO Setup new gradle scripts and mod info -ProxyNeko
public static final String MODID = "gotwood";
public static final String VERSION = "0.26.0";
public static final String NAME = "Got Wood?";
Expand Down
63 changes: 21 additions & 42 deletions src/main/java/panda/gotwood/block/BlockFruitingLeaves.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public class BlockFruitingLeaves extends BlockLeaves implements IOreDictionaryEn
public static final PropertyInteger FRUITING = PropertyInteger.create("fruit", 0, 2);
final WoodMaterial wood;

public BlockFruitingLeaves(WoodMaterial wood)
{
public BlockFruitingLeaves(WoodMaterial wood) {
this.wood = wood;
Blocks.FIRE.setFireInfo(this, 30, 60);
this.setDefaultState(this.blockState.getBaseState().withProperty(DECAYABLE, false).withProperty(CHECK_DECAY, false).withProperty(FRUITING, 0));
Expand All @@ -50,21 +49,18 @@ public BlockFruitingLeaves(WoodMaterial wood)


@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Items.AIR;
}

@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,
float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
{
float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
return this.getDefaultState();
}

@Override
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random)
{
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) {
super.randomTick(worldIn, pos, state, random);
if (state.getValue(FRUITING) == 2) {
return;
Expand Down Expand Up @@ -119,8 +115,7 @@ public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random ra
}

@Override
public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
java.util.List<ItemStack> ret = new java.util.ArrayList<>();
Random rand = world instanceof World ? ((World) world).rand : new Random();
int chance = -1;
Expand All @@ -145,8 +140,7 @@ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlo
}

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!worldIn.isRemote) {
if (state.getValue(FRUITING) == 2) {
for (ItemStack item : this.getDrops(worldIn, pos, state, 0)) {
Expand All @@ -164,8 +158,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state,
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, facing, hitX, hitY, hitZ);
}

private int getModifiedChance(int chance, int fortune, int decrement, int minchance)
{
private int getModifiedChance(int chance, int fortune, int decrement, int minchance) {
int modifiedchance = chance;
if (fortune > 0) {
modifiedchance -= decrement << fortune;
Expand All @@ -177,74 +170,62 @@ private int getModifiedChance(int chance, int fortune, int decrement, int mincha
}

@SideOnly(Side.CLIENT)
public int getBlockColor()
{
public int getBlockColor() {
return 16777215;
}

@SideOnly(Side.CLIENT)
public int getRenderColor(IBlockState state)
{
public int getRenderColor(IBlockState state) {
return 16777215;
}

@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass)
{
public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) {
return 16777215;
}

@SideOnly(Side.CLIENT)
@Override
public BlockRenderLayer getRenderLayer()
{
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT_MIPPED;
}

@Override
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
return true;
}

@Override
public boolean isOpaqueCube(IBlockState state)
{
public boolean isOpaqueCube(IBlockState state) {
return false;
}

@Override
public boolean isFoliage(IBlockAccess world, BlockPos pos)
{
public boolean isFoliage(IBlockAccess world, BlockPos pos) {
return true;
}

@Override
public EnumType getWoodType(int meta)
{
public EnumType getWoodType(int meta) {
return null;
}

public WoodMaterial getWoodMaterial()
{
public WoodMaterial getWoodMaterial() {
return this.wood;
}

@Override
public String getOreDictionaryName()
{
public String getOreDictionaryName() {
return "leavesFruit" + this.wood.getCapitalizedName();
}

@Override
public IBlockState getStateFromMeta(int meta)
{
public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(DECAYABLE, meta % 2 == 1).withProperty(CHECK_DECAY, meta < 6).withProperty(FRUITING, Arrays.asList(0, 1, 10, 11).contains(meta) ? Arrays.asList(2, 3, 8, 9).contains(meta) ? 2 : 1 : 0);
}

@Override
public int getMetaFromState(IBlockState state)
{
public int getMetaFromState(IBlockState state) {
int i = 0;
i += state.getValue(DECAYABLE) ? 1 : 0;
i += state.getValue(CHECK_DECAY) ? 0 : 6;
Expand All @@ -253,14 +234,12 @@ public int getMetaFromState(IBlockState state)
}

@Override
protected BlockStateContainer createBlockState()
{
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, CHECK_DECAY, DECAYABLE, FRUITING);
}

@Override
public List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
{
public List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) {
return java.util.Arrays.asList(new ItemStack(this, 1));
}
}
6 changes: 1 addition & 5 deletions src/main/java/panda/gotwood/blocks/SpecialFire.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package panda.gotwood.blocks;

import com.google.common.collect.Maps;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFire;
import net.minecraft.block.BlockLog;
import net.minecraft.block.BlockTNT;
import net.minecraft.block.SoundType;
import net.minecraft.block.*;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyInteger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public final class ConfigurationHandler {
public static int rubberChance;
public static boolean allowBonemealFruitSaplings;
public static Configuration config;

private ConfigurationHandler() {
}

Expand Down
6 changes: 1 addition & 5 deletions src/main/java/panda/gotwood/item/ItemSeed.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/panda/gotwood/item/ItemWoodSlab.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public final class ItemWoodSlab extends ItemSlab implements IOreDictionaryEntry {

private final WoodMaterial wood;
private final WoodMaterial wood;

public ItemWoodSlab(WoodMaterial wood, BlockSlab slab, BlockSlab doubleslab) {
super(slab, slab, doubleslab);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/panda/gotwood/util/TapRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

public class TapRegistry {

public static FluidStack find(Block block) {
//TODO Find out what this was for/meant to do.
//Just return water for now
return new FluidStack(FluidRegistry.WATER, 0);
}
public static FluidStack find(Block block) {
//TODO Find out what this was for/meant to do.
//Just return water for now
return new FluidStack(FluidRegistry.WATER, 0);
}
}
2 changes: 1 addition & 1 deletion src/main/java/panda/gotwood/util/TreeTapRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class TreeTapRenderer extends TileEntitySpecialRenderer<TileEntityTreeTap> {

//FROM TIC
//@Override
//@Override
public void renderTileEntityAt(TileEntityTreeTap te, double x, double y, double z, float partialTicks, int destroyStage, float partial, BufferBuilder buffer) {
if (te.sapInBucket == null || !te.hasBucket) {
return;
Expand Down

0 comments on commit 8dddc80

Please sign in to comment.