From 6143c88b52b5dd9387626d48a4f47df6f037512f Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Wed, 11 Jul 2018 19:59:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D1=87=D0=B5=D0=BC=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=BC=20Location.copyOf(),=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D1=8C=20clone()=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/java/mc/core/Location.java | 6 +----- .../java/mc/core/network/proto_1_12_2/TeleportManager.java | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/mc/core/Location.java b/core/src/main/java/mc/core/Location.java index 474ab1d..438efd9 100644 --- a/core/src/main/java/mc/core/Location.java +++ b/core/src/main/java/mc/core/Location.java @@ -12,10 +12,6 @@ import lombok.Data; public class Location implements Cloneable { private double x, y, z; - public static Location copyOf(Location location) { - return location.clone(); - } - public Location (Location location) { this.x = location.getX(); this.y = location.getY(); @@ -49,7 +45,7 @@ public class Location implements Cloneable { } @Override - protected Location clone() { + public Location clone() { try { return (Location) super.clone(); } catch (CloneNotSupportedException e) { diff --git a/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/TeleportManager.java b/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/TeleportManager.java index 31424bd..90c735f 100644 --- a/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/TeleportManager.java +++ b/proto_1.12.2/src/main/java/mc/core/network/proto_1_12_2/TeleportManager.java @@ -38,7 +38,7 @@ public class TeleportManager { teleportId = RAND.nextInt(9999); } while (teleportMap.containsKey(teleportId)); - teleportMap.put(teleportId, new TpData(player, Location.copyOf(location))); + teleportMap.put(teleportId, new TpData(player, location.clone())); return teleportId; }