mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 15:03:14 +00:00
Auto-format fix imports, tabs/spaces
This commit is contained in:
1 parent
5816af57bc
commit
cce3b7b901
174 files changed
+1025
-1259
No files matched your search
@@ -66,7 +66,7 @@ public class BlockCeramic extends Block implements IColoredBlock, IItemModelRegi
|
||||
}
|
||||
return hasBeenBroken;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
||||
return new TileCeramic();
|
||||
@@ -76,11 +76,11 @@ public class BlockCeramic extends Block implements IColoredBlock, IItemModelRegi
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
|
||||
TileCeramic ceramic = TileUtil.getTile(worldIn, pos, TileCeramic.class);
|
||||
if(ceramic != null){
|
||||
if (ceramic != null) {
|
||||
ceramic.setColor(EnumFlowerColor.VALUES[stack.getItemDamage()]);
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class BlockCeramic extends Block implements IColoredBlock, IItemModelRegi
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
TileCeramic ceramic = TileUtil.getTile(world, pos, TileCeramic.class);
|
||||
if(ceramic != null){
|
||||
if (ceramic != null) {
|
||||
return ceramic.getStack();
|
||||
}
|
||||
return super.getPickBlock(state, target, world, pos, player);
|
||||
@@ -106,7 +106,7 @@ public class BlockCeramic extends Block implements IColoredBlock, IItemModelRegi
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex) {
|
||||
TileCeramic ceramic = TileUtil.getTile(world, pos, TileCeramic.class);
|
||||
if(ceramic != null){
|
||||
if (ceramic != null) {
|
||||
return ceramic.getColor().getColor(false);
|
||||
}
|
||||
return EnumFlowerColor.get(0).getColor(false);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
@@ -65,21 +65,21 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
|
||||
Block block = iblockstate.getBlock();
|
||||
if (blockState != iblockstate) {
|
||||
return true;
|
||||
}
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
|
||||
Block block = iblockstate.getBlock();
|
||||
if (blockState != iblockstate) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block == this){
|
||||
return false;
|
||||
}
|
||||
if (block == this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
}
|
||||
return super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
@@ -128,7 +128,7 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(IBlockState state, int tileMetadata) {
|
||||
return tileMetadata;
|
||||
@@ -174,7 +174,7 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
|
||||
if(worldIn == null || pos == null){
|
||||
if (worldIn == null || pos == null) {
|
||||
return 0;
|
||||
}
|
||||
return EnumFlowerColor.get(TileEntityMetadata.getTileMetadata(worldIn, pos)).getColor(false);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class ItemCeramic extends ItemBlock implements IColoredItem {
|
||||
public ItemCeramic(BlockCeramic block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetadata(final int metadata) {
|
||||
return metadata;
|
||||
@@ -23,7 +23,7 @@ public class ItemCeramic extends ItemBlock implements IColoredItem {
|
||||
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
|
||||
return EnumFlowerColor.get(stack.getMetadata()).getColor(false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
|
||||
@@ -10,9 +10,6 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class PigmentRecipe implements IRecipe {
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting crafting, final World world) {
|
||||
|
||||
@@ -8,38 +8,38 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileCeramic extends TileEntity {
|
||||
protected EnumFlowerColor color = EnumFlowerColor.Black;
|
||||
|
||||
|
||||
public void setColor(EnumFlowerColor color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
public EnumFlowerColor getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
|
||||
compound.setInteger("Color", color.getID());
|
||||
return super.writeToNBT(compound);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
color = EnumFlowerColor.VALUES[compound.getInteger("Color")];
|
||||
}
|
||||
|
||||
public ItemStack getStack(){
|
||||
|
||||
public ItemStack getStack() {
|
||||
return getStack(1);
|
||||
}
|
||||
|
||||
public ItemStack getStack(int amount){
|
||||
|
||||
public ItemStack getStack(int amount) {
|
||||
int ID = 0;
|
||||
if(color != null){
|
||||
if (color != null) {
|
||||
ID = color.getID();
|
||||
}
|
||||
return new ItemStack(Botany.ceramic, amount, ID);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerStateMapper() {
|
||||
ResourceLocation resourceLocation = new ResourceLocation(Constants.BOTANY_MOD_ID, "ceramicBrick");
|
||||
ResourceLocation resourceLocation = new ResourceLocation(Constants.BOTANY_MOD_ID, "ceramicBrick");
|
||||
ModelLoader.setCustomStateMapper(this, new DefaultStateMapper(resourceLocation));
|
||||
ModelManager.registerCustomBlockModel(new BlockModelEntry(
|
||||
new ModelResourceLocation(resourceLocation, "normal"),
|
||||
@@ -132,7 +132,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
manager.registerItemModel(item, new CeramicBrickMeshDefinition());
|
||||
}
|
||||
|
||||
private class CeramicBrickMeshDefinition implements ItemMeshDefinition{
|
||||
private class CeramicBrickMeshDefinition implements ItemMeshDefinition {
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
@@ -158,7 +158,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return ((IExtendedBlockState)super.getExtendedState(state, world, pos)).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
return ((IExtendedBlockState) super.getExtendedState(state, world, pos)).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,7 +169,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
@Override
|
||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
|
||||
TileCeramicBrick ceramic = TileUtil.getTile(worldIn, pos, TileCeramicBrick.class);
|
||||
if(ceramic != null){
|
||||
if (ceramic != null) {
|
||||
int damage = stack.getItemDamage();
|
||||
ceramic.setColors(EnumFlowerColor.get(damage & 0xFF), EnumFlowerColor.get(damage >> 8 & 0xFF));
|
||||
}
|
||||
@@ -178,7 +178,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
TileCeramicBrick ceramic = TileUtil.getTile(world, pos, TileCeramicBrick.class);
|
||||
if(ceramic != null){
|
||||
if (ceramic != null) {
|
||||
return ceramic.pair().getStack(0);
|
||||
}
|
||||
return super.getPickBlock(state, target, world, pos, player);
|
||||
@@ -188,10 +188,10 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex) {
|
||||
TileCeramicBrick ceramic = TileUtil.getTile(world, pos, TileCeramicBrick.class);
|
||||
if(ceramic != null){
|
||||
if (ceramic != null) {
|
||||
if (tintIndex == 1) {
|
||||
return ceramic.getColorFirst().getColor(false);
|
||||
}else if(tintIndex == 2){
|
||||
} else if (tintIndex == 2) {
|
||||
return ceramic.getColorSecond().getColor(false);
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
IBlockAccess world = extendedState.getValue(UnlistedBlockAccess.BLOCKACCESS);
|
||||
BlockPos pos = extendedState.getValue(UnlistedBlockPos.POS);
|
||||
TileCeramicBrick ceramic = TileUtil.getTile(world, pos, TileCeramicBrick.class);
|
||||
if(ceramic != null){
|
||||
if (ceramic != null) {
|
||||
return ceramic.pair();
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -58,13 +58,13 @@ public class CeramicBrickPair {
|
||||
Preconditions.checkState(sprites != null, "Sprites have not been registered.");
|
||||
return sprites[pass];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(!(obj instanceof CeramicBrickPair)){
|
||||
if (!(obj instanceof CeramicBrickPair)) {
|
||||
return false;
|
||||
}
|
||||
return ((CeramicBrickPair)obj).ordinal() == ordinal();
|
||||
return ((CeramicBrickPair) obj).ordinal() == ordinal();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum CeramicBrickType implements IStringSerializable {
|
||||
Tile("tile", "Ceramic Tile"){
|
||||
Tile("tile", "Ceramic Tile") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -50,19 +50,19 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(c, c, CeramicBrickType.Tile).getStack(3);
|
||||
}
|
||||
},
|
||||
Brick("brick", "Ceramic Bricks"){
|
||||
Brick("brick", "Ceramic Bricks") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getBrickRecipe(this, stacks);
|
||||
}
|
||||
},
|
||||
StripeBrick("brickstripe", "Striped Ceramic Bricks"){
|
||||
StripeBrick("brickstripe", "Striped Ceramic Bricks") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getBrickRecipe(this, stacks);
|
||||
}
|
||||
},
|
||||
LargeBrick("bricklarge", "Large Ceramic Bricks"){
|
||||
LargeBrick("bricklarge", "Large Ceramic Bricks") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() == 1) {
|
||||
@@ -111,7 +111,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
}
|
||||
}
|
||||
},
|
||||
Split("split", "Split Ceramic Tile"){
|
||||
Split("split", "Split Ceramic Tile") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -139,7 +139,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(EnumFlowerColor.get(colors[0]), EnumFlowerColor.get(colors[1]), CeramicBrickType.Split).getStack(4);
|
||||
}
|
||||
},
|
||||
Chequered("cheque", "Chequered Ceramic Tile"){
|
||||
Chequered("cheque", "Chequered Ceramic Tile") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -168,7 +168,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(EnumFlowerColor.get(colors[0]), EnumFlowerColor.get(colors[1]), CeramicBrickType.Chequered).getStack(4);
|
||||
}
|
||||
},
|
||||
Mixed("mixed", "Mixed Ceramic Tile"){
|
||||
Mixed("mixed", "Mixed Ceramic Tile") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -207,19 +207,19 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(EnumFlowerColor.get(colors[0]), EnumFlowerColor.get(colors[1]), CeramicBrickType.Mixed).getStack(4);
|
||||
}
|
||||
},
|
||||
VerticalBrick("verticalbrick", "Vertical Ceramic Bricks"){
|
||||
VerticalBrick("verticalbrick", "Vertical Ceramic Bricks") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getVerticalBrickRecipe(stacks);
|
||||
}
|
||||
},
|
||||
VerticalStripeBrick("verticalbrickstripe", "Vertical Striped Ceramic Bricks"){
|
||||
VerticalStripeBrick("verticalbrickstripe", "Vertical Striped Ceramic Bricks") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getVerticalBrickRecipe(stacks);
|
||||
}
|
||||
},
|
||||
VerticalLargeBrick("verticalbricklarge", "Large Vertical Ceramic Bricks"){
|
||||
VerticalLargeBrick("verticalbricklarge", "Large Vertical Ceramic Bricks") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getVerticalBrickRecipe(stacks);
|
||||
@@ -227,7 +227,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
};
|
||||
|
||||
public static final CeramicBrickType[] VALUES = values();
|
||||
|
||||
|
||||
String id;
|
||||
String name;
|
||||
|
||||
@@ -250,7 +250,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
|
||||
public abstract ItemStack getRecipe(List<ItemStack> stacks);
|
||||
|
||||
protected ItemStack getVerticalBrickRecipe(List<ItemStack> stacks){
|
||||
protected ItemStack getVerticalBrickRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 1) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
@@ -271,7 +271,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
protected ItemStack getBrickRecipe(CeramicBrickType ceramicType, List<ItemStack> stacks){
|
||||
protected ItemStack getBrickRecipe(CeramicBrickType ceramicType, List<ItemStack> stacks) {
|
||||
if (stacks.size() == 1) {
|
||||
final ItemStack stack5 = stacks.get(0);
|
||||
final CeramicBrickPair type = new CeramicBrickPair(stack5);
|
||||
@@ -317,7 +317,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
protected boolean isMortar(final ItemStack stack) {
|
||||
return stack.getItem() == Botany.misc && stack.getItemDamage() == BotanyItems.Mortar.ordinal();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
|
||||
@@ -10,7 +10,7 @@ public class ItemCeramicBrick extends ItemBlock implements IColoredItem {
|
||||
public ItemCeramicBrick(BlockCeramicBrick block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMetadata(final int metadata) {
|
||||
return metadata;
|
||||
@@ -27,7 +27,7 @@ public class ItemCeramicBrick extends ItemBlock implements IColoredItem {
|
||||
}
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
|
||||
@@ -7,12 +7,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class TileCeramicBrick extends TileEntity{
|
||||
public class TileCeramicBrick extends TileEntity {
|
||||
private EnumFlowerColor colorFirst = EnumFlowerColor.Black;
|
||||
private EnumFlowerColor colorSecond = EnumFlowerColor.White;
|
||||
|
||||
|
||||
public void setColors(EnumFlowerColor colorFirst, EnumFlowerColor colorSecond) {
|
||||
this.colorFirst = colorFirst;
|
||||
this.colorSecond = colorSecond;
|
||||
@@ -40,40 +38,40 @@ public class TileCeramicBrick extends TileEntity{
|
||||
public int ordinal() {
|
||||
return this.colorFirst.ordinal() + this.colorSecond.ordinal() * 256 + getBlockMetadata() * 256 * 256;
|
||||
}
|
||||
|
||||
public CeramicBrickPair pair(){
|
||||
|
||||
public CeramicBrickPair pair() {
|
||||
return new CeramicBrickPair(colorFirst, colorSecond, CeramicBrickType.VALUES[getBlockMetadata()]);
|
||||
}
|
||||
|
||||
|
||||
public EnumFlowerColor getColorFirst() {
|
||||
return colorFirst;
|
||||
}
|
||||
|
||||
|
||||
public EnumFlowerColor getColorSecond() {
|
||||
return colorSecond;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
|
||||
compound.setInteger("First", colorFirst.ordinal());
|
||||
compound.setInteger("Second", colorSecond.ordinal());
|
||||
return super.writeToNBT(compound);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getUpdateTag() {
|
||||
return writeToNBT(new NBTTagCompound());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
if(compound.hasKey("First")){
|
||||
if (compound.hasKey("First")) {
|
||||
colorFirst = EnumFlowerColor.VALUES[compound.getInteger("First")];
|
||||
}
|
||||
if(compound.hasKey("Second")){
|
||||
if (compound.hasKey("Second")) {
|
||||
colorSecond = EnumFlowerColor.VALUES[compound.getInteger("Second")];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user