mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-23 15:48:34 +01:00
Added configuration for Leaf Blower and Potion Rings
This commit is contained in:
parent
8761c634cf
commit
160067c273
3 changed files with 11 additions and 4 deletions
|
@ -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."),
|
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_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_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 name;
|
||||||
public final String category;
|
public final String category;
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.items;
|
package de.ellpeck.actuallyadditions.mod.items;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
|
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.items.base.ItemBase;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockBush;
|
import net.minecraft.block.BlockBush;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
@ -139,6 +141,6 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getUsePerTick(ItemStack stack, TileEntity tile, int elapsedTicks){
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.items;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
|
import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
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.base.ItemBase;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.metalists.ThePotionRings;
|
import de.ellpeck.actuallyadditions.mod.items.metalists.ThePotionRings;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem;
|
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;
|
boolean advanced = ((ItemPotionRing)stack.getItem()).isAdvanced;
|
||||||
int range = advanced ? 48 : 16;
|
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));
|
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){
|
if(advanced){
|
||||||
//Give all entities the effect
|
//Give all entities the effect
|
||||||
for(EntityLivingBase entity : entities){
|
for(EntityLivingBase entity : entities){
|
||||||
|
@ -226,7 +227,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getUsePerTick(ItemStack stack, TileEntity tile, int elapsedTicks){
|
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){
|
private boolean effectEntity(EntityLivingBase thePlayer, ItemStack stack, boolean canUseBasic){
|
||||||
|
|
Loading…
Reference in a new issue