mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Some fixups for FML, and use the FML registry for potions
This commit is contained in:
1 parent
2847644368
commit
b342bf8481
5 files changed
+25
-12
No files matched your search
+1
-1
@@ -126,7 +126,7 @@ public class EntitySpawnHandler extends SimpleChannelInboundHandler<FMLMessage.E
|
||||
|
||||
if (spawnMsg.dataWatcherList != null)
|
||||
{
|
||||
entity.getDataWatcher().updateWatchedObjectsFromList(spawnMsg.dataWatcherList);
|
||||
entity.func_184212_Q().func_187218_a(spawnMsg.dataWatcherList);
|
||||
}
|
||||
|
||||
if (spawnMsg.throwerId > 0)
|
||||
|
||||
@@ -6,11 +6,11 @@ import io.netty.buffer.Unpooled;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
|
||||
import net.minecraft.entity.DataWatcher;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
@@ -157,7 +157,7 @@ public abstract class FMLMessage {
|
||||
double speedScaledX;
|
||||
double speedScaledY;
|
||||
double speedScaledZ;
|
||||
List<DataWatcher.WatchableObject> dataWatcherList;
|
||||
List<EntityDataManager.DataEntry<?>> dataWatcherList;
|
||||
ByteBuf dataStream;
|
||||
|
||||
public EntitySpawnMessage() {}
|
||||
@@ -193,7 +193,7 @@ public abstract class FMLMessage {
|
||||
PacketBuffer pb = new PacketBuffer(tmpBuf);
|
||||
try
|
||||
{
|
||||
entity.getDataWatcher().writeTo(pb);
|
||||
entity.func_184212_Q().func_187216_a(pb);
|
||||
} catch (IOException e)
|
||||
{
|
||||
FMLLog.log(Level.FATAL,e,"Encountered fatal exception trying to send entity spawn data watchers");
|
||||
@@ -247,7 +247,7 @@ public abstract class FMLMessage {
|
||||
scaledHeadYaw = dat.readByte() * 360F / 256F;
|
||||
try
|
||||
{
|
||||
dataWatcherList = DataWatcher.readWatchedListFromPacketBuffer(new PacketBuffer(dat));
|
||||
dataWatcherList = EntityDataManager.func_187215_b(new PacketBuffer(dat));
|
||||
} catch (IOException e)
|
||||
{
|
||||
FMLLog.log(Level.FATAL, e, "There was a critical error decoding the datawatcher stream for a mod entity.");
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.server.management.ServerConfigurationManager;
|
||||
import net.minecraft.server.management.PlayerList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
@@ -59,7 +59,7 @@ public class FMLNetworkHandler
|
||||
public static final int LOGIN_TIMEOUT = Integers.parseInt(System.getProperty("fml.loginTimeout","600"),600);
|
||||
private static EnumMap<Side, FMLEmbeddedChannel> channelPair;
|
||||
|
||||
public static void fmlServerHandshake(ServerConfigurationManager scm, NetworkManager manager, EntityPlayerMP player)
|
||||
public static void fmlServerHandshake(PlayerList scm, NetworkManager manager, EntityPlayerMP player)
|
||||
{
|
||||
NetworkDispatcher dispatcher = NetworkDispatcher.allocAndSet(manager, scm);
|
||||
dispatcher.serverToClientHandshake(player);
|
||||
|
||||
@@ -254,9 +254,7 @@ public class GameData
|
||||
|
||||
@Override
|
||||
public void onAdd(Potion potion, int id) {
|
||||
// fix the data in the potion and the potions-array
|
||||
potion.id = id;
|
||||
Potion.potionTypes[id] = potion;
|
||||
// no op for the minute?
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user