new config option(to Disable impact of rain), tweaked Shield Focus

This commit is contained in:
fewizz committed 2015-06-13 17:48:32 +03:00
1 parent 6e28e1709b
commit a0c4bb9ec2
6 files changed
+57 -39

No files matched your search

@@ -14,6 +14,7 @@ import net.minecraft.world.World;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.client.model.ModelWings;
import tombenpotter.emt.common.util.ConfigHandler;
public class ItemFeatherWing extends ItemArmor {
@@ -58,9 +59,11 @@ public class ItemFeatherWing extends ItemArmor {
player.motionY *= 0.9;
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.6;
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.3;
if(ConfigHandler.impactOfRain){
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.3;
}
if (isSneaking && !player.onGround) player.motionY = -0.6;
}
@@ -13,6 +13,7 @@ import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.util.ConfigHandler;
import tombenpotter.emt.common.util.TextHelper;
import java.util.List;
@@ -65,8 +66,10 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.6;
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.3;
if(ConfigHandler.impactOfRain){
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.3;
}
if (isSneaking && !player.onGround) player.motionY = -0.6;
@@ -78,8 +78,10 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.4;
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.2;
if(ConfigHandler.impactOfRain){
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.2;
}
if (isSneaking && !player.onGround) player.motionY = -0.6;
}
@@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.util.ConfigHandler;
public class ItemQuantumWing extends ItemNanoWing {
@@ -50,8 +51,10 @@ public class ItemQuantumWing extends ItemNanoWing {
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.1;
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.05;
if(ConfigHandler.impactOfRain){
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
player.motionY = -0.05;
}
if (isSneaking && isHoldingJump) player.motionY = 0;
@@ -27,6 +27,7 @@ import tombenpotter.emt.common.blocks.BlockRegistry;
public class ItemShieldFocus extends ItemBaseFocus {
int y1 = 0;
ItemStack milk;
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10);
@@ -56,49 +57,53 @@ public class ItemShieldFocus extends ItemBaseFocus {
@Override
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
player.motionX = 0.0D;
player.motionY = -0.1D;
if(!player.capabilities.isCreativeMode && player.motionY < 0)
player.motionY = player.motionY / 2;
player.motionZ = 0.0D;
int x = MathHelper.floor_double(player.posX);
int y = MathHelper.floor_double(player.posY);
int z = MathHelper.floor_double(player.posZ);
ItemStack milk = (new ItemStack(Items.milk_bucket));
if(milk == null)milk = (new ItemStack(Items.milk_bucket));
player.curePotionEffects(milk);
// Player Level
if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1)) {
player.worldObj.setBlock(x + 1, y, z, BlockRegistry.shield);
player.worldObj.setBlock(x - 1, y, z, BlockRegistry.shield);
player.worldObj.setBlock(x, y, z + 1, BlockRegistry.shield);
player.worldObj.setBlock(x, y, z - 1, BlockRegistry.shield);
}
// Above the player
if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1)) {
player.worldObj.setBlock(x + 1, y + 1, z, BlockRegistry.shield);
player.worldObj.setBlock(x - 1, y + 1, z, BlockRegistry.shield);
player.worldObj.setBlock(x, y + 1, z + 1, BlockRegistry.shield);
player.worldObj.setBlock(x, y + 1, z - 1, BlockRegistry.shield);
}
if (y > y1 && (player.worldObj.isAirBlock(x + 1, y - 2, z) && player.worldObj.isAirBlock(x - 1, y - 2, z) && player.worldObj.isAirBlock(x, y - 2, z + 1) && player.worldObj.isAirBlock(x, y - 2, z - 1)) || (player.worldObj.getBlock(x + 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z - 1) == BlockRegistry.shield)){
player.worldObj.setBlockToAir(x + 1, y - 2, z);
player.worldObj.setBlockToAir(x - 1, y - 2, z);
player.worldObj.setBlockToAir(x, y - 2, z + 1);
player.worldObj.setBlockToAir(x, y - 2, z - 1);
}
if(player.motionY > -5){
// Player Level
if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1)) {
player.worldObj.setBlock(x + 1, y, z, BlockRegistry.shield);
player.worldObj.setBlock(x - 1, y, z, BlockRegistry.shield);
player.worldObj.setBlock(x, y, z + 1, BlockRegistry.shield);
player.worldObj.setBlock(x, y, z - 1, BlockRegistry.shield);
}
// Above the player
if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1)) {
player.worldObj.setBlock(x + 1, y + 1, z, BlockRegistry.shield);
player.worldObj.setBlock(x - 1, y + 1, z, BlockRegistry.shield);
player.worldObj.setBlock(x, y + 1, z + 1, BlockRegistry.shield);
player.worldObj.setBlock(x, y + 1, z - 1, BlockRegistry.shield);
}
if (y < y1 && (player.worldObj.isAirBlock(x + 1, y + 2, z) && player.worldObj.isAirBlock(x - 1, y + 2, z) && player.worldObj.isAirBlock(x, y + 2, z + 1) && player.worldObj.isAirBlock(x, y + 2, z - 1)) || (player.worldObj.getBlock(x + 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z - 1) == BlockRegistry.shield)){
player.worldObj.setBlockToAir(x + 1, y + 2, z);
player.worldObj.setBlockToAir(x - 1, y + 2, z);
player.worldObj.setBlockToAir(x, y + 2, z + 1);
player.worldObj.setBlockToAir(x, y + 2, z - 1);
if (y > y1 && (player.worldObj.isAirBlock(x + 1, y - 2, z) && player.worldObj.isAirBlock(x - 1, y - 2, z) && player.worldObj.isAirBlock(x, y - 2, z + 1) && player.worldObj.isAirBlock(x, y - 2, z - 1)) || (player.worldObj.getBlock(x + 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z - 1) == BlockRegistry.shield)){
player.worldObj.setBlockToAir(x + 1, y - 2, z);
player.worldObj.setBlockToAir(x - 1, y - 2, z);
player.worldObj.setBlockToAir(x, y - 2, z + 1);
player.worldObj.setBlockToAir(x, y - 2, z - 1);
}
if (y < y1 && (player.worldObj.isAirBlock(x + 1, y + 2, z) && player.worldObj.isAirBlock(x - 1, y + 2, z) && player.worldObj.isAirBlock(x, y + 2, z + 1) && player.worldObj.isAirBlock(x, y + 2, z - 1)) || (player.worldObj.getBlock(x + 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z - 1) == BlockRegistry.shield)){
player.worldObj.setBlockToAir(x + 1, y + 2, z);
player.worldObj.setBlockToAir(x - 1, y + 2, z);
player.worldObj.setBlockToAir(x, y + 2, z + 1);
player.worldObj.setBlockToAir(x, y + 2, z - 1);
}
}
y1 = y;
@@ -43,6 +43,7 @@ public class ConfigHandler {
public static double outputCap;
// random stuff
public static boolean impactOfRain;
public static boolean capesOn;
public static boolean toolsInBore;
public static boolean nightVisionOff;
@@ -129,6 +130,7 @@ public class ConfigHandler {
chanceTaintedMjolnir = config.get(CATEGORY_RANDOM, "Tainted Mjolnir spawning change", 25, "If you have a lot of mods adding dungeon loot, you should definetely increase this").getInt();
chanceOneRing = config.get(CATEGORY_RANDOM, "One Ring spawning chance", 15, "If you have a lot of mods adding dungeon loot, you should definetely increase this").getInt();
removeAmberAndCinnabarMacerating = config.get(CATEGORY_RANDOM, "Clear Amber/Cinnabar Macerating", true, "This is here because of conflicts between mods that add the same input and different outputs").getBoolean(removeAmberAndCinnabarMacerating);
impactOfRain = config.get(CATEGORY_RANDOM, "Impact of rain", true, "The impact of rain on all wings").getBoolean(impactOfRain);
// DEFAULTS - Aer - 15,000 Aqua - 5,000 Ignis - 20,000 Ordo - 16,000 Perditio - 10,000 Terra - 2,000
airOutput = config.get(CATEGORY_OUTPUTS, "Aer Output", 15000).getDouble(airOutput);