mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-27 23:46:05 +00:00
Minor cleanups (#50)
* Finalize, minor alloc reduction Also enable Jabel and generic injection * Update dependencies.gradle * Clean up Machine a bit * spotless more enhanced instanceof * Update ModuleMachine.java * More clen * WARN: Removed exception catching * Many, many tiny patches + birthday fix * Spotless * Spotless again * Fix getLow and clamp tolerance value * Revert event -> ignored on unused event parameters * Rename instanceof variables * Update Machine.java * Use StringBuilder * Cache getStack() * Oops, Jabel can't handle that * Spotless * Spotless again My IDE was fighting with it * Remove unused elements + scream test success
This commit is contained in:
1 parent
6b4f3eb1c7
commit
f0f14bb278
325 files changed
+1205
-1868
No files matched your search
@@ -3,11 +3,11 @@ package binnie.core.liquid;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
class BinnieFluid extends Fluid {
|
||||
public class BinnieFluid extends Fluid {
|
||||
|
||||
protected IFluidType fluidType;
|
||||
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public String getLocalizedName(FluidStack stack) {
|
||||
|
||||
@@ -22,9 +22,9 @@ public enum FluidContainer {
|
||||
Glass,
|
||||
Cylinder;
|
||||
|
||||
protected IIcon bottle;
|
||||
protected IIcon contents;
|
||||
protected ItemFluidContainer item;
|
||||
private IIcon bottle;
|
||||
private IIcon contents;
|
||||
ItemFluidContainer item;
|
||||
|
||||
public int getMaxStackSize() {
|
||||
return (this == FluidContainer.Bucket) ? 1 : 16;
|
||||
@@ -65,26 +65,14 @@ public enum FluidContainer {
|
||||
}
|
||||
|
||||
public ItemStack getEmpty() {
|
||||
switch (this) {
|
||||
case Bucket:
|
||||
return new ItemStack(Items.bucket, 1, 0);
|
||||
|
||||
case Can:
|
||||
return Mods.forestry.stack("canEmpty");
|
||||
|
||||
case Capsule:
|
||||
return Mods.forestry.stack("waxCapsule");
|
||||
|
||||
case Glass:
|
||||
return new ItemStack(Items.glass_bottle, 1, 0);
|
||||
|
||||
case Refractory:
|
||||
return Mods.forestry.stack("refractoryEmpty");
|
||||
|
||||
case Cylinder:
|
||||
return GeneticsItems.Cylinder.get(1);
|
||||
}
|
||||
return null;
|
||||
return switch (this) {
|
||||
case Bucket -> new ItemStack(Items.bucket, 1, 0);
|
||||
case Can -> Mods.forestry.stack("canEmpty");
|
||||
case Capsule -> Mods.forestry.stack("waxCapsule");
|
||||
case Glass -> new ItemStack(Items.glass_bottle, 1, 0);
|
||||
case Refractory -> Mods.forestry.stack("refractoryEmpty");
|
||||
case Cylinder -> GeneticsItems.Cylinder.get(1);
|
||||
};
|
||||
}
|
||||
|
||||
public void registerContainerData(IFluidType fluid) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFluidContainer extends Item {
|
||||
|
||||
private FluidContainer container;
|
||||
private final FluidContainer container;
|
||||
public static int LiquidExtraBee = 64;
|
||||
public static int LiquidExtraTree = 128;
|
||||
public static int LiquidJuice = 256;
|
||||
@@ -27,8 +27,8 @@ public class ItemFluidContainer extends Item {
|
||||
public static int LiquidLiqueuer = 640;
|
||||
public static int LiquidGenetics = 768;
|
||||
|
||||
private static Map<Integer, String> idToFluid = new HashMap<>();
|
||||
private static Map<String, Integer> fluidToID = new HashMap<>();
|
||||
private static final Map<Integer, String> idToFluid = new HashMap<>();
|
||||
private static final Map<String, Integer> fluidToID = new HashMap<>();
|
||||
|
||||
public static void registerFluid(IFluidType fluid, int id) {
|
||||
ItemFluidContainer.idToFluid.put(id, fluid.getIdentifier().toLowerCase());
|
||||
@@ -69,7 +69,7 @@ public class ItemFluidContainer extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> itemList) {
|
||||
for (IFluidType liquid : Binnie.Liquid.fluids.values()) {
|
||||
if (!liquid.canPlaceIn(container) || !liquid.showInCreative(container)) {
|
||||
continue;
|
||||
|
||||
@@ -53,11 +53,6 @@ public class ManagerLiquid extends ManagerBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (IFluidType fluid : fluids.values()) {
|
||||
|
||||
Reference in new issue
Block a user