Deprecate int IDs in FluidRegistry. Modders should only ever use the String name. Also add a 'friendly' exception when attempting to get an ID for a unregistered fluid. Closes #1374

This commit is contained in:
LexManos committed 2015-12-10 02:54:00 -08:00
1 parent 2302963a9f
commit dcda451a0a
3 files changed
+14 -12

No files matched your search

@@ -48,10 +48,11 @@ public abstract class ForgeMessage {
public static class FluidIdMapMessage extends ForgeMessage {
BiMap<Fluid, Integer> fluidIds = HashBiMap.create();
Set<String> defaultFluids = Sets.newHashSet();
@SuppressWarnings("deprecation")
@Override
void toBytes(ByteBuf bytes)
{
Map<Fluid, Integer> ids = FluidRegistry.getRegisteredFluidIDsByFluid();
Map<Fluid, Integer> ids = FluidRegistry.getRegisteredFluidIDs();
bytes.writeInt(ids.size());
for (Map.Entry<Fluid, Integer> entry : ids.entrySet())
{