Files
EnderIO/src/main/java/crazypants/enderio/config/PacketConfigSync.java
T
Under 3639ade571 Staff Of Traveling Keybind Feature (#144)
* Staff Of Traveling Keybind Update

Two main things
1. Added a keybind for Staff of Traveling blink ability
2. Due to the new keybind, also added Baubles support for Staff of Traveling.

By extension, both features 1 and 2 also apply to the Staff of Teleportation.

* Update en_US.lang

* Add config to disable Travel Staff Keybind

Change as per request by @Caedis .
New config option is synced in the PacketConfigSync class.
A helpful info message is displayed when players attempt to use the keybind but it is disabled so it's immediately apparent why it's not working.

* Typo/formatting

Fix type, remove unnecessary null check.

* Annotations and UNIVERSAL bauble type

Added annotations missing from ItemMagnet and ItemTravelStaff for Baubles.
Added option 'UNIVERSAL' to description of magnet and travel staff Bauble type configs.
Changed default of staff to be 'UNIVERSAL', because bauble slots are limited enough as-is.
2023-12-24 20:18:57 +01:00

58 lines
2.6 KiB
Java

package crazypants.enderio.config;
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;
/**
* Syncs some configs that are only used clientside, but must use the serverside value for balance purposes.
*/
public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigSync, IMessage> {
@Override
public void toBytes(ByteBuf buf) {
buf.writeBoolean(Config.travelAnchorEnabled);
buf.writeInt(Config.travelAnchorMaxDistance);
buf.writeBoolean(Config.travelStaffEnabled);
buf.writeBoolean(Config.travelStaffBlinkEnabled);
buf.writeBoolean(Config.travelStaffBlinkThroughSolidBlocksEnabled);
buf.writeBoolean(Config.travelStaffBlinkThroughClearBlocksEnabled);
buf.writeInt(Config.travelStaffBlinkPauseTicks);
buf.writeInt(Config.travelStaffMaxDistance);
buf.writeInt(Config.travelStaffMaxBlinkDistance);
buf.writeFloat(Config.travelStaffPowerPerBlockRF);
buf.writeInt(Config.teleportStaffMaxDistance);
buf.writeInt(Config.teleportStaffMaxBlinkDistance);
buf.writeInt(Config.teleportStaffFailedBlinkDistance);
buf.writeBoolean(Config.telepadLockCoords);
buf.writeBoolean(Config.telepadLockDimension);
buf.writeBoolean(Config.travelStaffKeybindEnabled);
}
@Override
public void fromBytes(ByteBuf data) {
Config.travelAnchorEnabled = data.readBoolean();
Config.travelAnchorMaxDistance = data.readInt();
Config.travelStaffEnabled = data.readBoolean();
Config.travelStaffBlinkEnabled = data.readBoolean();
Config.travelStaffBlinkThroughSolidBlocksEnabled = data.readBoolean();
Config.travelStaffBlinkThroughClearBlocksEnabled = data.readBoolean();
Config.travelStaffBlinkPauseTicks = data.readInt();
Config.travelStaffMaxDistance = data.readInt();
Config.travelStaffMaxBlinkDistance = data.readInt();
Config.travelStaffPowerPerBlockRF = data.readFloat();
Config.teleportStaffMaxDistance = data.readInt();
Config.teleportStaffMaxBlinkDistance = data.readInt();
Config.teleportStaffFailedBlinkDistance = data.readInt();
Config.telepadLockCoords = data.readBoolean();
Config.telepadLockDimension = data.readBoolean();
Config.travelStaffKeybindEnabled = data.readBoolean();
}
@Override
public IMessage onMessage(PacketConfigSync message, MessageContext ctx) {
return null;
}
}