Flamethrower networking fixes
This commit is contained in:
parent
caab819663
commit
5a35d54a5c
5 changed files with 22 additions and 8 deletions
|
@ -436,6 +436,11 @@ public class ClientTickHandler
|
|||
|
||||
public static boolean isFlamethrowerOn(EntityPlayer player)
|
||||
{
|
||||
if(player != mc.thePlayer)
|
||||
{
|
||||
return Mekanism.flamethrowerActive.contains(player.getCommandSenderName());
|
||||
}
|
||||
|
||||
if(hasFlamethrower(player))
|
||||
{
|
||||
if(mc.gameSettings.keyBindUseItem.getIsKeyPressed())
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package mekanism.client.render;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
|
@ -15,7 +13,6 @@ import mekanism.common.item.ItemFlamethrower;
|
|||
import mekanism.common.item.ItemJetpack;
|
||||
import mekanism.common.item.ItemScubaTank;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
|
@ -195,7 +192,15 @@ public class RenderTickHandler
|
|||
}
|
||||
else {
|
||||
flameVec.xPos -= 0.45F;
|
||||
flameVec.yPos -= 0.5F;
|
||||
|
||||
if(player == p)
|
||||
{
|
||||
flameVec.yPos -= 0.5F;
|
||||
}
|
||||
else {
|
||||
flameVec.yPos += 1F;
|
||||
}
|
||||
|
||||
flameVec.zPos += 1.05F;
|
||||
|
||||
flameVec.rotateYaw(p.renderYawOffset);
|
||||
|
|
|
@ -125,6 +125,7 @@ public class PacketHandler
|
|||
netHandler.registerMessage(PacketBoxBlacklist.class, BoxBlacklistMessage.class, 24, Side.CLIENT);
|
||||
netHandler.registerMessage(PacketPortableTankState.class, PortableTankStateMessage.class, 25, Side.SERVER);
|
||||
netHandler.registerMessage(PacketContainerEditMode.class, ContainerEditModeMessage.class, 26, Side.SERVER);
|
||||
netHandler.registerMessage(PacketFlamethrowerActive.class, FlamethrowerActiveMessage.class, 27, Side.CLIENT);
|
||||
netHandler.registerMessage(PacketFlamethrowerActive.class, FlamethrowerActiveMessage.class, 27, Side.SERVER);
|
||||
netHandler.registerMessage(PacketDropperUse.class, DropperUseMessage.class, 28, Side.SERVER);
|
||||
}
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
package mekanism.common.network;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.network.PacketFlamethrowerActive.FlamethrowerActiveMessage;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketFlamethrowerActive implements IMessageHandler<FlamethrowerActiveMessage, IMessage>
|
||||
{
|
||||
@Override
|
||||
|
@ -26,6 +24,11 @@ public class PacketFlamethrowerActive implements IMessageHandler<FlamethrowerAct
|
|||
Mekanism.flamethrowerActive.remove(player.getCommandSenderName());
|
||||
}
|
||||
|
||||
if(!player.worldObj.isRemote)
|
||||
{
|
||||
Mekanism.packetHandler.sendToDimension(new FlamethrowerActiveMessage(message.value), player.worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public class PacketJetpackData implements IMessageHandler<JetpackDataMessage, IM
|
|||
|
||||
synchronized(Mekanism.jetpackOn)
|
||||
{
|
||||
for (String username : Mekanism.jetpackOn)
|
||||
for(String username : Mekanism.jetpackOn)
|
||||
{
|
||||
PacketHandler.writeString(dataStream, username);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue