Skip to content

Commit

Permalink
Merge pull request #355 from Team-RTG/dev
Browse files Browse the repository at this point in the history
Merged 0.4.0 dev into master.
  • Loading branch information
whichonespink44 committed Dec 20, 2015
2 parents c3457b0 + 263728c commit 63f994e
Show file tree
Hide file tree
Showing 457 changed files with 5,933 additions and 3,190 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ libs/CodeChickenCore-1.7.10-1.0.7.46-dev.jar
libs/NotEnoughItems-1.7.10-1.0.5.111-dev.jar
libs/extrabiomesxl_1.7.10-3.16.3-dev.jar
libs/BiomesOPlenty-1.7.10-2.1.0.1465-deobf.jar
libs/extrabiomesxl_1.7.10-3.16.3-deobf.jar
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 = "0.3.0"
version = "0.4.0"
group = "org.teamrtg.rtg" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "RTG-" + project.mcversion

Expand Down
14 changes: 12 additions & 2 deletions config/RTG/rtg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,27 @@ strongholds {
# [default: minecraft:stained_hardened_clay]
S:"Desert shadow block ID"=minecraft:stained_hardened_clay

# The meta value of the shadow block for desert structures. Defaults to 8 (light gray).
# The meta value of the shadow block for desert cliffs. Defaults to 8 (light gray).
# [range: 0 ~ 15, default: 8]
I:"Desert shadow block meta value"=8

# The block to use for stone terrain shadowing, typically seen on the cliffs of stone mountains. Defaults to stained hardened clay.
# [default: minecraft:stained_hardened_clay]
S:"Stone shadow block ID"=minecraft:stained_hardened_clay

# The meta value of the shadow block for stone structures. Defaults to 9 (cyan).
# The meta value of the shadow block for stone cliffs. Defaults to 9 (cyan).
# [range: 0 ~ 15, default: 9]
I:"Stone shadow block meta value"=9

# Set this to TRUE to allow UBC to override desert shadowing.
# This setting doesn't have any effect if UBC is not installed.
# [default: true]
B:"UBC Mode (Desert)"=true

# Set this to TRUE to allow UBC to override stone shadowing.
# This setting doesn't have any effect if UBC is not installed.
# [default: true]
B:"UBC Mode (Stone)"=true
}


Expand Down
Binary file added libs/ZenoUtils.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package exterminatorJeff.undergroundBiomes.api;

