mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 12:09:39 +00:00
#987 Use fluid names instead of IDs
This commit is contained in:
1 parent
6b9614bccd
commit
01e43d8a18
2 files changed
+9
-9
No files matched your search
@@ -32,7 +32,7 @@ import forestry.core.utils.StringUtil;
|
||||
*/
|
||||
public class FilteredTank extends StandardTank {
|
||||
|
||||
private final Set<Integer> filters = new HashSet<>(); // FluidIDs
|
||||
private final Set<String> filters = new HashSet<>(); // FluidNames
|
||||
|
||||
public FilteredTank(int capacity, Fluid... filters) {
|
||||
this(capacity, Arrays.asList(filters), null);
|
||||
@@ -50,7 +50,7 @@ public class FilteredTank extends StandardTank {
|
||||
public void setFilters(Collection<Fluid> filters) {
|
||||
this.filters.clear();
|
||||
for (Fluid fluid : filters) {
|
||||
this.filters.add(fluid.getID());
|
||||
this.filters.add(fluid.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,14 +64,14 @@ public class FilteredTank extends StandardTank {
|
||||
|
||||
@Override
|
||||
public boolean accepts(Fluid fluid) {
|
||||
return filters.contains(fluid.getID());
|
||||
return filters.contains(fluid.getName());
|
||||
}
|
||||
|
||||
private boolean liquidMatchesFilter(FluidStack resource) {
|
||||
if (resource == null || filters == null) {
|
||||
return false;
|
||||
}
|
||||
return filters.contains(resource.getFluid().getID());
|
||||
return filters.contains(resource.getFluid().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,8 +83,8 @@ public class FilteredTank extends StandardTank {
|
||||
|
||||
toolTip.clear();
|
||||
if (Proxies.common.isShiftDown() || filters.size() < 5) {
|
||||
for (Integer filterId : filters) {
|
||||
Fluid fluidFilter = FluidRegistry.getFluid(filterId);
|
||||
for (String filterName : filters) {
|
||||
Fluid fluidFilter = FluidRegistry.getFluid(filterName);
|
||||
EnumRarity rarity = fluidFilter.getRarity();
|
||||
if (rarity == null) {
|
||||
rarity = EnumRarity.common;
|
||||
|
||||
@@ -22,10 +22,10 @@ public class ItemRegistryFluids extends ItemRegistry {
|
||||
public final ItemLiquidContainer waxCapsuleEmpty;
|
||||
public final ItemLiquidContainer refractoryEmpty;
|
||||
|
||||
private final Table<EnumContainerType, Integer, ItemLiquidContainer> containers = HashBasedTable.create();
|
||||
private final Table<EnumContainerType, String, ItemLiquidContainer> containers = HashBasedTable.create();
|
||||
|
||||
public ItemLiquidContainer getContainer(EnumContainerType type, Fluids fluid) {
|
||||
return containers.get(type, fluid.getFluid().getID());
|
||||
return containers.get(type, fluid.getFluid().getName());
|
||||
}
|
||||
|
||||
public ItemRegistryFluids() {
|
||||
@@ -45,7 +45,7 @@ public class ItemRegistryFluids extends ItemRegistry {
|
||||
String name = type.getContainerNameKey() + fluidType.getContainerNameKey();
|
||||
registerItem(liquidContainer, name);
|
||||
|
||||
containers.put(type, fluidType.getFluid().getID(), liquidContainer);
|
||||
containers.put(type, fluidType.getFluid().getName(), liquidContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user