forked from TAIGA/TAIGA
general code cleanup
added new StateMatcher
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -126,6 +126,8 @@ local.properties
|
|||||||
# mpeltonen/sbt-idea plugin
|
# mpeltonen/sbt-idea plugin
|
||||||
.idea_modules/
|
.idea_modules/
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
|
||||||
# JIRA plugin
|
# JIRA plugin
|
||||||
atlassian-ide-plugin.xml
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
16
build.gradle
16
build.gradle
@@ -13,25 +13,13 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name "DVS1 Maven FS'"
|
|
||||||
url 'http://dvs1.progwml6.com/files/maven'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
|
|
||||||
//plugins {
|
|
||||||
// id "net.minecraftforge.gradle.forge" version "2.0.2"
|
|
||||||
//}
|
|
||||||
*/
|
|
||||||
version = "0.1"
|
version = "0.1"
|
||||||
group= "com.sosnitzka.zcompression" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group= "com.sosnitzka.zcompression" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = "zcompression"
|
archivesBaseName = "zcompression"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.9-12.16.0.1865-1.9"
|
version = "1.9-12.16.0.1867-1.9"
|
||||||
runDir = "run"
|
runDir = "run"
|
||||||
|
|
||||||
// the mappings can be changed at any time, and must be in the following format.
|
// the mappings can be changed at any time, and must be in the following format.
|
||||||
@@ -64,7 +52,7 @@ dependencies {
|
|||||||
// for more info...
|
// for more info...
|
||||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||||
compile "tconstruct:TConstruct:1.9-2.2.2.jenkins159:deobf"
|
// compile "tconstruct:TConstruct:1.9-2.2.2.jenkins159:deobf"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources
|
processResources
|
||||||
|
@@ -3,14 +3,13 @@ package blocks;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BasicBlock extends Block{
|
public class BasicBlock extends Block {
|
||||||
|
|
||||||
public BasicBlock(String name, Material material, float hardness, float resistance) {
|
|
||||||
super(material);
|
|
||||||
setUnlocalizedName(name);
|
|
||||||
setRegistryName(name);
|
|
||||||
setHardness(hardness);
|
|
||||||
setResistance(resistance);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public BasicBlock(String name, Material material, float hardness, float resistance) {
|
||||||
|
super(material);
|
||||||
|
setUnlocalizedName(name);
|
||||||
|
setRegistryName(name);
|
||||||
|
setHardness(hardness);
|
||||||
|
setResistance(resistance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockAdamantiteOre extends BasicBlock{
|
public class BlockAdamantiteOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockAdamantiteOre() {
|
|
||||||
super("adamantite_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockAdamantiteOre() {
|
||||||
|
super("adamantite_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockArcaniteOre extends BasicBlock{
|
public class BlockArcaniteOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockArcaniteOre() {
|
|
||||||
super("arcanite_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockArcaniteOre() {
|
||||||
|
super("arcanite_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockBasalt extends BasicBlock{
|
public class BlockBasalt extends BasicBlock {
|
||||||
|
|
||||||
public BlockBasalt() {
|
|
||||||
super("basalt", Material.ROCK, 12.0f, 2.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockBasalt() {
|
||||||
|
super("basalt", Material.ROCK, 12.0f, 2.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockBismuthOre extends BasicBlock{
|
public class BlockBismuthOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockBismuthOre() {
|
|
||||||
super("bismuth_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockBismuthOre() {
|
||||||
|
super("bismuth_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockEterniteOre extends BasicBlock{
|
public class BlockEterniteOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockEterniteOre() {
|
|
||||||
super("eternite_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockEterniteOre() {
|
||||||
|
super("eternite_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockKarmesineOre extends BasicBlock{
|
public class BlockKarmesineOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockKarmesineOre() {
|
|
||||||
super("karmesine_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockKarmesineOre() {
|
||||||
|
super("karmesine_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockLigniteOre extends BasicBlock{
|
public class BlockLigniteOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockLigniteOre() {
|
|
||||||
super("lignite_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockLigniteOre() {
|
||||||
|
super("lignite_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockMeteoriteOre extends BasicBlock{
|
public class BlockMeteoriteOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockMeteoriteOre() {
|
|
||||||
super("meteorite_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockMeteoriteOre() {
|
||||||
|
super("meteorite_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockMindoriteOre extends BasicBlock{
|
public class BlockMindoriteOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockMindoriteOre() {
|
|
||||||
super("mindorite_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockMindoriteOre() {
|
||||||
|
super("mindorite_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockMythrilOre extends BasicBlock{
|
public class BlockMythrilOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockMythrilOre() {
|
|
||||||
super("mythril_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockMythrilOre() {
|
||||||
|
super("mythril_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockPalladiumOre extends BasicBlock{
|
public class BlockPalladiumOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockPalladiumOre() {
|
|
||||||
super("palladium_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockPalladiumOre() {
|
||||||
|
super("palladium_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockPrometheumOre extends BasicBlock{
|
public class BlockPrometheumOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockPrometheumOre() {
|
|
||||||
super("prometheum_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockPrometheumOre() {
|
||||||
|
super("prometheum_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockRottenGround extends BasicBlock{
|
public class BlockRottenGround extends BasicBlock {
|
||||||
|
|
||||||
public BlockRottenGround() {
|
|
||||||
super("rotten_ground", Material.GROUND, 1.0f, 1.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockRottenGround() {
|
||||||
|
super("rotten_ground", Material.GROUND, 1.0f, 1.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockSlagironOre extends BasicBlock{
|
public class BlockSlagironOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockSlagironOre() {
|
|
||||||
super("slagiron_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockSlagironOre() {
|
||||||
|
super("slagiron_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockTiberiumOre extends BasicBlock{
|
public class BlockTiberiumOre extends BasicBlock {
|
||||||
|
|
||||||
public BlockTiberiumOre() {
|
|
||||||
super("tiberium_ore", Material.ROCK, 3.0f, 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public BlockTiberiumOre() {
|
||||||
|
super("tiberium_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,9 @@ package blocks;
|
|||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
public class BlockVibraniumre extends BasicBlock{
|
public class BlockVibraniumre extends BasicBlock {
|
||||||
|
|
||||||
public BlockVibraniumre() {
|
public BlockVibraniumre() {
|
||||||
super("vibranium_ore", Material.ROCK, 3.0f, 5.0f);
|
super("vibranium_ore", Material.ROCK, 3.0f, 5.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@@ -2,11 +2,10 @@ package items;
|
|||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
public class BasicItem extends Item{
|
public class BasicItem extends Item {
|
||||||
|
|
||||||
public BasicItem(String name) {
|
|
||||||
setUnlocalizedName(name);
|
|
||||||
setRegistryName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
BasicItem(String name) {
|
||||||
|
setUnlocalizedName(name);
|
||||||
|
setRegistryName(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
package items;
|
package items;
|
||||||
|
|
||||||
public class ItemSlagiron extends BasicItem{
|
public class ItemSlagiron extends BasicItem {
|
||||||
|
|
||||||
public ItemSlagiron() {
|
|
||||||
super("slagiron");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
public ItemSlagiron() {
|
||||||
|
super("slagiron");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -32,83 +32,73 @@ import proxy.ServerProxy;
|
|||||||
@Mod(modid = ZCompression.MODID, version = ZCompression.VERSION)
|
@Mod(modid = ZCompression.MODID, version = ZCompression.VERSION)
|
||||||
public class ZCompression {
|
public class ZCompression {
|
||||||
|
|
||||||
public static final String MODID = "zcompression";
|
static final String MODID = "zcompression";
|
||||||
public static final String VERSION = "1.0";
|
static final String VERSION = "1.0";
|
||||||
|
|
||||||
@SidedProxy(clientSide = "proxy.ClientProxy", serverSide = "proxy.ServerProxy")
|
@SidedProxy(clientSide = "proxy.ClientProxy", serverSide = "proxy.ServerProxy")
|
||||||
public static ServerProxy proxy;
|
private static ServerProxy proxy;
|
||||||
|
|
||||||
// Items
|
// Items
|
||||||
public static ItemSlagiron slagiron = new ItemSlagiron();
|
public static ItemSlagiron slagiron = new ItemSlagiron();
|
||||||
|
|
||||||
|
|
||||||
//Blocks, esp. for tconstruct
|
//Blocks, esp. for tconstruct
|
||||||
public static BlockAdamantiteOre adamantiteOre = new BlockAdamantiteOre();
|
public static BlockAdamantiteOre adamantiteOre = new BlockAdamantiteOre();
|
||||||
public static BlockArcaniteOre arcaniteOre = new BlockArcaniteOre();
|
public static BlockArcaniteOre arcaniteOre = new BlockArcaniteOre();
|
||||||
public static BlockBasalt basalt = new BlockBasalt();
|
public static BlockBasalt basalt = new BlockBasalt();
|
||||||
public static BlockBismuthOre bismuthOre = new BlockBismuthOre();
|
public static BlockBismuthOre bismuthOre = new BlockBismuthOre();
|
||||||
public static BlockEterniteOre eterniteOre = new BlockEterniteOre();
|
public static BlockEterniteOre eterniteOre = new BlockEterniteOre();
|
||||||
public static BlockKarmesineOre karmesineOre = new BlockKarmesineOre();
|
public static BlockKarmesineOre karmesineOre = new BlockKarmesineOre();
|
||||||
public static BlockLigniteOre ligniteOre = new BlockLigniteOre();
|
public static BlockLigniteOre ligniteOre = new BlockLigniteOre();
|
||||||
public static BlockMeteoriteOre meteoriteOre = new BlockMeteoriteOre();
|
public static BlockMeteoriteOre meteoriteOre = new BlockMeteoriteOre();
|
||||||
public static BlockMindoriteOre mindoriteOre = new BlockMindoriteOre();
|
public static BlockMindoriteOre mindoriteOre = new BlockMindoriteOre();
|
||||||
public static BlockMythrilOre mythrilOre = new BlockMythrilOre();
|
public static BlockMythrilOre mythrilOre = new BlockMythrilOre();
|
||||||
public static BlockPalladiumOre palladiumOre = new BlockPalladiumOre();
|
public static BlockPalladiumOre palladiumOre = new BlockPalladiumOre();
|
||||||
public static BlockPrometheumOre prometheumOre = new BlockPrometheumOre();
|
public static BlockPrometheumOre prometheumOre = new BlockPrometheumOre();
|
||||||
public static BlockRottenGround rottenGround = new BlockRottenGround();
|
public static BlockRottenGround rottenGround = new BlockRottenGround();
|
||||||
public static BlockSlagironOre slagironOre = new BlockSlagironOre();
|
public static BlockSlagironOre slagironOre = new BlockSlagironOre();
|
||||||
public static BlockTiberiumOre tiberiumOre = new BlockTiberiumOre();
|
public static BlockTiberiumOre tiberiumOre = new BlockTiberiumOre();
|
||||||
public static BlockVibraniumre vibraniumOre = new BlockVibraniumre();
|
public static BlockVibraniumre vibraniumOre = new BlockVibraniumre();
|
||||||
|
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void preInit(FMLPreInitializationEvent e) {
|
||||||
|
GameRegistry.register(slagiron);
|
||||||
|
registerBlock(adamantiteOre);
|
||||||
|
registerBlock(arcaniteOre);
|
||||||
|
registerBlock(basalt);
|
||||||
|
registerBlock(bismuthOre);
|
||||||
|
registerBlock(eterniteOre);
|
||||||
|
registerBlock(karmesineOre);
|
||||||
@EventHandler
|
registerBlock(ligniteOre);
|
||||||
public void preInit(FMLPreInitializationEvent e){
|
registerBlock(meteoriteOre);
|
||||||
GameRegistry.register(slagiron);
|
registerBlock(mindoriteOre);
|
||||||
registerBlock(adamantiteOre);
|
registerBlock(mythrilOre);
|
||||||
registerBlock(arcaniteOre);
|
registerBlock(palladiumOre);
|
||||||
registerBlock(basalt);
|
registerBlock(prometheumOre);
|
||||||
registerBlock(bismuthOre);
|
registerBlock(rottenGround);
|
||||||
registerBlock(eterniteOre);
|
registerBlock(slagironOre);
|
||||||
registerBlock(karmesineOre);
|
registerBlock(tiberiumOre);
|
||||||
registerBlock(ligniteOre);
|
registerBlock(vibraniumOre);
|
||||||
registerBlock(meteoriteOre);
|
|
||||||
registerBlock(mindoriteOre);
|
}
|
||||||
registerBlock(mythrilOre);
|
|
||||||
registerBlock(palladiumOre);
|
@EventHandler
|
||||||
registerBlock(prometheumOre);
|
public void init(FMLInitializationEvent e) {
|
||||||
registerBlock(rottenGround);
|
proxy.registerClientStuff();
|
||||||
registerBlock(slagironOre);
|
GameRegistry.registerWorldGenerator(new ZWorldGen(), 100);
|
||||||
registerBlock(tiberiumOre);
|
|
||||||
registerBlock(vibraniumOre);
|
}
|
||||||
|
|
||||||
}
|
@EventHandler
|
||||||
|
public void postInit(FMLPostInitializationEvent e) {
|
||||||
@EventHandler
|
|
||||||
public void init(FMLInitializationEvent e){
|
}
|
||||||
proxy.registerClientStuff();
|
|
||||||
GameRegistry.registerWorldGenerator(new ZWorldGen(), 100);
|
private static void registerBlock(BasicBlock block) {
|
||||||
|
GameRegistry.register(block);
|
||||||
}
|
GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
|
||||||
|
}
|
||||||
@EventHandler
|
|
||||||
public void postInit(FMLPostInitializationEvent e){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerBlock(BasicBlock block){
|
|
||||||
GameRegistry.register(block);
|
|
||||||
GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,39 +1,33 @@
|
|||||||
package main.util;
|
package main.util;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.block.state.pattern.BlockMatcher;
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class Generator {
|
public class Generator {
|
||||||
|
|
||||||
public static void generateOre(IBlockState state, Random random, int x, int z, World world, int chance, int minY, int maxY, int minSize, int maxSize){
|
public static void generateOre(IBlockState state, Random random, int x, int z, World world, int chance, int minY, int maxY, int minSize, int maxSize) {
|
||||||
generateOre(state, Blocks.STONE, random, x, z, world, chance, minY, maxY, minSize, maxSize);
|
generateOre(state, Blocks.STONE.getDefaultState(), random, x, z, world, chance, minY, maxY, minSize, maxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateNetherOre(IBlockState state, Random random, int x, int z, World world, int chance, int minY, int maxY, int minSize, int maxSize){
|
public static void generateNetherOre(IBlockState state, Random random, int x, int z, World world, int chance, int minY, int maxY, int minSize, int maxSize) {
|
||||||
generateOre(state, Blocks.NETHERRACK, random, x, z, world, chance, minY, maxY, minSize, maxSize);
|
generateOre(state, Blocks.NETHERRACK.getDefaultState(), random, x, z, world, chance, minY, maxY, minSize, maxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void generateOre(IBlockState state, Block replace, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize){
|
public static void generateOre(IBlockState state, IBlockState replace, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize) {
|
||||||
int size = minSize + random.nextInt(maxSize - minSize);
|
int size = minSize + random.nextInt(maxSize - minSize);
|
||||||
int height = maxY - minY;
|
int height = maxY - minY;
|
||||||
|
|
||||||
for(int i = 0; i < chance; i++) {
|
for (int i = 0; i < chance; i++) {
|
||||||
int posX = chunkX + random.nextInt(16);
|
int posX = chunkX + random.nextInt(16);
|
||||||
int posY = random.nextInt(height) + minY;
|
int posY = random.nextInt(height) + minY;
|
||||||
int posZ = chunkZ + random.nextInt(16);
|
int posZ = chunkZ + random.nextInt(16);
|
||||||
new WorldGenMinable(state, size, BlockMatcher.forBlock(replace)).generate(world, random, new BlockPos(posX, posY, posZ));
|
new WorldGenMinable(state, size, StateMatcher.forState(replace)).generate(world, random, new BlockPos(posX, posY, posZ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
21
src/main/java/main/util/StateMatcher.java
Normal file
21
src/main/java/main/util/StateMatcher.java
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package main.util;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
|
||||||
|
|
||||||
|
public class StateMatcher implements Predicate<IBlockState> {
|
||||||
|
private final IBlockState state;
|
||||||
|
|
||||||
|
private StateMatcher(IBlockState state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StateMatcher forState(IBlockState state) {
|
||||||
|
return new StateMatcher(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean apply(IBlockState state) {
|
||||||
|
return state != null && state.getBlock() == this.state.getBlock() && state.getMaterial() == this.state.getMaterial();
|
||||||
|
}
|
||||||
|
}
|
@@ -1,65 +1,56 @@
|
|||||||
package main.world;
|
package main.world;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.base.Predicates;
|
|
||||||
|
|
||||||
import main.ZCompression;
|
import main.ZCompression;
|
||||||
import main.util.Generator;
|
import main.util.Generator;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkGenerator;
|
import net.minecraft.world.chunk.IChunkGenerator;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraftforge.fml.common.IWorldGenerator;
|
import net.minecraftforge.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class ZWorldGen implements IWorldGenerator {
|
public class ZWorldGen implements IWorldGenerator {
|
||||||
|
private void nether(Random random, int x, int z, World world) {
|
||||||
|
Generator.generateNetherOre(ZCompression.adamantiteOre.getDefaultState(), random, x, z, world, 24, 1, 32, 2, 5);
|
||||||
|
Generator.generateNetherOre(ZCompression.tiberiumOre.getDefaultState(), random, x, z, world, 60, 1, 128, 2, 10);
|
||||||
|
Generator.generateNetherOre(ZCompression.palladiumOre.getDefaultState(), random, x, z, world, 15, 32, 64, 3, 6);
|
||||||
|
Generator.generateOre(ZCompression.prometheumOre.getDefaultState(), random, x, z, world, 20, 48, 64, 2, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void world(Random random, int x, int z, World world) {
|
||||||
private void nether(Random random, int x, int z, World world){
|
Generator.generateOre(ZCompression.slagironOre.getDefaultState(), random, x, z, world, 40, 8, 96, 5, 16);
|
||||||
Generator.generateNetherOre(ZCompression.adamantiteOre.getDefaultState(), random, x, z, world, 24, 1, 32, 2, 5);
|
Generator.generateOre(ZCompression.ligniteOre.getDefaultState(), random, x, z, world, 40, 8, 96, 5, 15);
|
||||||
Generator.generateNetherOre(ZCompression.tiberiumOre.getDefaultState(), random, x, z, world, 60, 1, 128, 2, 10);
|
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), random, x, z, world, 40, 8, 96, 2, 10);
|
||||||
Generator.generateNetherOre(ZCompression.palladiumOre.getDefaultState(), random, x, z, world, 15, 32, 64, 3, 6);
|
Generator.generateOre(ZCompression.basalt.getDefaultState(), Blocks.LAVA.getDefaultState(), random, x, z, world, 20, 8, 24, 2, 5);
|
||||||
Generator.generateOre(ZCompression.prometheumOre.getDefaultState(), random, x, z, world, 20, 48, 64, 2, 4);
|
Generator.generateOre(ZCompression.rottenGround.getDefaultState(), Blocks.DIRT.getDefaultState(), random, x, z, world, 25, 50, 70, 2, 15);
|
||||||
}
|
|
||||||
|
|
||||||
private void world(Random random, int x, int z, World world){
|
|
||||||
// Regular
|
|
||||||
Generator.generateOre(ZCompression.slagironOre.getDefaultState(), random, x, z, world, 40, 8, 96, 5, 16);
|
|
||||||
Generator.generateOre(ZCompression.ligniteOre.getDefaultState(), random, x, z, world, 40, 8, 96, 5, 15);
|
|
||||||
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(),random, x, z, world, 40, 8, 96, 2, 10);
|
|
||||||
Generator.generateOre(ZCompression.basalt.getDefaultState(), Blocks.LAVA, random, x, z, world, 20, 8, 24, 2, 5);
|
|
||||||
Generator.generateOre(ZCompression.rottenGround.getDefaultState(), Blocks.DIRT, random, x, z, world, 25, 50, 70, 2, 15);
|
|
||||||
|
|
||||||
Generator.generateOre(ZCompression.vibraniumOre.getDefaultState(), random, x, z, world, 16, 48, 64, 2, 4);
|
|
||||||
Generator.generateOre(ZCompression.mythrilOre.getDefaultState(), random, x, z, world, 16, 16, 32, 2, 4);
|
|
||||||
Generator.generateOre(ZCompression.meteoriteOre.getDefaultState(), random, x, z, world, 25, 0, 32, 3, 6);
|
|
||||||
Generator.generateOre(ZCompression.mindoriteOre.getDefaultState(), Blocks.STONE, random, x, z, world, 450, 32, 96, 3, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void end(Random random, int x, int z, World world){
|
Generator.generateOre(ZCompression.vibraniumOre.getDefaultState(), random, x, z, world, 16, 48, 64, 2, 4);
|
||||||
|
Generator.generateOre(ZCompression.mythrilOre.getDefaultState(), random, x, z, world, 16, 16, 32, 2, 4);
|
||||||
}
|
Generator.generateOre(ZCompression.meteoriteOre.getDefaultState(), random, x, z, world, 25, 0, 32, 3, 6);
|
||||||
|
Generator.generateOre(ZCompression.mindoriteOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 450, 32, 96, 3, 6);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
|
|
||||||
IChunkProvider chunkProvider) {
|
|
||||||
int x = chunkX * 16;
|
|
||||||
int z = chunkZ * 16;
|
|
||||||
switch(world.provider.getDimension()) {
|
|
||||||
case -1:
|
|
||||||
nether(random, x, z, world);
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
world(random, x, z, world);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
end(random, x, z, world);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
private void end(Random random, int x, int z, World world) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
|
||||||
|
IChunkProvider chunkProvider) {
|
||||||
|
int x = chunkX * 16;
|
||||||
|
int z = chunkZ * 16;
|
||||||
|
switch (world.provider.getDimension()) {
|
||||||
|
case -1:
|
||||||
|
nether(random, x, z, world);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
world(random, x, z, world);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
end(random, x, z, world);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,46 +1,42 @@
|
|||||||
package proxy;
|
package proxy;
|
||||||
|
|
||||||
import blocks.BasicBlock;
|
|
||||||
import items.BasicItem;
|
|
||||||
import main.ZCompression;
|
import main.ZCompression;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
public class ClientProxy extends ServerProxy{
|
public class ClientProxy extends ServerProxy {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void registerClientStuff() {
|
|
||||||
// Items
|
|
||||||
registerItemModel(ZCompression.slagiron);
|
|
||||||
|
|
||||||
// Blocks
|
|
||||||
registerBlockModel(ZCompression.adamantiteOre);
|
|
||||||
registerBlockModel(ZCompression.arcaniteOre);
|
|
||||||
registerBlockModel(ZCompression.basalt);
|
|
||||||
registerBlockModel(ZCompression.bismuthOre);
|
|
||||||
registerBlockModel(ZCompression.eterniteOre);
|
|
||||||
registerBlockModel(ZCompression.karmesineOre);
|
|
||||||
registerBlockModel(ZCompression.ligniteOre);
|
|
||||||
registerBlockModel(ZCompression.meteoriteOre);
|
|
||||||
registerBlockModel(ZCompression.mindoriteOre);
|
|
||||||
registerBlockModel(ZCompression.mythrilOre);
|
|
||||||
registerBlockModel(ZCompression.palladiumOre);
|
|
||||||
registerBlockModel(ZCompression.prometheumOre);
|
|
||||||
registerBlockModel(ZCompression.rottenGround);
|
|
||||||
registerBlockModel(ZCompression.slagironOre);
|
|
||||||
registerBlockModel(ZCompression.tiberiumOre);
|
|
||||||
registerBlockModel(ZCompression.vibraniumOre);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerItemModel(Item item){
|
|
||||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerBlockModel(Block block){
|
@Override
|
||||||
registerItemModel(Item.getItemFromBlock(block));
|
public void registerClientStuff() {
|
||||||
}
|
// Items
|
||||||
|
registerItemModel(ZCompression.slagiron);
|
||||||
|
|
||||||
|
// Blocks
|
||||||
|
registerBlockModel(ZCompression.adamantiteOre);
|
||||||
|
registerBlockModel(ZCompression.arcaniteOre);
|
||||||
|
registerBlockModel(ZCompression.basalt);
|
||||||
|
registerBlockModel(ZCompression.bismuthOre);
|
||||||
|
registerBlockModel(ZCompression.eterniteOre);
|
||||||
|
registerBlockModel(ZCompression.karmesineOre);
|
||||||
|
registerBlockModel(ZCompression.ligniteOre);
|
||||||
|
registerBlockModel(ZCompression.meteoriteOre);
|
||||||
|
registerBlockModel(ZCompression.mindoriteOre);
|
||||||
|
registerBlockModel(ZCompression.mythrilOre);
|
||||||
|
registerBlockModel(ZCompression.palladiumOre);
|
||||||
|
registerBlockModel(ZCompression.prometheumOre);
|
||||||
|
registerBlockModel(ZCompression.rottenGround);
|
||||||
|
registerBlockModel(ZCompression.slagironOre);
|
||||||
|
registerBlockModel(ZCompression.tiberiumOre);
|
||||||
|
registerBlockModel(ZCompression.vibraniumOre);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void registerBlockModel(Block block) {
|
||||||
|
registerItemModel(Item.getItemFromBlock(block));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void registerItemModel(Item item) {
|
||||||
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
package proxy;
|
package proxy;
|
||||||
|
|
||||||
public class ServerProxy {
|
public class ServerProxy {
|
||||||
|
|
||||||
public void registerClientStuff() {}
|
public void registerClientStuff() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user