public class BiomeGenUndergroundBase {


public String biomeName = "";

public final int biomeID;

public boolean hasStrata = false;

public StrataLayer[] strata;

public final PerlinNoiseGenerator strataNoise;

//public int fillerBlock = 0;
//public byte fillerBlockMetadata;

public final UBStoneCodes fillerBlockCodes;

public BiomeGenUndergroundBase(int ID, NamedBlock filler, int metadataValue, BiomeGenUndergroundBase [] biomeList){
this.biomeID = ID;
this.fillerBlockCodes = new UBStoneCodes(filler,metadataValue);
strataNoise = new PerlinNoiseGenerator(1);
biomeList[ID] = this;
}

public BiomeGenUndergroundBase(int ID, NamedBlock filler, int metadataValue, BiomeGenUndergroundBase [] biomeList,
StrataLayer [] strataLayers){
this.biomeID = ID;
this.fillerBlockCodes = new UBStoneCodes(filler,metadataValue);
strataNoise = new PerlinNoiseGenerator(1);
biomeList[ID] = this;
AddStrataLayers(strataLayers);
}

public BiomeGenUndergroundBase AddStrataLayers(StrataLayer[] strata){
hasStrata = true;
this.strata = strata;
return this;
}

public UBStoneCodes getStrataBlockAtLayer(int y){
for(int i = 0; i < strata.length; i++){
if(strata[i].valueIsInLayer(y) == true){
return strata[i].codes;
}
}
return fillerBlockCodes;
}

public BiomeGenUndergroundBase setName(String name){
this.biomeName = name;
return this;
}

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package exterminatorJeff.undergroundBiomes.api;

/**
*
* @author Zeno410
*/

import Zeno410Utils.*;
import net.minecraft.block.Block;

public class BlockCodes extends BlockState {
public final NamedBlock name;
public final BlockCodes onDrop;
private final int metadataHashcode;

public BlockCodes(Block block, int metadata) {
super(block,metadata);
name = null;
onDrop = this;
metadataHashcode = new Integer(metadata).hashCode();
}

public BlockCodes(NamedBlock namer, int metadata) {
super(namer.block(),metadata);
name = namer;
if (block == null) {
throw new RuntimeException("couldn't find block for "+namer.internal());
}
onDrop = this;
metadataHashcode = new Integer(metadata).hashCode();
}

public BlockCodes(NamedBlock namer, int metadata, BlockCodes onDrop) {
super(namer.block(),metadata);
name = namer;
this.onDrop = onDrop;
metadataHashcode = new Integer(metadata).hashCode();
}

public int hashcode() {
return block.hashCode()+metadataHashcode;
}

public boolean equals(Object compared) {
if (compared instanceof BlockCodes) {
BlockCodes comparedCodes = (BlockCodes)compared;
if ((block==comparedCodes.block)&&(metadata == comparedCodes.metadata)) return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package exterminatorJeff.undergroundBiomes.api;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;

import cpw.mods.fml.common.registry.GameRegistry;

public class NamedBlock extends Names {

protected int id;
public Block block;

public final static String modid = "undergroundBiomes";
public NamedBlock(String internalName) {
super(internalName);
}

public void gameRegister(Block _block, Class itemClass) {
block = _block;
GameRegistry.registerBlock(block, itemClass, internal());
}

public void register(int _id, Block _block) {
if (block != null) {
throw duplicateRegistry();
}
//Registrar.instance.add(this,_id,_block);
reRegister(_id,_block);
}

public void reRegister(int _id, Block _block) {
id = _id;
block = _block;
block.setBlockName(external());
Block current = Block.getBlockById(_id);
if (current != block) {
//UndergroundBiomes.logger.info(this.internal() + "was missing ");
if (current != null) {
throw new RuntimeException(this.internal()+ " has been replaced by "+current.toString());
}
Block.blockRegistry.addObject(id, this.internal(), _block);
}
}

public Block block() {
return block;
}

public boolean matches(Item compared) {
if (compared instanceof ItemBlock) {
return (((ItemBlock)compared).field_150939_a.equals(block));
}
return false;
}

public boolean matches(Block compared) {
return compared.equals(this.block());
}

public int ID() {return Block.getIdFromBlock(block());}

public Item matchingItem(Block block) {
return Item.getItemById(Block.getIdFromBlock(block));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package exterminatorJeff.undergroundBiomes.api;

import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.util.IIcon;

public class NamedItem extends Names {

protected int id;
protected Item item;

public NamedItem(String internalName) {
super(internalName);
}

public NamedItem(NamedBlock block) {
this (block.internal());
}

public void register(int _id, Item _item) {

// not reregistring in general for now
//Registrar.instance.add(this,_id,_item);
reRegister(_id,_item);
}

public void reRegister(int _id, Item _item) {
id = _id;
item = _item;
Item current = Item.getItemById(_id);
if (current != _item) {
Item.itemRegistry.addObject(_id, this.internal(), _item);
}
}

public Item cachedItem() {
if (item == null) {
item = (Item)(Item.itemRegistry.getObject(this.external()));
if (item == null) throw new RuntimeException(this.internal()+ " has no item");
}
return item;
}

public Item registeredItem() {
Item result = (Item)(Item.itemRegistry.getObject(internal()));
if (result == null) {
result = (Item)(Item.itemRegistry.getObject(external()));
if (result == null) {
for (Object key: Item.itemRegistry.getKeys()) {
//UndergroundBiomes.logger.info(key.toString());
}
//UndergroundBiomes.logger.info(external());
throw new RuntimeException();
}
}
return result;
}

public IIcon registerIcons(IIconRegister iconRegister) {
return iconRegister.registerIcon(external());
}

public boolean matches(Item matched) {
return item.equals(matched);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package exterminatorJeff.undergroundBiomes.api;
import Zeno410Utils.*;
import net.minecraft.block.Block;
import java.util.logging.Logger;

/**
*
* @author Zeno410
*/
public class NamedSlabPair {
public static final Logger logger = new Zeno410Logger("NamedSlabPair").logger();
public final NamedBlock half;
public final NamedBlock full;

public NamedSlabPair(NamedBlock material) {
half = new NamedSlab(material.internal()+"HalfSlab");
full = new NamedSlab(material.internal()+"FullSlab");
}

public static class NamedSlab extends NamedBlock {
public NamedSlab(String name) {super(name);}

public Block block() {
// this doesn't register its own items so it doesn't have the block
Block result = Block.getBlockFromName(internal());
if (result == null) {
result = Block.getBlockFromName(external());
}
return result;
}

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package exterminatorJeff.undergroundBiomes.api;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;

public class NamedVanillaBlock extends NamedBlock {

public final static NamedBlock cobblestone = new NamedVanillaBlock(Blocks.cobblestone);
public final static NamedBlock cobblestone_wall = new NamedVanillaBlock(Blocks.cobblestone_wall);
public final static NamedBlock dispenser= new NamedVanillaBlock(Blocks.dispenser);
public final static NamedBlock furnace= new NamedVanillaBlock(Blocks.furnace);

public final static NamedBlock lever= new NamedVanillaBlock(Blocks.lever);
public final static NamedBlock piston= new NamedVanillaBlock(Blocks.piston);
public final static NamedBlock planks= new NamedVanillaBlock(Blocks.planks);
public final static NamedBlock stone_pressure_plate= new NamedVanillaBlock(Blocks.stone_pressure_plate);

public final static NamedBlock sand= new NamedVanillaBlock(Blocks.sand);
public final static NamedBlock sandstone= new NamedVanillaBlock(Blocks.sandstone);
public final static NamedBlock smoothSandstone= new NamedVanillaBlock(Blocks.sandstone);
public final static NamedBlock stairsCobblestone= new NamedVanillaBlock(Blocks.stone_stairs);
public final static NamedBlock stairsStoneBrick= new NamedVanillaBlock(Blocks.stone_brick_stairs);
public final static NamedBlock stone= new NamedVanillaBlock(Blocks.stone);
public final static NamedBlock stoneBrick= new NamedVanillaBlock(Blocks.stonebrick);
public final static NamedBlock stoneButton= new NamedVanillaBlock(Blocks.stone_button);
public final static NamedBlock stoneSingleSlab= new NamedVanillaBlock(Blocks.stone_slab);
public final static NamedBlock torchRedstoneActive= new NamedVanillaBlock(Blocks.lit_redstone_lamp);

public NamedVanillaBlock(String name) {
super(name);
id = UBIDs.blockID(name);
block = UBIDs.blockNamed(name);
}

public NamedVanillaBlock(Block _block) {
super(_block.getUnlocalizedName());
id = Block.getIdFromBlock(_block);
block = _block;
}

public Block block() {
if (block == null) {
block = UBIDs.blockNamed(this.internal());
//if (block == null) throw new RuntimeException();
}
return block;
}
}
Loading

0 comments on commit 63f994e

Please sign in to comment.