mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
More stuff on the Magnet & The Water Removal Ring
This commit is contained in:
parent
24812ab53f
commit
f7a2a6b408
4 changed files with 25 additions and 23 deletions
|
@ -142,7 +142,10 @@ public enum ConfigIntValues{
|
||||||
GROWTH_RING_GROWTH_PER_CYCLE("Growth Ring: Growth Ticks per Cycle", ConfigCategories.MACHINE_VALUES, 45, 1, 200, "The Amount of plants that get ticked per cycle"),
|
GROWTH_RING_GROWTH_PER_CYCLE("Growth Ring: Growth Ticks per Cycle", ConfigCategories.MACHINE_VALUES, 45, 1, 200, "The Amount of plants that get ticked per cycle"),
|
||||||
|
|
||||||
MAGNET_RING_RANGE("Magnet Ring: Range", ConfigCategories.MACHINE_VALUES, 5, 3, 30, "The Range of the Magnet Ring"),
|
MAGNET_RING_RANGE("Magnet Ring: Range", ConfigCategories.MACHINE_VALUES, 5, 3, 30, "The Range of the Magnet Ring"),
|
||||||
MAGNET_RING_ENERGY_USE("Magnet Ring: Energy Used", ConfigCategories.MACHINE_VALUES, 30, 0, 500, "The Amount of Energy the Magnet Ring uses per tick");
|
MAGNET_RING_ENERGY_USE("Magnet Ring: Energy Used", ConfigCategories.MACHINE_VALUES, 30, 0, 500, "The Amount of Energy the Magnet Ring uses per tick"),
|
||||||
|
|
||||||
|
WATER_RING_RANGE("Water Ring: Range", ConfigCategories.MACHINE_VALUES, 3, 1, 10, "The Range of the Water Ring"),
|
||||||
|
WATER_RING_ENERGY_USE("Magnet Ring: Energy Used", ConfigCategories.MACHINE_VALUES, 30, 0, 500, "The Amount of Energy the Water Ring uses per Block");
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final String category;
|
public final String category;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.items;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||||
import ellpeck.actuallyadditions.util.INameableItem;
|
import ellpeck.actuallyadditions.util.INameableItem;
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
@ -15,8 +16,8 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ItemWaterRemovalRing extends ItemEnergy implements INameableItem{
|
public class ItemWaterRemovalRing extends ItemEnergy implements INameableItem{
|
||||||
|
|
||||||
private static final int RANGE = 3;
|
private static final int RANGE = ConfigIntValues.WATER_RING_RANGE.getValue();
|
||||||
private static final int ENERGY_USED_PER_BLOCK = 30;
|
private static final int ENERGY_USED_PER_BLOCK = ConfigIntValues.WATER_RING_ENERGY_USE.getValue();
|
||||||
|
|
||||||
public ItemWaterRemovalRing(){
|
public ItemWaterRemovalRing(){
|
||||||
super(1000000, 5000, 2);
|
super(1000000, 5000, 2);
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
|
||||||
|
|
||||||
private int currentWorkTimer;
|
private int currentWorkTimer;
|
||||||
|
|
||||||
private int maxWorkTimer = 15;
|
private int maxWorkTimer = 10;
|
||||||
private int range = 10;
|
private int range = 10;
|
||||||
public static int oilUsePerTick = 50;
|
public static int oilUsePerTick = 50;
|
||||||
public static int energyUsePerTick = 400;
|
public static int energyUsePerTick = 400;
|
||||||
|
@ -86,6 +86,7 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
|
||||||
for(int y = this.yCoord-1; y > 0; y--){
|
for(int y = this.yCoord-1; y > 0; y--){
|
||||||
Block block = worldObj.getBlock(xCoord+x, y, zCoord+z);
|
Block block = worldObj.getBlock(xCoord+x, y, zCoord+z);
|
||||||
int meta = worldObj.getBlockMetadata(xCoord+x, y, zCoord+z);
|
int meta = worldObj.getBlockMetadata(xCoord+x, y, zCoord+z);
|
||||||
|
if(!block.hasTileEntity(meta) && block.getBlockHardness(worldObj, xCoord+x, y, zCoord+z) >= 0.0F && (block.getMaterial().isToolNotRequired() || (block.getHarvestTool(meta).equals("pickaxe") && block.getHarvestLevel(meta) <= 3))){
|
||||||
int[] oreIDs = OreDictionary.getOreIDs(new ItemStack(block, 1, meta));
|
int[] oreIDs = OreDictionary.getOreIDs(new ItemStack(block, 1, meta));
|
||||||
for(int ID : oreIDs){
|
for(int ID : oreIDs){
|
||||||
String oreName = OreDictionary.getOreName(ID);
|
String oreName = OreDictionary.getOreName(ID);
|
||||||
|
@ -108,6 +109,7 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else this.currentWorkTimer = maxWorkTimer+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, maxWorkTimer);
|
else this.currentWorkTimer = maxWorkTimer+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, maxWorkTimer);
|
||||||
|
|
||||||
//Extract energy
|
//Extract energy
|
||||||
|
@ -189,7 +191,7 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill){
|
public int fill(ForgeDirection from, FluidStack resource, boolean doFill){
|
||||||
if(resource.getFluid() == InitBlocks.fluidOil) return this.tank.fill(resource, doFill);
|
if(this.canFill(from, resource.getFluid())) return this.tank.fill(resource, doFill);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,4 @@ public class KeyUtil{
|
||||||
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
|
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAltPressed(){
|
|
||||||
return Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue