6 Commits

7 changed files with 24 additions and 23 deletions

1
.gitignore vendored
View File

@@ -172,6 +172,7 @@ gradle-app.setting
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties # gradle/wrapper/gradle-wrapper.properties
*.hprof
# Forge # Forge
run/ run/

View File

@@ -108,16 +108,13 @@ public class TAIGAConfiguration {
final int PALLADIUM_DEFAULT = 10; final int PALLADIUM_DEFAULT = 10;
final int ABYSSUM_DEFAULT = 4; final int ABYSSUM_DEFAULT = 4;
final boolean FALSE = false;
final boolean TRUE = true;
Property ironSwitch = config.get(CATEGORY_NAME_GENERAL, "Additional Iron", false);
Property ironSwitch = config.get(CATEGORY_NAME_GENERAL, "Extra Iron Switch", FALSE); ironSwitch.setComment("Switch additional ore on/off");
ironSwitch.setComment("Switch ore on/off");
ironSwitch.setLanguageKey("gui.taiga_configuration.gen_iron"); ironSwitch.setLanguageKey("gui.taiga_configuration.gen_iron");
Property endSwitch = config.get(CATEGORY_NAME_GENERAL, "Extra Endstone Switch", TRUE); Property endSwitch = config.get(CATEGORY_NAME_GENERAL, "Additional Endstone", true);
endSwitch.setComment("Switch extra End on/off"); endSwitch.setComment("Switch additional endstone on/off");
endSwitch.setLanguageKey("gui.taiga_configuration.gen_end"); endSwitch.setLanguageKey("gui.taiga_configuration.gen_end");
/* /*
@@ -197,8 +194,8 @@ public class TAIGAConfiguration {
if (readFieldsFromConfig) { if (readFieldsFromConfig) {
ironGen = ironSwitch.getBoolean(FALSE); ironGen = ironSwitch.getBoolean(false);
endGen = endSwitch.getBoolean(TRUE); endGen = endSwitch.getBoolean(true);
IRON_VAL = ironValueProp.getInt(IRON_DEFAULT); IRON_VAL = ironValueProp.getInt(IRON_DEFAULT);
if (IRON_VAL > RESFAC_MAX_VALUE || IRON_VAL < RESFAC_MIN_VALUE) { if (IRON_VAL > RESFAC_MAX_VALUE || IRON_VAL < RESFAC_MIN_VALUE) {
IRON_VAL = IRON_DEFAULT; IRON_VAL = IRON_DEFAULT;
@@ -266,6 +263,7 @@ public class TAIGAConfiguration {
} }
ironSwitch.set(ironGen); ironSwitch.set(ironGen);
endSwitch.set(endGen);
ironValueProp.set(IRON_VAL); ironValueProp.set(IRON_VAL);
tiberiumValueProp.set(TIBERIUM_VAL); tiberiumValueProp.set(TIBERIUM_VAL);
prometheumValueProp.set(PROMETHEUM_VAL); prometheumValueProp.set(PROMETHEUM_VAL);

View File

@@ -43,8 +43,8 @@ public class TAIGAGuiFactory implements IModGuiFactory {
private static List<IConfigElement> getConfigElements() { private static List<IConfigElement> getConfigElements() {
List<IConfigElement> list = new ArrayList<IConfigElement>(); List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new DummyConfigElement.DummyCategoryElement("Basics configuration", "gui.taiga_configuration.ctgy.general", CategoryEntryGeneral.class)); list.add(new DummyConfigElement.DummyCategoryElement("Basic configuration", "gui.taiga_configuration.ctgy.general", CategoryEntryGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("Specific ore generation", "gui.taiga_configuration.ctgy.oregen", CategoryEntryOreGen.class)); list.add(new DummyConfigElement.DummyCategoryElement("Ore specific settings", "gui.taiga_configuration.ctgy.oregen", CategoryEntryOreGen.class));
return list; return list;
} }

View File

@@ -25,7 +25,7 @@ public class TraitAnalysing extends AbstractTrait {
@SubscribeEvent @SubscribeEvent
public void onXpDrop(LivingExperienceDropEvent event) { public void onXpDrop(LivingExperienceDropEvent event) {
EntityPlayer player = event.getAttackingPlayer(); EntityPlayer player = event.getAttackingPlayer();
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) { if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier) && event.getDroppedExperience() >= 0) {
event.setDroppedExperience(this.getUpdateXP(event.getDroppedExperience())); event.setDroppedExperience(this.getUpdateXP(event.getDroppedExperience()));
} }
@@ -34,7 +34,7 @@ public class TraitAnalysing 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 (!event.getWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) { if (!event.getWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier) && event.getExpToDrop() >= 0) {
event.setExpToDrop(this.getUpdateXP(event.getExpToDrop())); event.setExpToDrop(this.getUpdateXP(event.getExpToDrop()));
} }

View File

@@ -52,7 +52,8 @@ public class TraitCatcher extends AbstractTrait {
data.mobClass = target.getClass().getName(); data.mobClass = target.getClass().getName();
data.mobName = target.getName(); data.mobName = target.getName();
data.write(tag); data.write(tag);
TagUtil.setExtraTag(p.getHeldItemMainhand(), tag); if (p.getHeldItemMainhand() != null)
TagUtil.setExtraTag(p.getHeldItemMainhand(), tag);
p.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F); p.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
target.setDropItemsWhenDead(false); target.setDropItemsWhenDead(false);
target.setDead(); target.setDead();
@@ -70,8 +71,6 @@ public class TraitCatcher extends AbstractTrait {
TagUtil.setEnchantEffect(tool, false); TagUtil.setEnchantEffect(tool, false);
} else } else
TagUtil.setEnchantEffect(tool, true); TagUtil.setEnchantEffect(tool, true);
} }
} }

View File

@@ -198,6 +198,10 @@ public class Generator {
// we are in mid air, go down // we are in mid air, go down
while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) { while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
cPos = cPos.down(); cPos = cPos.down();
// if we are below 0, we might be in a void dim
if (cPos.getY() < 0)
break;
} }
} }
if (!validSurface.contains(Item.getItemFromBlock(world.getBlockState(cPos.down()).getBlock()))) if (!validSurface.contains(Item.getItemFromBlock(world.getBlockState(cPos.down()).getBlock())))

View File

@@ -20,11 +20,10 @@ import static com.sosnitzka.taiga.TAIGAConfiguration.*;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public class WorldGen implements IWorldGenerator { public class WorldGen implements IWorldGenerator {
private void nether(Random random, int x, int z, World world) { private void nether(Random random, int x, int z, World world) {
Generator.generateOre(Blocks.NETHERRACK.getDefaultState(), tiberiumOre.getDefaultState(), random, x, z, world, TIBERIUM_VAL, 0, 128, 10, 35); Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, TIBERIUM_VAL, 0, 128, 10, 35);
Generator.generateOre(Blocks.NETHERRACK.getDefaultState(), prometheumOre.getDefaultState(), random, x, z, world, PROMETHEUM_VAL, 0, 128, 2, 4); Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, PROMETHEUM_VAL, 0, 128, 2, 4);
Generator.generateOre(Blocks.NETHERRACK.getDefaultState(), valyriumOre.getDefaultState(), random, x, z, world, VALYRIUM_VAL, 0, 32, 2, 4); Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, VALYRIUM_VAL, 0, 32, 2, 4);
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15); Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
} }
private void world(Random random, int x, int z, World world) { private void world(Random random, int x, int z, World world) {
@@ -44,9 +43,9 @@ public class WorldGen implements IWorldGenerator {
private void end(Random random, int x, int z, World world) { 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); Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, world, URU_VAL, 2, 0, 96, 3);
if (endGen) if (endGen)
Generator.generateOre(Blocks.END_STONE.getDefaultState(), Blocks.AIR.getDefaultState(), null, null, random, x, z, world, 1, 100, 3, 64, 3, 8, null); Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, random, x, z, world, 1, 100, 3, 64, 3, 8, null);
Generator.generateOre(Blocks.END_STONE.getDefaultState(), auroriumOre.getDefaultState(), random, x, z, world, AURORIUM_VAL, 32, 48, 2, 4); Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, AURORIUM_VAL, 32, 48, 2, 4);
Generator.generateOre(Blocks.END_STONE.getDefaultState(), palladiumOre.getDefaultState(), random, x, z, world, PALLADIUM_VAL, 48, 64, 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); Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, world, ABYSSUM_VAL, 4, 64);
} }