2019-11-25 06:29:25 +00:00
|
|
|
package com.burnedkirby.TurnBasedMinecraft.client;
|
2018-09-12 06:39:55 +00:00
|
|
|
|
2019-11-25 06:29:25 +00:00
|
|
|
import com.burnedkirby.TurnBasedMinecraft.common.Battle;
|
|
|
|
import com.burnedkirby.TurnBasedMinecraft.common.CommonProxy;
|
2022-05-17 05:47:42 +00:00
|
|
|
import com.burnedkirby.TurnBasedMinecraft.common.EntityInfo;
|
|
|
|
import com.burnedkirby.TurnBasedMinecraft.common.TurnBasedMinecraftMod;
|
|
|
|
import com.burnedkirby.TurnBasedMinecraft.common.networking.PacketBattleMessage;
|
|
|
|
import com.burnedkirby.TurnBasedMinecraft.common.networking.PacketEditingMessage;
|
|
|
|
import com.burnedkirby.TurnBasedMinecraft.common.networking.PacketGeneralMessage;
|
2022-06-09 07:42:21 +00:00
|
|
|
import net.minecraft.ChatFormatting;
|
2018-09-12 06:39:55 +00:00
|
|
|
import net.minecraft.client.Minecraft;
|
2022-05-17 05:47:42 +00:00
|
|
|
import net.minecraft.client.Options;
|
2022-06-03 05:49:59 +00:00
|
|
|
import net.minecraft.network.chat.*;
|
2022-05-17 05:47:42 +00:00
|
|
|
import net.minecraft.resources.ResourceKey;
|
|
|
|
import net.minecraft.sounds.SoundSource;
|
|
|
|
import net.minecraft.world.entity.Entity;
|
|
|
|
import net.minecraft.world.level.Level;
|
|
|
|
import net.minecraftforge.network.NetworkEvent;
|
2020-11-12 08:10:01 +00:00
|
|
|
|
|
|
|
import java.util.UUID;
|
2022-05-17 05:47:42 +00:00
|
|
|
import java.util.function.Supplier;
|
2018-09-12 06:39:55 +00:00
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
public class ClientProxy extends CommonProxy {
|
2018-09-28 08:45:32 +00:00
|
|
|
private BattleGui battleGui = null;
|
|
|
|
private BattleMusic battleMusic = null;
|
|
|
|
private int battleMusicCount = 0;
|
|
|
|
private int sillyMusicCount = 0;
|
|
|
|
private Battle localBattle = null;
|
2022-06-08 10:22:45 +00:00
|
|
|
|
2018-09-20 06:15:34 +00:00
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
protected void initializeClient() {
|
2018-09-12 06:39:55 +00:00
|
|
|
battleGui = new BattleGui();
|
2018-09-14 05:14:10 +00:00
|
|
|
battleMusic = null; // will be initialized in postInit()
|
2018-09-27 09:09:40 +00:00
|
|
|
battleMusicCount = 0;
|
|
|
|
sillyMusicCount = 0;
|
2018-09-28 03:13:07 +00:00
|
|
|
localBattle = null;
|
2019-11-29 09:52:28 +00:00
|
|
|
logger.debug("Init client");
|
2018-09-12 06:39:55 +00:00
|
|
|
}
|
2018-09-20 06:15:34 +00:00
|
|
|
|
2018-09-12 06:39:55 +00:00
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void setBattleGuiTime(int timeRemaining) {
|
2018-09-28 08:45:32 +00:00
|
|
|
battleGui.setTimeRemaining(timeRemaining);
|
2018-09-12 06:39:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void setBattleGuiBattleChanged() {
|
2018-09-12 06:39:55 +00:00
|
|
|
battleGui.battleChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void setBattleGuiAsGui() {
|
|
|
|
if (Minecraft.getInstance().screen != battleGui) {
|
2019-10-21 07:13:11 +00:00
|
|
|
battleGui.turnEnd();
|
2021-05-21 05:44:31 +00:00
|
|
|
Minecraft.getInstance().setScreen(battleGui);
|
2019-10-21 07:13:11 +00:00
|
|
|
}
|
2018-09-12 06:39:55 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 03:57:10 +00:00
|
|
|
@Override
|
|
|
|
public void setBattleGuiTurnTimerEnabled(boolean enabled) {
|
|
|
|
battleGui.setTurnTimerEnabled(enabled);
|
|
|
|
}
|
|
|
|
|
2022-07-21 05:01:34 +00:00
|
|
|
@Override
|
|
|
|
public void setBattleGuiTurnTimerMax(int timeMax) {
|
|
|
|
battleGui.setTurnTimerMax(timeMax);
|
|
|
|
}
|
|
|
|
|
2018-09-12 06:39:55 +00:00
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void battleGuiTurnBegin() {
|
2018-09-12 06:39:55 +00:00
|
|
|
battleGui.turnBegin();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void battleGuiTurnEnd() {
|
2018-09-12 06:39:55 +00:00
|
|
|
battleGui.turnEnd();
|
|
|
|
}
|
2018-09-14 03:44:45 +00:00
|
|
|
|
2018-09-18 07:58:01 +00:00
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void battleStarted() {
|
2018-09-18 07:58:01 +00:00
|
|
|
setBattleGuiAsGui();
|
|
|
|
}
|
|
|
|
|
2018-09-14 03:44:45 +00:00
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void battleEnded() {
|
2018-09-28 03:13:07 +00:00
|
|
|
localBattle = null;
|
2021-05-21 05:44:31 +00:00
|
|
|
Minecraft.getInstance().setScreen(null);
|
2018-09-27 07:44:28 +00:00
|
|
|
stopMusic(true);
|
2018-09-27 09:09:40 +00:00
|
|
|
battleMusicCount = 0;
|
|
|
|
sillyMusicCount = 0;
|
2018-09-14 03:44:45 +00:00
|
|
|
}
|
2018-09-14 05:14:10 +00:00
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
protected void postInitClient() {
|
2018-09-28 08:45:32 +00:00
|
|
|
battleMusic = new BattleMusic(getLogger());
|
2018-09-14 05:14:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void playBattleMusic() {
|
2022-05-17 05:47:42 +00:00
|
|
|
Options gs = Minecraft.getInstance().options;
|
|
|
|
battleMusic.playBattle(gs.getSoundSourceVolume(SoundSource.MUSIC) * gs.getSoundSourceVolume(SoundSource.MASTER));
|
2018-09-14 05:14:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void playSillyMusic() {
|
2022-05-17 05:47:42 +00:00
|
|
|
Options gs = Minecraft.getInstance().options;
|
|
|
|
battleMusic.playSilly(gs.getSoundSourceVolume(SoundSource.MUSIC) * gs.getSoundSourceVolume(SoundSource.MASTER));
|
2018-09-14 05:14:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void stopMusic(boolean resumeMCSounds) {
|
2018-09-27 07:44:28 +00:00
|
|
|
battleMusic.stopMusic(resumeMCSounds);
|
2018-09-14 05:14:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets what music to play based on type and loaded Config
|
|
|
|
*/
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void typeEnteredBattle(String type) {
|
|
|
|
if (localBattle == null) {
|
2018-09-27 09:09:40 +00:00
|
|
|
return;
|
2022-06-08 10:22:45 +00:00
|
|
|
}
|
|
|
|
if (type == null || type.isEmpty() || getConfig().isBattleMusicType(type)) {
|
2018-09-27 09:09:40 +00:00
|
|
|
++battleMusicCount;
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (getConfig().isSillyMusicType(type)) {
|
2018-09-27 09:09:40 +00:00
|
|
|
++sillyMusicCount;
|
2021-05-23 06:38:04 +00:00
|
|
|
} else {
|
2018-09-27 09:09:40 +00:00
|
|
|
++battleMusicCount;
|
2018-09-14 05:14:10 +00:00
|
|
|
}
|
2021-05-23 06:38:04 +00:00
|
|
|
checkBattleTypes(false);
|
2018-09-27 09:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void typeLeftBattle(String type) {
|
|
|
|
if (localBattle == null || localBattle.getSideA().isEmpty() || localBattle.getSideB().isEmpty()) {
|
2021-05-23 06:38:04 +00:00
|
|
|
battleMusicCount = 0;
|
|
|
|
sillyMusicCount = 0;
|
2018-09-27 09:09:40 +00:00
|
|
|
return;
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (type == null || type.isEmpty() || getConfig().isBattleMusicType(type)) {
|
2018-09-27 09:09:40 +00:00
|
|
|
--battleMusicCount;
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (getConfig().isSillyMusicType(type)) {
|
2018-09-27 09:09:40 +00:00
|
|
|
--sillyMusicCount;
|
2021-05-23 06:38:04 +00:00
|
|
|
} else {
|
2018-09-27 09:09:40 +00:00
|
|
|
--battleMusicCount;
|
|
|
|
}
|
2021-05-23 06:38:04 +00:00
|
|
|
checkBattleTypes(true);
|
2018-09-14 05:14:10 +00:00
|
|
|
}
|
|
|
|
|
2018-09-17 04:27:13 +00:00
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void displayString(String message) {
|
2022-06-03 05:49:59 +00:00
|
|
|
Component parentComponent = new TextComponent("");
|
|
|
|
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent prefix = new TextComponent("TBM: ");
|
|
|
|
prefix.withStyle(prefix.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)).withBold(true));
|
|
|
|
TextComponent text = new TextComponent(message);
|
|
|
|
text.withStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
2022-06-03 05:49:59 +00:00
|
|
|
|
|
|
|
parentComponent.getSiblings().add(prefix);
|
|
|
|
parentComponent.getSiblings().add(text);
|
2020-11-12 08:10:01 +00:00
|
|
|
// UUID is required by sendMessage, but appears to be unused, so just give dummy UUID
|
2022-06-03 05:49:59 +00:00
|
|
|
Minecraft.getInstance().player.sendMessage(parentComponent, new UUID(0, 0));
|
2018-09-17 04:27:13 +00:00
|
|
|
}
|
|
|
|
|
2018-10-24 08:20:04 +00:00
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void displayComponent(Component text) {
|
2022-06-03 05:49:59 +00:00
|
|
|
Component parentComponent = new TextComponent("");
|
|
|
|
|
|
|
|
TextComponent prefix = new TextComponent("TBM: ");
|
|
|
|
prefix.withStyle(prefix.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)).withBold(true));
|
|
|
|
|
|
|
|
parentComponent.getSiblings().add(prefix);
|
|
|
|
parentComponent.getSiblings().add(text);
|
2020-11-12 08:10:01 +00:00
|
|
|
// UUID is required by sendMessage, but appears to be unused, so just give dummy UUID
|
2022-06-08 10:22:45 +00:00
|
|
|
Minecraft.getInstance().player.sendMessage(parentComponent, new UUID(0, 0));
|
2018-10-24 08:20:04 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
private void checkBattleTypes(boolean entityLeft) {
|
2021-05-23 06:38:04 +00:00
|
|
|
// check that battle is still valid
|
2022-06-08 10:22:45 +00:00
|
|
|
if (localBattle == null && entityLeft && (localBattle.getSideA().isEmpty() || localBattle.getSideB().isEmpty())) {
|
2021-05-23 06:38:04 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
float percentage = 0.0f;
|
|
|
|
if (sillyMusicCount == 0 && battleMusicCount == 0) {
|
2018-09-28 03:02:39 +00:00
|
|
|
percentage = 0.0f;
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (battleMusicCount == 0) {
|
2018-09-28 03:02:39 +00:00
|
|
|
percentage = 100.0f;
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
|
|
|
percentage = 100.0f * (float) sillyMusicCount / (float) (sillyMusicCount + battleMusicCount);
|
2018-09-28 03:02:39 +00:00
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
|
|
|
|
if (percentage >= (float) getConfig().getSillyMusicThreshold()) {
|
|
|
|
if (battleMusic.isPlaying()) {
|
|
|
|
if (!battleMusic.isPlayingSilly() && battleMusic.hasSillyMusic()) {
|
2018-09-27 09:09:40 +00:00
|
|
|
stopMusic(false);
|
|
|
|
playSillyMusic();
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (battleMusic.hasSillyMusic()) {
|
2018-09-27 09:09:40 +00:00
|
|
|
playSillyMusic();
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
|
|
|
if (battleMusic.isPlaying()) {
|
|
|
|
if (battleMusic.isPlayingSilly() && battleMusic.hasBattleMusic()) {
|
2018-09-27 09:09:40 +00:00
|
|
|
stopMusic(false);
|
|
|
|
playBattleMusic();
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (battleMusic.hasBattleMusic()) {
|
2018-09-27 09:09:40 +00:00
|
|
|
playBattleMusic();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-28 03:13:07 +00:00
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public Battle getLocalBattle() {
|
2018-09-28 03:13:07 +00:00
|
|
|
return localBattle;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-08 10:22:45 +00:00
|
|
|
public void createLocalBattle(int id) {
|
2021-05-21 05:44:31 +00:00
|
|
|
localBattle = new Battle(null, id, null, null, false, Minecraft.getInstance().level.dimension());
|
2018-09-28 03:13:07 +00:00
|
|
|
}
|
2019-11-29 09:52:28 +00:00
|
|
|
|
|
|
|
@Override
|
2022-05-17 05:47:42 +00:00
|
|
|
public Entity getEntity(int id, ResourceKey<Level> dim) {
|
2021-05-21 05:44:31 +00:00
|
|
|
return Minecraft.getInstance().level.getEntity(id);
|
2019-11-29 09:52:28 +00:00
|
|
|
}
|
2022-05-17 05:47:42 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public <MSG> void handlePacket(MSG msg, Supplier<NetworkEvent.Context> ctx) {
|
|
|
|
if (msg.getClass() == PacketBattleMessage.class) {
|
2022-06-08 10:22:45 +00:00
|
|
|
PacketBattleMessage pkt = (PacketBattleMessage) msg;
|
2022-05-17 05:47:42 +00:00
|
|
|
Entity fromEntity = getEntity(pkt.getEntityIDFrom(), pkt.getDimension());
|
2022-06-03 05:49:59 +00:00
|
|
|
Component from = new TextComponent("Unknown");
|
2022-06-08 10:22:45 +00:00
|
|
|
if (fromEntity != null) {
|
2022-06-03 05:49:59 +00:00
|
|
|
from = fromEntity.getDisplayName();
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (TurnBasedMinecraftMod.proxy.getLocalBattle() != null) {
|
2022-05-17 05:47:42 +00:00
|
|
|
fromEntity = TurnBasedMinecraftMod.proxy.getLocalBattle().getCombatantEntity(pkt.getEntityIDFrom());
|
2022-06-08 10:22:45 +00:00
|
|
|
if (fromEntity != null) {
|
2022-06-03 05:49:59 +00:00
|
|
|
from = fromEntity.getDisplayName();
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Entity toEntity = TurnBasedMinecraftMod.proxy.getEntity(pkt.getEntityIDTo(), pkt.getDimension());
|
2022-06-03 05:49:59 +00:00
|
|
|
Component to = new TextComponent("Unknown");
|
2022-06-08 10:22:45 +00:00
|
|
|
if (toEntity != null) {
|
2022-06-03 05:49:59 +00:00
|
|
|
to = toEntity.getDisplayName();
|
2022-06-08 10:22:45 +00:00
|
|
|
} else if (TurnBasedMinecraftMod.proxy.getLocalBattle() != null) {
|
2022-05-17 05:47:42 +00:00
|
|
|
toEntity = TurnBasedMinecraftMod.proxy.getLocalBattle().getCombatantEntity(pkt.getEntityIDTo());
|
2022-06-08 10:22:45 +00:00
|
|
|
if (toEntity != null) {
|
2022-06-03 05:49:59 +00:00
|
|
|
to = toEntity.getDisplayName();
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
Component parentComponent = new TextComponent("");
|
2022-06-08 10:22:45 +00:00
|
|
|
switch (pkt.getMessageType()) {
|
2022-05-17 05:47:42 +00:00
|
|
|
case ENTERED:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" entered battle!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (TurnBasedMinecraftMod.proxy.getLocalBattle() == null || TurnBasedMinecraftMod.proxy.getLocalBattle().getId() != pkt.getAmount()) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TurnBasedMinecraftMod.proxy.createLocalBattle(pkt.getAmount());
|
|
|
|
}
|
|
|
|
TurnBasedMinecraftMod.proxy.battleStarted();
|
|
|
|
TurnBasedMinecraftMod.proxy.typeEnteredBattle(pkt.getCustom());
|
|
|
|
break;
|
|
|
|
case FLEE:
|
2022-06-08 10:22:45 +00:00
|
|
|
if (pkt.getAmount() != 0) {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" fled battle!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
TurnBasedMinecraftMod.proxy.typeLeftBattle(pkt.getCustom());
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" tried to flee battle but failed!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case DIED:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" died in battle!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
TurnBasedMinecraftMod.proxy.typeLeftBattle(pkt.getCustom());
|
|
|
|
break;
|
|
|
|
case ENDED:
|
|
|
|
TurnBasedMinecraftMod.proxy.displayString("Battle has ended!");
|
|
|
|
TurnBasedMinecraftMod.proxy.battleEnded();
|
|
|
|
break;
|
|
|
|
case ATTACK:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" attacked "));
|
|
|
|
parentComponent.getSiblings().add(to);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" and dealt "));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(Integer.valueOf(pkt.getAmount()).toString()));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" damage!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case DEFEND:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" blocked "));
|
|
|
|
parentComponent.getSiblings().add(to);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent("'s attack!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case DEFENSE_DAMAGE:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" retaliated from "));
|
|
|
|
parentComponent.getSiblings().add(to);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent("'s attack and dealt "));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(Integer.valueOf(pkt.getAmount()).toString()));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" damage!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case MISS:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" attacked "));
|
|
|
|
parentComponent.getSiblings().add(to);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" but missed!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case DEFENDING:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" is defending!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case DID_NOTHING:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" did nothing!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case USED_ITEM:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
2022-06-08 10:22:45 +00:00
|
|
|
switch (PacketBattleMessage.UsedItemAction.valueOf(pkt.getAmount())) {
|
2022-05-17 05:47:42 +00:00
|
|
|
case USED_NOTHING:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(new TextComponent(" tried to use nothing!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case USED_INVALID:
|
2022-06-08 10:22:45 +00:00
|
|
|
if (pkt.getCustom().length() > 0) {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(new TextComponent(" tried to consume "));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(pkt.getCustom()));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" and failed!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(new TextComponent(" tried to consume an invalid item and failed!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case USED_FOOD:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(new TextComponent(" ate a "));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(pkt.getCustom()));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent("!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case USED_POTION:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(new TextComponent(" drank a "));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(pkt.getCustom()));
|
|
|
|
parentComponent.getSiblings().add(new TextComponent("!"));
|
2022-06-14 05:14:22 +00:00
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TURN_BEGIN:
|
|
|
|
TurnBasedMinecraftMod.proxy.displayString("The turn begins!");
|
|
|
|
TurnBasedMinecraftMod.proxy.battleGuiTurnBegin();
|
|
|
|
break;
|
|
|
|
case TURN_END:
|
2022-06-08 10:22:45 +00:00
|
|
|
if (TurnBasedMinecraftMod.proxy.getLocalBattle() != null) {
|
|
|
|
if (pkt.getAmount() == 0) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TurnBasedMinecraftMod.proxy.displayString("The turn ended!");
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-05-17 05:47:42 +00:00
|
|
|
TurnBasedMinecraftMod.proxy.displayString("The turn ended (abnormally due to internal error)!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TurnBasedMinecraftMod.proxy.battleGuiTurnEnd();
|
|
|
|
break;
|
|
|
|
case SWITCHED_ITEM:
|
2022-06-08 10:22:45 +00:00
|
|
|
if (pkt.getAmount() != 0) {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" switched to a different item!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" switched to a different item but failed because it was invalid!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WAS_AFFECTED:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(to);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" was " + pkt.getCustom() + " by "));
|
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent("!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case BECAME_CREATIVE:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" entered creative mode and left battle!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case FIRED_ARROW:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" let loose an arrow towards "));
|
|
|
|
parentComponent.getSiblings().add(to);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent("!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case ARROW_HIT:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(to);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" was hit by "));
|
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent("'s arrow!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case BOW_NO_AMMO:
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
parentComponent.getSiblings().add(new TextComponent(" tried to use their bow but ran out of ammo!"));
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
case CREEPER_WAIT: {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
TextComponent message = new TextComponent(" is charging up!");
|
2022-05-17 05:47:42 +00:00
|
|
|
message.setStyle(message.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)));
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(message);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CREEPER_WAIT_FINAL: {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
TextComponent message = new TextComponent(" is about to explode!");
|
2022-05-17 05:47:42 +00:00
|
|
|
message.setStyle(message.getStyle().withColor(TextColor.fromRgb(0xFFFF5050)));
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(message);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CREEPER_EXPLODE: {
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(from);
|
|
|
|
TextComponent message = new TextComponent(" exploded!");
|
2022-05-17 05:47:42 +00:00
|
|
|
message.setStyle(message.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)));
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(message);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if (msg.getClass() == PacketGeneralMessage.class) {
|
2022-06-08 10:22:45 +00:00
|
|
|
PacketGeneralMessage pkt = (PacketGeneralMessage) msg;
|
2022-05-17 05:47:42 +00:00
|
|
|
displayString(pkt.getMessage());
|
|
|
|
} else if (msg.getClass() == PacketEditingMessage.class) {
|
2022-06-08 10:22:45 +00:00
|
|
|
PacketEditingMessage pkt = (PacketEditingMessage) msg;
|
2022-06-03 05:49:59 +00:00
|
|
|
Component parentComponent = new TextComponent("");
|
2022-06-08 10:22:45 +00:00
|
|
|
switch (pkt.getType()) {
|
|
|
|
case ATTACK_ENTITY: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("Attack the entity you want to edit for TurnBasedMinecraftMod. ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
|
|
|
TextComponent cancel = new TextComponent("Cancel");
|
|
|
|
cancel.setStyle(cancel.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit cancel")));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
parentComponent.getSiblings().add(cancel);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case PICK_EDIT: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("Edit what value? ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
|
|
|
TextComponent option = new TextComponent("IgB");
|
|
|
|
// HoverEvent.Action.SHOW_TEXT is probably SHOW_TEXT
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit ignoreBattle"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("IgnoreBattle"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent value = new TextComponent("(" + pkt.getEntityInfo().ignoreBattle + ") ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("AP");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackPower"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("AttackPower"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().attackPower + ") ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("APr");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackProbability"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("AttackProbability"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().attackProbability + "%) ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("AV");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackVariance"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("AttackVariance"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().attackVariance + ") ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("AE");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackEffect"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("AttackEffect"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().attackEffect.toString() + ") ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("AEPr");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackEffectProbability"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("AttackEffectProbability"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().attackEffectProbability + "%) ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("DD");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit defenseDamage"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("DefenseDamage"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().defenseDamage + ") ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("DDPr");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit defenseDamageProbability"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("DefenseDamageProbability"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().defenseDamageProbability + "%) ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("E");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit evasion"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("Evasion"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().evasion + "%) ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("S");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit speed"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("Speed"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().speed + ") ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("C");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit category"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("Category"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().category + ") ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("DecA");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit decisionAttack"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("DecisionAttack"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().decisionAttack + "%) ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("DecD");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit decisionDefend"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("DecisionDefend"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().decisionDefend + "%) ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("DecF");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit decisionFlee"))
|
2022-06-08 10:22:45 +00:00
|
|
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponent("DecisionFlee"))));
|
2022-05-17 05:47:42 +00:00
|
|
|
value = new TextComponent("(" + pkt.getEntityInfo().decisionFlee + "%) ");
|
|
|
|
value.setStyle(value.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
option.getSiblings().add(value);
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
option = new TextComponent("Finished Editing");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit finish")));
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
text.getSiblings().add(new TextComponent(" "));
|
|
|
|
|
|
|
|
option = new TextComponent("Cancel");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit cancel")));
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case SERVER_EDIT: {
|
2022-06-08 06:24:29 +00:00
|
|
|
TextComponent parent = new TextComponent("Edit what server value? ");
|
|
|
|
parent.setStyle(parent.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
|
|
|
TextComponent sub = new TextComponent("leave_battle_cooldown ");
|
2022-06-09 07:42:21 +00:00
|
|
|
sub.setStyle(sub.getStyle().withColor(ChatFormatting.YELLOW).withBold(true));
|
|
|
|
parent.append(sub);
|
2022-06-08 06:24:29 +00:00
|
|
|
|
|
|
|
for (int i = 1; i <= 10; ++i) {
|
2022-06-09 07:42:21 +00:00
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit leave_battle_cooldown " + i)));
|
2022-06-09 07:42:21 +00:00
|
|
|
parent.append(sub);
|
2022-06-08 06:24:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("aggro_start_battle_max_distance ");
|
2022-06-09 07:42:21 +00:00
|
|
|
sub.setStyle(sub.getStyle().withColor(ChatFormatting.YELLOW).withBold(true));
|
2022-06-08 06:24:29 +00:00
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("5 ");
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit aggro_start_battle_max_distance 5")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("8 ");
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit aggro_start_battle_max_distance 8")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 10; i <= 50; i += 5) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit aggro_start_battle_max_distance " + String.valueOf(i))));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("old_battle_behavior ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.YELLOW)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
2022-06-08 10:22:45 +00:00
|
|
|
new TextComponent("If enabled, battles only start on a hit, not including mobs targeting players")))
|
|
|
|
.withBold(true));
|
2022-06-08 06:24:29 +00:00
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("true ");
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit old_battle_behavior true")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("false ");
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit old_battle_behavior false")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("anyone_can_disable_tbm_for_self ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.YELLOW)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
2022-06-08 10:22:45 +00:00
|
|
|
new TextComponent("Allows use for /tbm-disable and /tbm-enable for all")))
|
|
|
|
.withBold(true));
|
2022-06-08 06:24:29 +00:00
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("true ");
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit anyone_can_disable_tbm_for_self true")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("false ");
|
|
|
|
sub.setStyle(
|
|
|
|
sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit anyone_can_disable_tbm_for_self false")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("max_in_battle ");
|
2022-06-09 07:42:21 +00:00
|
|
|
sub.setStyle(sub.getStyle().withColor(ChatFormatting.YELLOW).withBold(true));
|
2022-06-08 06:24:29 +00:00
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("2 ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit max_in_battle 2")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 5; i < 30; i += 5) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit max_in_battle " + String.valueOf(i))));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("freeze_battle_combatants ");
|
2022-06-09 07:42:21 +00:00
|
|
|
sub.setStyle(sub.getStyle().withColor(ChatFormatting.YELLOW).withBold(true));
|
2022-06-08 06:24:29 +00:00
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("true ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit freeze_battle_combatants true"
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("false ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 06:24:29 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit freeze_battle_combatants false"
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
sub = new TextComponent("ignore_battle_types ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.DARK_GREEN)
|
2022-06-08 10:22:45 +00:00
|
|
|
.withClickEvent(new ClickEvent(
|
|
|
|
ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit ignore_battle_types"))
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Click to show current ignored categories, or use /tbm-server-edit ignore_battle_types add/remove <category_name>")
|
|
|
|
))
|
|
|
|
.withBold(true));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("player_speed ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.YELLOW)
|
2022-06-08 10:22:45 +00:00
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Player default speed"))));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 10:22:45 +00:00
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit player_speed " + i)));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("player_haste_speed ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.YELLOW)
|
2022-06-08 10:22:45 +00:00
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Player speed when under the effects of \"Speed\"")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 10:22:45 +00:00
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit player_haste_speed " + i)));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("player_slow_speed ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.YELLOW)
|
2022-06-08 10:22:45 +00:00
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Player speed when under the effects of \"Slow\"")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
2022-06-09 07:42:21 +00:00
|
|
|
.withColor(ChatFormatting.GREEN)
|
2022-06-08 10:22:45 +00:00
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit player_slow_speed " + i)));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
2022-06-09 07:42:21 +00:00
|
|
|
sub = new TextComponent("player_attack_probability ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Base Player attack probability in percentage")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
if (i == 0) {
|
|
|
|
sub = new TextComponent("1 ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit player_attack_probability 1")));
|
|
|
|
} else {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit player_attack_probability " + i)));
|
|
|
|
}
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("player_evasion ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Base Player evasion rate in percentage")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit player_evasion " + i)));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("defense_duration ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Number of attacks that a \"Defend\" move blocks (lasts until next action)")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 5; ++i) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit defense_duration " + i)));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("flee_good_probability ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Probability of flee success when Player's speed is higher than the fastest opposing Entity")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
if (i == 0) {
|
|
|
|
sub = new TextComponent("1 ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit flee_good_probability 1")));
|
|
|
|
} else {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit flee_good_probability " + i)));
|
|
|
|
}
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("flee_bad_probability ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Probability of flee success when Player's speed is lower than the fastest opposing Entity")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
if (i == 0) {
|
|
|
|
sub = new TextComponent("1 ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit flee_bad_probability 1")));
|
|
|
|
} else {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit flee_bad_probability " + i)));
|
|
|
|
}
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("minimum_hit_percentage ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("The minimum percentage possible when calculating hit percentage for any attacker")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 0; i <= 100; i += 5) {
|
|
|
|
if (i == 0) {
|
|
|
|
sub = new TextComponent("1 ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit minimum_hit_percentage 1")));
|
|
|
|
} else {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit minimum_hit_percentage " + i)));
|
|
|
|
}
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
2022-07-21 03:57:10 +00:00
|
|
|
sub = new TextComponent("battle_turn_wait_forever ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Disables the turn timer (recommended to leave this to false)"))
|
|
|
|
));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("true ");
|
|
|
|
sub.setStyle(sub.getStyle().withColor(ChatFormatting.GREEN).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit battle_turn_wait_forever true")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("false ");
|
|
|
|
sub.setStyle(sub.getStyle().withColor(ChatFormatting.GREEN).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit battle_turn_wait_forever false")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
2022-06-09 07:42:21 +00:00
|
|
|
sub = new TextComponent("battle_turn_time_seconds ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("The time in seconds to wait for all Players to choose their move")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 5; i <= 60; i += 5) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit battle_turn_time_seconds " + i)));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
2022-06-10 03:05:19 +00:00
|
|
|
sub = new TextComponent("creeper_explode_turn ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("The number of turns it takes for a creeper to explode")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
for (int i = 1; i <= 10; ++i) {
|
|
|
|
sub = new TextComponent(String.valueOf(i) + ' ');
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit creeper_explode_turn " + i)));
|
|
|
|
parent.append(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub = new TextComponent("creeper_stop_explode_on_leave_battle ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Stops creepers from exploding when they leave battle (during leave battle cooldown)")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("true ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit creeper_stop_explode_on_leave_battle true")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("false ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit creeper_stop_explode_on_leave_battle false")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("creeper_always_allow_damage ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.YELLOW)
|
|
|
|
.withBold(true)
|
|
|
|
.withHoverEvent(new HoverEvent(
|
|
|
|
HoverEvent.Action.SHOW_TEXT,
|
|
|
|
new TextComponent("Allows creepers to damage anyone who just left battle (in cooldown)")
|
|
|
|
)));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("true ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit creeper_always_allow_damage true")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
|
|
|
sub = new TextComponent("false ");
|
|
|
|
sub.setStyle(sub.getStyle()
|
|
|
|
.withColor(ChatFormatting.GREEN)
|
|
|
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,
|
|
|
|
"/tbm-server-edit creeper_always_allow_damage false")));
|
|
|
|
parent.append(sub);
|
|
|
|
|
2022-06-08 06:24:29 +00:00
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parent);
|
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_IGNORE_BATTLE: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("ignoreBattle: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
|
|
|
TextComponent option = new TextComponent("true");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit ignoreBattle true")));
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" "));
|
|
|
|
|
|
|
|
option = new TextComponent("false");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit ignoreBattle false")));
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_ATTACK_POWER: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("attackPower: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 15; ++i) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i));
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackPower " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 15) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit attackPower <integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_ATTACK_PROBABILITY: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("attackProbability: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 10; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i) + "%");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackProbability " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit attackProbability <percentage-integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_ATTACK_VARIANCE: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("attackVariance: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 10; ++i) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i));
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackVariance " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit attackVariance <integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_ATTACK_EFFECT: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("attackEffect: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (EntityInfo.Effect e : EntityInfo.Effect.values()) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(e.toString());
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackEffect " + e.toString())));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (e != EntityInfo.Effect.UNKNOWN) {
|
2022-05-17 05:47:42 +00:00
|
|
|
// TODO find a better way to handle printing comma for items before last
|
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_ATTACK_EFFECT_PROBABILITY: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("attackEffectProbability: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i) + "%");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit attackEffectProbability " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit attackEffectProbability <percentage-integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_DEFENSE_DAMAGE: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("defenseDamage: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 15; ++i) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i));
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit defenseDamage " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 15) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit defenseDamage <integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_DEFENSE_DAMAGE_PROBABILITY: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("defenseDamageProbability: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i) + "%");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit defenseDamageProbability " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit defenseDamageProbability <percentage-integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_EVASION: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("evasion: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i) + "%");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit evasion " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit evasion <percentage-integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_SPEED: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("speed: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i));
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit speed " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit speed <integer>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_CATEGORY: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("category: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
|
|
|
TextComponent option = new TextComponent("monster");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit category monster")));
|
2022-06-08 10:22:45 +00:00
|
|
|
if (TurnBasedMinecraftMod.proxy.getConfig().isIgnoreBattleType("monster")) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("disabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("enabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
|
|
|
}
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
|
|
|
|
option = new TextComponent("animal");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit category animal")));
|
2022-06-08 10:22:45 +00:00
|
|
|
if (TurnBasedMinecraftMod.proxy.getConfig().isIgnoreBattleType("animal")) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("disabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("enabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
|
|
|
}
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
|
|
|
|
option = new TextComponent("passive");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit category passive")));
|
2022-06-08 10:22:45 +00:00
|
|
|
if (TurnBasedMinecraftMod.proxy.getConfig().isIgnoreBattleType("passive")) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("disabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("enabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
|
|
|
}
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
|
|
|
|
option = new TextComponent("boss");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit category boss")));
|
2022-06-08 10:22:45 +00:00
|
|
|
if (TurnBasedMinecraftMod.proxy.getConfig().isIgnoreBattleType("boss")) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("disabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("enabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
|
|
|
}
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
|
|
|
|
option = new TextComponent("player");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit category player")));
|
2022-06-08 10:22:45 +00:00
|
|
|
if (TurnBasedMinecraftMod.proxy.getConfig().isIgnoreBattleType("player")) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("disabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFFFF0000)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
2022-06-08 10:22:45 +00:00
|
|
|
} else {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent optionInfo = new TextComponent("(battle-");
|
|
|
|
optionInfo.setStyle(optionInfo.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)));
|
|
|
|
TextComponent optionInfoBool = new TextComponent("enabled");
|
|
|
|
optionInfoBool.setStyle(optionInfoBool.getStyle().withColor(TextColor.fromRgb(0xFF00FF00)));
|
|
|
|
optionInfo.getSiblings().add(optionInfoBool);
|
|
|
|
optionInfo.getSiblings().add(new TextComponent(")"));
|
|
|
|
option.getSiblings().add(optionInfo);
|
|
|
|
}
|
|
|
|
text.getSiblings().add(option);
|
|
|
|
|
|
|
|
text.getSiblings().add(new TextComponent(" (or use command \"/tbm-edit edit category <string>\")"));
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_DECISION_ATTACK: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("decisionAttack: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i) + "%");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit decisionAttack " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_DECISION_DEFEND: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("decisionDefend: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i) + "%");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit decisionDefend " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2022-06-08 10:22:45 +00:00
|
|
|
case EDIT_DECISION_FLEE: {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent text = new TextComponent("decisionFlee: ");
|
|
|
|
text.setStyle(text.getStyle().withColor(TextColor.fromRgb(0xFFFFFFFF)).withBold(false));
|
|
|
|
|
2022-06-08 10:22:45 +00:00
|
|
|
for (int i = 0; i <= 100; i += 10) {
|
2022-05-17 05:47:42 +00:00
|
|
|
TextComponent option = new TextComponent(Integer.toString(i) + "%");
|
|
|
|
option.setStyle(option.getStyle().withColor(TextColor.fromRgb(0xFFFFFF00)).withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tbm-edit edit decisionFlee " + Integer.toString(i))));
|
|
|
|
text.getSiblings().add(option);
|
2022-06-08 10:22:45 +00:00
|
|
|
if (i < 100) {
|
2022-05-17 05:47:42 +00:00
|
|
|
text.getSiblings().add(new TextComponent(", "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-03 05:49:59 +00:00
|
|
|
parentComponent.getSiblings().add(text);
|
|
|
|
TurnBasedMinecraftMod.proxy.displayComponent(parentComponent);
|
2022-05-17 05:47:42 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-12 06:39:55 +00:00
|
|
|
}
|