Skip to content

Commit

Permalink
Added new wood types & did minor refactoring work in a couple of places
Browse files Browse the repository at this point in the history
  • Loading branch information
nuckable committed Feb 15, 2021
1 parent 69041a6 commit 793f4a2
Show file tree
Hide file tree
Showing 68 changed files with 175 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildscript {

apply plugin: 'forge'

version = "1.0.7"
version = "1.0.8"
group= "org.rbh.tfcadditions"
archivesBaseName = "[1.7.10]TFC-Additions"

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/rbh/tfcadditions/Api/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ public class Blocks {

public static Block PlanksOutline;
public static Block PlanksOutline2;
public static Block PlanksOutline3;

public static Block PlanksLarge;
public static Block PlanksLarge2;
public static Block PlanksLarge3;

public static Block PlanksParquet;
public static Block PlanksParquet2;
public static Block PlanksParquet3;

public static Block PlanksNorm;
public static Block PlanksNorm2;

public static Block PlanksVert;
public static Block PlanksVert2;
public static Block PlanksVert3;
}
6 changes: 3 additions & 3 deletions src/main/java/org/rbh/tfcadditions/Api/SubmapManCTM.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class SubmapManCTM extends SubmapManagerCTM {
private static RenderBlocksCTM rb;

private TextureSubmap submap, submapSmall;
private String blockNames;
private String blockType;
private String chiselType;
private final String blockNames;
private final String blockType;
private final String chiselType;

public SubmapManCTM(String names, String block, String chisel) {
super("dummy");
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/rbh/tfcadditions/Blocks/BlockChisel.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
public class BlockChisel extends BlockTerra implements ICTMBlock {

//@SideOnly(Side.CLIENT)
private List<SubmapManCTM> manager = new ArrayList<SubmapManCTM>();
private final List<SubmapManCTM> manager = new ArrayList<SubmapManCTM>();

protected String[] names;
protected IIcon[] icons;
private String blockType, chiselType;
private final String blockType;
private final String chiselType;

public BlockChisel(Material material, String blockType, String chiselType)
{
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/org/rbh/tfcadditions/Blocks/BlockPlanks.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class BlockPlanks extends BlockTerra {

public enum NameType {
FIRST_BRACKET,
SECOND_BRACKET
SECOND_BRACKET,
THIRD_BRACKET
}

protected String[] names;
Expand Down Expand Up @@ -105,7 +106,11 @@ protected String[] getMetaNames(NameType bracket){
return MetaNames;
} else if(bracket == NameType.SECOND_BRACKET){
MetaNames = new String[Global.WOOD_ALL.length - 16];
System.arraycopy(Global.WOOD_ALL, 16, MetaNames, 0, Global.WOOD_ALL.length - 16);
System.arraycopy(Global.WOOD_ALL, 16, MetaNames, 0, 16);
return MetaNames;
} else if(bracket == NameType.THIRD_BRACKET){
MetaNames = new String[Global.WOOD_ALL.length - 32];
System.arraycopy(Global.WOOD_ALL, 32, MetaNames, 0, Global.WOOD_ALL.length - 32);
return MetaNames;
}
return null;
Expand Down
31 changes: 26 additions & 5 deletions src/main/java/org/rbh/tfcadditions/Blocks/BlockSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@
import org.rbh.tfcadditions.Blocks.Dent.BlockIGEXDent;
import org.rbh.tfcadditions.Blocks.Dent.BlockIGINDent;
import org.rbh.tfcadditions.Blocks.Dent.BlockMMDent;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlank2Dent;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlank3Dent;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlankDent;
import org.rbh.tfcadditions.Blocks.Dent.BlockSEDDent;
import org.rbh.tfcadditions.Blocks.DentSmall.BlockIGEXDentSmall;
import org.rbh.tfcadditions.Blocks.DentSmall.BlockIGINDentSmall;
import org.rbh.tfcadditions.Blocks.DentSmall.BlockMMDentSmall;
import org.rbh.tfcadditions.Blocks.DentSmall.BlockSEDDentSmall;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlank2Dent;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlankDent;
import org.rbh.tfcadditions.Blocks.Planks.*;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksLarge;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksLarge2;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksLarge3;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksParquet;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksParquet2;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksParquet3;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksVert;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksVert2;
import org.rbh.tfcadditions.Blocks.Planks.BlockPlanksVert3;
import org.rbh.tfcadditions.Core.CreativeTabs;
import org.rbh.tfcadditions.Items.ItemBlocks.ItemBlock;
import org.rbh.tfcadditions.Items.ItemBlocks.ItemBlockPlanks;
Expand All @@ -26,7 +35,7 @@ public class BlockSetup extends Blocks {


public static void LoadBlocks(){
TFCAdditions.LOG.info(new StringBuilder().append("Loading Blocks").toString());
TFCAdditions.LOG.info("Loading Blocks");

StoneMMDent = new BlockMMDent().setHardness(15F).setStepSound(Block.soundTypeStone).setBlockName("MMRockDent").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
StoneMMDentSmall = new BlockMMDentSmall().setHardness(15F).setStepSound(Block.soundTypeStone).setBlockName("MMRockDentSmall").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
Expand All @@ -42,18 +51,22 @@ public static void LoadBlocks(){

PlanksOutline = new BlockPlankDent().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksOutline").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksOutline2 = new BlockPlank2Dent().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksOutline2").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksOutline3 = new BlockPlank3Dent().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksOutline3").setCreativeTab(CreativeTabs.TFCAdditions_Tab);

PlanksLarge = new BlockPlanksLarge().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksLarge").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksLarge2 = new BlockPlanksLarge2().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksLarge2").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksLarge3 = new BlockPlanksLarge3().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksLarge3").setCreativeTab(CreativeTabs.TFCAdditions_Tab);

PlanksParquet = new BlockPlanksParquet().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksParquet").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksParquet2 = new BlockPlanksParquet2().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksParquet2").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksParquet3 = new BlockPlanksParquet3().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksParquet3").setCreativeTab(CreativeTabs.TFCAdditions_Tab);

//PlanksNorm = new BlockPlanksNorm().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksNorm").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
//PlanksNorm2 = new BlockPlanksNorm2().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksNorm2").setCreativeTab(CreativeTabs.TFCAdditions_Tab);

PlanksVert = new BlockPlanksVert().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksVert").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksVert2 = new BlockPlanksVert2().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksVert2").setCreativeTab(CreativeTabs.TFCAdditions_Tab);
PlanksVert3 = new BlockPlanksVert3().setHardness(4.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood).setBlockName("PlanksVert3").setCreativeTab(CreativeTabs.TFCAdditions_Tab);

StoneMMDent.setHarvestLevel("pickaxe", 0);
StoneMMDentSmall.setHarvestLevel("pickaxe", 0);
Expand All @@ -69,22 +82,26 @@ public static void LoadBlocks(){

PlanksOutline.setHarvestLevel("axe", 0);
PlanksOutline2.setHarvestLevel("axe", 0);
PlanksOutline3.setHarvestLevel("axe", 0);

PlanksLarge.setHarvestLevel("axe", 0);
PlanksLarge2.setHarvestLevel("axe", 0);
PlanksLarge3.setHarvestLevel("axe", 0);

PlanksParquet.setHarvestLevel("axe", 0);
PlanksParquet2.setHarvestLevel("axe", 0);
PlanksParquet3.setHarvestLevel("axe", 0);

//PlanksNorm.setHarvestLevel("axe", 0);
//PlanksNorm2.setHarvestLevel("axe", 0);

PlanksVert.setHarvestLevel("axe", 0);
PlanksVert2.setHarvestLevel("axe", 0);
PlanksVert3.setHarvestLevel("axe", 0);
}

public static void RegisterBlocks(){
TFCAdditions.LOG.info(new StringBuilder().append("Register Blocks").toString());
TFCAdditions.LOG.info("Register Blocks");

GameRegistry.registerBlock(StoneMMDent, ItemBlock.class, "StoneMMDent");
GameRegistry.registerBlock(StoneMMDentSmall, ItemBlock.class, "StoneMMDentSmall");
Expand All @@ -100,17 +117,21 @@ public static void RegisterBlocks(){

GameRegistry.registerBlock(PlanksOutline, ItemBlockPlanks.class, "OutlinedPlanks");
GameRegistry.registerBlock(PlanksOutline2, ItemBlockPlanks.class, "OutlinedPlanks2");
GameRegistry.registerBlock(PlanksOutline3, ItemBlockPlanks.class, "OutlinedPlanks3");

GameRegistry.registerBlock(PlanksLarge, ItemBlockPlanks.class, "LargePlanks");
GameRegistry.registerBlock(PlanksLarge2, ItemBlockPlanks.class, "LargePlanks2");
GameRegistry.registerBlock(PlanksLarge3, ItemBlockPlanks.class, "LargePlanks3");

GameRegistry.registerBlock(PlanksParquet, ItemBlockPlanks.class, "ParquetPlanks");
GameRegistry.registerBlock(PlanksParquet2, ItemBlockPlanks.class, "ParquetPlanks2");
GameRegistry.registerBlock(PlanksParquet3, ItemBlockPlanks.class, "ParquetPlanks3");

//GameRegistry.registerBlock(PlanksNorm, ItemBlockPlanks.class, "NormalPlanks");
//GameRegistry.registerBlock(PlanksNorm2, ItemBlockPlanks.class, "NormalPlanks2");

GameRegistry.registerBlock(PlanksVert, ItemBlockPlanks.class, "VerticalPlanks");
GameRegistry.registerBlock(PlanksVert2, ItemBlockPlanks.class, "VerticalPlanks2");
GameRegistry.registerBlock(PlanksVert3, ItemBlockPlanks.class, "VerticalPlanks3");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.rbh.tfcadditions.Blocks.Dent;

import com.dunk.tfc.api.Constant.Global;
import net.minecraft.block.material.Material;
import net.minecraft.util.IIcon;
import org.rbh.tfcadditions.Blocks.BlockChisel;

/**
* Created by raymondbh on 19.08.2015.
*/
public class BlockPlank3Dent extends BlockChisel {
public BlockPlank3Dent()
{
super(Material.wood, "wood", "Plank Outline");
names = new String[Global.WOOD_ALL.length - 32];
System.arraycopy(Global.WOOD_ALL, 32, names, 0, Global.WOOD_ALL.length - 32);
icons = new IIcon[names.length];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.rbh.tfcadditions.Blocks.Planks;

import net.minecraft.block.material.Material;
import net.minecraft.util.IIcon;
import org.rbh.tfcadditions.Blocks.BlockPlanks;

/**
* Created by raymondbh on 20.08.2015.
*/
public class BlockPlanksLarge3 extends BlockPlanks {
public BlockPlanksLarge3() {
super(Material.wood, " Plank Large");
names = getMetaNames(NameType.THIRD_BRACKET);
icons = new IIcon[names.length];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.rbh.tfcadditions.Blocks.Planks;

import net.minecraft.block.material.Material;
import net.minecraft.util.IIcon;
import org.rbh.tfcadditions.Blocks.BlockPlanks;

/**
* Created by rbh on 20.08.2015.
*/
public class BlockPlanksNorm3 extends BlockPlanks{
public BlockPlanksNorm3()
{
super(Material.wood, " Plank");
names = getMetaNames(NameType.THIRD_BRACKET);
icons = new IIcon[names.length];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.rbh.tfcadditions.Blocks.Planks;

import net.minecraft.block.material.Material;
import net.minecraft.util.IIcon;
import org.rbh.tfcadditions.Blocks.BlockPlanks;

/**
* Created by raymondbh on 20.08.2015.
*/
public class BlockPlanksParquet3 extends BlockPlanks {
public BlockPlanksParquet3()
{
super(Material.wood, " Plank Parquet");
names = getMetaNames(NameType.THIRD_BRACKET);
icons = new IIcon[names.length];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.rbh.tfcadditions.Blocks.Planks;

import net.minecraft.block.material.Material;
import net.minecraft.util.IIcon;
import org.rbh.tfcadditions.Blocks.BlockPlanks;

/**
* Created by rbh on 20.08.2015.
*/
public class BlockPlanksVert3 extends BlockPlanks {
public BlockPlanksVert3() {
super(Material.wood, " Plank Vertical");
names = getMetaNames(NameType.THIRD_BRACKET);
icons = new IIcon[names.length];
}
}
4 changes: 4 additions & 0 deletions src/main/java/org/rbh/tfcadditions/Core/Recipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public static void registerRecipes(){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.PlanksVert2, 1, l), " 1 ","11 ","1 ", '1', new ItemStack(TFCItems.singlePlank, 1, i)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.PlanksParquet2, 2, l), "11","11", '1', new ItemStack(Items.PlankPlaned, 1, i)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.PlanksLarge2, 2, l), "111","111","111", '1', new ItemStack(Items.PlankPlaned, 1, i)));
} else if(i/32 == 1){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.PlanksVert3, 1, l), " 1 ","11 ","1 ", '1', new ItemStack(TFCItems.singlePlank, 1, i)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.PlanksParquet3, 2, l), "11","11", '1', new ItemStack(Items.PlankPlaned, 1, i)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.PlanksLarge3, 2, l), "111","111","111", '1', new ItemStack(Items.PlankPlaned, 1, i)));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.block.Block;
import org.rbh.tfcadditions.Blocks.BlockPlanks;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlank2Dent;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlank3Dent;
import org.rbh.tfcadditions.Blocks.Dent.BlockPlankDent;
import org.rbh.tfcadditions.Reference.Names;

Expand All @@ -22,11 +23,14 @@ public ItemBlockPlanks(Block block)
}
else if(block instanceof BlockPlank2Dent) {
metaNames = new String[Global.WOOD_ALL.length - 16];
System.arraycopy(Global.WOOD_ALL, 16, metaNames, 0, Global.WOOD_ALL.length - 16);
System.arraycopy(Global.WOOD_ALL, 16, metaNames, 0, 16);
}
else if(block instanceof BlockPlank3Dent) {
metaNames = new String[Global.WOOD_ALL.length - 32];
System.arraycopy(Global.WOOD_ALL, 32, metaNames, 0, Global.WOOD_ALL.length - 32);
}
else if(block instanceof BlockPlanks){
metaNames = ((BlockPlanks) block).getNames();
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
public class ItemPlankPlaned extends ItemTerra {

private IIcon[] icons = new IIcon[Global.WOOD_ALL.length];
private final IIcon[] icons = new IIcon[Global.WOOD_ALL.length];

ItemPlankPlaned(){
super();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/rbh/tfcadditions/Items/ItemSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class ItemSetup extends Items {

public static void LoadItems(){
TFCAdditions.LOG.info(new StringBuilder().append("Loading Items").toString());
TFCAdditions.LOG.info("Loading Items");

BismuthBronzePlaner = new ItemPlaner(TFCItems.bismuthBronzeToolMaterial).setUnlocalizedName("Bismuth Bronze Planer").setMaxDamage(TFCItems.bismuthBronzeUses);
BlackBronzePlaner = new ItemPlaner(TFCItems.blackBronzeToolMaterial).setUnlocalizedName("Black Bronze Planer").setMaxDamage(TFCItems.blackBronzeUses);
Expand All @@ -31,7 +31,7 @@ public static void LoadItems(){
}

public static void RegisterItems(){
TFCAdditions.LOG.info(new StringBuilder().append("Register Items").toString());
TFCAdditions.LOG.info("Register Items");

GameRegistry.registerItem(BismuthBronzePlaner, BismuthBronzePlaner.getUnlocalizedName());
GameRegistry.registerItem(BlackBronzePlaner, BlackBronzePlaner.getUnlocalizedName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Reference {

public static final int VersionMajor = 1;
public static final int VersionMinor = 0;
public static final int VersionRevision = 7;
public static final int VersionRevision = 8;

public static final String ModVersion = VersionMajor + "." + VersionMinor + "." + VersionRevision;
//public static final String TFCVersion = "@TFCVERSION@";
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/rbh/tfcadditions/Tools/ChiselMode_Dent.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public boolean onUsedHandler(World world, EntityPlayer player, int x, int y, int
world.setBlock(x, y, z, Blocks.PlanksOutline, meta, 0x2);
} else if(id == TFCBlocks.planks2 ||id == Blocks.PlanksVert2) {
world.setBlock(x, y, z, Blocks.PlanksOutline2, meta, 0x2);
} else if(id == TFCBlocks.planks3 ||id == Blocks.PlanksVert3) {
world.setBlock(x, y, z, Blocks.PlanksOutline3, meta, 0x2);
}

player.inventory.mainInventory[hasChisel].damageItem(1, player);
Expand Down
Loading

0 comments on commit 793f4a2

Please sign in to comment.