mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-22 21:09:43 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
ab0b8f11d4
commit
69a5c0e6ee
221 files changed
+3125
-2632
No files matched your search
+18
-17
@@ -1,12 +1,5 @@
|
||||
package com.glodblock.github.crossmod.opencomputers;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
import li.cil.oc.api.driver.EnvironmentProvider;
|
||||
import li.cil.oc.api.driver.NamedBlock;
|
||||
import li.cil.oc.api.driver.SidedBlock;
|
||||
@@ -18,12 +11,22 @@ import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.integration.ManagedTileEntityEnvironment;
|
||||
import li.cil.oc.server.network.Component;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.DualityFluidInterface;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class DriverDualFluidInterface implements SidedBlock {
|
||||
|
||||
@Override
|
||||
@@ -45,20 +48,18 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function(index:number):table -- Get the configuration of the dual fluid interface on the specified slot.")
|
||||
doc = "function(index:number):table -- Get the configuration of the dual fluid interface on the specified slot.")
|
||||
public Object[] getFluidInterfaceConfiguration(Context context, Arguments args) {
|
||||
int index = args.checkInteger(0);
|
||||
if (index >= 0 && index < DualityFluidInterface.NUMBER_OF_TANKS) {
|
||||
FluidStack fluid = tileEntity.getConfig().getFluidStackInSlot(index);
|
||||
return new Object[] {fluid == null ? null : new FluidStack(fluid.getFluid(), 1000)};
|
||||
return new Object[] { fluid == null ? null : new FluidStack(fluid.getFluid(), 1000) };
|
||||
}
|
||||
throw new IllegalArgumentException("invalid slot");
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function(index:number[, database:address, entry:number]):boolean -- Configure the filter in fluid interface on the specified slot.")
|
||||
doc = "function(index:number[, database:address, entry:number]):boolean -- Configure the filter in fluid interface on the specified slot.")
|
||||
public Object[] setFluidInterfaceConfiguration(Context context, Arguments args) {
|
||||
int index = args.checkInteger(0);
|
||||
String address;
|
||||
@@ -69,7 +70,7 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
} else {
|
||||
tileEntity.getConfig().setFluidInSlot(index, null);
|
||||
context.pause(0.5);
|
||||
return new Object[] {true};
|
||||
return new Object[] { true };
|
||||
}
|
||||
Node node = node().network().node(address);
|
||||
if (!(node instanceof Component)) throw new IllegalArgumentException("no such component");
|
||||
@@ -84,7 +85,7 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
tileEntity.getConfig().setFluidInSlot(index, tileEntity.getStandardFluid(fluid));
|
||||
}
|
||||
context.pause(0.5);
|
||||
return new Object[] {true};
|
||||
return new Object[] { true };
|
||||
}
|
||||
throw new IllegalArgumentException("invalid slot");
|
||||
}
|
||||
@@ -125,13 +126,13 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
}
|
||||
|
||||
public static class Provider implements EnvironmentProvider {
|
||||
|
||||
Provider() {}
|
||||
|
||||
@Override
|
||||
public Class<?> getEnvironment(ItemStack itemStack) {
|
||||
if (itemStack != null
|
||||
&& (itemStack.isItemEqual(ItemAndBlockHolder.FLUID_INTERFACE.stack())
|
||||
|| itemStack.isItemEqual(ItemAndBlockHolder.INTERFACE.stack()))) {
|
||||
if (itemStack != null && (itemStack.isItemEqual(ItemAndBlockHolder.FLUID_INTERFACE.stack())
|
||||
|| itemStack.isItemEqual(ItemAndBlockHolder.INTERFACE.stack()))) {
|
||||
return DriverDualFluidInterface.Environment.class;
|
||||
}
|
||||
return null;
|
||||
|
||||
+23
-21
@@ -1,14 +1,8 @@
|
||||
package com.glodblock.github.crossmod.opencomputers;
|
||||
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
import com.glodblock.github.inventory.AeItemStackHandler;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import li.cil.oc.api.driver.EnvironmentProvider;
|
||||
import li.cil.oc.api.driver.NamedBlock;
|
||||
import li.cil.oc.api.internal.Database;
|
||||
@@ -20,12 +14,23 @@ import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.prefab.DriverSidedTileEntity;
|
||||
import li.cil.oc.integration.ManagedTileEntityEnvironment;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
import com.glodblock.github.inventory.AeItemStackHandler;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class DriverLevelMaintainer extends DriverSidedTileEntity {
|
||||
|
||||
@Override
|
||||
public Class<?> getTileEntityClass() {
|
||||
return TileLevelMaintainer.class;
|
||||
@@ -100,18 +105,16 @@ public class DriverLevelMaintainer extends DriverSidedTileEntity {
|
||||
result.put("hasTag", stack.hasTagCompound());
|
||||
result.put("label", stack.getDisplayName());
|
||||
result.put("maxDamage", stack.getMaxDamage());
|
||||
result.put(
|
||||
"name",
|
||||
GameRegistry.findUniqueIdentifierFor(stack.getItem()).toString());
|
||||
result.put("name", GameRegistry.findUniqueIdentifierFor(stack.getItem()).toString());
|
||||
result.put("quantity", tileEntity.requests.getQuantity(slot));
|
||||
result.put("batch", tileEntity.requests.getBatchSize(slot));
|
||||
result.put("isFluid", ItemFluidDrop.isFluidStack(stack));
|
||||
if (ItemFluidDrop.isFluidStack(stack)) result.put("fluid", ItemFluidDrop.getFluidStack(stack));
|
||||
result.put("isEnable", tileEntity.requests.isEnable(slot));
|
||||
result.put("isDone", tileEntity.requests.isDone(slot));
|
||||
return new Object[] {result};
|
||||
return new Object[] { result };
|
||||
}
|
||||
return new Object[] {null};
|
||||
return new Object[] { null };
|
||||
}
|
||||
|
||||
private void setSlot(int slot, String address, int index) {
|
||||
@@ -123,8 +126,7 @@ public class DriverLevelMaintainer extends DriverSidedTileEntity {
|
||||
throw new IllegalArgumentException("Invalid slot");
|
||||
}
|
||||
dbStack.stackSize = 1;
|
||||
((AeItemStackHandler) tileEntity.getInventory())
|
||||
.getAeInventory()
|
||||
((AeItemStackHandler) tileEntity.getInventory()).getAeInventory()
|
||||
.setStack(slot, AEItemStack.create(dbStack));
|
||||
} else {
|
||||
throw new IllegalArgumentException("Not a database");
|
||||
@@ -135,8 +137,7 @@ public class DriverLevelMaintainer extends DriverSidedTileEntity {
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function(slot:number[,database:address[,index:number]],quantity:number,batch:number):boolean -- Configuration the slot.")
|
||||
doc = "function(slot:number[,database:address[,index:number]],quantity:number,batch:number):boolean -- Configuration the slot.")
|
||||
public Object[] setSlot(Context context, Arguments args) {
|
||||
int slot;
|
||||
String address;
|
||||
@@ -162,7 +163,7 @@ public class DriverLevelMaintainer extends DriverSidedTileEntity {
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid args");
|
||||
}
|
||||
return new Object[] {true};
|
||||
return new Object[] { true };
|
||||
}
|
||||
|
||||
private boolean isActive() {
|
||||
@@ -171,22 +172,22 @@ public class DriverLevelMaintainer extends DriverSidedTileEntity {
|
||||
|
||||
@Callback(doc = "function(slot:number):boolean -- Get the crafting task state.")
|
||||
public Object[] isDone(Context context, Arguments args) {
|
||||
return new Object[] {this.isDone(args)};
|
||||
return new Object[] { this.isDone(args) };
|
||||
}
|
||||
|
||||
@Callback(doc = "function(slot:number):boolean -- Get the crafting state of slot.")
|
||||
public Object[] isEnable(Context context, Arguments args) {
|
||||
return new Object[] {this.isEnable(args)};
|
||||
return new Object[] { this.isEnable(args) };
|
||||
}
|
||||
|
||||
@Callback(doc = "function(slot:number,value:boolean):boolean -- Set the crafting state of slot.")
|
||||
public Object[] setEnable(Context context, Arguments args) {
|
||||
return new Object[] {this.setEnable(args)};
|
||||
return new Object[] { this.setEnable(args) };
|
||||
}
|
||||
|
||||
@Callback(doc = "function():boolean Get Level Maintainer state")
|
||||
public Object[] active(Context context, Arguments args) {
|
||||
return new Object[] {this.isActive()};
|
||||
return new Object[] { this.isActive() };
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,6 +202,7 @@ public class DriverLevelMaintainer extends DriverSidedTileEntity {
|
||||
}
|
||||
|
||||
public static class Provider implements EnvironmentProvider {
|
||||
|
||||
Provider() {}
|
||||
|
||||
@Override
|
||||
|
||||
+22
-23
@@ -1,13 +1,5 @@
|
||||
package com.glodblock.github.crossmod.opencomputers;
|
||||
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
import com.glodblock.github.common.tile.TileOCPatternEditor;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
import li.cil.oc.api.driver.EnvironmentProvider;
|
||||
import li.cil.oc.api.driver.NamedBlock;
|
||||
import li.cil.oc.api.internal.Database;
|
||||
@@ -19,6 +11,7 @@ import li.cil.oc.api.network.ManagedEnvironment;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.prefab.DriverSidedTileEntity;
|
||||
import li.cil.oc.integration.ManagedTileEntityEnvironment;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -27,6 +20,16 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
import com.glodblock.github.common.tile.TileOCPatternEditor;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class DriverOCPatternEditor extends DriverSidedTileEntity {
|
||||
|
||||
public DriverOCPatternEditor() {}
|
||||
@@ -134,7 +137,7 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
|
||||
inv.setInventorySlotContents(slot, null);
|
||||
inv.setInventorySlotContents(slot, pattern);
|
||||
context.pause(0.1);
|
||||
return new Object[] {true};
|
||||
return new Object[] { true };
|
||||
} else {
|
||||
throw new IllegalArgumentException("Not Fluid Encoded pattern!");
|
||||
}
|
||||
@@ -170,7 +173,7 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
|
||||
inv.setInventorySlotContents(slot, null);
|
||||
inv.setInventorySlotContents(slot, pattern);
|
||||
context.pause(0.1);
|
||||
return new Object[] {true};
|
||||
return new Object[] { true };
|
||||
} else {
|
||||
throw new IllegalArgumentException("Not Fluid Encoded pattern!");
|
||||
}
|
||||
@@ -184,18 +187,17 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
|
||||
if (!validPattern(stack)) {
|
||||
throw new IllegalArgumentException("Not Fluid Encoded pattern!");
|
||||
}
|
||||
return new Object[] {stack};
|
||||
return new Object[] { stack };
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function([slot:number][, database:address, entry:number[, size:number]]):boolean -- Configure the interface.")
|
||||
doc = "function([slot:number][, database:address, entry:number[, size:number]]):boolean -- Configure the interface.")
|
||||
public Object[] setInterfaceConfiguration(Context context, Arguments args) {
|
||||
IInventory config = tileEntity.getInternalInventory();
|
||||
int slot = args.isString(0) ? 0 : optSlot(args, config, 0, 0);
|
||||
config.setInventorySlotContents(slot, getStack(args));
|
||||
context.pause(0.5);
|
||||
return new Object[] {true};
|
||||
return new Object[] { true };
|
||||
}
|
||||
|
||||
@Callback(doc = "function([slot:number]):table -- Get the given pattern in the interface.")
|
||||
@@ -203,33 +205,29 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
|
||||
IInventory inv = tileEntity.getInternalInventory();
|
||||
int slot = optSlot(args, inv, 0, 0);
|
||||
ItemStack stack = inv.getStackInSlot(slot);
|
||||
return new Object[] {stack};
|
||||
return new Object[] { stack };
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern item input at the given index.")
|
||||
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern item input at the given index.")
|
||||
public Object[] setInterfacePatternItemInput(Context context, Arguments args) {
|
||||
return setPatternSlot(context, args, "in", false);
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern item output at the given index.")
|
||||
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern item output at the given index.")
|
||||
public Object[] setInterfacePatternItemOutput(Context context, Arguments args) {
|
||||
return setPatternSlot(context, args, "out", false);
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern fluid input at the given index.")
|
||||
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern fluid input at the given index.")
|
||||
public Object[] setInterfacePatternFluidInput(Context context, Arguments args) {
|
||||
return setPatternSlot(context, args, "in", true);
|
||||
}
|
||||
|
||||
@Callback(
|
||||
doc =
|
||||
"function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern fluid output at the given index.")
|
||||
doc = "function(slot:number, database:address, entry:number, size:number, index:number):boolean -- Set the pattern fluid output at the given index.")
|
||||
public Object[] setInterfacePatternFluidOutput(Context context, Arguments args) {
|
||||
return setPatternSlot(context, args, "out", true);
|
||||
}
|
||||
@@ -256,6 +254,7 @@ public class DriverOCPatternEditor extends DriverSidedTileEntity {
|
||||
}
|
||||
|
||||
public static class Provider implements EnvironmentProvider {
|
||||
|
||||
Provider() {}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user