18 Commits

Author SHA1 Message Date
4ba49b23a3 Merge pull request 'Update 'README.md'' (#20) from anonfunc-patch-1 into master
Reviewed-on: https://git.harting.dev/TAIGA/TAIGA/pulls/20
2020-08-27 16:54:42 +02:00
5320a955b9 Update 'README.md' 2020-08-27 16:54:21 +02:00
5dd38a4324 Merge pull request 'Update 'README.md'' (#16) from idlegandalf-patch-1 into master 2020-05-22 15:52:24 +02:00
d936c57e27 Update 'README.md' 2020-05-22 15:52:12 +02:00
18dc97de61 Merge pull request 'Update 'LICENSE'' (#12) from license-change into master 2020-05-04 04:56:47 +02:00
bfec4bc442 Update 'LICENSE' 2020-05-04 04:56:30 +02:00
1e7ab1fc49 Merge pull request 'Spawn Nether/End ores in Overworld if allow-nether is set to FALSE on server' (#7) from Blaster/TAIGA-OV:master into master 2020-04-23 15:18:03 +02:00
Blaster
18543ec172 Formatting fix 2020-02-13 17:21:11 +01:00
Blaster
cda20df501 Formatting fix 2020-02-13 17:16:52 +01:00
Blaster
ada8e9e004 Upload files to 'src/main/java/com/sosnitzka/taiga/world'
Formatting fixes
2020-02-13 17:14:05 +01:00
Blaster
9828cc1a66 Delete 'WorldGen.java' 2020-02-13 17:12:46 +01:00
Blaster
4f852b0d32 src/main/java/com/sosnitzka/taiga/world/ 2020-02-13 17:09:13 +01:00
Blaster
c509b4cdd9 Upload files to 'src/main/java/com/sosnitzka/taiga/world'
Reupload
2020-02-01 23:58:59 +01:00
Blaster
fd80efa354 Upload files to 'src/main/java/com/sosnitzka/taiga/world'
Edited source as requested
2019-12-20 04:03:43 +01:00
Blaster
5ff045ecac Upload files to 'src/main/java/com/sosnitzka/taiga/world' 2019-12-11 20:07:32 +01:00
4c4268aa3d Update 'README.md' 2019-07-26 00:38:23 +02:00
abdc6da21d moved harvest level translation to client proxy 2018-10-10 15:56:22 +02:00
1ff00daf4b updated forge, tconstuct 2018-10-08 03:38:27 +02:00
8 changed files with 225 additions and 17 deletions

View File

View File

@@ -1,4 +1,7 @@
![TAIGA IMAGE](/taiga.png?raw=true) > This project needs new maintainers, see #15.
![TAIGA IMAGE](https://git.harting.dev/TAIGA/TAIGA/raw/branch/master/taiga.png)
Tinkers Alloying Addon (TAIGA) Tinkers Alloying Addon (TAIGA)
=============== ===============

View File

@@ -11,7 +11,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.0.8' classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.1.0'
} }
} }
@@ -63,7 +63,7 @@ task buildInfo {
version = project.buildInfo.revision version = project.buildInfo.revision
minecraft { minecraft {
version = "1.12.2-14.23.4.2705" version = "1.12.2-14.23.5.2768"
runDir = "run" runDir = "run"
mappings = "snapshot_20170801" mappings = "snapshot_20170801"
replace '@VERSION@', project.version replace '@VERSION@', project.version
@@ -74,15 +74,9 @@ ext.mc_version = project.minecraft.version.split('-')[0]
version = "${mc_version}-${project.buildInfo.revision}" version = "${mc_version}-${project.buildInfo.revision}"
dependencies { dependencies {
//deobfCompile "codechicken:CodeChickenLib:1.9.4-2.0.2.39:deobf"
//deobfCompile "codechicken:CodeChickenCore:1.9.4-2.0.3.65:deobf"
//deobfCompile "codechicken:NotEnoughItems:1.9-${nei_version}:dev"
deobfCompile "slimeknights.mantle:Mantle:1.12-1.3.+:deobf" deobfCompile "slimeknights.mantle:Mantle:1.12-1.3.+:deobf"
//Old: deobfCompile "slimeknights.mantle:Mantle:1.9-0.10.0.jenkins132:deobf"
deobfCompile "mezz.jei:jei_1.12.2:4.+" deobfCompile "mezz.jei:jei_1.12.2:4.+"
deobfCompile "slimeknights:TConstruct:1.12.2-2.9.+:deobf" deobfCompile "slimeknights:TConstruct:1.12.2-2.10.+:deobf"
//compile files('libs/TConstruct-1.9-2.3.1.DEV.1d4c1de-deobf.jar')
//compile group: 'com.google.guava', name: 'guava', version: '20.0'
} }
sourceSets { sourceSets {
@@ -139,7 +133,7 @@ curseforge {
} }
relations { relations {
requiredLibrary 'tinkers-construct' requiredDependency 'tinkers-construct'
} }
} }
} }

View File

@@ -5,8 +5,6 @@ import com.sosnitzka.taiga.proxy.CommonProxy;
import com.sosnitzka.taiga.recipes.CraftingRegistry; import com.sosnitzka.taiga.recipes.CraftingRegistry;
import com.sosnitzka.taiga.recipes.SmeltingRegistry; import com.sosnitzka.taiga.recipes.SmeltingRegistry;
import com.sosnitzka.taiga.world.WorldGen; import com.sosnitzka.taiga.world.WorldGen;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.SidedProxy;
@@ -32,7 +30,7 @@ import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
public class TAIGA { public class TAIGA {
public static final String MODID = "taiga"; public static final String MODID = "taiga";
public static final String VERSION = "@VERSION@"; public static final String VERSION = "1.12.2-1.3.3";
public static final String GUIFACTORY = "com.sosnitzka.taiga.TAIGAGuiFactory"; public static final String GUIFACTORY = "com.sosnitzka.taiga.TAIGAGuiFactory";
public static Logger logger; public static Logger logger;
@@ -66,9 +64,7 @@ public class TAIGA {
// GameRegistry.registerFuelHandler(new FuelHandler()); Registeres fuels' burn times // GameRegistry.registerFuelHandler(new FuelHandler()); Registeres fuels' burn times
// Adds new harvest levels' names // Adds new harvest levels' names
harvestLevelNames.put(DURANITE, I18n.format("harvestlevel.duranite", TextFormatting.GREEN, TextFormatting.RESET)); proxy.registerHarvestLevels();
harvestLevelNames.put(VALYRIUM, I18n.format("harvestlevel.valyrium", TextFormatting.GOLD, TextFormatting.RESET));
harvestLevelNames.put(VIBRANIUM, I18n.format("harvestlevel.vibranium", TextFormatting.DARK_PURPLE, TextFormatting.RESET));
Blocks.register(true); Blocks.register(true);

View File

@@ -12,9 +12,11 @@ import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry;
@@ -31,6 +33,7 @@ import static com.sosnitzka.taiga.Fluids.*;
import static com.sosnitzka.taiga.Keybindings.altKey; import static com.sosnitzka.taiga.Keybindings.altKey;
import static com.sosnitzka.taiga.MaterialTraits.*; import static com.sosnitzka.taiga.MaterialTraits.*;
import static slimeknights.mantle.client.book.BookLoader.registerPageType; import static slimeknights.mantle.client.book.BookLoader.registerPageType;
import static slimeknights.tconstruct.library.utils.HarvestLevels.harvestLevelNames;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class ClientProxy extends CommonProxy { public class ClientProxy extends CommonProxy {
@@ -164,4 +167,11 @@ public class ClientProxy extends CommonProxy {
return location; return location;
} }
} }
@Override
public void registerHarvestLevels() {
harvestLevelNames.put(DURANITE, I18n.format("harvestlevel.duranite", TextFormatting.GREEN, TextFormatting.RESET));
harvestLevelNames.put(VALYRIUM, I18n.format("harvestlevel.valyrium", TextFormatting.GOLD, TextFormatting.RESET));
harvestLevelNames.put(VIBRANIUM, I18n.format("harvestlevel.vibranium", TextFormatting.DARK_PURPLE, TextFormatting.RESET));
}
} }

View File

@@ -5,6 +5,9 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import slimeknights.tconstruct.library.materials.Material; import slimeknights.tconstruct.library.materials.Material;
import static com.sosnitzka.taiga.MaterialTraits.*;
import static slimeknights.tconstruct.library.utils.HarvestLevels.harvestLevelNames;
public class CommonProxy { public class CommonProxy {
public void registerModels() { public void registerModels() {
@@ -31,4 +34,10 @@ public class CommonProxy {
public void regsiterKeyBindings() { public void regsiterKeyBindings() {
} }
public void registerHarvestLevels() {
harvestLevelNames.put(DURANITE, "harvestlevel.duranite");
harvestLevelNames.put(VALYRIUM, "harvestlevel.valyrium");
harvestLevelNames.put(VIBRANIUM, "harvestlevel.vibranium");
}
} }

View File

@@ -122,6 +122,26 @@ public class WorldGen implements IWorldGenerator {
Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z,
world, ABYSSUM_VAL, 4, 64); world, ABYSSUM_VAL, 4, 64);
} }
/** Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures */
private void worldNetherless(Random random, int x, int z, World world) {
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
world, URU_VAL, 2, 0, 96, 3);
Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world,
AURORIUM_VAL, 8, 48, 2, 4);
Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
world, PALLADIUM_VAL, 12, 64, 2, 4);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z,
world, ABYSSUM_VAL, 4, 6);
Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, TIBERIUM_VAL, 16, 128, 10, 35);
Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, PROMETHEUM_VAL, 0, 32, 2, 4);
Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, VALYRIUM_VAL, 0, 128, 2, 4);
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
}
@Override @Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
@@ -134,6 +154,11 @@ public class WorldGen implements IWorldGenerator {
break; break;
case 0: case 0:
world(random, x, z, world); world(random, x, z, world);
if(!net.minecraft.server.MinecraftServer.getAllowNether()) {
/** worldNetherless generates nether/end ores in overworld */
worldNetherless(random, x, z, world);
}
break; break;
case 1: case 1:
end(random, x, z, world); end(random, x, z, world);

View File

@@ -0,0 +1,171 @@
package com.sosnitzka.taiga.world;
import com.sosnitzka.taiga.TAIGA;
import com.sosnitzka.taiga.util.Generator;
import net.minecraft.block.BlockStone;
import net.minecraft.init.Biomes;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
import java.util.*;
import static com.google.common.collect.Lists.newArrayList;
import static com.sosnitzka.taiga.Blocks.*;
import static com.sosnitzka.taiga.TAIGAConfiguration.*;
@SuppressWarnings("unchecked")
public class WorldGen implements IWorldGenerator {
private static WorldGen INSTANCE;
private final List<Integer> blackList = new ArrayList();
private final Map<Integer, Integer> meteorGenStats = new HashMap();
private final Map<Integer, Integer> meteorChunkStats = new HashMap();
public static WorldGen getInstance() {
if (INSTANCE == null)
INSTANCE = new WorldGen();
return INSTANCE;
}
private void nether(Random random, int x, int z, World world) {
Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
world, TIBERIUM_VAL, 32, 128, 10, 35);
Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
world, PROMETHEUM_VAL, 0, 32, 2, 4);
Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
world, VALYRIUM_VAL, 0, 128, 2, 4);
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
}
private void other(Random random, int x, int z, World world) {
int dim = world.provider.getDimension();
if (!meteorGenStats.containsKey(dim))
meteorGenStats.put(dim, 0);
if (!meteorChunkStats.containsKey(dim))
meteorChunkStats.put(dim, 0);
meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1);
meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre
.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112));
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
random, x, z, world, EEZO_VAL, 0, 10);
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
world, KARMESINE_VAL);
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
world, OVIUM_VAL);
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, JAUXUM_VAL);
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
15, 0, 128, 1, 5, null);
if (ironGen) {
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
world, IRON_VAL, 0, 32, 2, 8);
}
if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) {
blackList.add(dim);
TAIGA.logger.info(String.format("Detected void dimension, adding to blacklist: %d", dim));
}
}
private void world(Random random, int x, int z, World world) {
Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z,
world, DURANITE_VAL, 6, 16, 112);
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
random, x, z, world, EEZO_VAL, 0, 10);
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
world, KARMESINE_VAL);
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
world, OVIUM_VAL);
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, JAUXUM_VAL);
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
15, 0, 128, 1, 5, null);
if (ironGen) {
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
world, IRON_VAL, 0, 32, 2, 8);
}
}
private void end(Random random, int x, int z, World world) {
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
world, URU_VAL, 2, 0, 96, 3);
if (endGen)
Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null,
random, x, z, world, 1, 100, 3, 64, 3, 8, null);
Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world,
AURORIUM_VAL, 32, 48, 2, 4);
Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z,
world, PALLADIUM_VAL, 48, 64, 2, 4);
Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z,
world, ABYSSUM_VAL, 4, 64);
}
/** Spawns nether/end ores in the Overworld if the server has allow-nether set to 0 WIP: needs alternate textures */
private void worldNetherless(Random random, int x, int z, World world) {
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
world, URU_VAL, 2, 0, 96, 3);
Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world,
AURORIUM_VAL, 8, 48, 2, 4);
Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
world, PALLADIUM_VAL, 12, 64, 2, 4);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), abyssumOre.getDefaultState(), random, x, z,
world, ABYSSUM_VAL, 4, 6);
Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, TIBERIUM_VAL, 16, 128, 10, 35);
Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, PROMETHEUM_VAL, 0, 32, 2, 4);
Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, VALYRIUM_VAL, 0, 128, 2, 4);
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
}
@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);
if (!net.minecraft.server.MinecraftServer.getAllowNether()) {
/** worldNetherless generates nether/end ores in overworld */
worldNetherless(random, x, z, world);
}
break;
case 1:
end(random, x, z, world);
break;
default:
if (!blackList.contains(world.provider.getDimension()))
other(random, x, z, world);
break;
}
}
}