undid weird replace in railcraft api (wtf?) and some minor cleanup

This commit is contained in:
Florian Nücke 2014-02-10 03:19:45 +01:00
parent a4898e269d
commit 48d17315fc
70 changed files with 77 additions and 96 deletions

View File

@ -8,14 +8,11 @@ import li.cil.oc.api.prefab.DriverTileEntity;
import li.cil.occ.mods.ManagedTileEntityEnvironment;
import li.cil.occ.util.Reflection;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class DriverSteamTurbine extends DriverTileEntity {
// See https://bitbucket.org/ChickenBones/enderstorage/
public final class DriverSteamTurbine extends DriverTileEntity {
private static final Class<?> TileSteamTurbine = Reflection.getClass("mods.railcraft.common.blocks.machine.alpha.TileSteamTurbine");
@Override
@ -40,21 +37,14 @@ public class DriverSteamTurbine extends DriverTileEntity {
@Callback
public Object[] getTurbineRotorStatus(final Context context, final Arguments args) {
IInventory inventory = (IInventory) Reflection.tryInvoke(tileEntity, "getInventory");
if (inventory != null && inventory.getSizeInventory() >= 1) {
ItemStack itemStack = inventory.getStackInSlot(0);
IInventory inventory = Reflection.tryInvoke(tileEntity, "getInventory");
if (inventory != null && inventory.getSizeInventory() > 0) {
final ItemStack itemStack = inventory.getStackInSlot(0);
if (itemStack != null) {
Item item = itemStack.getItem();
if (item != null) {
return new Object[]{100 - (int) (itemStack.getItemDamage() * 100.0 / item.getMaxDamage())};
}
return new Object[]{100 - (int) (itemStack.getItemDamage() * 100.0 / itemStack.getMaxDamage())};
}
}
return new Object[]{null, "no Inventory"};
}
}
}

View File

@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack;
import java.util.Map;
public class ModRailcraft implements IMod{
public final class ModRailcraft implements IMod {
@Override
public String getModId() {
return "Railcraft";
@ -18,7 +18,6 @@ public class ModRailcraft implements IMod{
}
@Override
public void populate(Map<String, Object> map, ItemStack stack) {
public void populate(final Map<String, Object> map, final ItemStack stack) {
}
}

View File

@ -9,10 +9,7 @@ import li.cil.occ.mods.ManagedTileEntityEnvironment;
import net.minecraft.world.World;
import tmechworks.lib.blocks.IDrawbridgeLogicBase;
public class DriverDrawBridge extends DriverTileEntity {
@Override
public Class<?> getTileEntityClass() {
return IDrawbridgeLogicBase.class;
@ -32,7 +29,5 @@ public class DriverDrawBridge extends DriverTileEntity {
public Object[] hasExtended(final Context context, final Arguments args) {
return new Object[]{tileEntity.hasExtended()};
}
}
}

View File

@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack;
import java.util.Map;
public class ModTMechworks implements IMod{
public final class ModTMechworks implements IMod {
@Override
public String getModId() {
return "TMechworks";
@ -18,7 +18,6 @@ public class ModTMechworks implements IMod{
}
@Override
public void populate(Map<String, Object> map, ItemStack stack) {
public void populate(final Map<String, Object> map, final ItemStack stack) {
}
}

View File

@ -12,7 +12,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public class StackWrapper {

View File

@ -12,7 +12,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IPatternIterator {

View File

@ -16,7 +16,7 @@ import net.minecraftforge.common.ForgeDirection;
* This Tile Entity interface allows you to indicate that a block can emit power
* from a specific side.
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IPowerEmitter {

View File

@ -14,7 +14,7 @@ import net.minecraftforge.common.ForgeDirection;
* This interface should be implemented by any Tile Entity that wishes to be
* able to receive power.
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IPowerReceptor {

View File

@ -27,7 +27,7 @@ import net.minecraftforge.common.ForgeDirection;
* @see IPowerReceptor
* @see IPowerEmitter
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public final class PowerHandler {

View File

@ -12,7 +12,7 @@ import net.minecraft.util.ResourceLocation;
* Used to render a cart with a custom texture using Railcraft's cart renderer.
* You could always write your own renderer of course.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IAlternateCartTexture {

View File

@ -11,7 +11,7 @@ import net.minecraft.util.Icon;
/**
* Used by the renderer to renders blocks in carts.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ICartContentsTextureProvider{

View File

@ -6,7 +6,7 @@ package mods.railcraft.api.carts;
* It is roughly equivalent to the IItemTransfer interface
* and based on ElectricItem and IElectricItem.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
* @see IItemTransfer
*/
public interface IEnergyTransfer

View File

@ -7,7 +7,7 @@ import mods.railcraft.api.core.items.IStackFilter;
* This interface allows items to be passed around with out needing
* to know anything about the underlying implementation of the inventories.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IItemTransfer
{

View File

@ -7,7 +7,7 @@ import net.minecraft.entity.item.EntityMinecart;
* to change the default linkage behavior.
* It is NOT required to be able to link a cart,
* it merely gives you more control over the process.
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ILinkableCart
{

View File

@ -11,7 +11,7 @@ import net.minecraft.entity.item.EntityMinecart;
* Each cart can up to two links. They are called Link A and Link B.
* Some carts will have only Link A, for example the Tunnel Bore.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
* @see CartTools, ILinkableCart
*/
public interface ILinkageManager

View File

@ -6,7 +6,7 @@ import net.minecraftforge.fluids.FluidStack;
* This interface allows carts to transfer liquid between each other as well as
* adding a couple other functions related to liquids.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ILiquidTransfer {

View File

@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack;
*
* This interface is implemented by CartBase.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
* @see CartBase
*/
public interface IMinecart {

View File

@ -10,7 +10,7 @@ package mods.railcraft.api.carts;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IPaintedCart {

View File

@ -11,7 +11,7 @@ package mods.railcraft.api.carts;
/**
* This is used for the "NeedsRefuel" routing conditional.
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IRefuelableCart {

View File

@ -12,7 +12,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IRoutableCart {

View File

@ -5,7 +5,7 @@ import net.minecraft.util.ResourceLocation;
/**
* This interface it used to define an item that can
* be used as a bore head for the Tunnel Bore.
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IBoreHead
{

View File

@ -14,7 +14,7 @@ import net.minecraft.world.World;
* Generally, the reason blocks are not minable by default is to prevent you
* from intentionally or accidentally boring through your base.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IMineable
{

View File

@ -10,7 +10,7 @@ package mods.railcraft.api.core;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IOwnable {

View File

@ -9,7 +9,7 @@ import net.minecraftforge.common.ForgeDirection;
*
* The result takes priority over any other rules.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IPostConnection {

View File

@ -12,7 +12,7 @@ import net.minecraft.client.renderer.texture.IconRegister;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITextureLoader {

View File

@ -7,7 +7,7 @@ import net.minecraft.nbt.NBTTagCompound;
* This immutable class represents a point in the Minecraft world, while taking
* into account the possibility of coordinates in different dimensions.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public class WorldCoordinate {

View File

@ -8,7 +8,7 @@ import net.minecraft.world.World;
* This interface should be implemented by any cart item,
* but it is generally optional.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IMinecartItem
{

View File

@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack;
* This interface is used with several of the functions in IItemTransfer
* to provide a convenient means of dealing with entire classes of items without
* having to specify each item individually.
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IStackFilter
{

View File

@ -12,7 +12,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IToolCrowbar {

View File

@ -10,7 +10,7 @@ import net.minecraft.world.World;
*
* If you defined your rails with a TrackSpec, you don't need to worry about this.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackItem
{

View File

@ -17,7 +17,7 @@ import java.util.TreeSet;
* This is a collection of ItemStack tags than can be used with
* GameRegistry.findItemStack().
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
* @see GameRegistry#findItemStack(java.lang.String, java.lang.String, int)
*/
public class TagList {

View File

@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IBlastFurnaceCraftingManager {

View File

@ -4,7 +4,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IBlastFurnaceRecipe
{

View File

@ -6,7 +6,7 @@ import net.minecraftforge.fluids.FluidStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ICokeOvenCraftingManager {

View File

@ -5,7 +5,7 @@ import net.minecraftforge.fluids.FluidStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ICokeOvenRecipe
{

View File

@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IRockCrusherCraftingManager {

View File

@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IRockCrusherRecipe {

View File

@ -8,7 +8,7 @@ import net.minecraft.world.World;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IRollingMachineCraftingManager
{

View File

@ -4,7 +4,7 @@ package mods.railcraft.api.crafting;
* These variables are defined during the pre-init phase.
* Do not attempt to access them during pre-init.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public abstract class RailcraftCraftingManager
{

View File

@ -13,7 +13,7 @@ import net.minecraftforge.event.Event;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public abstract class CartLockdownEvent extends Event {

View File

@ -7,7 +7,7 @@ import net.minecraftforge.fluids.Fluid;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public class FuelManager {

View File

@ -2,7 +2,7 @@ package mods.railcraft.api.helpers;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public class Helpers {

View File

@ -7,7 +7,7 @@ import net.minecraftforge.fluids.FluidStack;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface StructureHelper {

View File

@ -22,7 +22,7 @@ import mods.railcraft.api.core.WorldCoordinate;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public abstract class AbstractPair {

View File

@ -15,7 +15,7 @@ import mods.railcraft.api.core.WorldCoordinate;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public class DualSignalReceiver extends SignalReceiver {

View File

@ -8,7 +8,7 @@ package mods.railcraft.api.signals;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IControllerTile {

View File

@ -10,7 +10,7 @@ import net.minecraft.tileentity.TileEntity;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IPairEffectRenderer {

View File

@ -10,7 +10,7 @@ import net.minecraft.world.World;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface IReceiverTile {

View File

@ -8,7 +8,7 @@ package mods.railcraft.api.signals;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ISignalPacketBuilder {
public void sendPairPacketUpdate(AbstractPair pairing);

View File

@ -5,7 +5,7 @@ import java.util.Locale;
/**
* Represents a Signal state.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public enum SignalAspect {

View File

@ -11,7 +11,7 @@ import mods.railcraft.api.core.WorldCoordinate;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public abstract class SignalController extends AbstractPair {

View File

@ -11,7 +11,7 @@ import mods.railcraft.api.core.WorldCoordinate;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public abstract class SignalReceiver extends AbstractPair {

View File

@ -2,7 +2,7 @@ package mods.railcraft.api.signals;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public abstract class SignalTools {

View File

@ -15,7 +15,7 @@ import mods.railcraft.api.core.WorldCoordinate;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public class SimpleSignalController extends SignalController {

View File

@ -14,7 +14,7 @@ import net.minecraft.tileentity.TileEntity;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public class SimpleSignalReceiver extends SignalReceiver {

View File

@ -13,7 +13,7 @@ package mods.railcraft.api.tracks;
* change the ticket on the fly. Be warned, security is the responsibility of
* the addon.
*
* @author CovertJaguar <http://www.ModTMechworks.info/>
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IRoutingTrack {

View File

@ -10,7 +10,7 @@ package mods.railcraft.api.tracks;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackBlocksMovement {

View File

@ -7,7 +7,7 @@ import net.minecraft.world.World;
*
* Used by tracks such as the Suspended Track.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackCustomPlaced extends ITrackInstance
{

View File

@ -11,7 +11,7 @@ import net.minecraft.util.Vec3;
*
* Not very useful since there is no system in place to insert custom render code.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackCustomShape extends ITrackInstance
{

View File

@ -8,7 +8,7 @@ package mods.railcraft.api.tracks;
*
* A track cannot implement both ITrackPowered and ITrackEmitter.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackEmitter extends ITrackInstance
{

View File

@ -12,7 +12,7 @@ import net.minecraft.util.Icon;
/**
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackItemIconProvider {

View File

@ -7,7 +7,7 @@ import net.minecraft.entity.item.EntityMinecart;
* all cart movement should implement this interface.
* (Used in collision handling)
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackLockdown extends ITrackInstance
{

View File

@ -7,7 +7,7 @@ package mods.railcraft.api.tracks;
* And so long as you inherit from TrackInstanceBase, all the code for updating
* the power state is already in place (including propagation).
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackPowered extends ITrackInstance
{

View File

@ -6,7 +6,7 @@ package mods.railcraft.api.tracks;
* And so long as you inherit from TrackInstanceBase it will automatically be
* reversable via the Crowbar.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackReversable extends ITrackInstance
{

View File

@ -4,7 +4,7 @@ package mods.railcraft.api.tracks;
* Don't use this, its an interface that allows other API code
* access to internal functions of the code.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public interface ITrackTile
{

View File

@ -13,7 +13,7 @@ import net.minecraft.block.BlockRailBase;
/**
* A number of utility functions related to rails.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public abstract class RailTools {

View File

@ -24,7 +24,7 @@ import net.minecraft.entity.EntityLivingBase;
* functions and standard behavior for Tracks that should greatly simplify
* implementing new Tracks when using this API.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
* @see ITrackInstance
* @see TrackRegistry
* @see TrackSpec

View File

@ -20,7 +20,7 @@ import mods.railcraft.api.core.ITextureLoader;
* The TrackSpec contains basic constant information about the Track, while the
* TrackInstace controls how an individual Track block interact with the world.
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
* @see TrackSpec
* @see ITrackInstance
* @see TrackInstanceBase

View File

@ -22,7 +22,7 @@ import net.minecraft.util.Icon;
* @see TrackRegistry
* @see ITrackInstance
*
* @author CovertJaguar <http://www.ModTMechworks.info>
* @author CovertJaguar <http://www.railcraft.info>
*/
public final class TrackSpec {

View File

@ -1,9 +1,7 @@
package tmechworks.lib.blocks;
public interface IDrawbridgeLogicBase
{
public interface IDrawbridgeLogicBase {
public boolean hasExtended();
public boolean hasExtended ();
public byte getPlacementDirection ();
public byte getPlacementDirection();
}