mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 17:04:24 +00:00
remove useless mathutils class, move idrawbridgelogic to TMech
This commit is contained in:
1 parent
3744f8a886
commit
e79d411131
4 files changed
+4
-28
No files matched your search
@@ -1,6 +1,5 @@
|
||||
package tconstruct.library.armor;
|
||||
|
||||
import tconstruct.library.util.MathUtils;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.IBehaviorDispenseItem;
|
||||
import net.minecraft.entity.*;
|
||||
@@ -152,7 +151,7 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte
|
||||
if (tags == null || !tags.hasKey("Energy"))
|
||||
return 0;
|
||||
int energy = tags.getInteger("Energy");
|
||||
int energyReceived = MathUtils.minInt(capacity - energy, MathUtils.minInt(this.maxReceive, maxReceive));
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
if (!simulate)
|
||||
{
|
||||
energy += energyReceived;
|
||||
@@ -172,7 +171,7 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte
|
||||
return 0;
|
||||
}
|
||||
int energy = tags.getInteger("Energy");
|
||||
int energyExtracted = MathUtils.minInt(energy, MathUtils.minInt(this.maxExtract, maxExtract));
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
if (!simulate)
|
||||
{
|
||||
energy -= energyExtracted;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package tconstruct.library.blocks;
|
||||
|
||||
public interface IDrawbridgeLogicBase
|
||||
{
|
||||
|
||||
public boolean hasExtended ();
|
||||
|
||||
}
|
||||
@@ -26,7 +26,6 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.util.MathUtils;
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -922,7 +921,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
if (tags == null || !tags.hasKey("Energy"))
|
||||
return 0;
|
||||
int energy = tags.getInteger("Energy");
|
||||
int energyReceived = MathUtils.minInt(capacity - energy, MathUtils.minInt(this.maxReceive, maxReceive));
|
||||
int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive));
|
||||
if (!simulate)
|
||||
{
|
||||
energy += energyReceived;
|
||||
@@ -942,7 +941,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa
|
||||
return 0;
|
||||
}
|
||||
int energy = tags.getInteger("Energy");
|
||||
int energyExtracted = MathUtils.minInt(energy, MathUtils.minInt(this.maxExtract, maxExtract));
|
||||
int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
|
||||
if (!simulate)
|
||||
{
|
||||
energy -= energyExtracted;
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package tconstruct.library.util;
|
||||
|
||||
public class MathUtils
|
||||
{
|
||||
/**
|
||||
* finds smaller of 2 valid int's
|
||||
* based on COFH's minI method
|
||||
*/
|
||||
public static int minInt (int a, int b)
|
||||
{
|
||||
|
||||
return a < b ? a : b;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user