Skip to content

Commit 5e3f024

Browse files
committed
Remove debug messages and fix spelling
1 parent 002042b commit 5e3f024

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

Item Creator/src/main/java/org/broken/arrow/library/itemcreator/meta/MapWrapperMeta.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class MapWrapperMeta {
3131
public MapView getMapView() {
3232
if (this.mapView == null)
3333
return null;
34-
return this.mapView.finilazeMapView();
34+
return this.mapView.finalizeMapView();
3535
}
3636

3737
/**
@@ -112,7 +112,6 @@ public BuildMapView createOrRetrieveMapView(@Nullable final World world, final i
112112
if (world == null) return null;
113113
mapView = Bukkit.createMap(world);
114114
}
115-
116115
this.mapView = new BuildMapView(mapView);
117116
action.accept(this.mapView);
118117
return this.mapView;
@@ -135,24 +134,25 @@ public BuildMapView createMapView(@Nonnull final BuildMapView buildMapView) {
135134
* <p>If the {@code itemMeta} is not an instance of {@link MapMeta}, this method does nothing.
136135
* Otherwise, it builds the {@link MapView} from the stored {@link BuildMapView} and sets it on the {@link MapMeta}.</p>
137136
*
138-
* @param item the itemStack to apply the data.
137+
* @param item the ItemStack to which the data is applied, used only on legacy versions
138+
* safe to set to null on Minecraft 1.13+.
139139
* @param itemMeta The {@link ItemMeta} to apply the map view to.
140140
*/
141-
public void applyMapMeta(final ItemStack item, @Nonnull final ItemMeta itemMeta) {
141+
public void applyMapMeta(@Nullable final ItemStack item, @Nonnull final ItemMeta itemMeta) {
142142
if (!(itemMeta instanceof MapMeta)) return;
143143
final MapMeta mapMeta = (MapMeta) itemMeta;
144144

145145
if (ItemCreator.getServerVersion() < 13.0F) {
146146
final BuildMapView mapViewBuilder = this.getMapViewBuilder();
147147
short durability = mapViewBuilder == null ? -1 : (short) mapViewBuilder.getId();
148-
if (durability >= 0) {
148+
if (item != null && durability >= 0) {
149149
item.setDurability(durability);
150150
}
151151
return;
152152
}
153153

154154
if (mapView != null) {
155-
MapView builtMap = mapView.finilazeMapView();
155+
MapView builtMap = mapView.finalizeMapView();
156156
mapMeta.setMapView(builtMap);
157157
}
158158
}

Item Creator/src/main/java/org/broken/arrow/library/itemcreator/meta/map/BuildMapView.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public void setLocked(final boolean locked) {
288288
*
289289
* @return a new MapView instance with your settings.
290290
*/
291-
public MapView finilazeMapView() {
291+
public MapView finalizeMapView() {
292292
if (world == null)
293293
throw new IllegalStateException("World must be set before building MapView.");
294294

@@ -303,12 +303,11 @@ public MapView finilazeMapView() {
303303
if (ItemCreator.getServerVersion() > 10.2F)
304304
mapView.setUnlimitedTracking(unlimited);
305305

306-
for (MapRenderer renderer : mapView.getRenderers()) {
307-
mapView.removeRenderer(renderer);
308-
}
309-
System.out.println("mapId " + mapId);
310-
System.out.println("mapView.getRenderers() " + renderers.size());
311306
if (!renderers.isEmpty()) {
307+
308+
for (MapRenderer renderer : mapView.getRenderers()) {
309+
mapView.removeRenderer(renderer);
310+
}
312311
for (MapRendererData data : renderers) {
313312
mapView.addRenderer(data.getMapRenderer());
314313
}

Item Creator/src/main/java/org/broken/arrow/library/itemcreator/serialization/itemstack/SerializeItem.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ private static void retrieveMapData(@Nonnull final ItemStack item, @Nonnull fina
515515
final MapWrapperMeta mapMetaWrapper = new MapWrapperMeta();
516516
final BuildMapView buildMapView = new BuildMapView(mapView);
517517
buildMapView.addAllRenderers(mapView.getRenderers());
518-
//buildMapView.finilazeMapView();
519518
mapMetaWrapper.createMapView(buildMapView);
520519
data.mapViewMeta = mapMetaWrapper;
521520
}
@@ -526,7 +525,6 @@ private static void retrieveMapData(@Nonnull final ItemStack item, @Nonnull fina
526525
final MapWrapperMeta mapMetaWrapper = new MapWrapperMeta();
527526
final BuildMapView buildMapView = new BuildMapView(mapView);
528527
buildMapView.addAllRenderers(mapView.getRenderers());
529-
// buildMapView.finilazeMapView();
530528
mapMetaWrapper.createMapView(buildMapView);
531529
data.mapViewMeta = mapMetaWrapper;
532530
}

0 commit comments

Comments
 (0)