Added configuration for Leaf Blower and Potion Rings

This commit is contained in:
OneEyeMaker 2017-09-25 10:56:07 +03:00
parent 8761c634cf
commit 160067c273
3 changed files with 11 additions and 4 deletions

View file

@ -48,7 +48,11 @@ public enum ConfigIntValues{
LIQUID_BANNING_RING_ENERGY_USE("Ring Of Liquid Banning: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 150, 1, 1000000000, "Amount of energy Ring Of Liquid Banning uses to remove liquid block."),
TELEPORT_STAFF_ENERGY_CAPACITY("Teleport Staff: Energy Capacity", ConfigCategories.TOOL_ENERGY_VALUES, 250000, 1000, 1000000000, "Amount of energy Teleport Staff can store."),
TELEPORT_STAFF_ENERGY_TRANSFER("Teleport Staff: Energy Transfer Rate", ConfigCategories.TOOL_ENERGY_VALUES, 1000, 1, 1000000000, "Amount of energy Teleport Staff can receive per tick."),
TELEPORT_STAFF_ENERGY_USE("Teleport Staff: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 200, 1, 1000000000, "Amount of energy Teleport Staff uses to teleport per block.");
TELEPORT_STAFF_ENERGY_USE("Teleport Staff: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 200, 1, 1000000000, "Amount of energy Teleport Staff uses to teleport per block."),
LEAF_BLOWER_ENERGY_USE("Leaf Blower: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 60, 1, 1000000, "Amount of energy Leaf Blower uses per tick while placed on Display Stand."),
ADVANCED_LEAF_BLOWER_ENERGY_USE("Advanced Leaf Blower: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 60, 1, 1000000, "Amount of energy Advanced Leaf Blower uses per tick while placed on Display Stand."),
POTION_RINGS_ENERGY_USE("Potion Rings: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 325, 1, 1000000, "Amount of energy Potion Rings use per tick while placed on Display Stand."),
ADVANCED_POTION_RINGS_ENERGY_USE("Advanced Potion Rings: Energy Use", ConfigCategories.TOOL_ENERGY_VALUES, 325, 1, 1000000, "Amount of energy Advanced Potion Rings use per tick while placed on Display Stand.");
public final String name;
public final String category;

View file

@ -11,7 +11,9 @@
package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.state.IBlockState;
@ -139,6 +141,6 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{
@Override
public int getUsePerTick(ItemStack stack, TileEntity tile, int elapsedTicks){
return 60;
return StackUtil.isValid(stack) && ((ItemLeafBlower) stack.getItem()).isAdvanced ? ConfigIntValues.ADVANCED_LEAF_BLOWER_ENERGY_USE.getValue() : ConfigIntValues.LEAF_BLOWER_ENERGY_USE.getValue();
}
}

View file

@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.items.metalists.ThePotionRings;
import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem;
@ -189,7 +190,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
boolean advanced = ((ItemPotionRing)stack.getItem()).isAdvanced;
int range = advanced ? 48 : 16;
List<EntityLivingBase> entities = tile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(tile.getPos().getX()-range, tile.getPos().getY()-range, tile.getPos().getZ()-range, tile.getPos().getX()+range, tile.getPos().getY()+range, tile.getPos().getZ()+range));
if(entities != null && !entities.isEmpty()){
if(!entities.isEmpty()){
if(advanced){
//Give all entities the effect
for(EntityLivingBase entity : entities){
@ -226,7 +227,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
@Override
public int getUsePerTick(ItemStack stack, TileEntity tile, int elapsedTicks){
return 325;
return StackUtil.isValid(stack) && ((ItemPotionRing) stack.getItem()).isAdvanced ? ConfigIntValues.ADVANCED_POTION_RINGS_ENERGY_USE.getValue() : ConfigIntValues.POTION_RINGS_ENERGY_USE.getValue();
}
private boolean effectEntity(EntityLivingBase thePlayer, ItemStack stack, boolean canUseBasic){