Skip to content

Commit 3ebbd49

Browse files
committed
removed the not needed id
1 parent b15f399 commit 3ebbd49

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class MapRendererDataCache {
5959
*/
6060
public int processImageAsync(@Nonnull BufferedImage image, @Nullable final Runnable onReady) {
6161
PixelCacheEntry pixelCacheEntry = new PixelCacheEntry();
62-
return this.processRendererData(pixelCacheEntry, () -> getMapPixels(pixelCacheEntry.getId(), image), false,
62+
return this.processRendererData(pixelCacheEntry, () -> getMapPixels(image), false,
6363
onReady);
6464
}
6565

@@ -82,7 +82,7 @@ public int processImageAsync(@Nonnull BufferedImage image, @Nullable final Runna
8282
public void updateCachedImage(final int rendererId, @Nonnull final BufferedImage image, @Nullable final Runnable onReady) {
8383
PixelCacheEntry data = get(rendererId);
8484
if (data != null) {
85-
this.processRendererData(data, () -> getMapPixels(rendererId, image),
85+
this.processRendererData(data, () -> getMapPixels(image),
8686
true,
8787
onReady);
8888
}
@@ -312,23 +312,23 @@ private static BufferedImage deepCopy(BufferedImage source) {
312312
return copy;
313313
}
314314

315-
private List<MapPixel> getMapPixels(final int id, final BufferedImage image) {
315+
private List<MapPixel> getMapPixels(final BufferedImage image) {
316316
BufferedImage scaled = getBufferedImage(image);
317317
if (applyColorBalance)
318-
return RenderColors.renderFromImage(id,scaled);
318+
return RenderColors.renderFromImage(scaled);
319319
if (!preConvertToPixels)
320-
return Collections.singletonList(new ImageOverlay(0, 0,scaled));
321-
return addPixels(scaled.getHeight(), scaled.getWidth(), id, scaled);
320+
return Collections.singletonList(new ImageOverlay(0, 0, scaled));
321+
return addPixels(scaled.getHeight(), scaled.getWidth(), scaled);
322322
}
323323

324-
private List<MapPixel> addPixels(final int height, final int width, final int id, @Nonnull final BufferedImage filtered) {
324+
private List<MapPixel> addPixels(final int height, final int width, @Nonnull final BufferedImage filtered) {
325325
List<MapPixel> mapColoredPixels = new ArrayList<>();
326326
int adjustedWidth = Math.min(width, MAX_PIXEL_SIZE);
327327
int adjustedHeight = Math.min(height, MAX_PIXEL_SIZE);
328328

329329
for (int y = 0; y < adjustedHeight; y++) {
330330
for (int x = 0; x < adjustedWidth; x++) {
331-
mapColoredPixels.add(new MapColoredPixel(x, y, new Color(filtered.getRGB(x, y))));
331+
mapColoredPixels.add(new MapColoredPixel(x, y, new Color(filtered.getRGB(x, y))));
332332
}
333333
}
334334
return mapColoredPixels;
@@ -350,8 +350,8 @@ public void onUpdate(@Nonnull final Runnable runnable) {
350350
* Otherwise, it replaces the layer and registers a callback to automatically
351351
* update the layer whenever the cache changes.</p>
352352
*
353-
* @param layer the layer index to set
354-
* @param cacheId the identifier of the cached pixel data
353+
* @param layer the layer index to set
354+
* @param cacheId the identifier of the cached pixel data
355355
* @param renderer the renderer instance to update
356356
*/
357357
public void setLayerToRender(final int layer, final int cacheId, @Nonnull final MapRendererData renderer) {

Item Creator/src/main/java/org/broken/arrow/library/itemcreator/meta/map/color/parser/RenderColors.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,22 @@ private RenderColors() {
3434
* <p>
3535
* Note: this method will make a copy of your image.
3636
*
37-
* @param id optional identifier used for grouping or metadata
38-
* (use -1 if not applicable)
3937
* @param scaled the image already scaled to map resolution (typically 128×128)
4038
* @return a list of set pixels for the image.
4139
*/
42-
public static List<MapPixel> renderFromImage(final int id, final BufferedImage scaled) {
43-
return renderFromImage(id, scaled, true);
40+
public static List<MapPixel> renderFromImage( final BufferedImage scaled) {
41+
return renderFromImage( scaled, true);
4442
}
4543

4644
/**
4745
* Processes a scaled image, smooths brightness inconsistencies,
4846
* and sends final pixel colors to the provided {@link MapRendererData}.
4947
*
50-
* @param id optional identifier used for grouping or metadata
51-
* (use -1 if not applicable)
5248
* @param scaled the image already scaled to map resolution (typically 128×128)
5349
* @param copy Make a copy of the image before scale it.
5450
* @return a list of set pixels for the image.
5551
*/
56-
public static List<MapPixel> renderFromImage(final int id, final BufferedImage scaled, final boolean copy) {
52+
public static List<MapPixel> renderFromImage( final BufferedImage scaled, final boolean copy) {
5753
int width = scaled.getWidth();
5854
int height = scaled.getHeight();
5955

@@ -82,7 +78,7 @@ public static List<MapPixel> renderFromImage(final int id, final BufferedImage s
8278
filtered.setRGB(x, y, rgb);
8379
}
8480
}
85-
return addPixels(id, height, width, filtered);
81+
return addPixels( height, width, filtered);
8682
}
8783

8884
/**
@@ -302,7 +298,7 @@ private static float getBrightness(final float[] neighB, int idx, float brightne
302298
}
303299

304300

305-
private static List<MapPixel> addPixels(final int id, final int height, final int width, @Nonnull final BufferedImage filtered) {
301+
private static List<MapPixel> addPixels( final int height, final int width, @Nonnull final BufferedImage filtered) {
306302
List<MapPixel> mapColoredPixels = new ArrayList<>();
307303
for (int y = 0; y < height; y++) {
308304
for (int x = 0; x < width; x++) {

0 commit comments

Comments
 (0)