mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 20:52:34 +00:00
Inital Fluid system update, untested. Still in progress.
This commit is contained in:
1 parent
51b008c391
commit
2b9a2b5c1a
14 files changed
+295
-343
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package net.minecraftforge.common.network;
|
||||
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
@@ -9,7 +12,7 @@ public class FluidIdRegistryMessageHandler extends SimpleChannelInboundHandler<F
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, ForgeMessage.FluidIdMapMessage msg) throws Exception
|
||||
{
|
||||
// Do something with the message
|
||||
FluidRegistry.initFluidIDs(msg.fluidIds);
|
||||
}
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package net.minecraftforge.common.network;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public abstract class ForgeMessage {
|
||||
@@ -39,27 +44,24 @@ public abstract class ForgeMessage {
|
||||
@Override
|
||||
void toBytes(ByteBuf bytes)
|
||||
{
|
||||
/*
|
||||
bytes.writeInt(FluidRegistry.maxID);
|
||||
for (Map.Entry<String, Integer> entry : FluidRegistry.fluidIDs.entrySet())
|
||||
Map<String, Integer> ids = FluidRegistry.getRegisteredFluidIDs();
|
||||
bytes.writeInt(ids.size());
|
||||
for (Map.Entry<String, Integer> entry : ids.entrySet())
|
||||
{
|
||||
ByteBufUtils.writeUTF8String(bytes,entry.getKey());
|
||||
bytes.writeInt(entry.getValue());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
void fromBytes(ByteBuf bytes)
|
||||
{
|
||||
/*
|
||||
int listSize = bytes.readInt();
|
||||
for (int i = 0; i < listSize; i++) {
|
||||
String fluidName = ByteBufUtils.readUTF8String(bytes);
|
||||
int fluidId = bytes.readInt();
|
||||
fluidIds.put(fluidName, fluidId);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user