Compare commits
27 Commits
1.3.1
...
idlegandal
Author | SHA1 | Date | |
---|---|---|---|
d936c57e27 | |||
18dc97de61 | |||
bfec4bc442 | |||
1e7ab1fc49 | |||
![]() |
18543ec172 | ||
![]() |
cda20df501 | ||
![]() |
ada8e9e004 | ||
![]() |
9828cc1a66 | ||
![]() |
4f852b0d32 | ||
![]() |
c509b4cdd9 | ||
![]() |
fd80efa354 | ||
![]() |
5ff045ecac | ||
4c4268aa3d | |||
abdc6da21d | |||
1ff00daf4b | |||
804a02d3fd | |||
adf19453c5 | |||
7e4c4baf05 | |||
809c10ef51 | |||
![]() |
058ec404a2 | ||
2227b0017e | |||
05ebd28180 | |||
468a5e4aac | |||
e98fc61144 | |||
f4befa63c9 | |||
ddb56b6043 | |||
d585d781f6 |
23
README.md
23
README.md
@@ -1,10 +1,12 @@
|
|||||||

|
> This project needs new maintainers, see #15.
|
||||||
|
|
||||||
Tinkers Alloying Addon(TAIGA)
|
|
||||||
|

|
||||||
|
|
||||||
|
Tinkers Alloying Addon (TAIGA)
|
||||||
===============
|
===============
|
||||||
[![][cq img]][cq] [![][license img]][license]
|
|
||||||
|
|
||||||
TAIGA is an addon for Tinkers Construct. It aims to find new minable ores, new alloys and a bunch of new tinker traits for them.
|
TAIGA is an addon for Tinkers Construct. It adds new minable ores, new alloys and a bunch of new tinker traits for them.
|
||||||
|
|
||||||
Included:
|
Included:
|
||||||
* 16 new meltable Ores with 4 new hardness levels (5,6,7,8)
|
* 16 new meltable Ores with 4 new hardness levels (5,6,7,8)
|
||||||
@@ -22,13 +24,9 @@ Download
|
|||||||
Dependencies
|
Dependencies
|
||||||
===============
|
===============
|
||||||
Necessary:
|
Necessary:
|
||||||
* Tinkers Construct for 1.10.2 + associated version of mantle
|
* Tinkers Construct for 1.12.2 + associated version of mantle
|
||||||
* Minecraft Forge 1.10.2
|
* Minecraft Forge 1.12.2
|
||||||
|
|
||||||
Latest tests done with:
|
|
||||||
|
|
||||||
* [Tinkers Construct 2.5.5](http://minecraft.curseforge.com/projects/tinkers-construct/files)
|
|
||||||
* [Minecraft Forge 12.18.2.2107](http://files.minecraftforge.net/)
|
|
||||||
|
|
||||||
What's going on?
|
What's going on?
|
||||||
===
|
===
|
||||||
@@ -65,8 +63,3 @@ More? Join our community on mumble (ofsg.eu) for questions or to have a nice cha
|
|||||||
#### License
|
#### License
|
||||||
|
|
||||||
This project is licensed under the conditions of the GNU GPL 3.0.
|
This project is licensed under the conditions of the GNU GPL 3.0.
|
||||||
|
|
||||||
[license]:LICENSE
|
|
||||||
[license img]:https://img.shields.io/github/license/zkaface/taiga.svg?style=flat-square
|
|
||||||
[cq]:https://www.codacy.com/app/chefeificationful/TAIGA
|
|
||||||
[cq img]:https://img.shields.io/codacy/69a9cf26620e4a159c99b62c264d64bb.svg?style=flat-square
|
|
||||||
|
14
build.gradle
14
build.gradle
@@ -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'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,5 @@
|
|||||||
#Wed Jul 20 03:42:23 CEST 2016
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
|
|
||||||
|
26
gradlew
vendored
26
gradlew
vendored
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
##
|
||||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
|||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
|
|
||||||
warn ( ) {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
die ( ) {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
@@ -154,11 +154,19 @@ if $cygwin ; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
# Escape application args
|
||||||
function splitJvmOpts() {
|
save () {
|
||||||
JVM_OPTS=("$@")
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
}
|
}
|
||||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
APP_ARGS=$(save "$@")
|
||||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
|
||||||
|
|
||||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
|
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
|
6
gradlew.bat
vendored
6
gradlew.bat
vendored
@@ -49,7 +49,6 @@ goto fail
|
|||||||
@rem Get command-line arguments, handling Windows variants
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
|
||||||
|
|
||||||
:win9xME_args
|
:win9xME_args
|
||||||
@rem Slurp the command line arguments.
|
@rem Slurp the command line arguments.
|
||||||
@@ -60,11 +59,6 @@ set _SKIP=2
|
|||||||
if "x%~1" == "x" goto execute
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
set CMD_LINE_ARGS=%*
|
||||||
goto execute
|
|
||||||
|
|
||||||
:4NT_args
|
|
||||||
@rem Get arguments from the 4NT Shell from JP Software
|
|
||||||
set CMD_LINE_ARGS=%$
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
@@ -24,7 +24,6 @@ import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
|
|||||||
|
|
||||||
public class Blocks {
|
public class Blocks {
|
||||||
|
|
||||||
|
|
||||||
// blocks and ores spawned via worldgen
|
// blocks and ores spawned via worldgen
|
||||||
public static Block basaltBlock = new BasicBlock("basalt_block", Material.ROCK, 20.0f, 35.0f, IRON, PREFIX_BLOCK);
|
public static Block basaltBlock = new BasicBlock("basalt_block", Material.ROCK, 20.0f, 35.0f, IRON, PREFIX_BLOCK);
|
||||||
public static Block tiberiumOre = new BlockTiberium();
|
public static Block tiberiumOre = new BlockTiberium();
|
||||||
|
@@ -58,7 +58,6 @@ public class Fluids {
|
|||||||
public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite_fluid", 0xFFCCFF00, 3100, 10, 5000);
|
public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite_fluid", 0xFFCCFF00, 3100, 10, 5000);
|
||||||
|
|
||||||
// Community
|
// Community
|
||||||
|
|
||||||
public static BasicTinkerFluid dilithiumFluid = new BasicTinkerFluid("dilithium_fluid", 0xFF79aea6, 1500, 10, 5000);
|
public static BasicTinkerFluid dilithiumFluid = new BasicTinkerFluid("dilithium_fluid", 0xFF79aea6, 1500, 10, 5000);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +102,6 @@ public class Fluids {
|
|||||||
TinkerRegistry.registerMelting(Items.dilithiumCrystal, dilithiumFluid, 72);
|
TinkerRegistry.registerMelting(Items.dilithiumCrystal, dilithiumFluid, 72);
|
||||||
TinkerRegistry.registerMelting(Items.tiberiumCrystal, tiberiumFluid, 72);
|
TinkerRegistry.registerMelting(Items.tiberiumCrystal, tiberiumFluid, 72);
|
||||||
|
|
||||||
|
|
||||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(magmaFluid, 50), 100);
|
TinkerRegistry.registerSmelteryFuel(new FluidStack(magmaFluid, 50), 100);
|
||||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(nitroniteFluid, 100), 500);
|
TinkerRegistry.registerSmelteryFuel(new FluidStack(nitroniteFluid, 100), 500);
|
||||||
TinkerRegistry.registerSmelteryFuel(new FluidStack(dilithiumFluid, 50), 100);
|
TinkerRegistry.registerSmelteryFuel(new FluidStack(dilithiumFluid, 50), 100);
|
||||||
|
8
src/main/java/com/sosnitzka/taiga/Keybindings.java
Normal file
8
src/main/java/com/sosnitzka/taiga/Keybindings.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package com.sosnitzka.taiga;
|
||||||
|
|
||||||
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
public class Keybindings {
|
||||||
|
public static KeyBinding altKey = new KeyBinding("key.taiga.alt_action", Keyboard.KEY_LCONTROL, "TAIGA");
|
||||||
|
}
|
@@ -19,7 +19,7 @@ public class MaterialTraits {
|
|||||||
public static final int VIBRANIUM = 7;
|
public static final int VIBRANIUM = 7;
|
||||||
|
|
||||||
// Init of new traits
|
// Init of new traits
|
||||||
public static final AbstractTrait instable = new TraitInstable();
|
public static final AbstractTrait instable = new TraitUnstable();
|
||||||
public static final AbstractTrait naturebound = new TraitNatureBound();
|
public static final AbstractTrait naturebound = new TraitNatureBound();
|
||||||
public static final AbstractTrait softy = new TraitSofty();
|
public static final AbstractTrait softy = new TraitSofty();
|
||||||
public static final AbstractTrait curvature = new TraitCurvature();
|
public static final AbstractTrait curvature = new TraitCurvature();
|
||||||
@@ -56,7 +56,7 @@ public class MaterialTraits {
|
|||||||
public static final AbstractTrait mutate = new TraitMutate();
|
public static final AbstractTrait mutate = new TraitMutate();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Assign traits to related materials. <br>
|
* Assign traits to related materials. <br>
|
||||||
* <p>
|
* <p>
|
||||||
* <p> Example:
|
* <p> Example:
|
||||||
|
@@ -5,7 +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.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;
|
||||||
@@ -31,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;
|
||||||
|
|
||||||
@@ -58,15 +57,14 @@ public class TAIGA {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void init(FMLInitializationEvent e) {
|
public void init(FMLInitializationEvent e) {
|
||||||
proxy.registerModels(); // Registers models on the client side
|
proxy.registerModels(); // Registers models on the client side
|
||||||
|
proxy.regsiterKeyBindings();
|
||||||
|
|
||||||
Fluids.registerfromItem(); // Registers some special smeltery recipes (not alloying)
|
Fluids.registerfromItem(); // Registers some special smeltery recipes (not alloying)
|
||||||
GameRegistry.registerWorldGenerator(WorldGen.getInstance(), 100); // Generates ores
|
GameRegistry.registerWorldGenerator(WorldGen.getInstance(), 100); // Generates ores
|
||||||
// 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, TextFormatting.DARK_GREEN + "Duranite");
|
proxy.registerHarvestLevels();
|
||||||
harvestLevelNames.put(VALYRIUM, TextFormatting.GOLD + "Valyrium");
|
|
||||||
harvestLevelNames.put(VIBRANIUM, TextFormatting.DARK_PURPLE + "Vibranium");
|
|
||||||
|
|
||||||
Blocks.register(true);
|
Blocks.register(true);
|
||||||
|
|
||||||
|
@@ -1,34 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.blocks;
|
|
||||||
|
|
||||||
import com.sosnitzka.taiga.generic.BasicBlock;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class BlockLignite extends BasicBlock {
|
|
||||||
|
|
||||||
public BlockLignite() {
|
|
||||||
super("lignite_ore", Material.ROCK, 4.0f, 5.0f, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
|
|
||||||
Random rand = world instanceof World ? ((World) world).rand : new Random();
|
|
||||||
int r = RANDOM.nextInt(11);
|
|
||||||
if (r > 7) {
|
|
||||||
return MathHelper.getInt(rand, 0, 10) + fortune;
|
|
||||||
} else return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@ParametersAreNonnullByDefault
|
|
||||||
public int quantityDropped(IBlockState state, int fortune, Random random) {
|
|
||||||
return random.nextInt(3) + 1 + fortune;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,68 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.blocks;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
import net.minecraft.util.NonNullList;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.mantle.block.EnumBlock;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class BlockMetal extends EnumBlock<BlockMetal.MetalTypes> {
|
|
||||||
|
|
||||||
public static final PropertyEnum<MetalTypes> TYPE = PropertyEnum.create("type", MetalTypes.class);
|
|
||||||
|
|
||||||
public BlockMetal() {
|
|
||||||
super(Material.IRON, TYPE, MetalTypes.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
|
||||||
for (MetalTypes type : MetalTypes.values()) {
|
|
||||||
list.add(new ItemStack(this, 1, type.getMeta()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum MetalTypes implements IStringSerializable, EnumBlock.IEnumMeta {
|
|
||||||
TIBERIUM,
|
|
||||||
AURODIUM,
|
|
||||||
PROMETHEUM,
|
|
||||||
ARCANITE,
|
|
||||||
TITANITE,
|
|
||||||
MYTHRIL,
|
|
||||||
URU,
|
|
||||||
VIBRANIUM,
|
|
||||||
ETERNITE,
|
|
||||||
FRACTORYTE,
|
|
||||||
PALLADIUM,
|
|
||||||
IGNITITE,
|
|
||||||
BISMUTH,
|
|
||||||
JAUXITE,
|
|
||||||
VIOLIUM,
|
|
||||||
KARMESINE;
|
|
||||||
|
|
||||||
public final int meta;
|
|
||||||
|
|
||||||
MetalTypes() {
|
|
||||||
meta = ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return this.toString().toLowerCase(Locale.US);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMeta() {
|
|
||||||
return meta;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@@ -1,68 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.blocks;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import slimeknights.mantle.block.EnumBlock;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class BlockOre extends EnumBlock<BlockOre.OreTypes> {
|
|
||||||
|
|
||||||
public static final PropertyEnum<OreTypes> TYPE = PropertyEnum.create("type", OreTypes.class);
|
|
||||||
|
|
||||||
public BlockOre() {
|
|
||||||
this(Material.ROCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockOre(Material material) {
|
|
||||||
super(material, TYPE, OreTypes.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public BlockRenderLayer getBlockLayer() {
|
|
||||||
return BlockRenderLayer.CUTOUT_MIPPED;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum OreTypes implements IStringSerializable, EnumBlock.IEnumMeta {
|
|
||||||
TIBERIUM,
|
|
||||||
AURODIUM,
|
|
||||||
PROMETHEUM,
|
|
||||||
ARCANITE,
|
|
||||||
TITANITE,
|
|
||||||
MYTHRIL,
|
|
||||||
URU,
|
|
||||||
VIBRANIUM,
|
|
||||||
ETERNITE,
|
|
||||||
FRACTORYTE,
|
|
||||||
PALLADIUM,
|
|
||||||
IGNITITE,
|
|
||||||
BISMUTH,
|
|
||||||
JAUXITE,
|
|
||||||
VIOLIUM,
|
|
||||||
KARMESINE;
|
|
||||||
|
|
||||||
public final int meta;
|
|
||||||
|
|
||||||
OreTypes() {
|
|
||||||
meta = ordinal();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return this.toString().toLowerCase(Locale.US);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMeta() {
|
|
||||||
return meta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.generic;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.SoundType;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
|
|
||||||
public class BasicBlockGround extends Block {
|
|
||||||
|
|
||||||
public BasicBlockGround(String name, Material material, float hardness, float resistance, int harvest) {
|
|
||||||
super(material);
|
|
||||||
setUnlocalizedName(name);
|
|
||||||
setRegistryName(name);
|
|
||||||
setHardness(hardness);
|
|
||||||
setResistance(resistance);
|
|
||||||
setHarvestLevel("shovel", harvest);
|
|
||||||
setSoundType(SoundType.GROUND);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -14,16 +14,6 @@ public class BasicItem extends Item {
|
|||||||
this.oreDictPrefix = oreDictPrefix;
|
this.oreDictPrefix = oreDictPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasicItem(String name, String oreDictPrefix, String registryname) {
|
|
||||||
setUnlocalizedName(name);
|
|
||||||
setRegistryName(registryname);
|
|
||||||
this.oreDictPrefix = oreDictPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BasicItem(String name) {
|
|
||||||
this(name, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOreDict() {
|
public boolean isOreDict() {
|
||||||
return this.oreDictPrefix != null;
|
return this.oreDictPrefix != null;
|
||||||
}
|
}
|
||||||
|
@@ -8,9 +8,6 @@ import slimeknights.tconstruct.library.fluid.FluidMolten;
|
|||||||
* A "wrapper" for FluidMolten that makes construction and manipulation easier
|
* A "wrapper" for FluidMolten that makes construction and manipulation easier
|
||||||
*/
|
*/
|
||||||
public class BasicTinkerFluid extends FluidMolten {
|
public class BasicTinkerFluid extends FluidMolten {
|
||||||
|
|
||||||
private boolean toolForge;
|
|
||||||
|
|
||||||
public BasicTinkerFluid(String fluidName, int color, int temp, int lumen, int visk) {
|
public BasicTinkerFluid(String fluidName, int color, int temp, int lumen, int visk) {
|
||||||
// Constructs the FluidMolten with textures and color
|
// Constructs the FluidMolten with textures and color
|
||||||
super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation
|
super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation
|
||||||
@@ -21,11 +18,5 @@ public class BasicTinkerFluid extends FluidMolten {
|
|||||||
this.setLuminosity(lumen);
|
this.setLuminosity(lumen);
|
||||||
this.setViscosity(visk);
|
this.setViscosity(visk);
|
||||||
this.setDensity(2000);
|
this.setDensity(2000);
|
||||||
this.toolForge = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean isToolForge() {
|
|
||||||
return toolForge;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,11 +12,14 @@ 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 slimeknights.mantle.client.book.repository.FileRepository;
|
import slimeknights.mantle.client.book.repository.FileRepository;
|
||||||
import slimeknights.tconstruct.library.book.TinkerBook;
|
import slimeknights.tconstruct.library.book.TinkerBook;
|
||||||
import slimeknights.tconstruct.library.client.MaterialRenderInfo;
|
import slimeknights.tconstruct.library.client.MaterialRenderInfo;
|
||||||
@@ -27,8 +30,10 @@ import javax.annotation.Nonnull;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
import static com.sosnitzka.taiga.Fluids.*;
|
import static com.sosnitzka.taiga.Fluids.*;
|
||||||
|
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 {
|
||||||
@@ -41,6 +46,11 @@ public class ClientProxy extends CommonProxy {
|
|||||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void regsiterKeyBindings() {
|
||||||
|
ClientRegistry.registerKeyBinding(altKey);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerModels() {
|
public void registerModels() {
|
||||||
Field[] itemFields = Items.class.getDeclaredFields();
|
Field[] itemFields = Items.class.getDeclaredFields();
|
||||||
@@ -157,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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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() {
|
||||||
@@ -27,4 +30,14 @@ public class CommonProxy {
|
|||||||
|
|
||||||
public void registerBookPages() {
|
public void registerBookPages() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void regsiterKeyBindings() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerHarvestLevels() {
|
||||||
|
harvestLevelNames.put(DURANITE, "harvestlevel.duranite");
|
||||||
|
harvestLevelNames.put(VALYRIUM, "harvestlevel.valyrium");
|
||||||
|
harvestLevelNames.put(VIBRANIUM, "harvestlevel.vibranium");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,15 +48,9 @@ public class CraftingRegistry {
|
|||||||
convertion(Item.getItemFromBlock(Blocks.blockMeteorite), Items.meteoriteIngot, Items.meteoriteNugget);
|
convertion(Item.getItemFromBlock(Blocks.blockMeteorite), Items.meteoriteIngot, Items.meteoriteNugget);
|
||||||
convertion(Item.getItemFromBlock(Blocks.blockObsidiorite), Items.obsidioriteIngot, Items.obsidioriteNugget);
|
convertion(Item.getItemFromBlock(Blocks.blockObsidiorite), Items.obsidioriteIngot, Items.obsidioriteNugget);
|
||||||
convertion(Item.getItemFromBlock(Blocks.dilithiumBlock), Items.dilithiumIngot, Items.dilithiumNugget);
|
convertion(Item.getItemFromBlock(Blocks.dilithiumBlock), Items.dilithiumIngot, Items.dilithiumNugget);
|
||||||
//convertion(Item.getItemFromBlock(Blocks.), Items., Items.);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void convertion(Item block, Item ingot, Item nugget) {
|
public static void convertion(Item block, Item ingot, Item nugget) {
|
||||||
//GameData.register_impl(new ShapedOreRecipe());
|
|
||||||
//GameData.register_impl(new ShapedOreRecipe(new ResourceLocation(""), new ItemStack(ingot), "###", "###",
|
|
||||||
// "###", '#', new ItemStack(nugget)));
|
|
||||||
//GameRegistry.addShapedRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(block), "###", "###", "###", '#', new ItemStack(ingot));
|
|
||||||
GameRegistry.addShapelessRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block
|
GameRegistry.addShapelessRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block
|
||||||
.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(ingot, 9), Ingredient.fromStacks(new
|
.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(ingot, 9), Ingredient.fromStacks(new
|
||||||
ItemStack(block)));
|
ItemStack(block)));
|
||||||
|
@@ -3,6 +3,6 @@ package com.sosnitzka.taiga.recipes;
|
|||||||
|
|
||||||
public class SmeltingRegistry {
|
public class SmeltingRegistry {
|
||||||
public static void register() {
|
public static void register() {
|
||||||
// OreDictionary.getOres("nuggetIron").get(OreDictionary.getOres("nuggetIron").size() - 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,8 @@ import slimeknights.tconstruct.library.utils.TagUtil;
|
|||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.Keybindings.altKey;
|
||||||
|
|
||||||
|
|
||||||
public class TraitBerserk extends TraitProgressiveStats {
|
public class TraitBerserk extends TraitProgressiveStats {
|
||||||
|
|
||||||
@@ -43,7 +45,6 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
return newDamage * 4;
|
return newDamage * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
@@ -53,11 +54,10 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
||||||
StatNBT distributed = getBonus(root);
|
StatNBT distributed = getBonus(root);
|
||||||
if (data.active) {
|
if (data.active) {
|
||||||
|
if (!TagUtil.hasEnchantEffect(root))
|
||||||
TagUtil.setEnchantEffect(root, true);
|
TagUtil.setEnchantEffect(root, true);
|
||||||
if (entity instanceof FakePlayer) {
|
|
||||||
return;
|
if (entity instanceof FakePlayer || entity.ticksExisted % TICK_PER_STAT != 0) {
|
||||||
}
|
|
||||||
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,10 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
ToolHelper.damageTool(tool, 1, player);
|
ToolHelper.damageTool(tool, 1, player);
|
||||||
TagUtil.setToolTag(root, stat.get());
|
TagUtil.setToolTag(root, stat.get());
|
||||||
setBonus(root, distributed);
|
setBonus(root, distributed);
|
||||||
} else TagUtil.setEnchantEffect(root, false);
|
} else {
|
||||||
|
if (TagUtil.hasEnchantEffect(root))
|
||||||
|
TagUtil.setEnchantEffect(root, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +80,7 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && altKey.isKeyDown()) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
NBTTagCompound root = TagUtil.getTagSafe(tool);
|
||||||
@@ -99,7 +102,6 @@ public class TraitBerserk extends TraitProgressiveStats {
|
|||||||
TagUtil.setExtraTag(root, tag);
|
TagUtil.setExtraTag(root, tag);
|
||||||
data.write(tag);
|
data.write(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,6 @@ public class TraitBright extends AbstractTrait {
|
|||||||
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
return super.damage(tool, player, target, damage, newDamage, isCritical);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
||||||
player, boolean wasEffective) {
|
player, boolean wasEffective) {
|
||||||
|
@@ -23,6 +23,8 @@ import slimeknights.tconstruct.library.utils.TagUtil;
|
|||||||
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
import slimeknights.tconstruct.library.utils.TinkerUtil;
|
||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
|
import static com.sosnitzka.taiga.Keybindings.altKey;
|
||||||
|
|
||||||
|
|
||||||
public class TraitCatcher extends AbstractTrait {
|
public class TraitCatcher extends AbstractTrait {
|
||||||
|
|
||||||
@@ -40,16 +42,24 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
return;
|
return;
|
||||||
if (event.getEntityLiving() instanceof EntityPlayer || event.getEntityLiving() instanceof EntityPlayerMP)
|
if (event.getEntityLiving() instanceof EntityPlayer || event.getEntityLiving() instanceof EntityPlayerMP)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
World w = event.getSource().getTrueSource().getEntityWorld();
|
World w = event.getSource().getTrueSource().getEntityWorld();
|
||||||
EntityPlayer p = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer p = (EntityPlayer) event.getSource().getTrueSource();
|
||||||
|
|
||||||
|
if (!TinkerUtil.hasTrait(TagUtil.getTagSafe(p.getHeldItemMainhand()), identifier))
|
||||||
|
return;
|
||||||
|
|
||||||
EntityLivingBase target = event.getEntityLiving();
|
EntityLivingBase target = event.getEntityLiving();
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(p.getHeldItemMainhand());
|
NBTTagCompound tag = TagUtil.getExtraTag(p.getHeldItemMainhand());
|
||||||
Data data = Data.read(tag);
|
Data data = Data.read(tag);
|
||||||
|
|
||||||
if (!data.mobClass.isEmpty())
|
if (!data.mobClass.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!w.isRemote && random.nextInt((int) target.getMaxHealth()) <= chance && target instanceof EntityLiving) {
|
if (!w.isRemote && random.nextInt((int) target.getMaxHealth()) <= chance && target instanceof EntityLiving) {
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
target.setDropItemsWhenDead(false);
|
target.setDropItemsWhenDead(false);
|
||||||
|
|
||||||
if (data.mobClass.isEmpty()) {
|
if (data.mobClass.isEmpty()) {
|
||||||
data.mobClass = target.getClass().getName();
|
data.mobClass = target.getClass().getName();
|
||||||
data.mobName = target.getName();
|
data.mobName = target.getName();
|
||||||
@@ -62,7 +72,6 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
@@ -75,13 +84,12 @@ public class TraitCatcher extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
BlockPos pos = event.getEntityPlayer().getPosition();
|
BlockPos pos = event.getEntityPlayer().getPosition();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && altKey.isKeyDown()) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Data data = Data.read(tag);
|
Data data = Data.read(tag);
|
||||||
if (!data.mobClass.isEmpty()) {
|
if (!data.mobClass.isEmpty()) {
|
||||||
|
@@ -20,8 +20,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
|
|
||||||
public class TraitCongenial extends AbstractTrait {
|
public class TraitCongenial extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public TraitCongenial() {
|
public TraitCongenial() {
|
||||||
super(TraitCongenial.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
super(TraitCongenial.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
@@ -13,7 +13,6 @@ public class TraitCrushing extends AbstractTrait {
|
|||||||
super(TraitCrushing.class.getSimpleName().toLowerCase().substring(5), TextFormatting.GRAY);
|
super(TraitCrushing.class.getSimpleName().toLowerCase().substring(5), TextFormatting.GRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent e) {
|
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent e) {
|
||||||
if (!e.getWorld().isRemote) {
|
if (!e.getWorld().isRemote) {
|
||||||
|
@@ -20,8 +20,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
public class TraitCursed extends AbstractTrait {
|
public class TraitCursed extends AbstractTrait {
|
||||||
|
|
||||||
private static int chance = 60 * 1000;
|
|
||||||
|
|
||||||
public TraitCursed() {
|
public TraitCursed() {
|
||||||
super(TraitCursed.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
super(TraitCursed.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
@@ -31,6 +29,7 @@ public class TraitCursed extends AbstractTrait {
|
|||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
|
int chance = 60 * 1000;
|
||||||
if (random.nextInt((chance + data.curse) / (data.curse + 1)) == 1) {
|
if (random.nextInt((chance + data.curse) / (data.curse + 1)) == 1) {
|
||||||
if (isSelected) data.curse += 10;
|
if (isSelected) data.curse += 10;
|
||||||
else data.curse++;
|
else data.curse++;
|
||||||
|
@@ -62,16 +62,7 @@ public class TraitDecay extends TraitProgressiveStats {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
if (entity instanceof FakePlayer || entity.world.isRemote) {
|
if (entity instanceof FakePlayer || entity.world.isRemote || entity.ticksExisted % TICK_PER_STAT != 0 || playerIsBreakingBlock(entity)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
// every 3.6 seconds we distribute one stat. This means 1h = 1000 applications
|
|
||||||
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// we don't update if the player is currently breaking a block because that'd reset it
|
|
||||||
if (playerIsBreakingBlock(entity)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,8 +24,8 @@ public class TraitDiffuse extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||||
EntityPlayer player = event.getPlayer();
|
EntityPlayer player = event.getPlayer();
|
||||||
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand())
|
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()),
|
||||||
, this.identifier)) {
|
this.identifier)) {
|
||||||
event.setExpToDrop((int) this.getUpdateXP(event.getExpToDrop()));
|
event.setExpToDrop((int) this.getUpdateXP(event.getExpToDrop()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,6 @@ public class TraitDissolving extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// high chance to remove XP, low chance to double,triple or quatruple dropped Experience
|
// high chance to remove XP, low chance to double,triple or quatruple dropped Experience
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onXpDrop(LivingExperienceDropEvent event) {
|
public void onXpDrop(LivingExperienceDropEvent event) {
|
||||||
if (!event.getEntity().getEntityWorld().isRemote) {
|
if (!event.getEntity().getEntityWorld().isRemote) {
|
||||||
|
@@ -16,7 +16,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
public class TraitGlimmer extends AbstractTrait {
|
public class TraitGlimmer extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public TraitGlimmer() {
|
public TraitGlimmer() {
|
||||||
super("glimmer", TextFormatting.DARK_GRAY);
|
super("glimmer", TextFormatting.DARK_GRAY);
|
||||||
}
|
}
|
||||||
|
@@ -13,22 +13,22 @@ public class TraitHeroic extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float
|
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
|
||||||
newDamage, boolean isCritical) {
|
|
||||||
int durability = ToolHelper.getCurrentDurability(tool);
|
int durability = ToolHelper.getCurrentDurability(tool);
|
||||||
int durabilitymax = ToolHelper.getMaxDurability(tool);
|
int durabilitymax = ToolHelper.getMaxDurability(tool);
|
||||||
|
|
||||||
int safeDenominator = durabilitymax - durability - 1;
|
int safeDenominator = durabilitymax - durability - 1;
|
||||||
if (safeDenominator <= 0) {
|
if (safeDenominator <= 0) {
|
||||||
safeDenominator = 1;
|
safeDenominator = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
float calc;
|
float calc;
|
||||||
if ((durability * durabilitymax / (durabilitymax - durability - 1)) != 0) {
|
if ((durability * durabilitymax / (durabilitymax - durability - 1 / safeDenominator)) != 0) {
|
||||||
calc = newDamage + (newDamage / 2) / (durability * durabilitymax / safeDenominator);
|
calc = newDamage + (newDamage / 2) / (durability * durabilitymax / safeDenominator);
|
||||||
} else {
|
} else {
|
||||||
calc = newDamage + (newDamage / 2) / ((durability * durabilitymax / safeDenominator) + 1);
|
calc = newDamage + (newDamage / 2) / ((durability * durabilitymax / safeDenominator) + 1);
|
||||||
}
|
}
|
||||||
if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 ||
|
if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 || (target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) {
|
||||||
(target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) {
|
|
||||||
return super.damage(tool, player, target, damage, calc, isCritical);
|
return super.damage(tool, player, target, damage, calc, isCritical);
|
||||||
} else return super.damage(tool, player, target, damage, newDamage * 0.9f, isCritical);
|
} else return super.damage(tool, player, target, damage, newDamage * 0.9f, isCritical);
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,6 @@ public class TraitHollow extends AbstractTrait {
|
|||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
||||||
isCritical) {
|
isCritical) {
|
||||||
|
@@ -18,7 +18,6 @@ public class TraitMelting extends AbstractTrait {
|
|||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void blockbreak(BlockEvent.BreakEvent e) {
|
public void blockbreak(BlockEvent.BreakEvent e) {
|
||||||
Block b = e.getWorld().getBlockState(e.getPos()).getBlock();
|
Block b = e.getWorld().getBlockState(e.getPos()).getBlock();
|
||||||
|
@@ -16,7 +16,6 @@ import static com.google.common.collect.Lists.newArrayList;
|
|||||||
|
|
||||||
public class TraitMutate extends AbstractTrait {
|
public class TraitMutate extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public TraitMutate() {
|
public TraitMutate() {
|
||||||
super(TraitMutate.class.getSimpleName().toLowerCase().substring(5), TextFormatting.YELLOW);
|
super(TraitMutate.class.getSimpleName().toLowerCase().substring(5), TextFormatting.YELLOW);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
@@ -35,9 +34,7 @@ public class TraitMutate extends AbstractTrait {
|
|||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
event.getWorld().setBlockState(event.getPos(), newState);
|
event.getWorld().setBlockState(event.getPos(), newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import com.sosnitzka.taiga.Keybindings;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
@@ -18,6 +19,7 @@ import slimeknights.tconstruct.library.utils.ToolHelper;
|
|||||||
|
|
||||||
|
|
||||||
public class TraitPorted extends AbstractTrait {
|
public class TraitPorted extends AbstractTrait {
|
||||||
|
|
||||||
public static int distance = 10;
|
public static int distance = 10;
|
||||||
|
|
||||||
public TraitPorted() {
|
public TraitPorted() {
|
||||||
@@ -28,7 +30,7 @@ public class TraitPorted extends AbstractTrait {
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onItemRightClick(PlayerInteractEvent.RightClickItem e) {
|
public void onItemRightClick(PlayerInteractEvent.RightClickItem e) {
|
||||||
ItemStack tool = e.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = e.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier))
|
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && Keybindings.altKey.isKeyDown())
|
||||||
teleport(e.getEntityPlayer(), e.getWorld());
|
teleport(e.getEntityPlayer(), e.getWorld());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +43,6 @@ public class TraitPorted extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
||||||
wasCritical, boolean wasHit) {
|
wasCritical, boolean wasHit) {
|
||||||
|
@@ -29,13 +29,6 @@ public abstract class TraitProgressiveStats extends AbstractTrait {
|
|||||||
applied_key = identifier + "StatBonus";
|
applied_key = identifier + "StatBonus";
|
||||||
}
|
}
|
||||||
|
|
||||||
public TraitProgressiveStats(String identifier, int color) {
|
|
||||||
super(identifier, color);
|
|
||||||
|
|
||||||
pool_key = identifier + "StatPool";
|
|
||||||
applied_key = identifier + "StatBonus";
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Modifier management */
|
/* Modifier management */
|
||||||
|
|
||||||
protected static StatNBT getStats(NBTTagCompound root, String key) {
|
protected static StatNBT getStats(NBTTagCompound root, String key) {
|
||||||
|
@@ -7,7 +7,6 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
|
|||||||
|
|
||||||
public class TraitResonance extends AbstractTrait {
|
public class TraitResonance extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public static float chance = 0.33f;
|
public static float chance = 0.33f;
|
||||||
|
|
||||||
public TraitResonance() {
|
public TraitResonance() {
|
||||||
|
@@ -18,7 +18,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
public class TraitReviving extends AbstractTrait {
|
public class TraitReviving extends AbstractTrait {
|
||||||
|
|
||||||
|
|
||||||
public final float chance = 0.15f;
|
public final float chance = 0.15f;
|
||||||
|
|
||||||
public TraitReviving() {
|
public TraitReviving() {
|
||||||
|
@@ -20,7 +20,6 @@ public class TraitSlaughtering extends AbstractTrait {
|
|||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onMobDrops(LivingDropsEvent event) {
|
public void onMobDrops(LivingDropsEvent event) {
|
||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import com.sosnitzka.taiga.Keybindings;
|
||||||
import com.sosnitzka.taiga.util.Utils;
|
import com.sosnitzka.taiga.util.Utils;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -21,11 +22,10 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
|
|
||||||
import static com.sosnitzka.taiga.Blocks.tiberiumOre;
|
import static com.sosnitzka.taiga.Blocks.tiberiumOre;
|
||||||
|
|
||||||
public class TraitTantrum extends AbstractTrait {
|
/*
|
||||||
|
|
||||||
/*
|
|
||||||
* Collects tiberium, to release it for an explosion
|
* Collects tiberium, to release it for an explosion
|
||||||
*/
|
*/
|
||||||
|
public class TraitTantrum extends AbstractTrait {
|
||||||
|
|
||||||
public static float max_charges = 12f;
|
public static float max_charges = 12f;
|
||||||
public static float max_power = 5;
|
public static float max_power = 5;
|
||||||
@@ -61,11 +61,11 @@ public class TraitTantrum extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void RightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void rightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
BlockPos pos = event.getPos();
|
BlockPos pos = event.getPos();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && Keybindings.altKey.isKeyDown()) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Data data = Data.read(tag);
|
Data data = Data.read(tag);
|
||||||
if (data.amount > 1f) {
|
if (data.amount > 1f) {
|
||||||
@@ -92,7 +92,6 @@ public class TraitTantrum extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Data {
|
public static class Data {
|
||||||
|
|
||||||
float amount;
|
float amount;
|
||||||
|
|
||||||
public static Data read(NBTTagCompound tag) {
|
public static Data read(NBTTagCompound tag) {
|
||||||
|
@@ -20,15 +20,15 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
|
|||||||
import slimeknights.tconstruct.library.utils.ToolHelper;
|
import slimeknights.tconstruct.library.utils.ToolHelper;
|
||||||
|
|
||||||
|
|
||||||
public class TraitInstable extends AbstractTrait {
|
public class TraitUnstable extends AbstractTrait {
|
||||||
public TraitInstable() {
|
|
||||||
super("instable", TextFormatting.DARK_RED);
|
public TraitUnstable() {
|
||||||
|
super("unstable", TextFormatting.DARK_RED);
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
|
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
|
||||||
player, boolean wasEffective) {
|
|
||||||
if (random.nextFloat() <= 0.03) {
|
if (random.nextFloat() <= 0.03) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
if (random.nextBoolean()) {
|
if (random.nextBoolean()) {
|
||||||
@@ -40,8 +40,7 @@ public class TraitInstable extends AbstractTrait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean
|
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
|
||||||
wasCritical, boolean wasHit) {
|
|
||||||
BlockPos pos = target.getPosition();
|
BlockPos pos = target.getPosition();
|
||||||
if (random.nextFloat() <= 0.04) {
|
if (random.nextFloat() <= 0.04) {
|
||||||
if (!player.getEntityWorld().isRemote) {
|
if (!player.getEntityWorld().isRemote) {
|
||||||
@@ -58,8 +57,7 @@ public class TraitInstable extends AbstractTrait {
|
|||||||
World w = event.getEntity().getEntityWorld();
|
World w = event.getEntity().getEntityWorld();
|
||||||
if (random.nextFloat() < 0.05 && !w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
if (random.nextFloat() < 0.05 && !w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
|
||||||
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
|
||||||
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
|
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
|
||||||
.getHeldItemMainhand()), identifier)) {
|
|
||||||
ItemStack i = new ItemStack(Items.GUNPOWDER, random.nextInt(2));
|
ItemStack i = new ItemStack(Items.GUNPOWDER, random.nextInt(2));
|
||||||
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
|
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
|
||||||
.getEntity().posZ, i));
|
.getEntity().posZ, i));
|
@@ -1,5 +1,6 @@
|
|||||||
package com.sosnitzka.taiga.traits;
|
package com.sosnitzka.taiga.traits;
|
||||||
|
|
||||||
|
import com.sosnitzka.taiga.Keybindings;
|
||||||
import com.sosnitzka.taiga.util.Utils;
|
import com.sosnitzka.taiga.util.Utils;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
@@ -33,11 +34,7 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
|
||||||
|
if (entity instanceof FakePlayer || entity.world.isRemote || entity.ticksExisted % TICK_PER_STAT != 0) {
|
||||||
if (entity instanceof FakePlayer || entity.world.isRemote) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (entity.ticksExisted % TICK_PER_STAT > 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +52,7 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
public void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
|
||||||
World w = event.getWorld();
|
World w = event.getWorld();
|
||||||
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
ItemStack tool = event.getEntityPlayer().getHeldItemMainhand();
|
||||||
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
|
if (!w.isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier) && Keybindings.altKey.isKeyDown()) {
|
||||||
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
NBTTagCompound tag = TagUtil.getExtraTag(tool);
|
||||||
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
|
||||||
if ((int) data.radius >= 1) {
|
if ((int) data.radius >= 1) {
|
||||||
@@ -82,7 +79,6 @@ public class TraitWhirl extends AbstractTrait {
|
|||||||
TagUtil.setEnchantEffect(tool, false);
|
TagUtil.setEnchantEffect(tool, false);
|
||||||
ToolHelper.damageTool(tool, 2 * r, event.getEntityPlayer());
|
ToolHelper.damageTool(tool, 2 * r, event.getEntityPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,99 +0,0 @@
|
|||||||
package com.sosnitzka.taiga.util;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityCreature;
|
|
||||||
import net.minecraft.entity.ai.EntityAIBase;
|
|
||||||
import net.minecraft.entity.ai.RandomPositionGenerator;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityAIPermanentPanic extends EntityAIBase {
|
|
||||||
private EntityCreature theEntityCreature;
|
|
||||||
private double speed;
|
|
||||||
private double randPosX;
|
|
||||||
private double randPosY;
|
|
||||||
private double randPosZ;
|
|
||||||
|
|
||||||
public EntityAIPermanentPanic(EntityCreature creature, double speedIn) {
|
|
||||||
this.theEntityCreature = creature;
|
|
||||||
this.speed = speedIn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether the EntityAIBase should begin execution.
|
|
||||||
*/
|
|
||||||
public boolean shouldExecute() {
|
|
||||||
|
|
||||||
Vec3d vec3d = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4);
|
|
||||||
|
|
||||||
if (vec3d == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
this.randPosX = vec3d.x;
|
|
||||||
this.randPosY = vec3d.y;
|
|
||||||
this.randPosZ = vec3d.z;
|
|
||||||
|
|
||||||
if (this.theEntityCreature.isBurning()) {
|
|
||||||
BlockPos blockpos = this.getRandPos(this.theEntityCreature.world, this.theEntityCreature, 5, 4);
|
|
||||||
|
|
||||||
if (blockpos != null) {
|
|
||||||
this.randPosX = (double) blockpos.getX();
|
|
||||||
this.randPosY = (double) blockpos.getY();
|
|
||||||
this.randPosZ = (double) blockpos.getZ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute a one shot task or start executing a continuous task
|
|
||||||
*/
|
|
||||||
public void startExecuting() {
|
|
||||||
this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether an in-progress EntityAIBase should continue executing
|
|
||||||
*/
|
|
||||||
public boolean continueExecuting() {
|
|
||||||
return !this.theEntityCreature.getNavigator().noPath();
|
|
||||||
}
|
|
||||||
|
|
||||||
private BlockPos getRandPos(World worldIn, Entity entityIn, int horizontalRange, int verticalRange) {
|
|
||||||
BlockPos blockpos = new BlockPos(entityIn);
|
|
||||||
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
|
|
||||||
int i = blockpos.getX();
|
|
||||||
int j = blockpos.getY();
|
|
||||||
int k = blockpos.getZ();
|
|
||||||
float f = (float) (horizontalRange * horizontalRange * verticalRange * 2);
|
|
||||||
BlockPos blockpos1 = null;
|
|
||||||
|
|
||||||
for (int l = i - horizontalRange; l <= i + horizontalRange; ++l) {
|
|
||||||
for (int i1 = j - verticalRange; i1 <= j + verticalRange; ++i1) {
|
|
||||||
for (int j1 = k - horizontalRange; j1 <= k + horizontalRange; ++j1) {
|
|
||||||
blockpos$mutableblockpos.setPos(l, i1, j1);
|
|
||||||
IBlockState iblockstate = worldIn.getBlockState(blockpos$mutableblockpos);
|
|
||||||
Block block = iblockstate.getBlock();
|
|
||||||
|
|
||||||
if (block == Blocks.WATER || block == Blocks.FLOWING_WATER) {
|
|
||||||
float f1 = (float) ((l - i) * (l - i) + (i1 - j) * (i1 - j) + (j1 - k) * (j1 - k));
|
|
||||||
|
|
||||||
if (f1 < f) {
|
|
||||||
f = f1;
|
|
||||||
blockpos1 = new BlockPos(blockpos$mutableblockpos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return blockpos1;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -54,7 +54,6 @@ public class Generator {
|
|||||||
.generate(world, random, new BlockPos(posX, posY, posZ));
|
.generate(world, random, new BlockPos(posX, posY, posZ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +63,6 @@ public class Generator {
|
|||||||
generateOreDescending(replaceBlockList, replacementBlock, random, chunkX, chunkZ, world, count, minY, maxY);
|
generateOreDescending(replaceBlockList, replacementBlock, random, chunkX, chunkZ, world, count, minY, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void generateOreDescending(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random
|
public static void generateOreDescending(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random
|
||||||
random, int chunkX, int chunkZ, World world, int count, int minY, int maxY) {
|
random, int chunkX, int chunkZ, World world, int count, int minY, int maxY) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
@@ -195,7 +193,6 @@ public class Generator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int generateMeteor(IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int
|
public static int generateMeteor(IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int
|
||||||
chunkZ, World world, int count, int chance, int minY, int maxY) {
|
chunkZ, World world, int count, int chance, int minY, int maxY) {
|
||||||
Set<Item> validSurface = new HashSet<Item>();
|
Set<Item> validSurface = new HashSet<Item>();
|
||||||
|
@@ -26,10 +26,9 @@ public class StateMatcher implements Predicate<IBlockState> {
|
|||||||
if (state != null) {
|
if (state != null) {
|
||||||
if (property != null && value != null) {
|
if (property != null && value != null) {
|
||||||
if (state.getBlock() == this.state.getBlock())
|
if (state.getBlock() == this.state.getBlock())
|
||||||
if (checkLayerForBlocks(3, 3, -1, world, pos) ||
|
return checkLayerForBlocks(3, 3, -1, world, pos) ||
|
||||||
checkLayerForBlocks(3, 3, 0, world, pos) ||
|
checkLayerForBlocks(3, 3, 0, world, pos) ||
|
||||||
checkLayerForBlocks(3, 3, 1, world, pos))
|
checkLayerForBlocks(3, 3, 1, world, pos);
|
||||||
return true;
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
return state.getBlock() == this.state.getBlock();
|
return state.getBlock() == this.state.getBlock();
|
||||||
|
@@ -123,6 +123,26 @@ public class WorldGen implements IWorldGenerator {
|
|||||||
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,
|
||||||
IChunkProvider chunkProvider) {
|
IChunkProvider chunkProvider) {
|
||||||
@@ -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);
|
||||||
|
@@ -12,9 +12,8 @@ import java.util.function.Predicate;
|
|||||||
|
|
||||||
public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMinable {
|
public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMinable {
|
||||||
private final IBlockState oreBlock;
|
private final IBlockState oreBlock;
|
||||||
/**
|
|
||||||
* The number of com.sosnitzka.taiga.blocks to generate.
|
// The number of com.sosnitzka.taiga.blocks to generate.
|
||||||
*/
|
|
||||||
private final int numberOfBlocks;
|
private final int numberOfBlocks;
|
||||||
private final Predicate<IBlockState> predicate;
|
private final Predicate<IBlockState> predicate;
|
||||||
|
|
||||||
|
171
src/main/java/sosnitzka/taiga/world/WorldGen.java
Normal file
171
src/main/java/sosnitzka/taiga/world/WorldGen.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user