mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
compressor recipes
This commit is contained in:
parent
dfa5d41d05
commit
ee7c10174a
@ -3,9 +3,10 @@ package com.hbm.inventory;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
public class FluidStack {
|
||||
|
||||
public int fill;
|
||||
|
||||
public FluidType type;
|
||||
public int fill;
|
||||
public int pressure;
|
||||
|
||||
public FluidStack(int fill, FluidType type) {
|
||||
this.fill = fill;
|
||||
@ -13,7 +14,12 @@ public class FluidStack {
|
||||
}
|
||||
|
||||
public FluidStack(FluidType type, int fill) {
|
||||
this(type, fill, 0);
|
||||
}
|
||||
|
||||
public FluidStack(FluidType type, int fill, int pressure) {
|
||||
this.fill = fill;
|
||||
this.type = type;
|
||||
this.pressure = pressure;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCompressor;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -16,7 +18,9 @@ public class ContainerCompressor extends Container {
|
||||
compressor = tile;
|
||||
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tile, 0, 35, 72));
|
||||
this.addSlotToContainer(new Slot(tile, 0, 17, 72));
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 1, 152, 72));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
@ -43,12 +47,23 @@ public class ContainerCompressor extends Container {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(index == 0) {
|
||||
if(!this.mergeItemStack(var5, 1, this.inventorySlots.size(), true)) {
|
||||
if(index < 2) {
|
||||
if(!this.mergeItemStack(var5, 2, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(var3.getItem() instanceof IBatteryItem) {
|
||||
if(!this.mergeItemStack(var5, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(var3.getItem() instanceof IItemFluidIdentifier) {
|
||||
if(!this.mergeItemStack(var5, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(var5, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
public class CompressorRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<Pair<FluidType, Integer>, CompressorRecipe> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
}
|
||||
|
||||
public static class CompressorRecipe {
|
||||
|
||||
public FluidStack output;
|
||||
public int inputAmount;
|
||||
|
||||
public CompressorRecipe(int input, FluidStack output) {
|
||||
this.output = output;
|
||||
this.inputAmount = input;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCompressor.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
|
||||
}
|
||||
}
|
||||
@ -15,7 +15,7 @@ import net.minecraft.world.World;
|
||||
public class TileEntityMachineCompressor extends TileEntityMachineBase implements IGUIProvider {
|
||||
|
||||
public TileEntityMachineCompressor() {
|
||||
super(1);
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user