mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
[ci skip] fix: fix comment (#692)
* fix: fix comment * refactor: format code
This commit is contained in:
@@ -75,7 +75,7 @@ ij_java_case_statement_on_separate_line = true
|
||||
ij_java_catch_on_new_line = false
|
||||
ij_java_class_annotation_wrap = split_into_lines
|
||||
ij_java_class_brace_style = end_of_line
|
||||
ij_java_class_count_to_use_import_on_demand = 99
|
||||
ij_java_class_count_to_use_import_on_demand = 10
|
||||
ij_java_class_names_in_javadoc = 1
|
||||
ij_java_deconstruction_list_wrap = normal
|
||||
ij_java_do_not_indent_top_level_class_members = false
|
||||
|
||||
@@ -5,19 +5,19 @@ Subject: [PATCH] Fix block place desync due to update suppression
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||
index e59b8d42d602bbdae1071f2a5be1180420c4efb7..1186cad641786aff2ea6f664724a53511aa1440e 100644
|
||||
index e59b8d42d602bbdae1071f2a5be1180420c4efb7..5dadbdb4bb4c0d3a2dcc33120ac725bfe3e6f65c 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -389,8 +389,12 @@ public final class ItemStack implements DataComponentHolder {
|
||||
}
|
||||
}
|
||||
InteractionResult interactionResult;
|
||||
+ org.leavesmc.leaves.util.UpdateSuppressionException ue = null;
|
||||
+ org.leavesmc.leaves.util.UpdateSuppressionException ue = null; // Leaves start - fix block place desync due to update suppression
|
||||
try {
|
||||
interactionResult = item.useOn(context);
|
||||
+ } catch (org.leavesmc.leaves.util.UpdateSuppressionException te) {
|
||||
+ interactionResult = net.minecraft.world.InteractionResult.SUCCESS.configurePaper(e -> e.placedBlockAt(clickedPos.immutable()));
|
||||
+ ue = te;
|
||||
+ ue = te; // Leaves end - fix block place desync due to update suppression
|
||||
} finally {
|
||||
serverLevel.captureBlockStates = false;
|
||||
}
|
||||
|
||||
@@ -4,4 +4,3 @@ ij_java_do_while_brace_force = always
|
||||
ij_java_for_brace_force = always
|
||||
ij_java_while_brace_force = always
|
||||
ij_java_use_fq_class_names = false
|
||||
ij_java_packages_to_use_import_on_demand = org.leavesmc.leaves.bot.agent.actions.*, org.leavesmc.leaves.bot.agent.configs.*, org.leavesmc.leaves.entity.bot.action.*
|
||||
@@ -36,7 +36,6 @@ import org.leavesmc.leaves.event.bot.BotRemoveEvent;
|
||||
import org.leavesmc.leaves.event.bot.BotSpawnLocationEvent;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -60,7 +60,7 @@ import org.leavesmc.leaves.LeavesLogger;
|
||||
import org.leavesmc.leaves.bot.agent.AbstractBotConfig;
|
||||
import org.leavesmc.leaves.bot.agent.Actions;
|
||||
import org.leavesmc.leaves.bot.agent.Configs;
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerBotAction;
|
||||
import org.leavesmc.leaves.entity.bot.CraftBot;
|
||||
import org.leavesmc.leaves.event.bot.BotActionScheduleEvent;
|
||||
import org.leavesmc.leaves.event.bot.BotCreateEvent;
|
||||
@@ -310,7 +310,7 @@ public class ServerBot extends ServerPlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setServerLevel(ServerLevel level) {
|
||||
public void setServerLevel(@NotNull ServerLevel level) {
|
||||
BotList.INSTANCE.updateBotLevel(this, level);
|
||||
super.setServerLevel(level);
|
||||
}
|
||||
@@ -475,9 +475,7 @@ public class ServerBot extends ServerPlayer {
|
||||
}
|
||||
|
||||
public void renderInfo() {
|
||||
this.getServer().getPlayerList().getPlayers().forEach(
|
||||
player -> this.sendPlayerInfo(player)
|
||||
);
|
||||
this.getServer().getPlayerList().getPlayers().forEach(this::sendPlayerInfo);
|
||||
}
|
||||
|
||||
public void renderData() {
|
||||
|
||||
@@ -4,7 +4,12 @@ import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
import org.leavesmc.leaves.bot.agent.configs.*;
|
||||
import org.leavesmc.leaves.bot.agent.configs.AlwaysSendDataConfig;
|
||||
import org.leavesmc.leaves.bot.agent.configs.LocatorBarConfig;
|
||||
import org.leavesmc.leaves.bot.agent.configs.SimulationDistanceConfig;
|
||||
import org.leavesmc.leaves.bot.agent.configs.SkipSleepConfig;
|
||||
import org.leavesmc.leaves.bot.agent.configs.SpawnPhantomConfig;
|
||||
import org.leavesmc.leaves.bot.agent.configs.TickTypeConfig;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.leavesmc.leaves.bot.agent.actions;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftVehicle;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.leavesmc.leaves.LeavesConfig;
|
||||
import org.leavesmc.leaves.bot.BotList;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
import org.leavesmc.leaves.bot.agent.Actions;
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerBotAction;
|
||||
import org.leavesmc.leaves.command.LeavesSubcommand;
|
||||
import org.leavesmc.leaves.command.LeavesSuggestionBuilder;
|
||||
import org.leavesmc.leaves.event.bot.BotActionStopEvent;
|
||||
|
||||
@@ -9,8 +9,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.bot.BotList;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerBotAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.BotAction;
|
||||
import org.leavesmc.leaves.entity.bot.actions.CraftBotAction;
|
||||
import org.leavesmc.leaves.event.bot.BotActionStopEvent;
|
||||
import org.leavesmc.leaves.event.bot.BotRemoveEvent;
|
||||
|
||||
@@ -9,8 +9,8 @@ import org.leavesmc.leaves.bot.BotCreateState;
|
||||
import org.leavesmc.leaves.bot.BotList;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
import org.leavesmc.leaves.bot.agent.Actions;
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerBotAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.BotAction;
|
||||
import org.leavesmc.leaves.event.bot.BotCreateEvent;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerAttackAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.AttackAction;
|
||||
|
||||
public class CraftAttackAction extends CraftTimerBotAction<AttackAction, ServerAttackAction> implements AttackAction {
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerBotAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.BotAction;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerBreakBlockAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.BreakBlockAction;
|
||||
|
||||
public class CraftBreakBlockAction extends CraftTimerBotAction<BreakBlockAction, ServerBreakBlockAction> implements BreakBlockAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerDropAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.DropAction;
|
||||
|
||||
public class CraftDropAction extends CraftTimerBotAction<DropAction, ServerDropAction> implements DropAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerFishAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.FishAction;
|
||||
|
||||
public class CraftFishAction extends CraftTimerBotAction<FishAction, ServerFishAction> implements FishAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerJumpAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.JumpAction;
|
||||
|
||||
public class CraftJumpAction extends CraftTimerBotAction<JumpAction, ServerJumpAction> implements JumpAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerMountAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.MountAction;
|
||||
|
||||
public class CraftMountAction extends CraftBotAction<MountAction, ServerMountAction> implements MountAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerMoveAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.MoveAction;
|
||||
|
||||
public class CraftMoveAction extends CraftBotAction<MoveAction, ServerMoveAction> implements MoveAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerRotationAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.RotationAction;
|
||||
|
||||
public class CraftRotationAction extends CraftBotAction<RotationAction, ServerRotationAction> implements RotationAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerSneakAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.SneakAction;
|
||||
|
||||
public class CraftSneakAction extends CraftBotAction<SneakAction, ServerSneakAction> implements SneakAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerSwapAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.SwapAction;
|
||||
|
||||
public class CraftSwapAction extends CraftBotAction<SwapAction, ServerSwapAction> implements SwapAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerSwimAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.SwimAction;
|
||||
|
||||
public class CraftSwimAction extends CraftBotAction<SwimAction, ServerSwimAction> implements SwimAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerTimerBotAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.TimerBotAction;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerUseItemAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.UseItemAction;
|
||||
|
||||
public class CraftUseItemAction extends CraftTimerBotAction<UseItemAction, ServerUseItemAction> implements UseItemAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerUseItemAutoAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.UseItemAutoAction;
|
||||
|
||||
public class CraftUseItemAutoAction extends CraftTimerBotAction<UseItemAutoAction, ServerUseItemAutoAction> implements UseItemAutoAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerUseItemOffhandAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.UseItemOffhandAction;
|
||||
|
||||
public class CraftUseItemOffhandAction extends CraftTimerBotAction<UseItemOffhandAction, ServerUseItemOffhandAction> implements UseItemOffhandAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerUseItemOnAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.UseItemOnAction;
|
||||
|
||||
public class CraftUseItemOnAction extends CraftTimerBotAction<UseItemOnAction, ServerUseItemOnAction> implements UseItemOnAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerUseItemOnOffhandAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.UseItemOnOffhandAction;
|
||||
|
||||
public class CraftUseItemOnOffhandAction extends CraftTimerBotAction<UseItemOnOffhandAction, ServerUseItemOnOffhandAction> implements UseItemOnOffhandAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerUseItemToAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.UseItemToAction;
|
||||
|
||||
public class CraftUseItemToAction extends CraftTimerBotAction<UseItemToAction, ServerUseItemToAction> implements UseItemToAction {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.leavesmc.leaves.entity.bot.actions;
|
||||
|
||||
import org.leavesmc.leaves.bot.agent.actions.*;
|
||||
import org.leavesmc.leaves.entity.bot.action.*;
|
||||
import org.leavesmc.leaves.bot.agent.actions.ServerUseItemToOffhandAction;
|
||||
import org.leavesmc.leaves.entity.bot.action.UseItemToOffhandAction;
|
||||
|
||||
public class CraftUseItemToOffhandAction extends CraftTimerBotAction<UseItemToOffhandAction, ServerUseItemToOffhandAction> implements UseItemToOffhandAction {
|
||||
|
||||
|
||||
@@ -6,16 +6,7 @@ import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.BedBlock;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.ComparatorBlock;
|
||||
import net.minecraft.world.level.block.DirectionalBlock;
|
||||
import net.minecraft.world.level.block.DispenserBlock;
|
||||
import net.minecraft.world.level.block.GlazedTerracottaBlock;
|
||||
import net.minecraft.world.level.block.ObserverBlock;
|
||||
import net.minecraft.world.level.block.RepeaterBlock;
|
||||
import net.minecraft.world.level.block.StairBlock;
|
||||
import net.minecraft.world.level.block.TrapDoorBlock;
|
||||
import net.minecraft.world.level.block.*;
|
||||
import net.minecraft.world.level.block.piston.PistonBaseBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
|
||||
@@ -24,18 +24,7 @@ import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.CampfireBlock;
|
||||
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.CommandBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.ComparatorBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.HopperBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.JukeboxBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.LecternBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -57,18 +46,7 @@ import org.leavesmc.leaves.protocol.jade.provider.IServerDataProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.IServerExtensionProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.ItemStorageExtensionProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.ItemStorageProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.BeehiveProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.BlockNameProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.BrewingStandProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.CampfireProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.ChiseledBookshelfProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.CommandBlockProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.FurnaceProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.HopperLockProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.JukeboxProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.LecternProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.MobSpawnerCooldownProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.RedstoneProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.block.*;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.entity.AnimalOwnerProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.entity.MobBreedingProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.entity.MobGrowthProvider;
|
||||
|
||||
@@ -20,17 +20,7 @@ import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.FireworkRocketRecipe;
|
||||
import net.minecraft.world.item.crafting.MapCloningRecipe;
|
||||
import net.minecraft.world.item.crafting.RecipeHolder;
|
||||
import net.minecraft.world.item.crafting.RecipeMap;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.world.item.crafting.ShapelessRecipe;
|
||||
import net.minecraft.world.item.crafting.SmithingTransformRecipe;
|
||||
import net.minecraft.world.item.crafting.SmithingTrimRecipe;
|
||||
import net.minecraft.world.item.crafting.TippedArrowRecipe;
|
||||
import net.minecraft.world.item.crafting.TransmuteRecipe;
|
||||
import net.minecraft.world.item.crafting.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
@@ -38,6 +28,7 @@ import org.bukkit.plugin.PluginManager;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.LeavesConfig;
|
||||
import org.leavesmc.leaves.LeavesLogger;
|
||||
import org.leavesmc.leaves.plugin.MinecraftInternalPlugin;
|
||||
import org.leavesmc.leaves.protocol.core.LeavesProtocol;
|
||||
import org.leavesmc.leaves.protocol.core.ProtocolHandler;
|
||||
@@ -337,17 +328,17 @@ public class REIServerProtocol implements LeavesProtocol {
|
||||
player.sendSystemMessage(Component.translatable(e.getMessage()).withStyle(ChatFormatting.RED));
|
||||
} catch (Exception e) {
|
||||
player.sendSystemMessage(Component.translatable("error.rei.internal.error", e.getMessage()).withStyle(ChatFormatting.RED));
|
||||
e.printStackTrace();
|
||||
LeavesLogger.LOGGER.severe("Failed to move items for player " + player.getScoreboardName(), e);
|
||||
}
|
||||
});
|
||||
} catch (IllegalStateException e) {
|
||||
player.sendSystemMessage(Component.translatable(e.getMessage()).withStyle(ChatFormatting.RED));
|
||||
} catch (Exception e) {
|
||||
player.sendSystemMessage(Component.translatable("error.rei.internal.error", e.getMessage()).withStyle(ChatFormatting.RED));
|
||||
e.printStackTrace();
|
||||
LeavesLogger.LOGGER.severe("Failed to move items for player " + player.getScoreboardName(), e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LeavesLogger.LOGGER.severe("Failed to move items for player " + player.getScoreboardName(), e);
|
||||
}
|
||||
};
|
||||
inboundTransform(player, MOVE_ITEMS_NEW_PACKET, buf, consumer);
|
||||
|
||||
@@ -50,7 +50,6 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -225,7 +224,7 @@ public class Recorder extends Connection {
|
||||
try {
|
||||
replayFile.saveMetaData(metaData);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
LOGGER.severe("Error saving metadata", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -235,13 +234,8 @@ public class Recorder extends Connection {
|
||||
}
|
||||
|
||||
private void savePacket(Packet<?> packet, final ConnectionProtocol protocol) {
|
||||
try {
|
||||
final long timestamp = getCurrentTimeAndUpdate();
|
||||
replayFile.savePacket(timestamp, packet, protocol);
|
||||
} catch (Exception e) {
|
||||
LOGGER.severe("Error saving packet");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isSaved() {
|
||||
|
||||
@@ -19,16 +19,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.leavesmc.leaves.protocol.core.ProtocolUtils;
|
||||
import org.leavesmc.leaves.util.UUIDSerializer;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
@@ -121,7 +112,7 @@ public class ReplayFile {
|
||||
}
|
||||
}
|
||||
|
||||
public void savePacket(long timestamp, Packet<?> packet, ConnectionProtocol protocol) throws Exception {
|
||||
public void savePacket(long timestamp, Packet<?> packet, ConnectionProtocol protocol) {
|
||||
byte[] data = getPacketBytes(packet, protocol);
|
||||
saveService.execute(() -> {
|
||||
try {
|
||||
@@ -129,8 +120,7 @@ public class ReplayFile {
|
||||
packetStream.writeInt(data.length);
|
||||
packetStream.write(data);
|
||||
} catch (Exception e) {
|
||||
LOGGER.severe("Error saving packet");
|
||||
e.printStackTrace();
|
||||
LOGGER.severe("Error saving packet", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user