From 479a1e877e3186a9b747c79e3c12c8df97107ebf Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 11 Feb 2023 17:32:26 +0800 Subject: [PATCH 001/261] Implementing more tree types --- src/main/java/minicraft/level/LevelGen.java | 46 ++++++------ src/main/java/minicraft/level/tile/Tiles.java | 10 ++- .../java/minicraft/level/tile/TreeTile.java | 66 ++++++++++++++---- .../resources/assets/textures/tile/ash.png | Bin 0 -> 235 bytes .../assets/textures/tile/ash_full.png | Bin 0 -> 217 bytes .../resources/assets/textures/tile/aspen.png | Bin 0 -> 242 bytes .../assets/textures/tile/aspen_full.png | Bin 0 -> 217 bytes .../resources/assets/textures/tile/birch.png | Bin 0 -> 244 bytes .../assets/textures/tile/birch_full.png | Bin 0 -> 210 bytes .../resources/assets/textures/tile/fir.png | Bin 0 -> 235 bytes .../assets/textures/tile/fir_full.png | Bin 0 -> 202 bytes .../resources/assets/textures/tile/oak.png | Bin 0 -> 235 bytes .../assets/textures/tile/oak_full.png | Bin 0 -> 202 bytes .../resources/assets/textures/tile/spruce.png | Bin 0 -> 235 bytes .../assets/textures/tile/spruce_full.png | Bin 0 -> 202 bytes .../resources/assets/textures/tile/tree.png | Bin 263 -> 0 bytes .../assets/textures/tile/tree_full.png | Bin 242 -> 0 bytes .../resources/assets/textures/tile/willow.png | Bin 0 -> 237 bytes .../assets/textures/tile/willow_full.png | Bin 0 -> 202 bytes 19 files changed, 88 insertions(+), 34 deletions(-) create mode 100644 src/main/resources/assets/textures/tile/ash.png create mode 100644 src/main/resources/assets/textures/tile/ash_full.png create mode 100644 src/main/resources/assets/textures/tile/aspen.png create mode 100644 src/main/resources/assets/textures/tile/aspen_full.png create mode 100644 src/main/resources/assets/textures/tile/birch.png create mode 100644 src/main/resources/assets/textures/tile/birch_full.png create mode 100644 src/main/resources/assets/textures/tile/fir.png create mode 100644 src/main/resources/assets/textures/tile/fir_full.png create mode 100644 src/main/resources/assets/textures/tile/oak.png create mode 100644 src/main/resources/assets/textures/tile/oak_full.png create mode 100644 src/main/resources/assets/textures/tile/spruce.png create mode 100644 src/main/resources/assets/textures/tile/spruce_full.png delete mode 100644 src/main/resources/assets/textures/tile/tree.png delete mode 100644 src/main/resources/assets/textures/tile/tree_full.png create mode 100644 src/main/resources/assets/textures/tile/willow.png create mode 100644 src/main/resources/assets/textures/tile/willow_full.png diff --git a/src/main/java/minicraft/level/LevelGen.java b/src/main/java/minicraft/level/LevelGen.java index 39c7bf4f4..39a8887b0 100644 --- a/src/main/java/minicraft/level/LevelGen.java +++ b/src/main/java/minicraft/level/LevelGen.java @@ -2,11 +2,15 @@ import java.awt.Image; import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.Collections; import java.util.Random; +import java.util.function.Supplier; import javax.swing.ImageIcon; import javax.swing.JOptionPane; +import minicraft.level.tile.TreeTile; import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; @@ -36,7 +40,7 @@ public LevelGen(int w, int h, int featureSize) { } int stepSize = featureSize; - double scale = 2 / w; + double scale = 2.0 / w; double scaleMod = 1; do { int halfStep = stepSize / 2; @@ -47,7 +51,7 @@ public LevelGen(int w, int h, int featureSize) { double c = sample(x, y + stepSize); // Fetches the next value down, possibly looping back to the top of the column. double d = sample(x + stepSize, y + stepSize); // Fetches the value one down, one right. - /** + /* * This could probably use some explaining... Note: the number values are probably only good the first time around... * * This starts with taking the average of the four numbers from before (they form a little square in adjacent tiles), each of which holds a value from -1 to 1. @@ -81,7 +85,7 @@ public LevelGen(int w, int h, int featureSize) { } } - /** + /* * THEN... this stuff is set to repeat the system all over again! * The featureSize is halved, allowing access to further unset mids, and the scale changes... * The scale increases the first time, x1.8, but the second time it's x1.1, and after that probably a little less than 1. So, it generally increases a bit, maybe to 4 / w at tops. This results in the 5th random value being more significant than the first 4 ones in later iterations. @@ -97,7 +101,7 @@ private double sample(int x, int y) { } // This merely returns the value, like Level.getTile(x, y). private void setSample(int x, int y, double value) { - /** + /* * This method is short, but difficult to understand. This is what I think it does: * * The values array is like a 2D array, but formatted into a 1D array; so the basic "x + y * w" is used to access a given value. @@ -113,8 +117,7 @@ private void setSample(int x, int y, double value) { values[(x & (w - 1)) + (y & (h - 1)) * w] = value; } - @Nullable - static short[][] createAndValidateMap(int w, int h, int level, long seed) { + static short[] @Nullable [] createAndValidateMap(int w, int h, int level, long seed) { worldSeed = seed; if (level == 1) @@ -144,7 +147,7 @@ private static short[][] createAndValidateTopMap(int w, int h) { if (count[Tiles.get("rock").id & 0xffff] < 100) continue; if (count[Tiles.get("sand").id & 0xffff] < 100) continue; if (count[Tiles.get("grass").id & 0xffff] < 100) continue; - if (count[Tiles.get("tree").id & 0xffff] < 100) continue; + if (TreeTile.treeIDs.stream().map(id -> count[id & 0xffff]).reduce(0, Integer::sum) < 100) continue; if (count[Tiles.get("Stairs Down").id & 0xffff] < w / 21) continue; // Size 128 = 6 stairs min @@ -154,7 +157,7 @@ private static short[][] createAndValidateTopMap(int w, int h) { } while (true); } - private static @Nullable short[][] createAndValidateUndergroundMap(int w, int h, int depth) { + private static short[] @Nullable [] createAndValidateUndergroundMap(int w, int h, int depth) { random.setSeed(worldSeed); do { short[][] result = createUndergroundMap(w, h, depth); @@ -195,7 +198,7 @@ private static short[][] createAndValidateDungeon(int w, int h) { } while (true); } - private static @Nullable short[][] createAndValidateSkyMap(int w, int h) { + private static short[] @Nullable [] createAndValidateSkyMap(int w, int h) { random.setSeed(worldSeed); do { @@ -241,7 +244,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map double yd = y / (h - 1.0) * 2 - 1; if (xd < 0) xd = -xd; if (yd < 0) yd = -yd; - double dist = xd >= yd ? xd : yd; + double dist = Math.max(xd, yd); dist = dist * dist * dist * dist; dist = dist * dist * dist * dist; val += 1 - dist*20; @@ -355,6 +358,9 @@ private static short[][] createTopMap(int w, int h) { // Create surface map } } + ArrayList treeIDs = new ArrayList<>(TreeTile.treeIDs); + Supplier treeRandom = () -> treeIDs.get(random.nextInt(treeIDs.size())); + if (Settings.get("Theme").equals("minicraft.settings.theme.forest")) { for (int i = 0; i < w * h / 200; i++) { int x = random.nextInt(w); @@ -364,7 +370,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = Tiles.get("tree").id; + map[xx + yy * w] = treeRandom.get(); } } } @@ -379,7 +385,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = Tiles.get("tree").id; + map[xx + yy * w] = treeRandom.get(); } } } @@ -395,7 +401,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = Tiles.get("tree").id; + map[xx + yy * w] = treeRandom.get(); } } } @@ -410,7 +416,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = Tiles.get("tree").id; + map[xx + yy * w] = treeRandom.get(); } } } @@ -436,7 +442,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map for (int i = 0; i < w * h / 100; i++) { int xx = random.nextInt(w); int yy = random.nextInt(h); - if (xx >= 0 && yy >= 0 && xx < w && yy < h) { + if (xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("sand").id) { map[xx + yy * w] = Tiles.get("cactus").id; } @@ -495,7 +501,7 @@ private static short[][] createDungeon(int w, int h) { double yd = y / (h - 1.1) * 2 - 1; if (xd < 0) xd = -xd; if (yd < 0) yd = -yd; - double dist = xd >= yd ? xd : yd; + double dist = Math.max(xd, yd); dist = dist * dist * dist * dist; dist = dist * dist * dist * dist; val = -val * 1 - 2.2; @@ -566,11 +572,11 @@ private static short[][] createUndergroundMap(int w, int h, int depth) { double yd = y / (h - 1.0) * 2 - 1; if (xd < 0) xd = -xd; if (yd < 0) yd = -yd; - double dist = xd >= yd ? xd : yd; + double dist = Math.max(xd, yd); dist = Math.pow(dist, 8); val += 1 - dist * 20; - if (val > -1 && wval < -1 + (depth) / 2 * 3) { + if (val > -1 && wval < -1 + (depth) / 2.0 * 3) { if (depth == 3) map[i] = Tiles.get("lava").id; else if (depth == 1) map[i] = Tiles.get("dirt").id; else map[i] = Tiles.get("water").id; @@ -669,7 +675,7 @@ private static short[][] createSkyMap(int w, int h) { double yd = y / (h - 1.0) * 2 - 1; if (xd < 0) xd = -xd; if (yd < 0) yd = -yd; - double dist = xd >= yd ? xd : yd; + double dist = Math.max(xd, yd); dist = dist * dist * dist * dist; dist = dist * dist * dist * dist; val = -val * 1 - 2.2; @@ -751,7 +757,6 @@ public static void main(String[] args) { if (!valid) { maplvls = new int[1]; - maplvls[0] = 0; } //noinspection InfiniteLoopStatement @@ -759,6 +764,7 @@ public static void main(String[] args) { int w = 128; int h = 128; + //noinspection ConstantConditions int lvl = maplvls[idx++ % maplvls.length]; if (lvl > 1 || lvl < -4) continue; diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index 4d9b5d48e..913a28bf2 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -31,8 +31,8 @@ public static void initTileList() { tiles.put((short)17, new LavaTile("Lava")); tiles.put((short)7, new RockTile("Rock")); - tiles.put((short)8, new TreeTile("Tree")); - tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Tree"))); + tiles.put((short)8, new TreeTile(TreeTile.TreeType.OAK)); + tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Oak"))); tiles.put((short)10, new SandTile("Sand")); tiles.put((short)11, new CactusTile("Cactus")); tiles.put((short)12, new SaplingTile("Cactus Sapling", Tiles.get("Sand"), Tiles.get("Cactus"))); @@ -69,6 +69,12 @@ public static void initTileList() { tiles.put((short)44, new MaterialTile(Tile.Material.Obsidian)); tiles.put((short)45, new DecorTile(Tile.Material.Stone)); tiles.put((short)46, new DecorTile(Tile.Material.Obsidian)); + tiles.put((short)47, new TreeTile(TreeTile.TreeType.SPRUCE)); + tiles.put((short)48, new TreeTile(TreeTile.TreeType.BIRCH)); + tiles.put((short)49, new TreeTile(TreeTile.TreeType.ASH)); + tiles.put((short)50, new TreeTile(TreeTile.TreeType.ASPEN)); + tiles.put((short)51, new TreeTile(TreeTile.TreeType.FIR)); + tiles.put((short)52, new TreeTile(TreeTile.TreeType.WILLOW)); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/main/java/minicraft/level/tile/TreeTile.java b/src/main/java/minicraft/level/tile/TreeTile.java index aed54b1ae..0de06bba1 100644 --- a/src/main/java/minicraft/level/tile/TreeTile.java +++ b/src/main/java/minicraft/level/tile/TreeTile.java @@ -22,12 +22,54 @@ import minicraft.screen.AchievementsDisplay; import minicraft.screen.QuestsDisplay; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + public class TreeTile extends Tile { - private static LinkedSprite treeSprite = new LinkedSprite(SpriteType.Tile, "tree"); - private static LinkedSprite treeSpriteFull = new LinkedSprite(SpriteType.Tile, "tree_full"); + private static final LinkedSprite oakSprite = new LinkedSprite(SpriteType.Tile, "oak"); + private static final LinkedSprite oakSpriteFull = new LinkedSprite(SpriteType.Tile, "oak_full"); + private static final LinkedSprite spruceSprite = new LinkedSprite(SpriteType.Tile, "spruce"); + private static final LinkedSprite spruceSpriteFull = new LinkedSprite(SpriteType.Tile, "spruce_full"); + private static final LinkedSprite birchSprite = new LinkedSprite(SpriteType.Tile, "birch"); + private static final LinkedSprite birchSpriteFull = new LinkedSprite(SpriteType.Tile, "birch_full"); + private static final LinkedSprite ashSprite = new LinkedSprite(SpriteType.Tile, "ash"); + private static final LinkedSprite ashSpriteFull = new LinkedSprite(SpriteType.Tile, "ash_full"); + private static final LinkedSprite aspenSprite = new LinkedSprite(SpriteType.Tile, "aspen"); + private static final LinkedSprite aspenSpriteFull = new LinkedSprite(SpriteType.Tile, "aspen_full"); + private static final LinkedSprite firSprite = new LinkedSprite(SpriteType.Tile, "fir"); + private static final LinkedSprite firSpriteFull = new LinkedSprite(SpriteType.Tile, "fir_full"); + private static final LinkedSprite willowSprite = new LinkedSprite(SpriteType.Tile, "willow"); + private static final LinkedSprite willowSpriteFull = new LinkedSprite(SpriteType.Tile, "willow_full"); + + private final TreeType type; + + public static final Set treeIDs = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( + (short) 8, (short) 47, (short) 48, (short) 49, (short) 50, (short) 51, (short) 52))); + + public enum TreeType { + OAK(oakSprite, oakSpriteFull), + SPRUCE(spruceSprite, spruceSpriteFull), + BIRCH(birchSprite, birchSpriteFull), + ASH(ashSprite, ashSpriteFull), + ASPEN(aspenSprite, aspenSpriteFull), + FIR(firSprite, firSpriteFull), + WILLOW(willowSprite, willowSpriteFull), + ; + + private final LinkedSprite treeSprite; + private final LinkedSprite treeSpriteFull; + + TreeType(LinkedSprite treeSprite, LinkedSprite treeSpriteFull) { + this.treeSprite = treeSprite; + this.treeSpriteFull = treeSpriteFull; + } + } - protected TreeTile(String name) { - super(name, (SpriteAnimation)null); + protected TreeTile(TreeType type) { + super(type.name().toLowerCase(), null); + this.type = type; connectsToGrass = true; } @@ -43,25 +85,25 @@ public void render(Screen screen, Level level, int x, int y) { boolean dl = level.getTile(x - 1, y + 1) == this; boolean dr = level.getTile(x + 1, y + 1) == this; - Sprite sprite = treeSprite.getSprite(); - Sprite spriteFull = treeSpriteFull.getSprite(); + Sprite sprite = type.treeSprite.getSprite(); + Sprite spriteFull = type.treeSpriteFull.getSprite(); if (u && ul && l) { - screen.render(x * 16 + 0, y * 16 + 0, spriteFull.spritePixels[0][1]); + screen.render(x * 16, y * 16, spriteFull.spritePixels[0][1]); } else { - screen.render(x * 16 + 0, y * 16 + 0, sprite.spritePixels[0][0]); + screen.render(x * 16, y * 16, sprite.spritePixels[0][0]); } if (u && ur && r) { - screen.render(x * 16 + 8, y * 16 + 0, spriteFull.spritePixels[0][0]); + screen.render(x * 16 + 8, y * 16, spriteFull.spritePixels[0][0]); } else { - screen.render(x * 16 + 8, y * 16 + 0, sprite.spritePixels[0][1]); + screen.render(x * 16 + 8, y * 16, sprite.spritePixels[0][1]); } if (d && dl && l) { - screen.render(x * 16 + 0, y * 16 + 8, spriteFull.spritePixels[1][1]); + screen.render(x * 16, y * 16 + 8, spriteFull.spritePixels[1][1]); } else { - screen.render(x * 16 + 0, y * 16 + 8, sprite.spritePixels[1][0]); + screen.render(x * 16, y * 16 + 8, sprite.spritePixels[1][0]); } if (d && dr && r) { diff --git a/src/main/resources/assets/textures/tile/ash.png b/src/main/resources/assets/textures/tile/ash.png new file mode 100644 index 0000000000000000000000000000000000000000..526e17335af51c160db6cfb89d232a54adb5de04 GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+7i*h5IX=;<7q;$`&%qWTh3g^i6Ob1eIB|(0{|3QFZ^Zq6Kfg+p* z9+AZi419+`m{C;2s{tq&;OXKRq7j_i&&YQ`frEMVf&csW1YOv9^q9#VS7AqugsPxK zgQc5VBpWNv<*JBHx6oU%v)kPKW1>`-v*545`7E{KY!z#j1r3VdZ~UeI?Ux|G$|@#T U+n|%BK(iSNS%G|>0G|+7i*h5IX=;<7qyPmTZ);r%Qdbh>7ySSKe+CDwm0y5-&H|6fVg?4j z!ywFfJbwj9t(&KdV~9p@YfrQgg8NS%G}f0G|-oltiwED$x@sQqG(?qphX1Y2_-Q%meQPBOt|I666>B9}F0zyqVpA zLYxI2k;M!Qe1|}oQB=dL0Vo*k>Ealo5uDr4&2_+l!+GbP0l+XkK2sKck literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/aspen_full.png b/src/main/resources/assets/textures/tile/aspen_full.png new file mode 100644 index 0000000000000000000000000000000000000000..81ac0cb25da0c4bf40a75825516ab4316e159728 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|-oltiwED$x@sQh)+!H8(6l>PmwAg8%>j&)}f7@(Ym9S>O>_%)r2R z7=#&*=dS>%b@Oy_4ABT~?THp*5a2n|_4|ILbo9}F*?wQQnUU5^)0#9M+}!+aUK5LV zLd6F`li2MM3xa2J)Evz>;!$@t+NS%G}f0G|+79dBj*bcK}NA!p8<(biJhv~m?tM%Jsk3P`b+1o;L32LlEvZ)P{3 z5NCl$WHAE+-yslY6xHx*01AeBx;Tbt1n2g1b2%t-ux$Tx=l_Y9uc}42v{*Pd9g=j} zm3**c$|(UDO=*u{uTvq^%7r^hQn)S-0-kD~}14`%~U3X4%g wTEiKp*^FkV9R!XDq$CzJ7(^^QCjc~x=^lH_2W!zaKtmZkUHx3vIVCg!0O^uB0RR91 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/fir.png b/src/main/resources/assets/textures/tile/fir.png new file mode 100644 index 0000000000000000000000000000000000000000..db594a5367ad5dfe39df690e69ac2400b1358a36 GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+71~mo-ePLl&0Rv?QWf7n#gRffAJRrqZ666>B9|RaS?_aVXD8gCb z5n0T@z;_6Q8AUa`8i0ZUo-U3d8o{~!j9do{IG8uD`v3n^(w12EHl=%kj)Gh>-i3TH zSh|VBnCWBGagQ9m!degGZvDwW40(?(<*>b?@A&!+jGUPZ|o3PZecQI TdBwC1Xf}hVtDnm{r-UW|IA}zk literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/fir_full.png b/src/main/resources/assets/textures/tile/fir_full.png new file mode 100644 index 0000000000000000000000000000000000000000..fb1ce243a203c4fc965e8be0e0f767ff09d1e04e GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFJkhEjsQTZPS qZfYf}EOFMeeltsCL(GkQ0dB@4?8P04*D`?SF?hQAxvXNS%G|^0G|+7F(*xCxII_w`o<1%yNS%G|^0G|+7UVDAv2n*NAiFTSo`ttlhVde!kEJkhEjsQTZPS qZfYf}EOFMeeltsCL(GkQ0dB@4?8P04*D`?SF?hQAxvX+QMzHx zO|=_rYu=x@r5s_~k;Bo(*kaP`bHt!Q>%Tm$zaLgn01it0F&SpiwUvKISN+N%fwtB`<$8_bXMY1+I*(yS$Qju7<~R= zyTgCOGM5=TCqxy_8WemzC2b*{!f|g8!)HEMwgWr|#XjBGWWvy((tF(O;cHKzXBa$P L{an^LB{Ts57t~)g diff --git a/src/main/resources/assets/textures/tile/tree_full.png b/src/main/resources/assets/textures/tile/tree_full.png deleted file mode 100644 index 8dad3ec38f104dff232eed183b1078336a52def8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|)_A%&hFJI~ zi(D7}fBwLM0}5|7c^7rC`ER#pU7c#8WzHncAgqugu*+%(qrqxNt^&y>U%tZ(GqNx6 zI$p~W&SBp6{=_Y14t<4cxo19K7#JnH)<~-ITo7F>%~X8xfONyVpf!yhGHVTZcONS%G|^0G|+76MsdEIEBPHPDVxo_7)%mIz+qI04cVTAiv=MAi%JB|C0Sc5zYdS z$YKTtzC$3)D5~Mr02B=Jba4#P2+r+icY#tut zqdhgyaK`nj-lK6%Ltg-BrzZ{U$wSf1m%)#OjCl!AinG8YvY3H^?=T269?xHq0u*%d zba4!kxSZN|kdr}yhdH=_;W3+4<8S|TVL?If%y)u)OkYxF$vB2B%-f>JkhEjsQTZPS qZfYf}EOFMeeltsCL(GkQ0dB@4?8P04*D`?SF?hQAxvX Date: Sun, 12 Feb 2023 15:59:30 +0800 Subject: [PATCH 002/261] Added more plants --- build.gradle | 2 +- src/main/java/minicraft/core/Game.java | 2 +- src/main/java/minicraft/item/Items.java | 2 +- .../java/minicraft/item/StackableItem.java | 1 + src/main/java/minicraft/item/TileItem.java | 121 ++++++++------ src/main/java/minicraft/item/TorchItem.java | 2 +- src/main/java/minicraft/level/Level.java | 4 +- src/main/java/minicraft/level/tile/Tiles.java | 18 +- .../level/tile/farming/BeetrootTile.java | 28 ++++ .../level/tile/farming/CarrotTile.java | 32 ++++ .../level/tile/farming/FarmTile.java | 93 ++++++----- .../level/tile/farming/PlantTile.java | 156 +++++++++++------- .../level/tile/farming/PotatoTile.java | 44 ++--- .../level/tile/farming/WheatTile.java | 17 +- src/main/java/minicraft/saveload/Load.java | 2 + .../assets/textures/item/beetroot.png | Bin 0 -> 231 bytes .../resources/assets/textures/item/carrot.png | Bin 0 -> 233 bytes .../assets/textures/tile/beetroot_stage0.png | Bin 0 -> 150 bytes .../assets/textures/tile/beetroot_stage1.png | Bin 0 -> 184 bytes .../assets/textures/tile/beetroot_stage2.png | Bin 0 -> 187 bytes .../assets/textures/tile/beetroot_stage3.png | Bin 0 -> 223 bytes .../assets/textures/tile/carrot_stage0.png | Bin 0 -> 192 bytes .../assets/textures/tile/carrot_stage1.png | Bin 0 -> 175 bytes .../assets/textures/tile/carrot_stage2.png | Bin 0 -> 188 bytes .../assets/textures/tile/carrot_stage3.png | Bin 0 -> 215 bytes .../assets/textures/tile/farmland_moist.png | Bin 0 -> 207 bytes 26 files changed, 323 insertions(+), 201 deletions(-) create mode 100644 src/main/java/minicraft/level/tile/farming/BeetrootTile.java create mode 100644 src/main/java/minicraft/level/tile/farming/CarrotTile.java create mode 100644 src/main/resources/assets/textures/item/beetroot.png create mode 100644 src/main/resources/assets/textures/item/carrot.png create mode 100644 src/main/resources/assets/textures/tile/beetroot_stage0.png create mode 100644 src/main/resources/assets/textures/tile/beetroot_stage1.png create mode 100644 src/main/resources/assets/textures/tile/beetroot_stage2.png create mode 100644 src/main/resources/assets/textures/tile/beetroot_stage3.png create mode 100644 src/main/resources/assets/textures/tile/carrot_stage0.png create mode 100644 src/main/resources/assets/textures/tile/carrot_stage1.png create mode 100644 src/main/resources/assets/textures/tile/carrot_stage2.png create mode 100644 src/main/resources/assets/textures/tile/carrot_stage3.png create mode 100644 src/main/resources/assets/textures/tile/farmland_moist.png diff --git a/build.gradle b/build.gradle index 0dcf8387e..87b630cb7 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { } -project.version = '2.2.0-dev2' +project.version = '2.2.0-dev3' group = "java.minicraft" archivesBaseName = "minicraft-plus" diff --git a/src/main/java/minicraft/core/Game.java b/src/main/java/minicraft/core/Game.java index 78a11d426..7dcdcdf62 100644 --- a/src/main/java/minicraft/core/Game.java +++ b/src/main/java/minicraft/core/Game.java @@ -22,7 +22,7 @@ protected Game() {} // Can't instantiate the Game class. public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev2"); + public static final Version VERSION = new Version("2.2.0-dev3"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; diff --git a/src/main/java/minicraft/item/Items.java b/src/main/java/minicraft/item/Items.java index a31c93ac9..079e9576b 100644 --- a/src/main/java/minicraft/item/Items.java +++ b/src/main/java/minicraft/item/Items.java @@ -19,7 +19,7 @@ This class is meant to define all the different kinds of items in minicraft. Ite If you want to access one of those items, you do it through this class, by calling get("item name"); casing does not matter. */ - private static ArrayList items = new ArrayList<>(); + private static final ArrayList items = new ArrayList<>(); private static void add(Item i) { items.add(i); diff --git a/src/main/java/minicraft/item/StackableItem.java b/src/main/java/minicraft/item/StackableItem.java index 1ef64ecc2..6e5abb0cf 100644 --- a/src/main/java/minicraft/item/StackableItem.java +++ b/src/main/java/minicraft/item/StackableItem.java @@ -36,6 +36,7 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Shard", new LinkedSprite(SpriteType.Item, "shard"))); items.add(new StackableItem("Cloud Ore", new LinkedSprite(SpriteType.Item, "cloud_ore"))); items.add(new StackableItem("Glass Bottle", new LinkedSprite(SpriteType.Item, "glass_bottle"))); + items.add(new StackableItem("Beetroot", new LinkedSprite(SpriteType.Item, "beetroot"))); return items; } diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index cbe6a29cc..88e6203c1 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -23,76 +23,95 @@ protected static ArrayList getAllInstances() { ArrayList items = new ArrayList<>(); /// TileItem sprites all have 1x1 sprites. - items.add(new TileItem("Flower", new LinkedSprite(SpriteType.Item, "white_flower"), "flower", "grass")); - items.add(new TileItem("Acorn", new LinkedSprite(SpriteType.Item, "acorn"), "tree Sapling", "grass")); - items.add(new TileItem("Dirt", new LinkedSprite(SpriteType.Item, "dirt"), "dirt", "hole", "water", "lava")); - items.add(new TileItem("Natural Rock", new LinkedSprite(SpriteType.Item, "stone"), "rock", "hole", "dirt", "sand", "grass", "path", "water", "lava")); - - items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), "Wood Planks", "hole", "water", "cloud")); - items.add(new TileItem("Plank Wall", new LinkedSprite(SpriteType.Item, "plank_wall"), "Wood Wall", "Wood Planks")); - items.add(new TileItem("Wood Door", new LinkedSprite(SpriteType.Item, "wood_door"), "Wood Door", "Wood Planks")); - items.add(new TileItem("Stone", new LinkedSprite(SpriteType.Item, "stone"), "Stone", "hole", "water", "cloud", "lava")); - items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), "Stone Bricks", "hole", "water", "cloud", "lava")); - items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), "Ornate Stone", "hole", "water", "cloud", "lava")); - items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), "Stone Wall", "Stone Bricks")); - items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), "Stone Door", "Stone Bricks")); - items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), "Raw Obsidian", "hole", "water", "cloud", "lava")); - items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), "Obsidian", "hole", "water", "cloud", "lava")); - items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), "Ornate Obsidian","hole", "water", "cloud", "lava")); - items.add(new TileItem("Obsidian Wall", new LinkedSprite(SpriteType.Item, "obsidian_wall"), "Obsidian Wall", "Obsidian")); - items.add(new TileItem("Obsidian Door", new LinkedSprite(SpriteType.Item, "obsidian_door"), "Obsidian Door", "Obsidian")); - - items.add(new TileItem("Wool", new LinkedSprite(SpriteType.Item, "wool"), "Wool", "hole", "water")); - items.add(new TileItem("Red Wool", new LinkedSprite(SpriteType.Item, "red_wool"), "Red Wool", "hole", "water")); - items.add(new TileItem("Blue Wool", new LinkedSprite(SpriteType.Item, "blue_wool"), "Blue Wool", "hole", "water")); - items.add(new TileItem("Green Wool", new LinkedSprite(SpriteType.Item, "green_wool"), "Green Wool", "hole", "water")); - items.add(new TileItem("Yellow Wool", new LinkedSprite(SpriteType.Item, "yellow_wool"), "Yellow Wool", "hole", "water")); - items.add(new TileItem("Black Wool", new LinkedSprite(SpriteType.Item, "black_wool"), "Black Wool", "hole", "water")); - - items.add(new TileItem("Sand", new LinkedSprite(SpriteType.Item, "sand"), "sand", "hole", "water", "lava")); - items.add(new TileItem("Cactus", new LinkedSprite(SpriteType.Item, "cactus"), "cactus Sapling", "sand")); - items.add(new TileItem("Bone", new LinkedSprite(SpriteType.Item, "bone"), "tree", "tree Sapling")); - items.add(new TileItem("Cloud", new LinkedSprite(SpriteType.Item, "cloud"), "cloud", "Infinite Fall")); - - items.add(new TileItem("Wheat Seeds", new LinkedSprite(SpriteType.Item, "seed"), "wheat", "farmland")); - items.add(new TileItem("Potato", new LinkedSprite(SpriteType.Item, "potato"), "potato", "farmland")); - items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), "grass", "dirt")); + items.add(new TileItem("Flower", new LinkedSprite(SpriteType.Item, "white_flower"), new TileModel("flower"), "grass")); + items.add(new TileItem("Acorn", new LinkedSprite(SpriteType.Item, "acorn"), new TileModel("tree Sapling"), "grass")); + items.add(new TileItem("Dirt", new LinkedSprite(SpriteType.Item, "dirt"), new TileModel("dirt"), "hole", "water", "lava")); + items.add(new TileItem("Natural Rock", new LinkedSprite(SpriteType.Item, "stone"), new TileModel("rock"), "hole", "dirt", "sand", "grass", "path", "water", "lava")); + + items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), new TileModel("Wood Planks"), "hole", "water", "cloud")); + items.add(new TileItem("Plank Wall", new LinkedSprite(SpriteType.Item, "plank_wall"), new TileModel("Wood Wall"), "Wood Planks")); + items.add(new TileItem("Wood Door", new LinkedSprite(SpriteType.Item, "wood_door"), new TileModel("Wood Door"), "Wood Planks")); + items.add(new TileItem("Stone", new LinkedSprite(SpriteType.Item, "stone"), new TileModel("Stone"), "hole", "water", "cloud", "lava")); + items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Stone Bricks"), "hole", "water", "cloud", "lava")); + items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Ornate Stone"), "hole", "water", "cloud", "lava")); + items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Wall"), "Stone Bricks")); + items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Door"), "Stone Bricks")); + items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), new TileModel("Raw Obsidian"), "hole", "water", "cloud", "lava")); + items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Obsidian"), "hole", "water", "cloud", "lava")); + items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Ornate Obsidian"),"hole", "water", "cloud", "lava")); + items.add(new TileItem("Obsidian Wall", new LinkedSprite(SpriteType.Item, "obsidian_wall"), new TileModel("Obsidian Wall"), "Obsidian")); + items.add(new TileItem("Obsidian Door", new LinkedSprite(SpriteType.Item, "obsidian_door"), new TileModel("Obsidian Door"), "Obsidian")); + + items.add(new TileItem("Wool", new LinkedSprite(SpriteType.Item, "wool"), new TileModel("Wool"), "hole", "water")); + items.add(new TileItem("Red Wool", new LinkedSprite(SpriteType.Item, "red_wool"), new TileModel("Red Wool"), "hole", "water")); + items.add(new TileItem("Blue Wool", new LinkedSprite(SpriteType.Item, "blue_wool"), new TileModel("Blue Wool"), "hole", "water")); + items.add(new TileItem("Green Wool", new LinkedSprite(SpriteType.Item, "green_wool"), new TileModel("Green Wool"), "hole", "water")); + items.add(new TileItem("Yellow Wool", new LinkedSprite(SpriteType.Item, "yellow_wool"), new TileModel("Yellow Wool"), "hole", "water")); + items.add(new TileItem("Black Wool", new LinkedSprite(SpriteType.Item, "black_wool"), new TileModel("Black Wool"), "hole", "water")); + + items.add(new TileItem("Sand", new LinkedSprite(SpriteType.Item, "sand"), new TileModel("sand"), "hole", "water", "lava")); + items.add(new TileItem("Cactus", new LinkedSprite(SpriteType.Item, "cactus"), new TileModel("cactus Sapling"), "sand")); + items.add(new TileItem("Bone", new LinkedSprite(SpriteType.Item, "bone"), new TileModel("tree"), "tree Sapling")); + items.add(new TileItem("Cloud", new LinkedSprite(SpriteType.Item, "cloud"), new TileModel("cloud"), "Infinite Fall")); + + items.add(new TileItem("Wheat Seeds", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "seed"), new TileModel("wheat", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Potato", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "potato"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Carrot", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Beetroot Seeds", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "seed"), new TileModel("beetroot", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); // Creative mode available tiles: - items.add(new TileItem("Farmland", SpriteLinker.missingTexture(SpriteType.Item), "farmland", "dirt", "grass", "hole")); - items.add(new TileItem("Exploded", SpriteLinker.missingTexture(SpriteType.Item), "explode", "dirt", "grass")); - items.add(new TileItem("hole", SpriteLinker.missingTexture(SpriteType.Item), "hole", "dirt", "grass")); - items.add(new TileItem("lava", SpriteLinker.missingTexture(SpriteType.Item), "lava", "dirt", "grass", "hole")); - items.add(new TileItem("path", SpriteLinker.missingTexture(SpriteType.Item), "path", "dirt", "grass", "hole")); - items.add(new TileItem("water", SpriteLinker.missingTexture(SpriteType.Item), "water", "dirt", "grass", "hole")); + items.add(new TileItem("Farmland", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("farmland"), "dirt", "grass", "hole")); + items.add(new TileItem("hole", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("hole"), "dirt", "grass")); + items.add(new TileItem("lava", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("lava"), "dirt", "grass", "hole")); + items.add(new TileItem("path", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("path"), "dirt", "grass", "hole")); + items.add(new TileItem("water", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("water"), "dirt", "grass", "hole")); return items; } - public final String model; + public final TileModel model; public final List validTiles; - protected TileItem(String name, LinkedSprite sprite, String model, String... validTiles) { + protected TileItem(String name, LinkedSprite sprite, TileModel model, String... validTiles) { this(name, sprite, 1, model, Arrays.asList(validTiles)); } - protected TileItem(String name, LinkedSprite sprite, int count, String model, String... validTiles) { + protected TileItem(String name, LinkedSprite sprite, int count, TileModel model, String... validTiles) { this(name, sprite, count, model, Arrays.asList(validTiles)); } - protected TileItem(String name, LinkedSprite sprite, int count, String model, List validTiles) { + protected TileItem(String name, LinkedSprite sprite, int count, TileModel model, List validTiles) { super(name, sprite, count); - this.model = model.toUpperCase(); + this.model = model; this.validTiles = new ArrayList<>(); for (String tile: validTiles) this.validTiles.add(tile.toUpperCase()); } + public static class TileModel { + public static final TileDataGetter DEFAULT_DATA = ((model, target, level, xt, yt, player, attackDir) -> model.getDefaultData()); + public static final TileDataGetter KEEP_DATA = ((model, target, level, xt, yt, player, attackDir) -> level.getData(xt, yt)); + + public final String tile; + public final TileDataGetter data; + + @FunctionalInterface + interface TileDataGetter { + int getTileData(Tile model, Tile target, Level level, int xt, int yt, Player player, Direction attackDir); + } + + public TileModel(String tile) { this(tile, DEFAULT_DATA); } + public TileModel(String tile, TileDataGetter data) { + this.tile = tile.toUpperCase(); + this.data = data; + } + } + public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { for (String tilename : validTiles) { if (tile.matches(level.getData(xt, yt), tilename)) { - level.setTile(xt, yt, model); // TODO maybe data should be part of the saved tile..? - + Tile t = Tiles.get(model.tile); + level.setTile(xt, yt, t, model.data.getTileData(t, tile, level, xt, yt, player, attackDir)); Sound.play("craft"); - return super.interactOn(true); } } @@ -100,13 +119,13 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Logger.tag("TileItem").debug("{} cannot be placed on {}.", model, tile.name); String note = ""; - if (model.contains("WALL")) { + if (model.tile.contains("WALL")) { note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); } - else if (model.contains("DOOR")) { + else if (model.tile.contains("DOOR")) { note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); } - else if ((model.contains("BRICK") || model.contains("PLANK") || model.equals("STONE") || model.contains("ORNATE"))) { + else if ((model.tile.contains("BRICK") || model.tile.contains("PLANK") || model.tile.equals("STONE") || model.tile.contains("ORNATE"))) { note = Localization.getLocalized("minicraft.notification.dig_hole"); } diff --git a/src/main/java/minicraft/item/TorchItem.java b/src/main/java/minicraft/item/TorchItem.java index fc8f6b366..e9fac2b51 100644 --- a/src/main/java/minicraft/item/TorchItem.java +++ b/src/main/java/minicraft/item/TorchItem.java @@ -20,7 +20,7 @@ public static ArrayList getAllInstances() { private TorchItem() { this(1); } private TorchItem(int count) { - super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, "", "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); + super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, new TileModel(""), "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { diff --git a/src/main/java/minicraft/level/Level.java b/src/main/java/minicraft/level/Level.java index 60e4b7dd6..5beee74b5 100644 --- a/src/main/java/minicraft/level/Level.java +++ b/src/main/java/minicraft/level/Level.java @@ -463,7 +463,7 @@ public void renderLight(Screen screen, int xScroll, int yScroll, int brightness) int h = (Screen.h + 15) >> 4; screen.setOffset(xScroll, yScroll); - + // this specifies the maximum radius that the game will stop rendering the light from the source object once off screen int r = 8; @@ -766,7 +766,7 @@ public Point[] getAreaTilePositions(int x, int y, int rx, int ry) { for (int xp = x-rx; xp <= x+rx; xp++) if (xp >= 0 && xp < w && yp >= 0 && yp < h) local.add(new Point(xp, yp)); - return local.toArray(new Point[local.size()]); + return local.toArray(new Point[0]); } public Tile[] getAreaTiles(int x, int y, int r) { return getAreaTiles(x, y, r, r); } diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index 913a28bf2..993779576 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -4,6 +4,8 @@ import java.util.HashMap; import minicraft.core.CrashHandler; +import minicraft.level.tile.farming.BeetrootTile; +import minicraft.level.tile.farming.CarrotTile; import minicraft.level.tile.farming.FarmTile; import minicraft.level.tile.farming.PotatoTile; import minicraft.level.tile.farming.WheatTile; @@ -32,6 +34,14 @@ public static void initTileList() { tiles.put((short)7, new RockTile("Rock")); tiles.put((short)8, new TreeTile(TreeTile.TreeType.OAK)); + // These are out of order because of the multiple tree types. + tiles.put((short)47, new TreeTile(TreeTile.TreeType.SPRUCE)); + tiles.put((short)48, new TreeTile(TreeTile.TreeType.BIRCH)); + tiles.put((short)49, new TreeTile(TreeTile.TreeType.ASH)); + tiles.put((short)50, new TreeTile(TreeTile.TreeType.ASPEN)); + tiles.put((short)51, new TreeTile(TreeTile.TreeType.FIR)); + tiles.put((short)52, new TreeTile(TreeTile.TreeType.WILLOW)); + tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Oak"))); tiles.put((short)10, new SandTile("Sand")); tiles.put((short)11, new CactusTile("Cactus")); @@ -69,12 +79,8 @@ public static void initTileList() { tiles.put((short)44, new MaterialTile(Tile.Material.Obsidian)); tiles.put((short)45, new DecorTile(Tile.Material.Stone)); tiles.put((short)46, new DecorTile(Tile.Material.Obsidian)); - tiles.put((short)47, new TreeTile(TreeTile.TreeType.SPRUCE)); - tiles.put((short)48, new TreeTile(TreeTile.TreeType.BIRCH)); - tiles.put((short)49, new TreeTile(TreeTile.TreeType.ASH)); - tiles.put((short)50, new TreeTile(TreeTile.TreeType.ASPEN)); - tiles.put((short)51, new TreeTile(TreeTile.TreeType.FIR)); - tiles.put((short)52, new TreeTile(TreeTile.TreeType.WILLOW)); + tiles.put((short)53, new BeetrootTile("Beetroot")); + tiles.put((short)54, new CarrotTile("Carrot")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/main/java/minicraft/level/tile/farming/BeetrootTile.java b/src/main/java/minicraft/level/tile/farming/BeetrootTile.java new file mode 100644 index 000000000..7afb4f85d --- /dev/null +++ b/src/main/java/minicraft/level/tile/farming/BeetrootTile.java @@ -0,0 +1,28 @@ +package minicraft.level.tile.farming; + +import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker.LinkedSprite; +import minicraft.gfx.SpriteLinker.SpriteType; +import minicraft.level.Level; +import minicraft.level.tile.Tiles; + +public class BeetrootTile extends PlantTile { + private final LinkedSprite[] spritStages = new LinkedSprite[] { + new LinkedSprite(SpriteType.Tile, "beetroot_stage0"), + new LinkedSprite(SpriteType.Tile, "beetroot_stage1"), + new LinkedSprite(SpriteType.Tile, "beetroot_stage2"), + new LinkedSprite(SpriteType.Tile, "beetroot_stage3") + }; + + public BeetrootTile(String name) { + super(name, "beetroot seeds"); + maxStage = 3; + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + int age = (level.getData(x, y) >> 3) & maxStage; + Tiles.get("Farmland").render(screen, level, x, y); + screen.render(x * 16, y * 16, spritStages[age]); + } +} diff --git a/src/main/java/minicraft/level/tile/farming/CarrotTile.java b/src/main/java/minicraft/level/tile/farming/CarrotTile.java new file mode 100644 index 000000000..9f24fd04a --- /dev/null +++ b/src/main/java/minicraft/level/tile/farming/CarrotTile.java @@ -0,0 +1,32 @@ +package minicraft.level.tile.farming; + +import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker.LinkedSprite; +import minicraft.gfx.SpriteLinker.SpriteType; +import minicraft.level.Level; +import minicraft.level.tile.Tiles; + +public class CarrotTile extends PlantTile { + private final LinkedSprite[] spritStages = new LinkedSprite[] { + new LinkedSprite(SpriteType.Tile, "carrot_stage0"), + new LinkedSprite(SpriteType.Tile, "carrot_stage1"), + new LinkedSprite(SpriteType.Tile, "carrot_stage2"), + new LinkedSprite(SpriteType.Tile, "carrot_stage3") + }; + + public CarrotTile(String name) { + super(name, null); + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + int age = (level.getData(x, y) >> 3) & maxStage; + Tiles.get("Farmland").render(screen, level, x, y); + int stage; + if (age < 2) stage = 0; + else if (age < 4) stage = 1; + else if (age < 7) stage = 2; + else stage = 3; + screen.render(x * 16, y * 16, spritStages[stage]); + } +} diff --git a/src/main/java/minicraft/level/tile/farming/FarmTile.java b/src/main/java/minicraft/level/tile/farming/FarmTile.java index ed1952355..ff961dcad 100644 --- a/src/main/java/minicraft/level/tile/farming/FarmTile.java +++ b/src/main/java/minicraft/level/tile/farming/FarmTile.java @@ -5,6 +5,7 @@ import minicraft.entity.Entity; import minicraft.entity.ItemEntity; import minicraft.entity.mob.Player; +import minicraft.gfx.Screen; import minicraft.gfx.SpriteAnimation; import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.item.Item; @@ -13,44 +14,60 @@ import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; +import minicraft.level.tile.WaterTile; + +import java.util.Arrays; public class FarmTile extends Tile { - private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "farmland"); - - public FarmTile(String name) { - super(name, sprite); - } - protected FarmTile(String name, SpriteAnimation sprite) { - super(name, sprite); - } - - @Override - public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if (item instanceof ToolItem) { - ToolItem tool = (ToolItem) item; - if (tool.type == ToolType.Shovel) { - if (player.payStamina(4 - tool.level) && tool.payDurability()) { - level.setTile(xt, yt, Tiles.get("Dirt")); - Sound.play("monsterhurt"); - return true; - } - } - } - return false; - } - - @Override - public boolean tick(Level level, int xt, int yt) { - int age = level.getData(xt, yt); - if (age < 5) level.setData(xt, yt, age + 1); - return true; - } - - @Override - public void steppedOn(Level level, int xt, int yt, Entity entity) { - if (entity instanceof ItemEntity) return; - if (random.nextInt(60) != 0) return; - if (level.getData(xt, yt) < 5) return; - level.setTile(xt, yt, Tiles.get("Dirt")); - } + private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "farmland"); + private static final SpriteAnimation spriteMoist = new SpriteAnimation(SpriteType.Tile, "farmland_moist"); + + public FarmTile(String name) { + super(name, sprite); + } + protected FarmTile(String name, SpriteAnimation sprite) { + super(name, sprite); + } + + @Override + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + if (item instanceof ToolItem) { + ToolItem tool = (ToolItem) item; + if (tool.type == ToolType.Shovel) { + if (player.payStamina(4 - tool.level) && tool.payDurability()) { + level.setTile(xt, yt, Tiles.get("Dirt")); + Sound.play("monsterhurt"); + return true; + } + } + } + return false; + } + + @Override + public boolean tick(Level level, int xt, int yt) { + int moisture = level.getData(xt, yt) & 0b111; + if (Arrays.stream(level.getAreaTiles(xt, yt, 4)).anyMatch(t -> t instanceof WaterTile)) { // Contains water. + if (moisture < 7 && random.nextInt(10) == 0) { // hydrating + level.setData(xt, yt, moisture + 1); + return true; + } + } else if (moisture > 0 && random.nextInt(10) == 0) { // drying + level.setData(xt, yt, moisture - 1); + return true; + } else if (moisture == 0 && random.nextInt(10) == 0) { + level.setTile(xt, yt, Tiles.get("dirt")); + return true; + } + + return false; + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + if ((level.getData(x, y) & 0b111) > 0) + spriteMoist.render(screen, level, x, y); + else + sprite.render(screen, level, x, y); + } } diff --git a/src/main/java/minicraft/level/tile/farming/PlantTile.java b/src/main/java/minicraft/level/tile/farming/PlantTile.java index c8c5f498e..496a749fa 100644 --- a/src/main/java/minicraft/level/tile/farming/PlantTile.java +++ b/src/main/java/minicraft/level/tile/farming/PlantTile.java @@ -9,71 +9,105 @@ import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; +import minicraft.level.tile.WaterTile; +import org.jetbrains.annotations.Nullable; + +import java.util.Arrays; public class PlantTile extends FarmTile { - protected static int maxAge = 100; - - protected PlantTile(String name) { - super(name, null); - } - - @Override - public void steppedOn(Level level, int xt, int yt, Entity entity) { - super.steppedOn(level, xt, yt, entity); - harvest(level, xt, yt, entity); - } - - @Override - public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { - harvest(level, x, y, source); - return true; - } - - @Override - public boolean tick(Level level, int xt, int yt) { - if (random.nextInt(2) == 0) return false; - - int age = level.getData(xt, yt); - if (age < maxAge) { - if (!IfWater(level, xt, yt)) level.setData(xt, yt, age + 1); - else if (IfWater(level, xt, yt)) level.setData(xt, yt, age + 2); - return true; - } - - return false; - } - - protected boolean IfWater(Level level, int xs, int ys) { - Tile[] areaTiles = level.getAreaTiles(xs, ys, 1); - for(Tile t: areaTiles) - if(t == Tiles.get("Water")) - return true; - - return false; - } - - /** Default harvest method, used for everything that doesn't really need any special behavior. */ - protected void harvest(Level level, int x, int y, Entity entity) { - int age = level.getData(x, y); - - level.dropItem(x * 16 + 8, y * 16 + 8, 1, Items.get(name + " Seeds")); - - int count = 0; - if (age >= maxAge) { - count = random.nextInt(3) + 2; - } else if (age >= maxAge - maxAge / 5) { - count = random.nextInt(2) + 1; - } - - level.dropItem(x * 16 + 8, y * 16 + 8, count, Items.get(name)); - - if (age >= maxAge && entity instanceof Player) { - ((Player)entity).addScore(random.nextInt(5) + 1); - } + protected final @Nullable String seed; + + protected int maxStage = 7; // Must be a bit mask. + + protected PlantTile(String name, @Nullable String seed) { + super(name, null); + this.seed = seed; + } + + @Override + public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { + harvest(level, x, y, source); + return true; + } + + @Override + public boolean tick(Level level, int xt, int yt) { + int data = level.getData(xt, yt); + int moisture = data & 0b111; + boolean successful = false; + if (Arrays.stream(level.getAreaTiles(xt, yt, 4)).anyMatch(t -> t instanceof WaterTile)) { // Contains water. + if (moisture < 7 && random.nextInt(10) == 0) { // hydrating + level.setData(xt, yt, data = (data & ~3) + moisture++); + successful = true; + } + } else if (moisture > 0 && random.nextInt(10) == 0) { // drying + level.setData(xt, yt, data = (data & ~3) + moisture--); + successful = true; + } + + int stage = (data >> 3) & maxStage; + if (stage < maxStage) { + double points = moisture > 0 ? 4 : 2; + for (int i = -1; i < 2; i++) + for (int j = -1; j < 2; j++) { + Tile t = level.getTile(xt + i, yt + j); + if ((i != 0 || j != 0) && t instanceof FarmTile) { + points += (level.getData(xt + i, yt + j) & 0b111) > 0 ? 0.75 : 0.25; + } + } + + boolean u = level.getTile(xt, yt - 1) == this; + boolean d = level.getTile(xt, yt + 1) == this; + boolean l = level.getTile(xt - 1, yt) == this; + boolean r = level.getTile(xt + 1, yt) == this; + boolean ul = level.getTile(xt - 1, yt - 1) == this; + boolean dl = level.getTile(xt - 1, yt + 1) == this; + boolean ur = level.getTile(xt + 1, yt - 1) == this; + boolean dr = level.getTile(xt + 1, yt + 1) == this; + if (u && d && l && r && ul && dl && ur && dr) + points /= 2; + else { + if (u && d && l && r) + points *= 0.75; + if (u && (d && (l || r) || l && r) || d && l && r) // Either 3 of 4 directions. + points *= 0.85; + if (ul && (dr || dl || ur) || dl && (ur || dr) || ur && dr) // Either 2 of 4 directions. + points *= 0.9; + if (ul) points *= 0.98125; + if (dl) points *= 0.98125; + if (ur) points *= 0.98125; + if (dr) points *= 0.98125; + } + + if (random.nextInt((int) (100/points) + 1) == 0) + level.setData(xt, yt, (data & ~(maxStage << 3)) + ((stage + 1) << 3)); // Incrementing the stage by 1. + return true; + } + + return successful; + } + + /** Default harvest method, used for everything that doesn't really need any special behavior. */ + protected void harvest(Level level, int x, int y, Entity entity) { + int data = level.getData(x, y); + int age = (data >> 3) & maxStage; + + if (seed != null) + level.dropItem(x * 16 + 8, y * 16 + 8, 1, Items.get(seed)); + + if (age == maxStage) { + level.dropItem(x * 16 + 8, y * 16 + 8, random.nextInt(3) + 2, Items.get(name)); + } else if (seed == null) { + level.dropItem(x * 16 + 8, y * 16 + 8, 1, Items.get(name)); + } + + if (age == maxStage && entity instanceof Player) { + ((Player)entity).addScore(random.nextInt(5) + 1); + } // Play sound. Sound.play("monsterhurt"); - level.setTile(x, y, Tiles.get("Dirt")); - } + level.setTile(x, y, Tiles.get("farmland"), data & 0b111); + } } diff --git a/src/main/java/minicraft/level/tile/farming/PotatoTile.java b/src/main/java/minicraft/level/tile/farming/PotatoTile.java index a4c96fd49..0c673d19a 100644 --- a/src/main/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/main/java/minicraft/level/tile/farming/PotatoTile.java @@ -11,7 +11,7 @@ import minicraft.level.tile.Tiles; public class PotatoTile extends PlantTile { - private LinkedSprite[] spritStages = new LinkedSprite[] { + private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "potato_stage0"), new LinkedSprite(SpriteType.Tile, "potato_stage1"), new LinkedSprite(SpriteType.Tile, "potato_stage2"), @@ -21,42 +21,20 @@ public class PotatoTile extends PlantTile { }; public PotatoTile(String name) { - super(name); - } - - static { - maxAge = 70; + super(name, null); } @Override public void render(Screen screen, Level level, int x, int y) { - int age = level.getData(x, y); - int icon = age / (maxAge / 5); - + int age = (level.getData(x, y) >> 3) & maxStage; Tiles.get("Farmland").render(screen, level, x, y); - screen.render(x * 16, y * 16, spritStages[icon]); - } - - @Override - protected void harvest(Level level, int x, int y, Entity entity) { - int age = level.getData(x, y); - - int count = 0; - if (age >= maxAge) { - count = random.nextInt(3) + 2; - } else if (age >= maxAge - maxAge / 5) { - count = random.nextInt(2); - } - - level.dropItem(x * 16 + 8, y * 16 + 8, count + 1, Items.get("Potato")); - - if (age >= maxAge && entity instanceof Player) { - ((Player)entity).addScore(random.nextInt(4) + 1); - } - - // Play sound. - Sound.play("monsterhurt"); - - level.setTile(x, y, Tiles.get("Dirt")); + int stage; + if (age < 1) stage = 0; + else if (age < 3) stage = 1; + else if (age < 4) stage = 2; + else if (age < 5) stage = 3; + else if (age < 7) stage = 4; + else stage = 5; + screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/main/java/minicraft/level/tile/farming/WheatTile.java b/src/main/java/minicraft/level/tile/farming/WheatTile.java index f5f3c6cfb..88e6d220d 100644 --- a/src/main/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/main/java/minicraft/level/tile/farming/WheatTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class WheatTile extends PlantTile { - private LinkedSprite[] spritStages = new LinkedSprite[] { + private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "wheat_stage0"), new LinkedSprite(SpriteType.Tile, "wheat_stage1"), new LinkedSprite(SpriteType.Tile, "wheat_stage2"), @@ -17,15 +17,20 @@ public class WheatTile extends PlantTile { }; public WheatTile(String name) { - super(name); + super(name, "wheat seeds"); } @Override public void render(Screen screen, Level level, int x, int y) { - int age = level.getData(x, y); - int icon = age / (maxAge / 5); - + int age = (level.getData(x, y) >> 3) & maxStage; Tiles.get("Farmland").render(screen, level, x, y); - screen.render(x * 16, y * 16, spritStages[icon]); + int stage; + if (age < 1) stage = 0; + else if (age < 3) stage = 1; + else if (age < 4) stage = 2; + else if (age < 5) stage = 3; + else if (age < 7) stage = 4; + else stage = 5; + screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/main/java/minicraft/saveload/Load.java b/src/main/java/minicraft/saveload/Load.java index c5716d966..5428bca97 100644 --- a/src/main/java/minicraft/saveload/Load.java +++ b/src/main/java/minicraft/saveload/Load.java @@ -490,6 +490,8 @@ private void loadWorld(String filename) { } } } + } else if (tilename.equalsIgnoreCase("Tree")) { + tilename = "Oak"; } tiles[tileArrIdx] = Tiles.get(tilename).id; diff --git a/src/main/resources/assets/textures/item/beetroot.png b/src/main/resources/assets/textures/item/beetroot.png new file mode 100644 index 0000000000000000000000000000000000000000..b84c4241a6a6d7b7f095136732c44c575e940554 GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`1E1o(uwPSDXW5aXJtt5Yb-9W5)iRL$_-*6rIp{FbTdPSnwxpsNE^XubT( z8X(0}666>B9|0JI?w>mc6z44Ph%9Dc;5!V$jK}j=qyPm?JY5_^B*IlsGjcH~a4|nr&iLo;{+r1_{S2P2 KelF{r5}E*(<4vRh literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/item/carrot.png b/src/main/resources/assets/textures/item/carrot.png new file mode 100644 index 0000000000000000000000000000000000000000..a23486c18019b3af0a37dc566cb15f69ee7e096f GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`1E2l#}z8t*rdn>HH5VlRQeff_<1MIIDa6Rk a%#gJ$^5%@G={`V%89ZJ6T-G@yGywo56*YYT literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/beetroot_stage2.png b/src/main/resources/assets/textures/tile/beetroot_stage2.png new file mode 100644 index 0000000000000000000000000000000000000000..54b5cdc14f3ca1928619c7702fe6ae8cb5d3df84 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!2nMe#}EtuZ7d|-1J?Uw?mIHreNrQi#i7Zcz dRYC#-1G9aSr~TVU+ks{?c)I$ztaD0e0sx((Ip_cY literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/beetroot_stage3.png b/src/main/resources/assets/textures/tile/beetroot_stage3.png new file mode 100644 index 0000000000000000000000000000000000000000..3040b6f4a6d0d527b43055ff9c8b7a339095b2ef GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+7j}0Cg8R|KT%o7wOHYuqAg|)6clLk_3B|(0{|3QFZ^Zq6Kfg+p* z9+AZi419+{nDKc2iWH!ri>HfYh(_?yzDC{y1{{Z(l>hIyDY&_XzfHhx;|i_av#q9x z?v_0@u`%XUrD~C8_|+5bcectnG)-f1Zp#1oZnshWkM>&TSF4$Kdb#i^0?lLaboFyt I=akR{0Lw#13IG5A literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/carrot_stage0.png b/src/main/resources/assets/textures/tile/carrot_stage0.png new file mode 100644 index 0000000000000000000000000000000000000000..edace2a7b15fd859590361fb73130c4797127ed9 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enFx1n&jl8xKCppGx^)`+z(BFoR;H z!GbPD1%}`bZ^5|Al;{nNdp?O|y0M3t_SiAp^h|MA4CP^DoZ%GH_2HEA?Izv_Q literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/carrot_stage1.png b/src/main/resources/assets/textures/tile/carrot_stage1.png new file mode 100644 index 0000000000000000000000000000000000000000..19d4ab29907ea898dbf310c1af04bf7c8b357c5f GIT binary patch literal 175 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en(8bfmF~q_@S;FQ(a`W-}921@glhRoP4I0*D zx*y;Zu@pF<#vk6I!^wQ2O<lKC#0dC6^8K&EKnJ8pS`LZ8jVq;?{`)TzvR44f) P&^!iDS3j3^P6a?`fb$_A`CQ~!PC{xWt~$(69AJ!H%0&e literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/carrot_stage3.png b/src/main/resources/assets/textures/tile/carrot_stage3.png new file mode 100644 index 0000000000000000000000000000000000000000..68b50001cdaecb881d0343b6cd5a6b0b7fe70041 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G~10G|+7j}0E%(}m|p30`iH28uN$c%K4NtR+Ey!T*7P;rBK^kU^XU9+AZi z419+`m{C;2s{ttJ;OXKRq7l5+?`HZ|M&0YxV Date: Sun, 12 Feb 2023 18:46:25 +0800 Subject: [PATCH 003/261] Added grasses --- src/main/java/minicraft/level/LevelGen.java | 79 ++++++++++++------ .../java/minicraft/level/tile/FlowerTile.java | 2 +- .../java/minicraft/level/tile/GrassTile.java | 7 +- .../minicraft/level/tile/TallGrassTile.java | 62 ++++++++++++++ src/main/java/minicraft/level/tile/Tiles.java | 4 + .../java/minicraft/level/tile/TreeTile.java | 8 +- .../textures/tile/double_tall_grass.png | Bin 0 -> 244 bytes .../resources/assets/textures/tile/fern.png | Bin 0 -> 234 bytes .../assets/textures/tile/large_fern.png | Bin 0 -> 248 bytes .../assets/textures/tile/tall_grass.png | Bin 0 -> 231 bytes 10 files changed, 127 insertions(+), 35 deletions(-) create mode 100644 src/main/java/minicraft/level/tile/TallGrassTile.java create mode 100644 src/main/resources/assets/textures/tile/double_tall_grass.png create mode 100644 src/main/resources/assets/textures/tile/fern.png create mode 100644 src/main/resources/assets/textures/tile/large_fern.png create mode 100644 src/main/resources/assets/textures/tile/tall_grass.png diff --git a/src/main/java/minicraft/level/LevelGen.java b/src/main/java/minicraft/level/LevelGen.java index 39a8887b0..f03c3d102 100644 --- a/src/main/java/minicraft/level/LevelGen.java +++ b/src/main/java/minicraft/level/LevelGen.java @@ -1,22 +1,22 @@ package minicraft.level; -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Random; -import java.util.function.Supplier; - -import javax.swing.ImageIcon; -import javax.swing.JOptionPane; - +import minicraft.core.Game; +import minicraft.core.io.Settings; +import minicraft.level.tile.TallGrassTile; +import minicraft.level.tile.Tiles; import minicraft.level.tile.TreeTile; import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; -import minicraft.core.Game; -import minicraft.core.io.Settings; -import minicraft.level.tile.Tiles; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; + +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.function.BiFunction; public class LevelGen { private static long worldSeed = 0; @@ -358,8 +358,30 @@ private static short[][] createTopMap(int w, int h) { // Create surface map } } - ArrayList treeIDs = new ArrayList<>(TreeTile.treeIDs); - Supplier treeRandom = () -> treeIDs.get(random.nextInt(treeIDs.size())); + BiFunction treeRandom; + { + List treeIDs = TreeTile.treeIDs; + treeRandom = (x, y) -> { + int i = x + y * w; + double val = Math.abs(noise1.values[i] - noise2.values[i]) * 3 - 2; + // This calculates a sort of distance based on the current coordinate. + double xd = x / (w - 1.0) * 2 - 1; + double yd = y / (h - 1.0) * 2 - 1; + if (xd < 0) xd = -xd; + if (yd < 0) yd = -yd; + double dist = Math.max(xd, yd); + dist = dist * dist * dist * dist; + dist = dist * dist * dist * dist; + val += 1 - dist*20; + val += 1.5; // Assuming the range of value is from 0 to 2. + val *= treeIDs.size() / 2.0; + val += 1; // Incrementing index. + val = 1.0/(3 * treeIDs.size()) * Math.pow(val - 5, 2); // Quadratically bloating the value. + int idx = (int) Math.round(val - 1); // Decrementing index. + if (idx >= treeIDs.size() || idx < 0) return (short) 8; // Oak + return treeIDs.get(idx); + }; + } if (Settings.get("Theme").equals("minicraft.settings.theme.forest")) { for (int i = 0; i < w * h / 200; i++) { @@ -370,7 +392,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.get(); + map[xx + yy * w] = treeRandom.apply(xx, yy); } } } @@ -385,7 +407,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.get(); + map[xx + yy * w] = treeRandom.apply(xx, yy); } } } @@ -401,7 +423,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.get(); + map[xx + yy * w] = treeRandom.apply(xx, yy); } } } @@ -416,13 +438,25 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.get(); + map[xx + yy * w] = treeRandom.apply(xx, yy); } } } } } + for (int x = 0; x < w; x++) { + for (int y = 0; y < h; y++) { + int xx = x + random.nextInt(3) - random.nextInt(3); + int yy = y + random.nextInt(3) - random.nextInt(3); + if (xx >= 0 && yy >= 0 && xx < w && yy < h && random.nextInt(5) < 3) { + if (map[xx + yy * w] == Tiles.get("grass").id) { + map[xx + yy * w] = TallGrassTile.grassIDs.get(random.nextInt(TallGrassTile.grassIDs.size())); + } + } + } + } + for (int i = 0; i < w * h / 400; i++) { int x = random.nextInt(w); int y = random.nextInt(h); @@ -788,7 +822,7 @@ public static void main(String[] args) { if (map[i] == Tiles.get("dirt").id) pixels[i] = 0x604040; if (map[i] == Tiles.get("sand").id) pixels[i] = 0xa0a040; if (map[i] == Tiles.get("Stone Bricks").id) pixels[i] = 0xa0a040; - if (map[i] == Tiles.get("tree").id) pixels[i] = 0x003000; + if (TreeTile.treeIDs.stream().anyMatch(id -> map[i] == id)) pixels[i] = 0x003000; if (map[i] == Tiles.get("Obsidian Wall").id) pixels[i] = 0x0aa0a0; if (map[i] == Tiles.get("Obsidian").id) pixels[i] = 0x000000; if (map[i] == Tiles.get("lava").id) pixels[i] = 0xffff2020; @@ -800,10 +834,7 @@ public static void main(String[] args) { } img.setRGB(0, 0, w, h, pixels, 0, w); JOptionPane.showMessageDialog(null, null, "Another Map", JOptionPane.PLAIN_MESSAGE, new ImageIcon(img.getScaledInstance(w * 4, h * 4, Image.SCALE_AREA_AVERAGING))); - if (LevelGen.worldSeed == 0x100) - LevelGen.worldSeed = 0xAAFF20; - else - LevelGen.worldSeed = 0x100; + LevelGen.worldSeed++; } } } diff --git a/src/main/java/minicraft/level/tile/FlowerTile.java b/src/main/java/minicraft/level/tile/FlowerTile.java index 8c0bf8176..aa3d600e1 100644 --- a/src/main/java/minicraft/level/tile/FlowerTile.java +++ b/src/main/java/minicraft/level/tile/FlowerTile.java @@ -18,7 +18,7 @@ public class FlowerTile extends Tile { private static final SpriteAnimation flowerSprite1 = new SpriteAnimation(SpriteType.Tile, "flower_shape1"); protected FlowerTile(String name) { - super(name, (SpriteAnimation) null); + super(name, null); connectsToGrass = true; maySpawn = true; } diff --git a/src/main/java/minicraft/level/tile/GrassTile.java b/src/main/java/minicraft/level/tile/GrassTile.java index 5213f3f18..d9a1d7335 100644 --- a/src/main/java/minicraft/level/tile/GrassTile.java +++ b/src/main/java/minicraft/level/tile/GrassTile.java @@ -13,7 +13,7 @@ import minicraft.level.Level; public class GrassTile extends Tile { - private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") + private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) .setSingletonWithConnective(true); @@ -60,11 +60,8 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } if (tool.type == ToolType.Hoe) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { - level.setTile(xt, yt, Tiles.get("Dirt")); + level.setTile(xt, yt, Tiles.get("Farmland")); Sound.play("monsterhurt"); - if (random.nextInt(5) != 0) { // 80% chance to drop Wheat seeds - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Wheat Seeds")); - } return true; } } diff --git a/src/main/java/minicraft/level/tile/TallGrassTile.java b/src/main/java/minicraft/level/tile/TallGrassTile.java new file mode 100644 index 000000000..38110a654 --- /dev/null +++ b/src/main/java/minicraft/level/tile/TallGrassTile.java @@ -0,0 +1,62 @@ +package minicraft.level.tile; + +import minicraft.core.io.Sound; +import minicraft.entity.Direction; +import minicraft.entity.mob.Mob; +import minicraft.entity.mob.Player; +import minicraft.gfx.Screen; +import minicraft.gfx.SpriteAnimation; +import minicraft.gfx.SpriteLinker; +import minicraft.item.Item; +import minicraft.item.Items; +import minicraft.level.Level; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class TallGrassTile extends Tile { + public enum TallGrassType { + GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "tall_grass")), + FERN(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "fern")), + TALL_GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "double_tall_grass")), + LARGE_FERN(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "large_fern")), + ; + + private final SpriteAnimation sprite; + + TallGrassType(SpriteAnimation sprite) { + this.sprite = sprite.setConnectChecker((tile, side) -> !side || tile.connectsToGrass) + .setSingletonWithConnective(true); + } + } + + public static final List grassIDs = Collections.unmodifiableList(Arrays.asList( + (short) 55, (short) 56, (short) 57, (short) 58)); + + protected TallGrassTile(String name, TallGrassType type) { + super(name, type.sprite); + connectsToGrass = true; + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + Tiles.get("grass").render(screen, level, x, y); + sprite.render(screen, level, x, y); + } + + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + level.setTile(xt, yt, Tiles.get("Grass")); + Sound.play("monsterhurt"); + level.dropItem(xt * 16 + 8, yt * 16 + 8, 0, 1, Items.get("Wheat Seeds")); + return true; + } + + @Override + public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { + level.setTile(x, y, Tiles.get("Grass")); + Sound.play("monsterhurt"); + level.dropItem(x * 16 + 8, y * 16 + 8, 0, 1, Items.get("Wheat Seeds")); + return true; + } +} diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index 993779576..e6b27fc7f 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -81,6 +81,10 @@ public static void initTileList() { tiles.put((short)46, new DecorTile(Tile.Material.Obsidian)); tiles.put((short)53, new BeetrootTile("Beetroot")); tiles.put((short)54, new CarrotTile("Carrot")); + tiles.put((short)55, new TallGrassTile("Tall Grass", TallGrassTile.TallGrassType.GRASS)); + tiles.put((short)56, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); + tiles.put((short)57, new TallGrassTile("Fern", TallGrassTile.TallGrassType.FERN)); + tiles.put((short)58, new TallGrassTile("Large Fern", TallGrassTile.TallGrassType.LARGE_FERN)); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/main/java/minicraft/level/tile/TreeTile.java b/src/main/java/minicraft/level/tile/TreeTile.java index 0de06bba1..740ffd4db 100644 --- a/src/main/java/minicraft/level/tile/TreeTile.java +++ b/src/main/java/minicraft/level/tile/TreeTile.java @@ -11,7 +11,6 @@ import minicraft.gfx.Color; import minicraft.gfx.Screen; import minicraft.gfx.Sprite; -import minicraft.gfx.SpriteAnimation; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.item.Item; @@ -24,8 +23,7 @@ import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; -import java.util.Set; +import java.util.List; public class TreeTile extends Tile { private static final LinkedSprite oakSprite = new LinkedSprite(SpriteType.Tile, "oak"); @@ -45,8 +43,8 @@ public class TreeTile extends Tile { private final TreeType type; - public static final Set treeIDs = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( - (short) 8, (short) 47, (short) 48, (short) 49, (short) 50, (short) 51, (short) 52))); + public static final List treeIDs = Collections.unmodifiableList(Arrays.asList( + (short) 8, (short) 47, (short) 48, (short) 49, (short) 50, (short) 51, (short) 52)); public enum TreeType { OAK(oakSprite, oakSpriteFull), diff --git a/src/main/resources/assets/textures/tile/double_tall_grass.png b/src/main/resources/assets/textures/tile/double_tall_grass.png new file mode 100644 index 0000000000000000000000000000000000000000..9f99ffe5309acd9306377d15bd957130829bf8f2 GIT binary patch literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|-okd?vyGyPmjoq+>PmwAg8%>j&)}f7@(Ym9S>O>_%)r2R z2!t6$HM|;tf{C6kjv*Ssv3-nu2NXDt*!=iE|N5zzGXYaxHx`!aPd1(XSi694#wY%w z2J=ZzH4k{*xW^o@OT0ktD^qo_rbETLCJ(`VMvHgww&YzXTM}x(sJhZy`9PsFJJW;D f(Hh@R$lm3@p~-mQp8t&=pk)l6u6{1-oD!MNS%G~10G|+7|CxRvD}&t{U0q6@fnrAUoqd25Ye|q_@P8m+_`Qt}WDsY8M`SSr z1K%MKW)#)%Y5)obd%8G=Xatw`dJ7#e;BXS$`+sKl{FGZhr`T!^c36Dj{&tvc+aZgC ze9Q%zJ|4^6Oz$MbF|aB2eqgD3;khwv4p&XA=bY@+znQO!m;T8Jc(p}paR>WZALh_c SImIBKFnGH9xvXNS%G~10G|-o$jxEi-JT&!g94WL0mZguKad4dtR+Ey!T*7P;rBK^kU^XU9+AZi z415Pcm~qF%?6*L{L{AsT5RKs6-ax(s1{_X|)&Gt8ue?i+oV@H4SI1||{|q83Auf4S zITl~yj=Hs_L1(IFev996mI4QDuO8I{xj$Q9Ok#_Z?0?yyH}eXU`>Y47_g>B}Y{*_8 iccE{dn97y+mi(0kOs6-W-cNS%G|>0G|-okd?vyGyPmjoq+>PmwAg8%>j&)}f7@(Ym9S>O>_%)r2R z7=#&*=dVZs3Wj*PIEH8h_nu+oYH;9i33Pv7|NP&XJVD0|(>@L2>t5d?0A(Wjx@6X{Gj?yt4*6(?Dr|G#DG6nW? SajpZJ&*16m=d#Wzp$PzN_e!Dw literal 0 HcmV?d00001 From 5d6d03ba57d96b9e8f03b9c16a7c9fa9217e4a64 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 14 Feb 2023 19:47:39 +0800 Subject: [PATCH 004/261] Added bone meal --- .../java/minicraft/item/BoneMealItem.java | 52 ++++++++++++++++++ src/main/java/minicraft/item/Items.java | 1 + .../java/minicraft/item/StackableItem.java | 1 + src/main/java/minicraft/item/TileItem.java | 9 ++- src/main/java/minicraft/level/LevelGen.java | 6 +- .../level/tile/BonemealableTile.java | 20 +++++++ .../java/minicraft/level/tile/GrassTile.java | 51 ++++++++++++++++- .../minicraft/level/tile/SaplingTile.java | 19 ++++++- .../level/tile/farming/BeetrootTile.java | 8 +++ .../level/tile/farming/PlantTile.java | 20 ++++++- .../assets/textures/entity/glint.png | Bin 0 -> 190 bytes .../assets/textures/item/bone_meal.png | Bin 0 -> 184 bytes 12 files changed, 175 insertions(+), 12 deletions(-) create mode 100644 src/main/java/minicraft/item/BoneMealItem.java create mode 100644 src/main/java/minicraft/level/tile/BonemealableTile.java create mode 100644 src/main/resources/assets/textures/entity/glint.png create mode 100644 src/main/resources/assets/textures/item/bone_meal.png diff --git a/src/main/java/minicraft/item/BoneMealItem.java b/src/main/java/minicraft/item/BoneMealItem.java new file mode 100644 index 000000000..3c213c6ef --- /dev/null +++ b/src/main/java/minicraft/item/BoneMealItem.java @@ -0,0 +1,52 @@ +package minicraft.item; + +import minicraft.entity.Direction; +import minicraft.entity.mob.Player; +import minicraft.entity.particle.Particle; +import minicraft.gfx.SpriteLinker; +import minicraft.level.Level; +import minicraft.level.tile.BonemealableTile; +import minicraft.level.tile.Tile; + +import java.util.ArrayList; +import java.util.Random; + +public class BoneMealItem extends StackableItem { + public static ArrayList getAllInstances() { + ArrayList items = new ArrayList<>(); + items.add(new BoneMealItem("Bone Meal", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "bone_meal"))); + return items; + } + + protected BoneMealItem(String name, SpriteLinker.LinkedSprite sprite) { + super(name, sprite); + } + + private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); + + @Override + public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { + if (tile instanceof BonemealableTile) { + if (((BonemealableTile) tile).isValidBonemealTarget(level, xt, yt)) { + if (((BonemealableTile) tile).isBonemealSuccess(level, xt, yt)) { + ((BonemealableTile) tile).performBonemeal(level, xt, yt); + } + + Random random = new Random(); + for (int i = 0; i < 5; i++) { + double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(40) - 20, particleSprite)); + } + return super.interactOn(true); + } + } + + return false; + } + + @Override + public StackableItem clone() { + return new BoneMealItem(getName(), sprite); + } +} diff --git a/src/main/java/minicraft/item/Items.java b/src/main/java/minicraft/item/Items.java index 079e9576b..7fcefad72 100644 --- a/src/main/java/minicraft/item/Items.java +++ b/src/main/java/minicraft/item/Items.java @@ -43,6 +43,7 @@ private static void addAll(ArrayList items) { addAll(PotionItem.getAllInstances()); addAll(FishingRodItem.getAllInstances()); addAll(SummonItem.getAllInstances()); + addAll(BoneMealItem.getAllInstances()); } public static ArrayList getAll() { diff --git a/src/main/java/minicraft/item/StackableItem.java b/src/main/java/minicraft/item/StackableItem.java index 6e5abb0cf..a7cee5e1b 100644 --- a/src/main/java/minicraft/item/StackableItem.java +++ b/src/main/java/minicraft/item/StackableItem.java @@ -37,6 +37,7 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Cloud Ore", new LinkedSprite(SpriteType.Item, "cloud_ore"))); items.add(new StackableItem("Glass Bottle", new LinkedSprite(SpriteType.Item, "glass_bottle"))); items.add(new StackableItem("Beetroot", new LinkedSprite(SpriteType.Item, "beetroot"))); + items.add(new StackableItem("Bone", new LinkedSprite(SpriteType.Item, "bone"))); return items; } diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 88e6203c1..e5056c519 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -51,13 +51,12 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Sand", new LinkedSprite(SpriteType.Item, "sand"), new TileModel("sand"), "hole", "water", "lava")); items.add(new TileItem("Cactus", new LinkedSprite(SpriteType.Item, "cactus"), new TileModel("cactus Sapling"), "sand")); - items.add(new TileItem("Bone", new LinkedSprite(SpriteType.Item, "bone"), new TileModel("tree"), "tree Sapling")); items.add(new TileItem("Cloud", new LinkedSprite(SpriteType.Item, "cloud"), new TileModel("cloud"), "Infinite Fall")); - items.add(new TileItem("Wheat Seeds", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "seed"), new TileModel("wheat", TileModel.KEEP_DATA), "farmland")); - items.add(new TileItem("Potato", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "potato"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); - items.add(new TileItem("Carrot", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); - items.add(new TileItem("Beetroot Seeds", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "seed"), new TileModel("beetroot", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Wheat Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("wheat", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Potato", new LinkedSprite(SpriteType.Item, "potato"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Carrot", new LinkedSprite(SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Beetroot Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("beetroot", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); // Creative mode available tiles: diff --git a/src/main/java/minicraft/level/LevelGen.java b/src/main/java/minicraft/level/LevelGen.java index f03c3d102..8b5b08bed 100644 --- a/src/main/java/minicraft/level/LevelGen.java +++ b/src/main/java/minicraft/level/LevelGen.java @@ -13,7 +13,6 @@ import java.awt.Image; import java.awt.image.BufferedImage; -import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.function.BiFunction; @@ -361,7 +360,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map BiFunction treeRandom; { List treeIDs = TreeTile.treeIDs; - treeRandom = (x, y) -> { + treeRandom = (x, y) -> { // Randomly selecting a tree type. int i = x + y * w; double val = Math.abs(noise1.values[i] - noise2.values[i]) * 3 - 2; // This calculates a sort of distance based on the current coordinate. @@ -376,9 +375,10 @@ private static short[][] createTopMap(int w, int h) { // Create surface map val += 1.5; // Assuming the range of value is from 0 to 2. val *= treeIDs.size() / 2.0; val += 1; // Incrementing index. + // The original val mainly falls in small interval instead of averagely. val = 1.0/(3 * treeIDs.size()) * Math.pow(val - 5, 2); // Quadratically bloating the value. int idx = (int) Math.round(val - 1); // Decrementing index. - if (idx >= treeIDs.size() || idx < 0) return (short) 8; // Oak + if (idx >= treeIDs.size() || idx < 0) return (short) 8; // Oak in default. return treeIDs.get(idx); }; } diff --git a/src/main/java/minicraft/level/tile/BonemealableTile.java b/src/main/java/minicraft/level/tile/BonemealableTile.java new file mode 100644 index 000000000..a50d08f60 --- /dev/null +++ b/src/main/java/minicraft/level/tile/BonemealableTile.java @@ -0,0 +1,20 @@ +package minicraft.level.tile; + +import minicraft.level.Level; + +public interface BonemealableTile { + /** + * Whether bonemeal is able to be performed on the tile. + */ + boolean isValidBonemealTarget(Level level, int x, int y); + + /** + * Whether bonemeal can successfully be performed on the tile. + */ + boolean isBonemealSuccess(Level level, int x, int y); + + /** + * Performing bonemeal with effects on the tile. + */ + void performBonemeal(Level level, int x, int y); +} diff --git a/src/main/java/minicraft/level/tile/GrassTile.java b/src/main/java/minicraft/level/tile/GrassTile.java index d9a1d7335..f382ed4db 100644 --- a/src/main/java/minicraft/level/tile/GrassTile.java +++ b/src/main/java/minicraft/level/tile/GrassTile.java @@ -12,7 +12,11 @@ import minicraft.item.ToolType; import minicraft.level.Level; -public class GrassTile extends Tile { +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Map; + +public class GrassTile extends Tile implements BonemealableTile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) .setSingletonWithConnective(true); @@ -74,4 +78,49 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } return false; } + + @Override + public boolean isValidBonemealTarget(Level level, int x, int y) { + return true; + } + + @Override + public boolean isBonemealSuccess(Level level, int x, int y) { + return true; + } + + @Override + public void performBonemeal(Level level, int x, int y) { + label: + for (int i = 0; i < 128; i++) { + int xx = x; + int yy = y; + + for(int j = 0; j < i / 16; ++j) { + xx += x + random.nextInt(3) - 1; + yy += y + random.nextInt(3) - 1; + if (!(level.getTile(xx, yy) == this)) { + continue label; + } + } + + if (level.getTile(xx, yy) == this && random.nextInt(10) == 0) { + performBonemeal(level, xx, yy); + } + + if (level.getTile(xx, yy) != this) continue; // Further confirming the tile is still grass tile. + Map.Entry plant = bonemealPerformingPlants.get(random.nextInt(bonemealPerformingPlants.size())); + level.setTile(xx, yy, Tiles.get(plant.getKey()), plant.getValue()); + } + } + + private static final ArrayList> bonemealPerformingPlants = new ArrayList<>(); + static { + bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 0)); + bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 1)); + bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 55, (short) 0)); + bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 56, (short) 0)); + bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 57, (short) 0)); + bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 58, (short) 0)); + } } diff --git a/src/main/java/minicraft/level/tile/SaplingTile.java b/src/main/java/minicraft/level/tile/SaplingTile.java index f000acf9e..2e7a36c6c 100644 --- a/src/main/java/minicraft/level/tile/SaplingTile.java +++ b/src/main/java/minicraft/level/tile/SaplingTile.java @@ -8,8 +8,8 @@ import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.level.Level; -public class SaplingTile extends Tile { - private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "sapling"); +public class SaplingTile extends Tile implements BonemealableTile { + private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "sapling"); private Tile onType; private Tile growsTo; @@ -47,4 +47,19 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at Sound.play("monsterhurt"); return true; } + + @Override + public boolean isValidBonemealTarget(Level level, int x, int y) { + return true; + } + + @Override + public boolean isBonemealSuccess(Level level, int x, int y) { + return true; + } + + @Override + public void performBonemeal(Level level, int x, int y) { + level.setData(x, y, Math.min(level.getData(x, y) + random.nextInt(30), 110)); + } } diff --git a/src/main/java/minicraft/level/tile/farming/BeetrootTile.java b/src/main/java/minicraft/level/tile/farming/BeetrootTile.java index 7afb4f85d..742a29754 100644 --- a/src/main/java/minicraft/level/tile/farming/BeetrootTile.java +++ b/src/main/java/minicraft/level/tile/farming/BeetrootTile.java @@ -25,4 +25,12 @@ public void render(Screen screen, Level level, int x, int y) { Tiles.get("Farmland").render(screen, level, x, y); screen.render(x * 16, y * 16, spritStages[age]); } + + @Override + public void performBonemeal(Level level, int x, int y) { + int data = level.getData(x, y); + int stage = (data >> 3) & maxStage; + if (stage < maxStage && random.nextInt(4) == 0) + level.setData(x, y, (data & ~(maxStage << 3)) + ((stage + 1) << 3)); + } } diff --git a/src/main/java/minicraft/level/tile/farming/PlantTile.java b/src/main/java/minicraft/level/tile/farming/PlantTile.java index 496a749fa..d3f17b143 100644 --- a/src/main/java/minicraft/level/tile/farming/PlantTile.java +++ b/src/main/java/minicraft/level/tile/farming/PlantTile.java @@ -7,6 +7,7 @@ import minicraft.entity.mob.Player; import minicraft.item.Items; import minicraft.level.Level; +import minicraft.level.tile.BonemealableTile; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.level.tile.WaterTile; @@ -14,7 +15,7 @@ import java.util.Arrays; -public class PlantTile extends FarmTile { +public class PlantTile extends FarmTile implements BonemealableTile { protected final @Nullable String seed; protected int maxStage = 7; // Must be a bit mask. @@ -110,4 +111,21 @@ protected void harvest(Level level, int x, int y, Entity entity) { level.setTile(x, y, Tiles.get("farmland"), data & 0b111); } + + @Override + public boolean isValidBonemealTarget(Level level, int x, int y) { + return true; + } + + @Override + public boolean isBonemealSuccess(Level level, int x, int y) { + return true; + } + + @Override + public void performBonemeal(Level level, int x, int y) { + int data = level.getData(x, y); + int stage = (data >> 3) & maxStage; + level.setData(x, y, (data & ~(maxStage << 3)) + (Math.min(stage + random.nextInt(4) + 2, maxStage) << 3)); + } } diff --git a/src/main/resources/assets/textures/entity/glint.png b/src/main/resources/assets/textures/entity/glint.png new file mode 100644 index 0000000000000000000000000000000000000000..3b14f6d8fdc0a6e5e0f7632921c44e4eaf8cf986 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!C+4p#}JL+WCzB}EdQM&3l6X>RdfgwI_1F7 z!ZabzFqJ1*;vkd4Tm{caf3~*cw9 gP>N1wLn9-@T{rQ9zv@99K;s!aUHx3vIVCg!0MgYs9smFU literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/item/bone_meal.png b/src/main/resources/assets/textures/item/bone_meal.png new file mode 100644 index 0000000000000000000000000000000000000000..c75a8b7316a326260a545a19afba6b0f9f0d3488 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`0h2Ka=ye)#YqEiDbmix4`r2S_oO1o;L3|Icv!6faOM180FpWHAE+-(e7D zJf6QI1t_TL>Eak75w6?S$jM;9bI9kveO2LF4K~AKp>ry}2Ol-_G98W0`tN7(nSm>c V!LjLP@^YXi22WQ%mvv4FO#t Date: Tue, 14 Feb 2023 19:59:48 +0800 Subject: [PATCH 005/261] Modify LevelGen #main behavior --- src/main/java/minicraft/level/LevelGen.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/minicraft/level/LevelGen.java b/src/main/java/minicraft/level/LevelGen.java index 8b5b08bed..9f01cdc5d 100644 --- a/src/main/java/minicraft/level/LevelGen.java +++ b/src/main/java/minicraft/level/LevelGen.java @@ -833,8 +833,11 @@ public static void main(String[] args) { } } img.setRGB(0, 0, w, h, pixels, 0, w); - JOptionPane.showMessageDialog(null, null, "Another Map", JOptionPane.PLAIN_MESSAGE, new ImageIcon(img.getScaledInstance(w * 4, h * 4, Image.SCALE_AREA_AVERAGING))); - LevelGen.worldSeed++; + int op = JOptionPane.showOptionDialog(null, null, "Map With Seed "+worldSeed, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, + new ImageIcon(img.getScaledInstance(w * 4, h * 4, Image.SCALE_AREA_AVERAGING)), new String[] {"Next", "0x100", "0xAAFF20"}, "Next"); + if (op == 1) LevelGen.worldSeed = 0x100; + else if (op == 2) LevelGen.worldSeed = 0xAAFF20; + else LevelGen.worldSeed++; } } } From 9f5a843faed7b61aa55be39ea27044ff2c125d06 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 14 Feb 2023 23:18:25 +0800 Subject: [PATCH 006/261] Added fertilization with watering tin --- src/main/java/minicraft/core/Renderer.java | 10 ++ src/main/java/minicraft/entity/mob/MobAi.java | 2 +- .../java/minicraft/item/BoneMealItem.java | 2 +- src/main/java/minicraft/item/Items.java | 1 + .../java/minicraft/item/WateringTinItem.java | 140 ++++++++++++++++++ .../level/tile/farming/PlantTile.java | 29 +++- .../assets/textures/entity/splash_0.png | Bin 0 -> 135 bytes .../assets/textures/entity/splash_1.png | Bin 0 -> 131 bytes .../assets/textures/entity/splash_2.png | Bin 0 -> 128 bytes .../assets/textures/entity/splash_3.png | Bin 0 -> 133 bytes .../assets/textures/item/watering_tin.png | Bin 0 -> 170 bytes .../textures/item/watering_tin_filled.png | Bin 0 -> 177 bytes 12 files changed, 179 insertions(+), 5 deletions(-) create mode 100644 src/main/java/minicraft/item/WateringTinItem.java create mode 100644 src/main/resources/assets/textures/entity/splash_0.png create mode 100644 src/main/resources/assets/textures/entity/splash_1.png create mode 100644 src/main/resources/assets/textures/entity/splash_2.png create mode 100644 src/main/resources/assets/textures/entity/splash_3.png create mode 100644 src/main/resources/assets/textures/item/watering_tin.png create mode 100644 src/main/resources/assets/textures/item/watering_tin_filled.png diff --git a/src/main/java/minicraft/core/Renderer.java b/src/main/java/minicraft/core/Renderer.java index 702548aed..af4a41f27 100644 --- a/src/main/java/minicraft/core/Renderer.java +++ b/src/main/java/minicraft/core/Renderer.java @@ -21,6 +21,7 @@ import minicraft.item.PotionType; import minicraft.item.ToolItem; import minicraft.item.ToolType; +import minicraft.item.WateringTinItem; import minicraft.level.Level; import minicraft.screen.LoadingDisplay; import minicraft.screen.Menu; @@ -330,6 +331,15 @@ private static void renderGui() { Font.drawBackground(dura + "%", screen, 164, Screen.h - 16, Color.get(1, 255 - green, green, 0)); } + // WATERING TIN CONTAINER STATUS + if (player.activeItem instanceof WateringTinItem) { + // Draws the text + WateringTinItem tin = (WateringTinItem) player.activeItem; + int dura = tin.content * 100 / tin.CAPACITY; + int green = (int)(dura * 2.55f); // Let duration show as normal. + Font.drawBackground(dura + "%", screen, 164, Screen.h - 16, Color.get(1, 255 - green, green, 0)); + } + // This renders the potions overlay if (player.showpotioneffects && player.potioneffects.size() > 0) { diff --git a/src/main/java/minicraft/entity/mob/MobAi.java b/src/main/java/minicraft/entity/mob/MobAi.java index 92b4c0e68..b438928e8 100644 --- a/src/main/java/minicraft/entity/mob/MobAi.java +++ b/src/main/java/minicraft/entity/mob/MobAi.java @@ -55,7 +55,7 @@ public void tick() { if (lifetime > 0) { age++; if (age > lifetime) { - boolean playerClose = getLevel().entityNearPlayer((Entity) this); + boolean playerClose = getLevel().entityNearPlayer(this); if (!playerClose) { remove(); diff --git a/src/main/java/minicraft/item/BoneMealItem.java b/src/main/java/minicraft/item/BoneMealItem.java index 3c213c6ef..6aa9f15af 100644 --- a/src/main/java/minicraft/item/BoneMealItem.java +++ b/src/main/java/minicraft/item/BoneMealItem.java @@ -36,7 +36,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, for (int i = 0; i < 5; i++) { double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - level.add(new Particle((int) x, (int) y, 120 + random.nextInt(40) - 20, particleSprite)); + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); } return super.interactOn(true); } diff --git a/src/main/java/minicraft/item/Items.java b/src/main/java/minicraft/item/Items.java index 7fcefad72..d5b125f98 100644 --- a/src/main/java/minicraft/item/Items.java +++ b/src/main/java/minicraft/item/Items.java @@ -44,6 +44,7 @@ private static void addAll(ArrayList items) { addAll(FishingRodItem.getAllInstances()); addAll(SummonItem.getAllInstances()); addAll(BoneMealItem.getAllInstances()); + addAll(WateringTinItem.getAllInstances()); } public static ArrayList getAll() { diff --git a/src/main/java/minicraft/item/WateringTinItem.java b/src/main/java/minicraft/item/WateringTinItem.java new file mode 100644 index 000000000..e979dd37d --- /dev/null +++ b/src/main/java/minicraft/item/WateringTinItem.java @@ -0,0 +1,140 @@ +package minicraft.item; + +import minicraft.entity.Direction; +import minicraft.entity.mob.Player; +import minicraft.entity.particle.Particle; +import minicraft.gfx.SpriteLinker; +import minicraft.level.Level; +import minicraft.level.tile.Tile; +import minicraft.level.tile.WaterTile; +import minicraft.level.tile.farming.PlantTile; + +import java.util.ArrayList; +import java.util.Random; +import java.util.function.ToIntFunction; + +public class WateringTinItem extends Item { + protected static ArrayList getAllInstances() { + ArrayList items = new ArrayList<>(); + items.add(new WateringTinItem("Watering Tin")); + return items; + } + + private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_tin"); + private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_tin_filled"); + + private static final SpriteLinker.LinkedSprite[] spriteSplash = new SpriteLinker.LinkedSprite[] { + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_0"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_1"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_2"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_3") + }; + + public final int CAPACITY = 3600; + public int content = 0; + private int renderingTick = 0; + + protected WateringTinItem(String name) { + super(name, sprite); + } + + @Override + public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { + if (tile instanceof WaterTile) { + content = CAPACITY; + updateSprite(); + return true; + } else if (content > 0) { + content--; + updateSprite(); + renderingTick++; + if (renderingTick == 8) { + Random random = new Random(); + for (int i = 0; i < 4; i++) { + SpriteLinker.LinkedSprite splash = spriteSplash[random.nextInt(spriteSplash.length)]; + // 2-pixel deviation? + int destX = player.x - 2 + 12 * attackDir.getX() + random.nextInt(9) - 4; + int destY = player.y - 2 + 12 * attackDir.getY() + random.nextInt(9) - 4; + int x = player.x - 2 + 4 * attackDir.getX() + random.nextInt(5) - 2; + int y = player.y - 2 + 4 * attackDir.getY() + random.nextInt(5) - 2; + System.out.println("DEST "+destX+";"+destY); + level.add(new WaterParticle(x, y, 80 + random.nextInt(61) - 30, splash, destX, destY)); + renderingTick = 0; + } + } + if (tile instanceof PlantTile) { + int fertilization = ((PlantTile) tile).getFertilization(level.getData(xt, yt)); + if (fertilization < 150) { // Maximum of 5 levels watering tin can fertilize. + ((PlantTile) tile).fertilize(level, xt, yt, 1); + } + } + + return true; + } + + return false; + } + + private void updateSprite() { + super.sprite = content > 0 ? spriteFilled : sprite; + } + + @Override + public Item clone() { + return new WateringTinItem(getName()); + } + + private static class WaterParticle extends Particle { + private final int destX; + private final int destY; + private int count; + private boolean stopped; + + public WaterParticle(int x, int y, int lifetime, SpriteLinker.LinkedSprite sprite, int destX, int destY) { + super(x, y, lifetime, sprite); + this.destX = destX; + this.destY = destY; + count = 0; + stopped = false; + } + + @Override + public void tick() { + move: + if (!stopped) { + count++; + if (x == destX && y == destY) { + stopped = true; + break move; + } + if (count == 2) { + int diffX = destX - x; + int diffY = destY - y; + if (Math.abs(diffX) < 3 && Math.abs(diffY) < 3) { + move(destX, destY); + stopped = true; + break move; + } + + double phi = Math.atan2(diffY, diffX); + double moveX = Math.cos(phi); + double moveY = Math.sin(phi); + int moveXI = 0; + int moveYI = 0; + if (Math.abs(moveX / moveY) > 1.4) moveXI = (int) Math.signum(moveX); // Difference in X is greater. + else if (Math.abs(moveY / moveX) > 1.4) moveYI = (int) Math.signum(moveY); // Difference in Y is greater. + else { // The difference is small. + moveXI = (int) Math.signum(moveX); + moveYI = (int) Math.signum(moveY); + } + + if (!move(moveXI, moveYI)) + stopped = true; + count = 0; + } + } + + super.tick(); + } + } +} diff --git a/src/main/java/minicraft/level/tile/farming/PlantTile.java b/src/main/java/minicraft/level/tile/farming/PlantTile.java index d3f17b143..361bca427 100644 --- a/src/main/java/minicraft/level/tile/farming/PlantTile.java +++ b/src/main/java/minicraft/level/tile/farming/PlantTile.java @@ -38,11 +38,17 @@ public boolean tick(Level level, int xt, int yt) { boolean successful = false; if (Arrays.stream(level.getAreaTiles(xt, yt, 4)).anyMatch(t -> t instanceof WaterTile)) { // Contains water. if (moisture < 7 && random.nextInt(10) == 0) { // hydrating - level.setData(xt, yt, data = (data & ~3) + moisture++); + level.setData(xt, yt, data = (data & ~0b111) + moisture++); successful = true; } } else if (moisture > 0 && random.nextInt(10) == 0) { // drying - level.setData(xt, yt, data = (data & ~3) + moisture--); + level.setData(xt, yt, data = (data & ~0b111) + moisture--); + successful = true; + } + + int fertilization = getFertilization(data); + if (fertilization > 0) { + level.setData(xt, yt, data = (data & (0b111 + (maxStage << 3))) + (fertilization-- << (3 + (maxStage + 1)/2))); successful = true; } @@ -80,7 +86,7 @@ public boolean tick(Level level, int xt, int yt) { if (dr) points *= 0.98125; } - if (random.nextInt((int) (100/points) + 1) == 0) + if (random.nextInt((int) (100/points) + 1) < (fertilization/30 + 1)) // fertilization >= 0 level.setData(xt, yt, (data & ~(maxStage << 3)) + ((stage + 1) << 3)); // Incrementing the stage by 1. return true; } @@ -112,6 +118,23 @@ protected void harvest(Level level, int x, int y, Entity entity) { level.setTile(x, y, Tiles.get("farmland"), data & 0b111); } + public int getFertilization(int data) { + return data >> (3 + (maxStage + 1)/2); + } + + /** + * Fertilization: Each magnitude of fertilization (by 1) increases the chance of growth by 1/30. + * (The addition by fertilization is rounded down to the nearest integer in chance calculation) + * For example, if the chance is originally 10% (1/10), the final chance with 30 fertilization will be 20% (2/10). + */ + public void fertilize(Level level, int x, int y, int amount) { + int data = level.getData(x, y); + int fertilization = getFertilization(data); + fertilization += amount; + if (fertilization < 0) fertilization = 0; + level.setData(x, y, (data & (0b111 + (maxStage << 3))) + (fertilization << (3 + (maxStage + 1)/2))); + } + @Override public boolean isValidBonemealTarget(Level level, int x, int y) { return true; diff --git a/src/main/resources/assets/textures/entity/splash_0.png b/src/main/resources/assets/textures/entity/splash_0.png new file mode 100644 index 0000000000000000000000000000000000000000..8065908bda42a7a0d6b998d7087fdb82966dc63f GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucK^adM#}JL+*~f})--jv*Ss$qVEre6aW|e@Z5+p^=ec>Q5#e Up<63X0u?ZLy85}Sb4q9e01n3?mH+?% literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/entity/splash_3.png b/src/main/resources/assets/textures/entity/splash_3.png new file mode 100644 index 0000000000000000000000000000000000000000..fcec23a26f93ad5d1f01504a26e0fbbd7b8ad180 GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufG}g$wN6f;pp>VJV~9p@@&dks^H!hbPaR=A!=WkRaR8`D Xyq%@)g+knCpehDWS3j3^P6XZ#}JL+{6L Date: Wed, 15 Feb 2023 19:40:01 +0800 Subject: [PATCH 007/261] Resolved fertilization and tin not saving problem --- src/main/java/minicraft/item/Items.java | 2 ++ src/main/java/minicraft/item/WateringTinItem.java | 9 ++++++--- src/main/java/minicraft/level/Level.java | 2 +- .../minicraft/level/tile/farming/PlantTile.java | 14 +++++++------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/main/java/minicraft/item/Items.java b/src/main/java/minicraft/item/Items.java index d5b125f98..554f9fc32 100644 --- a/src/main/java/minicraft/item/Items.java +++ b/src/main/java/minicraft/item/Items.java @@ -108,6 +108,8 @@ public static Item get(String name, boolean allowNull) { ((StackableItem)i).count = data; if (i instanceof ToolItem && hadUnderscore) ((ToolItem)i).dur = data; + if (i instanceof WateringTinItem) + ((WateringTinItem) i).content = data; return i; } else { Logging.ITEMS.error("Requested invalid item with name: '{}'", name); diff --git a/src/main/java/minicraft/item/WateringTinItem.java b/src/main/java/minicraft/item/WateringTinItem.java index e979dd37d..8548aecf7 100644 --- a/src/main/java/minicraft/item/WateringTinItem.java +++ b/src/main/java/minicraft/item/WateringTinItem.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import java.util.Random; -import java.util.function.ToIntFunction; public class WateringTinItem extends Item { protected static ArrayList getAllInstances() { @@ -52,12 +51,11 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Random random = new Random(); for (int i = 0; i < 4; i++) { SpriteLinker.LinkedSprite splash = spriteSplash[random.nextInt(spriteSplash.length)]; - // 2-pixel deviation? + // 2-pixel deviation for centering particle sprites. int destX = player.x - 2 + 12 * attackDir.getX() + random.nextInt(9) - 4; int destY = player.y - 2 + 12 * attackDir.getY() + random.nextInt(9) - 4; int x = player.x - 2 + 4 * attackDir.getX() + random.nextInt(5) - 2; int y = player.y - 2 + 4 * attackDir.getY() + random.nextInt(5) - 2; - System.out.println("DEST "+destX+";"+destY); level.add(new WaterParticle(x, y, 80 + random.nextInt(61) - 30, splash, destX, destY)); renderingTick = 0; } @@ -79,6 +77,11 @@ private void updateSprite() { super.sprite = content > 0 ? spriteFilled : sprite; } + @Override + public String getData() { + return super.getData() + "_" + content; + } + @Override public Item clone() { return new WateringTinItem(getName()); diff --git a/src/main/java/minicraft/level/Level.java b/src/main/java/minicraft/level/Level.java index 5beee74b5..8ae48b91e 100644 --- a/src/main/java/minicraft/level/Level.java +++ b/src/main/java/minicraft/level/Level.java @@ -524,7 +524,7 @@ public void setTile(int x, int y, Tile t, int dataVal) { public int getData(int x, int y) { if (x < 0 || y < 0 || x >= w || y >= h) return 0; - return data[x + y * w] & 0xff; + return data[x + y * w]; } public void setData(int x, int y, int val) { diff --git a/src/main/java/minicraft/level/tile/farming/PlantTile.java b/src/main/java/minicraft/level/tile/farming/PlantTile.java index 361bca427..8b0e3a936 100644 --- a/src/main/java/minicraft/level/tile/farming/PlantTile.java +++ b/src/main/java/minicraft/level/tile/farming/PlantTile.java @@ -47,11 +47,6 @@ public boolean tick(Level level, int xt, int yt) { } int fertilization = getFertilization(data); - if (fertilization > 0) { - level.setData(xt, yt, data = (data & (0b111 + (maxStage << 3))) + (fertilization-- << (3 + (maxStage + 1)/2))); - successful = true; - } - int stage = (data >> 3) & maxStage; if (stage < maxStage) { double points = moisture > 0 ? 4 : 2; @@ -87,8 +82,13 @@ public boolean tick(Level level, int xt, int yt) { } if (random.nextInt((int) (100/points) + 1) < (fertilization/30 + 1)) // fertilization >= 0 - level.setData(xt, yt, (data & ~(maxStage << 3)) + ((stage + 1) << 3)); // Incrementing the stage by 1. - return true; + level.setData(xt, yt, data = (data & ~(maxStage << 3)) + ((stage + 1) << 3)); // Incrementing the stage by 1. + successful = true; + } + + if (fertilization > 0) { + level.setData(xt, yt, (data & (0b111 + (maxStage << 3))) + ((fertilization - 1) << (3 + (maxStage + 1)/2))); + successful = true; } return successful; From 9d8ba8e1b7556ccda6bcfb35f85eb24f49c30792 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 16 Feb 2023 23:23:53 +0800 Subject: [PATCH 008/261] Added composting --- .../minicraft/entity/furniture/Chest.java | 2 +- .../minicraft/entity/furniture/Compostor.java | 75 ++++++++++++++++++ .../java/minicraft/entity/mob/Player.java | 6 +- .../java/minicraft/item/FertilizerItem.java | 49 ++++++++++++ .../java/minicraft/item/FurnitureItem.java | 1 + src/main/java/minicraft/item/Items.java | 1 + src/main/java/minicraft/item/Recipes.java | 1 + .../java/minicraft/item/WateringTinItem.java | 21 +++++ src/main/java/minicraft/level/Level.java | 4 +- .../level/tile/farming/PlantTile.java | 2 + .../assets/textures/entity/compostor.png | Bin 0 -> 228 bytes .../textures/entity/compostor_filled.png | Bin 0 -> 252 bytes .../assets/textures/entity/compostor_full.png | Bin 0 -> 246 bytes .../assets/textures/item/compostor.png | Bin 0 -> 187 bytes .../assets/textures/item/fertilizer.png | Bin 0 -> 189 bytes 15 files changed, 158 insertions(+), 4 deletions(-) create mode 100644 src/main/java/minicraft/entity/furniture/Compostor.java create mode 100644 src/main/java/minicraft/item/FertilizerItem.java create mode 100644 src/main/resources/assets/textures/entity/compostor.png create mode 100644 src/main/resources/assets/textures/entity/compostor_filled.png create mode 100644 src/main/resources/assets/textures/entity/compostor_full.png create mode 100644 src/main/resources/assets/textures/item/compostor.png create mode 100644 src/main/resources/assets/textures/item/fertilizer.png diff --git a/src/main/java/minicraft/entity/furniture/Chest.java b/src/main/java/minicraft/entity/furniture/Chest.java index b2f186cc6..71944b462 100644 --- a/src/main/java/minicraft/entity/furniture/Chest.java +++ b/src/main/java/minicraft/entity/furniture/Chest.java @@ -77,7 +77,7 @@ public Inventory getInventory() { public void die() { if (level != null) { List items = inventory.getItems(); - level.dropItem(x, y, items.toArray(new Item[items.size()])); + level.dropItem(x, y, items.toArray(new Item[0])); } super.die(); } diff --git a/src/main/java/minicraft/entity/furniture/Compostor.java b/src/main/java/minicraft/entity/furniture/Compostor.java new file mode 100644 index 000000000..d88f82cef --- /dev/null +++ b/src/main/java/minicraft/entity/furniture/Compostor.java @@ -0,0 +1,75 @@ +package minicraft.entity.furniture; + +import minicraft.entity.Direction; +import minicraft.entity.mob.Player; +import minicraft.gfx.SpriteLinker; +import minicraft.item.FertilizerItem; +import minicraft.item.Item; +import minicraft.item.Items; +import minicraft.item.StackableItem; +import org.jetbrains.annotations.Nullable; + +public class Compostor extends Furniture { + private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "compostor"); + private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "compostor_filled"); + private static final SpriteLinker.LinkedSprite spriteFull = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "compostor_full"); + private static final SpriteLinker.LinkedSprite itemSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "compostor"); + + private static final int MAX_COMPOST = 7; + private int compost = 0; + + public Compostor() { + super("Compostor", sprite, itemSprite); + } + + @Override + public boolean interact(Player player, @Nullable Item item, Direction attackDir) { + if (compost == MAX_COMPOST) { + compost = 0; + FertilizerItem i = (FertilizerItem) Items.get("Fertilizer").clone(); + i.count = 1; + player.getLevel().dropItem(x, y, i); + refreshStatus(); + return true; + } + + if (item instanceof StackableItem) { + if (item.getName().equalsIgnoreCase("Baked Potato") || item.getName().equalsIgnoreCase("Bread")) { + compost++; + ((StackableItem) item).count--; + refreshStatus(); + return true; + } else if (item.getName().equalsIgnoreCase("Wheat") || item.getName().equalsIgnoreCase("Rose") || + item.getName().equalsIgnoreCase("Beetroot") || item.getName().equalsIgnoreCase("Flower") || + item.getName().equalsIgnoreCase("Apple") || item.getName().equalsIgnoreCase("Potato") || + item.getName().equalsIgnoreCase("Carrot")) { + if (random.nextInt(4) != 0) { // 75% + compost++; + ((StackableItem) item).count--; + refreshStatus(); + return true; + } + } else if (item.getName().equalsIgnoreCase("Acorn") || item.getName().equalsIgnoreCase("Cactus") || + item.getName().equalsIgnoreCase("Wheat Seeds") || item.getName().equalsIgnoreCase("Beetroot Seeds") || + item.getName().equalsIgnoreCase("Grass Seeds")) { + if (random.nextInt(3) != 0) { // 66.7% + compost++; + ((StackableItem) item).count--; + refreshStatus(); + return true; + } + } + } + + return false; + } + + private void refreshStatus() { + if (compost == 0) + super.sprite = sprite; + else if (compost < MAX_COMPOST) + super.sprite = spriteFilled; + else + super.sprite = spriteFull; + } +} diff --git a/src/main/java/minicraft/entity/mob/Player.java b/src/main/java/minicraft/entity/mob/Player.java index 40e2d145e..c7b81593e 100644 --- a/src/main/java/minicraft/entity/mob/Player.java +++ b/src/main/java/minicraft/entity/mob/Player.java @@ -574,7 +574,11 @@ protected void attack() { } // If the interaction between you and an entity is successful, then return. - if (interact(getInteractionBox(INTERACT_DIST))) return; + if (interact(getInteractionBox(INTERACT_DIST))) { + if (activeItem.isDepleted()) + activeItem = null; + return; + } // Attempt to interact with the tile. Point t = getInteractionTile(); diff --git a/src/main/java/minicraft/item/FertilizerItem.java b/src/main/java/minicraft/item/FertilizerItem.java new file mode 100644 index 000000000..8bf985033 --- /dev/null +++ b/src/main/java/minicraft/item/FertilizerItem.java @@ -0,0 +1,49 @@ +package minicraft.item; + +import minicraft.entity.Direction; +import minicraft.entity.mob.Player; +import minicraft.gfx.SpriteLinker; +import minicraft.level.Level; +import minicraft.level.tile.Tile; +import minicraft.level.tile.farming.PlantTile; + +import java.util.ArrayList; + +public class FertilizerItem extends StackableItem { + public static ArrayList getAllInstances() { + ArrayList items = new ArrayList<>(); + items.add(new FertilizerItem("Fertilizer", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "fertilizer"))); + return items; + } + + protected FertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { + super(name, sprite); + } + + @Override + public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { + if (tile instanceof PlantTile) { + int fertilization = ((PlantTile) tile).getFertilization(level.getData(xt, yt)); + if (fertilization < 100) { // More fertilization, lower the buffer is applied. + ((PlantTile) tile).fertilize(level, xt, yt, 40); + } else if (fertilization < 200) { + ((PlantTile) tile).fertilize(level, xt, yt, 30); + } else if (fertilization < 300) { + ((PlantTile) tile).fertilize(level, xt, yt, 25); + } else if (fertilization < 400) { + ((PlantTile) tile).fertilize(level, xt, yt, 20); + } else { + ((PlantTile) tile).fertilize(level, xt, yt, 10); + } + + return super.interactOn(true); + } + + return false; + } + + @Override + public StackableItem clone() { + return new FertilizerItem(getName(), sprite); + } +} diff --git a/src/main/java/minicraft/item/FurnitureItem.java b/src/main/java/minicraft/item/FurnitureItem.java index 7ad4278af..7746cefb6 100644 --- a/src/main/java/minicraft/item/FurnitureItem.java +++ b/src/main/java/minicraft/item/FurnitureItem.java @@ -41,6 +41,7 @@ protected static ArrayList getAllInstances() { items.add(new FurnitureItem(new Tnt())); items.add(new FurnitureItem(new Bed())); + items.add(new FurnitureItem(new Compostor())); return items; } diff --git a/src/main/java/minicraft/item/Items.java b/src/main/java/minicraft/item/Items.java index 554f9fc32..38b7e4af5 100644 --- a/src/main/java/minicraft/item/Items.java +++ b/src/main/java/minicraft/item/Items.java @@ -45,6 +45,7 @@ private static void addAll(ArrayList items) { addAll(SummonItem.getAllInstances()); addAll(BoneMealItem.getAllInstances()); addAll(WateringTinItem.getAllInstances()); + addAll(FertilizerItem.getAllInstances()); } public static ArrayList getAll() { diff --git a/src/main/java/minicraft/item/Recipes.java b/src/main/java/minicraft/item/Recipes.java index 2c555f45a..1d58470e5 100644 --- a/src/main/java/minicraft/item/Recipes.java +++ b/src/main/java/minicraft/item/Recipes.java @@ -53,6 +53,7 @@ public class Recipes { workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); + workbenchRecipes.add(new Recipe("Bone Meal_3", "Bone_1")); workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); diff --git a/src/main/java/minicraft/item/WateringTinItem.java b/src/main/java/minicraft/item/WateringTinItem.java index 8548aecf7..12011a628 100644 --- a/src/main/java/minicraft/item/WateringTinItem.java +++ b/src/main/java/minicraft/item/WateringTinItem.java @@ -3,9 +3,13 @@ import minicraft.entity.Direction; import minicraft.entity.mob.Player; import minicraft.entity.particle.Particle; +import minicraft.gfx.Point; import minicraft.gfx.SpriteLinker; import minicraft.level.Level; +import minicraft.level.tile.DirtTile; +import minicraft.level.tile.GrassTile; import minicraft.level.tile.Tile; +import minicraft.level.tile.Tiles; import minicraft.level.tile.WaterTile; import minicraft.level.tile.farming.PlantTile; @@ -65,6 +69,23 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, if (fertilization < 150) { // Maximum of 5 levels watering tin can fertilize. ((PlantTile) tile).fertilize(level, xt, yt, 1); } + } else if (tile instanceof DirtTile) { + for (Tile t : level.getAreaTiles(xt, yt, 1)) { + if (t instanceof GrassTile) { // Grass tile exists. + if (new Random().nextInt(10) == 0) + level.setTile(xt, yt, Tiles.get("grass")); // Grass extends. + break; // Operation finished. + } + } + } else if (tile instanceof GrassTile) { + for (Point p : level.getAreaTilePositions(xt, yt, 1)) { + Tile t = level.getTile(p.x, p.y); + if (t instanceof DirtTile) { // Dirt tile exists. + if (new Random().nextInt(15) == 0) + level.setTile(p.x, p.y, Tiles.get("grass")); // Grass extends. + break; // Operation finished. + } + } } return true; diff --git a/src/main/java/minicraft/level/Level.java b/src/main/java/minicraft/level/Level.java index 8ae48b91e..f4854ed86 100644 --- a/src/main/java/minicraft/level/Level.java +++ b/src/main/java/minicraft/level/Level.java @@ -735,7 +735,7 @@ public Entity[] getEntitiesOfClass(Class targetClass) { } public Player[] getPlayers() { - return players.toArray(new Player[players.size()]); + return players.toArray(new Player[0]); } public Player getClosestPlayer(int x, int y) { @@ -776,7 +776,7 @@ public Tile[] getAreaTiles(int x, int y, int rx, int ry) { for (Point p: getAreaTilePositions(x, y, rx, ry)) local.add(getTile(p.x, p.y)); - return local.toArray(new Tile[local.size()]); + return local.toArray(new Tile[0]); } public void setAreaTiles(int xt, int yt, int r, Tile tile, int data) { setAreaTiles(xt, yt, r, tile, data, false); } diff --git a/src/main/java/minicraft/level/tile/farming/PlantTile.java b/src/main/java/minicraft/level/tile/farming/PlantTile.java index 8b0e3a936..0bef450eb 100644 --- a/src/main/java/minicraft/level/tile/farming/PlantTile.java +++ b/src/main/java/minicraft/level/tile/farming/PlantTile.java @@ -132,6 +132,8 @@ public void fertilize(Level level, int x, int y, int amount) { int fertilization = getFertilization(data); fertilization += amount; if (fertilization < 0) fertilization = 0; + if (fertilization > 511) fertilization = 511; // The maximum possible value to be reached. + // If this value exceeds 511, the final value would be greater than the hard maximum value that short can be. level.setData(x, y, (data & (0b111 + (maxStage << 3))) + (fertilization << (3 + (maxStage + 1)/2))); } diff --git a/src/main/resources/assets/textures/entity/compostor.png b/src/main/resources/assets/textures/entity/compostor.png new file mode 100644 index 0000000000000000000000000000000000000000..bc7225cd352c249c4f98fae2b045e5a58d8050a6 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G~10G|-o`56{@9%_zC91~&*?Ycq7l5b-%;p*0ta*Qga7$@o=dIzw!b^MMv(oH?8Xl8TRI8$(8vB+jetskD|BL7TZnX_)ze;#WruepRt;9+o`6wqJ> MPgg&ebxsLQ0AXZBdjJ3c literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/entity/compostor_filled.png b/src/main/resources/assets/textures/entity/compostor_filled.png new file mode 100644 index 0000000000000000000000000000000000000000..a81f933959b80167f964b8678778ad11224890f3 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}%0G|-o`56{@9%_zC9G?0Tna&b{-U5Nv5))z#f$}>TerW(H&XOR%;Qvs- z5bR$e1QIOph%9Dc;5!7ujG`J|4M4$APZ!4!jo_vIj(i6cI9SA89{$(Y%TYD+&7V8j zI!{3%u7*oSgCXNS%G}f0G|-o`56|T`VyJW5`o?V6JiY=l{kPhTYeq215)fIL4Lvi!GJ-^o7oL0 z#981GSoUi9S{^!1Ju1oL7^M}}LD;>mM zPxTilXLDh=;umnF!6zt#nLF%Ajk|Y~lu(CN?*_a4Zw*@Wy>Gg0_tu{N@YDGV`FfL| d7Z|^eV&BcrY%C#GeGzB{gQu&X%Q~loCIA?JOr8J$ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/item/compostor.png b/src/main/resources/assets/textures/item/compostor.png new file mode 100644 index 0000000000000000000000000000000000000000..7a95c51e2f1089c49ccc55cfcf82e71f988207d2 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`211o(uw&d;!LRN|NrYX}s`+orf5q^=~$FZloe{|pXVE588woCO|{#S9F5 zhe4R}c>anMprD4Qi(`mHcydA;lR`5i(+o+8Mut;~2@D$#F!?yJ2@5E=Gu{ XZe?(u>;3ZyP!EHrtDnm{r-UW|c;PV{ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/item/fertilizer.png b/src/main/resources/assets/textures/item/fertilizer.png new file mode 100644 index 0000000000000000000000000000000000000000..699e9a04dea1f998c9d99a3cbf0417bb9e0eb419 GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!5~i;#}JL+);>qR0}320*X8c$fB1j>BkP_m z8#<3|@two$RHpFAW%Z+X+n4bg2QL#66te0R4Ak||+HImLs${xX+WSJ}-aYqKZKx1KEh7IlfK+_pKUHx3vIVCg!0M)WOw*UYD literal 0 HcmV?d00001 From 68afc5dd26486a5080ff524c507de570ab849fb8 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 18 Feb 2023 14:16:29 +0800 Subject: [PATCH 009/261] Added an achievement for planting --- src/main/java/minicraft/item/TileItem.java | 9 +++++++-- src/main/java/minicraft/level/tile/DirtTile.java | 1 + src/main/java/minicraft/level/tile/GrassTile.java | 1 + src/main/resources/assets/localization/en-us.json | 2 ++ src/main/resources/resources/achievements.json | 5 +++++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index e5056c519..47887d504 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -15,6 +15,7 @@ import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; +import minicraft.screen.AchievementsDisplay; import org.tinylog.Logger; public class TileItem extends StackableItem { @@ -53,10 +54,14 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Cactus", new LinkedSprite(SpriteType.Item, "cactus"), new TileModel("cactus Sapling"), "sand")); items.add(new TileItem("Cloud", new LinkedSprite(SpriteType.Item, "cloud"), new TileModel("cloud"), "Infinite Fall")); - items.add(new TileItem("Wheat Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("wheat", TileModel.KEEP_DATA), "farmland")); + TileModel.TileDataGetter seedPlanting = (model1, target, level, xt, yt, player, attackDir) -> { + AchievementsDisplay.setAchievement("minicraft.achievement.plant_seed", true); + return TileModel.KEEP_DATA.getTileData(model1, target, level, xt, yt, player, attackDir); + }; + items.add(new TileItem("Wheat Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("wheat", seedPlanting), "farmland")); items.add(new TileItem("Potato", new LinkedSprite(SpriteType.Item, "potato"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Carrot", new LinkedSprite(SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); - items.add(new TileItem("Beetroot Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("beetroot", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Beetroot Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("beetroot", seedPlanting), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); // Creative mode available tiles: diff --git a/src/main/java/minicraft/level/tile/DirtTile.java b/src/main/java/minicraft/level/tile/DirtTile.java index 7293bc937..957518492 100644 --- a/src/main/java/minicraft/level/tile/DirtTile.java +++ b/src/main/java/minicraft/level/tile/DirtTile.java @@ -12,6 +12,7 @@ import minicraft.item.ToolItem; import minicraft.item.ToolType; import minicraft.level.Level; +import minicraft.screen.AchievementsDisplay; public class DirtTile extends Tile { private static SpriteAnimation[] levelSprite = new SpriteAnimation[] { diff --git a/src/main/java/minicraft/level/tile/GrassTile.java b/src/main/java/minicraft/level/tile/GrassTile.java index f382ed4db..d39246646 100644 --- a/src/main/java/minicraft/level/tile/GrassTile.java +++ b/src/main/java/minicraft/level/tile/GrassTile.java @@ -11,6 +11,7 @@ import minicraft.item.ToolItem; import minicraft.item.ToolType; import minicraft.level.Level; +import minicraft.screen.AchievementsDisplay; import java.util.AbstractMap; import java.util.ArrayList; diff --git a/src/main/resources/assets/localization/en-us.json b/src/main/resources/assets/localization/en-us.json index d214c0295..43a2a5982 100644 --- a/src/main/resources/assets/localization/en-us.json +++ b/src/main/resources/assets/localization/en-us.json @@ -31,6 +31,8 @@ "minicraft.achievement.airwizard.desc": "Defeat the first Air Wizard!", "minicraft.achievement.skin": "Fashion Show", "minicraft.achievement.skin.desc": "Change your skin.", + "minicraft.achievement.plant_seed": "A Seedy Place", + "minicraft.achievement.plant_seed.desc": "Plant a seed and watch it grow.", "minicraft.display.entries.boolean.false": "Off", "minicraft.display.entries.boolean.true": "On", "minicraft.display.gui.link_opening": "Opening with browser...", diff --git a/src/main/resources/resources/achievements.json b/src/main/resources/resources/achievements.json index 9eec082d7..7e0fd5135 100644 --- a/src/main/resources/resources/achievements.json +++ b/src/main/resources/resources/achievements.json @@ -73,5 +73,10 @@ "id": "minicraft.achievement.skin", "desc": "minicraft.achievement.skin.desc", "score": 10 + }, + { + "id": "minicraft.achievement.plant_seed", + "desc": "minicraft.achievement.plant_seed.desc", + "score": 20 } ] From 52b1e9ba56342a2e7e348b478e41a8a4336af033 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:15:22 +0800 Subject: [PATCH 010/261] Tweaked the color scheme for tall grasses --- .../assets/textures/tile/double_tall_grass.png | Bin 244 -> 244 bytes .../resources/assets/textures/tile/fern.png | Bin 234 -> 234 bytes .../assets/textures/tile/large_fern.png | Bin 248 -> 262 bytes .../assets/textures/tile/tall_grass.png | Bin 231 -> 230 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/textures/tile/double_tall_grass.png b/src/main/resources/assets/textures/tile/double_tall_grass.png index 9f99ffe5309acd9306377d15bd957130829bf8f2..fd0ed4f197b8f8ef0cabc7f031d3719cecab4742 100644 GIT binary patch delta 63 zcmeyu_=RzTn`!X8V85AuzJ0z73=EFl+jasemXaX9;Q#;sGdO6i`~u{27I;J!GcfQS P1YyP<6SLn=tgZwA(Ipm> delta 63 zcmeyu_=RzTn`y|(VE>tZE~U;43=FqPi5pfD||Y diff --git a/src/main/resources/assets/textures/tile/fern.png b/src/main/resources/assets/textures/tile/fern.png index e1013e27002fa8ee967da9ecbaa11d399a690149..67e5cb1b8f17a5eb244fe7af4eda25180e069503 100644 GIT binary patch delta 43 zcmaFG_=<6Yn{e>FV85AuzJ0zPogNGf41dy6vnEE$a2;e|;5*2;V`BE(iS^k4VB8RB delta 43 zcmaFG_=<6Yo3Q^(zmS!|ZjG)krOpft3`X;veI`cAa2;Y`;5)=9s^Qfzu|69BLP`zO diff --git a/src/main/resources/assets/textures/tile/large_fern.png b/src/main/resources/assets/textures/tile/large_fern.png index 84b6db1d081b915a4d5952b6337b0f2e74ac8865..f5edb4c5ca6dca562ee194728c49140b424741f0 100644 GIT binary patch delta 176 zcmV;h08jt;0fqvQMiWhrO-PAIPMJKq-0COV}1d&-Bf4~3$4!{9w)`?*@`&Bbe?(=p%C%2|WeKMb6W!FjLNCkKuk6>wYYp-6=j-D1I)bBYDd2j;Dv&*`C Q00000NkvXX1g=70f6IaTYd1nV85AuzJ0z73=EFl+jasemXaX9;Q#;sGdO6i`~u{27I;J!GcfQS z0%1l`4X*~EV6dl)V~9p@?-@p}0}4FO7tQwmpZi_7wC7;L!mwJ`?6{u|?Ejm!e(i0V zQ)HLWxz^G8x0u9M%Vvj_7xk>RHmJ|rEV<;tZE~U;43=FqXZ>bYgg9(_-f-Nn~k%?le93LZ-le TF3xp83m80I{an^LB{Ts5F5N*f From d1528a8139eeffe22015acca07eb40e0e65cd776 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 26 Feb 2023 10:49:43 +0800 Subject: [PATCH 011/261] Remove beetroot and add tomato --- .../java/minicraft/item/StackableItem.java | 2 +- src/main/java/minicraft/item/TileItem.java | 2 +- src/main/java/minicraft/level/tile/Tiles.java | 6 +-- .../level/tile/farming/BeetrootTile.java | 36 ------------------ .../level/tile/farming/TomatoTile.java | 32 ++++++++++++++++ .../assets/textures/item/beetroot.png | Bin 231 -> 0 bytes .../resources/assets/textures/item/tomato.png | Bin 0 -> 221 bytes .../assets/textures/tile/beetroot_stage2.png | Bin 187 -> 0 bytes .../assets/textures/tile/beetroot_stage3.png | Bin 223 -> 0 bytes ...{beetroot_stage0.png => tomato_stage0.png} | Bin ...{beetroot_stage1.png => tomato_stage1.png} | Bin .../assets/textures/tile/tomato_stage2.png | Bin 0 -> 163 bytes .../assets/textures/tile/tomato_stage3.png | Bin 0 -> 201 bytes 13 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644 src/main/java/minicraft/level/tile/farming/BeetrootTile.java create mode 100644 src/main/java/minicraft/level/tile/farming/TomatoTile.java delete mode 100644 src/main/resources/assets/textures/item/beetroot.png create mode 100644 src/main/resources/assets/textures/item/tomato.png delete mode 100644 src/main/resources/assets/textures/tile/beetroot_stage2.png delete mode 100644 src/main/resources/assets/textures/tile/beetroot_stage3.png rename src/main/resources/assets/textures/tile/{beetroot_stage0.png => tomato_stage0.png} (100%) rename src/main/resources/assets/textures/tile/{beetroot_stage1.png => tomato_stage1.png} (100%) create mode 100644 src/main/resources/assets/textures/tile/tomato_stage2.png create mode 100644 src/main/resources/assets/textures/tile/tomato_stage3.png diff --git a/src/main/java/minicraft/item/StackableItem.java b/src/main/java/minicraft/item/StackableItem.java index a7cee5e1b..821f35cb7 100644 --- a/src/main/java/minicraft/item/StackableItem.java +++ b/src/main/java/minicraft/item/StackableItem.java @@ -36,7 +36,7 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Shard", new LinkedSprite(SpriteType.Item, "shard"))); items.add(new StackableItem("Cloud Ore", new LinkedSprite(SpriteType.Item, "cloud_ore"))); items.add(new StackableItem("Glass Bottle", new LinkedSprite(SpriteType.Item, "glass_bottle"))); - items.add(new StackableItem("Beetroot", new LinkedSprite(SpriteType.Item, "beetroot"))); + items.add(new StackableItem("Tomato", new LinkedSprite(SpriteType.Item, "tomato"))); items.add(new StackableItem("Bone", new LinkedSprite(SpriteType.Item, "bone"))); return items; diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 47887d504..4a66e7c4d 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -61,7 +61,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Wheat Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("wheat", seedPlanting), "farmland")); items.add(new TileItem("Potato", new LinkedSprite(SpriteType.Item, "potato"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Carrot", new LinkedSprite(SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); - items.add(new TileItem("Beetroot Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("beetroot", seedPlanting), "farmland")); + items.add(new TileItem("Tomato Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("tomato", seedPlanting), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); // Creative mode available tiles: diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index e6b27fc7f..86487b2e6 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -4,7 +4,7 @@ import java.util.HashMap; import minicraft.core.CrashHandler; -import minicraft.level.tile.farming.BeetrootTile; +import minicraft.level.tile.farming.TomatoTile; import minicraft.level.tile.farming.CarrotTile; import minicraft.level.tile.farming.FarmTile; import minicraft.level.tile.farming.PotatoTile; @@ -79,7 +79,7 @@ public static void initTileList() { tiles.put((short)44, new MaterialTile(Tile.Material.Obsidian)); tiles.put((short)45, new DecorTile(Tile.Material.Stone)); tiles.put((short)46, new DecorTile(Tile.Material.Obsidian)); - tiles.put((short)53, new BeetrootTile("Beetroot")); + tiles.put((short)53, new TomatoTile("Tomato")); tiles.put((short)54, new CarrotTile("Carrot")); tiles.put((short)55, new TallGrassTile("Tall Grass", TallGrassTile.TallGrassType.GRASS)); tiles.put((short)56, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); @@ -96,7 +96,7 @@ public static void initTileList() { } - protected static void add(int id, Tile tile) { + static void add(int id, Tile tile) { tiles.put((short)id, tile); Logging.TILES.debug("Adding " + tile.name + " to tile list with id " + id); tile.id = (short) id; diff --git a/src/main/java/minicraft/level/tile/farming/BeetrootTile.java b/src/main/java/minicraft/level/tile/farming/BeetrootTile.java deleted file mode 100644 index 742a29754..000000000 --- a/src/main/java/minicraft/level/tile/farming/BeetrootTile.java +++ /dev/null @@ -1,36 +0,0 @@ -package minicraft.level.tile.farming; - -import minicraft.gfx.Screen; -import minicraft.gfx.SpriteLinker.LinkedSprite; -import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.level.Level; -import minicraft.level.tile.Tiles; - -public class BeetrootTile extends PlantTile { - private final LinkedSprite[] spritStages = new LinkedSprite[] { - new LinkedSprite(SpriteType.Tile, "beetroot_stage0"), - new LinkedSprite(SpriteType.Tile, "beetroot_stage1"), - new LinkedSprite(SpriteType.Tile, "beetroot_stage2"), - new LinkedSprite(SpriteType.Tile, "beetroot_stage3") - }; - - public BeetrootTile(String name) { - super(name, "beetroot seeds"); - maxStage = 3; - } - - @Override - public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxStage; - Tiles.get("Farmland").render(screen, level, x, y); - screen.render(x * 16, y * 16, spritStages[age]); - } - - @Override - public void performBonemeal(Level level, int x, int y) { - int data = level.getData(x, y); - int stage = (data >> 3) & maxStage; - if (stage < maxStage && random.nextInt(4) == 0) - level.setData(x, y, (data & ~(maxStage << 3)) + ((stage + 1) << 3)); - } -} diff --git a/src/main/java/minicraft/level/tile/farming/TomatoTile.java b/src/main/java/minicraft/level/tile/farming/TomatoTile.java new file mode 100644 index 000000000..8cec003aa --- /dev/null +++ b/src/main/java/minicraft/level/tile/farming/TomatoTile.java @@ -0,0 +1,32 @@ +package minicraft.level.tile.farming; + +import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker.LinkedSprite; +import minicraft.gfx.SpriteLinker.SpriteType; +import minicraft.level.Level; +import minicraft.level.tile.Tiles; + +public class TomatoTile extends PlantTile { + private final LinkedSprite[] spritStages = new LinkedSprite[] { + new LinkedSprite(SpriteType.Tile, "tomato_stage0"), + new LinkedSprite(SpriteType.Tile, "tomato_stage1"), + new LinkedSprite(SpriteType.Tile, "tomato_stage2"), + new LinkedSprite(SpriteType.Tile, "tomato_stage3") + }; + + public TomatoTile(String name) { + super(name, "tomato seeds"); + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + int age = (level.getData(x, y) >> 3) & maxStage; + Tiles.get("Farmland").render(screen, level, x, y); + int stage; + if (age < 2) stage = 0; + else if (age < 4) stage = 1; + else if (age < 7) stage = 2; + else stage = 3; + screen.render(x * 16, y * 16, spritStages[stage]); + } +} diff --git a/src/main/resources/assets/textures/item/beetroot.png b/src/main/resources/assets/textures/item/beetroot.png deleted file mode 100644 index b84c4241a6a6d7b7f095136732c44c575e940554..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`1E1o(uwPSDXW5aXJtt5Yb-9W5)iRL$_-*6rIp{FbTdPSnwxpsNE^XubT( z8X(0}666>B9|0JI?w>mc6z44Ph%9Dc;5!V$jK}j=qyPm?JY5_^B*IlsGjcH~a4|nr&iLo;{+r1_{S2P2 KelF{r5}E*(<4vRh diff --git a/src/main/resources/assets/textures/item/tomato.png b/src/main/resources/assets/textures/item/tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..3d5638a896f2e7acb8621123bfaf9e2337b6117d GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`1k1^9%xrnXsX_>1mV=A5|4{%f#VvMT$ZeOrDsW7I;J!GcfQS0%1l`4X*~EppmDGV~9k!Xt$#fgP{PU>xsVq^%d^n z3-u>3Sls4(pW144rlD%SO4H@Jr#3jAIa*ukS*QJt(PfSAiMc@C44$rjF6*2UngB!> BN!kDa literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/beetroot_stage2.png b/src/main/resources/assets/textures/tile/beetroot_stage2.png deleted file mode 100644 index 54b5cdc14f3ca1928619c7702fe6ae8cb5d3df84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!2nMe#}EtuZ7d|-1J?Uw?mIHreNrQi#i7Zcz dRYC#-1G9aSr~TVU+ks{?c)I$ztaD0e0sx((Ip_cY diff --git a/src/main/resources/assets/textures/tile/beetroot_stage3.png b/src/main/resources/assets/textures/tile/beetroot_stage3.png deleted file mode 100644 index 3040b6f4a6d0d527b43055ff9c8b7a339095b2ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+7j}0Cg8R|KT%o7wOHYuqAg|)6clLk_3B|(0{|3QFZ^Zq6Kfg+p* z9+AZi419+{nDKc2iWH!ri>HfYh(_?yzDC{y1{{Z(l>hIyDY&_XzfHhx;|i_av#q9x z?v_0@u`%XUrD~C8_|+5bcectnG)-f1Zp#1oZnshWkM>&TSF4$Kdb#i^0?lLaboFyt I=akR{0Lw#13IG5A diff --git a/src/main/resources/assets/textures/tile/beetroot_stage0.png b/src/main/resources/assets/textures/tile/tomato_stage0.png similarity index 100% rename from src/main/resources/assets/textures/tile/beetroot_stage0.png rename to src/main/resources/assets/textures/tile/tomato_stage0.png diff --git a/src/main/resources/assets/textures/tile/beetroot_stage1.png b/src/main/resources/assets/textures/tile/tomato_stage1.png similarity index 100% rename from src/main/resources/assets/textures/tile/beetroot_stage1.png rename to src/main/resources/assets/textures/tile/tomato_stage1.png diff --git a/src/main/resources/assets/textures/tile/tomato_stage2.png b/src/main/resources/assets/textures/tile/tomato_stage2.png new file mode 100644 index 0000000000000000000000000000000000000000..24e9904497c2bfe0165bb28fd5f9ac9878fb4834 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en(8ANjF~q_@d4bl48xKCpw=9g|Y4DxL={1?R zt&y=ufhqjJTaFu!Q~oG0-FPG^nJ`)2mz{Y&pM(TMoR|{#yU#nTfo3pxy85}Sb4q9e E0GVwqf&c&j literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/tomato_stage3.png b/src/main/resources/assets/textures/tile/tomato_stage3.png new file mode 100644 index 0000000000000000000000000000000000000000..80fbf4c2b24d62760b5d6c0c866b0d376627410e GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enFwWD(F~q_@d4bl99moIKb2#smXqaGgI4||w ze+8bWNenrkdIF?$R<1h2pLT!W_lXC;zAN7$!|`BJI#YK5cS5m}(E&C7vbN)F{A*^F rvAj|6suO6uSmMwq&SoHMV8FnTrVw|~>b`Rd&?W{?S3j3^P6 Date: Sun, 26 Feb 2023 11:11:26 +0800 Subject: [PATCH 012/261] Add Heaven Berry --- .../java/minicraft/item/FertilizerItem.java | 16 ++++----- src/main/java/minicraft/item/TileItem.java | 1 + .../java/minicraft/item/WateringTinItem.java | 8 ++--- src/main/java/minicraft/level/tile/Tiles.java | 2 ++ .../level/tile/farming/CarrotTile.java | 2 +- .../farming/{PlantTile.java => CropTile.java} | 4 +-- .../level/tile/farming/HeavenBerryTile.java | 31 ++++++++++++++++++ .../level/tile/farming/PotatoTile.java | 6 +--- .../level/tile/farming/TomatoTile.java | 2 +- .../level/tile/farming/WheatTile.java | 2 +- .../assets/textures/item/heaven_berry.png | Bin 0 -> 216 bytes .../textures/item/heaven_berry_stage0.png | Bin 0 -> 182 bytes .../textures/item/heaven_berry_stage1.png | Bin 0 -> 196 bytes .../textures/item/heaven_berry_stage2.png | Bin 0 -> 234 bytes .../textures/item/heaven_berry_stage3.png | Bin 0 -> 244 bytes 15 files changed, 52 insertions(+), 22 deletions(-) rename src/main/java/minicraft/level/tile/farming/{PlantTile.java => CropTile.java} (97%) create mode 100644 src/main/java/minicraft/level/tile/farming/HeavenBerryTile.java create mode 100644 src/main/resources/assets/textures/item/heaven_berry.png create mode 100644 src/main/resources/assets/textures/item/heaven_berry_stage0.png create mode 100644 src/main/resources/assets/textures/item/heaven_berry_stage1.png create mode 100644 src/main/resources/assets/textures/item/heaven_berry_stage2.png create mode 100644 src/main/resources/assets/textures/item/heaven_berry_stage3.png diff --git a/src/main/java/minicraft/item/FertilizerItem.java b/src/main/java/minicraft/item/FertilizerItem.java index 8bf985033..26aa28c9d 100644 --- a/src/main/java/minicraft/item/FertilizerItem.java +++ b/src/main/java/minicraft/item/FertilizerItem.java @@ -5,7 +5,7 @@ import minicraft.gfx.SpriteLinker; import minicraft.level.Level; import minicraft.level.tile.Tile; -import minicraft.level.tile.farming.PlantTile; +import minicraft.level.tile.farming.CropTile; import java.util.ArrayList; @@ -22,18 +22,18 @@ protected FertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { @Override public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (tile instanceof PlantTile) { - int fertilization = ((PlantTile) tile).getFertilization(level.getData(xt, yt)); + if (tile instanceof CropTile) { + int fertilization = ((CropTile) tile).getFertilization(level.getData(xt, yt)); if (fertilization < 100) { // More fertilization, lower the buffer is applied. - ((PlantTile) tile).fertilize(level, xt, yt, 40); + ((CropTile) tile).fertilize(level, xt, yt, 40); } else if (fertilization < 200) { - ((PlantTile) tile).fertilize(level, xt, yt, 30); + ((CropTile) tile).fertilize(level, xt, yt, 30); } else if (fertilization < 300) { - ((PlantTile) tile).fertilize(level, xt, yt, 25); + ((CropTile) tile).fertilize(level, xt, yt, 25); } else if (fertilization < 400) { - ((PlantTile) tile).fertilize(level, xt, yt, 20); + ((CropTile) tile).fertilize(level, xt, yt, 20); } else { - ((PlantTile) tile).fertilize(level, xt, yt, 10); + ((CropTile) tile).fertilize(level, xt, yt, 10); } return super.interactOn(true); diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 4a66e7c4d..23d1c2389 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -62,6 +62,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Potato", new LinkedSprite(SpriteType.Item, "potato"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Carrot", new LinkedSprite(SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Tomato Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("tomato", seedPlanting), "farmland")); + items.add(new TileItem("Heaven Berry", new LinkedSprite(SpriteType.Item, "heaven_berry"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); // Creative mode available tiles: diff --git a/src/main/java/minicraft/item/WateringTinItem.java b/src/main/java/minicraft/item/WateringTinItem.java index 12011a628..9f27f5251 100644 --- a/src/main/java/minicraft/item/WateringTinItem.java +++ b/src/main/java/minicraft/item/WateringTinItem.java @@ -11,7 +11,7 @@ import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.level.tile.WaterTile; -import minicraft.level.tile.farming.PlantTile; +import minicraft.level.tile.farming.CropTile; import java.util.ArrayList; import java.util.Random; @@ -64,10 +64,10 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, renderingTick = 0; } } - if (tile instanceof PlantTile) { - int fertilization = ((PlantTile) tile).getFertilization(level.getData(xt, yt)); + if (tile instanceof CropTile) { + int fertilization = ((CropTile) tile).getFertilization(level.getData(xt, yt)); if (fertilization < 150) { // Maximum of 5 levels watering tin can fertilize. - ((PlantTile) tile).fertilize(level, xt, yt, 1); + ((CropTile) tile).fertilize(level, xt, yt, 1); } } else if (tile instanceof DirtTile) { for (Tile t : level.getAreaTiles(xt, yt, 1)) { diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index 86487b2e6..d2720db49 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -4,6 +4,7 @@ import java.util.HashMap; import minicraft.core.CrashHandler; +import minicraft.level.tile.farming.HeavenBerryTile; import minicraft.level.tile.farming.TomatoTile; import minicraft.level.tile.farming.CarrotTile; import minicraft.level.tile.farming.FarmTile; @@ -85,6 +86,7 @@ public static void initTileList() { tiles.put((short)56, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); tiles.put((short)57, new TallGrassTile("Fern", TallGrassTile.TallGrassType.FERN)); tiles.put((short)58, new TallGrassTile("Large Fern", TallGrassTile.TallGrassType.LARGE_FERN)); + tiles.put((short)59, new HeavenBerryTile("Heaven Berry")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/main/java/minicraft/level/tile/farming/CarrotTile.java b/src/main/java/minicraft/level/tile/farming/CarrotTile.java index 9f24fd04a..e8707d26c 100644 --- a/src/main/java/minicraft/level/tile/farming/CarrotTile.java +++ b/src/main/java/minicraft/level/tile/farming/CarrotTile.java @@ -6,7 +6,7 @@ import minicraft.level.Level; import minicraft.level.tile.Tiles; -public class CarrotTile extends PlantTile { +public class CarrotTile extends CropTile { private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "carrot_stage0"), new LinkedSprite(SpriteType.Tile, "carrot_stage1"), diff --git a/src/main/java/minicraft/level/tile/farming/PlantTile.java b/src/main/java/minicraft/level/tile/farming/CropTile.java similarity index 97% rename from src/main/java/minicraft/level/tile/farming/PlantTile.java rename to src/main/java/minicraft/level/tile/farming/CropTile.java index 0bef450eb..0db4ee9e3 100644 --- a/src/main/java/minicraft/level/tile/farming/PlantTile.java +++ b/src/main/java/minicraft/level/tile/farming/CropTile.java @@ -15,12 +15,12 @@ import java.util.Arrays; -public class PlantTile extends FarmTile implements BonemealableTile { +public class CropTile extends FarmTile implements BonemealableTile { protected final @Nullable String seed; protected int maxStage = 7; // Must be a bit mask. - protected PlantTile(String name, @Nullable String seed) { + protected CropTile(String name, @Nullable String seed) { super(name, null); this.seed = seed; } diff --git a/src/main/java/minicraft/level/tile/farming/HeavenBerryTile.java b/src/main/java/minicraft/level/tile/farming/HeavenBerryTile.java new file mode 100644 index 000000000..c5603c761 --- /dev/null +++ b/src/main/java/minicraft/level/tile/farming/HeavenBerryTile.java @@ -0,0 +1,31 @@ +package minicraft.level.tile.farming; + +import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker; +import minicraft.level.Level; +import minicraft.level.tile.Tiles; + +public class HeavenBerryTile extends CropTile { + private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[] { + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage0"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage1"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage2"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage3") + }; + + public HeavenBerryTile(String name) { + super(name, null); + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + int age = (level.getData(x, y) >> 3) & maxStage; + Tiles.get("Farmland").render(screen, level, x, y); + int stage; + if (age < 2) stage = 0; + else if (age < 4) stage = 1; + else if (age < 7) stage = 2; + else stage = 3; + screen.render(x * 16, y * 16, spritStages[stage]); + } +} diff --git a/src/main/java/minicraft/level/tile/farming/PotatoTile.java b/src/main/java/minicraft/level/tile/farming/PotatoTile.java index 0c673d19a..a147bea89 100644 --- a/src/main/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/main/java/minicraft/level/tile/farming/PotatoTile.java @@ -1,16 +1,12 @@ package minicraft.level.tile.farming; -import minicraft.core.io.Sound; -import minicraft.entity.Entity; -import minicraft.entity.mob.Player; import minicraft.gfx.Screen; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.item.Items; import minicraft.level.Level; import minicraft.level.tile.Tiles; -public class PotatoTile extends PlantTile { +public class PotatoTile extends CropTile { private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "potato_stage0"), new LinkedSprite(SpriteType.Tile, "potato_stage1"), diff --git a/src/main/java/minicraft/level/tile/farming/TomatoTile.java b/src/main/java/minicraft/level/tile/farming/TomatoTile.java index 8cec003aa..0ee9ce92a 100644 --- a/src/main/java/minicraft/level/tile/farming/TomatoTile.java +++ b/src/main/java/minicraft/level/tile/farming/TomatoTile.java @@ -6,7 +6,7 @@ import minicraft.level.Level; import minicraft.level.tile.Tiles; -public class TomatoTile extends PlantTile { +public class TomatoTile extends CropTile { private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "tomato_stage0"), new LinkedSprite(SpriteType.Tile, "tomato_stage1"), diff --git a/src/main/java/minicraft/level/tile/farming/WheatTile.java b/src/main/java/minicraft/level/tile/farming/WheatTile.java index 88e6d220d..25b7ed742 100644 --- a/src/main/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/main/java/minicraft/level/tile/farming/WheatTile.java @@ -6,7 +6,7 @@ import minicraft.level.Level; import minicraft.level.tile.Tiles; -public class WheatTile extends PlantTile { +public class WheatTile extends CropTile { private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "wheat_stage0"), new LinkedSprite(SpriteType.Tile, "wheat_stage1"), diff --git a/src/main/resources/assets/textures/item/heaven_berry.png b/src/main/resources/assets/textures/item/heaven_berry.png new file mode 100644 index 0000000000000000000000000000000000000000..268bbfcd34eddd9f3c48ec10ff2f706bb95df277 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`032l#}zYKO=c1j!yguD>@!^y4(QACIyox=8Iy7YEAAHe0g*DbA80zu^B+ zz!2lBSEK+14Lw~PLnOj=Po3msaNuEbD3<)azCv}4JiFj8 vO9l%U7NJ#I{++Kf<OiCOK)Fe}^+t%sSlIdjh1G zXKbInIKv{cQfPIQnno|vhMR4tStEEASQAVW+z;^aJWmon%sGLXZzk^|cgCxX%*+fc XQso$QwzbP0l+XkKsjM(! literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/item/heaven_berry_stage1.png b/src/main/resources/assets/textures/item/heaven_berry_stage1.png new file mode 100644 index 0000000000000000000000000000000000000000..451d6308bf9d60b41778412c695ab355d2523933 GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0G|+7j}0E??dCw9L7g2)5pzk9U-19`4A)Qb0@X5b7I;J!GcfQS24TkI z`72U@f~KA>jv*Ss$q7!(DclAI21Z5>GZQ9psxYKFYN)xnX)w2QDafleIWu%G4Dc3Y gDsb4uAS}%A^(f={$F&!$fd(*my85}Sb4q9e0CvGJtpET3 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/item/heaven_berry_stage2.png b/src/main/resources/assets/textures/item/heaven_berry_stage2.png new file mode 100644 index 0000000000000000000000000000000000000000..630098f8be0477806f31414828483d5da13919a2 GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G~10G|+7!%c=Cr@5K8n|o~V0E)H8C9MTgtR+Ey!T*7P;rBK^kU^XU9+AZi z419+{nDKc2iWHz=u&0Y-h(>U0Paxj`0}iLPMgNWYSCpRKlu~2zfr~Bf7n`GHpc(hf zmlaZHX6`PP3uXJD9r0)rW3O93XV%LVosKWlrka~8OnTorp_qB$T=t%S3NS%G|^0G|+7!%c=Cr@8%jlx5y-?y-~RLe^fL!mL7q1g6*IZ@Ynvt| z@&3v<&46>3rTHwkW3~1q@*se|ZJE e_8(kp&oGDcAM+ns)i^hxB@CXfelF{r5}E*kc2oQS literal 0 HcmV?d00001 From 93c959d1fdd2bbf54e4a5bad24df190f161a0a17 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 26 Feb 2023 11:16:54 +0800 Subject: [PATCH 013/261] Rename Heavenly Berries --- src/main/java/minicraft/item/TileItem.java | 2 +- src/main/java/minicraft/level/tile/Tiles.java | 4 ++-- ...eavenBerryTile.java => HeavenlyBerriesTile.java} | 12 ++++++------ .../item/{heaven_berry.png => heavenly_berries.png} | Bin .../heavenly_berries_stage0.png} | Bin .../heavenly_berries_stage1.png} | Bin .../heavenly_berries_stage2.png} | Bin .../heavenly_berries_stage3.png} | Bin 8 files changed, 9 insertions(+), 9 deletions(-) rename src/main/java/minicraft/level/tile/farming/{HeavenBerryTile.java => HeavenlyBerriesTile.java} (82%) rename src/main/resources/assets/textures/item/{heaven_berry.png => heavenly_berries.png} (100%) rename src/main/resources/assets/textures/{item/heaven_berry_stage0.png => tile/heavenly_berries_stage0.png} (100%) rename src/main/resources/assets/textures/{item/heaven_berry_stage1.png => tile/heavenly_berries_stage1.png} (100%) rename src/main/resources/assets/textures/{item/heaven_berry_stage2.png => tile/heavenly_berries_stage2.png} (100%) rename src/main/resources/assets/textures/{item/heaven_berry_stage3.png => tile/heavenly_berries_stage3.png} (100%) diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 23d1c2389..d7d851b77 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -62,7 +62,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Potato", new LinkedSprite(SpriteType.Item, "potato"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Carrot", new LinkedSprite(SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Tomato Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("tomato", seedPlanting), "farmland")); - items.add(new TileItem("Heaven Berry", new LinkedSprite(SpriteType.Item, "heaven_berry"), new TileModel("potato", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Heavenly Berries", new LinkedSprite(SpriteType.Item, "heavenly_berries"), new TileModel("heavenly berries", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); // Creative mode available tiles: diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index d2720db49..822d0ef9f 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -4,7 +4,7 @@ import java.util.HashMap; import minicraft.core.CrashHandler; -import minicraft.level.tile.farming.HeavenBerryTile; +import minicraft.level.tile.farming.HeavenlyBerriesTile; import minicraft.level.tile.farming.TomatoTile; import minicraft.level.tile.farming.CarrotTile; import minicraft.level.tile.farming.FarmTile; @@ -86,7 +86,7 @@ public static void initTileList() { tiles.put((short)56, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); tiles.put((short)57, new TallGrassTile("Fern", TallGrassTile.TallGrassType.FERN)); tiles.put((short)58, new TallGrassTile("Large Fern", TallGrassTile.TallGrassType.LARGE_FERN)); - tiles.put((short)59, new HeavenBerryTile("Heaven Berry")); + tiles.put((short)59, new HeavenlyBerriesTile("Heavenly Berries")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/main/java/minicraft/level/tile/farming/HeavenBerryTile.java b/src/main/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java similarity index 82% rename from src/main/java/minicraft/level/tile/farming/HeavenBerryTile.java rename to src/main/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java index c5603c761..40495d3b9 100644 --- a/src/main/java/minicraft/level/tile/farming/HeavenBerryTile.java +++ b/src/main/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java @@ -5,15 +5,15 @@ import minicraft.level.Level; import minicraft.level.tile.Tiles; -public class HeavenBerryTile extends CropTile { +public class HeavenlyBerriesTile extends CropTile { private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[] { - new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage0"), - new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage1"), - new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage2"), - new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heaven_berry_stage3") + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage0"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage1"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage2"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage3") }; - public HeavenBerryTile(String name) { + public HeavenlyBerriesTile(String name) { super(name, null); } diff --git a/src/main/resources/assets/textures/item/heaven_berry.png b/src/main/resources/assets/textures/item/heavenly_berries.png similarity index 100% rename from src/main/resources/assets/textures/item/heaven_berry.png rename to src/main/resources/assets/textures/item/heavenly_berries.png diff --git a/src/main/resources/assets/textures/item/heaven_berry_stage0.png b/src/main/resources/assets/textures/tile/heavenly_berries_stage0.png similarity index 100% rename from src/main/resources/assets/textures/item/heaven_berry_stage0.png rename to src/main/resources/assets/textures/tile/heavenly_berries_stage0.png diff --git a/src/main/resources/assets/textures/item/heaven_berry_stage1.png b/src/main/resources/assets/textures/tile/heavenly_berries_stage1.png similarity index 100% rename from src/main/resources/assets/textures/item/heaven_berry_stage1.png rename to src/main/resources/assets/textures/tile/heavenly_berries_stage1.png diff --git a/src/main/resources/assets/textures/item/heaven_berry_stage2.png b/src/main/resources/assets/textures/tile/heavenly_berries_stage2.png similarity index 100% rename from src/main/resources/assets/textures/item/heaven_berry_stage2.png rename to src/main/resources/assets/textures/tile/heavenly_berries_stage2.png diff --git a/src/main/resources/assets/textures/item/heaven_berry_stage3.png b/src/main/resources/assets/textures/tile/heavenly_berries_stage3.png similarity index 100% rename from src/main/resources/assets/textures/item/heaven_berry_stage3.png rename to src/main/resources/assets/textures/tile/heavenly_berries_stage3.png From 9464e28f54c162a2c2446edd0d2b1aed6b6c6975 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 26 Feb 2023 11:28:43 +0800 Subject: [PATCH 014/261] Resolve errors --- src/main/java/minicraft/item/TileItem.java | 1 + src/main/java/minicraft/level/LevelGen.java | 14 ++------------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 26dd2dec1..e4002d935 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -15,6 +15,7 @@ import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; +import minicraft.screen.AchievementsDisplay; import minicraft.util.AdvancementElement; import org.tinylog.Logger; diff --git a/src/main/java/minicraft/level/LevelGen.java b/src/main/java/minicraft/level/LevelGen.java index d93f62d30..2b10efb78 100644 --- a/src/main/java/minicraft/level/LevelGen.java +++ b/src/main/java/minicraft/level/LevelGen.java @@ -2,9 +2,11 @@ import minicraft.core.Game; import minicraft.core.io.Settings; +import minicraft.gfx.Rectangle; import minicraft.level.tile.TallGrassTile; import minicraft.level.tile.Tiles; import minicraft.level.tile.TreeTile; +import minicraft.screen.RelPos; import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; @@ -17,18 +19,6 @@ import java.util.Random; import java.util.function.BiFunction; -import javax.swing.ImageIcon; -import javax.swing.JOptionPane; - -import minicraft.gfx.Rectangle; -import minicraft.screen.RelPos; -import org.jetbrains.annotations.Nullable; -import org.tinylog.Logger; - -import minicraft.core.Game; -import minicraft.core.io.Settings; -import minicraft.level.tile.Tiles; - public class LevelGen { private static long worldSeed = 0; private static final Random random = new Random(worldSeed); From b681bcb812299412888507bf3ae7ff9620323f48 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 26 Feb 2023 11:40:20 +0800 Subject: [PATCH 015/261] Add Hellish Berries --- src/main/java/minicraft/item/TileItem.java | 1 + src/main/java/minicraft/level/tile/Tiles.java | 2 ++ .../tile/farming/HellishBerriesTile.java | 31 ++++++++++++++++++ .../assets/textures/item/hellish_berries.png | Bin 0 -> 220 bytes .../textures/tile/hellish_berries_stage0.png | Bin 0 -> 182 bytes .../textures/tile/hellish_berries_stage1.png | Bin 0 -> 190 bytes .../textures/tile/hellish_berries_stage2.png | Bin 0 -> 217 bytes .../textures/tile/hellish_berries_stage3.png | Bin 0 -> 233 bytes 8 files changed, 34 insertions(+) create mode 100644 src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java create mode 100644 src/main/resources/assets/textures/item/hellish_berries.png create mode 100644 src/main/resources/assets/textures/tile/hellish_berries_stage0.png create mode 100644 src/main/resources/assets/textures/tile/hellish_berries_stage1.png create mode 100644 src/main/resources/assets/textures/tile/hellish_berries_stage2.png create mode 100644 src/main/resources/assets/textures/tile/hellish_berries_stage3.png diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index e4002d935..c23fed156 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -64,6 +64,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Carrot", new LinkedSprite(SpriteType.Item, "carrot"), new TileModel("carrot", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Tomato Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("tomato", seedPlanting), "farmland")); items.add(new TileItem("Heavenly Berries", new LinkedSprite(SpriteType.Item, "heavenly_berries"), new TileModel("heavenly berries", TileModel.KEEP_DATA), "farmland")); + items.add(new TileItem("Hellish Berries", new LinkedSprite(SpriteType.Item, "hellish_berries"), new TileModel("hellish berries", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); // Creative mode available tiles: diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index be6774809..6287bbbe8 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -5,6 +5,7 @@ import minicraft.core.CrashHandler; import minicraft.level.tile.farming.HeavenlyBerriesTile; +import minicraft.level.tile.farming.HellishBerriesTile; import minicraft.level.tile.farming.TomatoTile; import minicraft.level.tile.farming.CarrotTile; import minicraft.level.tile.farming.FarmTile; @@ -90,6 +91,7 @@ public static void initTileList() { tiles.put((short)60, new TallGrassTile("Fern", TallGrassTile.TallGrassType.FERN)); tiles.put((short)61, new TallGrassTile("Large Fern", TallGrassTile.TallGrassType.LARGE_FERN)); tiles.put((short)62, new HeavenlyBerriesTile("Heavenly Berries")); + tiles.put((short)63, new HellishBerriesTile("Hellish Berries")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java b/src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java new file mode 100644 index 000000000..b227e6b3e --- /dev/null +++ b/src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java @@ -0,0 +1,31 @@ +package minicraft.level.tile.farming; + +import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker; +import minicraft.level.Level; +import minicraft.level.tile.Tiles; + +public class HellishBerriesTile extends CropTile { + private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[] { + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage0"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage1"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage2"), + new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage3") + }; + + public HellishBerriesTile(String name) { + super(name, null); + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + int age = (level.getData(x, y) >> 3) & maxStage; + Tiles.get("Farmland").render(screen, level, x, y); + int stage; + if (age < 2) stage = 0; + else if (age < 4) stage = 1; + else if (age < 7) stage = 2; + else stage = 3; + screen.render(x * 16, y * 16, spritStages[stage]); + } +} diff --git a/src/main/resources/assets/textures/item/hellish_berries.png b/src/main/resources/assets/textures/item/hellish_berries.png new file mode 100644 index 0000000000000000000000000000000000000000..ecdb5b3e990e893c022c436ca8c91d5871e4194a GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`1k1^9%x%33H{@bPOT+Golux{8S2cdJ{<&d|iosu^SeR8s$l*$zl?l?3?( z|AzsFO=on@14TItJR*x382Ao@Fyrz36)8YLLr)jS5Q%Wz(+33^6nK~%O*$^s9~L_P zdxQLg`^*i;JcOircGjA{}WA&q+J#>yJ_?? znh3oOG`TaQUSM^Unno|vhMR4tStEEASQAVieC({2ICoU7O;~|l2B^NDX%#aY8-uWt W_>L=K`Kmx;89ZJ6T-G@yGywprt}xaB literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/textures/tile/hellish_berries_stage1.png b/src/main/resources/assets/textures/tile/hellish_berries_stage1.png new file mode 100644 index 0000000000000000000000000000000000000000..25af95129cc7d559adf9f36ecbfb41b67c78e0e3 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!C+4p#}EtuWC>QDo&YJ<43%5|*)K9>>o@$A zZ{j`hrS~Vh;T2=YOpyj(MKi;u15N$^?KzxxMlgnnPhcvr;=cP#c)ndysP{(h4@^mi e5<~)cBqSJqwu+qgeHj399fPNNS%G|>0G|+73qF30MEfRgkieT3H6xI^k|4j}|Ns9pIB2c>0_1ZRctjR6Fz_7) zVaDV6D^h@hZk{fVAsWF;yB&oX6gZev|Nnn3u%-F>49#+}-k6OY3@plgy$e`hd)T=x za$wZqixQ{}n)>R|znK09i}NS%G~10G|+7jYNA3KK>?d)}`z~AqJC!CRc$JYe|q_@P8m+_`Qt}WDsY8M`SSr z1K(i~W;~w1A_XWIi?Ouy)UxPT3+MVWO`9ed#Xy2>W^=i zgEk~5?6zh=*-B7DQZN4F7-d40n4wv)a39 S4opDP89ZJ6T-G@yGywpv@ Date: Mon, 27 Feb 2023 10:35:17 +0800 Subject: [PATCH 016/261] Update hellish_berries.png --- .../assets/textures/item/hellish_berries.png | Bin 220 -> 226 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/textures/item/hellish_berries.png b/src/main/resources/assets/textures/item/hellish_berries.png index ecdb5b3e990e893c022c436ca8c91d5871e4194a..cfd64b963a7ba7a9c63d0bf63ca38df9351f868c 100644 GIT binary patch delta 169 zcmcb^_=s_WW4&U4Pl&6Kwm3h#9JiIMs*slqkFBhQl9S|QBZ)K#UOfeObp{3o(}O=d zffRR1kYDhBIAHMdXZ!>d<}C1tEM{QfI|Ravq8eTeKtW?q7sn8ZaNW~}LI(_Zm>iQt z7JvB9&R$u=dz;}t9|O<4En+^??khD!XYs4B$$RlUyE=Dkz11qlr4H2-3etf1rBc)#HU=_XX3$F#Krn_7Em{Xr>mdKI;Vst E0I;Sx`~Uy| From c58cebce5bc63940b21f195a0c37c60d4c309ce8 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 4 Mar 2023 13:02:36 +0800 Subject: [PATCH 017/261] Resolved wording mistakes Spelling mistakes for "composter" ("compostor") and wording for "watering can" ("watering tin") --- src/main/java/minicraft/core/Renderer.java | 8 ++++---- .../furniture/{Compostor.java => Composter.java} | 14 +++++++------- src/main/java/minicraft/item/FurnitureItem.java | 2 +- src/main/java/minicraft/item/Items.java | 6 +++--- .../{WateringTinItem.java => WateringCanItem.java} | 10 +++++----- 5 files changed, 20 insertions(+), 20 deletions(-) rename src/main/java/minicraft/entity/furniture/{Compostor.java => Composter.java} (92%) rename src/main/java/minicraft/item/{WateringTinItem.java => WateringCanItem.java} (94%) diff --git a/src/main/java/minicraft/core/Renderer.java b/src/main/java/minicraft/core/Renderer.java index dcecf1d4a..e6dac4d91 100644 --- a/src/main/java/minicraft/core/Renderer.java +++ b/src/main/java/minicraft/core/Renderer.java @@ -23,7 +23,7 @@ import minicraft.item.PotionType; import minicraft.item.ToolItem; import minicraft.item.ToolType; -import minicraft.item.WateringTinItem; +import minicraft.item.WateringCanItem; import minicraft.level.Level; import minicraft.screen.LoadingDisplay; import minicraft.screen.Menu; @@ -340,10 +340,10 @@ private static void renderGui() { Font.drawBackground(dura + "%", screen, 164, Screen.h - 16, Color.get(1, 255 - green, green, 0)); } - // WATERING TIN CONTAINER STATUS - if (player.activeItem instanceof WateringTinItem) { + // WATERING CAN CONTAINER STATUS + if (player.activeItem instanceof WateringCanItem) { // Draws the text - WateringTinItem tin = (WateringTinItem) player.activeItem; + WateringCanItem tin = (WateringCanItem) player.activeItem; int dura = tin.content * 100 / tin.CAPACITY; int green = (int)(dura * 2.55f); // Let duration show as normal. Font.drawBackground(dura + "%", screen, 164, Screen.h - 16, Color.get(1, 255 - green, green, 0)); diff --git a/src/main/java/minicraft/entity/furniture/Compostor.java b/src/main/java/minicraft/entity/furniture/Composter.java similarity index 92% rename from src/main/java/minicraft/entity/furniture/Compostor.java rename to src/main/java/minicraft/entity/furniture/Composter.java index d88f82cef..7bd498102 100644 --- a/src/main/java/minicraft/entity/furniture/Compostor.java +++ b/src/main/java/minicraft/entity/furniture/Composter.java @@ -9,17 +9,17 @@ import minicraft.item.StackableItem; import org.jetbrains.annotations.Nullable; -public class Compostor extends Furniture { - private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "compostor"); - private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "compostor_filled"); - private static final SpriteLinker.LinkedSprite spriteFull = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "compostor_full"); - private static final SpriteLinker.LinkedSprite itemSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "compostor"); +public class Composter extends Furniture { + private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "composter"); + private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "composter_filled"); + private static final SpriteLinker.LinkedSprite spriteFull = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "composter_full"); + private static final SpriteLinker.LinkedSprite itemSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "composter"); private static final int MAX_COMPOST = 7; private int compost = 0; - public Compostor() { - super("Compostor", sprite, itemSprite); + public Composter() { + super("Composter", sprite, itemSprite); } @Override diff --git a/src/main/java/minicraft/item/FurnitureItem.java b/src/main/java/minicraft/item/FurnitureItem.java index b5a6f26c2..ebc53e3e3 100644 --- a/src/main/java/minicraft/item/FurnitureItem.java +++ b/src/main/java/minicraft/item/FurnitureItem.java @@ -40,7 +40,7 @@ protected static ArrayList getAllInstances() { items.add(new FurnitureItem(new Tnt())); items.add(new FurnitureItem(new Bed())); - items.add(new FurnitureItem(new Compostor())); + items.add(new FurnitureItem(new Composter())); return items; } diff --git a/src/main/java/minicraft/item/Items.java b/src/main/java/minicraft/item/Items.java index b62526755..14949c1f9 100644 --- a/src/main/java/minicraft/item/Items.java +++ b/src/main/java/minicraft/item/Items.java @@ -45,7 +45,7 @@ private static void addAll(ArrayList items) { addAll(SummonItem.getAllInstances()); addAll(HeartItem.getAllInstances()); addAll(BoneMealItem.getAllInstances()); - addAll(WateringTinItem.getAllInstances()); + addAll(WateringCanItem.getAllInstances()); addAll(FertilizerItem.getAllInstances()); } @@ -110,8 +110,8 @@ public static Item get(String name, boolean allowNull) { ((StackableItem)i).count = data; if (i instanceof ToolItem && hadUnderscore) ((ToolItem)i).dur = data; - if (i instanceof WateringTinItem) - ((WateringTinItem) i).content = data; + if (i instanceof WateringCanItem) + ((WateringCanItem) i).content = data; return i; } else { Logging.ITEMS.error("Requested invalid item with name: '{}'", name); diff --git a/src/main/java/minicraft/item/WateringTinItem.java b/src/main/java/minicraft/item/WateringCanItem.java similarity index 94% rename from src/main/java/minicraft/item/WateringTinItem.java rename to src/main/java/minicraft/item/WateringCanItem.java index 9f27f5251..ce78aec55 100644 --- a/src/main/java/minicraft/item/WateringTinItem.java +++ b/src/main/java/minicraft/item/WateringCanItem.java @@ -16,10 +16,10 @@ import java.util.ArrayList; import java.util.Random; -public class WateringTinItem extends Item { +public class WateringCanItem extends Item { protected static ArrayList getAllInstances() { ArrayList items = new ArrayList<>(); - items.add(new WateringTinItem("Watering Tin")); + items.add(new WateringCanItem("Watering Can")); return items; } @@ -37,7 +37,7 @@ protected static ArrayList getAllInstances() { public int content = 0; private int renderingTick = 0; - protected WateringTinItem(String name) { + protected WateringCanItem(String name) { super(name, sprite); } @@ -66,7 +66,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } if (tile instanceof CropTile) { int fertilization = ((CropTile) tile).getFertilization(level.getData(xt, yt)); - if (fertilization < 150) { // Maximum of 5 levels watering tin can fertilize. + if (fertilization < 150) { // Maximum of 5 levels watering can can fertilize. ((CropTile) tile).fertilize(level, xt, yt, 1); } } else if (tile instanceof DirtTile) { @@ -105,7 +105,7 @@ public String getData() { @Override public Item clone() { - return new WateringTinItem(getName()); + return new WateringCanItem(getName()); } private static class WaterParticle extends Particle { From 59b021f129306eca701b9dd8a29678ac56c20237 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 5 Mar 2023 00:51:53 +0800 Subject: [PATCH 018/261] Rewriting the way of handling tree sorts --- src/main/java/minicraft/level/Level.java | 34 +++++++++++++++++ src/main/java/minicraft/level/LevelGen.java | 38 +++---------------- src/main/java/minicraft/level/tile/Tiles.java | 25 +++++------- .../java/minicraft/level/tile/TreeTile.java | 18 +++------ 4 files changed, 55 insertions(+), 60 deletions(-) diff --git a/src/main/java/minicraft/level/Level.java b/src/main/java/minicraft/level/Level.java index 36fb8ae15..e2196b0e4 100644 --- a/src/main/java/minicraft/level/Level.java +++ b/src/main/java/minicraft/level/Level.java @@ -18,6 +18,7 @@ import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.level.tile.TorchTile; +import minicraft.level.tile.TreeTile; import minicraft.util.Logging; import java.util.*; @@ -39,6 +40,8 @@ public class Level { public short[] tiles; // An array of all the tiles in the world. public short[] data; // An array of the data of the tiles in the world. + public TreeTile.TreeType[] treeTypes; // An array of tree types + public final int depth; // Depth level of the level public int monsterDensity = 16; // Affects the number of monsters that are on the level, bigger the number the less monsters spawn. public int maxMobCount; @@ -133,6 +136,37 @@ public Level(int w, int h, long seed, int level, Level parentLevel, boolean make tiles = maps[0]; // Assigns the tiles in the map data = maps[1]; // Assigns the data of the tiles + treeTypes = new TreeTile.TreeType[w * h]; + { + LevelGen noise1 = new LevelGen(w, h, 32); + LevelGen noise2 = new LevelGen(w, h, 32); + TreeTile.TreeType[] types = TreeTile.TreeType.values(); + for (int y = 0; y < h; y++) { // Loop through height + for (int x = 0; x < w; x++) { // Loop through width + // Randomly selecting a tree type. + int i = x + y * w; + double val = Math.abs(noise1.values[i] - noise2.values[i]) * 3 - 2; + // This calculates a sort of distance based on the current coordinate. + double xd = x / (w - 1.0) * 2 - 1; + double yd = y / (h - 1.0) * 2 - 1; + if (xd < 0) xd = -xd; + if (yd < 0) yd = -yd; + double dist = Math.max(xd, yd); + dist = dist * dist * dist * dist; + dist = dist * dist * dist * dist; + val += 1 - dist*20; + val += 1.5; // Assuming the range of value is from 0 to 2. + val *= types.length / 2.0; + val += 1; // Incrementing index. + // The original val mainly falls in small interval instead of averagely. + val = 1.0/(3 * types.length) * Math.pow(val - 5, 2); // Quadratically bloating the value. + int idx = (int) Math.round(val - 1); // Decrementing index. + treeTypes[x + y * w] = (idx >= types.length || idx < 0) ? TreeTile.TreeType.OAK // Oak by default. + : types[idx]; + } + } + } + if (level < 0) generateSpawnerStructures(); diff --git a/src/main/java/minicraft/level/LevelGen.java b/src/main/java/minicraft/level/LevelGen.java index 2b10efb78..ca63ba029 100644 --- a/src/main/java/minicraft/level/LevelGen.java +++ b/src/main/java/minicraft/level/LevelGen.java @@ -148,7 +148,7 @@ private static short[][] createAndValidateTopMap(int w, int h) { if (count[Tiles.get("rock").id & 0xffff] < 100) continue; if (count[Tiles.get("sand").id & 0xffff] < 100) continue; if (count[Tiles.get("grass").id & 0xffff] < 100) continue; - if (TreeTile.treeIDs.stream().map(id -> count[id & 0xffff]).reduce(0, Integer::sum) < 100) continue; + if (count[Tiles.get("tree").id & 0xffff] < 100) continue; if (count[Tiles.get("Stairs Down").id & 0xffff] < w / 21) continue; // Size 128 = 6 stairs min @@ -359,32 +359,6 @@ private static short[][] createTopMap(int w, int h) { // Create surface map } } - BiFunction treeRandom; - { - List treeIDs = TreeTile.treeIDs; - treeRandom = (x, y) -> { // Randomly selecting a tree type. - int i = x + y * w; - double val = Math.abs(noise1.values[i] - noise2.values[i]) * 3 - 2; - // This calculates a sort of distance based on the current coordinate. - double xd = x / (w - 1.0) * 2 - 1; - double yd = y / (h - 1.0) * 2 - 1; - if (xd < 0) xd = -xd; - if (yd < 0) yd = -yd; - double dist = Math.max(xd, yd); - dist = dist * dist * dist * dist; - dist = dist * dist * dist * dist; - val += 1 - dist*20; - val += 1.5; // Assuming the range of value is from 0 to 2. - val *= treeIDs.size() / 2.0; - val += 1; // Incrementing index. - // The original val mainly falls in small interval instead of averagely. - val = 1.0/(3 * treeIDs.size()) * Math.pow(val - 5, 2); // Quadratically bloating the value. - int idx = (int) Math.round(val - 1); // Decrementing index. - if (idx >= treeIDs.size() || idx < 0) return (short) 8; // Oak in default. - return treeIDs.get(idx); - }; - } - if (Settings.get("Theme").equals("minicraft.settings.theme.forest")) { for (int i = 0; i < w * h / 200; i++) { int x = random.nextInt(w); @@ -394,7 +368,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.apply(xx, yy); + map[xx + yy * w] = Tiles.get("tree").id; } } } @@ -409,7 +383,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.apply(xx, yy); + map[xx + yy * w] = Tiles.get("tree").id; } } } @@ -425,7 +399,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.apply(xx, yy); + map[xx + yy * w] = Tiles.get("tree").id; } } } @@ -440,7 +414,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map int yy = y + random.nextInt(15) - random.nextInt(15); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = treeRandom.apply(xx, yy); + map[xx + yy * w] = Tiles.get("tree").id; } } } @@ -849,7 +823,7 @@ public static void main(String[] args) { if (map[i] == Tiles.get("dirt").id) pixels[i] = 0x604040; if (map[i] == Tiles.get("sand").id) pixels[i] = 0xa0a040; if (map[i] == Tiles.get("Stone Bricks").id) pixels[i] = 0xa0a040; - if (TreeTile.treeIDs.stream().anyMatch(id -> map[i] == id)) pixels[i] = 0x003000; + if (map[i] == Tiles.get("tree").id) pixels[i] = 0x003000; if (map[i] == Tiles.get("Obsidian Wall").id) pixels[i] = 0x0aa0a0; if (map[i] == Tiles.get("Obsidian").id) pixels[i] = 0x000000; if (map[i] == Tiles.get("lava").id) pixels[i] = 0xffff2020; diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index 6287bbbe8..47df0e353 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -35,14 +35,7 @@ public static void initTileList() { tiles.put((short)17, new LavaTile("Lava")); tiles.put((short)7, new RockTile("Rock")); - tiles.put((short)8, new TreeTile(TreeTile.TreeType.OAK)); - // These are out of order because of the multiple tree types. - tiles.put((short)50, new TreeTile(TreeTile.TreeType.SPRUCE)); - tiles.put((short)51, new TreeTile(TreeTile.TreeType.BIRCH)); - tiles.put((short)52, new TreeTile(TreeTile.TreeType.ASH)); - tiles.put((short)53, new TreeTile(TreeTile.TreeType.ASPEN)); - tiles.put((short)54, new TreeTile(TreeTile.TreeType.FIR)); - tiles.put((short)55, new TreeTile(TreeTile.TreeType.WILLOW)); + tiles.put((short)8, new TreeTile("Tree")); tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Oak"))); tiles.put((short)10, new SandTile("Sand")); @@ -84,14 +77,14 @@ public static void initTileList() { tiles.put((short)47, new BossWallTile()); tiles.put((short)48, new BossFloorTile()); tiles.put((short)49, new BossDoorTile()); - tiles.put((short)56, new TomatoTile("Tomato")); - tiles.put((short)57, new CarrotTile("Carrot")); - tiles.put((short)58, new TallGrassTile("Tall Grass", TallGrassTile.TallGrassType.GRASS)); - tiles.put((short)59, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); - tiles.put((short)60, new TallGrassTile("Fern", TallGrassTile.TallGrassType.FERN)); - tiles.put((short)61, new TallGrassTile("Large Fern", TallGrassTile.TallGrassType.LARGE_FERN)); - tiles.put((short)62, new HeavenlyBerriesTile("Heavenly Berries")); - tiles.put((short)63, new HellishBerriesTile("Hellish Berries")); + tiles.put((short)50, new TomatoTile("Tomato")); + tiles.put((short)51, new CarrotTile("Carrot")); + tiles.put((short)52, new TallGrassTile("Tall Grass", TallGrassTile.TallGrassType.GRASS)); + tiles.put((short)53, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); + tiles.put((short)54, new TallGrassTile("Fern", TallGrassTile.TallGrassType.FERN)); + tiles.put((short)55, new TallGrassTile("Large Fern", TallGrassTile.TallGrassType.LARGE_FERN)); + tiles.put((short)56, new HeavenlyBerriesTile("Heavenly Berries")); + tiles.put((short)57, new HellishBerriesTile("Hellish Berries")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/main/java/minicraft/level/tile/TreeTile.java b/src/main/java/minicraft/level/tile/TreeTile.java index 2f30b3f1d..115f28a46 100644 --- a/src/main/java/minicraft/level/tile/TreeTile.java +++ b/src/main/java/minicraft/level/tile/TreeTile.java @@ -25,6 +25,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Random; public class TreeTile extends Tile { private static final LinkedSprite oakSprite = new LinkedSprite(SpriteType.Tile, "oak"); @@ -42,11 +43,6 @@ public class TreeTile extends Tile { private static final LinkedSprite willowSprite = new LinkedSprite(SpriteType.Tile, "willow"); private static final LinkedSprite willowSpriteFull = new LinkedSprite(SpriteType.Tile, "willow_full"); - private final TreeType type; - - public static final List treeIDs = Collections.unmodifiableList(Arrays.asList( - (short) 8, (short) 47, (short) 48, (short) 49, (short) 50, (short) 51, (short) 52)); - public enum TreeType { OAK(oakSprite, oakSpriteFull), SPRUCE(spruceSprite, spruceSpriteFull), @@ -54,8 +50,7 @@ public enum TreeType { ASH(ashSprite, ashSpriteFull), ASPEN(aspenSprite, aspenSpriteFull), FIR(firSprite, firSpriteFull), - WILLOW(willowSprite, willowSpriteFull), - ; + WILLOW(willowSprite, willowSpriteFull); private final LinkedSprite treeSprite; private final LinkedSprite treeSpriteFull; @@ -66,9 +61,8 @@ public enum TreeType { } } - protected TreeTile(TreeType type) { - super(type.name().toLowerCase(), null); - this.type = type; + protected TreeTile(String name) { + super(name, null); connectsToGrass = true; } @@ -84,8 +78,8 @@ public void render(Screen screen, Level level, int x, int y) { boolean dl = level.getTile(x - 1, y + 1) == this; boolean dr = level.getTile(x + 1, y + 1) == this; - Sprite sprite = type.treeSprite.getSprite(); - Sprite spriteFull = type.treeSpriteFull.getSprite(); + Sprite sprite = level.treeTypes[x + y * level.w].treeSprite.getSprite(); + Sprite spriteFull = level.treeTypes[x + y * level.w].treeSpriteFull.getSprite(); if (u && ul && l) { screen.render(x * 16, y * 16, spriteFull.spritePixels[0][1]); From 073f8c59adb9d730dc97187e3e4872428009c5e1 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:04:13 +0800 Subject: [PATCH 019/261] Sheep and cow graze with tall grass --- src/main/java/minicraft/entity/mob/Cow.java | 4 +++- src/main/java/minicraft/entity/mob/Sheep.java | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/minicraft/entity/mob/Cow.java b/src/main/java/minicraft/entity/mob/Cow.java index f7acb4078..2a8df907a 100644 --- a/src/main/java/minicraft/entity/mob/Cow.java +++ b/src/main/java/minicraft/entity/mob/Cow.java @@ -4,6 +4,7 @@ import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.item.Items; import minicraft.level.tile.GrassTile; +import minicraft.level.tile.TallGrassTile; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; @@ -33,9 +34,10 @@ public void tick() { super.tick(); if (random.nextInt(1000) == 0) { // Grazing without any benefits. Tile tile = level.getTile(x >> 4, y >> 4); - // If tall grasses are present, these are consumed and then turn into grass tiles. if (tile instanceof GrassTile) { level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); + } else if (tile instanceof TallGrassTile) { + level.setTile(x >> 4, y >> 4, Tiles.get("grass")); } } } diff --git a/src/main/java/minicraft/entity/mob/Sheep.java b/src/main/java/minicraft/entity/mob/Sheep.java index 80e56eca3..3c26c2475 100644 --- a/src/main/java/minicraft/entity/mob/Sheep.java +++ b/src/main/java/minicraft/entity/mob/Sheep.java @@ -10,6 +10,7 @@ import minicraft.item.ToolItem; import minicraft.item.ToolType; import minicraft.level.tile.GrassTile; +import minicraft.level.tile.TallGrassTile; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import org.jetbrains.annotations.Nullable; @@ -46,12 +47,16 @@ public void render(Screen screen) { public void tick() { super.tick(); Tile tile = level.getTile(x >> 4, y >> 4); - // If tall grasses are present, these are consumed and then turn into grass tiles. if (tile instanceof GrassTile) { if (random.nextInt(1000) == 0) { // Grazing level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); cut = false; } + } else if (tile instanceof TallGrassTile) { + if (random.nextInt(1000) == 0) { // Grazing + level.setTile(x >> 4, y >> 4, Tiles.get("grass")); + cut = false; + } } } From fa1f483cfa3f88a616bf753dbf76cab83e2e00cd Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 13 Apr 2023 20:56:58 +0800 Subject: [PATCH 020/261] Fix tree rendering and oak tree removal problem --- src/main/java/minicraft/level/tile/Tiles.java | 2 +- .../java/minicraft/level/tile/TreeTile.java | 17 +++++++++-------- src/main/java/minicraft/saveload/Load.java | 2 -- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index 47df0e353..cdbcf6d59 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -37,7 +37,7 @@ public static void initTileList() { tiles.put((short)7, new RockTile("Rock")); tiles.put((short)8, new TreeTile("Tree")); - tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Oak"))); + tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Tree"))); tiles.put((short)10, new SandTile("Sand")); tiles.put((short)11, new CactusTile("Cactus")); tiles.put((short)12, new SaplingTile("Cactus Sapling", Tiles.get("Sand"), Tiles.get("Cactus"))); diff --git a/src/main/java/minicraft/level/tile/TreeTile.java b/src/main/java/minicraft/level/tile/TreeTile.java index 115f28a46..20af19435 100644 --- a/src/main/java/minicraft/level/tile/TreeTile.java +++ b/src/main/java/minicraft/level/tile/TreeTile.java @@ -69,14 +69,15 @@ protected TreeTile(String name) { public void render(Screen screen, Level level, int x, int y) { Tiles.get("Grass").render(screen, level, x, y); - boolean u = level.getTile(x, y - 1) == this; - boolean l = level.getTile(x - 1, y) == this; - boolean r = level.getTile(x + 1, y) == this; - boolean d = level.getTile(x, y + 1) == this; - boolean ul = level.getTile(x - 1, y - 1) == this; - boolean ur = level.getTile(x + 1, y - 1) == this; - boolean dl = level.getTile(x - 1, y + 1) == this; - boolean dr = level.getTile(x + 1, y + 1) == this; + TreeType thisType = level.treeTypes[x + y * level.w]; + boolean u = level.getTile(x, y - 1) == this && thisType == level.treeTypes[x + (y - 1) * level.w]; + boolean l = level.getTile(x - 1, y) == this && thisType == level.treeTypes[(x - 1) + y * level.w]; + boolean r = level.getTile(x + 1, y) == this && thisType == level.treeTypes[(x + 1) + y * level.w]; + boolean d = level.getTile(x, y + 1) == this && thisType == level.treeTypes[x + (y + 1) * level.w]; + boolean ul = level.getTile(x - 1, y - 1) == this && thisType == level.treeTypes[(x - 1) + (y - 1) * level.w]; + boolean ur = level.getTile(x + 1, y - 1) == this && thisType == level.treeTypes[(x + 1) + (y - 1) * level.w]; + boolean dl = level.getTile(x - 1, y + 1) == this && thisType == level.treeTypes[(x - 1) + (y + 1) * level.w]; + boolean dr = level.getTile(x + 1, y + 1) == this && thisType == level.treeTypes[(x + 1) + (y + 1) * level.w]; Sprite sprite = level.treeTypes[x + y * level.w].treeSprite.getSprite(); Sprite spriteFull = level.treeTypes[x + y * level.w].treeSpriteFull.getSprite(); diff --git a/src/main/java/minicraft/saveload/Load.java b/src/main/java/minicraft/saveload/Load.java index 4cd6c656a..c7ac4f40e 100644 --- a/src/main/java/minicraft/saveload/Load.java +++ b/src/main/java/minicraft/saveload/Load.java @@ -650,8 +650,6 @@ private void loadWorld(String filename) { } } } - } else if (tilename.equalsIgnoreCase("Tree")) { - tilename = "Oak"; } tiles[tileArrIdx] = Tiles.get(tilename).id; From 0f11e3883f6dc291ac0178866488b1a394096e0b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 13 Apr 2023 21:38:05 +0800 Subject: [PATCH 021/261] Resolve errors --- .../minicraft/entity/furniture/Composter.java | 2 +- .../java/minicraft/item/FurnitureItem.java | 1 + .../java/minicraft/item/WateringCanItem.java | 3 +- src/main/java/minicraft/level/Level.java | 49 ++++++++++--------- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/main/java/minicraft/entity/furniture/Composter.java b/src/main/java/minicraft/entity/furniture/Composter.java index 7bd498102..617036f24 100644 --- a/src/main/java/minicraft/entity/furniture/Composter.java +++ b/src/main/java/minicraft/entity/furniture/Composter.java @@ -26,7 +26,7 @@ public Composter() { public boolean interact(Player player, @Nullable Item item, Direction attackDir) { if (compost == MAX_COMPOST) { compost = 0; - FertilizerItem i = (FertilizerItem) Items.get("Fertilizer").clone(); + FertilizerItem i = (FertilizerItem) Items.get("Fertilizer").copy(); i.count = 1; player.getLevel().dropItem(x, y, i); refreshStatus(); diff --git a/src/main/java/minicraft/item/FurnitureItem.java b/src/main/java/minicraft/item/FurnitureItem.java index 794fe8628..878459cdc 100644 --- a/src/main/java/minicraft/item/FurnitureItem.java +++ b/src/main/java/minicraft/item/FurnitureItem.java @@ -5,6 +5,7 @@ import minicraft.entity.Direction; import minicraft.entity.furniture.Bed; import minicraft.entity.furniture.Chest; +import minicraft.entity.furniture.Composter; import minicraft.entity.furniture.Crafter; import minicraft.entity.furniture.DungeonChest; import minicraft.entity.furniture.Furniture; diff --git a/src/main/java/minicraft/item/WateringCanItem.java b/src/main/java/minicraft/item/WateringCanItem.java index ce78aec55..2e58476fb 100644 --- a/src/main/java/minicraft/item/WateringCanItem.java +++ b/src/main/java/minicraft/item/WateringCanItem.java @@ -12,6 +12,7 @@ import minicraft.level.tile.Tiles; import minicraft.level.tile.WaterTile; import minicraft.level.tile.farming.CropTile; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Random; @@ -104,7 +105,7 @@ public String getData() { } @Override - public Item clone() { + public @NotNull Item copy() { return new WateringCanItem(getName()); } diff --git a/src/main/java/minicraft/level/Level.java b/src/main/java/minicraft/level/Level.java index 53441a3e2..195cead97 100644 --- a/src/main/java/minicraft/level/Level.java +++ b/src/main/java/minicraft/level/Level.java @@ -61,7 +61,7 @@ public class Level { public short[] tiles; // An array of all the tiles in the world. public short[] data; // An array of the data of the tiles in the world. - public TreeTile.TreeType[] treeTypes; // An array of tree types + public final TreeTile.TreeType[] treeTypes; // An array of tree types public final int depth; // Depth level of the level public int monsterDensity = 16; // Affects the number of monsters that are on the level, bigger the number the less monsters spawn. @@ -134,29 +134,6 @@ public Level(int w, int h, long seed, int level, Level parentLevel, boolean make random = new Random(seed); short[][] maps; // Multidimensional array (an array within a array), used for the map - if (level != -4 && level != 0) - monsterDensity = 8; - - updateMobCap(); - - if(!makeWorld) { - int arrsize = w * h; - tiles = new short[arrsize]; - data = new short[arrsize]; - return; - } - - Logging.WORLD.debug("Making level " + level + "..."); - - maps = LevelGen.createAndValidateMap(w, h, level, seed); - if (maps == null) { - Logging.WORLD.error("Level generation: Returned maps array is null"); - return; - } - - tiles = maps[0]; // Assigns the tiles in the map - data = maps[1]; // Assigns the data of the tiles - treeTypes = new TreeTile.TreeType[w * h]; { LevelGen noise1 = new LevelGen(w, h, 32); @@ -188,6 +165,30 @@ public Level(int w, int h, long seed, int level, Level parentLevel, boolean make } } + if (level != -4 && level != 0) + monsterDensity = 8; + + updateMobCap(); + + if(!makeWorld) { + int arrsize = w * h; + tiles = new short[arrsize]; + data = new short[arrsize]; + return; + } + + Logging.WORLD.debug("Making level " + level + "..."); + + maps = LevelGen.createAndValidateMap(w, h, level, seed); + if (maps == null) { + Logging.WORLD.error("Level generation: Returned maps array is null"); + return; + } + + tiles = maps[0]; // Assigns the tiles in the map + data = maps[1]; // Assigns the data of the tiles + + if (level < 0) generateSpawnerStructures(); From 4ed1c45597468595cd19af3b61833165b39d03a8 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 13 Apr 2023 22:00:10 +0800 Subject: [PATCH 022/261] Update TallGrassTile.java --- src/main/java/minicraft/level/tile/TallGrassTile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/minicraft/level/tile/TallGrassTile.java b/src/main/java/minicraft/level/tile/TallGrassTile.java index 38110a654..7b231eb68 100644 --- a/src/main/java/minicraft/level/tile/TallGrassTile.java +++ b/src/main/java/minicraft/level/tile/TallGrassTile.java @@ -32,7 +32,7 @@ public enum TallGrassType { } public static final List grassIDs = Collections.unmodifiableList(Arrays.asList( - (short) 55, (short) 56, (short) 57, (short) 58)); + (short) 52, (short) 53, (short) 54, (short) 55)); protected TallGrassTile(String name, TallGrassType type) { super(name, type.sprite); From 24e24c3e33d8b5eea755c3941692451005bac688 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 15 Apr 2023 00:45:50 +0800 Subject: [PATCH 023/261] Renaming compostor.png to composter.png --- .../entity/{compostor.png => composter.png} | Bin .../textures/item/{compostor.png => composter.png} | Bin 2 files changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/assets/textures/entity/{compostor.png => composter.png} (100%) rename src/main/resources/assets/textures/item/{compostor.png => composter.png} (100%) diff --git a/src/main/resources/assets/textures/entity/compostor.png b/src/main/resources/assets/textures/entity/composter.png similarity index 100% rename from src/main/resources/assets/textures/entity/compostor.png rename to src/main/resources/assets/textures/entity/composter.png diff --git a/src/main/resources/assets/textures/item/compostor.png b/src/main/resources/assets/textures/item/composter.png similarity index 100% rename from src/main/resources/assets/textures/item/compostor.png rename to src/main/resources/assets/textures/item/composter.png From aa345035148e2c118dba059d75df1d2af2d90f4f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 21 May 2023 12:31:18 +0800 Subject: [PATCH 024/261] Update Composter.java Remove non-existed beetroot usages --- src/main/java/minicraft/entity/furniture/Composter.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/minicraft/entity/furniture/Composter.java b/src/main/java/minicraft/entity/furniture/Composter.java index 617036f24..d164dcdc0 100644 --- a/src/main/java/minicraft/entity/furniture/Composter.java +++ b/src/main/java/minicraft/entity/furniture/Composter.java @@ -40,9 +40,8 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) refreshStatus(); return true; } else if (item.getName().equalsIgnoreCase("Wheat") || item.getName().equalsIgnoreCase("Rose") || - item.getName().equalsIgnoreCase("Beetroot") || item.getName().equalsIgnoreCase("Flower") || - item.getName().equalsIgnoreCase("Apple") || item.getName().equalsIgnoreCase("Potato") || - item.getName().equalsIgnoreCase("Carrot")) { + item.getName().equalsIgnoreCase("Flower") || item.getName().equalsIgnoreCase("Apple") || + item.getName().equalsIgnoreCase("Potato") || item.getName().equalsIgnoreCase("Carrot")) { if (random.nextInt(4) != 0) { // 75% compost++; ((StackableItem) item).count--; @@ -50,8 +49,7 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) return true; } } else if (item.getName().equalsIgnoreCase("Acorn") || item.getName().equalsIgnoreCase("Cactus") || - item.getName().equalsIgnoreCase("Wheat Seeds") || item.getName().equalsIgnoreCase("Beetroot Seeds") || - item.getName().equalsIgnoreCase("Grass Seeds")) { + item.getName().equalsIgnoreCase("Wheat Seeds") || item.getName().equalsIgnoreCase("Grass Seeds")) { if (random.nextInt(3) != 0) { // 66.7% compost++; ((StackableItem) item).count--; From e6ca665e19787211fa805cc25a532da1eac3692f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 21 May 2023 12:33:42 +0800 Subject: [PATCH 025/261] Add watering can recipe --- src/main/java/minicraft/item/Recipes.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/minicraft/item/Recipes.java b/src/main/java/minicraft/item/Recipes.java index f5b4b64b2..1dc7c3905 100644 --- a/src/main/java/minicraft/item/Recipes.java +++ b/src/main/java/minicraft/item/Recipes.java @@ -110,6 +110,7 @@ public class Recipes { anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); + anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); From 015203c17921b41c9f04033094b3db52690cb79b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 21 May 2023 12:37:50 +0800 Subject: [PATCH 026/261] Fix hellish berries tile color --- .../textures/tile/hellish_berries_stage2.png | Bin 217 -> 217 bytes .../textures/tile/hellish_berries_stage3.png | Bin 233 -> 233 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/textures/tile/hellish_berries_stage2.png b/src/main/resources/assets/textures/tile/hellish_berries_stage2.png index 4ce5d911ebc1ca43e877c944092f60274c425d2f..e755934474415b71dc7860c8a60191116ee97c53 100644 GIT binary patch delta 57 zcmcb~c$0C0kG_#a8Uq8vkGTy$fD}tfkYDis|Nj{rv{rrr@;M7UB8wRq_zrysg53j0_my_gV1_lPX>pMPAjFjOz#K6FJh*4C-t6^e&769U!3-JH| delta 37 scmaFK_>ysg4{sAU>r!?GATT*-a&=;)4A)@>2EN0L$MaXDOsvlW0Nb4mTL1t6 From fe7498f75435e7870adbc2ae59b876f8884c1544 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 21 May 2023 13:17:00 +0800 Subject: [PATCH 027/261] Modify composter texture --- .../assets/textures/entity/composter.png | Bin 228 -> 210 bytes .../assets/textures/entity/compostor_filled.png | Bin 252 -> 237 bytes .../assets/textures/entity/compostor_full.png | Bin 246 -> 235 bytes .../assets/textures/item/composter.png | Bin 187 -> 187 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/textures/entity/composter.png b/src/main/resources/assets/textures/entity/composter.png index bc7225cd352c249c4f98fae2b045e5a58d8050a6..7a97ee3de05de4675b9f0b97bb23cae6a7256a0a 100644 GIT binary patch delta 117 zcmaFDc!_a>4{uATeww2S0|UeKOA{_mjFgEz#K6FJh*4C-s{trz?djqeq7j^&;K=O4 zWuU+i(amdKI;Vst0QN&6>i_@% delta 135 zcmV;20C@k>0ptOYObtOI2#{Sd0002U5pHLZSsZV}000id0mpBsWB>pFO-V#SR47xW zk3kZ^AP56v;QwzfNu@fDx9-WT5eMYKRbXKOjHZmlU}FJr-dDkbUjy+rJi{|-5utMw pvq38ONjDV!HR?A7voGgeGao6W0ubR-ei{G(002ovPDHLkV1n|SF{c0k diff --git a/src/main/resources/assets/textures/entity/compostor_filled.png b/src/main/resources/assets/textures/entity/compostor_filled.png index a81f933959b80167f964b8678778ad11224890f3..0b230a9dfd8c66a3f738526a25f6073a5583af5c 100644 GIT binary patch delta 180 zcmeyv_?B^kW4&B}Pl)UM42wJuwU$u*G&99=MfI6k_HuzL>Mq)8jw%cc46o0sWdbR# zk|4j}|1iL?>5R^KpeSd7M`SSr1K&XqX529``z=t=$kUz-p8 z)z=Z6n34LhWM7U`ON<=zAs&z0TsLp(GHFbWS~*wh#-U@|5|%$boHUpBmsQh$)efFd XVXVR-S{_@0#xZ!h`njxgN@xNA%>fk11C39*I@3=BIMerW(H&XOR% z;Qvs-5bR$e1QIOph%9Dc;5!7ujG`J|4M4$APZ!4!jo_vIj(i6cI9SA89{$(Y%TYD+ z&7V8jI!{3%u7*oSgCXceiv*=82Ons;8mJ(;&6?7^A5 mkRR7i3*cJU0*PzFy|KbLh*2~7a8ia^`| delta 189 zcmaFO_>FObW4&mAPl)UM3=2oUi9S{^!1Ju1oL7^M}}L zD;>mMPxTilXLDh=;umnF!6zt#nLF%Ajk}q5lax@0RqqD7{BI3f^Sy7nZTHrm{_xZJ i3;BAJpBEUvj$+@<&ulCqR(%m@2ZN`ppUXO@geCw*PehRb diff --git a/src/main/resources/assets/textures/item/composter.png b/src/main/resources/assets/textures/item/composter.png index 7a95c51e2f1089c49ccc55cfcf82e71f988207d2..9ba7a47e9cb1f43f3cecc2776d4485caa4dc7ae2 100644 GIT binary patch delta 60 zcmdnZxSMf;r%{@t%7j=$1_p+E@m8roilrpTFZloe{|pXVE588woCO|{#S9F5hd`K7 LRKu%bVzmPRIrtJe delta 60 zcmdnZxSMf;r;(!)$Anlz1_p+_ZHoJW6iZ2vU-19`{}~*#R(=8UISV`@iy0XB4ude` L@%$Aj6RRBnG$0c` From 013766287ce53abcd9fd52d4b5afd49bbca411d3 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 22 May 2023 18:44:41 +0800 Subject: [PATCH 028/261] Added arcane fertilizer To replace the mechanics of bonemeals --- ...ealItem.java => ArcaneFertilizerItem.java} | 21 +++++++------- .../java/minicraft/item/FertilizerItem.java | 3 +- src/main/java/minicraft/item/Items.java | 2 +- src/main/java/minicraft/item/Recipes.java | 5 ++-- .../java/minicraft/item/StackableItem.java | 1 + .../level/tile/BonemealableTile.java | 20 -------------- .../level/tile/BoostablePlantTile.java | 20 ++++++++++++++ .../java/minicraft/level/tile/GrassTile.java | 26 +++++++++--------- .../minicraft/level/tile/SaplingTile.java | 8 +++--- .../level/tile/farming/CropTile.java | 10 +++---- .../textures/item/arcane_fertilizer.png | Bin 0 -> 207 bytes 11 files changed, 60 insertions(+), 56 deletions(-) rename src/main/java/minicraft/item/{BoneMealItem.java => ArcaneFertilizerItem.java} (59%) delete mode 100644 src/main/java/minicraft/level/tile/BonemealableTile.java create mode 100644 src/main/java/minicraft/level/tile/BoostablePlantTile.java create mode 100644 src/main/resources/assets/textures/item/arcane_fertilizer.png diff --git a/src/main/java/minicraft/item/BoneMealItem.java b/src/main/java/minicraft/item/ArcaneFertilizerItem.java similarity index 59% rename from src/main/java/minicraft/item/BoneMealItem.java rename to src/main/java/minicraft/item/ArcaneFertilizerItem.java index 6aa9f15af..b99ff7b76 100644 --- a/src/main/java/minicraft/item/BoneMealItem.java +++ b/src/main/java/minicraft/item/ArcaneFertilizerItem.java @@ -5,20 +5,21 @@ import minicraft.entity.particle.Particle; import minicraft.gfx.SpriteLinker; import minicraft.level.Level; -import minicraft.level.tile.BonemealableTile; +import minicraft.level.tile.BoostablePlantTile; import minicraft.level.tile.Tile; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Random; -public class BoneMealItem extends StackableItem { +public class ArcaneFertilizerItem extends StackableItem { public static ArrayList getAllInstances() { ArrayList items = new ArrayList<>(); - items.add(new BoneMealItem("Bone Meal", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "bone_meal"))); + items.add(new ArcaneFertilizerItem("Arcane Fertilizer", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "arcane_fertilizer"))); return items; } - protected BoneMealItem(String name, SpriteLinker.LinkedSprite sprite) { + protected ArcaneFertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { super(name, sprite); } @@ -26,10 +27,10 @@ protected BoneMealItem(String name, SpriteLinker.LinkedSprite sprite) { @Override public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (tile instanceof BonemealableTile) { - if (((BonemealableTile) tile).isValidBonemealTarget(level, xt, yt)) { - if (((BonemealableTile) tile).isBonemealSuccess(level, xt, yt)) { - ((BonemealableTile) tile).performBonemeal(level, xt, yt); + if (tile instanceof BoostablePlantTile) { + if (((BoostablePlantTile) tile).isValidBoostablePlantTarget(level, xt, yt)) { + if (((BoostablePlantTile) tile).isPlantBoostSuccess(level, xt, yt)) { + ((BoostablePlantTile) tile).performPlantBoost(level, xt, yt); } Random random = new Random(); @@ -46,7 +47,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public StackableItem clone() { - return new BoneMealItem(getName(), sprite); + public @NotNull StackableItem copy() { + return new ArcaneFertilizerItem(getName(), sprite); } } diff --git a/src/main/java/minicraft/item/FertilizerItem.java b/src/main/java/minicraft/item/FertilizerItem.java index 26aa28c9d..3e9e22101 100644 --- a/src/main/java/minicraft/item/FertilizerItem.java +++ b/src/main/java/minicraft/item/FertilizerItem.java @@ -6,6 +6,7 @@ import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.farming.CropTile; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -43,7 +44,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public StackableItem clone() { + public @NotNull StackableItem copy() { return new FertilizerItem(getName(), sprite); } } diff --git a/src/main/java/minicraft/item/Items.java b/src/main/java/minicraft/item/Items.java index ab96883ac..1e8a2fc62 100644 --- a/src/main/java/minicraft/item/Items.java +++ b/src/main/java/minicraft/item/Items.java @@ -43,7 +43,7 @@ private static void addAll(ArrayList items) { addAll(FishingRodItem.getAllInstances()); addAll(SummonItem.getAllInstances()); addAll(HeartItem.getAllInstances()); - addAll(BoneMealItem.getAllInstances()); + addAll(ArcaneFertilizerItem.getAllInstances()); addAll(WateringCanItem.getAllInstances()); addAll(FertilizerItem.getAllInstances()); } diff --git a/src/main/java/minicraft/item/Recipes.java b/src/main/java/minicraft/item/Recipes.java index 1dc7c3905..1e593dd23 100644 --- a/src/main/java/minicraft/item/Recipes.java +++ b/src/main/java/minicraft/item/Recipes.java @@ -134,7 +134,8 @@ public class Recipes { enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); - enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5","Cloud Ore_5")); - enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5","Shard_15")); + enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); + enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); + enchantRecipes.add(new Recipe("Arcane Fertilizer_1", "Lapis_2", "Bone Meal_2")); } } diff --git a/src/main/java/minicraft/item/StackableItem.java b/src/main/java/minicraft/item/StackableItem.java index f0cfb9f7f..589da4d88 100644 --- a/src/main/java/minicraft/item/StackableItem.java +++ b/src/main/java/minicraft/item/StackableItem.java @@ -39,6 +39,7 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Glass Bottle", new LinkedSprite(SpriteType.Item, "glass_bottle"))); items.add(new StackableItem("Tomato", new LinkedSprite(SpriteType.Item, "tomato"))); items.add(new StackableItem("Bone", new LinkedSprite(SpriteType.Item, "bone"))); + items.add(new StackableItem("Bone Meal", new LinkedSprite(SpriteType.Item, "bone_meal"))); return items; } diff --git a/src/main/java/minicraft/level/tile/BonemealableTile.java b/src/main/java/minicraft/level/tile/BonemealableTile.java deleted file mode 100644 index a50d08f60..000000000 --- a/src/main/java/minicraft/level/tile/BonemealableTile.java +++ /dev/null @@ -1,20 +0,0 @@ -package minicraft.level.tile; - -import minicraft.level.Level; - -public interface BonemealableTile { - /** - * Whether bonemeal is able to be performed on the tile. - */ - boolean isValidBonemealTarget(Level level, int x, int y); - - /** - * Whether bonemeal can successfully be performed on the tile. - */ - boolean isBonemealSuccess(Level level, int x, int y); - - /** - * Performing bonemeal with effects on the tile. - */ - void performBonemeal(Level level, int x, int y); -} diff --git a/src/main/java/minicraft/level/tile/BoostablePlantTile.java b/src/main/java/minicraft/level/tile/BoostablePlantTile.java new file mode 100644 index 000000000..7f699658f --- /dev/null +++ b/src/main/java/minicraft/level/tile/BoostablePlantTile.java @@ -0,0 +1,20 @@ +package minicraft.level.tile; + +import minicraft.level.Level; + +public interface BoostablePlantTile { + /** + * Whether arcane fertilizer is able to be performed on the tile. + */ + boolean isValidBoostablePlantTarget(Level level, int x, int y); + + /** + * Whether arcane fertilizer can successfully be performed on the tile. + */ + boolean isPlantBoostSuccess(Level level, int x, int y); + + /** + * Performing arcane fertilizer with effects on the tile. + */ + void performPlantBoost(Level level, int x, int y); +} diff --git a/src/main/java/minicraft/level/tile/GrassTile.java b/src/main/java/minicraft/level/tile/GrassTile.java index 52920cb7f..0dabacf6d 100644 --- a/src/main/java/minicraft/level/tile/GrassTile.java +++ b/src/main/java/minicraft/level/tile/GrassTile.java @@ -17,7 +17,7 @@ import java.util.ArrayList; import java.util.Map; -public class GrassTile extends Tile implements BonemealableTile { +public class GrassTile extends Tile implements BoostablePlantTile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) .setSingletonWithConnective(true); @@ -89,17 +89,17 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } @Override - public boolean isValidBonemealTarget(Level level, int x, int y) { + public boolean isValidBoostablePlantTarget(Level level, int x, int y) { return true; } @Override - public boolean isBonemealSuccess(Level level, int x, int y) { + public boolean isPlantBoostSuccess(Level level, int x, int y) { return true; } @Override - public void performBonemeal(Level level, int x, int y) { + public void performPlantBoost(Level level, int x, int y) { label: for (int i = 0; i < 128; i++) { int xx = x; @@ -114,22 +114,22 @@ public void performBonemeal(Level level, int x, int y) { } if (level.getTile(xx, yy) == this && random.nextInt(10) == 0) { - performBonemeal(level, xx, yy); + performPlantBoost(level, xx, yy); } if (level.getTile(xx, yy) != this) continue; // Further confirming the tile is still grass tile. - Map.Entry plant = bonemealPerformingPlants.get(random.nextInt(bonemealPerformingPlants.size())); + Map.Entry plant = boostPerformingPlants.get(random.nextInt(boostPerformingPlants.size())); level.setTile(xx, yy, Tiles.get(plant.getKey()), plant.getValue()); } } - private static final ArrayList> bonemealPerformingPlants = new ArrayList<>(); + private static final ArrayList> boostPerformingPlants = new ArrayList<>(); static { - bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 0)); - bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 1)); - bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 55, (short) 0)); - bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 56, (short) 0)); - bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 57, (short) 0)); - bonemealPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 58, (short) 0)); + boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 0)); + boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 1)); + boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 52, (short) 0)); + boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 53, (short) 0)); + boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 54, (short) 0)); + boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 55, (short) 0)); } } diff --git a/src/main/java/minicraft/level/tile/SaplingTile.java b/src/main/java/minicraft/level/tile/SaplingTile.java index 2e7a36c6c..9cec8e0ec 100644 --- a/src/main/java/minicraft/level/tile/SaplingTile.java +++ b/src/main/java/minicraft/level/tile/SaplingTile.java @@ -8,7 +8,7 @@ import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.level.Level; -public class SaplingTile extends Tile implements BonemealableTile { +public class SaplingTile extends Tile implements BoostablePlantTile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "sapling"); private Tile onType; @@ -49,17 +49,17 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at } @Override - public boolean isValidBonemealTarget(Level level, int x, int y) { + public boolean isValidBoostablePlantTarget(Level level, int x, int y) { return true; } @Override - public boolean isBonemealSuccess(Level level, int x, int y) { + public boolean isPlantBoostSuccess(Level level, int x, int y) { return true; } @Override - public void performBonemeal(Level level, int x, int y) { + public void performPlantBoost(Level level, int x, int y) { level.setData(x, y, Math.min(level.getData(x, y) + random.nextInt(30), 110)); } } diff --git a/src/main/java/minicraft/level/tile/farming/CropTile.java b/src/main/java/minicraft/level/tile/farming/CropTile.java index 0db4ee9e3..1e53fbbe6 100644 --- a/src/main/java/minicraft/level/tile/farming/CropTile.java +++ b/src/main/java/minicraft/level/tile/farming/CropTile.java @@ -7,7 +7,7 @@ import minicraft.entity.mob.Player; import minicraft.item.Items; import minicraft.level.Level; -import minicraft.level.tile.BonemealableTile; +import minicraft.level.tile.BoostablePlantTile; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.level.tile.WaterTile; @@ -15,7 +15,7 @@ import java.util.Arrays; -public class CropTile extends FarmTile implements BonemealableTile { +public class CropTile extends FarmTile implements BoostablePlantTile { protected final @Nullable String seed; protected int maxStage = 7; // Must be a bit mask. @@ -138,17 +138,17 @@ public void fertilize(Level level, int x, int y, int amount) { } @Override - public boolean isValidBonemealTarget(Level level, int x, int y) { + public boolean isValidBoostablePlantTarget(Level level, int x, int y) { return true; } @Override - public boolean isBonemealSuccess(Level level, int x, int y) { + public boolean isPlantBoostSuccess(Level level, int x, int y) { return true; } @Override - public void performBonemeal(Level level, int x, int y) { + public void performPlantBoost(Level level, int x, int y) { int data = level.getData(x, y); int stage = (data >> 3) & maxStage; level.setData(x, y, (data & ~(maxStage << 3)) + (Math.min(stage + random.nextInt(4) + 2, maxStage) << 3)); diff --git a/src/main/resources/assets/textures/item/arcane_fertilizer.png b/src/main/resources/assets/textures/item/arcane_fertilizer.png new file mode 100644 index 0000000000000000000000000000000000000000..8b457a0ef25623a2c5a5032bdadcabf421521d2a GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`031o(uw+H*3*@iR0Fi+woA!0^=a=g*(^od1E6mzD_k0x6D?Aiv=M5WsM+ zd2b|8jI+QavY3H^?=T269?xHq0uzopr07&XTTmS$7 literal 0 HcmV?d00001 From 436116b3434fd468f5c9c2d0dcc2e288b2a3ba37 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 15 Jun 2023 21:29:16 +0800 Subject: [PATCH 029/261] Resolve problems --- .../minicraft/entity/furniture/Composter.java | 5 + src/main/java/minicraft/entity/mob/Sheep.java | 8 +- .../entity/particle/WaterParticle.java | 58 ++++++++++++ .../minicraft/item/ArcaneFertilizerItem.java | 10 +- src/main/java/minicraft/item/TileItem.java | 14 ++- src/main/java/minicraft/item/TorchItem.java | 2 +- .../java/minicraft/item/WateringCanItem.java | 88 ++++-------------- ...ablePlantTile.java => BoostablePlant.java} | 2 +- .../java/minicraft/level/tile/GrassTile.java | 7 +- .../minicraft/level/tile/SaplingTile.java | 2 +- .../minicraft/level/tile/TallGrassTile.java | 3 +- .../java/minicraft/level/tile/TreeTile.java | 9 +- .../level/tile/farming/CarrotTile.java | 22 ++--- .../level/tile/farming/CropTile.java | 28 +++--- .../tile/farming/HeavenlyBerriesTile.java | 8 +- .../tile/farming/HellishBerriesTile.java | 8 +- .../level/tile/farming/PotatoTile.java | 10 +- .../level/tile/farming/TomatoTile.java | 8 +- .../level/tile/farming/WheatTile.java | 10 +- .../{watering_tin.png => watering_can.png} | Bin ...tin_filled.png => watering_can_filled.png} | Bin 21 files changed, 145 insertions(+), 157 deletions(-) create mode 100644 src/main/java/minicraft/entity/particle/WaterParticle.java rename src/main/java/minicraft/level/tile/{BoostablePlantTile.java => BoostablePlant.java} (92%) rename src/main/resources/assets/textures/item/{watering_tin.png => watering_can.png} (100%) rename src/main/resources/assets/textures/item/{watering_tin_filled.png => watering_can_filled.png} (100%) diff --git a/src/main/java/minicraft/entity/furniture/Composter.java b/src/main/java/minicraft/entity/furniture/Composter.java index d164dcdc0..f8d54e4cc 100644 --- a/src/main/java/minicraft/entity/furniture/Composter.java +++ b/src/main/java/minicraft/entity/furniture/Composter.java @@ -34,11 +34,14 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) } if (item instanceof StackableItem) { + // 100% compost as they are heavy food if (item.getName().equalsIgnoreCase("Baked Potato") || item.getName().equalsIgnoreCase("Bread")) { compost++; ((StackableItem) item).count--; refreshStatus(); return true; + + // 75% compost as they are crop food } else if (item.getName().equalsIgnoreCase("Wheat") || item.getName().equalsIgnoreCase("Rose") || item.getName().equalsIgnoreCase("Flower") || item.getName().equalsIgnoreCase("Apple") || item.getName().equalsIgnoreCase("Potato") || item.getName().equalsIgnoreCase("Carrot")) { @@ -48,6 +51,8 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) refreshStatus(); return true; } + + // 66.7& compost as they are seeds } else if (item.getName().equalsIgnoreCase("Acorn") || item.getName().equalsIgnoreCase("Cactus") || item.getName().equalsIgnoreCase("Wheat Seeds") || item.getName().equalsIgnoreCase("Grass Seeds")) { if (random.nextInt(3) != 0) { // 66.7% diff --git a/src/main/java/minicraft/entity/mob/Sheep.java b/src/main/java/minicraft/entity/mob/Sheep.java index e5c509a03..d73955e00 100644 --- a/src/main/java/minicraft/entity/mob/Sheep.java +++ b/src/main/java/minicraft/entity/mob/Sheep.java @@ -46,13 +46,11 @@ public void render(Screen screen) { public void tick() { super.tick(); Tile tile = level.getTile(x >> 4, y >> 4); - if (tile instanceof GrassTile) { - if (random.nextInt(1000) == 0) { // Grazing + if (random.nextInt(1000) == 0) { // Grazing + if (tile instanceof GrassTile) { level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); cut = false; - } - } else if (tile instanceof TallGrassTile) { - if (random.nextInt(1000) == 0) { // Grazing + } else if (tile instanceof TallGrassTile) { level.setTile(x >> 4, y >> 4, Tiles.get("grass")); cut = false; } diff --git a/src/main/java/minicraft/entity/particle/WaterParticle.java b/src/main/java/minicraft/entity/particle/WaterParticle.java new file mode 100644 index 000000000..b91491dc2 --- /dev/null +++ b/src/main/java/minicraft/entity/particle/WaterParticle.java @@ -0,0 +1,58 @@ +package minicraft.entity.particle; + +import minicraft.gfx.SpriteLinker; + +public class WaterParticle extends Particle { + private final int destX; + private final int destY; + private int count; + private boolean stopped; + + public WaterParticle(int x, int y, int lifetime, SpriteLinker.LinkedSprite sprite, int destX, int destY) { + super(x, y, lifetime, sprite); + this.destX = destX; + this.destY = destY; + count = 0; + stopped = false; + } + + @Override + public void tick() { + move: + if (!stopped) { + count++; + if (x == destX && y == destY) { + stopped = true; + break move; + } + if (count == 2) { + int diffX = destX - x; + int diffY = destY - y; + if (Math.abs(diffX) < 3 && Math.abs(diffY) < 3) { + move(destX, destY); + stopped = true; + break move; + } + + double phi = Math.atan2(diffY, diffX); + double moveX = Math.cos(phi); + double moveY = Math.sin(phi); + int moveXI = 0; + int moveYI = 0; + if (Math.abs(moveX / moveY) > 1.4) moveXI = (int) Math.signum(moveX); // Difference in X is greater. + else if (Math.abs(moveY / moveX) > 1.4) + moveYI = (int) Math.signum(moveY); // Difference in Y is greater. + else { // The difference is small. + moveXI = (int) Math.signum(moveX); + moveYI = (int) Math.signum(moveY); + } + + if (!move(moveXI, moveYI)) + stopped = true; + count = 0; + } + } + + super.tick(); + } +} diff --git a/src/main/java/minicraft/item/ArcaneFertilizerItem.java b/src/main/java/minicraft/item/ArcaneFertilizerItem.java index b99ff7b76..0a27b0ae6 100644 --- a/src/main/java/minicraft/item/ArcaneFertilizerItem.java +++ b/src/main/java/minicraft/item/ArcaneFertilizerItem.java @@ -5,7 +5,7 @@ import minicraft.entity.particle.Particle; import minicraft.gfx.SpriteLinker; import minicraft.level.Level; -import minicraft.level.tile.BoostablePlantTile; +import minicraft.level.tile.BoostablePlant; import minicraft.level.tile.Tile; import org.jetbrains.annotations.NotNull; @@ -27,10 +27,10 @@ protected ArcaneFertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { @Override public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (tile instanceof BoostablePlantTile) { - if (((BoostablePlantTile) tile).isValidBoostablePlantTarget(level, xt, yt)) { - if (((BoostablePlantTile) tile).isPlantBoostSuccess(level, xt, yt)) { - ((BoostablePlantTile) tile).performPlantBoost(level, xt, yt); + if (tile instanceof BoostablePlant) { + if (((BoostablePlant) tile).isValidBoostablePlantTarget(level, xt, yt)) { + if (((BoostablePlant) tile).isPlantBoostSuccess(level, xt, yt)) { + ((BoostablePlant) tile).performPlantBoost(level, xt, yt); } Random random = new Random(); diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 0c26dd327..433970839 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -14,6 +14,7 @@ import minicraft.screen.AchievementsDisplay; import minicraft.util.AdvancementElement; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; import java.util.ArrayList; @@ -107,17 +108,22 @@ interface TileDataGetter { int getTileData(Tile model, Tile target, Level level, int xt, int yt, Player player, Direction attackDir); } - public TileModel(String tile) { this(tile, DEFAULT_DATA); } - public TileModel(String tile, TileDataGetter data) { - this.tile = tile.toUpperCase(); + public TileModel(@Nullable String tile) { this(tile, DEFAULT_DATA); } + public TileModel(@Nullable String tile, TileDataGetter data) { + this.tile = tile != null ? tile.toUpperCase() : null; this.data = data; } + + public Tile getTile() { + if (tile == null) return Tiles.get(0); // Default tile. + return Tiles.get(tile); + } } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { for (String tilename : validTiles) { if (tile.matches(level.getData(xt, yt), tilename)) { - Tile t = Tiles.get(model.tile); + Tile t = model.getTile(); level.setTile(xt, yt, t, model.data.getTileData(t, tile, level, xt, yt, player, attackDir)); AdvancementElement.AdvancementTrigger.PlacedTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.PlacedTileTrigger.PlacedTileTriggerConditionHandler.PlacedTileTriggerConditions( diff --git a/src/main/java/minicraft/item/TorchItem.java b/src/main/java/minicraft/item/TorchItem.java index 324681097..31ef3bb4e 100644 --- a/src/main/java/minicraft/item/TorchItem.java +++ b/src/main/java/minicraft/item/TorchItem.java @@ -21,7 +21,7 @@ public static ArrayList getAllInstances() { private TorchItem() { this(1); } private TorchItem(int count) { - super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, new TileModel(""), "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand","path","ornate stone","ornate obsidian"); + super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, new TileModel(null), "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand","path","ornate stone","ornate obsidian"); } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { diff --git a/src/main/java/minicraft/item/WateringCanItem.java b/src/main/java/minicraft/item/WateringCanItem.java index 2e58476fb..e3ab3dd71 100644 --- a/src/main/java/minicraft/item/WateringCanItem.java +++ b/src/main/java/minicraft/item/WateringCanItem.java @@ -2,7 +2,7 @@ import minicraft.entity.Direction; import minicraft.entity.mob.Player; -import minicraft.entity.particle.Particle; +import minicraft.entity.particle.WaterParticle; import minicraft.gfx.Point; import minicraft.gfx.SpriteLinker; import minicraft.level.Level; @@ -24,8 +24,8 @@ protected static ArrayList getAllInstances() { return items; } - private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_tin"); - private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_tin_filled"); + private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_can"); + private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_can_filled"); private static final SpriteLinker.LinkedSprite[] spriteSplash = new SpriteLinker.LinkedSprite[] { new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_0"), @@ -52,7 +52,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, content--; updateSprite(); renderingTick++; - if (renderingTick == 8) { + if (renderingTick >= 8) { Random random = new Random(); for (int i = 0; i < 4; i++) { SpriteLinker.LinkedSprite splash = spriteSplash[random.nextInt(spriteSplash.length)]; @@ -70,21 +70,21 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, if (fertilization < 150) { // Maximum of 5 levels watering can can fertilize. ((CropTile) tile).fertilize(level, xt, yt, 1); } - } else if (tile instanceof DirtTile) { - for (Tile t : level.getAreaTiles(xt, yt, 1)) { - if (t instanceof GrassTile) { // Grass tile exists. - if (new Random().nextInt(10) == 0) - level.setTile(xt, yt, Tiles.get("grass")); // Grass extends. - break; // Operation finished. - } - } - } else if (tile instanceof GrassTile) { + } else if (tile instanceof DirtTile || tile instanceof GrassTile) { for (Point p : level.getAreaTilePositions(xt, yt, 1)) { Tile t = level.getTile(p.x, p.y); - if (t instanceof DirtTile) { // Dirt tile exists. - if (new Random().nextInt(15) == 0) - level.setTile(p.x, p.y, Tiles.get("grass")); // Grass extends. - break; // Operation finished. + if (tile instanceof DirtTile) { + if (t instanceof GrassTile) { // Grass tile exists. + if (new Random().nextInt(10) == 0) + level.setTile(xt, yt, Tiles.get("grass")); // Grass extends. + break; // Operation finished. + } + } else { // tile instanceof GrassTile + if (t instanceof DirtTile) { // Dirt tile exists. + if (new Random().nextInt(15) == 0) + level.setTile(p.x, p.y, Tiles.get("grass")); // Grass extends. + break; // Operation finished. + } } } } @@ -108,58 +108,4 @@ public String getData() { public @NotNull Item copy() { return new WateringCanItem(getName()); } - - private static class WaterParticle extends Particle { - private final int destX; - private final int destY; - private int count; - private boolean stopped; - - public WaterParticle(int x, int y, int lifetime, SpriteLinker.LinkedSprite sprite, int destX, int destY) { - super(x, y, lifetime, sprite); - this.destX = destX; - this.destY = destY; - count = 0; - stopped = false; - } - - @Override - public void tick() { - move: - if (!stopped) { - count++; - if (x == destX && y == destY) { - stopped = true; - break move; - } - if (count == 2) { - int diffX = destX - x; - int diffY = destY - y; - if (Math.abs(diffX) < 3 && Math.abs(diffY) < 3) { - move(destX, destY); - stopped = true; - break move; - } - - double phi = Math.atan2(diffY, diffX); - double moveX = Math.cos(phi); - double moveY = Math.sin(phi); - int moveXI = 0; - int moveYI = 0; - if (Math.abs(moveX / moveY) > 1.4) moveXI = (int) Math.signum(moveX); // Difference in X is greater. - else if (Math.abs(moveY / moveX) > 1.4) moveYI = (int) Math.signum(moveY); // Difference in Y is greater. - else { // The difference is small. - moveXI = (int) Math.signum(moveX); - moveYI = (int) Math.signum(moveY); - } - - if (!move(moveXI, moveYI)) - stopped = true; - count = 0; - } - } - - super.tick(); - } - } } diff --git a/src/main/java/minicraft/level/tile/BoostablePlantTile.java b/src/main/java/minicraft/level/tile/BoostablePlant.java similarity index 92% rename from src/main/java/minicraft/level/tile/BoostablePlantTile.java rename to src/main/java/minicraft/level/tile/BoostablePlant.java index 7f699658f..50bcb1a0d 100644 --- a/src/main/java/minicraft/level/tile/BoostablePlantTile.java +++ b/src/main/java/minicraft/level/tile/BoostablePlant.java @@ -2,7 +2,7 @@ import minicraft.level.Level; -public interface BoostablePlantTile { +public interface BoostablePlant { /** * Whether arcane fertilizer is able to be performed on the tile. */ diff --git a/src/main/java/minicraft/level/tile/GrassTile.java b/src/main/java/minicraft/level/tile/GrassTile.java index 0dabacf6d..9babe6978 100644 --- a/src/main/java/minicraft/level/tile/GrassTile.java +++ b/src/main/java/minicraft/level/tile/GrassTile.java @@ -17,7 +17,7 @@ import java.util.ArrayList; import java.util.Map; -public class GrassTile extends Tile implements BoostablePlantTile { +public class GrassTile extends Tile implements BoostablePlant { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) .setSingletonWithConnective(true); @@ -72,6 +72,9 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get("Farmland")); Sound.play("monsterhurt"); + if (random.nextInt(2) != 0) { // 50% chance to drop Wheat seeds + level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Wheat Seeds")); + } AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); @@ -124,7 +127,7 @@ public void performPlantBoost(Level level, int x, int y) { } private static final ArrayList> boostPerformingPlants = new ArrayList<>(); - static { + static { // The left-hand-sided data is tile id; the right-hand-sided data is tile data. boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 0)); boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 1)); boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 52, (short) 0)); diff --git a/src/main/java/minicraft/level/tile/SaplingTile.java b/src/main/java/minicraft/level/tile/SaplingTile.java index 9cec8e0ec..d61cb25d8 100644 --- a/src/main/java/minicraft/level/tile/SaplingTile.java +++ b/src/main/java/minicraft/level/tile/SaplingTile.java @@ -8,7 +8,7 @@ import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.level.Level; -public class SaplingTile extends Tile implements BoostablePlantTile { +public class SaplingTile extends Tile implements BoostablePlant { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "sapling"); private Tile onType; diff --git a/src/main/java/minicraft/level/tile/TallGrassTile.java b/src/main/java/minicraft/level/tile/TallGrassTile.java index 7b231eb68..e6b525acc 100644 --- a/src/main/java/minicraft/level/tile/TallGrassTile.java +++ b/src/main/java/minicraft/level/tile/TallGrassTile.java @@ -20,8 +20,7 @@ public enum TallGrassType { GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "tall_grass")), FERN(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "fern")), TALL_GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "double_tall_grass")), - LARGE_FERN(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "large_fern")), - ; + LARGE_FERN(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "large_fern")); private final SpriteAnimation sprite; diff --git a/src/main/java/minicraft/level/tile/TreeTile.java b/src/main/java/minicraft/level/tile/TreeTile.java index 1213d3b4c..faa9221a5 100644 --- a/src/main/java/minicraft/level/tile/TreeTile.java +++ b/src/main/java/minicraft/level/tile/TreeTile.java @@ -65,6 +65,7 @@ protected TreeTile(String name) { connectsToGrass = true; } + @SuppressWarnings("PointlessArithmeticExpression") public void render(Screen screen, Level level, int x, int y) { Tiles.get("Grass").render(screen, level, x, y); @@ -82,9 +83,9 @@ public void render(Screen screen, Level level, int x, int y) { Sprite spriteFull = level.treeTypes[x + y * level.w].treeSpriteFull.getSprite(); if (u && ul && l) { - screen.render(x * 16, y * 16, spriteFull.spritePixels[0][1]); + screen.render(x * 16 + 0, y * 16, spriteFull.spritePixels[0][1]); } else { - screen.render(x * 16, y * 16, sprite.spritePixels[0][0]); + screen.render(x * 16 + 0, y * 16, sprite.spritePixels[0][0]); } if (u && ur && r) { @@ -94,9 +95,9 @@ public void render(Screen screen, Level level, int x, int y) { } if (d && dl && l) { - screen.render(x * 16, y * 16 + 8, spriteFull.spritePixels[1][1]); + screen.render(x * 16 + 0, y * 16 + 8, spriteFull.spritePixels[1][1]); } else { - screen.render(x * 16, y * 16 + 8, sprite.spritePixels[1][0]); + screen.render(x * 16 + 0, y * 16 + 8, sprite.spritePixels[1][0]); } if (d && dr && r) { diff --git a/src/main/java/minicraft/level/tile/farming/CarrotTile.java b/src/main/java/minicraft/level/tile/farming/CarrotTile.java index e8707d26c..313813adc 100644 --- a/src/main/java/minicraft/level/tile/farming/CarrotTile.java +++ b/src/main/java/minicraft/level/tile/farming/CarrotTile.java @@ -14,19 +14,15 @@ public class CarrotTile extends CropTile { new LinkedSprite(SpriteType.Tile, "carrot_stage3") }; - public CarrotTile(String name) { - super(name, null); - } + public CarrotTile(String name) { + super(name, null); + } - @Override - public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxStage; - Tiles.get("Farmland").render(screen, level, x, y); - int stage; - if (age < 2) stage = 0; - else if (age < 4) stage = 1; - else if (age < 7) stage = 2; - else stage = 3; + @Override + public void render(Screen screen, Level level, int x, int y) { + int age = (level.getData(x, y) >> 3) & maxAge; + Tiles.get("Farmland").render(screen, level, x, y); + int stage = age / (maxAge / 3); screen.render(x * 16, y * 16, spritStages[stage]); - } + } } diff --git a/src/main/java/minicraft/level/tile/farming/CropTile.java b/src/main/java/minicraft/level/tile/farming/CropTile.java index 1e53fbbe6..79219f2f9 100644 --- a/src/main/java/minicraft/level/tile/farming/CropTile.java +++ b/src/main/java/minicraft/level/tile/farming/CropTile.java @@ -7,7 +7,7 @@ import minicraft.entity.mob.Player; import minicraft.item.Items; import minicraft.level.Level; -import minicraft.level.tile.BoostablePlantTile; +import minicraft.level.tile.BoostablePlant; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.level.tile.WaterTile; @@ -15,10 +15,10 @@ import java.util.Arrays; -public class CropTile extends FarmTile implements BoostablePlantTile { +public class CropTile extends FarmTile implements BoostablePlant { protected final @Nullable String seed; - protected int maxStage = 7; // Must be a bit mask. + protected int maxAge = 0b111; // Must be a bit mask. protected CropTile(String name, @Nullable String seed) { super(name, null); @@ -47,8 +47,8 @@ public boolean tick(Level level, int xt, int yt) { } int fertilization = getFertilization(data); - int stage = (data >> 3) & maxStage; - if (stage < maxStage) { + int stage = (data >> 3) & maxAge; + if (stage < maxAge) { double points = moisture > 0 ? 4 : 2; for (int i = -1; i < 2; i++) for (int j = -1; j < 2; j++) { @@ -82,12 +82,12 @@ public boolean tick(Level level, int xt, int yt) { } if (random.nextInt((int) (100/points) + 1) < (fertilization/30 + 1)) // fertilization >= 0 - level.setData(xt, yt, data = (data & ~(maxStage << 3)) + ((stage + 1) << 3)); // Incrementing the stage by 1. + level.setData(xt, yt, data = (data & ~(maxAge << 3)) + ((stage + 1) << 3)); // Incrementing the stage by 1. successful = true; } if (fertilization > 0) { - level.setData(xt, yt, (data & (0b111 + (maxStage << 3))) + ((fertilization - 1) << (3 + (maxStage + 1)/2))); + level.setData(xt, yt, (data & (0b111 + (maxAge << 3))) + ((fertilization - 1) << (3 + (maxAge + 1)/2))); successful = true; } @@ -97,18 +97,18 @@ public boolean tick(Level level, int xt, int yt) { /** Default harvest method, used for everything that doesn't really need any special behavior. */ protected void harvest(Level level, int x, int y, Entity entity) { int data = level.getData(x, y); - int age = (data >> 3) & maxStage; + int age = (data >> 3) & maxAge; if (seed != null) level.dropItem(x * 16 + 8, y * 16 + 8, 1, Items.get(seed)); - if (age == maxStage) { + if (age == maxAge) { level.dropItem(x * 16 + 8, y * 16 + 8, random.nextInt(3) + 2, Items.get(name)); } else if (seed == null) { level.dropItem(x * 16 + 8, y * 16 + 8, 1, Items.get(name)); } - if (age == maxStage && entity instanceof Player) { + if (age == maxAge && entity instanceof Player) { ((Player)entity).addScore(random.nextInt(5) + 1); } @@ -119,7 +119,7 @@ protected void harvest(Level level, int x, int y, Entity entity) { } public int getFertilization(int data) { - return data >> (3 + (maxStage + 1)/2); + return data >> (3 + (maxAge + 1)/2); } /** @@ -134,7 +134,7 @@ public void fertilize(Level level, int x, int y, int amount) { if (fertilization < 0) fertilization = 0; if (fertilization > 511) fertilization = 511; // The maximum possible value to be reached. // If this value exceeds 511, the final value would be greater than the hard maximum value that short can be. - level.setData(x, y, (data & (0b111 + (maxStage << 3))) + (fertilization << (3 + (maxStage + 1)/2))); + level.setData(x, y, (data & (0b111 + (maxAge << 3))) + (fertilization << (3 + (maxAge + 1)/2))); } @Override @@ -150,7 +150,7 @@ public boolean isPlantBoostSuccess(Level level, int x, int y) { @Override public void performPlantBoost(Level level, int x, int y) { int data = level.getData(x, y); - int stage = (data >> 3) & maxStage; - level.setData(x, y, (data & ~(maxStage << 3)) + (Math.min(stage + random.nextInt(4) + 2, maxStage) << 3)); + int stage = (data >> 3) & maxAge; + level.setData(x, y, (data & ~(maxAge << 3)) + (Math.min(stage + random.nextInt(4) + 2, maxAge) << 3)); } } diff --git a/src/main/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java b/src/main/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java index 40495d3b9..e5d2c3dc0 100644 --- a/src/main/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java +++ b/src/main/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java @@ -19,13 +19,9 @@ public HeavenlyBerriesTile(String name) { @Override public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxStage; + int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage; - if (age < 2) stage = 0; - else if (age < 4) stage = 1; - else if (age < 7) stage = 2; - else stage = 3; + int stage = age / (maxAge / 3); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java b/src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java index b227e6b3e..d4fa25730 100644 --- a/src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java +++ b/src/main/java/minicraft/level/tile/farming/HellishBerriesTile.java @@ -19,13 +19,9 @@ public HellishBerriesTile(String name) { @Override public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxStage; + int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage; - if (age < 2) stage = 0; - else if (age < 4) stage = 1; - else if (age < 7) stage = 2; - else stage = 3; + int stage = age / (maxAge / 3); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/main/java/minicraft/level/tile/farming/PotatoTile.java b/src/main/java/minicraft/level/tile/farming/PotatoTile.java index a147bea89..9272ca2ba 100644 --- a/src/main/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/main/java/minicraft/level/tile/farming/PotatoTile.java @@ -22,15 +22,9 @@ public PotatoTile(String name) { @Override public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxStage; + int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage; - if (age < 1) stage = 0; - else if (age < 3) stage = 1; - else if (age < 4) stage = 2; - else if (age < 5) stage = 3; - else if (age < 7) stage = 4; - else stage = 5; + int stage = age / (maxAge / 5); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/main/java/minicraft/level/tile/farming/TomatoTile.java b/src/main/java/minicraft/level/tile/farming/TomatoTile.java index 0ee9ce92a..ecadf0b24 100644 --- a/src/main/java/minicraft/level/tile/farming/TomatoTile.java +++ b/src/main/java/minicraft/level/tile/farming/TomatoTile.java @@ -20,13 +20,9 @@ public TomatoTile(String name) { @Override public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxStage; + int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage; - if (age < 2) stage = 0; - else if (age < 4) stage = 1; - else if (age < 7) stage = 2; - else stage = 3; + int stage = age / (maxAge / 3); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/main/java/minicraft/level/tile/farming/WheatTile.java b/src/main/java/minicraft/level/tile/farming/WheatTile.java index 25b7ed742..367c8e69f 100644 --- a/src/main/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/main/java/minicraft/level/tile/farming/WheatTile.java @@ -22,15 +22,9 @@ public WheatTile(String name) { @Override public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxStage; + int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage; - if (age < 1) stage = 0; - else if (age < 3) stage = 1; - else if (age < 4) stage = 2; - else if (age < 5) stage = 3; - else if (age < 7) stage = 4; - else stage = 5; + int stage = age / (maxAge / 5); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/main/resources/assets/textures/item/watering_tin.png b/src/main/resources/assets/textures/item/watering_can.png similarity index 100% rename from src/main/resources/assets/textures/item/watering_tin.png rename to src/main/resources/assets/textures/item/watering_can.png diff --git a/src/main/resources/assets/textures/item/watering_tin_filled.png b/src/main/resources/assets/textures/item/watering_can_filled.png similarity index 100% rename from src/main/resources/assets/textures/item/watering_tin_filled.png rename to src/main/resources/assets/textures/item/watering_can_filled.png From 5d0df70e676fad06e37e4308d0749bf5f3e12311 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 15 Jun 2023 21:39:51 +0800 Subject: [PATCH 030/261] Remove ferns and large ferns --- src/main/java/minicraft/level/tile/GrassTile.java | 2 -- src/main/java/minicraft/level/tile/TallGrassTile.java | 6 ++---- src/main/java/minicraft/level/tile/Tiles.java | 6 ++---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/minicraft/level/tile/GrassTile.java b/src/main/java/minicraft/level/tile/GrassTile.java index 9babe6978..68630275d 100644 --- a/src/main/java/minicraft/level/tile/GrassTile.java +++ b/src/main/java/minicraft/level/tile/GrassTile.java @@ -132,7 +132,5 @@ public void performPlantBoost(Level level, int x, int y) { boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 1)); boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 52, (short) 0)); boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 53, (short) 0)); - boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 54, (short) 0)); - boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 55, (short) 0)); } } diff --git a/src/main/java/minicraft/level/tile/TallGrassTile.java b/src/main/java/minicraft/level/tile/TallGrassTile.java index e6b525acc..f2a0097e0 100644 --- a/src/main/java/minicraft/level/tile/TallGrassTile.java +++ b/src/main/java/minicraft/level/tile/TallGrassTile.java @@ -18,9 +18,7 @@ public class TallGrassTile extends Tile { public enum TallGrassType { GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "tall_grass")), - FERN(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "fern")), - TALL_GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "double_tall_grass")), - LARGE_FERN(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "large_fern")); + TALL_GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "double_tall_grass")); private final SpriteAnimation sprite; @@ -31,7 +29,7 @@ public enum TallGrassType { } public static final List grassIDs = Collections.unmodifiableList(Arrays.asList( - (short) 52, (short) 53, (short) 54, (short) 55)); + (short) 52, (short) 53)); protected TallGrassTile(String name, TallGrassType type) { super(name, type.sprite); diff --git a/src/main/java/minicraft/level/tile/Tiles.java b/src/main/java/minicraft/level/tile/Tiles.java index d4d5be597..c31e75c90 100644 --- a/src/main/java/minicraft/level/tile/Tiles.java +++ b/src/main/java/minicraft/level/tile/Tiles.java @@ -81,10 +81,8 @@ public static void initTileList() { tiles.put((short)51, new CarrotTile("Carrot")); tiles.put((short)52, new TallGrassTile("Tall Grass", TallGrassTile.TallGrassType.GRASS)); tiles.put((short)53, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); - tiles.put((short)54, new TallGrassTile("Fern", TallGrassTile.TallGrassType.FERN)); - tiles.put((short)55, new TallGrassTile("Large Fern", TallGrassTile.TallGrassType.LARGE_FERN)); - tiles.put((short)56, new HeavenlyBerriesTile("Heavenly Berries")); - tiles.put((short)57, new HellishBerriesTile("Hellish Berries")); + tiles.put((short)54, new HeavenlyBerriesTile("Heavenly Berries")); + tiles.put((short)55, new HellishBerriesTile("Hellish Berries")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); From 072ca500899ff7d1f3362154f587e09981959a39 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Jun 2023 09:21:46 +0800 Subject: [PATCH 031/261] Resolve problems --- src/main/java/minicraft/item/TileItem.java | 56 ++++++++++--------- src/main/java/minicraft/item/TorchItem.java | 2 +- .../minicraft/level/tile/BoostablePlant.java | 5 -- .../java/minicraft/level/tile/GrassTile.java | 5 -- .../minicraft/level/tile/SaplingTile.java | 5 -- .../level/tile/farming/CropTile.java | 5 -- 6 files changed, 32 insertions(+), 46 deletions(-) diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 433970839..dad79ffee 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -79,7 +79,7 @@ protected static ArrayList getAllInstances() { return items; } - public final TileModel model; + public final @Nullable TileModel model; public final List validTiles; protected TileItem(String name, LinkedSprite sprite, TileModel model, String... validTiles) { @@ -88,7 +88,7 @@ protected TileItem(String name, LinkedSprite sprite, TileModel model, String... protected TileItem(String name, LinkedSprite sprite, int count, TileModel model, String... validTiles) { this(name, sprite, count, model, Arrays.asList(validTiles)); } - protected TileItem(String name, LinkedSprite sprite, int count, TileModel model, List validTiles) { + protected TileItem(String name, LinkedSprite sprite, int count, @Nullable TileModel model, List validTiles) { super(name, sprite, count); this.model = model; this.validTiles = new ArrayList<>(); @@ -100,7 +100,7 @@ public static class TileModel { public static final TileDataGetter DEFAULT_DATA = ((model, target, level, xt, yt, player, attackDir) -> model.getDefaultData()); public static final TileDataGetter KEEP_DATA = ((model, target, level, xt, yt, player, attackDir) -> level.getData(xt, yt)); - public final String tile; + public final @NotNull String tile; public final TileDataGetter data; @FunctionalInterface @@ -108,23 +108,27 @@ interface TileDataGetter { int getTileData(Tile model, Tile target, Level level, int xt, int yt, Player player, Direction attackDir); } - public TileModel(@Nullable String tile) { this(tile, DEFAULT_DATA); } - public TileModel(@Nullable String tile, TileDataGetter data) { - this.tile = tile != null ? tile.toUpperCase() : null; + public TileModel(String tile) { this(tile, DEFAULT_DATA); } + public TileModel(String tile, TileDataGetter data) { + this.tile = tile.toUpperCase(); this.data = data; } - public Tile getTile() { - if (tile == null) return Tiles.get(0); // Default tile. - return Tiles.get(tile); + public static Tile getTile(@Nullable TileModel model) { + return model == null ? Tiles.get(0) : Tiles.get(model.tile); + } + + public static int getTileData(@Nullable TileModel model, Tile tile, Tile target, Level level, int xt, int yt, Player player, Direction attackDir) { + if (model == null) return DEFAULT_DATA.getTileData(tile, target, level, xt, yt, player, attackDir); + return model.data.getTileData(tile, target, level, xt, yt, player, attackDir); } } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { for (String tilename : validTiles) { if (tile.matches(level.getData(xt, yt), tilename)) { - Tile t = model.getTile(); - level.setTile(xt, yt, t, model.data.getTileData(t, tile, level, xt, yt, player, attackDir)); + Tile t = TileModel.getTile(model); + level.setTile(xt, yt, t, TileModel.getTileData(model, t, tile, level, xt, yt, player, attackDir)); AdvancementElement.AdvancementTrigger.PlacedTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.PlacedTileTrigger.PlacedTileTriggerConditionHandler.PlacedTileTriggerConditions( this, level.getTile(xt, yt), level.getData(xt, yt), xt, yt, level.depth @@ -137,19 +141,21 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Logger.tag("TileItem").debug("{} cannot be placed on {}.", model, tile.name); - String note = ""; - if (model.tile.contains("WALL")) { - note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); - } - else if (model.tile.contains("DOOR")) { - note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); - } - else if ((model.tile.contains("BRICK") || model.tile.contains("PLANK") || model.tile.equals("STONE") || model.tile.contains("ORNATE"))) { - note = Localization.getLocalized("minicraft.notification.dig_hole"); - } + if (model != null) { + String note = ""; + if (model.tile.contains("WALL")) { + note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); + } + else if (model.tile.contains("DOOR")) { + note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); + } + else if ((model.tile.contains("BRICK") || model.tile.contains("PLANK") || model.tile.equals("STONE") || model.tile.contains("ORNATE"))) { + note = Localization.getLocalized("minicraft.notification.dig_hole"); + } - if (note.length() > 0) { - Game.notifications.add(note); + if (note.length() > 0) { + Game.notifications.add(note); + } } return super.interactOn(false); @@ -157,11 +163,11 @@ else if ((model.tile.contains("BRICK") || model.tile.contains("PLANK") || model. @Override public boolean equals(Item other) { - return super.equals(other) && model.equals(((TileItem)other).model); + return super.equals(other) && (model == null || model.equals(((TileItem)other).model)); } @Override - public int hashCode() { return super.hashCode() + model.hashCode(); } + public int hashCode() { return super.hashCode() + (model == null ? 0xFF123 : model.hashCode()); } public @NotNull TileItem copy() { return new TileItem(getName(), sprite, count, model, validTiles); diff --git a/src/main/java/minicraft/item/TorchItem.java b/src/main/java/minicraft/item/TorchItem.java index 31ef3bb4e..2eee762eb 100644 --- a/src/main/java/minicraft/item/TorchItem.java +++ b/src/main/java/minicraft/item/TorchItem.java @@ -21,7 +21,7 @@ public static ArrayList getAllInstances() { private TorchItem() { this(1); } private TorchItem(int count) { - super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, new TileModel(null), "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand","path","ornate stone","ornate obsidian"); + super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, null, "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand","path","ornate stone","ornate obsidian"); } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { diff --git a/src/main/java/minicraft/level/tile/BoostablePlant.java b/src/main/java/minicraft/level/tile/BoostablePlant.java index 50bcb1a0d..e512e18be 100644 --- a/src/main/java/minicraft/level/tile/BoostablePlant.java +++ b/src/main/java/minicraft/level/tile/BoostablePlant.java @@ -8,11 +8,6 @@ public interface BoostablePlant { */ boolean isValidBoostablePlantTarget(Level level, int x, int y); - /** - * Whether arcane fertilizer can successfully be performed on the tile. - */ - boolean isPlantBoostSuccess(Level level, int x, int y); - /** * Performing arcane fertilizer with effects on the tile. */ diff --git a/src/main/java/minicraft/level/tile/GrassTile.java b/src/main/java/minicraft/level/tile/GrassTile.java index 68630275d..983cb9631 100644 --- a/src/main/java/minicraft/level/tile/GrassTile.java +++ b/src/main/java/minicraft/level/tile/GrassTile.java @@ -96,11 +96,6 @@ public boolean isValidBoostablePlantTarget(Level level, int x, int y) { return true; } - @Override - public boolean isPlantBoostSuccess(Level level, int x, int y) { - return true; - } - @Override public void performPlantBoost(Level level, int x, int y) { label: diff --git a/src/main/java/minicraft/level/tile/SaplingTile.java b/src/main/java/minicraft/level/tile/SaplingTile.java index d61cb25d8..3fdb8c5a4 100644 --- a/src/main/java/minicraft/level/tile/SaplingTile.java +++ b/src/main/java/minicraft/level/tile/SaplingTile.java @@ -53,11 +53,6 @@ public boolean isValidBoostablePlantTarget(Level level, int x, int y) { return true; } - @Override - public boolean isPlantBoostSuccess(Level level, int x, int y) { - return true; - } - @Override public void performPlantBoost(Level level, int x, int y) { level.setData(x, y, Math.min(level.getData(x, y) + random.nextInt(30), 110)); diff --git a/src/main/java/minicraft/level/tile/farming/CropTile.java b/src/main/java/minicraft/level/tile/farming/CropTile.java index 79219f2f9..a1b50e821 100644 --- a/src/main/java/minicraft/level/tile/farming/CropTile.java +++ b/src/main/java/minicraft/level/tile/farming/CropTile.java @@ -142,11 +142,6 @@ public boolean isValidBoostablePlantTarget(Level level, int x, int y) { return true; } - @Override - public boolean isPlantBoostSuccess(Level level, int x, int y) { - return true; - } - @Override public void performPlantBoost(Level level, int x, int y) { int data = level.getData(x, y); From ad775e9e7c2a64f6adc803ecab300f09ba9ee063 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Jun 2023 09:23:57 +0800 Subject: [PATCH 032/261] Resolve error --- src/main/java/minicraft/item/ArcaneFertilizerItem.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/minicraft/item/ArcaneFertilizerItem.java b/src/main/java/minicraft/item/ArcaneFertilizerItem.java index 0a27b0ae6..90caaf7b7 100644 --- a/src/main/java/minicraft/item/ArcaneFertilizerItem.java +++ b/src/main/java/minicraft/item/ArcaneFertilizerItem.java @@ -29,9 +29,7 @@ protected ArcaneFertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { if (tile instanceof BoostablePlant) { if (((BoostablePlant) tile).isValidBoostablePlantTarget(level, xt, yt)) { - if (((BoostablePlant) tile).isPlantBoostSuccess(level, xt, yt)) { - ((BoostablePlant) tile).performPlantBoost(level, xt, yt); - } + ((BoostablePlant) tile).performPlantBoost(level, xt, yt); Random random = new Random(); for (int i = 0; i < 5; i++) { From c489cb479cbd66869073a82bcc249273b8ddab8b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Jun 2023 17:42:58 +0800 Subject: [PATCH 033/261] Redo unlocalized string tracing --- src/main/java/minicraft/core/Initializer.java | 2 ++ src/main/java/minicraft/core/io/Localization.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/minicraft/core/Initializer.java b/src/main/java/minicraft/core/Initializer.java index a54a0d928..a48b401fb 100644 --- a/src/main/java/minicraft/core/Initializer.java +++ b/src/main/java/minicraft/core/Initializer.java @@ -63,6 +63,8 @@ static void parseArgs(String[] args) { Logging.fileLogFull = true; } else if (args[i].equalsIgnoreCase("--debug-locale")) { Localization.isDebugLocaleEnabled = true; + } else if (args[i].equalsIgnoreCase("--debug-unloc-tracing")) { + Localization.unlocalizedStringTracing = true; } } ((TinylogLoggingProvider) ProviderRegistry.getLoggingProvider()).init(); diff --git a/src/main/java/minicraft/core/io/Localization.java b/src/main/java/minicraft/core/io/Localization.java index e908d4717..bcb36ad1c 100644 --- a/src/main/java/minicraft/core/io/Localization.java +++ b/src/main/java/minicraft/core/io/Localization.java @@ -17,6 +17,7 @@ public class Localization { public static final Locale DEBUG_LOCALE = Locale.ROOT; // This locale is used for debugging; public static boolean isDebugLocaleEnabled = false; + public static boolean unlocalizedStringTracing = false; private static final HashMap> knownUnlocalizedStrings = new HashMap<>(); private static final HashMap localization = new HashMap<>(); @@ -46,7 +47,7 @@ public static String getLocalized(String key, Object... arguments) { if (localString == null) { if (!knownUnlocalizedStrings.containsKey(selectedLocale)) knownUnlocalizedStrings.put(selectedLocale, new HashSet<>()); if (!knownUnlocalizedStrings.get(selectedLocale).contains(key)) { - Logger.tag("LOC").trace("{}: '{}' is unlocalized.", selectedLocale.toLanguageTag(), key); + Logger.tag("LOC").trace(unlocalizedStringTracing ? new Throwable("Tracing") : null, "{}: '{}' is unlocalized.", selectedLocale.toLanguageTag(), key); knownUnlocalizedStrings.get(selectedLocale).add(key); } } From 9a5da0e1d4e8bd94b0aac9ba6d67c1cada48a5ca Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Jun 2023 21:45:41 +0800 Subject: [PATCH 034/261] Complements and repairs localizations --- src/main/java/minicraft/core/World.java | 2 +- src/main/java/minicraft/core/io/Settings.java | 6 +++--- src/main/java/minicraft/item/Recipes.java | 4 ++-- src/main/java/minicraft/item/TileItem.java | 10 +++++----- src/main/java/minicraft/saveload/Load.java | 2 +- src/main/java/minicraft/screen/InventoryMenu.java | 3 ++- src/main/java/minicraft/screen/ItemListMenu.java | 5 +++-- src/main/java/minicraft/screen/LoadingDisplay.java | 12 ++++++++++-- src/main/java/minicraft/screen/Menu.java | 10 ++++++++-- src/main/java/minicraft/screen/PauseDisplay.java | 6 +++--- .../java/minicraft/screen/PlayerInvDisplay.java | 4 +--- .../minicraft/screen/TutorialDisplayHandler.java | 4 ++-- .../java/minicraft/screen/entry/StringEntry.java | 5 +++-- src/main/resources/assets/localization/en-us.json | 14 ++++++++++++-- src/main/resources/assets/localization/es-es.json | 2 +- src/main/resources/assets/localization/fr-fr.json | 2 +- src/main/resources/assets/localization/hu-hu.json | 2 +- src/main/resources/assets/localization/id-id.json | 2 +- src/main/resources/assets/localization/it-it.json | 2 +- src/main/resources/assets/localization/nb-no.json | 2 +- src/main/resources/assets/localization/pt-pt.json | 2 +- src/main/resources/assets/localization/ru-ru.json | 2 +- src/main/resources/assets/localization/tr-tr.json | 2 +- src/main/resources/resources/recipes.json | 4 ++-- 24 files changed, 67 insertions(+), 42 deletions(-) diff --git a/src/main/java/minicraft/core/World.java b/src/main/java/minicraft/core/World.java index 4e5a2aa8d..3f9ef9362 100644 --- a/src/main/java/minicraft/core/World.java +++ b/src/main/java/minicraft/core/World.java @@ -134,7 +134,7 @@ public static void resetGame(boolean keepPlayer) { Logging.WORLD.trace("Generating level " + i + "..."); - LoadingDisplay.setMessage(Level.getDepthString(i)); + LoadingDisplay.setMessage(Level.getDepthString(i), false); levels[lvlIdx(i)] = new Level(worldSize, worldSize, random.nextLong(), i, levels[lvlIdx(i+1)], !WorldSelectDisplay.hasLoadedWorld()); LoadingDisplay.progress(loadingInc); diff --git a/src/main/java/minicraft/core/io/Settings.java b/src/main/java/minicraft/core/io/Settings.java index 77653aab8..82f5f9bcb 100644 --- a/src/main/java/minicraft/core/io/Settings.java +++ b/src/main/java/minicraft/core/io/Settings.java @@ -30,9 +30,9 @@ public final class Settings { options.put("type", new ArrayEntry<>("minicraft.settings.type", "minicraft.settings.type.island", "minicraft.settings.type.box", "minicraft.settings.type.mountain", "minicraft.settings.type.irregular")); // TODO localize these labels - options.put("tutorials", new BooleanEntry("Tutorials", false)); - options.put("quests", new BooleanEntry("Quests", false)); - options.put("showquests", new BooleanEntry("Quests Panel", true)); + options.put("tutorials", new BooleanEntry("minicraft.settings.tutorials", false)); + options.put("quests", new BooleanEntry("minicraft.settings.quests", false)); + options.put("showquests", new BooleanEntry("minicraft.settings.show_quests", true)); options.get("mode").setChangeAction(value -> options.get("scoretime").setVisible("minicraft.settings.mode.score".equals(value)) diff --git a/src/main/java/minicraft/item/Recipes.java b/src/main/java/minicraft/item/Recipes.java index d34e29cd0..5ea1a4b37 100644 --- a/src/main/java/minicraft/item/Recipes.java +++ b/src/main/java/minicraft/item/Recipes.java @@ -130,8 +130,8 @@ public class Recipes { enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); - enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); - enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); + enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "Gunpowder_2", "Leather Armor_1")); + enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "Gunpowder_3", "Lapis_7")); enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5","Cloud Ore_5")); enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5","Shard_15")); } diff --git a/src/main/java/minicraft/item/TileItem.java b/src/main/java/minicraft/item/TileItem.java index 0212fbdcd..c16a44876 100644 --- a/src/main/java/minicraft/item/TileItem.java +++ b/src/main/java/minicraft/item/TileItem.java @@ -62,11 +62,11 @@ protected static ArrayList getAllInstances() { // Creative mode available tiles: items.add(new TileItem("Farmland", SpriteLinker.missingTexture(SpriteType.Item), "farmland", "dirt", "grass", "hole")); - items.add(new TileItem("Exploded", SpriteLinker.missingTexture(SpriteType.Item), "explode", "dirt", "grass")); - items.add(new TileItem("hole", SpriteLinker.missingTexture(SpriteType.Item), "hole", "dirt", "grass")); - items.add(new TileItem("lava", SpriteLinker.missingTexture(SpriteType.Item), "lava", "dirt", "grass", "hole")); - items.add(new TileItem("path", SpriteLinker.missingTexture(SpriteType.Item), "path", "dirt", "grass", "hole")); - items.add(new TileItem("water", SpriteLinker.missingTexture(SpriteType.Item), "water", "dirt", "grass", "hole")); + items.add(new TileItem("Explode", SpriteLinker.missingTexture(SpriteType.Item), "explode", "dirt", "grass")); + items.add(new TileItem("Hole", SpriteLinker.missingTexture(SpriteType.Item), "hole", "dirt", "grass")); + items.add(new TileItem("Lava", SpriteLinker.missingTexture(SpriteType.Item), "lava", "dirt", "grass", "hole")); + items.add(new TileItem("Path", SpriteLinker.missingTexture(SpriteType.Item), "path", "dirt", "grass", "hole")); + items.add(new TileItem("Water", SpriteLinker.missingTexture(SpriteType.Item), "water", "dirt", "grass", "hole")); return items; } diff --git a/src/main/java/minicraft/saveload/Load.java b/src/main/java/minicraft/saveload/Load.java index 992fccd42..4517ac270 100644 --- a/src/main/java/minicraft/saveload/Load.java +++ b/src/main/java/minicraft/saveload/Load.java @@ -585,7 +585,7 @@ private void loadUnlocks(String filename) { private void loadWorld(String filename) { for(int l = World.maxLevelDepth; l >= World.minLevelDepth; l--) { - LoadingDisplay.setMessage(Level.getDepthString(l)); + LoadingDisplay.setMessage(Level.getDepthString(l), false); int lvlidx = World.lvlIdx(l); loadFromFile(location + filename + lvlidx + extension); diff --git a/src/main/java/minicraft/screen/InventoryMenu.java b/src/main/java/minicraft/screen/InventoryMenu.java index 21bb8df9f..4e6851bf0 100644 --- a/src/main/java/minicraft/screen/InventoryMenu.java +++ b/src/main/java/minicraft/screen/InventoryMenu.java @@ -20,9 +20,10 @@ class InventoryMenu extends ItemListMenu { } InventoryMenu(InventoryMenu model) { - super(ItemListMenu.getBuilder(), ItemEntry.useItems(model.inv.getItems()), model.getTitle()); + super(ItemListMenu.getBuilder(), ItemEntry.useItems(model.inv.getItems()), model.getTitle(), false); this.inv = model.inv; this.holder = model.holder; + this.creativeInv = model.creativeInv; setSelection(model.getSelection()); } diff --git a/src/main/java/minicraft/screen/ItemListMenu.java b/src/main/java/minicraft/screen/ItemListMenu.java index 6fea47075..3a40d018e 100644 --- a/src/main/java/minicraft/screen/ItemListMenu.java +++ b/src/main/java/minicraft/screen/ItemListMenu.java @@ -15,10 +15,11 @@ static Builder getBuilder(RelPos entryPos) { .setSearcherBar(true); } - protected ItemListMenu(Builder b, ItemEntry[] entries, String title) { + protected ItemListMenu(Builder b, ItemEntry[] entries, String title) { this(b, entries, title, true); } + protected ItemListMenu(Builder b, ItemEntry[] entries, String title, boolean localizeTitle) { super(b .setEntries(entries) - .setTitle(title) + .setTitle(title, localizeTitle) .createMenu() ); } diff --git a/src/main/java/minicraft/screen/LoadingDisplay.java b/src/main/java/minicraft/screen/LoadingDisplay.java index 62c2e20d6..fd4aa737c 100644 --- a/src/main/java/minicraft/screen/LoadingDisplay.java +++ b/src/main/java/minicraft/screen/LoadingDisplay.java @@ -18,6 +18,7 @@ public class LoadingDisplay extends Display { private static float percentage = 0; private static String progressType = ""; + private static boolean localizeProgressType = true; private final Timer t; private final Ellipsis ellipsis = new SmoothEllipsis(new TimeUpdater()); @@ -49,6 +50,7 @@ public void init(Display parent) { super.init(parent); percentage = 0; progressType = "minicraft.displays.loading.message.world"; + localizeProgressType = true; if (WorldSelectDisplay.hasLoadedWorld()) msg = "minicraft.displays.loading.message.loading"; else @@ -62,6 +64,7 @@ public void onExit() { if (!WorldSelectDisplay.hasLoadedWorld()) { msg = "minicraft.displays.loading.message.saving"; progressType = "minicraft.displays.loading.message.world"; + localizeProgressType = true; new Save(WorldSelectDisplay.getWorldName()); Game.notifications.clear(); } @@ -71,7 +74,11 @@ public static void setPercentage(float percent) { percentage = percent; } public static float getPercentage() { return percentage; } - public static void setMessage(String progressType) { LoadingDisplay.progressType = progressType; } + public static void setMessage(String progressType) { setMessage(progressType, true); } + public static void setMessage(String progressType, boolean localize) { + LoadingDisplay.progressType = progressType; + localizeProgressType = localize; + } public static void progress(float amt) { percentage = Math.min(100, percentage + amt); @@ -82,7 +89,8 @@ public void render(Screen screen) { super.render(screen); int percent = Math.round(percentage); Font.drawParagraph(screen, new FontStyle(Color.RED), 6, - Localization.getLocalized(msg) + (progressType.length() > 0 ? " " + Localization.getLocalized(progressType) : "") + ellipsis.updateAndGet(), + Localization.getLocalized(msg) + (progressType.length() > 0 ? " " + (localizeProgressType ? Localization.getLocalized(progressType) : progressType) : "") + + ellipsis.updateAndGet(), percent + "%" ); } diff --git a/src/main/java/minicraft/screen/Menu.java b/src/main/java/minicraft/screen/Menu.java index 21738dbad..86da04889 100644 --- a/src/main/java/minicraft/screen/Menu.java +++ b/src/main/java/minicraft/screen/Menu.java @@ -421,6 +421,7 @@ public static class Builder { @NotNull private RelPos titlePos = RelPos.TOP; private boolean fullTitleColor = false, setTitleColor = false; + private boolean localizeTitle = true; private int titleCol = Color.YELLOW; @NotNull private Point anchor = center; @@ -465,7 +466,12 @@ public Builder setBounds(Rectangle rect) { public Builder setTitlePos(RelPos rp) { titlePos = (rp == null ? RelPos.TOP : rp); return this; } - public Builder setTitle(String title) { menu.title = title; return this; } + public Builder setTitle(String title) { return setTitle(title, true); } + public Builder setTitle(String title, boolean localize) { + menu.title = title; + localizeTitle = localize; + return this; + } public Builder setTitle(String title, int color) { return setTitle(title, color, false); } public Builder setTitle(String title, int color, boolean fullColor) { @@ -519,7 +525,7 @@ private Menu createMenu(Builder b) { if(b == this) return copy().createMenu(this); - menu.title = Localization.getLocalized(menu.title); + if (localizeTitle) menu.title = Localization.getLocalized(menu.title); // set default selectability if(!setSelectable) { diff --git a/src/main/java/minicraft/screen/PauseDisplay.java b/src/main/java/minicraft/screen/PauseDisplay.java index 34a158d33..c9e95a272 100644 --- a/src/main/java/minicraft/screen/PauseDisplay.java +++ b/src/main/java/minicraft/screen/PauseDisplay.java @@ -39,7 +39,7 @@ public PauseDisplay() { new SelectEntry("minicraft.displays.pause.menu", () -> { ArrayList items = new ArrayList<>(Arrays.asList(StringEntry.useLines("minicraft.displays.pause.display.exit_popup.0"))); - items.addAll(Arrays.asList(StringEntry.useLines(Color.RED, Localization.getLocalized("minicraft.displays.pause.display.exit_popup.1")))); + items.addAll(Arrays.asList(StringEntry.useLines(Color.RED, "minicraft.displays.pause.display.exit_popup.1"))); items.add(new BlankEntry()); items.add(new SelectEntry("minicraft.displays.pause.display.exit_popup.cancel", Game::exitDisplay)); items.add(new SelectEntry("minicraft.displays.pause.display.exit_popup.quit", () -> { @@ -52,8 +52,8 @@ public PauseDisplay() { new BlankEntry(), - new StringEntry(upString, Color.GRAY), - new StringEntry(selectString, Color.GRAY) + new StringEntry(upString, Color.GRAY, false), + new StringEntry(selectString, Color.GRAY, false) )); menus = new Menu[] { diff --git a/src/main/java/minicraft/screen/PlayerInvDisplay.java b/src/main/java/minicraft/screen/PlayerInvDisplay.java index 0cdae98cf..65f2e7b98 100644 --- a/src/main/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/main/java/minicraft/screen/PlayerInvDisplay.java @@ -192,9 +192,7 @@ protected void onSelectionChange(int oldSel, int newSel) { private void update() { menus[0] = new InventoryMenu((InventoryMenu) menus[0]); - menus[1] = new InventoryMenu((InventoryMenu) menus[1]) {{ - creativeInv = true; - }}; + menus[1] = new InventoryMenu((InventoryMenu) menus[1]); menus[1].translate(menus[0].getBounds().getWidth() + padding, 0); onSelectionChange(0, selection); } diff --git a/src/main/java/minicraft/screen/TutorialDisplayHandler.java b/src/main/java/minicraft/screen/TutorialDisplayHandler.java index 06be9c594..0e6e8025e 100644 --- a/src/main/java/minicraft/screen/TutorialDisplayHandler.java +++ b/src/main/java/minicraft/screen/TutorialDisplayHandler.java @@ -157,7 +157,7 @@ public static void turnOffTutorials() { currentOngoingElement = null; Settings.set("tutorials", false); Logging.TUTORIAL.debug("Tutorial completed."); - Game.notifications.add(Localization.getLocalized("minicraft.notification.tutorial_completed")); + Game.notifications.add(Localization.getLocalized("minicraft.notification.tutorials_completed")); } private static void turnOffGuides() { @@ -202,7 +202,7 @@ public static void tick(InputHandler input) { /** Rendering directly on the GUI/HUD. */ public static void render(Screen screen) { if (currentGuide != null) { // Is ongoing. - String[] lines = Font.getLines(Localization.getLocalized(currentGuide.display.get()), Screen.w, Screen.h, 0); + String[] lines = Font.getLines(currentGuide.display.get(), Screen.w, Screen.h, 0); if (ControlGuide.animation > 0) { int textWidth = Font.textWidth(lines); int xPadding = Screen.w/2 - (textWidth + 8)/2; diff --git a/src/main/java/minicraft/screen/entry/StringEntry.java b/src/main/java/minicraft/screen/entry/StringEntry.java index de22241aa..600a25ffe 100644 --- a/src/main/java/minicraft/screen/entry/StringEntry.java +++ b/src/main/java/minicraft/screen/entry/StringEntry.java @@ -7,6 +7,7 @@ import minicraft.gfx.Screen; import java.util.ArrayList; +import java.util.Arrays; // an unselectable line. public class StringEntry extends ListEntry { @@ -27,11 +28,11 @@ public static StringEntry[] useLines(String... lines) { public static StringEntry[] useLines(int color, boolean localize, String... lines) { ArrayList lns = new ArrayList<>(); for (String l : lines) { - for (String ll : Font.getLines(localize? Localization.getLocalized(l): l, Screen.w-20, Screen.h*2, 0)) lns.add(ll); + lns.addAll(Arrays.asList(Font.getLines(localize ? Localization.getLocalized(l) : l, Screen.w - 20, Screen.h * 2, 0))); } StringEntry[] entries = new StringEntry[lns.size()]; for (int i = 0; i < lns.size(); i++) - entries[i] = new StringEntry(lns.get(i), color); + entries[i] = new StringEntry(lns.get(i), color, false); return entries; } diff --git a/src/main/resources/assets/localization/en-us.json b/src/main/resources/assets/localization/en-us.json index 5104b46ff..8f14bcb56 100644 --- a/src/main/resources/assets/localization/en-us.json +++ b/src/main/resources/assets/localization/en-us.json @@ -233,6 +233,7 @@ "minicraft.notification.wrong_level_dungeon": "Can only be summoned on the dungeon level", "minicraft.notification.boss_limit": "No more bosses can be spawned", "minicraft.notification.spawn_on_boss_tile": "Can only be summoned in the Boss Room", + "minicraft.notification.tutorials_completed": "Tutorials are completed.", "minicraft.notifications.statue_tapped": "You hear echoed whispers...", "minicraft.notifications.statue_touched": "You hear the statue vibrating...", "minicraft.quest.farming": "Farming Farmer", @@ -297,6 +298,9 @@ "minicraft.settings.type.box": "Box", "minicraft.settings.type.mountain": "Mountain", "minicraft.settings.type.irregular": "Irregular", + "minicraft.settings.tutorials": "Tutorials", + "minicraft.settings.quests": "Quests", + "minicraft.settings.show_quests": "Quest Panel", "minicraft.skin.paul": "Paul", "minicraft.skin.paul_cape": "Paul with cape", "minicraft.skin.minecraft_steve": "Familiar boy", @@ -396,7 +400,7 @@ "Gold": "Gold", "Lapis": "Lapis", "Rose": "Rose", - "GunPowder": "GunPowder", + "Gunpowder": "Gunpowder", "Slime": "Slime", "glass": "glass", "cloth": "cloth", @@ -467,5 +471,11 @@ "Infinite Fall": "Infinite Fall", "Cloud Cactus": "Cloud Cactus", "Raw Obsidian": "Raw Obsidian", - "Totem of Air": "Totem of Air" + "Totem of Air": "Totem of Air", + "Dungeon Chest": "Dungeon Chest", + "Path": "Path", + "Glass Bottle": "Glass Bottle", + "Awkward Potion": "Awkward Potion", + "Obsidian Poppet": "Obsidian Poppet", + "Obsidian Heart": "Obsidian Heart" } diff --git a/src/main/resources/assets/localization/es-es.json b/src/main/resources/assets/localization/es-es.json index e29d00a66..35a1b3bb5 100644 --- a/src/main/resources/assets/localization/es-es.json +++ b/src/main/resources/assets/localization/es-es.json @@ -134,7 +134,7 @@ "Iron": "Hierro", "Gold": "Oro", "Rose": "Rosa", - "GunPowder": "Pólvora", + "Gunpowder": "Pólvora", "Slime": "Slime", "glass": "cristal", "cloth": "paño", diff --git a/src/main/resources/assets/localization/fr-fr.json b/src/main/resources/assets/localization/fr-fr.json index 4f8069960..a16eb3d57 100644 --- a/src/main/resources/assets/localization/fr-fr.json +++ b/src/main/resources/assets/localization/fr-fr.json @@ -131,7 +131,7 @@ "Iron": "Fer", "Gold": "Or", "Rose": "Rose", - "GunPowder": "PoudreACanon", + "Gunpowder": "PoudreACanon", "Slime": "Slime", "glass": "verre", "cloth": "chiffon", diff --git a/src/main/resources/assets/localization/hu-hu.json b/src/main/resources/assets/localization/hu-hu.json index e879b0b90..4af10d3b0 100644 --- a/src/main/resources/assets/localization/hu-hu.json +++ b/src/main/resources/assets/localization/hu-hu.json @@ -134,7 +134,7 @@ "Iron": "Vas", "Gold": "Arany", "Rose": "Rózsa", - "GunPowder": "Puskapor", + "Gunpowder": "Puskapor", "Slime": "Nyálka", "glass": "Üveg", "cloth": "Szövet", diff --git a/src/main/resources/assets/localization/id-id.json b/src/main/resources/assets/localization/id-id.json index 667435ccc..6493866ee 100644 --- a/src/main/resources/assets/localization/id-id.json +++ b/src/main/resources/assets/localization/id-id.json @@ -134,7 +134,7 @@ "Iron": "Besi", "Gold": "Emas", "Rose": "Bunga Mawar", - "GunPowder": "Bubuk Mesiu", + "Gunpowder": "Bubuk Mesiu", "Slime": "lendir", "glass": "kaca", "cloth": "kain", diff --git a/src/main/resources/assets/localization/it-it.json b/src/main/resources/assets/localization/it-it.json index 4a8a54c43..bb24b70b1 100644 --- a/src/main/resources/assets/localization/it-it.json +++ b/src/main/resources/assets/localization/it-it.json @@ -134,7 +134,7 @@ "Iron": "Ferro", "Gold": "Oro", "Rose": "Rosa", - "GunPowder": "Polvere da sparo", + "Gunpowder": "Polvere da sparo", "Slime": "Slime", "glass": "vetro", "cloth": "stoffa", diff --git a/src/main/resources/assets/localization/nb-no.json b/src/main/resources/assets/localization/nb-no.json index 81ecd8049..b2188a7a7 100644 --- a/src/main/resources/assets/localization/nb-no.json +++ b/src/main/resources/assets/localization/nb-no.json @@ -147,7 +147,7 @@ "Gold": "Gull", "Lapis": "Lapis", "Rose": "Rose", - "GunPowder": "Krutt", + "Gunpowder": "Krutt", "Slime": "Slim", "glass": "glass", "cloth": "tøystykke", diff --git a/src/main/resources/assets/localization/pt-pt.json b/src/main/resources/assets/localization/pt-pt.json index 9d2690063..92b60af95 100644 --- a/src/main/resources/assets/localization/pt-pt.json +++ b/src/main/resources/assets/localization/pt-pt.json @@ -134,7 +134,7 @@ "Iron": "Ferro", "Gold": "Ouro", "Rose": "Rosa", - "GunPowder": "Pólvora", + "Gunpowder": "Pólvora", "Slime": "Gosma", "glass": "Vidro", "cloth": "Tecido", diff --git a/src/main/resources/assets/localization/ru-ru.json b/src/main/resources/assets/localization/ru-ru.json index 04cde3322..b641a3665 100644 --- a/src/main/resources/assets/localization/ru-ru.json +++ b/src/main/resources/assets/localization/ru-ru.json @@ -147,7 +147,7 @@ "Iron": "Железный слиток", "Gold": "Золотой слиток", "Rose": "Роза", - "GunPowder": "Порох", + "Gunpowder": "Порох", "Slime": "Слизь", "glass": "Стекло", "cloth": "Ткань", diff --git a/src/main/resources/assets/localization/tr-tr.json b/src/main/resources/assets/localization/tr-tr.json index 397b17dc0..f265f8e00 100644 --- a/src/main/resources/assets/localization/tr-tr.json +++ b/src/main/resources/assets/localization/tr-tr.json @@ -134,7 +134,7 @@ "Iron": "Demir", "Gold": "Altın", "Rose": "Gül", - "GunPowder": "Barut", + "Gunpowder": "Barut", "Slime": "Balçık", "glass": "Cam", "cloth": "Kumaş", diff --git a/src/main/resources/resources/recipes.json b/src/main/resources/resources/recipes.json index 335f7e8c2..78d59cfc4 100644 --- a/src/main/resources/resources/recipes.json +++ b/src/main/resources/resources/recipes.json @@ -3713,7 +3713,7 @@ ], "rewards": { "recipes": { - "Health potion_1": ["awkward potion_1", "GunPowder_2", "Leather Armor_1"] + "Health potion_1": ["awkward potion_1", "Gunpowder_2", "Leather Armor_1"] } } }, @@ -3765,7 +3765,7 @@ ], "rewards": { "recipes": { - "Escape potion_1": ["awkward potion_1", "GunPowder_3", "Lapis_7"] + "Escape potion_1": ["awkward potion_1", "Gunpowder_3", "Lapis_7"] } } }, From 01b12b5e629a73dec98101570607f42669c142af Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Jun 2023 22:06:53 +0800 Subject: [PATCH 035/261] Fixes the second localization request of menu titles --- src/main/java/minicraft/screen/Menu.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/minicraft/screen/Menu.java b/src/main/java/minicraft/screen/Menu.java index 86da04889..a3cbfe8a5 100644 --- a/src/main/java/minicraft/screen/Menu.java +++ b/src/main/java/minicraft/screen/Menu.java @@ -683,6 +683,7 @@ public Builder copy() { b.titlePos = titlePos; b.fullTitleColor = fullTitleColor; b.setTitleColor = setTitleColor; + b.localizeTitle = localizeTitle; b.titleCol = titleCol; b.searcherBar = searcherBar; From 95330fde260a06e9217550813e16877ba3887ef2 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 17 Jun 2023 11:52:48 +0800 Subject: [PATCH 036/261] Update en-us.json --- src/main/resources/assets/localization/en-us.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/assets/localization/en-us.json b/src/main/resources/assets/localization/en-us.json index 8f14bcb56..690a24133 100644 --- a/src/main/resources/assets/localization/en-us.json +++ b/src/main/resources/assets/localization/en-us.json @@ -145,6 +145,7 @@ "minicraft.displays.options_world": "World Options", "minicraft.displays.options_world.off_tutorials_confirm_popup": "Are you sure you want to turn off the tutorials forever?", "minicraft.displays.options_world.turn_off_tutorials": "Turn off tutorials", + "minicraft.displays.options_world.skip_current_tutorial": "Skip current tutorial", "minicraft.displays.pause": "Paused", "minicraft.displays.pause.display.exit_popup.0": "Are you sure you want to exit the game?", "minicraft.displays.pause.display.exit_popup.1": "All unsaved progress will be lost", From 2035086be2d48e46b5a555e2f3f403b4b5b50ef4 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 21 Jun 2023 16:54:29 +0800 Subject: [PATCH 037/261] Remove bone meal --- src/main/java/minicraft/item/Recipes.java | 3 +-- src/main/java/minicraft/item/StackableItem.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/minicraft/item/Recipes.java b/src/main/java/minicraft/item/Recipes.java index 1e593dd23..534561380 100644 --- a/src/main/java/minicraft/item/Recipes.java +++ b/src/main/java/minicraft/item/Recipes.java @@ -57,7 +57,6 @@ public class Recipes { workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); - workbenchRecipes.add(new Recipe("Bone Meal_3", "Bone_1")); workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); @@ -136,6 +135,6 @@ public class Recipes { enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); - enchantRecipes.add(new Recipe("Arcane Fertilizer_1", "Lapis_2", "Bone Meal_2")); + enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); } } diff --git a/src/main/java/minicraft/item/StackableItem.java b/src/main/java/minicraft/item/StackableItem.java index 589da4d88..f0cfb9f7f 100644 --- a/src/main/java/minicraft/item/StackableItem.java +++ b/src/main/java/minicraft/item/StackableItem.java @@ -39,7 +39,6 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Glass Bottle", new LinkedSprite(SpriteType.Item, "glass_bottle"))); items.add(new StackableItem("Tomato", new LinkedSprite(SpriteType.Item, "tomato"))); items.add(new StackableItem("Bone", new LinkedSprite(SpriteType.Item, "bone"))); - items.add(new StackableItem("Bone Meal", new LinkedSprite(SpriteType.Item, "bone_meal"))); return items; } From 46a8f59de86136a809a0bf6f0e8e291732e3ddbb Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 22 Jun 2023 10:34:24 +0800 Subject: [PATCH 038/261] Rename original directional variables --- .../java/minicraft/level/tile/TreeTile.java | 24 +++++++------- .../level/tile/farming/CropTile.java | 32 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/minicraft/level/tile/TreeTile.java b/src/main/java/minicraft/level/tile/TreeTile.java index faa9221a5..3e704bf23 100644 --- a/src/main/java/minicraft/level/tile/TreeTile.java +++ b/src/main/java/minicraft/level/tile/TreeTile.java @@ -70,37 +70,37 @@ public void render(Screen screen, Level level, int x, int y) { Tiles.get("Grass").render(screen, level, x, y); TreeType thisType = level.treeTypes[x + y * level.w]; - boolean u = level.getTile(x, y - 1) == this && thisType == level.treeTypes[x + (y - 1) * level.w]; - boolean l = level.getTile(x - 1, y) == this && thisType == level.treeTypes[(x - 1) + y * level.w]; - boolean r = level.getTile(x + 1, y) == this && thisType == level.treeTypes[(x + 1) + y * level.w]; - boolean d = level.getTile(x, y + 1) == this && thisType == level.treeTypes[x + (y + 1) * level.w]; - boolean ul = level.getTile(x - 1, y - 1) == this && thisType == level.treeTypes[(x - 1) + (y - 1) * level.w]; - boolean ur = level.getTile(x + 1, y - 1) == this && thisType == level.treeTypes[(x + 1) + (y - 1) * level.w]; - boolean dl = level.getTile(x - 1, y + 1) == this && thisType == level.treeTypes[(x - 1) + (y + 1) * level.w]; - boolean dr = level.getTile(x + 1, y + 1) == this && thisType == level.treeTypes[(x + 1) + (y + 1) * level.w]; + boolean up = level.getTile(x, y - 1) == this && thisType == level.treeTypes[x + (y - 1) * level.w]; + boolean left = level.getTile(x - 1, y) == this && thisType == level.treeTypes[(x - 1) + y * level.w]; + boolean right = level.getTile(x + 1, y) == this && thisType == level.treeTypes[(x + 1) + y * level.w]; + boolean down = level.getTile(x, y + 1) == this && thisType == level.treeTypes[x + (y + 1) * level.w]; + boolean upLeft = level.getTile(x - 1, y - 1) == this && thisType == level.treeTypes[(x - 1) + (y - 1) * level.w]; + boolean upRight = level.getTile(x + 1, y - 1) == this && thisType == level.treeTypes[(x + 1) + (y - 1) * level.w]; + boolean downLeft = level.getTile(x - 1, y + 1) == this && thisType == level.treeTypes[(x - 1) + (y + 1) * level.w]; + boolean downRight = level.getTile(x + 1, y + 1) == this && thisType == level.treeTypes[(x + 1) + (y + 1) * level.w]; Sprite sprite = level.treeTypes[x + y * level.w].treeSprite.getSprite(); Sprite spriteFull = level.treeTypes[x + y * level.w].treeSpriteFull.getSprite(); - if (u && ul && l) { + if (up && upLeft && left) { screen.render(x * 16 + 0, y * 16, spriteFull.spritePixels[0][1]); } else { screen.render(x * 16 + 0, y * 16, sprite.spritePixels[0][0]); } - if (u && ur && r) { + if (up && upRight && right) { screen.render(x * 16 + 8, y * 16, spriteFull.spritePixels[0][0]); } else { screen.render(x * 16 + 8, y * 16, sprite.spritePixels[0][1]); } - if (d && dl && l) { + if (down && downLeft && left) { screen.render(x * 16 + 0, y * 16 + 8, spriteFull.spritePixels[1][1]); } else { screen.render(x * 16 + 0, y * 16 + 8, sprite.spritePixels[1][0]); } - if (d && dr && r) { + if (down && downRight && right) { screen.render(x * 16 + 8, y * 16 + 8, spriteFull.spritePixels[1][0]); } else { screen.render(x * 16 + 8, y * 16 + 8, sprite.spritePixels[1][1]); diff --git a/src/main/java/minicraft/level/tile/farming/CropTile.java b/src/main/java/minicraft/level/tile/farming/CropTile.java index a1b50e821..1f8466d25 100644 --- a/src/main/java/minicraft/level/tile/farming/CropTile.java +++ b/src/main/java/minicraft/level/tile/farming/CropTile.java @@ -58,27 +58,27 @@ public boolean tick(Level level, int xt, int yt) { } } - boolean u = level.getTile(xt, yt - 1) == this; - boolean d = level.getTile(xt, yt + 1) == this; - boolean l = level.getTile(xt - 1, yt) == this; - boolean r = level.getTile(xt + 1, yt) == this; - boolean ul = level.getTile(xt - 1, yt - 1) == this; - boolean dl = level.getTile(xt - 1, yt + 1) == this; - boolean ur = level.getTile(xt + 1, yt - 1) == this; - boolean dr = level.getTile(xt + 1, yt + 1) == this; - if (u && d && l && r && ul && dl && ur && dr) + boolean up = level.getTile(xt, yt - 1) == this; + boolean down = level.getTile(xt, yt + 1) == this; + boolean left = level.getTile(xt - 1, yt) == this; + boolean right = level.getTile(xt + 1, yt) == this; + boolean upLeft = level.getTile(xt - 1, yt - 1) == this; + boolean downLeft = level.getTile(xt - 1, yt + 1) == this; + boolean upRight = level.getTile(xt + 1, yt - 1) == this; + boolean downRight = level.getTile(xt + 1, yt + 1) == this; + if (up && down && left && right && upLeft && downLeft && upRight && downRight) points /= 2; else { - if (u && d && l && r) + if (up && down && left && right) points *= 0.75; - if (u && (d && (l || r) || l && r) || d && l && r) // Either 3 of 4 directions. + if (up && (down && (left || right) || left && right) || down && left && right) // Either 3 of 4 directions. points *= 0.85; - if (ul && (dr || dl || ur) || dl && (ur || dr) || ur && dr) // Either 2 of 4 directions. + if (upLeft && (downRight || downLeft || upRight) || downLeft && (upRight || downRight) || upRight && downRight) // Either 2 of 4 directions. points *= 0.9; - if (ul) points *= 0.98125; - if (dl) points *= 0.98125; - if (ur) points *= 0.98125; - if (dr) points *= 0.98125; + if (upLeft) points *= 0.98125; + if (downLeft) points *= 0.98125; + if (upRight) points *= 0.98125; + if (downRight) points *= 0.98125; } if (random.nextInt((int) (100/points) + 1) < (fertilization/30 + 1)) // fertilization >= 0 From 6059419a8917a41eb8bb896edf9b1be7ae0119a6 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 23 Jun 2023 01:08:18 +0800 Subject: [PATCH 039/261] Update InfoDisplay.java --- src/main/java/minicraft/screen/InfoDisplay.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/minicraft/screen/InfoDisplay.java b/src/main/java/minicraft/screen/InfoDisplay.java index 7e1feb2c3..a476bc0fd 100644 --- a/src/main/java/minicraft/screen/InfoDisplay.java +++ b/src/main/java/minicraft/screen/InfoDisplay.java @@ -4,6 +4,7 @@ import minicraft.core.Updater; import minicraft.core.io.InputHandler; import minicraft.core.io.Localization; +import minicraft.gfx.Color; import minicraft.gfx.MinicraftImage; import minicraft.gfx.Point; import minicraft.screen.entry.StringEntry; @@ -12,7 +13,7 @@ public class InfoDisplay extends Display { public InfoDisplay() { //noinspection SuspiciousNameCombination - super(new Menu.Builder(true, 4, RelPos.LEFT, StringEntry.useLines( + super(new Menu.Builder(true, 4, RelPos.LEFT, StringEntry.useLines(Color.WHITE, false, "----------------------------", Localization.getLocalized("minicraft.displays.info.display.time", getTimeString()), Localization.getLocalized("minicraft.displays.info.display.score", Game.player.getScore()), From ab93a368d0e8e0eb3eed272ba27dd73650506ba5 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 23 Jun 2023 18:37:39 +0800 Subject: [PATCH 040/261] Add comment to directional variables --- src/main/java/minicraft/level/tile/TreeTile.java | 1 + src/main/java/minicraft/level/tile/farming/CropTile.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/minicraft/level/tile/TreeTile.java b/src/main/java/minicraft/level/tile/TreeTile.java index 3e704bf23..7b173625c 100644 --- a/src/main/java/minicraft/level/tile/TreeTile.java +++ b/src/main/java/minicraft/level/tile/TreeTile.java @@ -70,6 +70,7 @@ public void render(Screen screen, Level level, int x, int y) { Tiles.get("Grass").render(screen, level, x, y); TreeType thisType = level.treeTypes[x + y * level.w]; + // Checking whether the target direction has targeted the same TreeTile boolean up = level.getTile(x, y - 1) == this && thisType == level.treeTypes[x + (y - 1) * level.w]; boolean left = level.getTile(x - 1, y) == this && thisType == level.treeTypes[(x - 1) + y * level.w]; boolean right = level.getTile(x + 1, y) == this && thisType == level.treeTypes[(x + 1) + y * level.w]; diff --git a/src/main/java/minicraft/level/tile/farming/CropTile.java b/src/main/java/minicraft/level/tile/farming/CropTile.java index 1f8466d25..07ce463a1 100644 --- a/src/main/java/minicraft/level/tile/farming/CropTile.java +++ b/src/main/java/minicraft/level/tile/farming/CropTile.java @@ -58,6 +58,7 @@ public boolean tick(Level level, int xt, int yt) { } } + // Checking whether the target direction has targeted the same CropTile boolean up = level.getTile(xt, yt - 1) == this; boolean down = level.getTile(xt, yt + 1) == this; boolean left = level.getTile(xt - 1, yt) == this; From 3c95d8c40232588da466b52f0bfaa64adf291fff Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Jun 2023 01:10:01 +0800 Subject: [PATCH 041/261] Update TreeTile.java --- .../java/minicraft/level/tile/TreeTile.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/client/java/minicraft/level/tile/TreeTile.java b/src/client/java/minicraft/level/tile/TreeTile.java index 7b173625c..c4e5c8f3a 100644 --- a/src/client/java/minicraft/level/tile/TreeTile.java +++ b/src/client/java/minicraft/level/tile/TreeTile.java @@ -71,37 +71,37 @@ public void render(Screen screen, Level level, int x, int y) { TreeType thisType = level.treeTypes[x + y * level.w]; // Checking whether the target direction has targeted the same TreeTile - boolean up = level.getTile(x, y - 1) == this && thisType == level.treeTypes[x + (y - 1) * level.w]; - boolean left = level.getTile(x - 1, y) == this && thisType == level.treeTypes[(x - 1) + y * level.w]; - boolean right = level.getTile(x + 1, y) == this && thisType == level.treeTypes[(x + 1) + y * level.w]; - boolean down = level.getTile(x, y + 1) == this && thisType == level.treeTypes[x + (y + 1) * level.w]; - boolean upLeft = level.getTile(x - 1, y - 1) == this && thisType == level.treeTypes[(x - 1) + (y - 1) * level.w]; - boolean upRight = level.getTile(x + 1, y - 1) == this && thisType == level.treeTypes[(x + 1) + (y - 1) * level.w]; - boolean downLeft = level.getTile(x - 1, y + 1) == this && thisType == level.treeTypes[(x - 1) + (y + 1) * level.w]; - boolean downRight = level.getTile(x + 1, y + 1) == this && thisType == level.treeTypes[(x + 1) + (y + 1) * level.w]; + boolean isUpTileSame = level.getTile(x, y - 1) == this && thisType == level.treeTypes[x + (y - 1) * level.w]; + boolean isLeftTileSame = level.getTile(x - 1, y) == this && thisType == level.treeTypes[(x - 1) + y * level.w]; + boolean isRightTileSame = level.getTile(x + 1, y) == this && thisType == level.treeTypes[(x + 1) + y * level.w]; + boolean isDownTileSame = level.getTile(x, y + 1) == this && thisType == level.treeTypes[x + (y + 1) * level.w]; + boolean isUpLeftTileSame = level.getTile(x - 1, y - 1) == this && thisType == level.treeTypes[(x - 1) + (y - 1) * level.w]; + boolean isUpRightTileSame = level.getTile(x + 1, y - 1) == this && thisType == level.treeTypes[(x + 1) + (y - 1) * level.w]; + boolean isDownLeftTileSame = level.getTile(x - 1, y + 1) == this && thisType == level.treeTypes[(x - 1) + (y + 1) * level.w]; + boolean isDownRightTileSame = level.getTile(x + 1, y + 1) == this && thisType == level.treeTypes[(x + 1) + (y + 1) * level.w]; Sprite sprite = level.treeTypes[x + y * level.w].treeSprite.getSprite(); Sprite spriteFull = level.treeTypes[x + y * level.w].treeSpriteFull.getSprite(); - if (up && upLeft && left) { + if (isUpTileSame && isUpLeftTileSame && isLeftTileSame) { screen.render(x * 16 + 0, y * 16, spriteFull.spritePixels[0][1]); } else { screen.render(x * 16 + 0, y * 16, sprite.spritePixels[0][0]); } - if (up && upRight && right) { + if (isUpTileSame && isUpRightTileSame && isRightTileSame) { screen.render(x * 16 + 8, y * 16, spriteFull.spritePixels[0][0]); } else { screen.render(x * 16 + 8, y * 16, sprite.spritePixels[0][1]); } - if (down && downLeft && left) { + if (isDownTileSame && isDownLeftTileSame && isLeftTileSame) { screen.render(x * 16 + 0, y * 16 + 8, spriteFull.spritePixels[1][1]); } else { screen.render(x * 16 + 0, y * 16 + 8, sprite.spritePixels[1][0]); } - if (down && downRight && right) { + if (isDownTileSame && isDownRightTileSame && isRightTileSame) { screen.render(x * 16 + 8, y * 16 + 8, spriteFull.spritePixels[1][0]); } else { screen.render(x * 16 + 8, y * 16 + 8, sprite.spritePixels[1][1]); From 21fcf2a255b90204e273c3d94e2f71cd1e6471a8 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Jun 2023 02:15:13 +0800 Subject: [PATCH 042/261] Update Menu.java --- src/client/java/minicraft/screen/Menu.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index a3cbfe8a5..acd08e77f 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -421,7 +421,6 @@ public static class Builder { @NotNull private RelPos titlePos = RelPos.TOP; private boolean fullTitleColor = false, setTitleColor = false; - private boolean localizeTitle = true; private int titleCol = Color.YELLOW; @NotNull private Point anchor = center; @@ -468,8 +467,7 @@ public Builder setBounds(Rectangle rect) { public Builder setTitle(String title) { return setTitle(title, true); } public Builder setTitle(String title, boolean localize) { - menu.title = title; - localizeTitle = localize; + menu.title = localize ? Localization.getLocalized(title) : title; return this; } @@ -525,7 +523,7 @@ private Menu createMenu(Builder b) { if(b == this) return copy().createMenu(this); - if (localizeTitle) menu.title = Localization.getLocalized(menu.title); + menu.title = Localization.getLocalized(menu.title); // set default selectability if(!setSelectable) { @@ -683,7 +681,6 @@ public Builder copy() { b.titlePos = titlePos; b.fullTitleColor = fullTitleColor; b.setTitleColor = setTitleColor; - b.localizeTitle = localizeTitle; b.titleCol = titleCol; b.searcherBar = searcherBar; From 2ce95dbce42772f44c9786b317110e04d6074475 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Jun 2023 02:21:06 +0800 Subject: [PATCH 043/261] Remove tall grass --- src/client/java/minicraft/entity/mob/Cow.java | 1 - .../java/minicraft/entity/mob/Sheep.java | 1 - src/client/java/minicraft/level/LevelGen.java | 4 -- .../java/minicraft/level/tile/GrassTile.java | 2 - .../minicraft/level/tile/TallGrassTile.java | 59 ------------------ .../java/minicraft/level/tile/Tiles.java | 6 +- .../textures/tile/double_tall_grass.png | Bin 244 -> 0 bytes .../assets/textures/tile/tall_grass.png | Bin 230 -> 0 bytes 8 files changed, 2 insertions(+), 71 deletions(-) delete mode 100644 src/client/java/minicraft/level/tile/TallGrassTile.java delete mode 100644 src/client/resources/assets/textures/tile/double_tall_grass.png delete mode 100644 src/client/resources/assets/textures/tile/tall_grass.png diff --git a/src/client/java/minicraft/entity/mob/Cow.java b/src/client/java/minicraft/entity/mob/Cow.java index 2a8df907a..d7457a910 100644 --- a/src/client/java/minicraft/entity/mob/Cow.java +++ b/src/client/java/minicraft/entity/mob/Cow.java @@ -4,7 +4,6 @@ import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.item.Items; import minicraft.level.tile.GrassTile; -import minicraft.level.tile.TallGrassTile; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; diff --git a/src/client/java/minicraft/entity/mob/Sheep.java b/src/client/java/minicraft/entity/mob/Sheep.java index d73955e00..961a74440 100644 --- a/src/client/java/minicraft/entity/mob/Sheep.java +++ b/src/client/java/minicraft/entity/mob/Sheep.java @@ -9,7 +9,6 @@ import minicraft.item.ToolItem; import minicraft.item.ToolType; import minicraft.level.tile.GrassTile; -import minicraft.level.tile.TallGrassTile; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import org.jetbrains.annotations.Nullable; diff --git a/src/client/java/minicraft/level/LevelGen.java b/src/client/java/minicraft/level/LevelGen.java index ca63ba029..a12411cbe 100644 --- a/src/client/java/minicraft/level/LevelGen.java +++ b/src/client/java/minicraft/level/LevelGen.java @@ -3,9 +3,7 @@ import minicraft.core.Game; import minicraft.core.io.Settings; import minicraft.gfx.Rectangle; -import minicraft.level.tile.TallGrassTile; import minicraft.level.tile.Tiles; -import minicraft.level.tile.TreeTile; import minicraft.screen.RelPos; import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; @@ -15,9 +13,7 @@ import java.awt.Image; import java.awt.image.BufferedImage; -import java.util.List; import java.util.Random; -import java.util.function.BiFunction; public class LevelGen { private static long worldSeed = 0; diff --git a/src/client/java/minicraft/level/tile/GrassTile.java b/src/client/java/minicraft/level/tile/GrassTile.java index 983cb9631..4eed505ca 100644 --- a/src/client/java/minicraft/level/tile/GrassTile.java +++ b/src/client/java/minicraft/level/tile/GrassTile.java @@ -125,7 +125,5 @@ public void performPlantBoost(Level level, int x, int y) { static { // The left-hand-sided data is tile id; the right-hand-sided data is tile data. boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 0)); boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 1)); - boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 52, (short) 0)); - boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 53, (short) 0)); } } diff --git a/src/client/java/minicraft/level/tile/TallGrassTile.java b/src/client/java/minicraft/level/tile/TallGrassTile.java deleted file mode 100644 index f2a0097e0..000000000 --- a/src/client/java/minicraft/level/tile/TallGrassTile.java +++ /dev/null @@ -1,59 +0,0 @@ -package minicraft.level.tile; - -import minicraft.core.io.Sound; -import minicraft.entity.Direction; -import minicraft.entity.mob.Mob; -import minicraft.entity.mob.Player; -import minicraft.gfx.Screen; -import minicraft.gfx.SpriteAnimation; -import minicraft.gfx.SpriteLinker; -import minicraft.item.Item; -import minicraft.item.Items; -import minicraft.level.Level; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -public class TallGrassTile extends Tile { - public enum TallGrassType { - GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "tall_grass")), - TALL_GRASS(new SpriteAnimation(SpriteLinker.SpriteType.Tile, "double_tall_grass")); - - private final SpriteAnimation sprite; - - TallGrassType(SpriteAnimation sprite) { - this.sprite = sprite.setConnectChecker((tile, side) -> !side || tile.connectsToGrass) - .setSingletonWithConnective(true); - } - } - - public static final List grassIDs = Collections.unmodifiableList(Arrays.asList( - (short) 52, (short) 53)); - - protected TallGrassTile(String name, TallGrassType type) { - super(name, type.sprite); - connectsToGrass = true; - } - - @Override - public void render(Screen screen, Level level, int x, int y) { - Tiles.get("grass").render(screen, level, x, y); - sprite.render(screen, level, x, y); - } - - public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - level.setTile(xt, yt, Tiles.get("Grass")); - Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, 0, 1, Items.get("Wheat Seeds")); - return true; - } - - @Override - public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { - level.setTile(x, y, Tiles.get("Grass")); - Sound.play("monsterhurt"); - level.dropItem(x * 16 + 8, y * 16 + 8, 0, 1, Items.get("Wheat Seeds")); - return true; - } -} diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index c31e75c90..a5c3749d4 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -79,10 +79,8 @@ public static void initTileList() { tiles.put((short)49, new BossDoorTile()); tiles.put((short)50, new TomatoTile("Tomato")); tiles.put((short)51, new CarrotTile("Carrot")); - tiles.put((short)52, new TallGrassTile("Tall Grass", TallGrassTile.TallGrassType.GRASS)); - tiles.put((short)53, new TallGrassTile("Double Tall Grass", TallGrassTile.TallGrassType.TALL_GRASS)); - tiles.put((short)54, new HeavenlyBerriesTile("Heavenly Berries")); - tiles.put((short)55, new HellishBerriesTile("Hellish Berries")); + tiles.put((short)52, new HeavenlyBerriesTile("Heavenly Berries")); + tiles.put((short)53, new HellishBerriesTile("Hellish Berries")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/client/resources/assets/textures/tile/double_tall_grass.png b/src/client/resources/assets/textures/tile/double_tall_grass.png deleted file mode 100644 index fd0ed4f197b8f8ef0cabc7f031d3719cecab4742..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|-o;CaD*GyQz~e1QUv-P?A8)RhGJ1^@s5pTR+EjeE=iyTl9RzA{w@YdTb{Yw{4>XS8?+Z%f{VvL&GgjH)ZWl@Am;vok&T g9If&FgzR1Z8=8yFVdQ&MBb@0IBa$JOBUy diff --git a/src/client/resources/assets/textures/tile/tall_grass.png b/src/client/resources/assets/textures/tile/tall_grass.png deleted file mode 100644 index 1262cf7a83dfd1f7904ed56b16deded1809633e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|-o;CaD*GyQz~e1QUv-P?A8)RhGJ1^@s5pTR+E`!)N!|be From 878e2e89acf7027d6a9ef4fb32f413d93de8e9bf Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Jun 2023 02:21:53 +0800 Subject: [PATCH 044/261] Resolve errors --- src/client/java/minicraft/entity/mob/Cow.java | 2 -- src/client/java/minicraft/entity/mob/Sheep.java | 3 --- src/client/java/minicraft/level/LevelGen.java | 12 ------------ 3 files changed, 17 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/Cow.java b/src/client/java/minicraft/entity/mob/Cow.java index d7457a910..5effb7cd9 100644 --- a/src/client/java/minicraft/entity/mob/Cow.java +++ b/src/client/java/minicraft/entity/mob/Cow.java @@ -35,8 +35,6 @@ public void tick() { Tile tile = level.getTile(x >> 4, y >> 4); if (tile instanceof GrassTile) { level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); - } else if (tile instanceof TallGrassTile) { - level.setTile(x >> 4, y >> 4, Tiles.get("grass")); } } } diff --git a/src/client/java/minicraft/entity/mob/Sheep.java b/src/client/java/minicraft/entity/mob/Sheep.java index 961a74440..9bdae3c9e 100644 --- a/src/client/java/minicraft/entity/mob/Sheep.java +++ b/src/client/java/minicraft/entity/mob/Sheep.java @@ -49,9 +49,6 @@ public void tick() { if (tile instanceof GrassTile) { level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); cut = false; - } else if (tile instanceof TallGrassTile) { - level.setTile(x >> 4, y >> 4, Tiles.get("grass")); - cut = false; } } } diff --git a/src/client/java/minicraft/level/LevelGen.java b/src/client/java/minicraft/level/LevelGen.java index a12411cbe..794e5eec9 100644 --- a/src/client/java/minicraft/level/LevelGen.java +++ b/src/client/java/minicraft/level/LevelGen.java @@ -417,18 +417,6 @@ private static short[][] createTopMap(int w, int h) { // Create surface map } } - for (int x = 0; x < w; x++) { - for (int y = 0; y < h; y++) { - int xx = x + random.nextInt(3) - random.nextInt(3); - int yy = y + random.nextInt(3) - random.nextInt(3); - if (xx >= 0 && yy >= 0 && xx < w && yy < h && random.nextInt(5) < 3) { - if (map[xx + yy * w] == Tiles.get("grass").id) { - map[xx + yy * w] = TallGrassTile.grassIDs.get(random.nextInt(TallGrassTile.grassIDs.size())); - } - } - } - } - for (int i = 0; i < w * h / 400; i++) { int x = random.nextInt(w); int y = random.nextInt(h); From 0f4378deb85ca3120652319e9a7afc4f838395da Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Jun 2023 12:44:16 +0800 Subject: [PATCH 045/261] Remove ArcaneFertilizer and move some to watering can --- .../minicraft/item/ArcaneFertilizerItem.java | 51 ------------------- .../java/minicraft/item/FertilizerItem.java | 10 ++++ src/client/java/minicraft/item/Items.java | 1 - .../java/minicraft/item/WateringCanItem.java | 36 +++++++++++-- .../minicraft/level/tile/BoostablePlant.java | 15 ------ .../java/minicraft/level/tile/GrassTile.java | 38 +------------- .../minicraft/level/tile/SaplingTile.java | 12 +---- .../level/tile/farming/CropTile.java | 15 +----- 8 files changed, 46 insertions(+), 132 deletions(-) delete mode 100644 src/client/java/minicraft/item/ArcaneFertilizerItem.java delete mode 100644 src/client/java/minicraft/level/tile/BoostablePlant.java diff --git a/src/client/java/minicraft/item/ArcaneFertilizerItem.java b/src/client/java/minicraft/item/ArcaneFertilizerItem.java deleted file mode 100644 index 90caaf7b7..000000000 --- a/src/client/java/minicraft/item/ArcaneFertilizerItem.java +++ /dev/null @@ -1,51 +0,0 @@ -package minicraft.item; - -import minicraft.entity.Direction; -import minicraft.entity.mob.Player; -import minicraft.entity.particle.Particle; -import minicraft.gfx.SpriteLinker; -import minicraft.level.Level; -import minicraft.level.tile.BoostablePlant; -import minicraft.level.tile.Tile; -import org.jetbrains.annotations.NotNull; - -import java.util.ArrayList; -import java.util.Random; - -public class ArcaneFertilizerItem extends StackableItem { - public static ArrayList getAllInstances() { - ArrayList items = new ArrayList<>(); - items.add(new ArcaneFertilizerItem("Arcane Fertilizer", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "arcane_fertilizer"))); - return items; - } - - protected ArcaneFertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { - super(name, sprite); - } - - private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); - - @Override - public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (tile instanceof BoostablePlant) { - if (((BoostablePlant) tile).isValidBoostablePlantTarget(level, xt, yt)) { - ((BoostablePlant) tile).performPlantBoost(level, xt, yt); - - Random random = new Random(); - for (int i = 0; i < 5; i++) { - double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); - } - return super.interactOn(true); - } - } - - return false; - } - - @Override - public @NotNull StackableItem copy() { - return new ArcaneFertilizerItem(getName(), sprite); - } -} diff --git a/src/client/java/minicraft/item/FertilizerItem.java b/src/client/java/minicraft/item/FertilizerItem.java index 3e9e22101..7ea629210 100644 --- a/src/client/java/minicraft/item/FertilizerItem.java +++ b/src/client/java/minicraft/item/FertilizerItem.java @@ -2,6 +2,7 @@ import minicraft.entity.Direction; import minicraft.entity.mob.Player; +import minicraft.entity.particle.Particle; import minicraft.gfx.SpriteLinker; import minicraft.level.Level; import minicraft.level.tile.Tile; @@ -9,8 +10,11 @@ import org.jetbrains.annotations.NotNull; import java.util.ArrayList; +import java.util.Random; public class FertilizerItem extends StackableItem { + private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); + public static ArrayList getAllInstances() { ArrayList items = new ArrayList<>(); items.add(new FertilizerItem("Fertilizer", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "fertilizer"))); @@ -24,6 +28,12 @@ protected FertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { @Override public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { if (tile instanceof CropTile) { + Random random = new Random(); + for (int i = 0; i < 2; ++i) { + double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); + } int fertilization = ((CropTile) tile).getFertilization(level.getData(xt, yt)); if (fertilization < 100) { // More fertilization, lower the buffer is applied. ((CropTile) tile).fertilize(level, xt, yt, 40); diff --git a/src/client/java/minicraft/item/Items.java b/src/client/java/minicraft/item/Items.java index 1e8a2fc62..e50fc3c3e 100644 --- a/src/client/java/minicraft/item/Items.java +++ b/src/client/java/minicraft/item/Items.java @@ -43,7 +43,6 @@ private static void addAll(ArrayList items) { addAll(FishingRodItem.getAllInstances()); addAll(SummonItem.getAllInstances()); addAll(HeartItem.getAllInstances()); - addAll(ArcaneFertilizerItem.getAllInstances()); addAll(WateringCanItem.getAllInstances()); addAll(FertilizerItem.getAllInstances()); } diff --git a/src/client/java/minicraft/item/WateringCanItem.java b/src/client/java/minicraft/item/WateringCanItem.java index e3ab3dd71..eaeb5c565 100644 --- a/src/client/java/minicraft/item/WateringCanItem.java +++ b/src/client/java/minicraft/item/WateringCanItem.java @@ -2,6 +2,7 @@ import minicraft.entity.Direction; import minicraft.entity.mob.Player; +import minicraft.entity.particle.Particle; import minicraft.entity.particle.WaterParticle; import minicraft.gfx.Point; import minicraft.gfx.SpriteLinker; @@ -14,7 +15,9 @@ import minicraft.level.tile.farming.CropTile; import org.jetbrains.annotations.NotNull; +import java.util.AbstractMap; import java.util.ArrayList; +import java.util.Map; import java.util.Random; public class WateringCanItem extends Item { @@ -26,6 +29,7 @@ protected static ArrayList getAllInstances() { private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_can"); private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_can_filled"); + private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); private static final SpriteLinker.LinkedSprite[] spriteSplash = new SpriteLinker.LinkedSprite[] { new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_0"), @@ -52,8 +56,8 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, content--; updateSprite(); renderingTick++; + Random random = new Random(); if (renderingTick >= 8) { - Random random = new Random(); for (int i = 0; i < 4; i++) { SpriteLinker.LinkedSprite splash = spriteSplash[random.nextInt(spriteSplash.length)]; // 2-pixel deviation for centering particle sprites. @@ -70,18 +74,44 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, if (fertilization < 150) { // Maximum of 5 levels watering can can fertilize. ((CropTile) tile).fertilize(level, xt, yt, 1); } + if (random.nextInt(5) == 0) { + double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); + } } else if (tile instanceof DirtTile || tile instanceof GrassTile) { + if (tile instanceof GrassTile) { + if (random.nextInt(15) == 0) { + double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); + } + if (random.nextInt(60) == 0) { // Small chance for growing flowers + level.setTile(xt, yt, Tiles.get(2), random.nextInt(2)); + } + } + for (Point p : level.getAreaTilePositions(xt, yt, 1)) { Tile t = level.getTile(p.x, p.y); if (tile instanceof DirtTile) { if (t instanceof GrassTile) { // Grass tile exists. - if (new Random().nextInt(10) == 0) + if (random.nextInt(5) == 0) { + double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); + } + if (random.nextInt(10) == 0) level.setTile(xt, yt, Tiles.get("grass")); // Grass extends. break; // Operation finished. } } else { // tile instanceof GrassTile if (t instanceof DirtTile) { // Dirt tile exists. - if (new Random().nextInt(15) == 0) + if (random.nextInt(5) == 0) { + double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); + } + if (random.nextInt(15) == 0) level.setTile(p.x, p.y, Tiles.get("grass")); // Grass extends. break; // Operation finished. } diff --git a/src/client/java/minicraft/level/tile/BoostablePlant.java b/src/client/java/minicraft/level/tile/BoostablePlant.java deleted file mode 100644 index e512e18be..000000000 --- a/src/client/java/minicraft/level/tile/BoostablePlant.java +++ /dev/null @@ -1,15 +0,0 @@ -package minicraft.level.tile; - -import minicraft.level.Level; - -public interface BoostablePlant { - /** - * Whether arcane fertilizer is able to be performed on the tile. - */ - boolean isValidBoostablePlantTarget(Level level, int x, int y); - - /** - * Performing arcane fertilizer with effects on the tile. - */ - void performPlantBoost(Level level, int x, int y); -} diff --git a/src/client/java/minicraft/level/tile/GrassTile.java b/src/client/java/minicraft/level/tile/GrassTile.java index 4eed505ca..01cbf9337 100644 --- a/src/client/java/minicraft/level/tile/GrassTile.java +++ b/src/client/java/minicraft/level/tile/GrassTile.java @@ -17,7 +17,7 @@ import java.util.ArrayList; import java.util.Map; -public class GrassTile extends Tile implements BoostablePlant { +public class GrassTile extends Tile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) .setSingletonWithConnective(true); @@ -90,40 +90,4 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } return false; } - - @Override - public boolean isValidBoostablePlantTarget(Level level, int x, int y) { - return true; - } - - @Override - public void performPlantBoost(Level level, int x, int y) { - label: - for (int i = 0; i < 128; i++) { - int xx = x; - int yy = y; - - for(int j = 0; j < i / 16; ++j) { - xx += x + random.nextInt(3) - 1; - yy += y + random.nextInt(3) - 1; - if (!(level.getTile(xx, yy) == this)) { - continue label; - } - } - - if (level.getTile(xx, yy) == this && random.nextInt(10) == 0) { - performPlantBoost(level, xx, yy); - } - - if (level.getTile(xx, yy) != this) continue; // Further confirming the tile is still grass tile. - Map.Entry plant = boostPerformingPlants.get(random.nextInt(boostPerformingPlants.size())); - level.setTile(xx, yy, Tiles.get(plant.getKey()), plant.getValue()); - } - } - - private static final ArrayList> boostPerformingPlants = new ArrayList<>(); - static { // The left-hand-sided data is tile id; the right-hand-sided data is tile data. - boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 0)); - boostPerformingPlants.add(new AbstractMap.SimpleEntry<>((short) 2, (short) 1)); - } } diff --git a/src/client/java/minicraft/level/tile/SaplingTile.java b/src/client/java/minicraft/level/tile/SaplingTile.java index 3fdb8c5a4..e3f90849e 100644 --- a/src/client/java/minicraft/level/tile/SaplingTile.java +++ b/src/client/java/minicraft/level/tile/SaplingTile.java @@ -8,7 +8,7 @@ import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.level.Level; -public class SaplingTile extends Tile implements BoostablePlant { +public class SaplingTile extends Tile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "sapling"); private Tile onType; @@ -47,14 +47,4 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at Sound.play("monsterhurt"); return true; } - - @Override - public boolean isValidBoostablePlantTarget(Level level, int x, int y) { - return true; - } - - @Override - public void performPlantBoost(Level level, int x, int y) { - level.setData(x, y, Math.min(level.getData(x, y) + random.nextInt(30), 110)); - } } diff --git a/src/client/java/minicraft/level/tile/farming/CropTile.java b/src/client/java/minicraft/level/tile/farming/CropTile.java index 07ce463a1..a48c48b46 100644 --- a/src/client/java/minicraft/level/tile/farming/CropTile.java +++ b/src/client/java/minicraft/level/tile/farming/CropTile.java @@ -7,7 +7,6 @@ import minicraft.entity.mob.Player; import minicraft.item.Items; import minicraft.level.Level; -import minicraft.level.tile.BoostablePlant; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.level.tile.WaterTile; @@ -15,7 +14,7 @@ import java.util.Arrays; -public class CropTile extends FarmTile implements BoostablePlant { +public class CropTile extends FarmTile { protected final @Nullable String seed; protected int maxAge = 0b111; // Must be a bit mask. @@ -137,16 +136,4 @@ public void fertilize(Level level, int x, int y, int amount) { // If this value exceeds 511, the final value would be greater than the hard maximum value that short can be. level.setData(x, y, (data & (0b111 + (maxAge << 3))) + (fertilization << (3 + (maxAge + 1)/2))); } - - @Override - public boolean isValidBoostablePlantTarget(Level level, int x, int y) { - return true; - } - - @Override - public void performPlantBoost(Level level, int x, int y) { - int data = level.getData(x, y); - int stage = (data >> 3) & maxAge; - level.setData(x, y, (data & ~(maxAge << 3)) + (Math.min(stage + random.nextInt(4) + 2, maxAge) << 3)); - } } From 6db7f5956ad13c5b4cfe930b42bec06bce1e084b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Jun 2023 15:29:09 +0800 Subject: [PATCH 046/261] Localize QuestsDisplay --- .../java/minicraft/screen/QuestsDisplay.java | 48 ++++++++++--------- .../resources/assets/localization/en-us.json | 10 ++++ 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index c871b79da..82cad3605 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -53,8 +53,6 @@ public class QuestsDisplay extends Display { e.printStackTrace(); Logging.QUEST.error("Failed to load quests."); } - - // TODO Localize this class } private static void loadQuestFile(@SuppressWarnings("SameParameterValue") String filename) throws IOException { @@ -256,20 +254,23 @@ public SeriesInformationDisplay(QuestSeries series) { super(false, true); ArrayList entries = new ArrayList<>(); - entries.add(series.isCompleted() ? new StringEntry("Status: Completed", Color.GREEN): - series.isUnlocked() ? new StringEntry("Status: Unlocked", Color.WHITE): - new StringEntry("Status: Locked", Color.GRAY) // Locked series would not been shown...? + entries.add(series.isCompleted() ? new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.status", + Localization.getLocalized("minicraft.displays.quests.quest_info.display.status.completed")), Color.GREEN, false): + series.isUnlocked() ? new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.status", + Localization.getLocalized("minicraft.displays.quests.quest_info.display.status.unlocked")), Color.WHITE, false): + new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.status", + Localization.getLocalized("minicraft.displays.quests.quest_info.display.status.locked")), Color.GRAY, false) // Locked series would not been shown...? ); - entries.add(new StringEntry("Quests completed: " + - series.getSeriesQuests().values().stream().filter(AdvancementElement::isCompleted).count())); - entries.addAll(Arrays.asList(StringEntry.useLines( - "Description: " + Localization.getLocalized(series.description)))); - entries.add(new StringEntry("Ongoing quests: " + - series.getSeriesQuests().values().stream().filter(AdvancementElement::isDisplayableAtStatus).count())); + entries.add(new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.quests_completed_count", + series.getSeriesQuests().values().stream().filter(AdvancementElement::isCompleted).count()), Color.WHITE, false)); + entries.addAll(Arrays.asList(StringEntry.useLines(Color.WHITE, false, + Localization.getLocalized("minicraft.displays.quests.quest_info.display.description", Localization.getLocalized(series.description))))); + entries.add(new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.ongoing_quests", + series.getSeriesQuests().values().stream().filter(AdvancementElement::isDisplayableAtStatus).count()), Color.WHITE, false)); entries.add(new BlankEntry()); - entries.add(new SelectEntry("View all quests of this series", () -> Game.setDisplay(new SeriesQuestViewerDisplay(series)))); + entries.add(new SelectEntry("minicraft.displays.quests.quest_info.view_quests", () -> Game.setDisplay(new SeriesQuestViewerDisplay(series)))); menus = new Menu[] { new Menu.Builder(true, 0, RelPos.CENTER) @@ -351,7 +352,7 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee public SeriesQuestViewerDisplay(QuestSeries series) { super(false, true); menus = new Menu[] { - new Menu.Builder(true, 0, RelPos.CENTER, StringEntry.useLines("minicrat.displays.quests", series.key)) + new Menu.Builder(true, 0, RelPos.CENTER, StringEntry.useLines("minicraft.displays.quests", series.key)) .setPositioning(new Point(Screen.w/2, 6), RelPos.BOTTOM) .createMenu(), new Menu.Builder(true, 0, RelPos.CENTER) @@ -651,20 +652,23 @@ void plotLine(int x0, int y0, int x1, int y1, IntPredicate yRange, int color) { private static class QuestInformationDisplay extends Display { public QuestInformationDisplay(Quest quest) { super(false, true); - String state = quest.isCompleted() ? "Completed" : quest.isUnlocked() ? "Unlocked" : "Locked"; + String state = quest.isCompleted() ? "minicraft.displays.quests.quest_info.display.status.completed" : + quest.isUnlocked() ? "minicraft.displays.quests.quest_info.display.status.unlocked" : + "minicraft.displays.quests.quest_info.display.status.locked"; int color = quest.isCompleted() ? Color.GREEN : quest.isUnlocked() ? Color.WHITE : Color.GRAY; menus = new Menu[] { new Menu.Builder(true, 1, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, 5), RelPos.BOTTOM) - .setEntries(new StringEntry(Localization.getLocalized(quest.getSeries().key)), - new StringEntry(Localization.getLocalized(quest.key) + ": " + state, color), + .setEntries(new StringEntry(quest.getSeries().key), + new StringEntry(Localization.getLocalized(quest.key) + ": " + Localization.getLocalized(state), color, false), new StringEntry(quest.shouldAllCriteriaBeCompleted() ? - String.format("Progress: (%d/%d)", quest.getNumCriteriaCompleted(), quest.getTotalNumCriteria()) : - "Uncompleted")) + Localization.getLocalized("minicraft.displays.quests.quest_info.display.progress", + quest.getNumCriteriaCompleted(), quest.getTotalNumCriteria()) : + Localization.getLocalized("minicraft.displays.quests.quest_info.display.progress_uncompleted"), Color.WHITE, false)) .setSelectable(false) .createMenu(), new Menu.Builder(true, 2, RelPos.CENTER, - StringEntry.useLines(Localization.getLocalized(quest.description))) + StringEntry.useLines(quest.description)) .setPositioning(new Point(Screen.w / 2, 52), RelPos.BOTTOM) .setSelectable(false) .createMenu() @@ -724,9 +728,9 @@ public void tick(InputHandler input) { } if (menus[0].getCurEntry() != null) { - menus[3].setEntries(StringEntry.useLines(Localization.getLocalized(entrySeries[selectedEntry][menus[0].getSelection()].description))); + menus[3].setEntries(StringEntry.useLines(entrySeries[selectedEntry][menus[0].getSelection()].description)); } else { - menus[3].setEntries(StringEntry.useLines(Localization.getLocalized("minicraft.displays.quests.display.no_quest_desc"))); + menus[3].setEntries(StringEntry.useLines("minicraft.displays.quests.display.no_quest_desc")); } } @@ -734,7 +738,7 @@ private void updateEntries() { menus[0].setEntries(seriesEntries[selectedEntry]); String[] entryNames = new String[] { - "Unlocked", "Completed" + "minicraft.displays.quests.display.header.unlocked", "minicraft.displays.quests.display.header.completed" }; for (int i = 0; i < 2; i++) { diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 690a24133..f344e53db 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -169,6 +169,16 @@ "minicraft.displays.quests.display.header.unlocked": "Unlocked", "minicraft.displays.quests.display.no_quest": "No quest unlocked", "minicraft.displays.quests.display.no_quest_desc": "No quest", + "minicraft.displays.quests.quest_info.display.description": "Description: %s", + "minicraft.displays.quests.quest_info.display.ongoing_quests": "Ongoing quests: %s", + "minicraft.displays.quests.quest_info.display.progress": "Progress: (%d/%d)", + "minicraft.displays.quests.quest_info.display.progress_uncompleted": "Uncompleted", + "minicraft.displays.quests.quest_info.display.quests_completed_count": "Quests completed: %d", + "minicraft.displays.quests.quest_info.display.status": "Status: %s", + "minicraft.displays.quests.quest_info.display.status.completed": "Completed", + "minicraft.displays.quests.quest_info.display.status.locked": "Locked", + "minicraft.displays.quests.quest_info.display.status.unlocked": "Unlocked", + "minicraft.displays.quests.quest_info.view_quests": "View all quests of this series", "minicraft.displays.resource_packs.display.help.keyboard_needed": "Only keyboard input is accepted.", "minicraft.displays.resource_packs.display.help.move": "Use %s and %s to move.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] to move packs. ", From e529ada7d27f2e3ff0cb52c6f670baf0b0d035e9 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:58:15 +0800 Subject: [PATCH 047/261] Remove Menu localTitle and resolve inv menu dup --- src/client/java/minicraft/screen/InventoryMenu.java | 8 +++++++- src/client/java/minicraft/screen/ItemListMenu.java | 5 ++--- src/client/java/minicraft/screen/Menu.java | 5 ++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/client/java/minicraft/screen/InventoryMenu.java b/src/client/java/minicraft/screen/InventoryMenu.java index 4e6851bf0..6f74f45fa 100644 --- a/src/client/java/minicraft/screen/InventoryMenu.java +++ b/src/client/java/minicraft/screen/InventoryMenu.java @@ -9,6 +9,8 @@ class InventoryMenu extends ItemListMenu { + private final RelPos entryPos; // Used for copy constructor + private final String title; // Used for copy constructor private final Inventory inv; private final Entity holder; protected boolean creativeInv = false; @@ -17,13 +19,17 @@ class InventoryMenu extends ItemListMenu { super(ItemListMenu.getBuilder(entryPos), ItemEntry.useItems(inv.getItems()), title); this.inv = inv; this.holder = holder; + this.title = title; + this.entryPos = entryPos; } InventoryMenu(InventoryMenu model) { - super(ItemListMenu.getBuilder(), ItemEntry.useItems(model.inv.getItems()), model.getTitle(), false); + super(ItemListMenu.getBuilder(model.entryPos), ItemEntry.useItems(model.inv.getItems()), model.title); this.inv = model.inv; this.holder = model.holder; this.creativeInv = model.creativeInv; + this.title = model.title; + this.entryPos = model.entryPos; setSelection(model.getSelection()); } diff --git a/src/client/java/minicraft/screen/ItemListMenu.java b/src/client/java/minicraft/screen/ItemListMenu.java index 3a40d018e..6fea47075 100644 --- a/src/client/java/minicraft/screen/ItemListMenu.java +++ b/src/client/java/minicraft/screen/ItemListMenu.java @@ -15,11 +15,10 @@ static Builder getBuilder(RelPos entryPos) { .setSearcherBar(true); } - protected ItemListMenu(Builder b, ItemEntry[] entries, String title) { this(b, entries, title, true); } - protected ItemListMenu(Builder b, ItemEntry[] entries, String title, boolean localizeTitle) { + protected ItemListMenu(Builder b, ItemEntry[] entries, String title) { super(b .setEntries(entries) - .setTitle(title, localizeTitle) + .setTitle(title) .createMenu() ); } diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index acd08e77f..6afa95e5a 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -465,9 +465,8 @@ public Builder setBounds(Rectangle rect) { public Builder setTitlePos(RelPos rp) { titlePos = (rp == null ? RelPos.TOP : rp); return this; } - public Builder setTitle(String title) { return setTitle(title, true); } - public Builder setTitle(String title, boolean localize) { - menu.title = localize ? Localization.getLocalized(title) : title; + public Builder setTitle(String title) { + menu.title = title; return this; } From af291e82a27368b9b2a216aeb70f26cba4e5d0b2 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:29:30 +0800 Subject: [PATCH 048/261] Add hardware acceleration setting --- src/client/java/minicraft/core/Game.java | 8 ++++++-- .../java/minicraft/core/io/Settings.java | 1 + src/client/java/minicraft/saveload/Load.java | 19 +++++++++++++------ src/client/java/minicraft/saveload/Save.java | 1 + .../screen/OptionsMainMenuDisplay.java | 1 + 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 7debc6b41..0bdd8793b 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -86,6 +86,11 @@ public static void main(String[] args) { Analytics.GameStartup.ping(); + new Load(true, true); // This loads basic saved preferences. + // Reference: https://stackoverflow.com/a/13832805 + if ((boolean) Settings.get("hardwareacc")) System.setProperty("sun.java2d.opengl", "true"); + MAX_FPS = (int) Settings.get("fps"); // DO NOT put this above. + input = new InputHandler(Renderer.canvas); ResourcePackDisplay.initPacks(); @@ -102,8 +107,7 @@ public static void main(String[] args) { World.resetGame(); // "half"-starts a new game, to set up initial variables player.eid = 0; - new Load(true); // This loads any saved preferences. - MAX_FPS = (int) Settings.get("fps"); // DO NOT put this above. + new Load(true, false); // This loads any saved preferences. // Update fullscreen frame if Updater.FULLSCREEN was updated previously if (Updater.FULLSCREEN) { diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index ce0c92622..c1e5e4bea 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -26,6 +26,7 @@ public final class Settings { options.put("sound", new BooleanEntry("minicraft.settings.sound", true)); options.put("autosave", new BooleanEntry("minicraft.settings.autosave", true)); + options.put("hardwareacc", new BooleanEntry("minicraft.settings.hardware_acceleration", true)); options.put("size", new ArrayEntry<>("minicraft.settings.size", 128, 256, 512)); options.put("theme", new ArrayEntry<>("minicraft.settings.theme", "minicraft.settings.theme.normal", "minicraft.settings.theme.forest", "minicraft.settings.theme.desert", "minicraft.settings.theme.plain", "minicraft.settings.theme.hell")); diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 992fccd42..44588a84b 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -193,10 +193,10 @@ public Load(String worldname, boolean loadGame) { public Load() { this(Game.VERSION); } public Load(Version worldVersion) { - this(false); + this(false, false); worldVer = worldVersion; } - public Load(boolean loadConfig) { + public Load(boolean loadConfig, boolean partialLoad) { if (!loadConfig) return; boolean resave = false; @@ -205,11 +205,11 @@ public Load(boolean loadConfig) { // Check if Preferences.json exists. (new version) if (new File(location + "Preferences.json").exists()) { - loadPrefs("Preferences"); + loadPrefs("Preferences", partialLoad); // Check if Preferences.miniplussave exists. (old version) } else if (new File(location + "Preferences" + extension).exists()) { - loadPrefsOld("Preferences"); + loadPrefsOld("Preferences", partialLoad); Logging.SAVELOAD.info("Upgrading preferences to JSON."); resave = true; @@ -219,6 +219,8 @@ public Load(boolean loadConfig) { resave = true; } + if (partialLoad) return; // Partial loading only loads partial preferences + // Load unlocks. (new version) File testFileOld = new File(location + "unlocks" + extension); File testFile = new File(location + "Unlocks" + extension); @@ -425,7 +427,7 @@ private void loadMode(String modedata) { Settings.setIdx("mode", mode); } - private void loadPrefsOld(String filename) { + private void loadPrefsOld(String filename, boolean partialLoad) { loadFromFile(location + filename + extension); Version prefVer = new Version("2.0.2"); // the default, b/c this doesn't really matter much being specific past this if it's not set below. @@ -438,6 +440,8 @@ private void loadPrefsOld(String filename) { if (prefVer.compareTo(new Version("2.0.4-dev2")) >= 0) Settings.set("fps", Integer.parseInt(data.remove(0))); + if (partialLoad) return; // Partial loading only loads basic settings. + SkinDisplay.releaseSkins(); // Get legacy language and convert it into the current format. @@ -502,7 +506,7 @@ private void loadPrefsOld(String filename) { } } - private void loadPrefs(String filename) { + private void loadPrefs(String filename, boolean partialLoad) { JSONObject json; try { json = new JSONObject(loadFromFile(location + filename + ".json", false)); @@ -519,6 +523,9 @@ private void loadPrefs(String filename) { Settings.set("autosave", json.getBoolean("autosave")); Settings.set("fps", json.getInt("fps")); Settings.set("showquests", json.optBoolean("showquests", true)); + Settings.set("hardwareacc", json.optBoolean("hardwareacc", true)); + + if (partialLoad) return; // Partial loading only loads basic settings. if (json.has("lang")) { String lang = json.getString("lang"); diff --git a/src/client/java/minicraft/saveload/Save.java b/src/client/java/minicraft/saveload/Save.java index a5096b15e..91500b305 100644 --- a/src/client/java/minicraft/saveload/Save.java +++ b/src/client/java/minicraft/saveload/Save.java @@ -201,6 +201,7 @@ private void writePrefs() { json.put("keymap", new JSONArray(Game.input.getKeyPrefs())); json.put("resourcePacks", new JSONArray(ResourcePackDisplay.getLoadedPacks())); json.put("showquests", String.valueOf(Settings.get("showquests"))); + json.put("hardwareacc", String.valueOf(Settings.get("hardwareacc"))); // Save json try { diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index 6182bf3e0..b28c711ad 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -12,6 +12,7 @@ public OptionsMainMenuDisplay() { Settings.getEntry("fps"), Settings.getEntry("sound"), Settings.getEntry("showquests"), + Settings.getEntry("hardwareacc"), new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), From e48a87d6362fc9f8f0aaf2c2ad72e58dffb3514c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:27:58 +0800 Subject: [PATCH 049/261] Modify grazing codes --- src/client/java/minicraft/entity/mob/Cow.java | 8 +++----- src/client/java/minicraft/entity/mob/Sheep.java | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/Cow.java b/src/client/java/minicraft/entity/mob/Cow.java index 5effb7cd9..a3baf9f4b 100644 --- a/src/client/java/minicraft/entity/mob/Cow.java +++ b/src/client/java/minicraft/entity/mob/Cow.java @@ -31,11 +31,9 @@ public void die() { @Override public void tick() { super.tick(); - if (random.nextInt(1000) == 0) { // Grazing without any benefits. - Tile tile = level.getTile(x >> 4, y >> 4); - if (tile instanceof GrassTile) { - level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); - } + Tile tile = level.getTile(x >> 4, y >> 4); + if (tile instanceof GrassTile && random.nextInt(1000) == 0) { // Grazing without any benefits. + level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); } } } diff --git a/src/client/java/minicraft/entity/mob/Sheep.java b/src/client/java/minicraft/entity/mob/Sheep.java index 9bdae3c9e..5aefa8709 100644 --- a/src/client/java/minicraft/entity/mob/Sheep.java +++ b/src/client/java/minicraft/entity/mob/Sheep.java @@ -45,11 +45,9 @@ public void render(Screen screen) { public void tick() { super.tick(); Tile tile = level.getTile(x >> 4, y >> 4); - if (random.nextInt(1000) == 0) { // Grazing - if (tile instanceof GrassTile) { - level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); - cut = false; - } + if (tile instanceof GrassTile && random.nextInt(1000) == 0) { // Grazing + level.setTile(x >> 4, y >> 4, Tiles.get("dirt")); + cut = false; } } From a9c17cf6654d66a4f8d9ceb1833024ebe29a2f4f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:41:43 +0800 Subject: [PATCH 050/261] Merge FertilizerItem --- .../minicraft/entity/furniture/Composter.java | 3 +- .../java/minicraft/item/FertilizerItem.java | 60 ------------------- src/client/java/minicraft/item/Items.java | 1 - .../java/minicraft/item/StackableItem.java | 2 + .../level/tile/farming/CropTile.java | 36 +++++++++++ 5 files changed, 39 insertions(+), 63 deletions(-) delete mode 100644 src/client/java/minicraft/item/FertilizerItem.java diff --git a/src/client/java/minicraft/entity/furniture/Composter.java b/src/client/java/minicraft/entity/furniture/Composter.java index f8d54e4cc..079d90795 100644 --- a/src/client/java/minicraft/entity/furniture/Composter.java +++ b/src/client/java/minicraft/entity/furniture/Composter.java @@ -3,7 +3,6 @@ import minicraft.entity.Direction; import minicraft.entity.mob.Player; import minicraft.gfx.SpriteLinker; -import minicraft.item.FertilizerItem; import minicraft.item.Item; import minicraft.item.Items; import minicraft.item.StackableItem; @@ -26,7 +25,7 @@ public Composter() { public boolean interact(Player player, @Nullable Item item, Direction attackDir) { if (compost == MAX_COMPOST) { compost = 0; - FertilizerItem i = (FertilizerItem) Items.get("Fertilizer").copy(); + StackableItem i = (StackableItem) Items.get("Fertilizer").copy(); i.count = 1; player.getLevel().dropItem(x, y, i); refreshStatus(); diff --git a/src/client/java/minicraft/item/FertilizerItem.java b/src/client/java/minicraft/item/FertilizerItem.java deleted file mode 100644 index 7ea629210..000000000 --- a/src/client/java/minicraft/item/FertilizerItem.java +++ /dev/null @@ -1,60 +0,0 @@ -package minicraft.item; - -import minicraft.entity.Direction; -import minicraft.entity.mob.Player; -import minicraft.entity.particle.Particle; -import minicraft.gfx.SpriteLinker; -import minicraft.level.Level; -import minicraft.level.tile.Tile; -import minicraft.level.tile.farming.CropTile; -import org.jetbrains.annotations.NotNull; - -import java.util.ArrayList; -import java.util.Random; - -public class FertilizerItem extends StackableItem { - private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); - - public static ArrayList getAllInstances() { - ArrayList items = new ArrayList<>(); - items.add(new FertilizerItem("Fertilizer", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "fertilizer"))); - return items; - } - - protected FertilizerItem(String name, SpriteLinker.LinkedSprite sprite) { - super(name, sprite); - } - - @Override - public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (tile instanceof CropTile) { - Random random = new Random(); - for (int i = 0; i < 2; ++i) { - double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); - } - int fertilization = ((CropTile) tile).getFertilization(level.getData(xt, yt)); - if (fertilization < 100) { // More fertilization, lower the buffer is applied. - ((CropTile) tile).fertilize(level, xt, yt, 40); - } else if (fertilization < 200) { - ((CropTile) tile).fertilize(level, xt, yt, 30); - } else if (fertilization < 300) { - ((CropTile) tile).fertilize(level, xt, yt, 25); - } else if (fertilization < 400) { - ((CropTile) tile).fertilize(level, xt, yt, 20); - } else { - ((CropTile) tile).fertilize(level, xt, yt, 10); - } - - return super.interactOn(true); - } - - return false; - } - - @Override - public @NotNull StackableItem copy() { - return new FertilizerItem(getName(), sprite); - } -} diff --git a/src/client/java/minicraft/item/Items.java b/src/client/java/minicraft/item/Items.java index e50fc3c3e..ce9bbee5b 100644 --- a/src/client/java/minicraft/item/Items.java +++ b/src/client/java/minicraft/item/Items.java @@ -44,7 +44,6 @@ private static void addAll(ArrayList items) { addAll(SummonItem.getAllInstances()); addAll(HeartItem.getAllInstances()); addAll(WateringCanItem.getAllInstances()); - addAll(FertilizerItem.getAllInstances()); } public static ArrayList getAll() { diff --git a/src/client/java/minicraft/item/StackableItem.java b/src/client/java/minicraft/item/StackableItem.java index f0cfb9f7f..f8dbb0c3d 100644 --- a/src/client/java/minicraft/item/StackableItem.java +++ b/src/client/java/minicraft/item/StackableItem.java @@ -2,6 +2,7 @@ import minicraft.core.Game; import minicraft.core.io.Localization; +import minicraft.gfx.SpriteLinker; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; import org.jetbrains.annotations.NotNull; @@ -39,6 +40,7 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Glass Bottle", new LinkedSprite(SpriteType.Item, "glass_bottle"))); items.add(new StackableItem("Tomato", new LinkedSprite(SpriteType.Item, "tomato"))); items.add(new StackableItem("Bone", new LinkedSprite(SpriteType.Item, "bone"))); + items.add(new StackableItem("Fertilizer", new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "fertilizer"))); return items; } diff --git a/src/client/java/minicraft/level/tile/farming/CropTile.java b/src/client/java/minicraft/level/tile/farming/CropTile.java index a48c48b46..89b368dd7 100644 --- a/src/client/java/minicraft/level/tile/farming/CropTile.java +++ b/src/client/java/minicraft/level/tile/farming/CropTile.java @@ -5,7 +5,11 @@ import minicraft.entity.Entity; import minicraft.entity.mob.Mob; import minicraft.entity.mob.Player; +import minicraft.entity.particle.Particle; +import minicraft.gfx.SpriteLinker; +import minicraft.item.Item; import minicraft.item.Items; +import minicraft.item.StackableItem; import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; @@ -13,6 +17,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Arrays; +import java.util.Random; public class CropTile extends FarmTile { protected final @Nullable String seed; @@ -94,6 +99,37 @@ public boolean tick(Level level, int xt, int yt) { return successful; } + private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); + + @Override + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + if (item instanceof StackableItem && item.getName().equalsIgnoreCase("Fertilizer")) { + ((StackableItem) item).count--; + Random random = new Random(); + for (int i = 0; i < 2; ++i) { + double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); + } + int fertilization = getFertilization(level.getData(xt, yt)); + if (fertilization < 100) { // More fertilization, lower the buffer is applied. + fertilize(level, xt, yt, 40); + } else if (fertilization < 200) { + fertilize(level, xt, yt, 30); + } else if (fertilization < 300) { + fertilize(level, xt, yt, 25); + } else if (fertilization < 400) { + fertilize(level, xt, yt, 20); + } else { + fertilize(level, xt, yt, 10); + } + + return true; + } + + return super.interact(level, xt, yt, player, item, attackDir); + } + /** Default harvest method, used for everything that doesn't really need any special behavior. */ protected void harvest(Level level, int x, int y, Entity entity) { int data = level.getData(x, y); From 125287807ba2a38c6895b42588a2bff28520b376 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 2 Jul 2023 22:43:52 +0800 Subject: [PATCH 051/261] Resolve problems --- src/client/java/minicraft/level/tile/GrassTile.java | 2 +- src/client/java/minicraft/level/tile/Tiles.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/java/minicraft/level/tile/GrassTile.java b/src/client/java/minicraft/level/tile/GrassTile.java index 01cbf9337..9c916353e 100644 --- a/src/client/java/minicraft/level/tile/GrassTile.java +++ b/src/client/java/minicraft/level/tile/GrassTile.java @@ -72,7 +72,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get("Farmland")); Sound.play("monsterhurt"); - if (random.nextInt(2) != 0) { // 50% chance to drop Wheat seeds + if (random.nextInt(5) != 0) { // 80% chance to drop Wheat seeds level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Wheat Seeds")); } AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index a5c3749d4..d138b227a 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -36,7 +36,6 @@ public static void initTileList() { tiles.put((short)7, new RockTile("Rock")); tiles.put((short)8, new TreeTile("Tree")); - tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Tree"))); tiles.put((short)10, new SandTile("Sand")); tiles.put((short)11, new CactusTile("Cactus")); From f351ce42a25b2bfbddb980804aef0fb5083a56ab Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 3 Jul 2023 19:47:29 +0800 Subject: [PATCH 052/261] Add launching argument support Hardware acceleration setting --- src/client/java/minicraft/core/Initializer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/java/minicraft/core/Initializer.java b/src/client/java/minicraft/core/Initializer.java index e7346f2ff..46d4ab817 100644 --- a/src/client/java/minicraft/core/Initializer.java +++ b/src/client/java/minicraft/core/Initializer.java @@ -2,6 +2,7 @@ import minicraft.core.io.FileHandler; import minicraft.core.io.Localization; +import minicraft.core.io.Settings; import minicraft.util.Logging; import minicraft.util.TinylogLoggingProvider; import org.jetbrains.annotations.Nullable; @@ -63,6 +64,13 @@ static void parseArgs(String[] args) { Localization.isDebugLocaleEnabled = true; } else if (args[i].equalsIgnoreCase("--debug-unloc-tracing")) { Localization.unlocalizedStringTracing = true; + } else if (args[i].toLowerCase().startsWith("--hardware-acceleration=")) { + switch (args[i].substring(24).toLowerCase()) { // Strip the whole matching string including equal sign + case "on": case "true": case "yes": case "t": case "y": + Settings.set("hardwareacc", true); break; + case "off": case "false": case "no": case "f": case "n": + Settings.set("hardwareacc", false); break; + } } } ((TinylogLoggingProvider) ProviderRegistry.getLoggingProvider()).init(); From f918608a3dc3835178693b0c4482a453f5537535 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 3 Jul 2023 20:14:26 +0800 Subject: [PATCH 053/261] Add a popup on hardware acceleration value change --- src/client/java/minicraft/core/io/Settings.java | 17 +++++++++++++++++ .../resources/assets/localization/en-us.json | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index c1e5e4bea..09865669a 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -1,12 +1,18 @@ package minicraft.core.io; +import minicraft.core.Game; +import minicraft.gfx.Color; +import minicraft.screen.OptionsMainMenuDisplay; +import minicraft.screen.PopupDisplay; import minicraft.screen.entry.ArrayEntry; import minicraft.screen.entry.BooleanEntry; import minicraft.screen.entry.RangeEntry; +import minicraft.screen.entry.StringEntry; import java.awt.DisplayMode; import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; +import java.util.ArrayList; import java.util.HashMap; public final class Settings { @@ -40,6 +46,17 @@ public final class Settings { options.get("mode").setChangeAction(value -> options.get("scoretime").setVisible("minicraft.settings.mode.score".equals(value)) ); + options.get("hardwareacc").setChangeAction(value -> { + if (Game.getDisplay() instanceof OptionsMainMenuDisplay) { // if it is current on a settings display + ArrayList callbacks = new ArrayList<>(); + callbacks.add(new PopupDisplay.PopupActionCallback("enter", menu -> { + Game.exitDisplay(); + return true; + })); + Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig("minicraft.displays.options_main_menu.popup_restart_required", callbacks, 0), + StringEntry.useLines(Color.YELLOW, false, "minicraft.displays.options_main_menu.popup_restart_required.description"))); + } + }); } /** diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 5104b46ff..80f1b93e8 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -141,6 +141,8 @@ "minicraft.displays.loading.regeneration_popup.display.4": "%s to cancel world loading", "minicraft.displays.loading.regeneration_cancellation_popup.display": "World loading cancelled", "minicraft.displays.options_main_menu": "Main Menu Options", + "minicraft.displays.options_main_menu.popup_restart_required": "Restart Required", + "minicraft.displays.options_main_menu.popup_restart_required.description": "A restart is required to apply the change in hardware acceleration setting.", "minicraft.displays.options_main_menu.resource_packs": "Resource packs", "minicraft.displays.options_world": "World Options", "minicraft.displays.options_world.off_tutorials_confirm_popup": "Are you sure you want to turn off the tutorials forever?", From fc6b036025accff84cfe129ab8b7980d2ea06520 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:43:56 +0800 Subject: [PATCH 054/261] Update WateringCanItem.java --- src/client/java/minicraft/item/WateringCanItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/WateringCanItem.java b/src/client/java/minicraft/item/WateringCanItem.java index eaeb5c565..7ef7d1dd0 100644 --- a/src/client/java/minicraft/item/WateringCanItem.java +++ b/src/client/java/minicraft/item/WateringCanItem.java @@ -38,7 +38,7 @@ protected static ArrayList getAllInstances() { new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_3") }; - public final int CAPACITY = 3600; + public final int CAPACITY = 1800; public int content = 0; private int renderingTick = 0; From e8fa613742727508509e3008bcec7b74682c3430 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:52:34 +0800 Subject: [PATCH 055/261] Remove hardware acceleration as being a setting --- src/client/java/minicraft/core/Game.java | 2 -- src/client/java/minicraft/core/Initializer.java | 12 +++++------- src/client/java/minicraft/core/io/Settings.java | 12 ------------ src/client/java/minicraft/saveload/Load.java | 1 - src/client/java/minicraft/saveload/Save.java | 1 - src/client/resources/assets/localization/en-us.json | 2 -- 6 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 0bdd8793b..f39b29e3f 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -87,8 +87,6 @@ public static void main(String[] args) { Analytics.GameStartup.ping(); new Load(true, true); // This loads basic saved preferences. - // Reference: https://stackoverflow.com/a/13832805 - if ((boolean) Settings.get("hardwareacc")) System.setProperty("sun.java2d.opengl", "true"); MAX_FPS = (int) Settings.get("fps"); // DO NOT put this above. input = new InputHandler(Renderer.canvas); diff --git a/src/client/java/minicraft/core/Initializer.java b/src/client/java/minicraft/core/Initializer.java index 46d4ab817..9a78b5ce7 100644 --- a/src/client/java/minicraft/core/Initializer.java +++ b/src/client/java/minicraft/core/Initializer.java @@ -44,6 +44,7 @@ static void parseArgs(String[] args) { // Parses command line arguments @Nullable String saveDir = null; + boolean enableHardwareAcceleration = true; for (int i = 0; i < args.length; i++) { if (args[i].equalsIgnoreCase("--savedir") && i + 1 < args.length) { i++; @@ -64,16 +65,13 @@ static void parseArgs(String[] args) { Localization.isDebugLocaleEnabled = true; } else if (args[i].equalsIgnoreCase("--debug-unloc-tracing")) { Localization.unlocalizedStringTracing = true; - } else if (args[i].toLowerCase().startsWith("--hardware-acceleration=")) { - switch (args[i].substring(24).toLowerCase()) { // Strip the whole matching string including equal sign - case "on": case "true": case "yes": case "t": case "y": - Settings.set("hardwareacc", true); break; - case "off": case "false": case "no": case "f": case "n": - Settings.set("hardwareacc", false); break; - } + } else if (args[i].equalsIgnoreCase("--no-hardware-acceleration")) { + enableHardwareAcceleration = false; } } ((TinylogLoggingProvider) ProviderRegistry.getLoggingProvider()).init(); + // Reference: https://stackoverflow.com/a/13832805 + if (enableHardwareAcceleration) System.setProperty("sun.java2d.opengl", "true"); FileHandler.determineGameDir(saveDir); } diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index 09865669a..d447fc1c7 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -32,7 +32,6 @@ public final class Settings { options.put("sound", new BooleanEntry("minicraft.settings.sound", true)); options.put("autosave", new BooleanEntry("minicraft.settings.autosave", true)); - options.put("hardwareacc", new BooleanEntry("minicraft.settings.hardware_acceleration", true)); options.put("size", new ArrayEntry<>("minicraft.settings.size", 128, 256, 512)); options.put("theme", new ArrayEntry<>("minicraft.settings.theme", "minicraft.settings.theme.normal", "minicraft.settings.theme.forest", "minicraft.settings.theme.desert", "minicraft.settings.theme.plain", "minicraft.settings.theme.hell")); @@ -46,17 +45,6 @@ public final class Settings { options.get("mode").setChangeAction(value -> options.get("scoretime").setVisible("minicraft.settings.mode.score".equals(value)) ); - options.get("hardwareacc").setChangeAction(value -> { - if (Game.getDisplay() instanceof OptionsMainMenuDisplay) { // if it is current on a settings display - ArrayList callbacks = new ArrayList<>(); - callbacks.add(new PopupDisplay.PopupActionCallback("enter", menu -> { - Game.exitDisplay(); - return true; - })); - Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig("minicraft.displays.options_main_menu.popup_restart_required", callbacks, 0), - StringEntry.useLines(Color.YELLOW, false, "minicraft.displays.options_main_menu.popup_restart_required.description"))); - } - }); } /** diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 44588a84b..5338525a8 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -523,7 +523,6 @@ private void loadPrefs(String filename, boolean partialLoad) { Settings.set("autosave", json.getBoolean("autosave")); Settings.set("fps", json.getInt("fps")); Settings.set("showquests", json.optBoolean("showquests", true)); - Settings.set("hardwareacc", json.optBoolean("hardwareacc", true)); if (partialLoad) return; // Partial loading only loads basic settings. diff --git a/src/client/java/minicraft/saveload/Save.java b/src/client/java/minicraft/saveload/Save.java index 91500b305..a5096b15e 100644 --- a/src/client/java/minicraft/saveload/Save.java +++ b/src/client/java/minicraft/saveload/Save.java @@ -201,7 +201,6 @@ private void writePrefs() { json.put("keymap", new JSONArray(Game.input.getKeyPrefs())); json.put("resourcePacks", new JSONArray(ResourcePackDisplay.getLoadedPacks())); json.put("showquests", String.valueOf(Settings.get("showquests"))); - json.put("hardwareacc", String.valueOf(Settings.get("hardwareacc"))); // Save json try { diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 80f1b93e8..5104b46ff 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -141,8 +141,6 @@ "minicraft.displays.loading.regeneration_popup.display.4": "%s to cancel world loading", "minicraft.displays.loading.regeneration_cancellation_popup.display": "World loading cancelled", "minicraft.displays.options_main_menu": "Main Menu Options", - "minicraft.displays.options_main_menu.popup_restart_required": "Restart Required", - "minicraft.displays.options_main_menu.popup_restart_required.description": "A restart is required to apply the change in hardware acceleration setting.", "minicraft.displays.options_main_menu.resource_packs": "Resource packs", "minicraft.displays.options_world": "World Options", "minicraft.displays.options_world.off_tutorials_confirm_popup": "Are you sure you want to turn off the tutorials forever?", From 20500261d7dec1c4f6ab7f1f14ba45b62a7a46bc Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 7 Jul 2023 17:06:24 +0800 Subject: [PATCH 056/261] Add screenshot scaling strategy setting --- src/client/java/minicraft/core/Renderer.java | 10 ++++++++-- src/client/java/minicraft/core/io/Settings.java | 3 +++ .../java/minicraft/screen/OptionsMainMenuDisplay.java | 1 + .../java/minicraft/screen/OptionsWorldDisplay.java | 1 + src/client/resources/assets/localization/en-us.json | 4 ++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index 4b846f0d2..371e8a0b3 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -171,9 +171,15 @@ public static void render() { // BufferedImage after = BigBufferedImage.create(scale * w, scale * h, BufferedImage.TYPE_INT_RGB); AffineTransform at = new AffineTransform(); at.scale(scale, scale); // Setting the scaling. - AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_BICUBIC); + int interpolationType; + switch ((String) Settings.get("screenshotscale")) { + case "minicraft.settings.screenshot_scaling_strategy.nearest_neighbor": interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR; break; + case "minicraft.settings.screenshot_scaling_strategy.bilinear": interpolationType = AffineTransformOp.TYPE_BILINEAR; break; + case "minicraft.settings.screenshot_scaling_strategy.bicubic": default: interpolationType = AffineTransformOp.TYPE_BICUBIC; break; + } + AffineTransformOp scaleOp = new AffineTransformOp(at, interpolationType); - // Use this solution without larger scales which use up a lot memory. + // Use this solution without larger scales which use up a lot of memory. // With scale 20, up to around 360MB overall RAM use. BufferedImage after = scaleOp.filter(before, null); ImageIO.write(after, "png", file); diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index ce0c92622..7b827f5a5 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -16,6 +16,9 @@ public final class Settings { static { options.put("fps", new RangeEntry("minicraft.settings.fps", 10, 300, getDefaultRefreshRate())); // Has to check if the game is running in a headless mode. If it doesn't set the fps to 60 options.put("screenshot", new ArrayEntry<>("minicraft.settings.screenshot_scale", 1, 2, 5, 10, 15, 20)); // The magnification of screenshot. I would want to see ultimate sized. + options.put("screenshotscale", new ArrayEntry<>("minicraft.settings.screenshot_scaling_strategy", + "minicraft.settings.screenshot_scaling_strategy.nearest_neighbor", "minicraft.settings.screenshot_scaling_strategy.bilinear", "minicraft.settings.screenshot_scaling_strategy.bicubic")); + options.get("screenshotscale").setSelection(2); options.put("diff", new ArrayEntry<>("minicraft.settings.difficulty", "minicraft.settings.difficulty.easy", "minicraft.settings.difficulty.normal", "minicraft.settings.difficulty.hard")); options.get("diff").setSelection(1); options.put("mode", new ArrayEntry<>("minicraft.settings.mode", "minicraft.settings.mode.survival", "minicraft.settings.mode.creative", "minicraft.settings.mode.hardcore", "minicraft.settings.mode.score")); diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index 6182bf3e0..fce83dbe3 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -16,6 +16,7 @@ public OptionsMainMenuDisplay() { new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), Settings.getEntry("screenshot"), + Settings.getEntry("screenshotscale"), new SelectEntry("minicraft.display.options_display.resource_packs", () -> Game.setDisplay(new ResourcePackDisplay())) ) .setTitle("minicraft.displays.options_main_menu") diff --git a/src/client/java/minicraft/screen/OptionsWorldDisplay.java b/src/client/java/minicraft/screen/OptionsWorldDisplay.java index 6a71e13d6..4e0027582 100644 --- a/src/client/java/minicraft/screen/OptionsWorldDisplay.java +++ b/src/client/java/minicraft/screen/OptionsWorldDisplay.java @@ -65,6 +65,7 @@ private List getEntries() { new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), Settings.getEntry("screenshot"), + Settings.getEntry("screenshotscale"), new SelectEntry("minicraft.display.options_display.resource_packs", () -> Game.setDisplay(new ResourcePackDisplay())) )); } diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 5104b46ff..faf853662 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -283,6 +283,10 @@ "minicraft.settings.mode.score": "Score", "minicraft.settings.scoretime": "Time (Score Mode)", "minicraft.settings.screenshot_scale": "Screenshot Scale", + "minicraft.settings.screenshot_scaling_strategy": "Screenshot Scaling Strategy", + "minicraft.settings.screenshot_scaling_strategy.nearest_neighbor": "Nearest Neighbor", + "minicraft.settings.screenshot_scaling_strategy.bilinear": "Bilinear", + "minicraft.settings.screenshot_scaling_strategy.bicubic": "Bicubic", "minicraft.settings.sound": "Sound", "minicraft.settings.autosave": "Autosave", "minicraft.settings.size": "World Size", From fb166a145610b19b3100c1cea16794876c2721b9 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:28:11 +0800 Subject: [PATCH 057/261] Remove screenshot scaling strategy setting Changing the interpolation instead. --- src/client/java/minicraft/core/Renderer.java | 8 +------- src/client/java/minicraft/core/io/Settings.java | 3 --- .../java/minicraft/screen/OptionsMainMenuDisplay.java | 1 - src/client/java/minicraft/screen/OptionsWorldDisplay.java | 1 - src/client/resources/assets/localization/en-us.json | 5 ----- 5 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index 371e8a0b3..5d62283d8 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -171,13 +171,7 @@ public static void render() { // BufferedImage after = BigBufferedImage.create(scale * w, scale * h, BufferedImage.TYPE_INT_RGB); AffineTransform at = new AffineTransform(); at.scale(scale, scale); // Setting the scaling. - int interpolationType; - switch ((String) Settings.get("screenshotscale")) { - case "minicraft.settings.screenshot_scaling_strategy.nearest_neighbor": interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR; break; - case "minicraft.settings.screenshot_scaling_strategy.bilinear": interpolationType = AffineTransformOp.TYPE_BILINEAR; break; - case "minicraft.settings.screenshot_scaling_strategy.bicubic": default: interpolationType = AffineTransformOp.TYPE_BICUBIC; break; - } - AffineTransformOp scaleOp = new AffineTransformOp(at, interpolationType); + AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); // Use this solution without larger scales which use up a lot of memory. // With scale 20, up to around 360MB overall RAM use. diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index 7b827f5a5..ce0c92622 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -16,9 +16,6 @@ public final class Settings { static { options.put("fps", new RangeEntry("minicraft.settings.fps", 10, 300, getDefaultRefreshRate())); // Has to check if the game is running in a headless mode. If it doesn't set the fps to 60 options.put("screenshot", new ArrayEntry<>("minicraft.settings.screenshot_scale", 1, 2, 5, 10, 15, 20)); // The magnification of screenshot. I would want to see ultimate sized. - options.put("screenshotscale", new ArrayEntry<>("minicraft.settings.screenshot_scaling_strategy", - "minicraft.settings.screenshot_scaling_strategy.nearest_neighbor", "minicraft.settings.screenshot_scaling_strategy.bilinear", "minicraft.settings.screenshot_scaling_strategy.bicubic")); - options.get("screenshotscale").setSelection(2); options.put("diff", new ArrayEntry<>("minicraft.settings.difficulty", "minicraft.settings.difficulty.easy", "minicraft.settings.difficulty.normal", "minicraft.settings.difficulty.hard")); options.get("diff").setSelection(1); options.put("mode", new ArrayEntry<>("minicraft.settings.mode", "minicraft.settings.mode.survival", "minicraft.settings.mode.creative", "minicraft.settings.mode.hardcore", "minicraft.settings.mode.score")); diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index fce83dbe3..6182bf3e0 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -16,7 +16,6 @@ public OptionsMainMenuDisplay() { new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), Settings.getEntry("screenshot"), - Settings.getEntry("screenshotscale"), new SelectEntry("minicraft.display.options_display.resource_packs", () -> Game.setDisplay(new ResourcePackDisplay())) ) .setTitle("minicraft.displays.options_main_menu") diff --git a/src/client/java/minicraft/screen/OptionsWorldDisplay.java b/src/client/java/minicraft/screen/OptionsWorldDisplay.java index 4e0027582..6a71e13d6 100644 --- a/src/client/java/minicraft/screen/OptionsWorldDisplay.java +++ b/src/client/java/minicraft/screen/OptionsWorldDisplay.java @@ -65,7 +65,6 @@ private List getEntries() { new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), Settings.getEntry("screenshot"), - Settings.getEntry("screenshotscale"), new SelectEntry("minicraft.display.options_display.resource_packs", () -> Game.setDisplay(new ResourcePackDisplay())) )); } diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index faf853662..d52cd7703 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -282,11 +282,6 @@ "minicraft.settings.mode.hardcore": "Hardcore", "minicraft.settings.mode.score": "Score", "minicraft.settings.scoretime": "Time (Score Mode)", - "minicraft.settings.screenshot_scale": "Screenshot Scale", - "minicraft.settings.screenshot_scaling_strategy": "Screenshot Scaling Strategy", - "minicraft.settings.screenshot_scaling_strategy.nearest_neighbor": "Nearest Neighbor", - "minicraft.settings.screenshot_scaling_strategy.bilinear": "Bilinear", - "minicraft.settings.screenshot_scaling_strategy.bicubic": "Bicubic", "minicraft.settings.sound": "Sound", "minicraft.settings.autosave": "Autosave", "minicraft.settings.size": "World Size", From 83691e9641e530c3cc9ca73d212f75364f733d50 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:33:59 +0800 Subject: [PATCH 058/261] Remove further changes in #524 Remove changes in loading and settings --- src/client/java/minicraft/core/Game.java | 6 ++---- .../java/minicraft/core/Initializer.java | 1 - .../java/minicraft/core/io/Settings.java | 6 ------ src/client/java/minicraft/saveload/Load.java | 18 ++++++------------ .../screen/OptionsMainMenuDisplay.java | 1 - 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index f39b29e3f..7debc6b41 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -86,9 +86,6 @@ public static void main(String[] args) { Analytics.GameStartup.ping(); - new Load(true, true); // This loads basic saved preferences. - MAX_FPS = (int) Settings.get("fps"); // DO NOT put this above. - input = new InputHandler(Renderer.canvas); ResourcePackDisplay.initPacks(); @@ -105,7 +102,8 @@ public static void main(String[] args) { World.resetGame(); // "half"-starts a new game, to set up initial variables player.eid = 0; - new Load(true, false); // This loads any saved preferences. + new Load(true); // This loads any saved preferences. + MAX_FPS = (int) Settings.get("fps"); // DO NOT put this above. // Update fullscreen frame if Updater.FULLSCREEN was updated previously if (Updater.FULLSCREEN) { diff --git a/src/client/java/minicraft/core/Initializer.java b/src/client/java/minicraft/core/Initializer.java index 9a78b5ce7..923aa3d35 100644 --- a/src/client/java/minicraft/core/Initializer.java +++ b/src/client/java/minicraft/core/Initializer.java @@ -2,7 +2,6 @@ import minicraft.core.io.FileHandler; import minicraft.core.io.Localization; -import minicraft.core.io.Settings; import minicraft.util.Logging; import minicraft.util.TinylogLoggingProvider; import org.jetbrains.annotations.Nullable; diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index d447fc1c7..ce0c92622 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -1,18 +1,12 @@ package minicraft.core.io; -import minicraft.core.Game; -import minicraft.gfx.Color; -import minicraft.screen.OptionsMainMenuDisplay; -import minicraft.screen.PopupDisplay; import minicraft.screen.entry.ArrayEntry; import minicraft.screen.entry.BooleanEntry; import minicraft.screen.entry.RangeEntry; -import minicraft.screen.entry.StringEntry; import java.awt.DisplayMode; import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; -import java.util.ArrayList; import java.util.HashMap; public final class Settings { diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 5338525a8..992fccd42 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -193,10 +193,10 @@ public Load(String worldname, boolean loadGame) { public Load() { this(Game.VERSION); } public Load(Version worldVersion) { - this(false, false); + this(false); worldVer = worldVersion; } - public Load(boolean loadConfig, boolean partialLoad) { + public Load(boolean loadConfig) { if (!loadConfig) return; boolean resave = false; @@ -205,11 +205,11 @@ public Load(boolean loadConfig, boolean partialLoad) { // Check if Preferences.json exists. (new version) if (new File(location + "Preferences.json").exists()) { - loadPrefs("Preferences", partialLoad); + loadPrefs("Preferences"); // Check if Preferences.miniplussave exists. (old version) } else if (new File(location + "Preferences" + extension).exists()) { - loadPrefsOld("Preferences", partialLoad); + loadPrefsOld("Preferences"); Logging.SAVELOAD.info("Upgrading preferences to JSON."); resave = true; @@ -219,8 +219,6 @@ public Load(boolean loadConfig, boolean partialLoad) { resave = true; } - if (partialLoad) return; // Partial loading only loads partial preferences - // Load unlocks. (new version) File testFileOld = new File(location + "unlocks" + extension); File testFile = new File(location + "Unlocks" + extension); @@ -427,7 +425,7 @@ private void loadMode(String modedata) { Settings.setIdx("mode", mode); } - private void loadPrefsOld(String filename, boolean partialLoad) { + private void loadPrefsOld(String filename) { loadFromFile(location + filename + extension); Version prefVer = new Version("2.0.2"); // the default, b/c this doesn't really matter much being specific past this if it's not set below. @@ -440,8 +438,6 @@ private void loadPrefsOld(String filename, boolean partialLoad) { if (prefVer.compareTo(new Version("2.0.4-dev2")) >= 0) Settings.set("fps", Integer.parseInt(data.remove(0))); - if (partialLoad) return; // Partial loading only loads basic settings. - SkinDisplay.releaseSkins(); // Get legacy language and convert it into the current format. @@ -506,7 +502,7 @@ private void loadPrefsOld(String filename, boolean partialLoad) { } } - private void loadPrefs(String filename, boolean partialLoad) { + private void loadPrefs(String filename) { JSONObject json; try { json = new JSONObject(loadFromFile(location + filename + ".json", false)); @@ -524,8 +520,6 @@ private void loadPrefs(String filename, boolean partialLoad) { Settings.set("fps", json.getInt("fps")); Settings.set("showquests", json.optBoolean("showquests", true)); - if (partialLoad) return; // Partial loading only loads basic settings. - if (json.has("lang")) { String lang = json.getString("lang"); Localization.changeLanguage(lang); diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index b28c711ad..6182bf3e0 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -12,7 +12,6 @@ public OptionsMainMenuDisplay() { Settings.getEntry("fps"), Settings.getEntry("sound"), Settings.getEntry("showquests"), - Settings.getEntry("hardwareacc"), new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), From 4ef1daa24df24832bc26eb37c3db154b0035eb1b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 8 Jul 2023 21:37:41 +0800 Subject: [PATCH 059/261] Add knight statue limit --- src/client/java/minicraft/item/SummonItem.java | 15 +++++++++------ .../resources/assets/localization/en-us.json | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/item/SummonItem.java b/src/client/java/minicraft/item/SummonItem.java index de4508c5d..27455e08b 100644 --- a/src/client/java/minicraft/item/SummonItem.java +++ b/src/client/java/minicraft/item/SummonItem.java @@ -68,12 +68,15 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, // If the player nears the center. if (new Rectangle(level.w/2-3, level.h/2-3, 7, 7).contains(player.x >> 4, player.y >> 4)) { if (!ObsidianKnight.active) { - - // Pay stamina - if (player.payStamina(2)) { - level.add(new KnightStatue(5000), level.w/2, level.h/2, true); - Logger.tag("SummonItem").debug("Summoned new Knight Statue"); - success = true; + if (level.getEntitiesOfClass(KnightStatue.class).length == 0) { // Prevent unintended behaviors + // Pay stamina + if (player.payStamina(2)) { + level.add(new KnightStatue(5000), level.w/2, level.h/2, true); + Logger.tag("SummonItem").debug("Summoned new Knight Statue"); + success = true; + } + } else { + Game.notifications.add(Localization.getLocalized("minicraft.notification.knight_statue_exists")); } } else { Game.notifications.add(Localization.getLocalized("minicraft.notification.boss_limit")); diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 5104b46ff..4ed7ccdab 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -233,6 +233,7 @@ "minicraft.notification.wrong_level_dungeon": "Can only be summoned on the dungeon level", "minicraft.notification.boss_limit": "No more bosses can be spawned", "minicraft.notification.spawn_on_boss_tile": "Can only be summoned in the Boss Room", + "minicraft.notification.knight_statue_exists": "A knight statue exists", "minicraft.notifications.statue_tapped": "You hear echoed whispers...", "minicraft.notifications.statue_touched": "You hear the statue vibrating...", "minicraft.quest.farming": "Farming Farmer", From 788c92c1cf2579b012fb7777154ea4af83aa8dee Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 9 Jul 2023 02:21:37 +0800 Subject: [PATCH 060/261] Update en-us.json --- src/client/resources/assets/localization/en-us.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index d52cd7703..5104b46ff 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -282,6 +282,7 @@ "minicraft.settings.mode.hardcore": "Hardcore", "minicraft.settings.mode.score": "Score", "minicraft.settings.scoretime": "Time (Score Mode)", + "minicraft.settings.screenshot_scale": "Screenshot Scale", "minicraft.settings.sound": "Sound", "minicraft.settings.autosave": "Autosave", "minicraft.settings.size": "World Size", From df46bc1063f2ddf6bb926fd7bdbc56c92f377ce2 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 9 Jul 2023 14:14:34 +0800 Subject: [PATCH 061/261] Update SummonItem.java --- src/client/java/minicraft/item/SummonItem.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/SummonItem.java b/src/client/java/minicraft/item/SummonItem.java index 27455e08b..15c0d286e 100644 --- a/src/client/java/minicraft/item/SummonItem.java +++ b/src/client/java/minicraft/item/SummonItem.java @@ -3,6 +3,7 @@ import minicraft.core.Game; import minicraft.core.io.Localization; import minicraft.entity.Direction; +import minicraft.entity.Entity; import minicraft.entity.furniture.KnightStatue; import minicraft.entity.mob.AirWizard; import minicraft.entity.mob.ObsidianKnight; @@ -68,7 +69,15 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, // If the player nears the center. if (new Rectangle(level.w/2-3, level.h/2-3, 7, 7).contains(player.x >> 4, player.y >> 4)) { if (!ObsidianKnight.active) { - if (level.getEntitiesOfClass(KnightStatue.class).length == 0) { // Prevent unintended behaviors + boolean exists = false; + for (Entity e : level.getEntityArray()) { + if (e instanceof KnightStatue) { + exists = true; + break; + } + } + + if (!exists) { // Prevent unintended behaviors // Pay stamina if (player.payStamina(2)) { level.add(new KnightStatue(5000), level.w/2, level.h/2, true); From 753500532c92d45146c72494cdd6ca940464bbf3 Mon Sep 17 00:00:00 2001 From: Litorom Date: Tue, 11 Jul 2023 10:59:17 -0400 Subject: [PATCH 062/261] Fixed wrong sprite usage when OBK is respawned. --- src/client/java/minicraft/entity/mob/ObsidianKnight.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/client/java/minicraft/entity/mob/ObsidianKnight.java b/src/client/java/minicraft/entity/mob/ObsidianKnight.java index 84f833338..d76eb0d4c 100644 --- a/src/client/java/minicraft/entity/mob/ObsidianKnight.java +++ b/src/client/java/minicraft/entity/mob/ObsidianKnight.java @@ -85,6 +85,11 @@ public void tick() { lvlSprites = broken; } + //Fix for wrong sprite usage when respawned + if (health > 2500) { + lvlSprites = armored; + } + if (Game.isMode("minicraft.settings.mode.creative")) return; // Should not attack if player is in creative if (attackPhaseCooldown == 0) { From 3b8f9f1efeee6562f23fe7aad5a12fed82a8b16a Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:20:55 +0800 Subject: [PATCH 063/261] Fix Obsidian Knight phase problem Also fix sprite setting problem --- .../java/minicraft/entity/mob/ObsidianKnight.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/ObsidianKnight.java b/src/client/java/minicraft/entity/mob/ObsidianKnight.java index d76eb0d4c..9c46a5b5b 100644 --- a/src/client/java/minicraft/entity/mob/ObsidianKnight.java +++ b/src/client/java/minicraft/entity/mob/ObsidianKnight.java @@ -16,6 +16,7 @@ import minicraft.gfx.SpriteLinker; import minicraft.item.Items; import minicraft.screen.AchievementsDisplay; +import org.jetbrains.annotations.Range; public class ObsidianKnight extends EnemyMob { private static final SpriteLinker.LinkedSprite[][][] armored = new SpriteLinker.LinkedSprite[][][] { @@ -36,8 +37,9 @@ public class ObsidianKnight extends EnemyMob { public static boolean beaten = false; // If the boss was beaten public static boolean active = false; // If the boss is active - private static int phase = 0; // The phase of the boss. {0, 1} - private static int attackPhaseCooldown = 0; // Cooldown between attacks + @Range(from = 0, to = 1) + private int phase = 0; // The phase of the boss. {0, 1} + private int attackPhaseCooldown = 0; // Cooldown between attacks private AttackPhase attackPhase = AttackPhase.Attacking; private enum AttackPhase { Attacking, Dashing, Walking; } // Using fire sparks in attacking. @@ -81,12 +83,9 @@ public void tick() { if (health <= 2500) { phase = 1; } - if (phase == 1) { + if (phase == 1) { // Refreshing phased sprites lvlSprites = broken; - } - - //Fix for wrong sprite usage when respawned - if (health > 2500) { + } else { lvlSprites = armored; } @@ -139,7 +138,7 @@ public void tick() { else if (atan2 < -67.5) attackDir = -90; else if (atan2 < -22.5) attackDir = -45; else attackDir = 0; - double speed = 1 + attackLevel * 0.2 + attackTime / 10 * 0.01; // speed is dependent on the attackType. (higher attackType, faster speeds) + double speed = 1 + attackLevel * 0.2 + attackTime / 10D * 0.01; // speed is dependent on the attackType. (higher attackType, faster speeds) // The range of attack is 90 degrees. With little random factor. int phi = attackDir - 36 + (attackTime % 5) * 18 + random.nextInt(7) - 3; level.add(new FireSpark(this, Math.cos(Math.toRadians(phi)) * speed, Math.sin(Math.toRadians(phi)) * speed)); // Adds a spark entity with the cosine and sine of dir times speed. From 6a76ec9dd599c6969ca28e8526537edf25207b1b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:24:24 +0800 Subject: [PATCH 064/261] Update Obsidian Knight phase handle --- .../java/minicraft/entity/mob/ObsidianKnight.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/ObsidianKnight.java b/src/client/java/minicraft/entity/mob/ObsidianKnight.java index 9c46a5b5b..8ee4bcf89 100644 --- a/src/client/java/minicraft/entity/mob/ObsidianKnight.java +++ b/src/client/java/minicraft/entity/mob/ObsidianKnight.java @@ -79,14 +79,10 @@ public void tick() { this.remove(); } - //Achieve phase2 - if (health <= 2500) { + // Achieve phase 2 + if (health <= 2500 && phase == 0) { // Assume that phase would not turn back to phase 1 phase = 1; - } - if (phase == 1) { // Refreshing phased sprites - lvlSprites = broken; - } else { - lvlSprites = armored; + lvlSprites = broken; // Refreshing phased sprites } if (Game.isMode("minicraft.settings.mode.creative")) return; // Should not attack if player is in creative From d16ff819d0e1aae8ef9956d2a250b243cccf7b40 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:34:25 +0800 Subject: [PATCH 065/261] Fix Level#getData unsigned short conversion --- src/client/java/minicraft/level/Level.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 5946535e4..b6d3039d4 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -568,7 +568,7 @@ public void setTile(int x, int y, Tile t, int dataVal) { public int getData(int x, int y) { if (x < 0 || y < 0 || x >= w || y >= h) return 0; - return data[x + y * w]; + return data[x + y * w] & 0xFFFF; } public void setData(int x, int y, int val) { From e6be928ebd62968c66593f41e6e0f5e3badc73c5 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:21:41 +0800 Subject: [PATCH 066/261] Fix crop stage calculation error --- src/client/java/minicraft/level/tile/farming/CarrotTile.java | 2 +- .../java/minicraft/level/tile/farming/HeavenlyBerriesTile.java | 2 +- .../java/minicraft/level/tile/farming/HellishBerriesTile.java | 2 +- src/client/java/minicraft/level/tile/farming/PotatoTile.java | 2 +- src/client/java/minicraft/level/tile/farming/TomatoTile.java | 2 +- src/client/java/minicraft/level/tile/farming/WheatTile.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/level/tile/farming/CarrotTile.java b/src/client/java/minicraft/level/tile/farming/CarrotTile.java index 313813adc..1a91530d7 100644 --- a/src/client/java/minicraft/level/tile/farming/CarrotTile.java +++ b/src/client/java/minicraft/level/tile/farming/CarrotTile.java @@ -22,7 +22,7 @@ public CarrotTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = age / (maxAge / 3); + int stage = (int) (age / maxAge * 3f); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java index e5d2c3dc0..9a3bb5132 100644 --- a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java @@ -21,7 +21,7 @@ public HeavenlyBerriesTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = age / (maxAge / 3); + int stage = (int) (age / maxAge * 3f); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java index d4fa25730..14da378e7 100644 --- a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java @@ -21,7 +21,7 @@ public HellishBerriesTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = age / (maxAge / 3); + int stage = (int) (age / maxAge * 3f); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/PotatoTile.java b/src/client/java/minicraft/level/tile/farming/PotatoTile.java index 9272ca2ba..7e2ac4379 100644 --- a/src/client/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/PotatoTile.java @@ -24,7 +24,7 @@ public PotatoTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = age / (maxAge / 5); + int stage = (int) (age / maxAge * 5f); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/TomatoTile.java b/src/client/java/minicraft/level/tile/farming/TomatoTile.java index ecadf0b24..ea92ebbea 100644 --- a/src/client/java/minicraft/level/tile/farming/TomatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/TomatoTile.java @@ -22,7 +22,7 @@ public TomatoTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = age / (maxAge / 3); + int stage = (int) (age / maxAge * 3f); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/WheatTile.java b/src/client/java/minicraft/level/tile/farming/WheatTile.java index 367c8e69f..b33d93c14 100644 --- a/src/client/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/client/java/minicraft/level/tile/farming/WheatTile.java @@ -24,7 +24,7 @@ public WheatTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = age / (maxAge / 5); + int stage = (int) (age / maxAge * 5f); screen.render(x * 16, y * 16, spritStages[stage]); } } From 6878e728fe02c11b2cf04780c9688e1bf1b17301 Mon Sep 17 00:00:00 2001 From: Makkkkus <37084190+Makkkkus@users.noreply.github.com> Date: Wed, 19 Jul 2023 22:57:14 +0200 Subject: [PATCH 067/261] Update autobuild.yml --- .github/workflows/autobuild.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 631cf6746..2c260ae31 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -23,14 +23,11 @@ jobs: - name: Execute Gradle build run: ./gradlew build - - uses: "dciborow/action-github-releases@v1.0.1" + - uses: actions/upload-artifact@v3.1.2 with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: true - title: "Nightly (breaking)" - generate_release_notes: true - files: | + name: "Nightly release" + path: | LICENSE ChangeLog.md build/libs/**.jar - + if-no-files-found: error From fcc44be66c4fd1793029ed00ba846e41f61c07e9 Mon Sep 17 00:00:00 2001 From: Makkkkus <37084190+Makkkkus@users.noreply.github.com> Date: Wed, 19 Jul 2023 23:02:38 +0200 Subject: [PATCH 068/261] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4d00c10c3..ef7ff6d31 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Nightly build](https://github.com/MinicraftPlus/minicraft-plus-revived/actions/workflows/autobuild.yml/badge.svg?branch=main)](https://github.com/MinicraftPlus/minicraft-plus-revived/actions/workflows/autobuild.yml) +[![CodeQL](https://github.com/MinicraftPlus/minicraft-plus-revived/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/MinicraftPlus/minicraft-plus-revived/actions/workflows/codeql-analysis.yml) + # Minicraft+ ![Minicraft+](https://user-images.githubusercontent.com/37084190/138313821-75ac3112-7044-45c1-bdbb-d89f2333c2c0.png) From 7a3fdfb134c960750da0f3410437962fa83b0e08 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 20 Jul 2023 13:57:37 +0800 Subject: [PATCH 069/261] Further fix crop stage calculation problem --- src/client/java/minicraft/level/tile/farming/CarrotTile.java | 2 +- .../java/minicraft/level/tile/farming/HeavenlyBerriesTile.java | 2 +- .../java/minicraft/level/tile/farming/HellishBerriesTile.java | 2 +- src/client/java/minicraft/level/tile/farming/PotatoTile.java | 2 +- src/client/java/minicraft/level/tile/farming/TomatoTile.java | 2 +- src/client/java/minicraft/level/tile/farming/WheatTile.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/level/tile/farming/CarrotTile.java b/src/client/java/minicraft/level/tile/farming/CarrotTile.java index 1a91530d7..542fee7d6 100644 --- a/src/client/java/minicraft/level/tile/farming/CarrotTile.java +++ b/src/client/java/minicraft/level/tile/farming/CarrotTile.java @@ -22,7 +22,7 @@ public CarrotTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = (int) (age / maxAge * 3f); + int stage = (int) ((float) age / maxAge * 3); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java index 9a3bb5132..c4fc57100 100644 --- a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java @@ -21,7 +21,7 @@ public HeavenlyBerriesTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = (int) (age / maxAge * 3f); + int stage = (int) ((float) age / maxAge * 3); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java index 14da378e7..6d4f7bcb5 100644 --- a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java @@ -21,7 +21,7 @@ public HellishBerriesTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = (int) (age / maxAge * 3f); + int stage = (int) ((float) age / maxAge * 3); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/PotatoTile.java b/src/client/java/minicraft/level/tile/farming/PotatoTile.java index 7e2ac4379..9a5c44798 100644 --- a/src/client/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/PotatoTile.java @@ -24,7 +24,7 @@ public PotatoTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = (int) (age / maxAge * 5f); + int stage = (int) ((float) age / maxAge * 5); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/TomatoTile.java b/src/client/java/minicraft/level/tile/farming/TomatoTile.java index ea92ebbea..a8329ae63 100644 --- a/src/client/java/minicraft/level/tile/farming/TomatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/TomatoTile.java @@ -22,7 +22,7 @@ public TomatoTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = (int) (age / maxAge * 3f); + int stage = (int) ((float) age / maxAge * 3); screen.render(x * 16, y * 16, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/WheatTile.java b/src/client/java/minicraft/level/tile/farming/WheatTile.java index b33d93c14..39f585bf4 100644 --- a/src/client/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/client/java/minicraft/level/tile/farming/WheatTile.java @@ -24,7 +24,7 @@ public WheatTile(String name) { public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); - int stage = (int) (age / maxAge * 5f); + int stage = (int) ((float) age / maxAge * 5); screen.render(x * 16, y * 16, spritStages[stage]); } } From c4688ad0ea93dc1464810ec2e4b7aca62ad32b19 Mon Sep 17 00:00:00 2001 From: GreenEye Date: Wed, 19 Jul 2023 17:18:09 -0300 Subject: [PATCH 070/261] Update ContainerDisplay.java * The order of the inventories was changed, now the player's inventory will be on the left, and the chest will be on the right --- .../minicraft/screen/ContainerDisplay.java | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index dda07468c..3912f0f93 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -19,19 +19,24 @@ public class ContainerDisplay extends Display { private Chest chest; public ContainerDisplay(Player player, Chest chest) { - super(new InventoryMenu(chest, chest.getInventory(), chest.name, RelPos.LEFT), new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.RIGHT)); + super( + new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT), + new InventoryMenu(chest, chest.getInventory(), chest.name, RelPos.RIGHT) + ); + //pInv = player.getInventory(); //cInv = chest.getInventory(); this.player = player; this.chest = chest; onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); - if (onScreenKeyboardMenu != null) + if (onScreenKeyboardMenu != null) { onScreenKeyboardMenu.setVisible(false); + } menus[1].translate(menus[0].getBounds().getWidth() + padding, 0); - if(menus[0].getNumOptions() == 0) onSelectionChange(0, 1); + if (menus[1].getNumOptions() == 0) onSelectionChange(1, 0); } OnScreenKeyboardMenu onScreenKeyboardMenu; @@ -39,12 +44,17 @@ public ContainerDisplay(Player player, Chest chest) { @Override protected void onSelectionChange(int oldSel, int newSel) { super.onSelectionChange(oldSel, newSel); - if(oldSel == newSel) return; // this also serves as a protection against access to menus[0] when such may not exist. + + if (oldSel == newSel) return; // this also serves as a protection against access to menus[0] when such may not exist. + int shift = 0; - if(newSel == 0) shift = padding - menus[0].getBounds().getLeft(); - if(newSel == 1) shift = (Screen.w - padding) - menus[1].getBounds().getRight(); - for(Menu m: menus) + + if (newSel == 0) shift = padding - menus[0].getBounds().getLeft(); + if (newSel == 1) shift = (Screen.w - padding) - menus[1].getBounds().getRight(); + + for (Menu m: menus) { m.translate(shift, 0); + } } private int getOtherIdx() { return selection ^ 1; } @@ -52,8 +62,9 @@ protected void onSelectionChange(int oldSel, int newSel) { @Override public void render(Screen screen) { super.render(screen); - if (onScreenKeyboardMenu != null) + if (onScreenKeyboardMenu != null) { onScreenKeyboardMenu.render(screen); + } } @Override @@ -101,14 +112,15 @@ public void tick(InputHandler input) { if (mainMethod || !onScreenKeyboardMenu.isVisible()) if (input.inputPressed("attack") || input.getKey("shift-enter").clicked) { if (curMenu.getEntries().length == 0) return; + // switch inventories Inventory from, to; - if(selection == 0) { - from = chest.getInventory(); - to = player.getInventory(); - } else { + if (selection == 0) { from = player.getInventory(); to = chest.getInventory(); + } else { + from = chest.getInventory(); + to = player.getInventory(); } int toSel = menus[otherIdx].getSelection(); @@ -148,8 +160,9 @@ public void tick(InputHandler input) { } public void onInvUpdate(ItemHolder holder) { - if(holder == player || holder == chest) + if (holder == player || holder == chest) { update(); + } } private void update() { From 7b86af755491db8b1509568bb132c48c0d69f937 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 27 Jul 2023 03:48:22 +0800 Subject: [PATCH 071/261] Add multiple clip support --- src/client/java/minicraft/core/io/Sound.java | 90 +++++++++++++------- 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/src/client/java/minicraft/core/io/Sound.java b/src/client/java/minicraft/core/io/Sound.java index fd547a7a3..1a9035974 100644 --- a/src/client/java/minicraft/core/io/Sound.java +++ b/src/client/java/minicraft/core/io/Sound.java @@ -4,7 +4,9 @@ import minicraft.util.Logging; import org.jetbrains.annotations.Nullable; +import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.DataLine; @@ -13,6 +15,9 @@ import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; +import java.applet.AudioClip; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; @@ -21,10 +26,16 @@ public class Sound { // Creates sounds from their respective files private static final HashMap sounds = new HashMap<>(); - private Clip clip; // Creates a audio clip to be played + private final DataLine.Info info; + private final byte[] raw; + private final AudioFormat format; + private final long length; - private Sound(Clip clip) { - this.clip = clip; + private Sound(DataLine.Info info, byte[] raw, AudioFormat format, long length) { + this.info = info; + this.raw = raw; + this.format = format; + this.length = length; } public static void resetSounds() { @@ -33,7 +44,9 @@ public static void resetSounds() { public static void loadSound(String key, InputStream in, String pack) { try { - DataLine.Info info = new DataLine.Info(Clip.class, AudioSystem.getAudioFileFormat(in).getFormat()); + AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(in); + AudioFormat format = fileFormat.getFormat(); + DataLine.Info info = new DataLine.Info(Clip.class, format); if (!AudioSystem.isLineSupported(info)) { Logging.RESOURCEHANDLER_SOUND.error("ERROR: Audio format of file \"{}\" in pack \"\" is not supported: {}", key, pack, AudioSystem.getAudioFileFormat(in)); @@ -65,25 +78,21 @@ public static void loadSound(String key, InputStream in, String pack) { return; } - Clip clip = (Clip)AudioSystem.getLine(info); - clip.open(AudioSystem.getAudioInputStream(in)); - - clip.addLineListener(e -> { - if (e.getType() == LineEvent.Type.STOP) { - clip.flush(); - clip.setFramePosition(0); - } - }); - - sounds.put(key, new Sound(clip)); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buf = new byte[8192]; + int length; + while ((length = in.read(buf)) != -1) { + out.write(buf, 0, length); + } + sounds.put(key, new Sound(info, out.toByteArray(), format, fileFormat.getFrameLength())); - } catch (LineUnavailableException | UnsupportedAudioFileException | IOException e) { + } catch (UnsupportedAudioFileException | IOException e) { CrashHandler.errorHandle(e, new CrashHandler.ErrorInfo("Audio Could not Load", CrashHandler.ErrorInfo.ErrorType.REPORT, String.format("Could not load audio: %s in pack: %s", key, pack))); } } - /** Recommend {@link #play(String)} and {@link #loop(String, boolean)}. */ + /** Recommend {@link #play(String)} and {@link #loop(String, int)}. */ @Nullable public static Sound getSound(String key) { return sounds.get(key); @@ -95,27 +104,46 @@ public static void play(String key) { if (sound != null) sound.play(); } - /** This method does safe check for {@link #loop(boolean)}. */ - public static void loop(String key, boolean start) { + /** This method does safe check for {@link #loop(int)}. */ + public static void loop(String key, int count) { Sound sound = sounds.get(key); - if (sound != null) sound.loop(start); + if (sound != null) sound.loop(count); } - public void play() { - if (!(boolean)Settings.get("sound") || clip == null) return; + @Nullable + private Clip createClip() { + try { + Clip clip = (Clip) AudioSystem.getLine(info); // Creates an audio clip to be played + clip.open(new AudioInputStream(new ByteArrayInputStream(raw), format, length)); + clip.addLineListener(e -> { + if (e.getType() == LineEvent.Type.STOP) { + clip.flush(); + clip.close(); + } + }); - if (clip.isRunning() || clip.isActive()) - clip.stop(); + return clip; + } catch (LineUnavailableException | IOException e) { + Logging.RESOURCEHANDLER_SOUND.error(e, "Unable to create Clip"); + return null; + } + } + + public void play() { + if (!(boolean)Settings.get("sound")) return; - clip.start(); + Clip clip = createClip(); + if (clip != null) { + clip.start(); + } } - public void loop(boolean start) { - if (!(boolean)Settings.get("sound") || clip == null) return; + public void loop(int count) { + if (!(boolean)Settings.get("sound")) return; - if (start) - clip.loop(Clip.LOOP_CONTINUOUSLY); - else - clip.stop(); + Clip clip = createClip(); + if (clip != null) { + clip.loop(count); + } } } From 68b576c01aa01bcdcff1989625092f296dc62060 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 29 Jul 2023 00:08:55 +0800 Subject: [PATCH 072/261] Clean up usages of Random in chests --- .../minicraft/entity/furniture/Chest.java | 5 ++-- .../entity/furniture/DungeonChest.java | 23 +++++++++---------- .../java/minicraft/item/FurnitureItem.java | 2 +- src/client/java/minicraft/item/Inventory.java | 23 ++++--------------- src/client/java/minicraft/level/Level.java | 13 +++++++---- .../java/minicraft/level/Structure.java | 14 +++++++---- .../java/minicraft/saveload/LegacyLoad.java | 2 +- src/client/java/minicraft/saveload/Load.java | 2 +- 8 files changed, 40 insertions(+), 44 deletions(-) diff --git a/src/client/java/minicraft/entity/furniture/Chest.java b/src/client/java/minicraft/entity/furniture/Chest.java index b2f186cc6..b213a2338 100644 --- a/src/client/java/minicraft/entity/furniture/Chest.java +++ b/src/client/java/minicraft/entity/furniture/Chest.java @@ -16,6 +16,7 @@ import java.io.IOException; import java.util.List; +import java.util.Random; public class Chest extends Furniture implements ItemHolder { private Inventory inventory; // Inventory of the chest @@ -39,7 +40,7 @@ public boolean use(Player player) { return true; } - public void populateInvRandom(String lootTable, int depth) { + public void populateInvRandom(Random random, String lootTable, @SuppressWarnings("unused") int depth) { // depth is unused try { String[] lines = Load.loadFile("/resources/data/chestloot/" + lootTable + ".txt").toArray(new String[]{}); @@ -47,7 +48,7 @@ public void populateInvRandom(String lootTable, int depth) { //System.out.println(line); String[] data = line.split(","); if (!line.startsWith(":")) { - inventory.tryAdd(Integer.parseInt(data[0]), Items.get(data[1]), data.length < 3 ? 1 : Integer.parseInt(data[2])); + inventory.tryAdd(random, Integer.parseInt(data[0]), Items.get(data[1]), data.length < 3 ? 1 : Integer.parseInt(data[2])); } else if (inventory.invSize() == 0) { // Adds the "fallback" items to ensure there's some stuff String[] fallbacks = line.substring(1).split(":"); diff --git a/src/client/java/minicraft/entity/furniture/DungeonChest.java b/src/client/java/minicraft/entity/furniture/DungeonChest.java index a7aaf9ddf..2535a4586 100644 --- a/src/client/java/minicraft/entity/furniture/DungeonChest.java +++ b/src/client/java/minicraft/entity/furniture/DungeonChest.java @@ -22,21 +22,21 @@ public class DungeonChest extends Chest { private static final LinkedSprite openSprite = new LinkedSprite(SpriteType.Entity, "dungeon_chest"); private static final LinkedSprite lockSprite = new LinkedSprite(SpriteType.Entity, "white_chest"); - public Random random = new Random(); private boolean isLocked; /** * Creates a custom chest with the name Dungeon Chest. - * @param populateInv Populate the inventory of the DungeonChest using the loot table system. + * @param random Populate the inventory of the DungeonChest using the loot table system with the given {@link Random} provider. + * {@code null} if populating the inventory is not intended. */ - public DungeonChest(boolean populateInv) { - this(populateInv, false); + public DungeonChest(@Nullable Random random) { + this(random, false); } - public DungeonChest(boolean populateInv, boolean unlocked) { + public DungeonChest(@Nullable Random random, boolean unlocked) { super("Dungeon Chest"); - if (populateInv) { - populateInv(); + if (random != null) { + populateInv(random); } setLocked(!unlocked); @@ -44,7 +44,7 @@ public DungeonChest(boolean populateInv, boolean unlocked) { @Override public @NotNull Furniture copy() { - return new DungeonChest(false, !this.isLocked); + return new DungeonChest(null, !this.isLocked); } public boolean use(Player player) { @@ -83,13 +83,12 @@ public boolean use(Player player) { /** * Populate the inventory of the DungeonChest using the loot table system. */ - private void populateInv() { + public void populateInv(Random random) { // Clear inventory. - Inventory inv = getInventory(); - inv.clearInv(); + getInventory().clearInv(); // Populate inventory. - populateInvRandom("dungeonchest", 0); + populateInvRandom(random, "dungeonchest", 0); } public boolean isLocked() { diff --git a/src/client/java/minicraft/item/FurnitureItem.java b/src/client/java/minicraft/item/FurnitureItem.java index 0bf800a8d..22ea2460c 100644 --- a/src/client/java/minicraft/item/FurnitureItem.java +++ b/src/client/java/minicraft/item/FurnitureItem.java @@ -44,7 +44,7 @@ protected static ArrayList getAllInstances() { items.add(new FurnitureItem(new Spawner(new Knight(1)))); items.add(new FurnitureItem(new Chest())); - items.add(new FurnitureItem(new DungeonChest(false, true))); + items.add(new FurnitureItem(new DungeonChest(null, false, true))); // Add the various types of crafting furniture for (Crafter.Type type: Crafter.Type.values()) { diff --git a/src/client/java/minicraft/item/Inventory.java b/src/client/java/minicraft/item/Inventory.java index 106d6b26c..da41b8c8e 100644 --- a/src/client/java/minicraft/item/Inventory.java +++ b/src/client/java/minicraft/item/Inventory.java @@ -9,7 +9,6 @@ import java.util.Random; public class Inventory { - private final Random random = new Random(); private final List items = new ArrayList<>(); // The list of items that is in the inventory. protected int maxItem = 27; @@ -244,37 +243,25 @@ public void updateInv(String items) { /** * Tries to add an item to the inventory. + * @param random The {@code Random} number generator. * @param chance Chance for the item to be added. * @param item Item to be added. * @param num How many of the item. * @param allOrNothing if true, either all items will be added or none, if false its possible to add * between 0-num items. */ - public void tryAdd(int chance, Item item, int num, boolean allOrNothing) { + public void tryAdd(Random random, int chance, Item item, int num, boolean allOrNothing) { if (!allOrNothing || random.nextInt(chance) == 0) for (int i = 0; i < num; i++) if (allOrNothing || random.nextInt(chance) == 0) add(item.copy()); } - public void tryAdd(int chance, @Nullable Item item, int num) { + public void tryAdd(Random random, int chance, @Nullable Item item, int num) { if (item == null) return; if (item instanceof StackableItem) { ((StackableItem)item).count *= num; - tryAdd(chance, item, 1, true); + tryAdd(random, chance, item, 1, true); } else - tryAdd(chance, item, num, false); - } - public void tryAdd(int chance, @Nullable Item item) { tryAdd(chance, item, 1); } - public void tryAdd(int chance, ToolType type, int lvl) { - tryAdd(chance, new ToolItem(type, lvl)); - } - - /** - * Tries to add an Furniture to the inventory. - * @param chance Chance for the item to be added. - * @param type Type of furniture to add. - */ - public void tryAdd(int chance, Furniture type) { - tryAdd(chance, new FurnitureItem(type)); + tryAdd(random, chance, item, num, false); } } diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 716e62a87..4fc71a571 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -269,7 +269,7 @@ private void checkChestCount(boolean check) { /// Make DungeonChests! for (int i = numChests; i < 10 * (w / 128); i++) { - DungeonChest d = new DungeonChest(true); + DungeonChest d = new DungeonChest(random); boolean addedchest = false; while (!addedchest) { // Keep running until we successfully add a DungeonChest @@ -939,7 +939,7 @@ private void generateSpawnerStructures() { Chest c = new Chest(); int chance = -depth; - c.populateInvRandom("minidungeon", chance); + c.populateInvRandom(random, "minidungeon", chance); add(c, sp.x - 16 + rpt * 32, sp.y - 16); } @@ -995,7 +995,7 @@ private void generateSpawnerStructures() { add(sp); for (int rpt = 0; rpt < 2; rpt++) { if (random.nextInt(2) != 0) continue; - DungeonChest c = new DungeonChest(true); + DungeonChest c = new DungeonChest(random); chestCount++; add(c, sp.x - 16 + rpt * 32, sp.y - 16); @@ -1055,7 +1055,7 @@ private void generateVillages() { // Add a chest to some of the houses if (hasChest) { Chest c = new Chest(); - c.populateInvRandom("villagehouse", 1); + c.populateInvRandom(random, "villagehouse", 1); add(c, (x + random.nextInt(2) + xo) << 4, (y + random.nextInt(2) + yo) << 4); } } @@ -1076,7 +1076,10 @@ private void generateDungeonStructures() { if (random.nextInt(2) == 1) { Structure.dungeonGarden.draw(this, x, y); } else { - Structure.dungeonChest.draw(this, x, y); + Structure.dungeonChest.draw(this, x, y, furniture -> { + if (furniture instanceof DungeonChest) + ((DungeonChest) furniture).populateInv(random); + }); } } } diff --git a/src/client/java/minicraft/level/Structure.java b/src/client/java/minicraft/level/Structure.java index 8175ece84..53ad797fc 100644 --- a/src/client/java/minicraft/level/Structure.java +++ b/src/client/java/minicraft/level/Structure.java @@ -11,6 +11,8 @@ import java.util.HashMap; import java.util.HashSet; +import java.util.Random; +import java.util.function.Consumer; // this stores structures that can be drawn at any location. public class Structure { @@ -34,12 +36,16 @@ public void addFurniture(int x, int y, Furniture furniture) { this.furniture.put(new Point(x, y), furniture); } - public void draw(Level level, int xt, int yt) { + public void draw(Level level, int xt, int yt) { draw(level, xt, yt, f -> {}); } + public void draw(Level level, int xt, int yt, Consumer furnitureHandler) { for (TilePoint p: tiles) level.setTile(xt+p.x, yt+p.y, p.t); - for (Point p: furniture.keySet()) - level.add(furniture.get(p).copy(), xt+p.x, yt+p.y, true); + for (Point p: furniture.keySet()) { + Furniture fur = furniture.get(p).copy(); + furnitureHandler.accept(fur); + level.add(fur, xt+p.x, yt+p.y, true); + } } public void draw(short[] map, int xt, int yt, int mapWidth) { @@ -204,7 +210,7 @@ public int hashCode() { "WOOOOOW\n" + "WWWDWWW" ); - dungeonChest.addFurniture(0,0, new DungeonChest(true)); + dungeonChest.addFurniture(0,0, new DungeonChest(null)); mobDungeonCenter = new Structure(); mobDungeonCenter.setData("B:Stone Bricks,W:Stone Wall", diff --git a/src/client/java/minicraft/saveload/LegacyLoad.java b/src/client/java/minicraft/saveload/LegacyLoad.java index 46dcb4f5b..cf3c8187a 100644 --- a/src/client/java/minicraft/saveload/LegacyLoad.java +++ b/src/client/java/minicraft/saveload/LegacyLoad.java @@ -445,7 +445,7 @@ public Entity getEntity(String string, Player player, int mobLevel) { case "Workbench": return new Crafter(Crafter.Type.Workbench); case "Chest": return new Chest(); case "DeathChest": return new DeathChest(); - case "DungeonChest": return new DungeonChest(false); + case "DungeonChest": return new DungeonChest(null); case "Anvil": return new Crafter(Crafter.Type.Anvil); case "Enchanter": return new Crafter(Crafter.Type.Enchanter); case "Loom": return new Crafter(Crafter.Type.Loom); diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 03b06c5b2..c3b11f968 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -1129,7 +1129,7 @@ private static Entity getEntity(String string, int mobLevel) { case "Workbench": return new Crafter(Crafter.Type.Workbench); case "Chest": return new Chest(); case "DeathChest": return new DeathChest(); - case "DungeonChest": return new DungeonChest(false); + case "DungeonChest": return new DungeonChest(null); case "Anvil": return new Crafter(Crafter.Type.Anvil); case "Enchanter": return new Crafter(Crafter.Type.Enchanter); case "Loom": return new Crafter(Crafter.Type.Loom); From a249622d739a859e2b84ad18ca57009702a674d6 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 29 Jul 2023 00:32:35 +0800 Subject: [PATCH 073/261] Fix error --- src/client/java/minicraft/item/FurnitureItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/FurnitureItem.java b/src/client/java/minicraft/item/FurnitureItem.java index 22ea2460c..41b76624b 100644 --- a/src/client/java/minicraft/item/FurnitureItem.java +++ b/src/client/java/minicraft/item/FurnitureItem.java @@ -44,7 +44,7 @@ protected static ArrayList getAllInstances() { items.add(new FurnitureItem(new Spawner(new Knight(1)))); items.add(new FurnitureItem(new Chest())); - items.add(new FurnitureItem(new DungeonChest(null, false, true))); + items.add(new FurnitureItem(new DungeonChest(null, true))); // Add the various types of crafting furniture for (Crafter.Type type: Crafter.Type.values()) { From 6e44ed8aa59d7c6ea9b7f7956855d8739ff8c094 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 2 Aug 2023 23:45:06 +0800 Subject: [PATCH 074/261] Add sign --- .../java/minicraft/core/io/InputHandler.java | 41 ++- src/client/java/minicraft/entity/Entity.java | 5 + src/client/java/minicraft/item/SignItem.java | 42 +++ .../java/minicraft/level/tile/SignTile.java | 104 ++++++ .../java/minicraft/level/tile/Tile.java | 3 + .../java/minicraft/level/tile/Tiles.java | 10 + .../java/minicraft/level/tile/TorchTile.java | 2 +- .../java/minicraft/screen/SignDisplay.java | 323 ++++++++++++++++++ .../minicraft/screen/SignDisplayMenu.java | 49 +++ .../resources/assets/textures/item/sign.png | Bin 0 -> 181 bytes .../resources/assets/textures/tile/sign.png | Bin 0 -> 237 bytes 11 files changed, 565 insertions(+), 14 deletions(-) create mode 100644 src/client/java/minicraft/item/SignItem.java create mode 100644 src/client/java/minicraft/level/tile/SignTile.java create mode 100644 src/client/java/minicraft/screen/SignDisplay.java create mode 100644 src/client/java/minicraft/screen/SignDisplayMenu.java create mode 100644 src/client/resources/assets/textures/item/sign.png create mode 100644 src/client/resources/assets/textures/tile/sign.png diff --git a/src/client/java/minicraft/core/io/InputHandler.java b/src/client/java/minicraft/core/io/InputHandler.java index d24b53c37..7e299367a 100644 --- a/src/client/java/minicraft/core/io/InputHandler.java +++ b/src/client/java/minicraft/core/io/InputHandler.java @@ -520,40 +520,55 @@ public void keyTyped(KeyEvent ke) { keyTypedBuffer = String.valueOf(ke.getKeyChar()); } - private static final String control = "\\p{Print}"; // Should match only printable characters. + private static final String control = "\\p{Print}&&\b"; // Should match only printable characters. public String addKeyTyped(String typing, @Nullable String pattern) { + return handleBackspaceChars(getKeysTyped(typing, pattern)); + } + + /** This returns a raw format of the keys typed, i.e. {@code \b} are not handled here. */ + public String getKeysTyped(@Nullable String pattern) { return getKeysTyped(null, pattern); } + public String getKeysTyped(@Nullable String typing, @Nullable String pattern) { + StringBuilder typed = typing == null ? new StringBuilder() : new StringBuilder(typing); if (lastKeyTyped.length() > 0) { - String letter = lastKeyTyped; + for (char letter : lastKeyTyped.toCharArray()) { + String letterString = String.valueOf(letter); + if (letterString.matches(control) && (pattern == null || letterString.matches(pattern))) + typed.append(letter); + } lastKeyTyped = ""; - if ( letter.matches(control) && (pattern == null || letter.matches(pattern)) || letter.equals("\b") ) - typing += letter; } + return typed.toString(); + } + + public static String handleBackspaceChars(String typing) { return handleBackspaceChars(typing, false); } + /** + * This handles and erases backspace control characters {@code \b} from the given string. + * Evaluation to backspace characters stops if no more characters are in front of them. + * @param keepUnevaluated {@code true} if intending to keep the unhandled backspace characters in the returned string; + * otherwise, those characters are removed even that they are not evaluated. + */ + public static String handleBackspaceChars(String typing, boolean keepUnevaluated) { // Erasing characters by \b. Reference: https://stackoverflow.com/a/30174028 Stack stack = new Stack<>(); // for-each character in the string for (int i = 0; i < typing.length(); i++) { char c = typing.charAt(i); - - // push if it's not a backspace - if (c != '\b') { - stack.push(c); - // else pop if possible - } else if (!stack.empty()) { + if (c == '\b' && !stack.empty() && stack.peek() != '\b') { // pop if the last char exists and is not \b stack.pop(); + } else if (c != '\b' || keepUnevaluated) { + stack.push(c); } } // convert stack to string StringBuilder builder = new StringBuilder(stack.size()); - for (Character c : stack) { builder.append(c); } - typing = builder.toString(); - return typing; + return builder.toString(); } public boolean anyControllerConnected() { diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index 0ff319460..4655dd3f3 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -120,6 +120,9 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) public boolean move(int xd, int yd) { if (Updater.saving || (xd == 0 && yd == 0)) return true; // Pretend that it kept moving + int prevXt = x >> 4; + int prevYt = y >> 4; + boolean stopped = true; // Used to check if the entity has BEEN stopped, COMPLETELY; below checks for a lack of collision. //noinspection RedundantIfStatement if (moveX(xd)) stopped = false; // Becomes false if horizontal movement was successful. @@ -127,6 +130,8 @@ public boolean move(int xd, int yd) { if (!stopped) { int xt = x >> 4; // The x tile coordinate that the entity is standing on. int yt = y >> 4; // The y tile coordinate that the entity is standing on. + if (prevXt != xt || prevYt != yt) + level.getTile(xt, yt).steppedOn(level, xt, yt, this); // Calls the steppedOn() method in a tile's class. (used for tiles like sand (footprints) or lava (burning)) } diff --git a/src/client/java/minicraft/item/SignItem.java b/src/client/java/minicraft/item/SignItem.java new file mode 100644 index 000000000..825f21ce4 --- /dev/null +++ b/src/client/java/minicraft/item/SignItem.java @@ -0,0 +1,42 @@ +package minicraft.item; + +import java.util.ArrayList; + +import minicraft.core.Game; +import minicraft.entity.Direction; +import minicraft.entity.mob.Player; +import minicraft.gfx.Sprite; +import minicraft.gfx.SpriteLinker; +import minicraft.level.Level; +import minicraft.level.tile.SignTile; +import minicraft.level.tile.Tile; +import minicraft.screen.SignDisplay; +import org.jetbrains.annotations.NotNull; + +public class SignItem extends TileItem { + private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "sign"); + + public static ArrayList getAllInstances() { + ArrayList items = new ArrayList<>(); + items.add(new SignItem()); + return items; + } + + private SignItem() { this(1); } + private SignItem(int count) { + super("Torch", sprite, count, "", "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); + } + + public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { + if (validTiles.contains(tile.name)) { + level.setTile(xt, yt, SignTile.getSignTile(tile)); + Game.setDisplay(new SignDisplay(level, xt, yt)); + return super.interactOn(true); + } + return super.interactOn(false); + } + + public @NotNull SignItem copy() { + return new SignItem(count); + } +} diff --git a/src/client/java/minicraft/level/tile/SignTile.java b/src/client/java/minicraft/level/tile/SignTile.java new file mode 100644 index 000000000..1b5dfecb1 --- /dev/null +++ b/src/client/java/minicraft/level/tile/SignTile.java @@ -0,0 +1,104 @@ +package minicraft.level.tile; + +import minicraft.core.Game; +import minicraft.core.io.Sound; +import minicraft.entity.Direction; +import minicraft.entity.Entity; +import minicraft.entity.mob.Mob; +import minicraft.entity.mob.Player; +import minicraft.gfx.Screen; +import minicraft.gfx.SpriteAnimation; +import minicraft.gfx.SpriteLinker; +import minicraft.item.Item; +import minicraft.item.Items; +import minicraft.item.PowerGloveItem; +import minicraft.item.ToolItem; +import minicraft.item.ToolType; +import minicraft.level.Level; +import minicraft.screen.SignDisplay; +import minicraft.screen.SignDisplayMenu; +import org.jetbrains.annotations.Nullable; +import org.tinylog.Logger; + +public class SignTile extends Tile { + private static final SpriteAnimation sprite = new SpriteAnimation(SpriteLinker.SpriteType.Tile, "sign"); + + private static @Nullable SignDisplayMenu signDisplayMenu; + + private final Tile onType; + + public static SignTile getSignTile(Tile onTile) { + int id = onTile.id & 0xFFFF; + if(id < 16384) id += 16384; + else Logger.tag("SignTile").info("Tried to place torch on torch or sign tile..."); + + if(Tiles.containsTile(id)) { + return (SignTile)Tiles.get(id); + } else { + SignTile tile = new SignTile(onTile); + Tiles.add(id, tile); + return tile; + } + } + + private SignTile(Tile onType) { + super("Sign "+ onType.name, sprite); + this.onType = onType; + this.connectsToSand = onType.connectsToSand; + this.connectsToGrass = onType.connectsToGrass; + this.connectsToFluid = onType.connectsToFluid; + } + + public void render(Screen screen, Level level, int x, int y) { + onType.render(screen, level, x, y); + sprite.render(screen, level, x, y); + if (signDisplayMenu != null) { + signDisplayMenu.render(screen); + } + } + + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + if (item != null) { + if (item instanceof ToolItem && ((ToolItem) item).type == ToolType.Axe) { + level.setTile(xt, yt, this.onType); + SignDisplay.removeSign(xt, yt); + Sound.play("monsterhurt"); + level.dropItem(xt*16+8, yt*16+8, Items.get("Sign")); + return true; + } + } else { // TODO Add a way to lock signs + Game.setDisplay(new SignDisplay(level, xt, yt)); + return true; + } + + return false; + } + + @Override + public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { + if (source instanceof Player) { + Game.setDisplay(new SignDisplay(level, x, y)); + return true; + } + + return false; + } + + @Override + public void steppedOn(Level level, int xt, int yt, Entity entity) { + if (entity instanceof Player) { + if (signDisplayMenu == null || signDisplayMenu.differsFrom(level.depth, xt, yt)) { + signDisplayMenu = new SignDisplayMenu(level, xt, yt); + } + } + } + + @Override + public void steppedOut(Level level, int xt, int yt, Entity entity) { + if (entity instanceof Player) { + if (signDisplayMenu != null && signDisplayMenu.matches(level.depth, xt, yt)) { + signDisplayMenu = null; + } + } + } +} diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index fe52cf1e1..9f5d8e732 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -109,6 +109,9 @@ public void bumpedInto(Level level, int xt, int yt, Entity entity) {} /** What happens when you are inside the tile (ex: lava) */ public void steppedOn(Level level, int xt, int yt, Entity entity) {} + /** What happens when you have just stepped out the tile (ex: sign) */ + public void steppedOut(Level level, int xt, int yt, Entity entity) {} + /** * Called when you hit an item on a tile (ex: Pickaxe on rock). * @param level The level the player is on. diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index c5106a385..c21fde9a1 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -204,6 +204,12 @@ public static Tile get(String name) { name = name.substring(6); // Cuts off torch prefix. } + boolean isSign = false; + if (name.startsWith("SIGN")) { + isSign = true; + name = name.substring(5); + } + if(name.contains("_")) { name = name.substring(0, name.indexOf("_")); } @@ -225,6 +231,10 @@ public static Tile get(String name) { getting = TorchTile.getTorchTile(getting); } + if (isSign) { + getting = SignTile.getSignTile(getting); + } + overflowCheck = 0; return getting; } diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index 52353ac45..0c5c53202 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -19,7 +19,7 @@ public class TorchTile extends Tile { public static TorchTile getTorchTile(Tile onTile) { int id = onTile.id & 0xFFFF; if(id < 16384) id += 16384; - else Logger.tag("TorchTile").info("Tried to place torch on torch tile..."); + else Logger.tag("TorchTile").info("Tried to place torch on torch or sign tile..."); if(Tiles.containsTile(id)) return (TorchTile)Tiles.get(id); diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java new file mode 100644 index 000000000..58b7b608a --- /dev/null +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -0,0 +1,323 @@ +package minicraft.screen; + +import minicraft.core.Game; +import minicraft.core.io.ClipboardHandler; +import minicraft.core.io.InputHandler; +import minicraft.core.io.Localization; +import minicraft.gfx.Color; +import minicraft.gfx.Dimension; +import minicraft.gfx.Font; +import minicraft.gfx.MinicraftImage; +import minicraft.gfx.Point; +import minicraft.gfx.Rectangle; +import minicraft.gfx.Screen; +import minicraft.level.Level; +import minicraft.util.Logging; +import org.jetbrains.annotations.Nullable; + +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SignDisplay extends Display { + public static final int MAX_TEXT_LENGTH = 20; + public static final int MAX_ROW_COUNT = 4; + + // TODO make this into an attached attribute of a sign tile. + private static final HashMap, List> signTexts = new HashMap<>(); // The lines of signs should be immutable when stored. + + public static void resetSignTexts() { + signTexts.clear(); + } + + public static void loadSignTexts(Map, List> signTexts) { + SignDisplay.signTexts.clear(); + signTexts.forEach((pt, texts) -> SignDisplay.signTexts.put(pt, Collections.emptyList())); + } + + public static void updateSign(int levelDepth, int x, int y, List lines) { + signTexts.put(new AbstractMap.SimpleImmutableEntry<>(levelDepth, new Point(x, y)), Collections.unmodifiableList(new ArrayList<>(lines))); + } + + public static void removeSign(int levelDepth, int x, int y) { + if (signTexts.remove(new AbstractMap.SimpleImmutableEntry<>(levelDepth, new Point(x, y))) == null) + Logging.WORLDNAMED.warn("Sign at ({}, {}) does not exist to be removed.", x, y); + } + + public static @Nullable List getSign(int levelDepth, int x, int y) { + return signTexts.get(new AbstractMap.SimpleImmutableEntry<>(levelDepth, new Point(x, y))); + } + + private final int levelDepth, x, y; + + private final SignEditor editor; + + public SignDisplay(Level level, int x, int y) { + super(false, new Menu.Builder(true, 3, RelPos.CENTER) + .setPositioning(new Point(Screen.w, 6), RelPos.BOTTOM) + .setMenuSize(new Dimension(MinicraftImage.boxWidth * (MAX_TEXT_LENGTH + 2), MinicraftImage.boxWidth * (MAX_ROW_COUNT + 2))) + .setSelectable(false) + .createMenu()); + this.levelDepth = level.depth; + this.x = x; + this.y = y; + editor = new SignEditor(getSign(levelDepth, x, y)); + } + + private class SignEditor { + private final ClipboardHandler clipboard = new ClipboardHandler(); + private final ArrayList rows = new ArrayList<>(); + private int cursorX = 0, cursorY = 0; + private int caretFrameCountDown = 60; + private boolean caretShown = true; + + public SignEditor(@Nullable List lines) { + if (lines != null) lines.forEach(l -> rows.add(new StringBuilder(l))); + if (rows.isEmpty()) rows.add(new StringBuilder()); + } + + public List getLines() { + ArrayList lines = new ArrayList<>(); + rows.forEach(r -> { + // Reference: https://www.baeldung.com/java-string-split-every-n-characters#using-the-stringsubstring-method + int length = r.length(); + for (int i = 0; i < length; i += MAX_TEXT_LENGTH) { + lines.add(r.substring(i, Math.min(length, i + MAX_TEXT_LENGTH))); + } + }); + return lines; + } + + public void tick(InputHandler input) { + if (caretFrameCountDown-- == 0) { // Caret flashing animation + caretFrameCountDown = 30; + caretShown = !caretShown; + } + + insertChars(input.getKeysTyped(null)); + if (input.getKey("PAGE-UP").clicked) { + cursorX = 0; + cursorY = 0; + updateCaretAnimation(); + } else if (input.getKey("PAGE-DOWN").clicked) { + cursorY = rows.size() - 1; + cursorX = rows.get(cursorY).length(); + updateCaretAnimation(); + + } else if (input.getKey("HOME").clicked) { + cursorX = (cursorX - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH; // Rounding down + updateCaretAnimation(); + } else if (input.getKey("END").clicked) { + cursorX = Math.min((cursorX + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH, rows.get(cursorY).length()); // Rounding up + updateCaretAnimation(); + + // Cursor navigating + // As lines are centered, the character above in rendering would not always be the one in indices. + // The position is set to the beginning of line when the cursor moved upward or downward. + } else if (input.inputPressed("CURSOR-UP")) { + if (cursorX > MAX_TEXT_LENGTH) { // This should be safe. + cursorX -= (cursorX % MAX_TEXT_LENGTH == 0 ? MAX_TEXT_LENGTH : cursorX % MAX_TEXT_LENGTH) + MAX_TEXT_LENGTH; + } else if (cursorY > 0) { + int length = rows.get(--cursorY).length(); + if (cursorX > 0 && cursorX % MAX_TEXT_LENGTH == 0) { // If the current position is at the end of line + cursorX = length; + } else { + if (length > 0 && (length % MAX_TEXT_LENGTH) == 0) { + cursorX += length - MAX_TEXT_LENGTH; + } else { + cursorX += length / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH; + } + + if (cursorX > length) cursorX = length; // Collapses the spaces between the cursor and the end of row + } + } else { + cursorX = 0; + } + + updateCaretAnimation(); + } else if (input.inputPressed("CURSOR-DOWN")) { + if (cursorX / MAX_TEXT_LENGTH < rows.get(cursorY).length() / MAX_TEXT_LENGTH) { + cursorX += MAX_TEXT_LENGTH - cursorX % MAX_TEXT_LENGTH; + } else if (cursorY < rows.size() - 1) { + cursorX = 0; // It is always in the first line of the row, so it is always the beginning of the row. + } else { + cursorX = rows.get(cursorY).length(); + } + + updateCaretAnimation(); + } else if (input.inputDown("CURSOR-LEFT")) { + if (cursorX > 0) cursorX--; + updateCaretAnimation(); + } else if (input.inputDown("CURSOR-RIGHT")) { + if (cursorX == rows.get(cursorY).length()) { // The end of row + if (cursorY < rows.size() - 1) { // If it is not in the last row + cursorX = 0; + cursorY++; + } + } else { + cursorX++; + } + + updateCaretAnimation(); + + // Clipboard operations + } else if (input.getKey("CTRL-X").clicked) { + cursorX = 0; + cursorY = 0; + clipboard.setClipboardContents(String.join("\n", rows)); + rows.clear(); + rows.add(new StringBuilder()); + updateCaretAnimation(); + } else if (input.getKey("CTRL-C").clicked) { + clipboard.setClipboardContents(String.join("\n", rows)); + updateCaretAnimation(); + } else if (input.getKey("CTRL-V").clicked) { + insertChars(clipboard.getClipboardContents()); + } + } + + public void render(Screen screen) { + Rectangle bounds = menus[0].getBounds(); + int yPos = bounds.getTop() + MinicraftImage.boxWidth; // Upper border + int centeredX = bounds.getLeft() + bounds.getWidth() / 2; + for (StringBuilder row : rows) { + // See #getLines + String r = row.toString(); + int length = r.length(); + for (int j = 0; j < length; j += MAX_TEXT_LENGTH) { // For each line + Font.drawCentered(r.substring(j, Math.min(length, j + MAX_TEXT_LENGTH)), screen, yPos, Color.WHITE); + //noinspection SuspiciousNameCombination + yPos += MinicraftImage.boxWidth; + } + } + + // Cursor rendering + int lineWidth = getLineWidthOfRow(cursorX, cursorY) * MinicraftImage.boxWidth; + int displayX = calculateDisplayX(cursorX) * MinicraftImage.boxWidth; + int displayY = calculateDisplayY(cursorX, cursorY) * MinicraftImage.boxWidth; + int lineBeginning = centeredX - lineWidth / 2; + int cursorX = lineBeginning + displayX; + int cursorY = bounds.getTop() + MinicraftImage.boxWidth + displayY; + int cursorRenderY = cursorY + MinicraftImage.boxWidth - 1; + for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 1 pixel high and 8 pixel wide + int idx = cursorX + i + cursorRenderY; + screen.pixels[idx] = idx == Color.WHITE ? Color.BLACK : Color.WHITE; + } + } + + private void updateCaretAnimation() { + caretShown = true; + caretFrameCountDown = 120; + } + + private int calculateDisplayX(int x) { + return x > MAX_TEXT_LENGTH ? x % MAX_TEXT_LENGTH : x; + } + + private int getLineWidthOfRow(int x, int y) { + int length = rows.get(y).length(); + return (x == 0 ? MAX_TEXT_LENGTH : (x + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH) > length + ? length - (x - 1) / MAX_TEXT_LENGTH : MAX_TEXT_LENGTH; + } + + private int calculateDisplayY(int x, int y) { + int count = 0; + for (int i = 0; i <= y; i++) { + if (i != y) count += calculateNumberOfOccupiedLinesOfRow(i); + else count += (x - 1) / MAX_TEXT_LENGTH; // A new line is regarded when the current line exceeds MAX_TEST_LENGTH. + } + + return count; + } + + private boolean checkNewLineAvailable() { + int maxY = rows.size() - 1; + return calculateDisplayY(rows.get(maxY).length(), maxY) < MAX_ROW_COUNT - 1; + } + + private boolean checkRowLineCapacity(int y) { + int len = rows.get(y).length(); + // If the current row is not enough to fill in a line or the existing new line + return len < MAX_TEXT_LENGTH || len % MAX_TEXT_LENGTH != 0; + } + + private int calculateNumberOfOccupiedLinesOfRow(int y) { + int length = rows.get(y).length(); + return length == 0 ? 1 : (length + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH; + } + + private void insertChars(String chars) { + chars = InputHandler.handleBackspaceChars(chars, true); // Reduce the number of unnecessary operations. + if (chars.isEmpty()) return; + updateCaretAnimation(); + for (int i = 0; i < chars.length(); i++) { + char c = chars.charAt(i); + if (!insertChar(c)) break; // Terminates the processing of characters if no more character can be proceeded. + } + } + + /** + * Inserts a character to be inserted at the current cursor position. Cursor position is handled when needed. + * This controls whether the procedure should be terminated depending on how the characters are handled. + * @param c A printable or line break (line feed) or backspace {@code \b} character to be inserted. Regex: {@code \p{Print}&&[\b\n]} + * @return {@code true} if the char is handled and valid to be continuing processing the following chars; + * otherwise, the procedure of processing characters is terminated. + */ + private boolean insertChar(char c) { + if (c == '\b') { // Backspace + if (cursorX == 0 && cursorY == 0) return true; // No effect; valid behaviour; handled + else if (cursorX > 0) { + rows.get(cursorY).deleteCharAt(--cursorX); // Remove the char in front of the cursor. + } else { // cursorY > 0 && cursorX == 0 + // Combining the current row to the row above. Remove the current line and decrement cursorY by 1. + rows.get(cursorY - 1).append(rows.remove(cursorY--)); + } + + return true; // A backspace is always not limited by the line count limit, and it could reduce characters when appropriate. + } else if (c == '\n') { // Line break + StringBuilder curRow = rows.get(cursorY); + int rowLen = curRow.length(); + // If the row occupies more than 1 line and the string of the cursor until the end of line plus the last line + // does not contain enough chars to require a new line, so that the line break does not affect the line count. + // The cursor should be within the row so that it does not create an empty new line, which breaks the case mentioned above. + // One of the cases is that the cursor is at the end of line. + if (rowLen > MAX_TEXT_LENGTH && cursorX > 0 && cursorX < rowLen && + cursorX <= rowLen - rowLen % MAX_TEXT_LENGTH && // The cursor should be in the line before the last line. + MAX_TEXT_LENGTH - cursorX + rowLen % MAX_TEXT_LENGTH <= MAX_TEXT_LENGTH || + checkNewLineAvailable()) { // For other cases, a new line would always be required. + rows.add(++cursorY, new StringBuilder(curRow.substring(cursorX))); // Create new builder from the split point. + curRow.delete(cursorX, rowLen); // Remove string part starts with the split point. + cursorX = 0; // A pointer to the new line after the break. + return true; + } else return false; // No line break; the char is discarded; no effect; unhandled + } else { + // If the current line has spaces to expand, or else a new line would be required. + if (checkRowLineCapacity(cursorY) || checkNewLineAvailable()) { + rows.get(cursorY).insert(cursorX++, c); + return true; + } else return false; // No more chars are accepted to expand at the current cursor position. + } + } + } + + @Override + public void render(Screen screen) { + super.render(screen); + Rectangle bounds = menus[0].getBounds(); + Font.draw(Localization.getLocalized("Use SHIFT-ENTER to confirm input."), screen, bounds.getLeft(), bounds.getBottom() + 8, Color.GRAY); + } + + @Override + public void tick(InputHandler input) { + if (input.inputPressed("exit") || input.getKey("SHIFT-ENTER").clicked) { + updateSign(levelDepth, x, y, editor.getLines()); + Game.exitDisplay(); + return; + } + + editor.tick(input); + } +} diff --git a/src/client/java/minicraft/screen/SignDisplayMenu.java b/src/client/java/minicraft/screen/SignDisplayMenu.java new file mode 100644 index 000000000..c56652baa --- /dev/null +++ b/src/client/java/minicraft/screen/SignDisplayMenu.java @@ -0,0 +1,49 @@ +package minicraft.screen; + +import minicraft.core.io.InputHandler; +import minicraft.gfx.Dimension; +import minicraft.gfx.MinicraftImage; +import minicraft.gfx.Point; +import minicraft.gfx.Screen; +import minicraft.level.Level; +import minicraft.screen.entry.StringEntry; +import minicraft.util.Logging; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public class SignDisplayMenu extends Menu { + private final int levelDepth, x, y; + + public SignDisplayMenu(Level level, int x, int y) { + super(new Menu.Builder(true, 3, RelPos.CENTER) + .setPositioning(new Point(Screen.w, 6), RelPos.BOTTOM) + .setMenuSize(new Dimension(MinicraftImage.boxWidth * (SignDisplay.MAX_TEXT_LENGTH + 2), MinicraftImage.boxWidth * (SignDisplay.MAX_ROW_COUNT + 2))) + .setSelectable(false) + .createMenu()); + this.levelDepth = level.depth; + this.x = x; + this.y = y; + List lines; + if ((lines = SignDisplay.getSign(levelDepth, x, y)) == null) { + lines = Collections.emptyList(); + Logging.WORLDNAMED.warn("Sign at ({}, {}) does not exist or has not initialized, but a display menu is invoked.", x, y); + } + setEntries(lines.stream().map(r -> new StringEntry(r, false)).collect(Collectors.toList())); + } + + /** Checks if this sign's coordinates differ from the given ones. */ + public boolean differsFrom(int levelDepth, int x, int y) { + return this.levelDepth != levelDepth || this.x != x || this.y != y; + } + + /** Checks if this sign's coordinates match the given ones. */ + public boolean matches(int levelDepth, int x, int y) { + return this.levelDepth == levelDepth && this.x == x && this.y == y; + } + + @Deprecated + @Override + public void tick(InputHandler input) {} // Render only +} diff --git a/src/client/resources/assets/textures/item/sign.png b/src/client/resources/assets/textures/item/sign.png new file mode 100644 index 0000000000000000000000000000000000000000..99fc4f104d08f4ffc1b3779bfdcbacbffe2552d0 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucK`&1i#}JL+WE(r Date: Wed, 2 Aug 2023 23:51:47 +0800 Subject: [PATCH 075/261] Fix an error of sign --- src/client/java/minicraft/level/tile/SignTile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/level/tile/SignTile.java b/src/client/java/minicraft/level/tile/SignTile.java index 1b5dfecb1..532cb055d 100644 --- a/src/client/java/minicraft/level/tile/SignTile.java +++ b/src/client/java/minicraft/level/tile/SignTile.java @@ -61,7 +61,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D if (item != null) { if (item instanceof ToolItem && ((ToolItem) item).type == ToolType.Axe) { level.setTile(xt, yt, this.onType); - SignDisplay.removeSign(xt, yt); + SignDisplay.removeSign(level.depth, xt, yt); Sound.play("monsterhurt"); level.dropItem(xt*16+8, yt*16+8, Items.get("Sign")); return true; From d4cb9bb2848f40635b9f8e88d2c6b7154a4abc75 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 3 Aug 2023 18:33:21 +0800 Subject: [PATCH 076/261] Add sign tile data save and load support --- src/client/java/minicraft/core/World.java | 2 + src/client/java/minicraft/item/Items.java | 1 + src/client/java/minicraft/saveload/Load.java | 35 ++++++++++++++++ src/client/java/minicraft/saveload/Save.java | 42 ++++++++++++++----- .../java/minicraft/screen/SignDisplay.java | 4 ++ 5 files changed, 74 insertions(+), 10 deletions(-) diff --git a/src/client/java/minicraft/core/World.java b/src/client/java/minicraft/core/World.java index 4e5a2aa8d..4b2c70902 100644 --- a/src/client/java/minicraft/core/World.java +++ b/src/client/java/minicraft/core/World.java @@ -11,6 +11,7 @@ import minicraft.screen.LoadingDisplay; import minicraft.screen.PlayerDeathDisplay; import minicraft.screen.QuestsDisplay; +import minicraft.screen.SignDisplay; import minicraft.screen.TutorialDisplayHandler; import minicraft.screen.WorldGenDisplay; import minicraft.screen.WorldSelectDisplay; @@ -150,6 +151,7 @@ public static void resetGame(boolean keepPlayer) { CraftingDisplay.resetRecipeUnlocks(); TutorialDisplayHandler.reset(true); AdvancementElement.resetRecipeUnlockingElements(); + SignDisplay.resetSignTexts(); } Renderer.readyToRenderGameplay = true; diff --git a/src/client/java/minicraft/item/Items.java b/src/client/java/minicraft/item/Items.java index 9430bd63c..55b2c5cbb 100644 --- a/src/client/java/minicraft/item/Items.java +++ b/src/client/java/minicraft/item/Items.java @@ -43,6 +43,7 @@ private static void addAll(ArrayList items) { addAll(FishingRodItem.getAllInstances()); addAll(SummonItem.getAllInstances()); addAll(HeartItem.getAllInstances()); + addAll(SignItem.getAllInstances()); } public static ArrayList getAll() { diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 03b06c5b2..2b1e79f5b 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -39,6 +39,7 @@ import minicraft.entity.particle.SmashParticle; import minicraft.entity.particle.TextParticle; import minicraft.gfx.Color; +import minicraft.gfx.Point; import minicraft.item.ArmorItem; import minicraft.item.Inventory; import minicraft.item.Item; @@ -57,6 +58,7 @@ import minicraft.screen.PopupDisplay; import minicraft.screen.QuestsDisplay; import minicraft.screen.ResourcePackDisplay; +import minicraft.screen.SignDisplay; import minicraft.screen.SkinDisplay; import minicraft.screen.TutorialDisplayHandler; import minicraft.screen.entry.ListEntry; @@ -77,12 +79,16 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; +import java.util.AbstractMap; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Stack; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Predicate; +import java.util.stream.Collectors; public class Load { @@ -714,6 +720,35 @@ private void loadWorld(String filename) { AdvancementElement.resetRecipeUnlockingElements(); QuestsDisplay.resetGameQuests(); } + + boolean signsLoadSucceeded = false; + if (new File(location+"signs.json").exists()) { + try { + JSONObject fileObj = new JSONObject(loadFromFile(location + "signs.json", true)); + @SuppressWarnings("unused") + Version dataVersion = new Version(fileObj.getString("Version")); + JSONArray dataObj = fileObj.getJSONArray("signs"); + HashMap, List> signTexts = new HashMap<>(); + for (int i = 0; i < dataObj.length(); i++) { + JSONObject signObj = dataObj.getJSONObject(i); + signTexts.put( + new AbstractMap.SimpleImmutableEntry<>(signObj.getInt("level"), new Point(signObj.getInt("x"), signObj.getInt("y"))), + signObj.getJSONArray("lines").toList().stream().map(e -> (String) e).collect(Collectors.toList()) + ); + } + + SignDisplay.loadSignTexts(signTexts); + signsLoadSucceeded = true; + } catch (IOException e) { + Logging.SAVELOAD.error(e, "Unable to load signs.json, reset sign data instead."); + } + } else { + Logging.SAVELOAD.debug("signs.json not found, reset sign data instead."); + } + + if (!signsLoadSucceeded) { + SignDisplay.resetSignTexts(); + } } public void loadPlayer(String filename, Player player) { diff --git a/src/client/java/minicraft/saveload/Save.java b/src/client/java/minicraft/saveload/Save.java index a5096b15e..96a5efe1e 100644 --- a/src/client/java/minicraft/saveload/Save.java +++ b/src/client/java/minicraft/saveload/Save.java @@ -26,6 +26,7 @@ import minicraft.entity.mob.Sheep; import minicraft.entity.particle.Particle; import minicraft.entity.particle.TextParticle; +import minicraft.gfx.Point; import minicraft.item.Inventory; import minicraft.item.Item; import minicraft.item.PotionType; @@ -36,6 +37,7 @@ import minicraft.screen.MultiplayerDisplay; import minicraft.screen.QuestsDisplay; import minicraft.screen.ResourcePackDisplay; +import minicraft.screen.SignDisplay; import minicraft.screen.SkinDisplay; import minicraft.screen.TutorialDisplayHandler; import minicraft.screen.WorldSelectDisplay; @@ -50,6 +52,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Map; public class Save { @@ -257,17 +260,36 @@ private void writeWorld(String filename) { writeToFile(location + filename + l + "data" + extension, data); } - JSONObject fileObj = new JSONObject(); - fileObj.put("Version", Game.VERSION.toString()); - TutorialDisplayHandler.save(fileObj); - AdvancementElement.saveRecipeUnlockingElements(fileObj); - QuestsDisplay.save(fileObj); + { // Advancements + JSONObject fileObj = new JSONObject(); + fileObj.put("Version", Game.VERSION.toString()); + TutorialDisplayHandler.save(fileObj); + AdvancementElement.saveRecipeUnlockingElements(fileObj); + QuestsDisplay.save(fileObj); + try { + writeJSONToFile(location + "advancements.json", fileObj.toString(4)); + } catch (IOException e) { + e.printStackTrace(); + Logging.SAVELOAD.error("Unable to write advancements.json."); + } + } - try { - writeJSONToFile(location + "advancements.json", fileObj.toString(4)); - } catch (IOException e) { - e.printStackTrace(); - Logging.SAVELOAD.error("Unable to write advancements.json."); + { // Sign Data + JSONObject fileObj = new JSONObject(); + fileObj.put("Version", Game.VERSION.toString()); + JSONArray dataObj = new JSONArray(); + SignDisplay.getSignTexts().forEach((key, value) -> dataObj.put(new JSONObject() + .put("level", key.getKey()) + .put("x", key.getValue().x) + .put("y", key.getValue().y) + .put("lines", value))); + fileObj.put("signs", dataObj); + try { + writeJSONToFile(location + "signs.json", fileObj.toString(4)); + } catch (IOException e) { + e.printStackTrace(); + Logging.SAVELOAD.error("Unable to write signs.json."); + } } } diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java index 58b7b608a..4f422856f 100644 --- a/src/client/java/minicraft/screen/SignDisplay.java +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -38,6 +38,10 @@ public static void loadSignTexts(Map, List> si signTexts.forEach((pt, texts) -> SignDisplay.signTexts.put(pt, Collections.emptyList())); } + public static Map, List> getSignTexts() { + return new HashMap<>(signTexts); + } + public static void updateSign(int levelDepth, int x, int y, List lines) { signTexts.put(new AbstractMap.SimpleImmutableEntry<>(levelDepth, new Point(x, y)), Collections.unmodifiableList(new ArrayList<>(lines))); } From a8399e8633c78bcad9d7be31a7f0734399961642 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 3 Aug 2023 18:55:19 +0800 Subject: [PATCH 077/261] Fix input filter and sign item name --- src/client/java/minicraft/core/io/InputHandler.java | 9 +++++---- src/client/java/minicraft/item/SignItem.java | 2 +- src/client/java/minicraft/screen/SignDisplay.java | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/core/io/InputHandler.java b/src/client/java/minicraft/core/io/InputHandler.java index 7e299367a..e8af57cfc 100644 --- a/src/client/java/minicraft/core/io/InputHandler.java +++ b/src/client/java/minicraft/core/io/InputHandler.java @@ -520,19 +520,20 @@ public void keyTyped(KeyEvent ke) { keyTypedBuffer = String.valueOf(ke.getKeyChar()); } - private static final String control = "\\p{Print}&&\b"; // Should match only printable characters. + private static final String control = "[\\p{Print}\n]+"; // Should match only printable characters. public String addKeyTyped(String typing, @Nullable String pattern) { return handleBackspaceChars(getKeysTyped(typing, pattern)); } /** This returns a raw format of the keys typed, i.e. {@code \b} are not handled here. */ - public String getKeysTyped(@Nullable String pattern) { return getKeysTyped(null, pattern); } - public String getKeysTyped(@Nullable String typing, @Nullable String pattern) { + public String getKeysTyped(@Nullable String pattern) { return getKeysTyped(null, pattern, true); } + public String getKeysTyped(@Nullable String typing, @Nullable String pattern) { return getKeysTyped(typing, pattern, false); } + public String getKeysTyped(@Nullable String typing, @Nullable String pattern, boolean multiline) { StringBuilder typed = typing == null ? new StringBuilder() : new StringBuilder(typing); if (lastKeyTyped.length() > 0) { for (char letter : lastKeyTyped.toCharArray()) { String letterString = String.valueOf(letter); - if (letterString.matches(control) && (pattern == null || letterString.matches(pattern))) + if (letter == '\b' || letterString.matches(control) && (letter != '\n' || multiline) && (pattern == null || letterString.matches(pattern))) typed.append(letter); } lastKeyTyped = ""; diff --git a/src/client/java/minicraft/item/SignItem.java b/src/client/java/minicraft/item/SignItem.java index 825f21ce4..645878bde 100644 --- a/src/client/java/minicraft/item/SignItem.java +++ b/src/client/java/minicraft/item/SignItem.java @@ -24,7 +24,7 @@ public static ArrayList getAllInstances() { private SignItem() { this(1); } private SignItem(int count) { - super("Torch", sprite, count, "", "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); + super("Sign", sprite, count, "", "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java index 4f422856f..eae717935 100644 --- a/src/client/java/minicraft/screen/SignDisplay.java +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -266,7 +266,7 @@ private void insertChars(String chars) { /** * Inserts a character to be inserted at the current cursor position. Cursor position is handled when needed. * This controls whether the procedure should be terminated depending on how the characters are handled. - * @param c A printable or line break (line feed) or backspace {@code \b} character to be inserted. Regex: {@code \p{Print}&&[\b\n]} + * @param c A printable or line break (line feed) or backspace {@code \b} character to be inserted. Regex: {@code [\p{Print}\b\n]+} * @return {@code true} if the char is handled and valid to be continuing processing the following chars; * otherwise, the procedure of processing characters is terminated. */ From ee4a8b6aa08cc27fcb8721421812491e1750942b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 3 Aug 2023 23:14:37 +0800 Subject: [PATCH 078/261] Fix more problems related to sign --- src/client/java/minicraft/core/Renderer.java | 4 ++ src/client/java/minicraft/core/World.java | 2 + src/client/java/minicraft/entity/Entity.java | 2 +- src/client/java/minicraft/level/Level.java | 2 +- .../java/minicraft/level/tile/SignTile.java | 14 +++---- .../java/minicraft/screen/SignDisplay.java | 39 ++++++++++--------- .../minicraft/screen/SignDisplayMenu.java | 3 +- 7 files changed, 36 insertions(+), 30 deletions(-) diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index 01e024f4e..b332fd3b7 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -28,6 +28,7 @@ import minicraft.screen.Menu; import minicraft.screen.QuestsDisplay; import minicraft.screen.RelPos; +import minicraft.screen.SignDisplayMenu; import minicraft.screen.TutorialDisplayHandler; import minicraft.screen.entry.ListEntry; import minicraft.screen.entry.StringEntry; @@ -72,6 +73,8 @@ private Renderer() { public static boolean readyToRenderGameplay = false; public static boolean showDebugInfo = false; + public static SignDisplayMenu signDisplayMenu = null; + private static Ellipsis ellipsis = new SmoothEllipsis(new TickUpdater()); private static int potionRenderOffset = 0; @@ -411,6 +414,7 @@ private static void renderGui() { TutorialDisplayHandler.render(screen); renderQuestsDisplay(); + if (signDisplayMenu != null) signDisplayMenu.render(screen); renderDebugInfo(); } diff --git a/src/client/java/minicraft/core/World.java b/src/client/java/minicraft/core/World.java index 4b2c70902..a52588bec 100644 --- a/src/client/java/minicraft/core/World.java +++ b/src/client/java/minicraft/core/World.java @@ -156,6 +156,8 @@ public static void resetGame(boolean keepPlayer) { Renderer.readyToRenderGameplay = true; + Renderer.signDisplayMenu = null; + PlayerDeathDisplay.shouldRespawn = true; Logging.WORLD.trace("World initialized."); diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index 4655dd3f3..b09321c19 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -131,7 +131,7 @@ public boolean move(int xd, int yd) { int xt = x >> 4; // The x tile coordinate that the entity is standing on. int yt = y >> 4; // The y tile coordinate that the entity is standing on. if (prevXt != xt || prevYt != yt) - + level.getTile(prevXt, prevYt).steppedOut(level, prevXt, prevYt, this); level.getTile(xt, yt).steppedOn(level, xt, yt, this); // Calls the steppedOn() method in a tile's class. (used for tiles like sand (footprints) or lava (burning)) } diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 716e62a87..3e844872b 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -507,7 +507,7 @@ private void sortAndRender(Screen screen, List list) { public Tile getTile(int x, int y) { if (x < 0 || y < 0 || x >= w || y >= h /* || (x + y * w) >= tiles.length*/ ) return Tiles.get("connector tile"); int id = tiles[x + y * w]; - if(id < 0) id += 256; + if(id < 0) id += 32768; return Tiles.get(id); } diff --git a/src/client/java/minicraft/level/tile/SignTile.java b/src/client/java/minicraft/level/tile/SignTile.java index 532cb055d..55858f98f 100644 --- a/src/client/java/minicraft/level/tile/SignTile.java +++ b/src/client/java/minicraft/level/tile/SignTile.java @@ -1,6 +1,7 @@ package minicraft.level.tile; import minicraft.core.Game; +import minicraft.core.Renderer; import minicraft.core.io.Sound; import minicraft.entity.Direction; import minicraft.entity.Entity; @@ -23,8 +24,6 @@ public class SignTile extends Tile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteLinker.SpriteType.Tile, "sign"); - private static @Nullable SignDisplayMenu signDisplayMenu; - private final Tile onType; public static SignTile getSignTile(Tile onTile) { @@ -52,9 +51,6 @@ private SignTile(Tile onType) { public void render(Screen screen, Level level, int x, int y) { onType.render(screen, level, x, y); sprite.render(screen, level, x, y); - if (signDisplayMenu != null) { - signDisplayMenu.render(screen); - } } public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { @@ -87,8 +83,8 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at @Override public void steppedOn(Level level, int xt, int yt, Entity entity) { if (entity instanceof Player) { - if (signDisplayMenu == null || signDisplayMenu.differsFrom(level.depth, xt, yt)) { - signDisplayMenu = new SignDisplayMenu(level, xt, yt); + if (Renderer.signDisplayMenu == null || Renderer.signDisplayMenu.differsFrom(level.depth, xt, yt)) { + Renderer.signDisplayMenu = new SignDisplayMenu(level, xt, yt); } } } @@ -96,8 +92,8 @@ public void steppedOn(Level level, int xt, int yt, Entity entity) { @Override public void steppedOut(Level level, int xt, int yt, Entity entity) { if (entity instanceof Player) { - if (signDisplayMenu != null && signDisplayMenu.matches(level.depth, xt, yt)) { - signDisplayMenu = null; + if (Renderer.signDisplayMenu != null && Renderer.signDisplayMenu.matches(level.depth, xt, yt)) { + Renderer.signDisplayMenu = null; } } } diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java index eae717935..8398fac5f 100644 --- a/src/client/java/minicraft/screen/SignDisplay.java +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -35,7 +35,7 @@ public static void resetSignTexts() { public static void loadSignTexts(Map, List> signTexts) { SignDisplay.signTexts.clear(); - signTexts.forEach((pt, texts) -> SignDisplay.signTexts.put(pt, Collections.emptyList())); + signTexts.forEach((pt, texts) -> SignDisplay.signTexts.put(pt, Collections.unmodifiableList(new ArrayList<>(texts)))); } public static Map, List> getSignTexts() { @@ -61,7 +61,7 @@ public static void removeSign(int levelDepth, int x, int y) { public SignDisplay(Level level, int x, int y) { super(false, new Menu.Builder(true, 3, RelPos.CENTER) - .setPositioning(new Point(Screen.w, 6), RelPos.BOTTOM) + .setPositioning(new Point(Screen.w / 2, 6), RelPos.BOTTOM) .setMenuSize(new Dimension(MinicraftImage.boxWidth * (MAX_TEXT_LENGTH + 2), MinicraftImage.boxWidth * (MAX_ROW_COUNT + 2))) .setSelectable(false) .createMenu()); @@ -152,10 +152,10 @@ public void tick(InputHandler input) { } updateCaretAnimation(); - } else if (input.inputDown("CURSOR-LEFT")) { + } else if (input.inputPressed("CURSOR-LEFT")) { if (cursorX > 0) cursorX--; updateCaretAnimation(); - } else if (input.inputDown("CURSOR-RIGHT")) { + } else if (input.inputPressed("CURSOR-RIGHT")) { if (cursorX == rows.get(cursorY).length()) { // The end of row if (cursorY < rows.size() - 1) { // If it is not in the last row cursorX = 0; @@ -199,16 +199,18 @@ public void render(Screen screen) { } // Cursor rendering - int lineWidth = getLineWidthOfRow(cursorX, cursorY) * MinicraftImage.boxWidth; - int displayX = calculateDisplayX(cursorX) * MinicraftImage.boxWidth; - int displayY = calculateDisplayY(cursorX, cursorY) * MinicraftImage.boxWidth; - int lineBeginning = centeredX - lineWidth / 2; - int cursorX = lineBeginning + displayX; - int cursorY = bounds.getTop() + MinicraftImage.boxWidth + displayY; - int cursorRenderY = cursorY + MinicraftImage.boxWidth - 1; - for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 1 pixel high and 8 pixel wide - int idx = cursorX + i + cursorRenderY; - screen.pixels[idx] = idx == Color.WHITE ? Color.BLACK : Color.WHITE; + if (caretShown) { + int lineWidth = getLineWidthOfRow(cursorX, cursorY) * MinicraftImage.boxWidth; + int displayX = calculateDisplayX(cursorX) * MinicraftImage.boxWidth; + int displayY = calculateDisplayY(cursorX, cursorY) * MinicraftImage.boxWidth; + int lineBeginning = centeredX - lineWidth / 2; + int cursorX = lineBeginning + displayX; + int cursorY = bounds.getTop() + MinicraftImage.boxWidth + displayY; + int cursorRenderY = cursorY + MinicraftImage.boxWidth - 2; + for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 1 pixel high and 8 pixel wide + int idx = cursorX + i + cursorRenderY * Screen.w; + screen.pixels[idx] = screen.pixels[idx] == Color.WHITE ? Color.BLACK : Color.WHITE; + } } } @@ -218,13 +220,13 @@ private void updateCaretAnimation() { } private int calculateDisplayX(int x) { - return x > MAX_TEXT_LENGTH ? x % MAX_TEXT_LENGTH : x; + return x > MAX_TEXT_LENGTH ? x - (x - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH : x; } private int getLineWidthOfRow(int x, int y) { int length = rows.get(y).length(); return (x == 0 ? MAX_TEXT_LENGTH : (x + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH) > length - ? length - (x - 1) / MAX_TEXT_LENGTH : MAX_TEXT_LENGTH; + ? length - (x - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH : MAX_TEXT_LENGTH; } private int calculateDisplayY(int x, int y) { @@ -250,7 +252,7 @@ private boolean checkRowLineCapacity(int y) { private int calculateNumberOfOccupiedLinesOfRow(int y) { int length = rows.get(y).length(); - return length == 0 ? 1 : (length + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH; + return length == 0 ? 1 : (length + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH; } private void insertChars(String chars) { @@ -311,7 +313,8 @@ else if (cursorX > 0) { public void render(Screen screen) { super.render(screen); Rectangle bounds = menus[0].getBounds(); - Font.draw(Localization.getLocalized("Use SHIFT-ENTER to confirm input."), screen, bounds.getLeft(), bounds.getBottom() + 8, Color.GRAY); + Font.drawCentered(Localization.getLocalized("Use SHIFT-ENTER to confirm input."), screen, bounds.getBottom() + 8, Color.GRAY); + editor.render(screen); } @Override diff --git a/src/client/java/minicraft/screen/SignDisplayMenu.java b/src/client/java/minicraft/screen/SignDisplayMenu.java index c56652baa..f8cbaea17 100644 --- a/src/client/java/minicraft/screen/SignDisplayMenu.java +++ b/src/client/java/minicraft/screen/SignDisplayMenu.java @@ -18,8 +18,9 @@ public class SignDisplayMenu extends Menu { public SignDisplayMenu(Level level, int x, int y) { super(new Menu.Builder(true, 3, RelPos.CENTER) - .setPositioning(new Point(Screen.w, 6), RelPos.BOTTOM) + .setPositioning(new Point(Screen.w / 2, 6), RelPos.BOTTOM) .setMenuSize(new Dimension(MinicraftImage.boxWidth * (SignDisplay.MAX_TEXT_LENGTH + 2), MinicraftImage.boxWidth * (SignDisplay.MAX_ROW_COUNT + 2))) + .setDisplayLength(4) .setSelectable(false) .createMenu()); this.levelDepth = level.depth; From 40a8bd435f936f02ab8661e96683670824270e32 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 4 Aug 2023 21:12:01 +0800 Subject: [PATCH 079/261] Fix some sign edit and rendering problems --- src/client/java/minicraft/gfx/Color.java | 13 +++++++ .../java/minicraft/screen/SignDisplay.java | 35 +++++-------------- .../minicraft/screen/SignDisplayMenu.java | 2 +- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/src/client/java/minicraft/gfx/Color.java b/src/client/java/minicraft/gfx/Color.java index cdc1e757d..e967749fe 100644 --- a/src/client/java/minicraft/gfx/Color.java +++ b/src/client/java/minicraft/gfx/Color.java @@ -173,6 +173,19 @@ protected static int[] decodeRGBColor(int rgbInt) { return new int[] {r, g, b}; } + /** + * Gets the lightness of the given 24-bit RGB color value. + * This is strictly calculated by L from RGB to HSL conversion. + * For other formula and method reference: https://stackoverflow.com/a/56678483. + * @return lightness, from 0 to 1 floating point number + */ + public static float getLightnessFromRGB(int color) { + int r = (color >> 16) & 0xFF; + int g = (color >> 8) & 0xFF; + int b = color & 0xFF; + return (Math.max(Math.max(r, g), b) + Math.min(Math.min(r, g), b)) / 510f; + } + /// This is for color testing. public static void main(String[] args) { int r, g, b; diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java index 8398fac5f..327d02dd9 100644 --- a/src/client/java/minicraft/screen/SignDisplay.java +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -122,38 +122,21 @@ public void tick(InputHandler input) { // As lines are centered, the character above in rendering would not always be the one in indices. // The position is set to the beginning of line when the cursor moved upward or downward. } else if (input.inputPressed("CURSOR-UP")) { - if (cursorX > MAX_TEXT_LENGTH) { // This should be safe. - cursorX -= (cursorX % MAX_TEXT_LENGTH == 0 ? MAX_TEXT_LENGTH : cursorX % MAX_TEXT_LENGTH) + MAX_TEXT_LENGTH; - } else if (cursorY > 0) { - int length = rows.get(--cursorY).length(); - if (cursorX > 0 && cursorX % MAX_TEXT_LENGTH == 0) { // If the current position is at the end of line - cursorX = length; - } else { - if (length > 0 && (length % MAX_TEXT_LENGTH) == 0) { - cursorX += length - MAX_TEXT_LENGTH; - } else { - cursorX += length / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH; - } - - if (cursorX > length) cursorX = length; // Collapses the spaces between the cursor and the end of row - } - } else { - cursorX = 0; + cursorX = 0; + if (cursorY > 0) { + cursorY--; } updateCaretAnimation(); } else if (input.inputPressed("CURSOR-DOWN")) { - if (cursorX / MAX_TEXT_LENGTH < rows.get(cursorY).length() / MAX_TEXT_LENGTH) { - cursorX += MAX_TEXT_LENGTH - cursorX % MAX_TEXT_LENGTH; - } else if (cursorY < rows.size() - 1) { - cursorX = 0; // It is always in the first line of the row, so it is always the beginning of the row. - } else { - cursorX = rows.get(cursorY).length(); - } - + cursorX = rows.get(cursorY < rows.size() - 1 ? ++cursorY : cursorY).length(); updateCaretAnimation(); } else if (input.inputPressed("CURSOR-LEFT")) { if (cursorX > 0) cursorX--; + else if (cursorY > 0) { + cursorX = rows.get(--cursorY).length(); + } + updateCaretAnimation(); } else if (input.inputPressed("CURSOR-RIGHT")) { if (cursorX == rows.get(cursorY).length()) { // The end of row @@ -209,7 +192,7 @@ public void render(Screen screen) { int cursorRenderY = cursorY + MinicraftImage.boxWidth - 2; for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 1 pixel high and 8 pixel wide int idx = cursorX + i + cursorRenderY * Screen.w; - screen.pixels[idx] = screen.pixels[idx] == Color.WHITE ? Color.BLACK : Color.WHITE; + screen.pixels[idx] = Color.getLightnessFromRGB(screen.pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; } } } diff --git a/src/client/java/minicraft/screen/SignDisplayMenu.java b/src/client/java/minicraft/screen/SignDisplayMenu.java index f8cbaea17..b5846b7ac 100644 --- a/src/client/java/minicraft/screen/SignDisplayMenu.java +++ b/src/client/java/minicraft/screen/SignDisplayMenu.java @@ -17,7 +17,7 @@ public class SignDisplayMenu extends Menu { private final int levelDepth, x, y; public SignDisplayMenu(Level level, int x, int y) { - super(new Menu.Builder(true, 3, RelPos.CENTER) + super(new Menu.Builder(true, 0, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, 6), RelPos.BOTTOM) .setMenuSize(new Dimension(MinicraftImage.boxWidth * (SignDisplay.MAX_TEXT_LENGTH + 2), MinicraftImage.boxWidth * (SignDisplay.MAX_ROW_COUNT + 2))) .setDisplayLength(4) From a4d469cdac40a5bcda38d6d9dfea1f335c7b6916 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:18:28 +0800 Subject: [PATCH 080/261] Resolve SignDisplay OSK and cursor problems --- .../java/minicraft/screen/SignDisplay.java | 196 +++++++----------- 1 file changed, 77 insertions(+), 119 deletions(-) diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java index 327d02dd9..cb970ba6c 100644 --- a/src/client/java/minicraft/screen/SignDisplay.java +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -1,5 +1,6 @@ package minicraft.screen; +import com.studiohartman.jamepad.ControllerButton; import minicraft.core.Game; import minicraft.core.io.ClipboardHandler; import minicraft.core.io.InputHandler; @@ -21,6 +22,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public class SignDisplay extends Display { public static final int MAX_TEXT_LENGTH = 20; @@ -69,6 +71,9 @@ public SignDisplay(Level level, int x, int y) { this.x = x; this.y = y; editor = new SignEditor(getSign(levelDepth, x, y)); + onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); + if (onScreenKeyboardMenu != null) + onScreenKeyboardMenu.setVisible(false); } private class SignEditor { @@ -80,19 +85,12 @@ private class SignEditor { public SignEditor(@Nullable List lines) { if (lines != null) lines.forEach(l -> rows.add(new StringBuilder(l))); - if (rows.isEmpty()) rows.add(new StringBuilder()); + while (rows.size() < MAX_ROW_COUNT) + rows.add(new StringBuilder()); } public List getLines() { - ArrayList lines = new ArrayList<>(); - rows.forEach(r -> { - // Reference: https://www.baeldung.com/java-string-split-every-n-characters#using-the-stringsubstring-method - int length = r.length(); - for (int i = 0; i < length; i += MAX_TEXT_LENGTH) { - lines.add(r.substring(i, Math.min(length, i + MAX_TEXT_LENGTH))); - } - }); - return lines; + return rows.stream().map(StringBuilder::toString).collect(Collectors.toList()); } public void tick(InputHandler input) { @@ -103,63 +101,43 @@ public void tick(InputHandler input) { insertChars(input.getKeysTyped(null)); if (input.getKey("PAGE-UP").clicked) { - cursorX = 0; - cursorY = 0; + cursorX = rows.get(cursorY = 0).length(); updateCaretAnimation(); } else if (input.getKey("PAGE-DOWN").clicked) { - cursorY = rows.size() - 1; - cursorX = rows.get(cursorY).length(); + cursorX = rows.get(cursorY = rows.size() - 1).length(); updateCaretAnimation(); } else if (input.getKey("HOME").clicked) { - cursorX = (cursorX - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH; // Rounding down + cursorX = 0; updateCaretAnimation(); } else if (input.getKey("END").clicked) { - cursorX = Math.min((cursorX + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH, rows.get(cursorY).length()); // Rounding up + cursorX = rows.get(cursorY).length(); updateCaretAnimation(); // Cursor navigating // As lines are centered, the character above in rendering would not always be the one in indices. - // The position is set to the beginning of line when the cursor moved upward or downward. + // The position is set to the end of line when the cursor moved upward or downward. } else if (input.inputPressed("CURSOR-UP")) { - cursorX = 0; - if (cursorY > 0) { - cursorY--; - } - + cursorX = rows.get(cursorY == 0 ? cursorY = rows.size() - 1 : --cursorY).length(); updateCaretAnimation(); - } else if (input.inputPressed("CURSOR-DOWN")) { - cursorX = rows.get(cursorY < rows.size() - 1 ? ++cursorY : cursorY).length(); + } else if (input.inputPressed("CURSOR-DOWN") || input.getKey("ENTER").clicked) { + cursorX = rows.get(cursorY == rows.size() - 1 ? cursorY = 0 : ++cursorY).length(); updateCaretAnimation(); } else if (input.inputPressed("CURSOR-LEFT")) { if (cursorX > 0) cursorX--; - else if (cursorY > 0) { - cursorX = rows.get(--cursorY).length(); - } - updateCaretAnimation(); } else if (input.inputPressed("CURSOR-RIGHT")) { - if (cursorX == rows.get(cursorY).length()) { // The end of row - if (cursorY < rows.size() - 1) { // If it is not in the last row - cursorX = 0; - cursorY++; - } - } else { - cursorX++; - } - + if (cursorX < rows.get(cursorY).length()) cursorX++; updateCaretAnimation(); // Clipboard operations } else if (input.getKey("CTRL-X").clicked) { cursorX = 0; - cursorY = 0; - clipboard.setClipboardContents(String.join("\n", rows)); - rows.clear(); - rows.add(new StringBuilder()); + clipboard.setClipboardContents(rows.get(cursorY).toString()); + rows.set(cursorY, new StringBuilder()); updateCaretAnimation(); } else if (input.getKey("CTRL-C").clicked) { - clipboard.setClipboardContents(String.join("\n", rows)); + clipboard.setClipboardContents(rows.get(cursorY).toString()); updateCaretAnimation(); } else if (input.getKey("CTRL-V").clicked) { insertChars(clipboard.getClipboardContents()); @@ -171,28 +149,30 @@ public void render(Screen screen) { int yPos = bounds.getTop() + MinicraftImage.boxWidth; // Upper border int centeredX = bounds.getLeft() + bounds.getWidth() / 2; for (StringBuilder row : rows) { - // See #getLines - String r = row.toString(); - int length = r.length(); - for (int j = 0; j < length; j += MAX_TEXT_LENGTH) { // For each line - Font.drawCentered(r.substring(j, Math.min(length, j + MAX_TEXT_LENGTH)), screen, yPos, Color.WHITE); - //noinspection SuspiciousNameCombination - yPos += MinicraftImage.boxWidth; - } + Font.drawCentered(row.toString(), screen, yPos, Color.WHITE); + //noinspection SuspiciousNameCombination + yPos += MinicraftImage.boxWidth; } // Cursor rendering if (caretShown) { - int lineWidth = getLineWidthOfRow(cursorX, cursorY) * MinicraftImage.boxWidth; - int displayX = calculateDisplayX(cursorX) * MinicraftImage.boxWidth; - int displayY = calculateDisplayY(cursorX, cursorY) * MinicraftImage.boxWidth; + int lineWidth = rows.get(cursorY).length() * MinicraftImage.boxWidth; + int displayX = cursorX * MinicraftImage.boxWidth; + int displayY = cursorY * MinicraftImage.boxWidth; int lineBeginning = centeredX - lineWidth / 2; int cursorX = lineBeginning + displayX; int cursorY = bounds.getTop() + MinicraftImage.boxWidth + displayY; - int cursorRenderY = cursorY + MinicraftImage.boxWidth - 2; - for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 1 pixel high and 8 pixel wide - int idx = cursorX + i + cursorRenderY * Screen.w; - screen.pixels[idx] = Color.getLightnessFromRGB(screen.pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; + if (this.cursorX == rows.get(this.cursorY).length()) { // Replace cursor + int cursorRenderY = cursorY + MinicraftImage.boxWidth - 1; + for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 1 pixel high and 8 pixel wide + int idx = cursorX + i + cursorRenderY * Screen.w; + screen.pixels[idx] = Color.getLightnessFromRGB(screen.pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; + } + } else { // Insert cursor + for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 8 pixel high and 1 pixel wide + int idx = cursorX + (cursorY + i) * Screen.w; + screen.pixels[idx] = Color.getLightnessFromRGB(screen.pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; + } } } } @@ -202,42 +182,6 @@ private void updateCaretAnimation() { caretFrameCountDown = 120; } - private int calculateDisplayX(int x) { - return x > MAX_TEXT_LENGTH ? x - (x - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH : x; - } - - private int getLineWidthOfRow(int x, int y) { - int length = rows.get(y).length(); - return (x == 0 ? MAX_TEXT_LENGTH : (x + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH) > length - ? length - (x - 1) / MAX_TEXT_LENGTH * MAX_TEXT_LENGTH : MAX_TEXT_LENGTH; - } - - private int calculateDisplayY(int x, int y) { - int count = 0; - for (int i = 0; i <= y; i++) { - if (i != y) count += calculateNumberOfOccupiedLinesOfRow(i); - else count += (x - 1) / MAX_TEXT_LENGTH; // A new line is regarded when the current line exceeds MAX_TEST_LENGTH. - } - - return count; - } - - private boolean checkNewLineAvailable() { - int maxY = rows.size() - 1; - return calculateDisplayY(rows.get(maxY).length(), maxY) < MAX_ROW_COUNT - 1; - } - - private boolean checkRowLineCapacity(int y) { - int len = rows.get(y).length(); - // If the current row is not enough to fill in a line or the existing new line - return len < MAX_TEXT_LENGTH || len % MAX_TEXT_LENGTH != 0; - } - - private int calculateNumberOfOccupiedLinesOfRow(int y) { - int length = rows.get(y).length(); - return length == 0 ? 1 : (length + MAX_TEXT_LENGTH - 1) / MAX_TEXT_LENGTH; - } - private void insertChars(String chars) { chars = InputHandler.handleBackspaceChars(chars, true); // Reduce the number of unnecessary operations. if (chars.isEmpty()) return; @@ -257,34 +201,17 @@ private void insertChars(String chars) { */ private boolean insertChar(char c) { if (c == '\b') { // Backspace - if (cursorX == 0 && cursorY == 0) return true; // No effect; valid behaviour; handled - else if (cursorX > 0) { + if (cursorX == 0) return true; // No effect; valid behaviour; handled + else { // cursorX > 0 rows.get(cursorY).deleteCharAt(--cursorX); // Remove the char in front of the cursor. - } else { // cursorY > 0 && cursorX == 0 - // Combining the current row to the row above. Remove the current line and decrement cursorY by 1. - rows.get(cursorY - 1).append(rows.remove(cursorY--)); } return true; // A backspace is always not limited by the line count limit, and it could reduce characters when appropriate. } else if (c == '\n') { // Line break - StringBuilder curRow = rows.get(cursorY); - int rowLen = curRow.length(); - // If the row occupies more than 1 line and the string of the cursor until the end of line plus the last line - // does not contain enough chars to require a new line, so that the line break does not affect the line count. - // The cursor should be within the row so that it does not create an empty new line, which breaks the case mentioned above. - // One of the cases is that the cursor is at the end of line. - if (rowLen > MAX_TEXT_LENGTH && cursorX > 0 && cursorX < rowLen && - cursorX <= rowLen - rowLen % MAX_TEXT_LENGTH && // The cursor should be in the line before the last line. - MAX_TEXT_LENGTH - cursorX + rowLen % MAX_TEXT_LENGTH <= MAX_TEXT_LENGTH || - checkNewLineAvailable()) { // For other cases, a new line would always be required. - rows.add(++cursorY, new StringBuilder(curRow.substring(cursorX))); // Create new builder from the split point. - curRow.delete(cursorX, rowLen); // Remove string part starts with the split point. - cursorX = 0; // A pointer to the new line after the break. - return true; - } else return false; // No line break; the char is discarded; no effect; unhandled + return true; // No effect; the char is ignored; handled } else { // If the current line has spaces to expand, or else a new line would be required. - if (checkRowLineCapacity(cursorY) || checkNewLineAvailable()) { + if (rows.get(cursorY).length() < MAX_TEXT_LENGTH) { rows.get(cursorY).insert(cursorX++, c); return true; } else return false; // No more chars are accepted to expand at the current cursor position. @@ -292,22 +219,53 @@ else if (cursorX > 0) { } } + OnScreenKeyboardMenu onScreenKeyboardMenu; + @Override public void render(Screen screen) { super.render(screen); Rectangle bounds = menus[0].getBounds(); Font.drawCentered(Localization.getLocalized("Use SHIFT-ENTER to confirm input."), screen, bounds.getBottom() + 8, Color.GRAY); editor.render(screen); + if (onScreenKeyboardMenu != null) + onScreenKeyboardMenu.render(screen); } @Override public void tick(InputHandler input) { - if (input.inputPressed("exit") || input.getKey("SHIFT-ENTER").clicked) { - updateSign(levelDepth, x, y, editor.getLines()); - Game.exitDisplay(); - return; + boolean acted = false; // Checks if typing action is needed to be handled. + boolean mainMethod = false; + if (onScreenKeyboardMenu == null || !onScreenKeyboardMenu.isVisible()) { + if (input.inputPressed("exit") || input.getKey("SHIFT-ENTER").clicked) { + updateSign(levelDepth, x, y, editor.getLines()); + Game.exitDisplay(); + return; + } + + mainMethod = true; + } else { + try { + onScreenKeyboardMenu.tick(input); + } catch (OnScreenKeyboardMenu.OnScreenKeyboardMenuTickActionCompleted | + OnScreenKeyboardMenu.OnScreenKeyboardMenuBackspaceButtonActed e) { + acted = true; + } + + if (acted) + editor.tick(input); + + if (input.getKey("exit").clicked || input.getKey("SHIFT-ENTER").clicked) { // Should not listen button press + updateSign(levelDepth, x, y, editor.getLines()); + Game.exitDisplay(); + return; + } + + if (input.buttonPressed(ControllerButton.X)) { // Hide the keyboard. + onScreenKeyboardMenu.setVisible(!onScreenKeyboardMenu.isVisible()); + } } - editor.tick(input); + if (mainMethod || !onScreenKeyboardMenu.isVisible()) + editor.tick(input); } } From a097072b9c92ea6f96d9271b3a30eb83b2a08a2f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 9 Aug 2023 23:16:01 +0800 Subject: [PATCH 081/261] Move torch variations into tile data --- src/client/java/minicraft/item/TileItem.java | 2 +- src/client/java/minicraft/item/TorchItem.java | 2 +- src/client/java/minicraft/level/Level.java | 10 +++++-- .../java/minicraft/level/tile/DoorTile.java | 2 +- .../java/minicraft/level/tile/Tile.java | 10 +++++++ .../java/minicraft/level/tile/Tiles.java | 25 ++++++----------- .../java/minicraft/level/tile/TorchTile.java | 28 ++++++++++--------- 7 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index 0212fbdcd..439dd7cb6 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -91,7 +91,7 @@ protected TileItem(String name, LinkedSprite sprite, int count, String model, Li public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { for (String tilename : validTiles) { if (tile.matches(level.getData(xt, yt), tilename)) { - level.setTile(xt, yt, model); // TODO maybe data should be part of the saved tile..? + level.setTile(xt, yt, Tiles.get(model)); // TODO maybe data should be part of the saved tile..? AdvancementElement.AdvancementTrigger.PlacedTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.PlacedTileTrigger.PlacedTileTriggerConditionHandler.PlacedTileTriggerConditions( this, level.getTile(xt, yt), level.getData(xt, yt), xt, yt, level.depth diff --git a/src/client/java/minicraft/item/TorchItem.java b/src/client/java/minicraft/item/TorchItem.java index 6df20168b..b715af787 100644 --- a/src/client/java/minicraft/item/TorchItem.java +++ b/src/client/java/minicraft/item/TorchItem.java @@ -26,7 +26,7 @@ private TorchItem(int count) { public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { if (validTiles.contains(tile.name)) { - level.setTile(xt, yt, TorchTile.getTorchTile(tile)); + level.setTile(xt, yt, TorchTile.DELEGATE, tile.id); return super.interactOn(true); } return super.interactOn(false); diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 716e62a87..aa7dde17a 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -506,11 +506,15 @@ private void sortAndRender(Screen screen, List list) { public Tile getTile(int x, int y) { if (x < 0 || y < 0 || x >= w || y >= h /* || (x + y * w) >= tiles.length*/ ) return Tiles.get("connector tile"); - int id = tiles[x + y * w]; - if(id < 0) id += 256; - return Tiles.get(id); + short id = tiles[x + y * w]; + Tile tile; + return (tile = Tiles.get(id)) == TorchTile.DELEGATE ? TorchTile.getTorchTile(Tiles.get((short) getData(x, y))) : tile; } + /** + * @deprecated Currently unused, but this should be prevented being used. + */ + @Deprecated public void setTile(int x, int y, String tilewithdata) { if (!tilewithdata.contains("_")) { setTile(x, y, Tiles.get(tilewithdata)); diff --git a/src/client/java/minicraft/level/tile/DoorTile.java b/src/client/java/minicraft/level/tile/DoorTile.java index e01b023cc..7cb909cbf 100644 --- a/src/client/java/minicraft/level/tile/DoorTile.java +++ b/src/client/java/minicraft/level/tile/DoorTile.java @@ -52,7 +52,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D if (tool.type == type.getRequiredTool()) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { int data = level.getData(xt, yt); - level.setTile(xt, yt, Tiles.get(id + 3)); // Will get the corresponding floor tile. + level.setTile(xt, yt, Tiles.get((short) (id + 3))); // Will get the corresponding floor tile. Sound.play("monsterhurt"); level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get(type.name() + " Door")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index fe52cf1e1..8bb4ffd7a 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -138,6 +138,11 @@ public boolean onExplode(Level level, int xt, int yt) { /** Sees if the tile connects to a fluid. */ public boolean connectsToLiquid() { return connectsToFluid; } + /** + * @deprecated This should be planned to be removed as this method is not ideally used. + * The current only usage is in {@link Level#setTile(int, int, String)}. + */ + @Deprecated public int getData(String data) { try { return Integer.parseInt(data); @@ -146,6 +151,11 @@ public int getData(String data) { } } + /** + * @deprecated Similar to {@link #getData(String)}. Also, param {@code thisData} is unused. + * The current only usage is in {@link minicraft.item.TileItem#interactOn(Tile, Level, int, int, Player, Direction)}. + */ + @Deprecated public boolean matches(int thisData, String tileInfo) { return name.equals(tileInfo.split("_")[0]); } diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index c5106a385..49fd01414 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -72,6 +72,7 @@ public static void initTileList() { tiles.put((short)47, new BossWallTile()); tiles.put((short)48, new BossFloorTile()); tiles.put((short)49, new BossDoorTile()); + tiles.put((short)50, TorchTile.DELEGATE); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); @@ -199,7 +200,7 @@ public static Tile get(String name) { Tile getting = null; boolean isTorch = false; - if(name.startsWith("TORCH")) { + if(name.startsWith("TORCH") && name.length() > 5) { isTorch = true; name = name.substring(6); // Cuts off torch prefix. } @@ -221,7 +222,7 @@ public static Tile get(String name) { getting = tiles.get((short)0); } - if(isTorch) { + if (isTorch) { getting = TorchTile.getTorchTile(getting); } @@ -229,26 +230,16 @@ public static Tile get(String name) { return getting; } - public static Tile get(int id) { + public static Tile get(short id) { //System.out.println("Requesting tile by id: " + id); - if(id < 0) id += 32768; - - if(tiles.get((short)id) != null) { - return tiles.get((short)id); - } - else if(id >= 32767) { - return TorchTile.getTorchTile(get(id - 32767)); - } - else { + if (tiles.get(id) != null) { + return tiles.get(id); + } else { Logging.TILES.info("Unknown tile id requested: " + id); - return tiles.get((short)0); + return tiles.get((short) 0); } } - public static boolean containsTile(int id) { - return tiles.get((short)id) != null; - } - public static String getName(String descriptName) { if(!descriptName.contains("_")) return descriptName; int data; diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index 52353ac45..39959c9a5 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -13,25 +13,27 @@ import minicraft.util.AdvancementElement; import org.tinylog.Logger; +import java.util.HashMap; + public class TorchTile extends Tile { - private Tile onType; + public static final TorchTile DELEGATE = new TorchTile(new ConnectTile()); // ConnectTile is used for placeholder. + + private static final HashMap instances = new HashMap<>(); + + private final Tile onType; + /** @param onTile The tile identified by tile data. */ public static TorchTile getTorchTile(Tile onTile) { + if (onTile instanceof TorchTile) return (TorchTile) onTile; int id = onTile.id & 0xFFFF; - if(id < 16384) id += 16384; - else Logger.tag("TorchTile").info("Tried to place torch on torch tile..."); - - if(Tiles.containsTile(id)) - return (TorchTile)Tiles.get(id); - else { - TorchTile tile = new TorchTile(onTile); - Tiles.add(id, tile); - return tile; - } + if (instances.containsKey(id)) return instances.get(id); + TorchTile tile = new TorchTile(onTile); + instances.put(id, tile); + return tile; } private TorchTile(Tile onType) { - super("Torch "+ onType.name, new SpriteAnimation(SpriteType.Tile, "torch")); + super("Torch", new SpriteAnimation(SpriteType.Tile, "torch")); this.onType = onType; this.connectsToSand = onType.connectsToSand; this.connectsToGrass = onType.connectsToGrass; @@ -50,7 +52,7 @@ public int getLightRadius(Level level, int x, int y) { public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { if(item instanceof PowerGloveItem) { int data = level.getData(xt, yt); - level.setTile(xt, yt, this.onType); + level.setTile(xt, yt, onType); Sound.play("monsterhurt"); level.dropItem(xt*16+8, yt*16+8, Items.get("Torch")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( From 897b11b268323dc69af7d5270c1a2cf58907dacb Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 17 Aug 2023 02:00:05 +0800 Subject: [PATCH 082/261] Update Level#getTile --- src/client/java/minicraft/level/Level.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index aa7dde17a..2b054e65c 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -508,7 +508,12 @@ public Tile getTile(int x, int y) { if (x < 0 || y < 0 || x >= w || y >= h /* || (x + y * w) >= tiles.length*/ ) return Tiles.get("connector tile"); short id = tiles[x + y * w]; Tile tile; - return (tile = Tiles.get(id)) == TorchTile.DELEGATE ? TorchTile.getTorchTile(Tiles.get((short) getData(x, y))) : tile; + + if ((tile = Tiles.get(id)) == TorchTile.DELEGATE) { + return TorchTile.getTorchTile(Tiles.get((short) getData(x, y))); + } + + return tile; } /** From d7e0ae7631bbffa5f2fd85827e06f5bf960732b2 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:42:13 +0800 Subject: [PATCH 083/261] Fix horizontal flipping of ston_wall_border.png --- .../assets/textures/tile/stone_wall_border.png | Bin 270 -> 297 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/tile/stone_wall_border.png b/src/client/resources/assets/textures/tile/stone_wall_border.png index 575105751a0f6e2042c5cd3db754f733997fbe81..5bde9b10624267b86825db9cff02decf4ca42d79 100644 GIT binary patch delta 256 zcmV+b0ssDv0;vL!F@FSSK}|sb0I`n?{9y$E000SaNLh0L01m}XtCC=&N(v1Y|A@2=b?4H_-mW1@vT6E7$dzg;j-!yuX*}{e)lK|S|Bb3NJud! z5B?Dci0M^b5}-90cfeY#R}!G_JVt4?)IZZX3EIAm&}yl8P+uPpPOyfm2esCG52QWi z7l`R?`{H?kz5EK2#^F2wFbDV2j>^v^+UN5-@n{I8uYV) fw1h5z)xRwd+R6+JY|7X^00000NkvXXu0mjf&#rC} From bd01a5b5b94e4f732e6ec0e88dd82286292e42bd Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 21 Aug 2023 02:09:04 +0800 Subject: [PATCH 084/261] Fix ResourcePackDisplay entry reposition problem Rendering problem when updating entries --- src/client/java/minicraft/screen/ResourcePackDisplay.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index e7fd1822a..b3a1dc64e 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -247,8 +247,8 @@ private void refreshEntries() { menus = newMenus; - /* Translate position. */ - menus[selection ^ 1].translate(menus[selection].getBounds().getWidth() + padding, 0); + // Translate position. + onSelectionChange(selection ^ 1, selection); } /** Watching the directory changes. Allowing hot-loading. */ From 7377c702ee569fda77593d09466f5803864e75ff Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 11 Jul 2023 20:18:41 +0800 Subject: [PATCH 085/261] Fix missing Display#onExit invoke --- src/client/java/minicraft/core/Updater.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/core/Updater.java b/src/client/java/minicraft/core/Updater.java index 391d94314..fb45c9e29 100644 --- a/src/client/java/minicraft/core/Updater.java +++ b/src/client/java/minicraft/core/Updater.java @@ -126,7 +126,10 @@ public static void tick() { // assert curDisplay == prevDisplay; currentDisplay = displayQuery.peek(); assert currentDisplay != null; - currentDisplay.init(prevDisplay); + if (prevDisplay.getParent() == currentDisplay) + prevDisplay.onExit(); + else + currentDisplay.init(prevDisplay); } Level level = levels[currentLevel]; From b8f18fda6ff00ae9f26dbf2b1e61e611c3fa8dea Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 22 Aug 2023 23:06:37 +0800 Subject: [PATCH 086/261] Add ExplosionTileTicker to replace explosion replacements --- .../minicraft/entity/ExplosionTileTicker.java | 56 +++++++++++++++++++ .../java/minicraft/entity/furniture/Tnt.java | 32 +---------- .../java/minicraft/entity/mob/Creeper.java | 10 +--- src/client/java/minicraft/level/Level.java | 4 +- .../java/minicraft/level/tile/Tiles.java | 22 ++++++++ 5 files changed, 85 insertions(+), 39 deletions(-) create mode 100644 src/client/java/minicraft/entity/ExplosionTileTicker.java diff --git a/src/client/java/minicraft/entity/ExplosionTileTicker.java b/src/client/java/minicraft/entity/ExplosionTileTicker.java new file mode 100644 index 000000000..5331a82f4 --- /dev/null +++ b/src/client/java/minicraft/entity/ExplosionTileTicker.java @@ -0,0 +1,56 @@ +package minicraft.entity; + +import minicraft.gfx.Screen; +import minicraft.level.Level; +import minicraft.level.tile.ExplodedTile; +import minicraft.level.tile.Tile; +import minicraft.level.tile.Tiles; + +// This is a kind of tile entity. Maybe this should be savable. +public class ExplosionTileTicker extends Entity { + private static final int EXPLOSION_TIME = 18; // 18 ticks == 0.3 second + + private final Level level; + private final int x, y, r; + + private int tick = 0; + + public ExplosionTileTicker(Level level, int x, int y, int r) { + super(0, 0); + this.level = level; + this.x = x; + this.y = y; + this.r = r; + level.setAreaTiles(x, y, r, Tiles.get("explode"), 0, ExplosionTileTicker::explodeBlacklistCheck); + } + + public static void addTicker(Level level, int x, int y, int r) { + level.add(new ExplosionTileTicker(level, x, y, r), x * 16 + 8, y * 16 + 8); + } + + private static boolean explodeBlacklistCheck(Tile tile, int x, int y) { + return !Tiles.explosionBlacklist.contains(tile.id); + } + + private static boolean explodedTileCheck(Tile tile, int x, int y) { + return tile instanceof ExplodedTile; + } + + @Override + public void render(Screen screen) {} + + @Override + public void tick() { + if (tick == EXPLOSION_TIME) { // Does the explosion + if (level.depth != 1) { + level.setAreaTiles(x, y, r, Tiles.get("hole"), 0, ExplosionTileTicker::explodedTileCheck); + } else { + level.setAreaTiles(x, y, r, Tiles.get("Infinite Fall"), 0, ExplosionTileTicker::explodedTileCheck); + } + + remove(); + } + + tick++; + } +} diff --git a/src/client/java/minicraft/entity/furniture/Tnt.java b/src/client/java/minicraft/entity/furniture/Tnt.java index 9b659d2c0..9eda287ef 100644 --- a/src/client/java/minicraft/entity/furniture/Tnt.java +++ b/src/client/java/minicraft/entity/furniture/Tnt.java @@ -3,6 +3,7 @@ import minicraft.core.io.Sound; import minicraft.entity.Direction; import minicraft.entity.Entity; +import minicraft.entity.ExplosionTileTicker; import minicraft.entity.mob.Mob; import minicraft.entity.mob.Player; import minicraft.gfx.Color; @@ -22,17 +23,13 @@ import java.awt.event.ActionListener; import java.util.List; -public class Tnt extends Furniture implements ActionListener { +public class Tnt extends Furniture { private static int FUSE_TIME = 90; private static int BLAST_RADIUS = 32; private static int BLAST_DAMAGE = 75; private int ftik = 0; private boolean fuseLit = false; - private Timer explodeTimer; - private Level levelSave; - - private final String[] explosionBlacklist = new String[]{ "hard rock", "obsidian wall", "stairs up", "stairs down" }; /** * Creates a new tnt furniture. @@ -41,8 +38,6 @@ public Tnt() { super("Tnt", new LinkedSprite(SpriteType.Entity, "tnt"), new LinkedSprite(SpriteType.Item, "tnt"), 3, 2); fuseLit = false; ftik = 0; - - explodeTimer = new Timer(300, this); } @Override @@ -87,11 +82,7 @@ public void tick() { AchievementsDisplay.setAchievement("minicraft.achievement.demolition", true); Sound.play("explode"); - - level.setAreaTiles(xt, yt, 1, Tiles.get("explode"), 0, explosionBlacklist); - - levelSave = level; - explodeTimer.start(); + ExplosionTileTicker.addTicker(level, xt, yt, 1); super.remove(); } } @@ -106,23 +97,6 @@ public void render(Screen screen) { super.render(screen); } - /** - * Does the explosion. - */ - public void actionPerformed(ActionEvent e) { - explodeTimer.stop(); - int xt = x >> 4; - int yt = (y - 2) >> 4; - - if (levelSave.depth != 1) { - levelSave.setAreaTiles(xt, yt, 1, Tiles.get("hole"), 0, explosionBlacklist); - } else { - levelSave.setAreaTiles(xt, yt, 1, Tiles.get("Infinite Fall"), 0, explosionBlacklist); - } - - levelSave = null; - } - @Override public boolean interact(Player player, Item heldItem, Direction attackDir) { if (!fuseLit) { diff --git a/src/client/java/minicraft/entity/mob/Creeper.java b/src/client/java/minicraft/entity/mob/Creeper.java index acaa6810d..0f9ca80bb 100644 --- a/src/client/java/minicraft/entity/mob/Creeper.java +++ b/src/client/java/minicraft/entity/mob/Creeper.java @@ -5,6 +5,7 @@ import minicraft.core.io.Sound; import minicraft.entity.Direction; import minicraft.entity.Entity; +import minicraft.entity.ExplosionTileTicker; import minicraft.entity.furniture.Spawner; import minicraft.gfx.Point; import minicraft.gfx.Screen; @@ -30,8 +31,6 @@ public class Creeper extends EnemyMob { private int fuseTime = 0; private boolean fuseLit = false; - private final String[] explosionBlacklist = new String[] { "hard rock", "obsidian wall", "raw obsidian"}; - public Creeper(int lvl) { super(lvl, sprites, 10, 50); } @@ -119,12 +118,7 @@ public void tick() { } } if (!hasSpawner) { - if (level.depth != 1) { - level.setAreaTiles(tilePosition.x, tilePosition.y, 0, Tiles.get("hole"), 0, explosionBlacklist); - } else { - level.setAreaTiles(tilePosition.x, tilePosition.y, 0, Tiles.get("Infinite Fall"), 0, explosionBlacklist); - } - + ExplosionTileTicker.addTicker(level, tilePosition.x, tilePosition.y, 0); } } diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 716e62a87..bf6d925f8 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -826,10 +826,10 @@ public void setAreaTiles(int xt, int yt, int r, Tile tile, int data, boolean ove } } - public void setAreaTiles(int xt, int yt, int r, Tile tile, int data, String[] blacklist) { + public void setAreaTiles(int xt, int yt, int r, Tile tile, int data, TileCheck condition) { for (int y = yt - r; y <= yt + r; y++) { for (int x = xt - r; x <= xt + r; x++) { - if (!Arrays.asList(blacklist).contains(getTile(x, y).name.toLowerCase())) + if (condition.check(getTile(x, y), x, y)) setTile(x, y, tile, data); } } diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index c5106a385..3059519c6 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -7,7 +7,11 @@ import minicraft.util.Logging; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; public final class Tiles { /// Idea: to save tile names while saving space, I could encode the names in base 64 in the save file...^M @@ -17,6 +21,10 @@ public final class Tiles { private static HashMap tiles = new HashMap<>(); + // Standard tile explosion blacklist + // Tiles (as IDs) included cannot be damaged by explosions such as by TNTs and creepers. + public static final Set explosionBlacklist; + public static void initTileList() { Logging.TILES.debug("Initializing tile list..."); @@ -179,6 +187,20 @@ protected static void add(int id, Tile tile) { oldids.set(53, "torch green wool"); oldids.set(54, "torch yellow wool"); oldids.set(55, "torch black wool"); + + explosionBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( + (short) 4, // Stairs Up + (short) 5, // Stairs Down + (short) 22, // Hard Rock + (short) 28, // Obsidian Door + (short) 31, // Obsidian + (short) 34, // Obsidian Wall + (short) 44, // Raw Obsidian + (short) 46, // Ornate Obsidian + (short) 47, // Boss Wall + (short) 48, // Boss Floor + (short) 49 // Boss Door + ))); } private static int overflowCheck = 0; From c9e171746ef37e44d18d90327179cf0d09985cf0 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:23:08 +0800 Subject: [PATCH 087/261] Remove the removal for empty values in saves --- src/client/java/minicraft/saveload/Load.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 03b06c5b2..7909495b3 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -315,7 +315,7 @@ private static ArrayList splitUnwrappedCommas(String input) { if (ch == commaChar && bracketCounter.isEmpty()) { String str = input.substring(lastIdx + (input.charAt(lastIdx) == commaChar ? 1 : 0), i).trim(); lastIdx = i; - if (!str.isEmpty()) out.add(str); + out.add(str); // Empty strings are expected. } else if (ch == openBracket0) { bracketCounter.push(0); } else if (ch == closeBracket0) { From e8105518195bf73c019b3466a03256566bf6d8d1 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 5 Jul 2023 17:03:36 +0800 Subject: [PATCH 088/261] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef7ff6d31..274f59a34 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ You must first confirm that you have [Java](https://www.java.com/en/download/) ( ## Localization This project is running with an external localization platform called POEditor. You can contribute localization by clicking the image below! -[![Minicraft+ POEditor Stats](https://raw.githubusercontent.com/BenCheung0422/MinicraftPlus-POEditor-Stats/main/docs/poeditor_stats.svg)](https://poeditor.com/join/project/xvtwoWhNXe) +[![Minicraft+ POEditor Stats](https://minicraft-plus-poeditor-stats.vercel.app/api/card)](https://minicraft-plus-poeditor-stats.vercel.app) ## How to build/run in development Because this project uses a build tool called gradle it is very easy to build or run the project from the source code. From b92e88d0e6f5787d9da8f95081a56cb892e8c191 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 16 Aug 2023 00:24:31 +0800 Subject: [PATCH 089/261] Fix inconsistence of wooden and stone bow textures --- .../assets/textures/item/stone_bow.png | Bin 161 -> 174 bytes .../assets/textures/item/wooden_bow.png | Bin 161 -> 161 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/item/stone_bow.png b/src/client/resources/assets/textures/item/stone_bow.png index c37012d788dc2e98b4b0617f1d6b0e0a6eeec656..82a83a87a9724f286dd4cd3d74254afed15fbca2 100644 GIT binary patch delta 132 zcmZ3;xQ=mxVJ%C#qpu?a!^VE@KZ&di3=EtF9+AZi419+{nDKc2iWH!rv!{z=h(>U- z1G|`**ndZfQ?9HAozCri2Sp7WGdDcx6jqm57-PYpeL$6ysX(}ZaRbwYycoXb*$w`J hTnw5{8Yu}34Bs52C$HHM`x|H+gQu&X%Q~loCIHgyCl~+# delta 119 zcmV--0Eqvt0igkqF>qT+L_t(2Q)6U+0t*X^|0hnIV1)5uG+5x!p+o=E1JfD!Rrwjv z6~PtQ+1W8_3TysHSA?PfWE#363V0FwN8`y<2kx7WdPC<@Re;R;~(BI|^C Z697iGKncrePpkj{002ovPDHLkV1gXIGavu} diff --git a/src/client/resources/assets/textures/item/wooden_bow.png b/src/client/resources/assets/textures/item/wooden_bow.png index 668bca7d46d2f8cb8f304bd46fb435c882fc2170..cdef21787a726c076bfa4675a9e5eb12609ab137 100644 GIT binary patch delta 119 zcmZ3;xR7yzVF63Jqpu?a!^VE@KZ&di3=EtF9+AZi419+{nDKc2iWH!rnWu|mh(>U- z1AF$eW&ha|HN-^^sPM^JwX9@_6mMfHQJyGj;Fx)cVZEq9!}W;<3_&dhy^V|vSDtHF UOQvnK2AaU&>FVdQ&MBb@01{0jp#T5? delta 119 zcmV--0Eqvg0igkqF>qT+L_t(2Q)6U+f;Cgq|A%DHWQ6fyG+5x!p+o=E1JfCro9r0S z6~PtQ+1W8_3TysHSA?PfWE#363V0Ftb&JH&AP?RBsmiUM>=xB{5H$U0%( Z1OR5XKnWyi-Z20G002ovPDHLkV1k*)GhzS$ From 03ef607e5b59d3fe794cabcbeb3cafd21aa9fecc Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 4 Aug 2023 20:32:35 +0800 Subject: [PATCH 090/261] Update PotionItem.java --- src/client/java/minicraft/item/PotionItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/PotionItem.java b/src/client/java/minicraft/item/PotionItem.java index 7146ec279..c0ef3396d 100644 --- a/src/client/java/minicraft/item/PotionItem.java +++ b/src/client/java/minicraft/item/PotionItem.java @@ -1,5 +1,6 @@ package minicraft.item; +import minicraft.core.Game; import minicraft.entity.Direction; import minicraft.entity.mob.Player; import minicraft.gfx.SpriteLinker.LinkedSprite; @@ -39,7 +40,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } protected boolean interactOn(boolean subClassSuccess, Player player) { - if (subClassSuccess) + if (subClassSuccess && !Game.isMode("minicraft.settings.mode.creative")) player.tryAddToInvOrDrop(Items.get("glass bottle")); return super.interactOn(subClassSuccess); } From 47c1aacd5e1cd2e8a9bfa55b740be6c61fac904a Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 4 Aug 2023 20:35:03 +0800 Subject: [PATCH 091/261] Update ClothingItem.java --- .../java/minicraft/item/ClothingItem.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/client/java/minicraft/item/ClothingItem.java b/src/client/java/minicraft/item/ClothingItem.java index b453ffacf..6340ded44 100644 --- a/src/client/java/minicraft/item/ClothingItem.java +++ b/src/client/java/minicraft/item/ClothingItem.java @@ -1,5 +1,6 @@ package minicraft.item; +import minicraft.core.Game; import minicraft.entity.Direction; import minicraft.entity.mob.Player; import minicraft.gfx.Color; @@ -42,13 +43,15 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, if (player.shirtColor == playerCol) { return false; } else { - ClothingItem lastClothing = (ClothingItem) getAllInstances().stream().filter(i -> i instanceof ClothingItem && ((ClothingItem) i).playerCol == player.shirtColor) - .findAny().orElse(null); - if (lastClothing == null) - lastClothing = (ClothingItem) Items.get("Reg Clothes"); - lastClothing = lastClothing.copy(); - lastClothing.count = 1; - player.tryAddToInvOrDrop(lastClothing); + if (!Game.isMode("minicraft.settings.mode.creative")) { + ClothingItem lastClothing = (ClothingItem) getAllInstances().stream().filter(i -> i instanceof ClothingItem && ((ClothingItem) i).playerCol == player.shirtColor) + .findAny().orElse(null); + if (lastClothing == null) + lastClothing = (ClothingItem) Items.get("Reg Clothes"); + lastClothing = lastClothing.copy(); + lastClothing.count = 1; + player.tryAddToInvOrDrop(lastClothing); + } player.shirtColor = playerCol; return super.interactOn(true); } From 054953af27c90218162710798fa7526905085a2c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 11 Jul 2023 19:55:59 +0800 Subject: [PATCH 092/261] Add missing fishing interrupt handles --- src/client/java/minicraft/entity/mob/Player.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index a669d05ce..70605fbd0 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -605,6 +605,10 @@ protected void attack() { activeItem.interactOn(Tiles.get("rock"), level, 0, 0, this, attackDir); if (activeItem.isDepleted()) { activeItem = null; + if (isFishing) { + isFishing = false; + fishingTicks = maxFishingTicks; + } } return; } @@ -663,6 +667,10 @@ protected void attack() { if (activeItem.isDepleted()) { // If the activeItem has 0 items left, then "destroy" it. activeItem = null; + if (isFishing) { + isFishing = false; + fishingTicks = maxFishingTicks; + } } } if (done) return; // Skip the rest if interaction was handled From 0a98da300cbb6a91694e6313db1d2d501dc0657e Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Sat, 30 Sep 2023 12:22:13 +0200 Subject: [PATCH 093/261] fences added fences --- src/client/java/minicraft/item/Recipes.java | 4 + src/client/java/minicraft/item/TileItem.java | 3 + .../java/minicraft/level/tile/FenceTile.java | 166 ++++++++++++++++++ .../java/minicraft/level/tile/Tiles.java | 3 + .../assets/textures/item/obsidian_fence.png | Bin 0 -> 182 bytes .../assets/textures/item/stone_fence.png | Bin 0 -> 171 bytes .../assets/textures/item/wood_fence.png | Bin 0 -> 182 bytes .../assets/textures/tile/obsidian_fence.png | Bin 0 -> 174 bytes .../textures/tile/obsidian_fence_bottom.png | Bin 0 -> 126 bytes .../textures/tile/obsidian_fence_left.png | Bin 0 -> 191 bytes .../textures/tile/obsidian_fence_right.png | Bin 0 -> 156 bytes .../textures/tile/obsidian_fence_up.png | Bin 0 -> 115 bytes .../assets/textures/tile/stone_fence.png | Bin 0 -> 181 bytes .../assets/textures/tile/stone_fence_down.png | Bin 0 -> 115 bytes .../assets/textures/tile/stone_fence_left.png | Bin 0 -> 177 bytes .../textures/tile/stone_fence_right.png | Bin 0 -> 146 bytes .../assets/textures/tile/stone_fence_up.png | Bin 0 -> 111 bytes .../assets/textures/tile/wood_fence.png | Bin 0 -> 174 bytes .../textures/tile/wood_fence_bottom.png | Bin 0 -> 120 bytes .../assets/textures/tile/wood_fence_left.png | Bin 0 -> 179 bytes .../assets/textures/tile/wood_fence_right.png | Bin 0 -> 140 bytes .../assets/textures/tile/wood_fence_top.png | Bin 0 -> 115 bytes src/client/resources/resources/recipes.json | 78 ++++++++ 23 files changed, 254 insertions(+) create mode 100644 src/client/java/minicraft/level/tile/FenceTile.java create mode 100644 src/client/resources/assets/textures/item/obsidian_fence.png create mode 100644 src/client/resources/assets/textures/item/stone_fence.png create mode 100644 src/client/resources/assets/textures/item/wood_fence.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_bottom.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_left.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_right.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_up.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_down.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_left.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_right.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_up.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_bottom.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_left.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_right.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_top.png diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 725406d9a..80daca00a 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -18,21 +18,25 @@ public class Recipes { craftRecipes.add(new Recipe("plank_2", "Wood_1")); craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); + craftRecipes.add(new Recipe("Wood Fence_1", "plank_3")); workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); + workbenchRecipes.add(new Recipe("Wood Fence_1", "plank_3")); workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); + workbenchRecipes.add(new Recipe("Stone Fence_1", "Stone Brick_3")); workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); + workbenchRecipes.add(new Recipe("Obsidian Fence_1", "Obsidian Brick_3")); workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index 0212fbdcd..a645dcef0 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -33,16 +33,19 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), "Wood Planks", "hole", "water", "cloud")); items.add(new TileItem("Plank Wall", new LinkedSprite(SpriteType.Item, "plank_wall"), "Wood Wall", "Wood Planks")); items.add(new TileItem("Wood Door", new LinkedSprite(SpriteType.Item, "wood_door"), "Wood Door", "Wood Planks")); + items.add(new TileItem("Wood Fence", new LinkedSprite(SpriteType.Item, "wood_fence"), "Wood Fence", "grass")); items.add(new TileItem("Stone", new LinkedSprite(SpriteType.Item, "stone"), "Stone", "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), "Stone Bricks", "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), "Ornate Stone", "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), "Stone Wall", "Stone Bricks")); items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), "Stone Door", "Stone Bricks")); + items.add(new TileItem("Stone Fence", new LinkedSprite(SpriteType.Item, "stone_fence"), "Stone Fence", "Stone Bricks")); items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), "Raw Obsidian", "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), "Obsidian", "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), "Ornate Obsidian","hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Wall", new LinkedSprite(SpriteType.Item, "obsidian_wall"), "Obsidian Wall", "Obsidian")); items.add(new TileItem("Obsidian Door", new LinkedSprite(SpriteType.Item, "obsidian_door"), "Obsidian Door", "Obsidian")); + items.add(new TileItem("Obsidian Fence", new LinkedSprite(SpriteType.Item, "obsidian_fence"), "Obsidian Fence", "Obsidian")); items.add(new TileItem("Wool", new LinkedSprite(SpriteType.Item, "wool"), "Wool", "hole", "water")); items.add(new TileItem("Red Wool", new LinkedSprite(SpriteType.Item, "red_wool"), "Red Wool", "hole", "water")); diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java new file mode 100644 index 000000000..6897d1dc1 --- /dev/null +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -0,0 +1,166 @@ +package minicraft.level.tile; + +import minicraft.core.Game; +import minicraft.core.io.Sound; +import minicraft.entity.Direction; +import minicraft.entity.Entity; +import minicraft.entity.mob.Mob; +import minicraft.entity.mob.Player; +import minicraft.entity.particle.SmashParticle; +import minicraft.entity.particle.TextParticle; +import minicraft.gfx.Color; +import minicraft.gfx.Screen; +import minicraft.gfx.Sprite; +import minicraft.gfx.SpriteAnimation; +import minicraft.gfx.SpriteLinker; +import minicraft.gfx.SpriteLinker.LinkedSprite; +import minicraft.gfx.SpriteLinker.SpriteType; +import minicraft.item.Item; +import minicraft.item.Items; +import minicraft.item.ToolItem; +import minicraft.level.Level; +import minicraft.util.AdvancementElement; +import minicraft.util.Logging; + +public class FenceTile extends Tile { + + private static SpriteAnimation wood = new SpriteAnimation(SpriteType.Tile, "wood_fence"); + private static SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_fence"); + private static SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_fence"); + + protected Material type; + + protected SpriteAnimation top, bottom, left, right; + + protected FenceTile(Material type) { this(type, null); } + protected FenceTile(Material type, String name) { + super(type.name() + " " + (name == null ? "Fence" : name), null); + this.type = type; + switch (type) + { + case Wood: + sprite = wood; + connectsToGrass = true; + break; + case Stone: + sprite = stone; + break; + case Obsidian: + sprite = obsidian; + break; + } + top = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_top"); + bottom = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_bottom"); + left = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_left"); + right = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_right"); + } + + public boolean mayPass(Level level, int x, int y, Entity e) { + return false; + } + + public void render(Screen screen, Level level, int x, int y) + { + switch (type) + { + case Wood: Tiles.get("Grass").render(screen, level, x, y); break; + case Stone: Tiles.get("Stone Bricks").render(screen, level, x, y); break; + case Obsidian: Tiles.get("Obsidian").render(screen, level, x, y); break; + } + + sprite.render(screen, level, x, y); + + // up + if (level.getTile(x, y - 1).name.equals(name)) { + top.render(screen, level, x, y); + } + // bottom + if (level.getTile(x, y + 1).name.equals(name)) { + bottom.render(screen, level, x, y); + } + // left + if (level.getTile(x - 1, y).name.equals(name)) { + left.render(screen, level, x, y); + } + // right + if (level.getTile(x + 1, y).name.equals(name)) { + right.render(screen, level, x, y); + } + } + + @Override + public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { + hurt(level, x, y, dmg); + return true; + } + + @Override + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + if(Game.isMode("minicraft.settings.mode.creative")) + return false; // Go directly to hurt method + if (item instanceof ToolItem) { + ToolItem tool = (ToolItem) item; + if (tool.type == type.getRequiredTool()) { + if (player.payStamina(4 - tool.level) && tool.payDurability()) { + int data = level.getData(xt, yt); + hurt(level, xt, yt, tool.getDamage()); + AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( + new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( + item, this, data, xt, yt, level.depth)); + return true; + } + } + } + return false; + } + + public void hurt(Level level, int x, int y, int dmg) { + int damage = level.getData(x, y) + dmg; + int fenceHealth = 5; + if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = fenceHealth; + + level.add(new SmashParticle(x * 16, y * 16)); + Sound.play("monsterhurt"); + + level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + + if (damage >= fenceHealth) { + String itemName = "", tilename = ""; + switch (type) { // Get what tile to set and what item to drop + case Wood: { + itemName = "Wood Fence"; + tilename = "Grass"; + break; + } + case Stone: { + itemName = "Stone Fence"; + tilename = "Stone Bricks"; + break; + } + case Obsidian: { + itemName = "Obsidian Fence"; + tilename = "Obsidian"; + break; + } + } + + level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(itemName)); + level.setTile(x, y, Tiles.get(tilename)); + } else { + level.setData(x, y, damage); + } + } + + public boolean tick(Level level, int xt, int yt) { + int damage = level.getData(xt, yt); + if (damage > 0) { + level.setData(xt, yt, damage - 1); + return true; + } + return false; + } + + public String getName(int data) { + return Material.values[data].name() + " Fence"; + } +} diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index c5106a385..01e7ee87d 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -72,6 +72,9 @@ public static void initTileList() { tiles.put((short)47, new BossWallTile()); tiles.put((short)48, new BossFloorTile()); tiles.put((short)49, new BossDoorTile()); + tiles.put((short)50, new FenceTile(Tile.Material.Wood)); + tiles.put((short)51, new FenceTile(Tile.Material.Stone)); + tiles.put((short)52, new FenceTile(Tile.Material.Obsidian)); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); diff --git a/src/client/resources/assets/textures/item/obsidian_fence.png b/src/client/resources/assets/textures/item/obsidian_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..9a7a86e5795634c71ed41dca4ea23fa1e9718e84 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|3OrpLLnNm5 z_8W3F7znVa2RhX>wEAAK+kayB-`2fJlMk_LI4z2`IC|*iyJ^ySjt_1Z{4|RxTAs3E zHDALVrOReo466FS(ijqMK2KWlJ1xPMzo=`?^FXH9Qj6q^dkT)(J&SrZXXDXH!6`TE eZGJvj{fyV_nod}->Y)Un-3*?telF{r5}E)cuSH-0 literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/item/stone_fence.png b/src/client/resources/assets/textures/item/stone_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..08b69d2306448b5ff9ab2bede5000b29eee5ddbf GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|QaxQ9LnNl= z_HPtqQRHF%Ubo`-#;%2Y;*PQ*k2-Gfemux)Ur>K4=kzVXoJl6CzV}oz-H!Bh91i)W zXxz`<5R`rNOhNgXH|ZH`C(f*yx5Acn!IyjekG%@N-!?e5L#)_+&ENRR>1Xwi)#y&h T^b-;WTFBt(>gTe~DWM4fDF8ph literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/item/wood_fence.png b/src/client/resources/assets/textures/item/wood_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..4e0f48340ba8f2273e928964a6fd36f216a2e85e GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|3OrpLLnNjq zCpa*@{5S3Y<-fZBmAf}8c(=J`9N6(cJQd9=@7tULZVUOR0-Q zg4Nbimj_*kluRT*+!+!V7&hgt3CnohVX!8ukolpz=EC2ui literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/obsidian_fence.png b/src/client/resources/assets/textures/tile/obsidian_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..78b431ef7c4e96235af8fce660be44a6e035fcb5 GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|GCW-zLo9le z6C^SYbohSw|NlSFt|Yzx6OZcczjgS;iH?Up>zQ69l zBqv6n9V$<5SUfQ4@twqYgsF>HL4vL25YuwT6aS8-pAg_+-W2PQW3|9SKY)jUtxe%l TlYi)Spq&h!u6{1-oD!MZh literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png b/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..cd2535b51adcfaa0098f1a70d0367b1cb987507e GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|EIeHtLo9le z6C_wG8v9m!u9ppb{{P1ngGZOw99Vhc01$k5@VmB6d;RyM(9!PC{xWt~$(697-%E6xA_ literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_left.png b/src/client/resources/assets/textures/tile/obsidian_fence_left.png new file mode 100644 index 0000000000000000000000000000000000000000..a5d8a4037e15e8a3ba46639aa8193349d131c2f9 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|Dm`5sLo9le z6C_xBtQMX7f01?lo_nV~)-dXD&FSLlult)YA^EX`ghLZ|gxud>2M+)N!(vZXo&W#r z)V-B?4F3J^7i8h->2YCaWbR%!gL@e#56=;HCE?8~7q=xc`xNEK@EDvqaG*g*+GXd1 mgWrE^F!ApTezIU82gBSnspW^?t3(1F!QkoY=d#Wzp$P!j7(=E2 literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_right.png b/src/client/resources/assets/textures/tile/obsidian_fence_right.png new file mode 100644 index 0000000000000000000000000000000000000000..3b2e025a9d5b8cd3143d204322ef19b40f5371d1 GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|!aQ9ZLo9le z6C_xBmS|iPEdAH7cg(4ak!wyDPk-ItgbB%y70x%f@2^{MK}Gt*`}f5>hLa9G_+Q_n zu%KAM$k02fV`2(J(Tl@L%__`tHT(OIsk?q(z{=3EQ1VpvBCAxO4Gf;HelF{r5}E*q Ca5k_2 literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_up.png b/src/client/resources/assets/textures/tile/obsidian_fence_up.png new file mode 100644 index 0000000000000000000000000000000000000000..c9c56cdcc1439b94501695117ef95d6ec64ff969 GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|bUj@hLo9le zQw}hexXk^pU7%%T00cHa>gGQ@^?Gm5jVp!^jS@t9ngR{3Ffi0#W@o8hZp#hS$l&Sf K=d#Wzp$Pz}ULvIc literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence.png b/src/client/resources/assets/textures/tile/stone_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..9df75239360a767abb05c791b3520b0aa174f761 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|@;zM~Lo9le z|NQ@N&%Ci=;zU8`p3aQB77W~aoZjBvBFkm%>trrh#jr(0Mg4pK>eZn%g*HWt*n*dr zRAYiP7}6zPynJ~uQ)0FXa|i2|Zq^710WR)2Yzn`n=PNoZ@SG@P-1xFVFg)+bH1Q2j c-MSbVBp8(qcD76C1FdH8boFyt=akR{0BE5*3jhEB literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence_down.png b/src/client/resources/assets/textures/tile/stone_fence_down.png new file mode 100644 index 0000000000000000000000000000000000000000..7a0656aa2f32bc6ea9c88a2a86d0e329d8eb9eca GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|bUj@hLo9le z6C_wG8e3bB)^l@r|4+%bD|vC@zjHg^L(`Vdoaen#23ZWIyg;pCyw(LDJ_Q3cGI+ZB KxvXib~h|B r=;-V`D4=|j;mL*eqijdxB!D)&VvwwEd?IN8G?&5C)z4*}Q$iB}z8o&> literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence_up.png b/src/client/resources/assets/textures/tile/stone_fence_up.png new file mode 100644 index 0000000000000000000000000000000000000000..bf5760f941e882d71e06aef08b72558b0e6f6ccf GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|G(BA$Lo9le z6Am!y=;-{Dw<>w@f1z{xzvzgFKgXB$aZW#?A;G#hVFe?@i2}~s0cT&912r*ty85}S Ib4q9e04<~ug4l$YCWDgCiRvJFYUYv9YzS4!`$c zk`trP4wWsXE)Pt4d?zs;Vd~;lkYH;$#I&68#J^+dCj>Z{H^n;SSS_&758z?oTBEdS Te%1L{pq&h!u6{1-oD!MyKUyf8mHIr{oqwevkawoToH@ S@0tYE&EVJ!;>-QvHxF+am){r5-A!hHVwniXebeqf-apEcm zbImdKI;Vst0P%A=LjV8( literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/wood_fence_right.png b/src/client/resources/assets/textures/tile/wood_fence_right.png new file mode 100644 index 0000000000000000000000000000000000000000..afeecd1595fbf63670e2696dd9e95a182def13c2 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|+&oTPgQu&X%Q~loCIGm8ELi{m literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/wood_fence_top.png b/src/client/resources/assets/textures/tile/wood_fence_top.png new file mode 100644 index 0000000000000000000000000000000000000000..bef437c24bdb62f2ca080892dcba45566be5d5b2 GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|bUj@hLo9le zQw}g*`m6iD-8I7i1lB|qHYYwi_PFQ96~l){2_ijBfd*F?7`h&_vv5o-TLRR`;OXk; Jvd$@?2>{7mBVzyn literal 0 HcmV?d00001 diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 335f7e8c2..aa51e66b6 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -142,6 +142,32 @@ } } }, + "minicraft.advancements.recipes.wood_fence": { + "criteria": { + "has_plank": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "plank" + ] + } + ] + } + } + }, + "requirements": [ + [ + "has_plank" + ] + ], + "rewards": { + "recipes": { + "Wood Fence_1": ["plank_3"] + } + } + }, "minicraft.advancements.recipes.lantern": { "criteria": { "has_wood": { @@ -298,6 +324,32 @@ } } }, + "minicraft.advancements.recipes.stone_fence": { + "criteria": { + "has_stone_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "stone brick" + ] + } + ] + } + } + }, + "requirements": [ + [ + "has_stone_brick" + ] + ], + "rewards": { + "recipes": { + "Stone Fence_1": ["Stone Brick_3"] + } + } + }, "minicraft.advancements.recipes.obsidian_brick": { "criteria": { "has_raw_obsidian": { @@ -402,6 +454,32 @@ } } }, + "minicraft.advancements.recipes.obsidian_fence": { + "criteria": { + "has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "obsidian brick" + ] + } + ] + } + } + }, + "requirements": [ + [ + "has_obsidian_brick" + ] + ], + "rewards": { + "recipes": { + "Obsidian Fence_1": ["Obsidian Brick_3"] + } + } + }, "minicraft.advancements.recipes.oven": { "criteria": { "has_stone": { From 783fd84db3cb5b64f358740249f4014d51dfe34e Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Sat, 30 Sep 2023 12:53:25 +0200 Subject: [PATCH 094/261] Update FenceTile.java --- .../java/minicraft/level/tile/FenceTile.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index 6897d1dc1..2fd0c3e0d 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -32,6 +32,8 @@ public class FenceTile extends Tile { protected SpriteAnimation top, bottom, left, right; + public boolean connectUp = false, connectDown = false, connectLeft = false, connectRight = false; + protected FenceTile(Material type) { this(type, null); } protected FenceTile(Material type, String name) { super(type.name() + " " + (name == null ? "Fence" : name), null); @@ -55,6 +57,14 @@ protected FenceTile(Material type, String name) { right = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_right"); } + public void updateConnections(Level level, int x, int y) + { + connectUp = level.getTile(x, y - 1).name.equals(name); + connectDown = level.getTile(x, y + 1).name.equals(name); + connectLeft = level.getTile(x - 1, y).name.equals(name); + connectRight = level.getTile(x + 1, y).name.equals(name); + } + public boolean mayPass(Level level, int x, int y, Entity e) { return false; } @@ -70,20 +80,22 @@ public void render(Screen screen, Level level, int x, int y) sprite.render(screen, level, x, y); + updateConnections(level, x, y); + // up - if (level.getTile(x, y - 1).name.equals(name)) { + if (connectUp) { top.render(screen, level, x, y); } // bottom - if (level.getTile(x, y + 1).name.equals(name)) { + if (connectDown) { bottom.render(screen, level, x, y); } // left - if (level.getTile(x - 1, y).name.equals(name)) { + if (connectLeft) { left.render(screen, level, x, y); } // right - if (level.getTile(x + 1, y).name.equals(name)) { + if (connectRight) { right.render(screen, level, x, y); } } From acab5ec62320dbcb031fb29e04c0045c7928736b Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:38:29 +0200 Subject: [PATCH 095/261] Update en-us.json --- src/client/resources/assets/localization/en-us.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 5104b46ff..bd4ab0adc 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -467,5 +467,8 @@ "Infinite Fall": "Infinite Fall", "Cloud Cactus": "Cloud Cactus", "Raw Obsidian": "Raw Obsidian", - "Totem of Air": "Totem of Air" + "Totem of Air": "Totem of Air", + "Wood Fence": "Wood Fence", + "Stone Fence": "Stone Fence", + "Obsidian Fence": "Obsidian Fence" } From 9d364243e9f928e005f018b2dbbb880ca5d5c520 Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Sat, 30 Sep 2023 15:42:14 +0200 Subject: [PATCH 096/261] Update fence textures --- .../textures/tile/obsidian_fence_bottom.png | Bin 126 -> 159 bytes .../assets/textures/tile/obsidian_fence_up.png | Bin 115 -> 115 bytes .../assets/textures/tile/stone_fence_down.png | Bin 115 -> 138 bytes .../assets/textures/tile/stone_fence_up.png | Bin 111 -> 111 bytes .../assets/textures/tile/wood_fence_bottom.png | Bin 120 -> 145 bytes .../assets/textures/tile/wood_fence_top.png | Bin 115 -> 115 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png b/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png index cd2535b51adcfaa0098f1a70d0367b1cb987507e..1c98de36ac6208af4fd2f8703dcfd51e3d0da881 100644 GIT binary patch delta 116 zcmb=M&p5#_FVfS+F~p)bIYEN8qOotq=X%+|=l_3PF?e+O%n_ZF2Y}$i`}f6d+Uvh3 zg`RFYUt(#-#|8v#?Dq>-Cmu>ausGiSgQu`rgM>pgb3$SR{{!A53kBJj=kqa0eG9!&5yeI4^O?`+jHZJ;X|VYk)EbNgDVUS^~&rl58qa%G5~?6 LtDnm{r-UW|%*+=j delta 56 zcmXRep5S1tU7%%T00cHa>gGQ@^?Gm5jVp!^jS@t9ngR{3Ffi0#W@o8hZp+O81fH&b JF6*2UngESz6;S{H diff --git a/src/client/resources/assets/textures/tile/stone_fence_down.png b/src/client/resources/assets/textures/tile/stone_fence_down.png index 7a0656aa2f32bc6ea9c88a2a86d0e329d8eb9eca..5091f520ee83a06b175cb4d25b2067786bfbaf9e 100644 GIT binary patch delta 95 zcmXT!Vw_+Y>Eh|)7-G?zoFKtk(b(F0w4R&0`+rKdUCE0J|DD_U9-6kW&R3kS7ps&Z yC~W6xYioOoM}h6aHHM@^4EYLty#^9LN*EYC`@|fLx9*c>00K`}KbLh*2~7Zwd?5`0 delta 72 zcmeBTES_NKr0eP87-G?zoFKtk(b(F0w4R&0`+rKdUCE0J|DD_U9-6jv<~;9}GRR^u bX>FVdQ&MBb@0D!U( A&;S4c diff --git a/src/client/resources/assets/textures/tile/wood_fence_top.png b/src/client/resources/assets/textures/tile/wood_fence_top.png index bef437c24bdb62f2ca080892dcba45566be5d5b2..4f9b0dbdec253f1156574de607074a1ff304d6a9 100644 GIT binary patch delta 52 zcmXRep5US%v-eZm!&g(yd5q2F(vK|bzmvv4F FO#nT16a)YO From b7d02b9f3559b313ff8ac44e83b30b99e5bd96a3 Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Sun, 1 Oct 2023 14:31:18 +0200 Subject: [PATCH 097/261] fixed fence textures stone and obsidian textures were broken + updated wood fence textures --- .../assets/textures/tile/obsidian_fence.png | Bin 174 -> 193 bytes .../textures/tile/obsidian_fence_left.png | Bin 191 -> 180 bytes .../textures/tile/obsidian_fence_right.png | Bin 156 -> 161 bytes ...dian_fence_up.png => obsidian_fence_top.png} | Bin ...ne_fence_down.png => stone_fence_bottom.png} | Bin .../{stone_fence_up.png => stone_fence_top.png} | Bin .../assets/textures/tile/wood_fence.png | Bin 174 -> 229 bytes .../assets/textures/tile/wood_fence_bottom.png | Bin 145 -> 212 bytes .../assets/textures/tile/wood_fence_left.png | Bin 179 -> 194 bytes .../assets/textures/tile/wood_fence_right.png | Bin 140 -> 193 bytes .../assets/textures/tile/wood_fence_top.png | Bin 115 -> 159 bytes 11 files changed, 0 insertions(+), 0 deletions(-) rename src/client/resources/assets/textures/tile/{obsidian_fence_up.png => obsidian_fence_top.png} (100%) rename src/client/resources/assets/textures/tile/{stone_fence_down.png => stone_fence_bottom.png} (100%) rename src/client/resources/assets/textures/tile/{stone_fence_up.png => stone_fence_top.png} (100%) diff --git a/src/client/resources/assets/textures/tile/obsidian_fence.png b/src/client/resources/assets/textures/tile/obsidian_fence.png index 78b431ef7c4e96235af8fce660be44a6e035fcb5..7266237126e6eea8c654f229394c3fd9d3b6c80e 100644 GIT binary patch delta 152 zcmV;J0B8TM0l@)~F@JkWL_t(IjbmUKXuya~&_^zX;lcO&|B=NmzuLpd$cU+&1)Bj6 zzTf}P#4L#-rYq+1ADe|(4PankV31?uKrB{_kZG1z5TZipE%L6at`ZkMv#c8 zg{a|?4UrvJ8Q9p^+T8coJ(%Rg=(9uR$qkDKCOy8B7>_V@@hV8LwH#tv&UoVAvGfxH k9L$?y9dfJ|Sm+1vFtD{LTx#+Uz0Lpxp00i_>zopr09QITkN^Mx diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_left.png b/src/client/resources/assets/textures/tile/obsidian_fence_left.png index a5d8a4037e15e8a3ba46639aa8193349d131c2f9..03b15107ef07bc3c2f4fe458d0461b710cee282a 100644 GIT binary patch delta 139 zcmdnbxP@_oVSS#bi(`mIZ*qbJYme2UbN?^0uHSR-w8t7o9iKCkc#3jlc>3%9Dx7B3 z0Wm?qU{+&e<3k}$Hk%)H^L1uFWYZ|nO8W7gt5fd)hYK4U+au<{#$Z9`2`b_W?RJ(M o4}N<8zS!dV!SYF8_{13)zopr0NZmkSpWb4 delta 150 zcmV;H0BQfU0lxu|F@JeUL_t(IjbmUK1&lhP&i~N`ue{#NNUQ-Y3Y>}zkAD4NkYnRO z7(jvxSRVcQ!N9=4zyPC31uXymJ|{~f3^4xxj}Zh6jEqDF0RxM!m_xmUU55806prHr=on{)R!w>HySpWb407*qoM6N<$ Ef~=@L9RL6T diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_right.png b/src/client/resources/assets/textures/tile/obsidian_fence_right.png index 3b2e025a9d5b8cd3143d204322ef19b40f5371d1..eca4910d0a0ac957df6c407d4bf6b77ca43812ab 100644 GIT binary patch delta 119 zcmV--0Eqvb0igkqF>qT+L_t(IjbmUK1&pL9))967k1obSiUCZ_k_>We91M?s{UFZ( zIW`Uynq&hWe7}z&Mv?&voQfD>Myd-a3q%D@MGP^L3_uQjSZt7Fz`wuG;p_+BNzpl| Z0RRj17O0~^EeZet002ovPDHLkV1fy!Dpddg delta 114 zcmV-&0FD2l0h|GlF>6*yL_t(IjbmUK1&pL9))967k1obSiUA6oiVTl_{a}z|;~>v~ zN56ic&?Fo1@9%RAF_OaI|9^}ipmQKHF-u~Ikz@dJ=)+=zBm*9NzmLWzMfacu0EnR( U%4?!JWdHyG07*qoM6N<$g6Z-v&Hw-a diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_up.png b/src/client/resources/assets/textures/tile/obsidian_fence_top.png similarity index 100% rename from src/client/resources/assets/textures/tile/obsidian_fence_up.png rename to src/client/resources/assets/textures/tile/obsidian_fence_top.png diff --git a/src/client/resources/assets/textures/tile/stone_fence_down.png b/src/client/resources/assets/textures/tile/stone_fence_bottom.png similarity index 100% rename from src/client/resources/assets/textures/tile/stone_fence_down.png rename to src/client/resources/assets/textures/tile/stone_fence_bottom.png diff --git a/src/client/resources/assets/textures/tile/stone_fence_up.png b/src/client/resources/assets/textures/tile/stone_fence_top.png similarity index 100% rename from src/client/resources/assets/textures/tile/stone_fence_up.png rename to src/client/resources/assets/textures/tile/stone_fence_top.png diff --git a/src/client/resources/assets/textures/tile/wood_fence.png b/src/client/resources/assets/textures/tile/wood_fence.png index e0fdeb6bc3d7c17e4a0078fd9ed88930584f0ca3..e714c6788a4725258ca3e25f5b7d54315b69e1fb 100644 GIT binary patch delta 201 zcmZ3-_>^&iN~-K3$OlR&&d%B!2;OQb$4nuFf3k0001JNkllD>0mK4| z4Imf>gu()+0m%NwXUGr;1F~H}Y&xJgFHj5s3alcspL)+-01E&B07*qoM6N<$f(BYR A^#A|> diff --git a/src/client/resources/assets/textures/tile/wood_fence_bottom.png b/src/client/resources/assets/textures/tile/wood_fence_bottom.png index 9aa448053077348ee416ad6d3ad235abd5132e93..eb91e92cd123db3bd9273d46585f02cbc93a913d 100644 GIT binary patch delta 184 zcmbQpc!hC-NoV^a!y|W;sXZ`G#D=_+||(7*!b|(RP!H8KJEsw z9i!b_jF>wZx0p7}FgPIH@xdU%a~U^~@7>A6Q)1}F&hVgFbb1$$i5SpgzSIcMG+$o^ YEg+i%h(X{|@MI9>>FVdQ&MBb@03?w?&Hw-a delta 116 zcmV-)0E_?B0g(ZaBy9n6Qb$4nuFf3k0000>Nkl zXp;H$ delta 151 zcmV;I0BHZh0kZ*+B!2;OQb$4nuFf3k0001ONkl!{+9pI1!rzN&Pc2Q zEMXBE3|FtbVbInQK{kMB7qDEt@`izdfq?-=lL}bK)d&NO|NmnI0Rtl=(Lun#k`Z8q zX#xWS@qvgOcyO?hXa}GgfF2t}8L(=_4HN-N19b=j070%F{Sa+j><<6{002ovPDHLk FV1hXmH-G>D diff --git a/src/client/resources/assets/textures/tile/wood_fence_right.png b/src/client/resources/assets/textures/tile/wood_fence_right.png index afeecd1595fbf63670e2696dd9e95a182def13c2..ae919603751b702670bae687da49c0503a8fba35 100644 GIT binary patch delta 165 zcmeBSJjggfrJl3EBeIx*fm;}a85w5Hkzin8i1c)E46*1<{`3F8J+o>(QOjr ziG}>#yj^=8CNbVPaNs#BLw313o8jT6NkB{ZQX@RmmdK II;Vst0B^T93;+NC delta 111 zcmV-#0FeK|0gM5VBxnJ1Qb$4nuFf3k0000+NklgTe~DWM4fHD@U< delta 85 zcmV-b0IL6=0dtTfPXTjMM?wIu&K&6g001pXL_t(IjbmiM0n+^~|A$3rFkHRzhT-a! rHw-g39%sa+jtQ3mqhJ(_f}sWgQ|k%@lb+p500000NkvXXu0mjfYQG== From 06bdf42229abe5014e7b566b2edc5963f9726d87 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 9 Oct 2023 04:23:57 +0800 Subject: [PATCH 098/261] Fix mobs spawning --- src/client/java/minicraft/entity/mob/Mob.java | 4 ++-- src/client/java/minicraft/entity/mob/MobAi.java | 5 ++++- src/client/java/minicraft/level/Level.java | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/Mob.java b/src/client/java/minicraft/entity/mob/Mob.java index f0bc64aeb..5484c6c15 100644 --- a/src/client/java/minicraft/entity/mob/Mob.java +++ b/src/client/java/minicraft/entity/mob/Mob.java @@ -129,12 +129,12 @@ private boolean move(int xd, int yd, boolean changeDir) { // Knockback shouldn't /** The mob immediately despawns if the distance of the closest player is greater than the return value of this. */ protected int getDespawnDistance() { - return 80; + return 1280; } /** The mob randomly despawns if the distance of the closest player is greater than the return value of this. */ protected int getNoDespawnDistance() { - return 40; + return 640; } /** @see #handleDespawn() */ diff --git a/src/client/java/minicraft/entity/mob/MobAi.java b/src/client/java/minicraft/entity/mob/MobAi.java index 8195e9171..d5508b35a 100644 --- a/src/client/java/minicraft/entity/mob/MobAi.java +++ b/src/client/java/minicraft/entity/mob/MobAi.java @@ -66,7 +66,10 @@ public void handleDespawn() { */ protected boolean isWithinLight() { return Arrays.stream(level.getEntityArray()).anyMatch(e -> e instanceof Lantern && isWithin(e.getLightRadius(), e)) - || !level.getMatchingTiles((tile, x, y) -> Math.hypot(Math.abs(this.x - x), Math.abs(this.y - y)) <= tile.getLightRadius(level, x, y)).isEmpty(); + || !level.getMatchingTiles((tile, x, y) -> { + int xx = Math.abs(this.x - x), yy = Math.abs(this.y - y), l = tile.getLightRadius(level, x, y); + return xx * xx + yy * yy <= l * l; + }).isEmpty(); } /** diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 716e62a87..417ced6f0 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -571,12 +571,13 @@ private void trySpawn() { boolean spawned = false; for (Player player : players) { + assert player.getLevel().depth == depth; int lvl = World.lvlIdx(player.getLevel().depth); for (int i = 0; i < 30 && !spawned; i++) { int rnd = random.nextInt(100); int nx = random.nextInt(w) * 16 + 8, ny = random.nextInt(h) * 16 + 8; double distance = Math.hypot(Math.abs(nx - player.x), Math.abs(ny - player.y)); - if (distance < 10 || distance > 40) continue; // Spawns only between 10 and 40 tiles far from players. + if (distance < 160) continue; // Spawns only far from 10 tiles away. //System.out.println("trySpawn on level " + depth + " of lvl " + lvl + " mob w/ rand " + rnd + " at tile " + nx + "," + ny); From 364c2836b06992f97d50a2b2ff3149b3e7b730e7 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:07:18 +0800 Subject: [PATCH 099/261] Add recipe advancement adder to Recipes.java --- src/client/java/minicraft/item/Recipes.java | 343 +- src/client/resources/resources/recipes.json | 3149 +++++++++++-------- 2 files changed, 2098 insertions(+), 1394 deletions(-) diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 725406d9a..6a9b2afdf 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -1,6 +1,40 @@ package minicraft.item; +import minicraft.entity.furniture.Bed; +import minicraft.saveload.Save; +import org.json.JSONArray; +import org.json.JSONObject; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.Spring; +import javax.swing.SpringLayout; +import javax.swing.UIManager; +import javax.swing.border.EmptyBorder; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.function.Function; public class Recipes { @@ -132,7 +166,312 @@ public class Recipes { enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); - enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5","Cloud Ore_5")); - enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5","Shard_15")); + enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); + enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); + } + + /** + * This regenerates the recipes.json at once by the recipes above. + * Remind that it is recommended to use String Manipulation plugin to resort (JSON Sort) the file if using IntelliJ IDEA. + */ + public static void main(String[] args) { + HashSet recipes = new HashSet<>(); + recipes.addAll(anvilRecipes); + recipes.addAll(ovenRecipes); + recipes.addAll(furnaceRecipes); + recipes.addAll(workbenchRecipes); + recipes.addAll(enchantRecipes); + recipes.addAll(craftRecipes); + recipes.addAll(loomRecipes); + HashMap recipeMap = new HashMap<>(); + HashMap> duplicatedRecipes = new HashMap<>(); + Function itemNameFixer = item -> { + String name = item.getName(); + return (name.equalsIgnoreCase("gold apple") ? name.replaceAll("(?i)gold", "golden") : + item instanceof ToolItem ? name.replaceAll("(?i)wood", "wooden").replaceAll("(?i)rock", "stone") : name) + .toLowerCase().replace(' ', '_'); + }; + Function recipeNameFixer = recipe -> { // This is applied when duplication occurs. + Item item = recipe.getProduct(); + String name = itemNameFixer.apply(item); + /*if (item instanceof DyeItem) { TODO + Map costs = recipe.getCosts(); + if (costs.size() == 2 && costs.containsKey("WHITE DYE")) + return name + "_from_white_dye"; + return name; + } else*/ if (item instanceof FurnitureItem && ((FurnitureItem) item).furniture instanceof Bed) { + if (recipe.getCosts().containsKey("WHITE BED")) + return name + "_from_white_bed"; + return name; + } + return name; + }; + for (Recipe recipe : recipes) { + if (recipes.stream().anyMatch(r -> r != recipe && r.getProduct().equals(recipe.getProduct()))) { + if (recipes.stream().anyMatch(r -> r != recipe && recipeNameFixer.apply(r).equals(recipeNameFixer.apply(recipe)))) { + duplicatedRecipes.compute(recipeNameFixer.apply(recipe), (k, v) -> { + if (v == null) return new HashSet<>(Collections.singletonList(recipe)); + else { + v.add(recipe); + return v; + } + }); + } else { + recipeMap.put(recipeNameFixer.apply(recipe), recipe); + } + } else { + recipeMap.put(itemNameFixer.apply(recipe.getProduct()), recipe); + } + } + for (String key : duplicatedRecipes.keySet()) { + HashSet duplications = duplicatedRecipes.get(key); + HashMap inputs = new HashMap<>(); + JDialog dialog = new JDialog((Frame) null, "Recipe Duplication: " + key); + dialog.setLayout(new BorderLayout()); + dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); + dialog.addWindowListener(new WindowListener() { + @Override + public void windowOpened(WindowEvent e) {} + @Override + public void windowClosing(WindowEvent e) { + dialog.setVisible(false); + JOptionPane.showMessageDialog(null, "Exit Program"); + dialog.dispose(); + System.exit(0); + } + @Override + public void windowClosed(WindowEvent e) {} + @Override + public void windowIconified(WindowEvent e) {} + @Override + public void windowDeiconified(WindowEvent e) {} + @Override + public void windowActivated(WindowEvent e) {} + @Override + public void windowDeactivated(WindowEvent e) {} + }); + + JPanel inputPanel = new JPanel(new SpringLayout()); + inputPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + for (Recipe recipe : duplications) { + JLabel l = new JLabel(recipe.toString(), JLabel.TRAILING); + inputPanel.add(l); + JTextField textField = new JTextField(key, 20); + l.setLabelFor(textField); + inputPanel.add(textField); + inputs.put(recipe, textField); + } + + makeCompactGrid(inputPanel, + duplications.size(), 2, //rows, cols + 6, 6, //initX, initY + 6, 6); //xPad, yPad + + JPanel buttonPane = new JPanel(); + buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS)); + buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + buttonPane.add(Box.createHorizontalGlue()); + JButton doneButton = new JButton("Done"); + doneButton.addActionListener(e -> { + inputs.forEach((recipe, text) -> recipeMap.put(text.getText(), recipe)); + dialog.setVisible(false); + dialog.dispose(); + }); + doneButton.setDefaultCapable(true); + buttonPane.add(doneButton); + buttonPane.add(Box.createHorizontalGlue()); + + class JMultilineLabel extends JTextArea { // Reference: https://stackoverflow.com/a/11034405 + private static final long serialVersionUID = 1L; + public JMultilineLabel(String text){ + super(text); // According to Mr. Polywhirl, this might improve it -> text + System.lineSeparator() + setEditable(false); + setCursor(null); + setOpaque(false); + setFocusable(false); + setFont(UIManager.getFont("Label.font")); + setWrapStyleWord(true); + setLineWrap(true); + //According to Mariana this might improve it + setBorder(new EmptyBorder(5, 5, 5, 5)); + setAlignmentY(JLabel.CENTER_ALIGNMENT); + } + } + + Container dialogPane = dialog.getContentPane(); + dialogPane.add(new JMultilineLabel("Recipes:\n" + + String.join("\n", duplicatedRecipes.get(key).stream().map(Recipe::toString)::iterator)), + BorderLayout.NORTH); + dialogPane.add(inputPanel, BorderLayout.CENTER); + dialogPane.add(buttonPane, BorderLayout.SOUTH); + dialog.pack(); + dialog.setLocationRelativeTo(null); + dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); + dialog.setVisible(true); + } + + JSONObject json = new JSONObject(); + for (String key : recipeMap.keySet()) { + Recipe recipe = recipeMap.get(key); + JSONObject recipeUnlockingJson = new JSONObject(); + + ArrayList costs = new ArrayList<>(); + JSONObject criteriaJson = new JSONObject(); + Map costMap = recipe.getCosts(); + for (String itemKey : costMap.keySet()) { + Item item = Items.get(itemKey); + JSONObject criterionJson = new JSONObject(); + + criterionJson.put("trigger", "inventory_changed"); + + JSONObject conditionsJson = new JSONObject(); + JSONArray itemConditionsJsonArray = new JSONArray(); + JSONObject itemConditionsJson = new JSONObject(); + JSONArray itemsJson = new JSONArray(); + itemsJson.put(item.getName()); + itemConditionsJson.put("items", itemsJson); + itemConditionsJsonArray.put(itemConditionsJson); + conditionsJson.put("items", itemConditionsJsonArray); + criterionJson.put("conditions", conditionsJson); + criteriaJson.put("has_" + itemNameFixer.apply(item), criterionJson); + + costs.add(item.getName() + "_" + costMap.get(itemKey)); + } + recipeUnlockingJson.put("criteria", criteriaJson); + + JSONArray requirementsJson = new JSONArray(); + JSONArray criterionNamesJson = new JSONArray(); + criterionNamesJson.putAll(criteriaJson.keySet()); + requirementsJson.put(criterionNamesJson); + recipeUnlockingJson.put("requirements", requirementsJson); + + JSONObject rewardsJson = new JSONObject(); + JSONObject recipesJson = new JSONObject(); + JSONArray costsJson = new JSONArray(); + costsJson.putAll(costs); + recipesJson.put(recipe.getProduct().getName() + "_" + recipe.getAmount(), costsJson); + rewardsJson.put("recipes", recipesJson); + recipeUnlockingJson.put("rewards", rewardsJson); + + json.put("minicraft.advancements.recipes." + key, recipeUnlockingJson); + } + + try { + Save.writeJSONToFile(new File(System.getProperty("user.dir"), "src/client/resources/resources/recipes.json").toString(), + json.toString(2)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /* Used by makeCompactGrid. */ + private static SpringLayout.Constraints getConstraintsForCell( + int row, int col, + Container parent, + int cols) { + SpringLayout layout = (SpringLayout) parent.getLayout(); + Component c = parent.getComponent(row * cols + col); + return layout.getConstraints(c); + } + + /* + * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle or the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /** + * Aligns the first rows * cols + * components of parent in + * a grid. Each component in a column is as wide as the maximum + * preferred width of the components in that column; + * height is similarly determined for each row. + * The parent is made just big enough to fit them all. + * + * @param rows number of rows + * @param cols number of columns + * @param initialX x location to start the grid at + * @param initialY y location to start the grid at + * @param xPad x padding between cells + * @param yPad y padding between cells + */ + @SuppressWarnings("SameParameterValue") + private static void makeCompactGrid(Container parent, + int rows, int cols, + int initialX, int initialY, + int xPad, int yPad) { + SpringLayout layout; + try { + layout = (SpringLayout)parent.getLayout(); + } catch (ClassCastException exc) { + System.err.println("The first argument to makeCompactGrid must use SpringLayout."); + return; + } + + //Align all cells in each column and make them the same width. + Spring x = Spring.constant(initialX); + for (int c = 0; c < cols; c++) { + Spring width = Spring.constant(0); + for (int r = 0; r < rows; r++) { + width = Spring.max(width, + getConstraintsForCell(r, c, parent, cols). + getWidth()); + } + for (int r = 0; r < rows; r++) { + SpringLayout.Constraints constraints = + getConstraintsForCell(r, c, parent, cols); + constraints.setX(x); + constraints.setWidth(width); + } + x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad))); + } + + //Align all cells in each row and make them the same height. + Spring y = Spring.constant(initialY); + for (int r = 0; r < rows; r++) { + Spring height = Spring.constant(0); + for (int c = 0; c < cols; c++) { + height = Spring.max(height, + getConstraintsForCell(r, c, parent, cols). + getHeight()); + } + for (int c = 0; c < cols; c++) { + SpringLayout.Constraints constraints = + getConstraintsForCell(r, c, parent, cols); + constraints.setY(y); + constraints.setHeight(height); + } + y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad))); + } + + //Set the parent's size. + SpringLayout.Constraints pCons = layout.getConstraints(parent); + pCons.setConstraint(SpringLayout.SOUTH, y); + pCons.setConstraint(SpringLayout.EAST, x); } } diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 335f7e8c2..995a0266a 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -1,475 +1,593 @@ { - "minicraft.advancements.recipes.workbench": { + "minicraft.advancements.recipes.anvil": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "wood" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood" + "has_iron" ] ], "rewards": { "recipes": { - "Workbench_1": ["Wood_10"] + "Anvil_1": [ + "Iron_5" + ] } } }, - "minicraft.advancements.recipes.torch": { + "minicraft.advancements.recipes.arrow": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "wood" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "coal" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_coal" + "has_stone", + "has_wood" ] ], "rewards": { "recipes": { - "Torch_2": ["Wood_1", "coal_1"] + "arrow_3": [ + "Stone_2", + "Wood_2" + ] } } }, - "minicraft.advancements.recipes.plank": { + "minicraft.advancements.recipes.awkward_potion": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_glass_bottle": { "conditions": { "items": [ { "items": [ - "wood" + "Glass Bottle" ] } ] - } - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "plank_2": ["Wood_1"] - } - } - }, - "minicraft.advancements.recipes.plank_wall": { - "criteria": { - "has_plank": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + }, + "has_lapis": { "conditions": { "items": [ { "items": [ - "plank" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_plank" + "has_lapis", + "has_glass_bottle" ] ], "rewards": { "recipes": { - "Plank Wall_1": ["plank_3"] + "Awkward Potion_1": [ + "Lapis_3", + "Glass Bottle_1" + ] } } }, - "minicraft.advancements.recipes.wood_door": { + "minicraft.advancements.recipes.baked_potato": { "criteria": { - "has_plank": { - "trigger": "inventory_changed", + "has_potato": { "conditions": { "items": [ { "items": [ - "plank" + "Potato" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_plank" + "has_potato" ] ], "rewards": { "recipes": { - "Wood Door_1": ["plank_5"] + "Baked Potato_1": [ + "Potato_1" + ] } } }, - "minicraft.advancements.recipes.lantern": { + "minicraft.advancements.recipes.bed": { "criteria": { "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_slime": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "slime" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_glass": { - "trigger": "inventory_changed", + "has_wool": { "conditions": { "items": [ { "items": [ - "glass" + "Wool" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ "has_wood", - "has_slime", - "has_glass" + "has_wool" ] ], "rewards": { "recipes": { - "Lantern_1": ["Wood_8", "slime_4", "glass_3"] + "Bed_1": [ + "Wood_5", + "Wool_3" + ] } } }, - "minicraft.advancements.recipes.stone_brick": { + "minicraft.advancements.recipes.black_clothes": { "criteria": { - "has_stone": { - "trigger": "inventory_changed", + "has_cloth": { "conditions": { "items": [ { "items": [ - "stone" + "cloth" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_coal": { + "conditions": { + "items": [ + { + "items": [ + "Coal" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_stone" + "has_coal", + "has_cloth" ] ], "rewards": { "recipes": { - "Stone Brick_1": ["Stone_2"] + "Black Clothes_1": [ + "Coal_1", + "cloth_5" + ] } } }, - "minicraft.advancements.recipes.ornate_stone": { + "minicraft.advancements.recipes.black_wool": { "criteria": { - "has_stone": { - "trigger": "inventory_changed", + "has_coal": { "conditions": { "items": [ { "items": [ - "stone" + "Coal" ] } ] - } + }, + "trigger": "inventory_changed" + }, + "has_wool": { + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_stone" + "has_coal", + "has_wool" ] ], "rewards": { "recipes": { - "Stone Brick_1": ["Stone_2"] + "Black Wool_1": [ + "Coal_1", + "Wool_1" + ] } } }, - "minicraft.advancements.recipes.stone_wall": { + "minicraft.advancements.recipes.blue_clothes": { "criteria": { - "has_stone_brick": { - "trigger": "inventory_changed", + "has_cloth": { + "conditions": { + "items": [ + { + "items": [ + "cloth" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_lapis": { "conditions": { "items": [ { "items": [ - "stone brick" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_stone_brick" + "has_lapis", + "has_cloth" ] ], "rewards": { "recipes": { - "Stone Wall_1": ["Stone Brick_3"] + "Blue Clothes_1": [ + "Lapis_1", + "cloth_5" + ] } } }, - "minicraft.advancements.recipes.stone_door": { + "minicraft.advancements.recipes.blue_wool": { "criteria": { - "has_stone_brick": { - "trigger": "inventory_changed", + "has_lapis": { "conditions": { "items": [ { "items": [ - "stone brick" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" + }, + "has_wool": { + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_stone_brick" + "has_lapis", + "has_wool" ] ], "rewards": { "recipes": { - "Stone Door_1": ["Stone Brick_5"] + "Blue Wool_1": [ + "Lapis_1", + "Wool_1" + ] } } }, - "minicraft.advancements.recipes.obsidian_brick": { + "minicraft.advancements.recipes.bread": { "criteria": { - "has_raw_obsidian": { - "trigger": "inventory_changed", + "has_wheat": { "conditions": { "items": [ { "items": [ - "raw obsidian" + "Wheat" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_raw_obsidian" + "has_wheat" ] ], "rewards": { "recipes": { - "Obsidian Brick_1": ["Raw Obsidian_2"] + "Bread_1": [ + "Wheat_4" + ] } } }, - "minicraft.advancements.recipes.ornate_obsidian": { + "minicraft.advancements.recipes.chest": { "criteria": { - "has_raw_obsidian": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "raw obsidian" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_raw_obsidian" + "has_wood" ] ], "rewards": { "recipes": { - "Ornate Obsidian_1": ["Raw Obsidian_2"] + "Chest_1": [ + "Wood_20" + ] } } }, - "minicraft.advancements.recipes.obsidian_wall": { + "minicraft.advancements.recipes.cooked_fish": { "criteria": { - "has_obsidian_brick": { - "trigger": "inventory_changed", + "has_coal": { + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_raw_fish": { "conditions": { "items": [ { "items": [ - "obsidian brick" + "Raw Fish" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_obsidian_brick" + "has_coal", + "has_raw_fish" ] ], "rewards": { "recipes": { - "Obsidian Wall_1": ["Obsidian Brick_3"] + "Cooked Fish_1": [ + "Coal_1", + "Raw Fish_1" + ] } } }, - "minicraft.advancements.recipes.obsidian_door": { + "minicraft.advancements.recipes.cooked_pork": { "criteria": { - "has_obsidian_brick": { - "trigger": "inventory_changed", + "has_coal": { + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_raw_pork": { "conditions": { "items": [ { "items": [ - "obsidian brick" + "Raw Pork" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_obsidian_brick" + "has_coal", + "has_raw_pork" ] ], "rewards": { "recipes": { - "Obsidian Door_1": ["Obsidian Brick_5"] + "Cooked Pork_1": [ + "Coal_1", + "Raw Pork_1" + ] } } }, - "minicraft.advancements.recipes.oven": { + "minicraft.advancements.recipes.cyan_clothes": { "criteria": { - "has_stone": { - "trigger": "inventory_changed", + "has_cactus": { + "conditions": { + "items": [ + { + "items": [ + "Cactus" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_cloth": { + "conditions": { + "items": [ + { + "items": [ + "cloth" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_lapis": { "conditions": { "items": [ { "items": [ - "stone" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_stone" + "has_cactus", + "has_lapis", + "has_cloth" ] ], "rewards": { "recipes": { - "Oven_1": ["Stone_15"] + "Cyan Clothes_1": [ + "Lapis_1", + "cloth_5", + "Cactus_1" + ] } } }, - "minicraft.advancements.recipes.furnace": { + "minicraft.advancements.recipes.empty_bucket": { "criteria": { - "has_stone": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "stone" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_stone" + "has_iron" ] ], "rewards": { "recipes": { - "Furnace_1": ["Stone_20"] + "Empty Bucket_1": [ + "Iron_5" + ] } } }, "minicraft.advancements.recipes.enchanter": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_lapis": { "conditions": { "items": [ { "items": [ - "wood" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" }, "has_string": { - "trigger": "inventory_changed", "conditions": { "items": [ { @@ -478,19 +596,20 @@ ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_lapis": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "lapis" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ @@ -502,195 +621,225 @@ ], "rewards": { "recipes": { - "Enchanter_1": ["Wood_5", "String_2", "Lapis_10"] + "Enchanter_1": [ + "Lapis_10", + "string_2", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.chest": { + "minicraft.advancements.recipes.energy_potion": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "wood" + "Awkward Potion" ] } ] - } - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Chest_1": ["Wood_20"] - } - } - }, - "minicraft.advancements.recipes.anvil": { - "criteria": { - "has_iron": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + }, + "has_gem": { "conditions": { "items": [ { "items": [ - "iron" + "gem" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_iron" + "has_gem", + "has_awkward_potion" ] ], "rewards": { "recipes": { - "Anvil_1": ["iron_5"] + "Energy Potion_1": [ + "Awkward Potion_1", + "gem_25" + ] } } }, - "minicraft.advancements.recipes.tnt": { + "minicraft.advancements.recipes.escape_potion": { "criteria": { + "has_awkward_potion": { + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + }, + "trigger": "inventory_changed" + }, "has_gunpowder": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "gunpowder" + "Gunpowder" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_sand": { - "trigger": "inventory_changed", + "has_lapis": { "conditions": { "items": [ { "items": [ - "sand" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ + "has_lapis", "has_gunpowder", - "has_sand" + "has_awkward_potion" ] ], "rewards": { "recipes": { - "Tnt_1": ["Gunpowder_10", "Sand_8"] + "Escape Potion_1": [ + "Lapis_7", + "Awkward Potion_1", + "Gunpowder_3" + ] } } }, - "minicraft.advancements.recipes.loom": { + "minicraft.advancements.recipes.furnace": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_wool": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "wool" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_wool" + "has_stone" ] ], "rewards": { "recipes": { - "Loom_1": ["Wood_10", "Wool_5"] + "Furnace_1": [ + "Stone_20" + ] } } }, - "minicraft.advancements.recipes.wood_fishing_rod": { + "minicraft.advancements.recipes.gem_armor": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gem": { "conditions": { "items": [ { "items": [ - "wood" + "gem" ] } ] - } + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_gem" + ] + ], + "rewards": { + "recipes": { + "Gem Armor_1": [ + "gem_65" + ] + } + } + }, + "minicraft.advancements.recipes.gem_axe": { + "criteria": { + "has_gem": { + "conditions": { + "items": [ + { + "items": [ + "gem" + ] + } + ] + }, + "trigger": "inventory_changed" }, - "has_string": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "string" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ "has_wood", - "has_string" + "has_gem" ] ], "rewards": { "recipes": { - "Wood Fishing Rod_1": ["Wood_10", "String_3"] + "Gem Axe_1": [ + "Wood_5", + "gem_50" + ] } } }, - "minicraft.advancements.recipes.iron_fishing_rod": { + "minicraft.advancements.recipes.gem_bow": { "criteria": { - "has_iron": { - "trigger": "inventory_changed", + "has_gem": { "conditions": { "items": [ { "items": [ - "iron" + "gem" ] } ] - } + }, + "trigger": "inventory_changed" }, "has_string": { - "trigger": "inventory_changed", "conditions": { "items": [ { @@ -699,64 +848,84 @@ ] } ] - } + }, + "trigger": "inventory_changed" + }, + "has_wood": { + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_iron", + "has_wood", + "has_gem", "has_string" ] ], "rewards": { "recipes": { - "Iron Fishing Rod_1": ["Iron_10", "String_3"] + "Gem Bow_1": [ + "string_2", + "Wood_5", + "gem_50" + ] } } }, - "minicraft.advancements.recipes.gold_fishing_rod": { + "minicraft.advancements.recipes.gem_claymore": { "criteria": { - "has_gold": { - "trigger": "inventory_changed", + "has_gem_sword": { "conditions": { "items": [ { "items": [ - "gold" + "Gem Sword" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_string": { - "trigger": "inventory_changed", + "has_shard": { "conditions": { "items": [ { "items": [ - "string" + "Shard" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_gold", - "has_string" + "has_shard", + "has_gem_sword" ] ], "rewards": { "recipes": { - "Gold Fishing Rod_1": ["Gold_10", "String_3"] + "Gem Claymore_1": [ + "Gem Sword_1", + "Shard_15" + ] } } }, "minicraft.advancements.recipes.gem_fishing_rod": { "criteria": { "has_gem": { - "trigger": "inventory_changed", "conditions": { "items": [ { @@ -765,10 +934,10 @@ ] } ] - } + }, + "trigger": "inventory_changed" }, "has_string": { - "trigger": "inventory_changed", "conditions": { "items": [ { @@ -777,7 +946,8 @@ ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ @@ -788,1348 +958,1382 @@ ], "rewards": { "recipes": { - "Gem Fishing Rod_1": ["Gem_10", "String_3"] + "Gem Fishing Rod_1": [ + "string_3", + "gem_10" + ] } } }, - "minicraft.advancements.recipes.wooden_sword": { + "minicraft.advancements.recipes.gem_hoe": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gem": { "conditions": { "items": [ { "items": [ - "wood" + "gem" ] } ] - } - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Wood Sword_1": ["Wood_5"] - } - } - }, - "minicraft.advancements.recipes.wooden_axe": { - "criteria": { + }, + "trigger": "inventory_changed" + }, "has_wood": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "wood" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood" + "has_wood", + "has_gem" ] ], "rewards": { "recipes": { - "Wood Axe_1": ["Wood_5"] + "Gem Hoe_1": [ + "Wood_5", + "gem_50" + ] } } }, - "minicraft.advancements.recipes.wooden_hoe": { + "minicraft.advancements.recipes.gem_pickaxe": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gem": { "conditions": { "items": [ { "items": [ - "wood" + "gem" ] } ] - } - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Wood Hoe_1": ["Wood_5"] - } - } - }, - "minicraft.advancements.recipes.wooden_pickaxe": { - "criteria": { + }, + "trigger": "inventory_changed" + }, "has_wood": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "wood" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood" + "has_wood", + "has_gem" ] ], "rewards": { "recipes": { - "Wood Pickaxe_1": ["Wood_5"] + "Gem Pickaxe_1": [ + "Wood_5", + "gem_50" + ] } } }, - "minicraft.advancements.recipes.wooden_shovel": { + "minicraft.advancements.recipes.gem_shovel": { "criteria": { + "has_gem": { + "conditions": { + "items": [ + { + "items": [ + "gem" + ] + } + ] + }, + "trigger": "inventory_changed" + }, "has_wood": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "wood" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood" + "has_wood", + "has_gem" ] ], "rewards": { "recipes": { - "Wood Shovel_1": ["Wood_5"] + "Gem Shovel_1": [ + "Wood_5", + "gem_50" + ] } } }, - "minicraft.advancements.recipes.wooden_bow": { + "minicraft.advancements.recipes.gem_sword": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gem": { "conditions": { "items": [ { "items": [ - "wood" + "gem" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_string": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "string" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ "has_wood", - "has_string" + "has_gem" ] ], "rewards": { "recipes": { - "Wood Bow_1": ["Wood_5", "string_2"] + "Gem Sword_1": [ + "Wood_5", + "gem_50" + ] } } }, - "minicraft.advancements.recipes.rock_sword": { + "minicraft.advancements.recipes.glass": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_coal": { "conditions": { "items": [ { "items": [ - "wood" + "Coal" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_stone": { - "trigger": "inventory_changed", + "has_sand": { "conditions": { "items": [ { "items": [ - "stone" + "Sand" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_stone" + "has_coal", + "has_sand" ] ], "rewards": { "recipes": { - "Rock Sword_1": ["Wood_5", "Stone_5"] + "glass_1": [ + "Coal_1", + "Sand_4" + ] } } }, - "minicraft.advancements.recipes.rock_axe": { + "minicraft.advancements.recipes.glass_bottle": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_stone": { - "trigger": "inventory_changed", + "has_glass": { "conditions": { "items": [ { "items": [ - "stone" + "glass" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_stone" + "has_glass" ] ], "rewards": { "recipes": { - "Rock Sword_1": ["Wood_5", "Stone_5"] + "Glass Bottle_1": [ + "glass_3" + ] } } }, - "minicraft.advancements.recipes.rock_hoe": { + "minicraft.advancements.recipes.gold": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_coal": { "conditions": { "items": [ { "items": [ - "wood" + "Coal" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_stone": { - "trigger": "inventory_changed", + "has_gold_ore": { "conditions": { "items": [ { "items": [ - "stone" + "Gold Ore" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_stone" + "has_coal", + "has_gold_ore" ] ], "rewards": { "recipes": { - "Rock Axe_1": ["Wood_5", "Stone_5"] + "Gold_1": [ + "Coal_1", + "Gold Ore_4" + ] } } }, - "minicraft.advancements.recipes.rock_pickaxe": { + "minicraft.advancements.recipes.gold_armor": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_stone": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "stone" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_stone" + "has_gold" ] ], "rewards": { "recipes": { - "Rock Pickaxe_1": ["Wood_5", "Stone_5"] + "Gold Armor_1": [ + "Gold_10" + ] } } }, - "minicraft.advancements.recipes.rock_shovel": { + "minicraft.advancements.recipes.gold_axe": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "wood" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_stone": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "stone" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ "has_wood", - "has_stone" + "has_gold" ] ], "rewards": { "recipes": { - "Rock Shovel_1": ["Wood_5", "Stone_5"] + "Gold Axe_1": [ + "Gold_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.rock_bow": { + "minicraft.advancements.recipes.gold_bow": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "wood" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_stone": { - "trigger": "inventory_changed", + "has_string": { "conditions": { "items": [ { "items": [ - "stone" + "string" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_string": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "string" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ "has_wood", - "has_stone", - "has_string" + "has_string", + "has_gold" ] ], "rewards": { "recipes": { - "Rock Bow_1": ["Wood_5", "Stone_5", "string_2"] + "Gold Bow_1": [ + "Gold_5", + "string_2", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.arrow": { + "minicraft.advancements.recipes.gold_claymore": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gold_sword": { "conditions": { "items": [ { "items": [ - "wood" + "Gold Sword" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_stone": { - "trigger": "inventory_changed", + "has_shard": { "conditions": { "items": [ { "items": [ - "stone" + "Shard" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_stone" + "has_shard", + "has_gold_sword" ] ], "rewards": { "recipes": { - "arrow_3": ["Wood_2", "Stone_2"] + "Gold Claymore_1": [ + "Shard_15", + "Gold Sword_1" + ] } } }, - "minicraft.advancements.recipes.leather_armor": { + "minicraft.advancements.recipes.gold_fishing_rod": { "criteria": { - "has_leather": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "leather" + "Gold" ] } ] - } - } - }, - "requirements": [ - [ - "has_leather" - ] - ], - "rewards": { - "recipes": { - "Leather Armor_1": ["leather_10"] - } - } - }, - "minicraft.advancements.recipes.snake_armor": { - "criteria": { - "has_scale": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + }, + "has_string": { "conditions": { "items": [ { "items": [ - "scale" + "string" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_scale" + "has_string", + "has_gold" ] ], "rewards": { "recipes": { - "Snake Armor_1": ["scale_15"] + "Gold Fishing Rod_1": [ + "Gold_10", + "string_3" + ] } } }, - "minicraft.advancements.recipes.string": { + "minicraft.advancements.recipes.gold_hoe": { "criteria": { - "has_wool": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "wool" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" + }, + "has_wood": { + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wool" + "has_wood", + "has_gold" ] ], "rewards": { "recipes": { - "String_2": ["Wool_1"] + "Gold Hoe_1": [ + "Gold_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.red_wool": { + "minicraft.advancements.recipes.gold_lantern": { "criteria": { - "has_wool": { - "trigger": "inventory_changed", + "has_glass": { "conditions": { "items": [ { "items": [ - "wool" + "glass" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_rose": { - "trigger": "inventory_changed", + "has_gold": { + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_slime": { "conditions": { "items": [ { "items": [ - "rose" + "Slime" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wool", - "has_rose" + "has_glass", + "has_gold", + "has_slime" ] ], "rewards": { "recipes": { - "red wool_1": ["Wool_1", "rose_1"] + "Gold Lantern_1": [ + "glass_4", + "Gold_10", + "Slime_5" + ] } } }, - "minicraft.advancements.recipes.blue_wool": { + "minicraft.advancements.recipes.gold_pickaxe": { "criteria": { - "has_wool": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "wool" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_lapis": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "lapis" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wool", - "has_lapis" + "has_wood", + "has_gold" ] ], "rewards": { "recipes": { - "blue wool_1": ["Wool_1", "Lapis_1"] + "Gold Pickaxe_1": [ + "Gold_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.green_wool": { + "minicraft.advancements.recipes.gold_shovel": { "criteria": { - "has_wool": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "wool" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_cactus": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "cactus" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wool", - "has_cactus" + "has_wood", + "has_gold" ] ], "rewards": { "recipes": { - "green wool_1": ["Wool_1", "Cactus_1"] + "Gold Shovel_1": [ + "Gold_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.yellow_wool": { + "minicraft.advancements.recipes.gold_sword": { "criteria": { - "has_wool": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "wool" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_flower": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "flower" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wool", - "has_flower" + "has_wood", + "has_gold" ] ], "rewards": { "recipes": { - "yellow wool_1": ["Wool_1", "Flower_1"] + "Gold Sword_1": [ + "Gold_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.black_wool": { + "minicraft.advancements.recipes.golden_apple": { "criteria": { - "has_wool": { - "trigger": "inventory_changed", + "has_apple": { "conditions": { "items": [ { "items": [ - "wool" + "Apple" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_gold": { "conditions": { "items": [ { "items": [ - "coal" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wool", - "has_coal" + "has_apple", + "has_gold" ] ], "rewards": { "recipes": { - "black wool_1": ["Wool_1", "coal_1"] + "Gold Apple_1": [ + "Gold_8", + "Apple_1" + ] } } }, - "minicraft.advancements.recipes.bed": { + "minicraft.advancements.recipes.green_clothes": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_cactus": { "conditions": { "items": [ { "items": [ - "wood" + "Cactus" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_wool": { - "trigger": "inventory_changed", + "has_cloth": { "conditions": { "items": [ { "items": [ - "wool" + "cloth" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_wool" + "has_cactus", + "has_cloth" ] ], "rewards": { "recipes": { - "Bed_1": ["Wood_5", "Wool_3"] + "Green Clothes_1": [ + "Cactus_1", + "cloth_5" + ] } } }, - "minicraft.advancements.recipes.blue_clothes": { + "minicraft.advancements.recipes.green_wool": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", + "has_cactus": { "conditions": { "items": [ { "items": [ - "cloth" + "Cactus" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_lapis": { - "trigger": "inventory_changed", + "has_wool": { "conditions": { "items": [ { "items": [ - "lapis" + "Wool" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_cloth", - "has_lapis" + "has_cactus", + "has_wool" ] ], "rewards": { "recipes": { - "blue clothes_1": ["cloth_5", "Lapis_1"] + "Green Wool_1": [ + "Cactus_1", + "Wool_1" + ] } } }, - "minicraft.advancements.recipes.green_clothes": { + "minicraft.advancements.recipes.haste_potion": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "cloth" + "Awkward Potion" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_cactus": { - "trigger": "inventory_changed", + "has_stone": { + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_wood": { "conditions": { "items": [ { "items": [ - "cactus" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_cloth", - "has_cactus" + "has_stone", + "has_wood", + "has_awkward_potion" ] ], "rewards": { "recipes": { - "green clothes_1": ["cloth_5", "Cactus_1"] + "Haste Potion_1": [ + "Awkward Potion_1", + "Stone_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.yellow_clothes": { + "minicraft.advancements.recipes.health_potion": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "cloth" + "Awkward Potion" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_flower": { - "trigger": "inventory_changed", + "has_gunpowder": { + "conditions": { + "items": [ + { + "items": [ + "Gunpowder" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_leather_armor": { "conditions": { "items": [ { "items": [ - "flower" + "Leather Armor" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_cloth", - "has_flower" + "has_leather_armor", + "has_gunpowder", + "has_awkward_potion" ] ], "rewards": { "recipes": { - "yellow clothes_1": ["cloth_5", "Flower_1"] + "Health Potion_1": [ + "Awkward Potion_1", + "Gunpowder_2", + "Leather Armor_1" + ] } } }, - "minicraft.advancements.recipes.black_clothes": { + "minicraft.advancements.recipes.iron": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", + "has_coal": { "conditions": { "items": [ { "items": [ - "cloth" + "Coal" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_iron_ore": { "conditions": { "items": [ { "items": [ - "coal" + "Iron Ore" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_cloth", - "has_coal" + "has_coal", + "has_iron_ore" ] ], "rewards": { "recipes": { - "black clothes_1": ["cloth_5", "coal_1"] + "Iron_1": [ + "Coal_1", + "Iron Ore_4" + ] } } }, - "minicraft.advancements.recipes.orange_clothes": { + "minicraft.advancements.recipes.iron_armor": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - } - }, - "has_rose": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "rose" - ] - } - ] - } - }, - "has_flower": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "flower" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_cloth", - "has_rose", - "has_flower" + "has_iron" ] ], "rewards": { "recipes": { - "orange clothes_1": ["cloth_5", "rose_1", "Flower_1"] + "Iron Armor_1": [ + "Iron_10" + ] } } }, - "minicraft.advancements.recipes.purple_clothes": { + "minicraft.advancements.recipes.iron_axe": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - } - }, - "has_lapis": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "lapis" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_rose": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "rose" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_cloth", - "has_lapis", - "has_rose" + "has_wood", + "has_iron" ] ], "rewards": { "recipes": { - "purple clothes_1": ["cloth_5", "Lapis_1", "rose_1"] + "Iron Axe_1": [ + "Wood_5", + "Iron_5" + ] } } }, - "minicraft.advancements.recipes.cyan_clothes": { + "minicraft.advancements.recipes.iron_bow": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "cloth" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_lapis": { - "trigger": "inventory_changed", + "has_string": { "conditions": { "items": [ { "items": [ - "lapis" + "string" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_cactus": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "cactus" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_cloth", - "has_lapis", - "has_cactus" + "has_wood", + "has_string", + "has_iron" ] ], "rewards": { "recipes": { - "cyan clothes_1": ["cloth_5", "Lapis_1", "Cactus_1"] + "Iron Bow_1": [ + "string_2", + "Iron_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.reg_clothes": { + "minicraft.advancements.recipes.iron_claymore": { "criteria": { - "has_cloth": { - "trigger": "inventory_changed", + "has_iron_sword": { "conditions": { "items": [ { "items": [ - "cloth" + "Iron Sword" ] } ] - } - } - }, - "requirements": [ - [ - "has_cloth" - ] - ], - "rewards": { - "recipes": { - "reg clothes_1": ["cloth_5"] - } - } - }, - "minicraft.advancements.recipes.iron_armor": { - "criteria": { - "has_iron": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + }, + "has_shard": { "conditions": { "items": [ { "items": [ - "iron" + "Shard" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_iron" + "has_shard", + "has_iron_sword" ] ], "rewards": { "recipes": { - "Iron Armor_1": ["iron_10"] + "Iron Claymore_1": [ + "Iron Sword_1", + "Shard_15" + ] } } }, - "minicraft.advancements.recipes.gold_armor": { + "minicraft.advancements.recipes.iron_fishing_rod": { "criteria": { - "has_gold": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "gold" + "Iron" ] } ] - } - } - }, - "requirements": [ - [ - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Armor_1": ["gold_10"] - } - } - }, - "minicraft.advancements.recipes.gem_armor": { - "criteria": { - "has_gem": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + }, + "has_string": { "conditions": { "items": [ { "items": [ - "gem" + "string" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_gem" + "has_string", + "has_iron" ] ], "rewards": { "recipes": { - "Gem Armor_1": ["gem_65"] + "Iron Fishing Rod_1": [ + "string_3", + "Iron_10" + ] } } }, - "minicraft.advancements.recipes.empty_bucket": { + "minicraft.advancements.recipes.iron_hoe": { "criteria": { "has_iron": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "iron" + "Iron" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_wood": { + "conditions": { + "items": [ + { + "items": [ + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ + "has_wood", "has_iron" ] ], "rewards": { "recipes": { - "Empty Bucket_1": ["iron_5"] + "Iron Hoe_1": [ + "Wood_5", + "Iron_5" + ] } } }, "minicraft.advancements.recipes.iron_lantern": { "criteria": { - "has_iron": { - "trigger": "inventory_changed", + "has_glass": { "conditions": { "items": [ { "items": [ - "iron" + "glass" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_slime": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "slime" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_glass": { - "trigger": "inventory_changed", + "has_slime": { "conditions": { "items": [ { "items": [ - "glass" + "Slime" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_iron", + "has_glass", "has_slime", - "has_glass" + "has_iron" ] ], "rewards": { "recipes": { - "Iron Lantern_1": ["iron_8", "slime_5", "glass_4"] + "Iron Lantern_1": [ + "glass_4", + "Iron_8", + "Slime_5" + ] } } }, - "minicraft.advancements.recipes.gold_lantern": { + "minicraft.advancements.recipes.iron_pickaxe": { "criteria": { - "has_gold": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "gold" - ] - } - ] - } - }, - "has_slime": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "slime" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_glass": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "glass" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_gold", - "has_slime", - "has_glass" + "has_wood", + "has_iron" ] ], "rewards": { "recipes": { - "Gold Lantern_1": ["gold_10", "slime_5", "glass_4"] + "Iron Pickaxe_1": [ + "Wood_5", + "Iron_5" + ] } } }, - "minicraft.advancements.recipes.iron_sword": { + "minicraft.advancements.recipes.iron_shovel": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "wood" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_iron": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "iron" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ @@ -2140,1697 +2344,1858 @@ ], "rewards": { "recipes": { - "Iron Sword_1": ["Wood_5", "iron_5"] + "Iron Shovel_1": [ + "Wood_5", + "Iron_5" + ] } } }, - "minicraft.advancements.recipes.iron_claymore": { + "minicraft.advancements.recipes.iron_sword": { "criteria": { - "has_sword": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "iron sword" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_shard": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "shard" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_sword", - "has_shard" + "has_wood", + "has_iron" ] ], "rewards": { "recipes": { - "Iron Claymore_1": ["Iron Sword_1", "shard_15"] + "Iron Sword_1": [ + "Wood_5", + "Iron_5" + ] } } }, - "minicraft.advancements.recipes.iron_axe": { + "minicraft.advancements.recipes.lantern": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_glass": { "conditions": { "items": [ { "items": [ - "wood" + "glass" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_iron": { - "trigger": "inventory_changed", + "has_slime": { "conditions": { "items": [ { "items": [ - "iron" + "Slime" ] } ] - } + }, + "trigger": "inventory_changed" + }, + "has_wood": { + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + }, + "trigger": "inventory_changed" } }, "requirements": [ [ + "has_glass", "has_wood", - "has_iron" + "has_slime" ] ], "rewards": { "recipes": { - "Iron Axe_1": ["Wood_5", "iron_5"] + "Lantern_1": [ + "glass_3", + "Slime_4", + "Wood_8" + ] } } }, - "minicraft.advancements.recipes.iron_hoe": { + "minicraft.advancements.recipes.lava_potion": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "wood" + "Awkward Potion" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_iron": { - "trigger": "inventory_changed", + "has_lava_bucket": { "conditions": { "items": [ { "items": [ - "iron" + "Lava Bucket" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_iron" + "has_awkward_potion", + "has_lava_bucket" ] ], "rewards": { "recipes": { - "Iron Hoe_1": ["Wood_5", "iron_5"] + "Lava Potion_1": [ + "Awkward Potion_1", + "Lava Bucket_1" + ] } } }, - "minicraft.advancements.recipes.iron_pickaxe": { + "minicraft.advancements.recipes.leather_armor": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_iron": { - "trigger": "inventory_changed", + "has_leather": { "conditions": { "items": [ { "items": [ - "iron" + "Leather" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_iron" + "has_leather" ] ], "rewards": { "recipes": { - "Iron Pickaxe_1": ["Wood_5", "iron_5"] + "Leather Armor_1": [ + "Leather_10" + ] } } }, - "minicraft.advancements.recipes.iron_shovel": { + "minicraft.advancements.recipes.light_potion": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "wood" + "Awkward Potion" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_iron": { - "trigger": "inventory_changed", + "has_slime": { "conditions": { "items": [ { "items": [ - "iron" + "Slime" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_iron" + "has_slime", + "has_awkward_potion" ] ], "rewards": { "recipes": { - "Iron Shovel_1": ["Wood_5", "iron_5"] + "Light Potion_1": [ + "Slime_5", + "Awkward Potion_1" + ] } } }, - "minicraft.advancements.recipes.iron_bow": { + "minicraft.advancements.recipes.loom": { "criteria": { "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_iron": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "iron" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_string": { - "trigger": "inventory_changed", + "has_wool": { "conditions": { "items": [ { "items": [ - "string" + "Wool" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ "has_wood", - "has_iron", - "has_string" + "has_wool" ] ], "rewards": { "recipes": { - "Iron Bow_1": ["Wood_5", "iron_5", "string_2"] + "Loom_1": [ + "Wood_10", + "Wool_5" + ] } } }, - "minicraft.advancements.recipes.gold_sword": { + "minicraft.advancements.recipes.obsidian_brick": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_gold": { - "trigger": "inventory_changed", + "has_raw_obsidian": { "conditions": { "items": [ { "items": [ - "gold" + "Raw Obsidian" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gold" + "has_raw_obsidian" ] ], "rewards": { "recipes": { - "Gold Sword_1": ["Wood_5", "gold_5"] + "Obsidian Brick_1": [ + "Raw Obsidian_2" + ] } } }, - "minicraft.advancements.recipes.gold_claymore": { + "minicraft.advancements.recipes.obsidian_door": { "criteria": { - "has_sword": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "gold sword" - ] - } - ] - } - }, - "has_shard": { - "trigger": "inventory_changed", + "has_obsidian_brick": { "conditions": { "items": [ { "items": [ - "shard" + "Obsidian Brick" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_sword", - "has_shard" + "has_obsidian_brick" ] ], "rewards": { "recipes": { - "Gold Claymore_1": ["Gold Sword_1", "shard_15"] + "Obsidian Door_1": [ + "Obsidian Brick_5" + ] } } }, - "minicraft.advancements.recipes.gold_axe": { + "minicraft.advancements.recipes.obsidian_poppet": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_gem": { "conditions": { "items": [ { "items": [ - "wood" + "gem" ] } ] - } + }, + "trigger": "inventory_changed" }, "has_gold": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "gold" + "Gold" ] } ] - } - } - }, - "requirements": [ - [ - "has_wood", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Axe_1": ["Wood_5", "gold_5"] - } - } - }, - "minicraft.advancements.recipes.gold_hoe": { - "criteria": { - "has_wood": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + }, + "has_lapis": { "conditions": { "items": [ { "items": [ - "wood" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_gold": { - "trigger": "inventory_changed", + "has_shard": { "conditions": { "items": [ { "items": [ - "gold" + "Shard" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", + "has_shard", + "has_gem", + "has_lapis", "has_gold" ] ], "rewards": { "recipes": { - "Gold Hoe_1": ["Wood_5", "gold_5"] + "Obsidian Poppet_1": [ + "Lapis_5", + "Gold_10", + "Shard_15", + "gem_10" + ] } } }, - "minicraft.advancements.recipes.gold_pickaxe": { + "minicraft.advancements.recipes.obsidian_wall": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_gold": { - "trigger": "inventory_changed", + "has_obsidian_brick": { "conditions": { "items": [ { "items": [ - "gold" + "Obsidian Brick" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gold" + "has_obsidian_brick" ] ], "rewards": { "recipes": { - "Gold Pickaxe_1": ["Wood_5", "gold_5"] + "Obsidian Wall_1": [ + "Obsidian Brick_3" + ] } } }, - "minicraft.advancements.recipes.gold_shovel": { + "minicraft.advancements.recipes.orange_clothes": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_cloth": { "conditions": { "items": [ { "items": [ - "wood" + "cloth" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_gold": { - "trigger": "inventory_changed", + "has_flower": { + "conditions": { + "items": [ + { + "items": [ + "Flower" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_rose": { "conditions": { "items": [ { "items": [ - "gold" + "Rose" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gold" + "has_rose", + "has_cloth", + "has_flower" ] ], "rewards": { "recipes": { - "Gold Shovel_1": ["Wood_5", "gold_5"] + "Orange Clothes_1": [ + "cloth_5", + "Rose_1", + "Flower_1" + ] } } }, - "minicraft.advancements.recipes.gold_bow": { + "minicraft.advancements.recipes.ornate_obsidian": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_raw_obsidian": { "conditions": { "items": [ { "items": [ - "wood" + "Raw Obsidian" ] } ] - } - }, - "has_gold": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_raw_obsidian" + ] + ], + "rewards": { + "recipes": { + "Ornate Obsidian_1": [ + "Raw Obsidian_2" + ] + } + } + }, + "minicraft.advancements.recipes.ornate_stone": { + "criteria": { + "has_stone": { "conditions": { "items": [ { "items": [ - "gold" + "Stone" ] } ] - } - }, - "has_string": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_stone" + ] + ], + "rewards": { + "recipes": { + "Ornate Stone_1": [ + "Stone_2" + ] + } + } + }, + "minicraft.advancements.recipes.oven": { + "criteria": { + "has_stone": { "conditions": { "items": [ { "items": [ - "string" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gold", - "has_string" + "has_stone" ] ], "rewards": { "recipes": { - "Gold Bow_1": ["Wood_5", "gold_5", "string_2"] + "Oven_1": [ + "Stone_15" + ] } } }, - "minicraft.advancements.recipes.gem_sword": { + "minicraft.advancements.recipes.plank": { "criteria": { "has_wood": { - "trigger": "inventory_changed", "conditions": { "items": [ { "items": [ - "wood" + "Wood" ] } ] - } - }, - "has_gem": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_wood" + ] + ], + "rewards": { + "recipes": { + "Plank_2": [ + "Wood_1" + ] + } + } + }, + "minicraft.advancements.recipes.plank_wall": { + "criteria": { + "has_plank": { "conditions": { "items": [ { "items": [ - "gem" + "Plank" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gem" + "has_plank" ] ], "rewards": { "recipes": { - "Gem Sword_1": ["Wood_5", "gem_50"] + "Plank Wall_1": [ + "Plank_3" + ] } } }, - "minicraft.advancements.recipes.gem_claymore": { + "minicraft.advancements.recipes.purple_clothes": { "criteria": { - "has_sword": { - "trigger": "inventory_changed", + "has_cloth": { "conditions": { "items": [ { "items": [ - "gem sword" + "cloth" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_shard": { - "trigger": "inventory_changed", + "has_lapis": { "conditions": { "items": [ { "items": [ - "shard" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" + }, + "has_rose": { + "conditions": { + "items": [ + { + "items": [ + "Rose" + ] + } + ] + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_sword", - "has_shard" + "has_rose", + "has_lapis", + "has_cloth" ] ], "rewards": { "recipes": { - "Gem Claymore_1": ["Gem Sword_1", "shard_15"] + "Purple Clothes_1": [ + "Lapis_1", + "cloth_5", + "Rose_1" + ] } } }, - "minicraft.advancements.recipes.gem_axe": { + "minicraft.advancements.recipes.red_wool": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_rose": { "conditions": { "items": [ { "items": [ - "wood" + "Rose" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_gem": { - "trigger": "inventory_changed", + "has_wool": { "conditions": { "items": [ { "items": [ - "gem" + "Wool" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gem" + "has_rose", + "has_wool" ] ], "rewards": { "recipes": { - "Gem Axe_1": ["Wood_5", "gem_50"] + "Red Wool_1": [ + "Rose_1", + "Wool_1" + ] } } }, - "minicraft.advancements.recipes.gem_hoe": { + "minicraft.advancements.recipes.reg_clothes": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_gem": { - "trigger": "inventory_changed", + "has_cloth": { "conditions": { "items": [ { "items": [ - "gem" + "cloth" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gem" + "has_cloth" ] ], "rewards": { "recipes": { - "Gem Hoe_1": ["Wood_5", "gem_50"] + "Reg Clothes_1": [ + "cloth_5" + ] } } }, - "minicraft.advancements.recipes.gem_pickaxe": { + "minicraft.advancements.recipes.regen_potion": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "wood" + "Awkward Potion" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_gem": { - "trigger": "inventory_changed", + "has_golden_apple": { "conditions": { "items": [ { "items": [ - "gem" + "Gold Apple" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gem" + "has_golden_apple", + "has_awkward_potion" ] ], "rewards": { "recipes": { - "Gem Pickaxe_1": ["Wood_5", "gem_50"] + "Regen Potion_1": [ + "Gold Apple_1", + "Awkward Potion_1" + ] } } }, - "minicraft.advancements.recipes.gem_shovel": { + "minicraft.advancements.recipes.shears": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "wood" - ] - } - ] - } - }, - "has_gem": { - "trigger": "inventory_changed", + "has_iron": { "conditions": { "items": [ { "items": [ - "gem" + "Iron" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gem" + "has_iron" ] ], "rewards": { "recipes": { - "Gem Shovel_1": ["Wood_5", "gem_50"] + "Shears_1": [ + "Iron_4" + ] } } }, - "minicraft.advancements.recipes.gem_bow": { + "minicraft.advancements.recipes.snake_armor": { "criteria": { - "has_wood": { - "trigger": "inventory_changed", + "has_scale": { "conditions": { "items": [ { "items": [ - "wood" + "Scale" ] } ] - } - }, - "has_gem": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_scale" + ] + ], + "rewards": { + "recipes": { + "Snake Armor_1": [ + "Scale_15" + ] + } + } + }, + "minicraft.advancements.recipes.speed_potion": { + "criteria": { + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "gem" + "Awkward Potion" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_string": { - "trigger": "inventory_changed", + "has_cactus": { "conditions": { "items": [ { "items": [ - "string" + "Cactus" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wood", - "has_gem", - "has_string" + "has_cactus", + "has_awkward_potion" ] ], "rewards": { "recipes": { - "Gem Bow_1": ["Wood_5", "gem_50", "string_2"] + "Speed Potion_1": [ + "Cactus_5", + "Awkward Potion_1" + ] } } }, - "minicraft.advancements.recipes.shears": { + "minicraft.advancements.recipes.steak": { "criteria": { - "has_iron": { - "trigger": "inventory_changed", + "has_coal": { "conditions": { "items": [ { "items": [ - "iron" + "Coal" ] } ] - } + }, + "trigger": "inventory_changed" + }, + "has_raw_beef": { + "conditions": { + "items": [ + { + "items": [ + "Raw Beef" + ] + } + ] + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_iron" + "has_coal", + "has_raw_beef" ] ], "rewards": { "recipes": { - "Shears_1": ["Iron_4"] + "Steak_1": [ + "Coal_1", + "Raw Beef_1" + ] } } }, - "minicraft.advancements.recipes.iron": { + "minicraft.advancements.recipes.stone_axe": { "criteria": { - "has_ore": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "iron ore" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "coal" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_ore", - "has_coal" + "has_stone", + "has_wood" ] ], "rewards": { "recipes": { - "iron_1": ["iron Ore_4", "coal_1"] + "Rock Axe_1": [ + "Stone_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.gold": { + "minicraft.advancements.recipes.stone_bow": { "criteria": { - "has_ore": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "gold ore" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_string": { + "conditions": { + "items": [ + { + "items": [ + "string" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_wood": { "conditions": { "items": [ { "items": [ - "coal" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_ore", - "has_coal" + "has_stone", + "has_wood", + "has_string" ] ], "rewards": { "recipes": { - "gold_1": ["gold Ore_4", "coal_1"] + "Rock Bow_1": [ + "string_2", + "Stone_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.glass": { + "minicraft.advancements.recipes.stone_brick": { "criteria": { - "has_sand": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "sand" + "Stone" ] } ] - } - }, - "has_coal": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_stone" + ] + ], + "rewards": { + "recipes": { + "Stone Brick_1": [ + "Stone_2" + ] + } + } + }, + "minicraft.advancements.recipes.stone_door": { + "criteria": { + "has_stone_brick": { "conditions": { "items": [ { "items": [ - "coal" + "Stone Brick" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_sand", - "has_coal" + "has_stone_brick" ] ], "rewards": { "recipes": { - "glass_1": ["sand_4", "coal_1"] + "Stone Door_1": [ + "Stone Brick_5" + ] } } }, - "minicraft.advancements.recipes.glass_bottle": { + "minicraft.advancements.recipes.stone_hoe": { "criteria": { - "has_glass": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "glass" + "Stone" + ] + } + ] + }, + "trigger": "inventory_changed" + }, + "has_wood": { + "conditions": { + "items": [ + { + "items": [ + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_glass" + "has_stone", + "has_wood" ] ], "rewards": { "recipes": { - "glass bottle_1": ["glass_3"] + "Rock Hoe_1": [ + "Stone_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.cooked_pork": { + "minicraft.advancements.recipes.stone_pickaxe": { "criteria": { - "has_pork": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "raw pork" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "coal" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_pork", - "has_coal" + "has_stone", + "has_wood" ] ], "rewards": { "recipes": { - "cooked pork_1": ["raw pork_1", "coal_1"] + "Rock Pickaxe_1": [ + "Stone_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.steak": { + "minicraft.advancements.recipes.stone_shovel": { "criteria": { - "has_beef": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "raw beef" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "coal" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_beef", - "has_coal" + "has_stone", + "has_wood" ] ], "rewards": { "recipes": { - "steak_1": ["raw beef_1", "coal_1"] + "Rock Shovel_1": [ + "Stone_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.cooked_fish": { + "minicraft.advancements.recipes.stone_sword": { "criteria": { - "has_fish": { - "trigger": "inventory_changed", + "has_stone": { "conditions": { "items": [ { "items": [ - "raw fish" + "Stone" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_coal": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "coal" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_fish", - "has_coal" + "has_stone", + "has_wood" ] ], "rewards": { "recipes": { - "cooked fish_1": ["raw fish_1", "coal_1"] + "Rock Sword_1": [ + "Stone_5", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.bread": { + "minicraft.advancements.recipes.stone_wall": { "criteria": { - "has_wheat": { - "trigger": "inventory_changed", + "has_stone_brick": { "conditions": { "items": [ { "items": [ - "wheat" + "Stone Brick" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_wheat" + "has_stone_brick" ] ], "rewards": { "recipes": { - "bread_1": ["wheat_4"] + "Stone Wall_1": [ + "Stone Brick_3" + ] } } }, - "minicraft.advancements.recipes.baked_potato": { + "minicraft.advancements.recipes.string": { "criteria": { - "has_potato": { - "trigger": "inventory_changed", + "has_wool": { "conditions": { "items": [ { "items": [ - "potato" + "Wool" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_potato" + "has_wool" ] ], "rewards": { "recipes": { - "Baked Potato_1": ["Potato_1"] + "string_2": [ + "Wool_1" + ] } } }, - "minicraft.advancements.recipes.golden_apple": { + "minicraft.advancements.recipes.swim_potion": { "criteria": { - "has_apple": { - "trigger": "inventory_changed", + "has_awkward_potion": { "conditions": { "items": [ { "items": [ - "apple" + "Awkward Potion" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_gold": { - "trigger": "inventory_changed", + "has_raw_fish": { "conditions": { "items": [ { "items": [ - "gold" + "Raw Fish" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_apple", - "has_gold" + "has_raw_fish", + "has_awkward_potion" ] ], "rewards": { "recipes": { - "Gold Apple_1": ["apple_1", "gold_8"] + "Swim Potion_1": [ + "Awkward Potion_1", + "Raw Fish_5" + ] } } }, - "minicraft.advancements.recipes.awkward_potion": { + "minicraft.advancements.recipes.tnt": { "criteria": { - "has_bottle": { - "trigger": "inventory_changed", + "has_gunpowder": { "conditions": { "items": [ { "items": [ - "glass bottle" + "Gunpowder" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_lapis": { - "trigger": "inventory_changed", + "has_sand": { "conditions": { "items": [ { "items": [ - "lapis" + "Sand" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_bottle", - "has_lapis" + "has_sand", + "has_gunpowder" ] ], "rewards": { "recipes": { - "awkward potion_1": ["glass bottle_1", "Lapis_3"] + "Tnt_1": [ + "Sand_8", + "Gunpowder_10" + ] } } }, - "minicraft.advancements.recipes.speed_potion": { + "minicraft.advancements.recipes.torch": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", + "has_coal": { "conditions": { "items": [ { "items": [ - "awkward potion" + "Coal" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_cactus": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "cactus" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", - "has_cactus" + "has_coal", + "has_wood" ] ], "rewards": { "recipes": { - "speed potion_1": ["awkward potion_1", "Cactus_5"] + "Torch_2": [ + "Coal_1", + "Wood_1" + ] } } }, - "minicraft.advancements.recipes.light_potion": { + "minicraft.advancements.recipes.totem_of_air": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", + "has_cloud_ore": { "conditions": { "items": [ { "items": [ - "awkward potion" + "Cloud Ore" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_slime": { - "trigger": "inventory_changed", + "has_gem": { "conditions": { "items": [ { "items": [ - "slime" + "gem" ] } ] - } - } - }, - "requirements": [ - [ - "has_awkward", - "has_slime" - ] - ], - "rewards": { - "recipes": { - "light potion_1": ["awkward potion_1", "slime_5"] - } - } - }, - "minicraft.advancements.recipes.swim_potion": { - "criteria": { - "has_awkward": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + }, + "has_gold": { "conditions": { "items": [ { "items": [ - "awkward potion" + "Gold" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_fish": { - "trigger": "inventory_changed", + "has_lapis": { "conditions": { "items": [ { "items": [ - "raw fish" + "Lapis" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", - "has_fish" + "has_gem", + "has_cloud_ore", + "has_lapis", + "has_gold" ] ], "rewards": { "recipes": { - "swim potion_1": ["awkward potion_1", "raw fish_5"] + "Totem of Air_1": [ + "Lapis_5", + "Gold_10", + "gem_10", + "Cloud Ore_5" + ] } } }, - "minicraft.advancements.recipes.haste_potion": { + "minicraft.advancements.recipes.wood_door": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", + "has_plank": { "conditions": { "items": [ { "items": [ - "awkward potion" + "Plank" ] } ] - } - }, - "has_wood": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_plank" + ] + ], + "rewards": { + "recipes": { + "Wood Door_1": [ + "Plank_5" + ] + } + } + }, + "minicraft.advancements.recipes.wood_fishing_rod": { + "criteria": { + "has_string": { "conditions": { "items": [ { "items": [ - "wood" + "string" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_stone": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "stone" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", "has_wood", - "has_stone" + "has_string" ] ], "rewards": { "recipes": { - "haste potion_1": ["awkward potion_1", "Wood_5", "Stone_5"] + "Wood Fishing Rod_1": [ + "string_3", + "Wood_10" + ] } } }, - "minicraft.advancements.recipes.lava_potion": { + "minicraft.advancements.recipes.wooden_axe": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "awkward potion" - ] - } - ] - } - }, - "has_lava_bucket": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "lava bucket" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", - "has_lava_bucket" + "has_wood" ] ], "rewards": { "recipes": { - "lava potion_1": ["awkward potion_1", "Lava Bucket_1"] + "Wood Axe_1": [ + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.energy_potion": { + "minicraft.advancements.recipes.wooden_bow": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", + "has_string": { "conditions": { "items": [ { "items": [ - "awkward potion" + "string" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_gem": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "gem" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", - "has_gem" + "has_wood", + "has_string" ] ], "rewards": { "recipes": { - "energy potion_1": ["awkward potion_1", "gem_25"] + "Wood Bow_1": [ + "string_2", + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.regen_potion": { + "minicraft.advancements.recipes.wooden_hoe": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "awkward potion" - ] - } - ] - } - }, - "has_golden_apple": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "gold apple" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", - "has_golden_apple" + "has_wood" ] ], "rewards": { "recipes": { - "regen potion_1": ["awkward potion_1", "Gold Apple_1"] + "Wood Hoe_1": [ + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.health_potion": { + "minicraft.advancements.recipes.wooden_pickaxe": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "awkward potion" - ] - } - ] - } - }, - "has_gunpowder": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "gunpowder" - ] - } - ] - } - }, - "has_leather_armor": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "leather armor" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", - "has_gunpowder", - "has_leather_armor" + "has_wood" ] ], "rewards": { "recipes": { - "Health potion_1": ["awkward potion_1", "GunPowder_2", "Leather Armor_1"] + "Wood Pickaxe_1": [ + "Wood_5" + ] } } }, - "minicraft.advancements.recipes.escape_potion": { + "minicraft.advancements.recipes.wooden_shovel": { "criteria": { - "has_awkward": { - "trigger": "inventory_changed", + "has_wood": { "conditions": { "items": [ { "items": [ - "awkward potion" + "Wood" ] } ] - } - }, - "has_gunpowder": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_wood" + ] + ], + "rewards": { + "recipes": { + "Wood Shovel_1": [ + "Wood_5" + ] + } + } + }, + "minicraft.advancements.recipes.wooden_sword": { + "criteria": { + "has_wood": { "conditions": { "items": [ { "items": [ - "gunpowder" + "Wood" ] } ] - } - }, - "has_lapis": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_wood" + ] + ], + "rewards": { + "recipes": { + "Wood Sword_1": [ + "Wood_5" + ] + } + } + }, + "minicraft.advancements.recipes.workbench": { + "criteria": { + "has_wood": { "conditions": { "items": [ { "items": [ - "lapis" + "Wood" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_awkward", - "has_gunpowder", - "has_lapis" + "has_wood" ] ], "rewards": { "recipes": { - "Escape potion_1": ["awkward potion_1", "GunPowder_3", "Lapis_7"] + "Workbench_1": [ + "Wood_10" + ] } } }, - "minicraft.advancements.recipes.totem_of_air": { + "minicraft.advancements.recipes.yellow_clothes": { "criteria": { - "has_gold": { - "trigger": "inventory_changed", + "has_cloth": { "conditions": { "items": [ { "items": [ - "gold potion" + "cloth" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_gem": { - "trigger": "inventory_changed", + "has_flower": { "conditions": { "items": [ { "items": [ - "gem" + "Flower" ] } ] - } - }, - "has_lapis": { - "trigger": "inventory_changed", + }, + "trigger": "inventory_changed" + } + }, + "requirements": [ + [ + "has_cloth", + "has_flower" + ] + ], + "rewards": { + "recipes": { + "Yellow Clothes_1": [ + "Flower_1", + "cloth_5" + ] + } + } + }, + "minicraft.advancements.recipes.yellow_wool": { + "criteria": { + "has_flower": { "conditions": { "items": [ { "items": [ - "lapis" + "Flower" ] } ] - } + }, + "trigger": "inventory_changed" }, - "has_cloud_ore": { - "trigger": "inventory_changed", + "has_wool": { "conditions": { "items": [ { "items": [ - "cloud ore" + "Wool" ] } ] - } + }, + "trigger": "inventory_changed" } }, "requirements": [ [ - "has_gold", - "has_gem", - "has_lapis", - "has_cloud_ore" + "has_wool", + "has_flower" ] ], "rewards": { "recipes": { - "Totem of Air_1": ["gold_10", "gem_10", "Lapis_5","Cloud Ore_5"] + "Yellow Wool_1": [ + "Flower_1", + "Wool_1" + ] } } } From 0b08130655cf2c0bd75ced2603533c1749a8c83c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:43:38 +0800 Subject: [PATCH 100/261] Make rendering methods into GPU kernels Aparapi Kernel transformation of rendering methods: stage 1 --- build.gradle | 1 + src/client/java/minicraft/core/Renderer.java | 4 +- src/client/java/minicraft/gfx/Screen.java | 238 ++++++++++++++---- .../screen/OnScreenKeyboardMenu.java | 115 ++------- .../java/minicraft/screen/QuestsDisplay.java | 33 +-- .../screen/TutorialDisplayHandler.java | 20 +- .../resources/assets/textures/gui/osk.png | Bin 0 -> 318 bytes 7 files changed, 247 insertions(+), 164 deletions(-) create mode 100644 src/client/resources/assets/textures/gui/osk.png diff --git a/build.gradle b/build.gradle index 8911d1700..380f9d077 100644 --- a/build.gradle +++ b/build.gradle @@ -55,6 +55,7 @@ project(":client") { implementation 'com.badlogicgames.gdx:gdx-box2d:1.11.0' implementation 'com.badlogicgames.gdx:gdx-controllers:1.9.13' implementation 'com.badlogicgames.jamepad:jamepad:2.0.20.0' + implementation 'com.aparapi:aparapi:3.0.0' } application { diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index 01e024f4e..de2c641df 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -101,7 +101,7 @@ public static void initScreen() { lightScreen = new Screen(); image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); - screen.pixels = ((DataBufferInt) image.getRaster().getDataBuffer()).getData(); + screen.init(((DataBufferInt) image.getRaster().getDataBuffer()).getData()); hudSheet = new LinkedSprite(SpriteType.Gui, "hud"); canvas.createBufferStrategy(3); @@ -128,7 +128,7 @@ public static void render() { BufferStrategy bs = canvas.getBufferStrategy(); // Creates a buffer strategy to determine how the graphics should be buffered. Graphics g = bs.getDrawGraphics(); // Gets the graphics in which java draws the picture - g.fillRect(0, 0, canvas.getWidth(), canvas.getHeight()); // Draws a rect to fill the whole window (to cover last?) + g.clearRect(0, 0, canvas.getWidth(), canvas.getHeight()); // Draws a rect to fill the whole window (to cover last?) // Scale the pixels. int ww = getWindowSize().width; diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index 8491cd62b..6115fc6ba 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -1,11 +1,20 @@ package minicraft.gfx; +import com.aparapi.Kernel; +import minicraft.core.Initializer; import minicraft.core.Renderer; import minicraft.core.Updater; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; +import minicraft.screen.ResourcePackDisplay; +import org.intellij.lang.annotations.MagicConstant; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; public class Screen { @@ -23,7 +32,7 @@ public class Screen { private static final int BIT_MIRROR_X = 0x01; // Written in hexadecimal; binary: 01 private static final int BIT_MIRROR_Y = 0x02; // Binary: 10 - public int[] pixels; // Pixels on the screen + protected int[] pixels; // Pixels on the screen // Outdated Information: // Since each sheet is 256x256 pixels, each one has 1024 8x8 "tiles" @@ -35,10 +44,23 @@ public Screen() { pixels = new int[Screen.w * Screen.h]; // Makes new integer array for all the pixels on the screen. } + /** Initializes the screen with the given pixel array instance. */ + public void init(int[] pixels) { + this.pixels = pixels; + } + /** Clears all the colors on the screen */ public void clear(int color) { // Turns each pixel into a single color (clearing the screen!) - Arrays.fill(pixels, color); + int[] pixels = this.pixels; + Kernel kernel = new Kernel() { + @Override + public void run() { + pixels[getGlobalId()] = color; + } + }; + kernel.execute(pixels.length); + kernel.dispose(); } public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet) { render(xp, yp, xt, yt, bits, sheet, -1); } @@ -74,36 +96,97 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee if (sheet == null) return; // Verifying that sheet is not null. // xp and yp are originally in level coordinates, but offset turns them to screen coordinates. - xp -= xOffset; //account for screen offset - yp -= yOffset; + int xpt = xp - xOffset; //account for screen offset + int ypt = yp - yOffset; // Determines if the image should be mirrored... - boolean mirrorX = (bits & BIT_MIRROR_X) > 0; // Horizontally. - boolean mirrorY = (bits & BIT_MIRROR_Y) > 0; // Vertically. + boolean[] mirrorX = new boolean [] { (bits & BIT_MIRROR_X) > 0 }; // Horizontally. + boolean[] mirrorY = new boolean [] { (bits & BIT_MIRROR_Y) > 0 }; // Vertically. + boolean[] wBright = new boolean [] { fullbright }; // Validation check - if (sheet == null || xt * 8 + yt * 8 * sheet.width + 7 + 7 * sheet.width >= sheet.pixels.length) { - sheet = Renderer.spriteLinker.missingSheet(SpriteType.Item); - xt = 0; - yt = 0; + if (xt * 8 + yt * 8 * sheet.width + 7 + 7 * sheet.width >= sheet.pixels.length) { + render(xp, yp, 0, 0, bits, Renderer.spriteLinker.missingSheet(SpriteType.Item), -1, false, 0); + return; } - int xTile = xt; // Gets x position of the spritesheet "tile" - int yTile = yt; // Gets y position - int toffs = xTile * 8 + yTile * 8 * sheet.width; // Gets the offset of the sprite into the spritesheet pixel array, the 8's represent the size of the box. (8 by 8 pixel sprite boxes) + int toffs = xt * 8 + yt * 8 * sheet.width; // Gets the offset of the sprite into the spritesheet pixel array, the 8's represent the size of the box. (8 by 8 pixel sprite boxes) + int[] sheetPixels = sheet.pixels; + int sheetWidth = sheet.width; // THIS LOOPS FOR EVERY PIXEL - for (int y = 0; y < 8; y++) { // Loops 8 times (because of the height of the tile) - int ys = y; // Current y pixel - if (mirrorY) ys = 7 - y; // Reverses the pixel for a mirroring effect - if (y + yp < 0 || y + yp >= h) continue; // If the pixel is out of bounds, then skip the rest of the loop. - for (int x = 0; x < 8; x++) { // Loops 8 times (because of the width of the tile) - if (x + xp < 0 || x + xp >= w) continue; // Skip rest if out of bounds. + int[] pixels = this.pixels; + int w = Screen.w, h = Screen.h; + int WHITE = Color.WHITE; + Kernel kernel = new Kernel() { + @Override + public void run() { + int subPos = getGlobalId(); + int x = subPos % 8; + int y = subPos / 8; + int ys = y; // Current y pixel + if (mirrorY[0]) ys = 7 - y; // Reverses the pixel for a mirroring effect + if (y + ypt < 0 || y + ypt >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. + if (x + xpt < 0 || x + xpt >= w) return; // Skip rest if out of bounds. int xs = x; // Current x pixel - if (mirrorX) xs = 7 - x; // Reverses the pixel for a mirroring effect + if (mirrorX[0]) xs = 7 - x; // Reverses the pixel for a mirroring effect - int col = sheet.pixels[toffs + xs + ys * sheet.width]; // Gets the color of the current pixel from the value stored in the sheet. + int col = sheetPixels[toffs + xs + ys * sheetWidth]; // Gets the color of the current pixel from the value stored in the sheet. + + boolean isTransparent = (col >> 24 == 0); + + if (!isTransparent) { + int index = (x + xpt) + (y + ypt) * w; + + if (whiteTint != -1 && col == 0x1FFFFFF) { + // If this is white, write the whiteTint over it + pixels[index] = Color.upgrade(whiteTint); + } else { + // Inserts the colors into the image + if (wBright[0]) { + pixels[index] = WHITE; + } else { + if (color != 0) { + + pixels[index] = color; + } else { + pixels[index] = Color.upgrade(col); + } + } + } + } + } + }; + kernel.execute(64); // Loops a whole sheet tile. + kernel.dispose(); + } + + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet) { + render(xp, yp, xt, yt ,tw, th, sheet, -1); + } + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int whiteTint) { + render(xp, yp, xt, yt, tw, th, sheet, whiteTint, false); + } + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int whiteTint, boolean fullbright) { + render(xp, yp, xt, yt, tw, th, sheet, whiteTint, fullbright, 0); + } + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int whiteTint, boolean fullbright, int color) { + if (sheet == null) return; // Verifying that sheet is not null. + int toffs = xt + yt * sheet.width; + int[] pixels = this.pixels; + int w = Screen.w, h = Screen.h; + int WHITE = Color.WHITE; + Kernel kernel = new Kernel() { + @Override + public void run() { + int subPos = getGlobalId(); + int x = subPos % 8; + int y = subPos / 8; + if (y + yp < 0 || y + yp >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. + if (x + xp < 0 || x + xp >= w) return; // Skip rest if out of bounds. + + int col = sheet.pixels[toffs + x + y * sheet.width]; // Gets the color of the current pixel from the value stored in the sheet. boolean isTransparent = (col >> 24 == 0); @@ -116,7 +199,7 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee } else { // Inserts the colors into the image if (fullbright) { - pixels[index] = Color.WHITE; + pixels[index] = WHITE; } else { if (color != 0) { @@ -128,7 +211,49 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee } } } - } + }; + kernel.execute(tw * th); // Loops a whole sheet area. + kernel.dispose(); + } + + public void fillRect(int xp, int yp, int ww, int hh, int color) { + int[] pixels = this.pixels; + int w = Screen.w, h = Screen.h; + Kernel kernel = new Kernel() { + @Override + public void run() { + int id = getGlobalId(); + int x = xp + id % ww; + int y = yp + id / ww; + if (y < 0 || y >= h || x < 0 || x >= w) return; + pixels[x + y * w] = color; + } + }; + kernel.execute(ww * hh); + kernel.dispose(); + } + + /** + * Draw a straight line along an axis. + * @param axis The axis to draw along: {@code 0} for x-axis; {@code 1} for y-axis + * @param l The length of the line + */ + public void drawAxisLine(int xp, int yp, @MagicConstant(intValues = {0, 1}) int axis, int l, int color) { + int[] pixels = this.pixels; + int w = Screen.w; + Kernel kernel = new Kernel() { + @Override + public void run() { + int id = getGlobalId(); + if (axis == 0) { // x-axis + pixels[xp + id + yp * w] = color; + } else { // y-axis + pixels[xp + (yp + id) * w] = color; + } + } + }; + kernel.execute(l); + kernel.dispose(); } /** Sets the offset of the screen */ @@ -174,27 +299,34 @@ public void overlay(Screen screen2, int currentLevel, int xa, int ya) { else if(currentLevel >= 5) tintFactor = -MAXDARK; + int[] pixels = this.pixels; int[] oPixels = screen2.pixels; // The Integer array of pixels to overlay the screen with. - int i = 0; // Current pixel on the screen - for (int y = 0; y < h; y++) { // loop through height of screen - for (int x = 0; x < w; x++) { // loop through width of screen - if (oPixels[i] / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { - - /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... + double finalTintFactor = tintFactor; + int w = Screen.w, h = Screen.h; + Kernel kernel = new Kernel() { + @Override + public void run() { + int id = getGlobalId(); + int x = id % w; + int y = id / h; + if (oPixels[id] / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { + + /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... if (currentLevel < 3) { // if in caves... - /// in the caves, not being lit means being pitch black. - pixels[i] = 0; - } else { + /// in the caves, not being lit means being pitch black. + pixels[id] = 0; + } else { /// Outside the caves, not being lit simply means being darker. - pixels[i] = Color.tintColor(pixels[i], (int)tintFactor); // darkens the color one shade. - } - } + pixels[id] = Color.tintColor(pixels[id], (int) finalTintFactor); // darkens the color one shade. + } + } // Increase the tinting of all colors by 20. - pixels[i] = Color.tintColor(pixels[i], 20); - i++; // Moves to the next pixel. - } - } + pixels[id] = Color.tintColor(pixels[id], 20); + } + }; + kernel.execute(w * h); + kernel.dispose(); } public void renderLight(int x, int y, int r) { @@ -213,13 +345,25 @@ public void renderLight(int x, int y, int r) { if (x1 > w) x1 = w; if (y1 > h) y1 = h; - for (int yy = y0; yy < y1; yy++) { // Loop through each y position - int yd = yy - y; // Get distance to the previous y position. - yd = yd * yd; // Square that distance - for (int xx = x0; xx < x1; xx++) { // Loop though each x pos - int xd = xx - x; // Get x delta + int xp = x; + int yp = y; + int xa = x0; + int ya = y0; + int ww = x1 - x0; + int hh = y1 - y0; + int[] pixels = this.pixels; + int w = Screen.w, h = Screen.h; + Kernel kernel = new Kernel() { + @Override + public void run() { + int id = getGlobalId(); + int xx = xa + id % ww; + int yy = ya + id / ww; + if (xx < 0 || xx >= w || yy < 0 || yy >= h) return; + int yd = yy - yp; // Get distance to the previous y position. + yd = yd * yd; // Square that distance + int xd = xx - xp; // Get x delta int dist = xd * xd + yd; // Square x delta, then add the y delta, to get total distance. - if (dist <= r * r) { // If the distance from the center (x,y) is less or equal to the radius... int br = 255 - dist * 255 / (r * r); // area where light will be rendered. // r*r is becuase dist is still x*x+y*y, of pythag theorem. @@ -227,6 +371,8 @@ public void renderLight(int x, int y, int r) { if (pixels[xx + yy * w] < br) pixels[xx + yy * w] = br; // Pixel cannot be smaller than br; in other words, the pixel color (brightness) cannot be less than br. } } - } + }; + kernel.execute(ww * hh); + kernel.dispose(); } } diff --git a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java index 82deee31c..109b48c76 100644 --- a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java +++ b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java @@ -2,13 +2,16 @@ import com.studiohartman.jamepad.ControllerButton; import minicraft.core.Game; +import minicraft.core.Renderer; import minicraft.core.io.InputHandler; import minicraft.core.io.Sound; import minicraft.gfx.Dimension; import minicraft.gfx.Font; +import minicraft.gfx.MinicraftImage; import minicraft.gfx.Point; import minicraft.gfx.Rectangle; import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker; import org.jetbrains.annotations.Nullable; import java.awt.Label; @@ -259,115 +262,49 @@ public boolean isVisible() { public void render(Screen screen) { super.render(screen); - BiConsumer colorPixel = (pos, color) -> { - if (pos < screen.pixels.length && pos > 0) - screen.pixels[pos] = color; - }; - Rectangle bounds = getBounds(); int width = bounds.getWidth(); int height = bounds.getHeight(); - int renderingTop = bounds.getTop(); - for (int x = 0; x < width; x++) { // Rendering background. - for (int y = 0; y < height; y++) { - colorPixel.accept(x + (y + renderingTop) * Screen.w, 0x1CFCFCF); - } - } - - for (int x = 0; x < width; x++) { // Rendering upper edge. - for (int y = 0; y < 2; y++) { - colorPixel.accept(x + (y + renderingTop) * Screen.w, 0x1EFEFEF); - } - } + int top = bounds.getTop(); + // Rendering background. + screen.fillRect(0, top, width, height, 0x1CFCFCF); + // Rendering upper edge. + screen.fillRect(0, top, width, 2, 0x1EFEFEF); final int keyHeight = 14; + final int keyWidth = 16; VirtualKey[][] keys = shiftPressed? keysB: keysF; + MinicraftImage sheet = Renderer.spriteLinker.getSheet(SpriteLinker.SpriteType.Gui, "osk"); for (int r = 0; r < keys.length; r++) { - final int defaultKeyWidth = 16; - int keyWidth = defaultKeyWidth; int totalLength = (keys[r].length * keyWidth); totalLength += keyWidth * 2 * (int) Stream.of(keys[r]).filter(k -> k == spaceBar).count(); totalLength += keyWidth * (int) Stream.of(keys[r]).filter(k -> k == shiftKey).count(); int xOffset = (Screen.w - totalLength) / 2; - int y = renderingTop + 2 + r * keyHeight; + int y = top + 2 + r * keyHeight; int x = xOffset; for (int c = 0; c < keys[r].length; c++) { VirtualKey key = keys[r][c]; - if (key == spaceBar) - keyWidth = defaultKeyWidth * 3; - else if (key == shiftKey) - keyWidth = defaultKeyWidth * 2; - else - keyWidth = defaultKeyWidth; int color = keyPressed > 0 && r == this.y && c == this.x? 0x1EFEFF0: 0x1FDFDFD; - if (key == backspace) { // Rendering the backspace. - // Rendering the cross. - colorPixel.accept(x + 1 + keyWidth/2 + (y + keyHeight/2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 + 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 + 1) * Screen.w, color); - - // Rendering the upper base. - colorPixel.accept(x + 1 + keyWidth/2 - 3 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 2 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 2 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 3 + (y + keyHeight/2 - 3) * Screen.w, color); - - // Rendering the lower base. - colorPixel.accept(x + 1 + keyWidth/2 - 3 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 2 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 2 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 3 + (y + keyHeight/2 + 3) * Screen.w, color); - - // Rendering the left angle. - colorPixel.accept(x + 1 + keyWidth/2 - 4 + (y + keyHeight/2 - 2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 5 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 6 + (y + keyHeight/2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 5 + (y + keyHeight/2 + 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 4 + (y + keyHeight/2 + 2) * Screen.w, color); - - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 - 2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 + 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 + 2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 + 3) * Screen.w, color); - } else if (key == shiftKey) { // Rendering "SYM". - Font.draw("S", screen, x + keyWidth/2 - 3 - defaultKeyWidth/2, y + keyHeight/2 - 3, color); - Font.draw("Y", screen, x + keyWidth/2 - 3, y + keyHeight/2 - 3, color); - Font.draw("M", screen, x + keyWidth/2 - 3 + defaultKeyWidth/2, y + keyHeight/2 - 3, color); - } else if (key == spaceBar) { // Rendering "underscore". - for (int i = 1; i < 19; i++) { - colorPixel.accept(x + keyWidth/2 + i - 9 + (y + keyHeight/2 + 2) * Screen.w, color); - } + if (key == backspace) { + screen.render(x, y, 0, 0, keyWidth, keyHeight, sheet, color); + } else if (key == shiftKey) { + screen.render(x, y, keyWidth, 0, keyWidth, keyHeight, sheet, color); + } else if (key == spaceBar) { + screen.render(x, y, 0, keyHeight, keyWidth, keyHeight, sheet, color); } else Font.draw(String.valueOf(key.output), screen, x + keyWidth/2 - 3, y + keyHeight/2 - 3, color); - for (int i = 0; i <= keyHeight; i++) { // Rendering left and right border. - colorPixel.accept(x + (y + i) * Screen.w, 0x1BCBCBC); - colorPixel.accept(x + keyWidth + (y + i) * Screen.w, 0x1BCBCBC); - } for (int i = 0; i <= keyWidth; i++) { // Rendering top and bottom border. - colorPixel.accept(x + i + y * Screen.w, 0x1BCBCBC); - colorPixel.accept(x + i + (y + keyHeight) * Screen.w, 0x1BCBCBC); - } + screen.drawAxisLine(x, y, 1, keyHeight, 0x1BCBCBC); // left border + screen.drawAxisLine(x + keyWidth, y, 1, keyHeight, 0x1BCBCBC); // right border + screen.drawAxisLine(x, y, 0, keyWidth, 0x1BCBCBC); // top border + screen.drawAxisLine(x, y + keyHeight, 0, keyWidth, 0x1BCBCBC); // bottom border if (this.x == c && this.y == r) { - color = keyPressed > 0? 0x1EFEFF0: 0x1DFDFE0; - for (int i = 1; i < keyHeight; i++) { // Rendering left and right border. - colorPixel.accept(x + 1 + (y + i) * Screen.w, color); - colorPixel.accept(x - 1 + keyWidth + (y + i) * Screen.w, color); - } for (int i = 1; i < keyWidth; i++) { // Rendering top and bottom border. - colorPixel.accept(x + i + (y + 1) * Screen.w, color); - colorPixel.accept(x + i + (y - 1 + keyHeight) * Screen.w, color); - } + color = keyPressed > 0 ? 0x1EFEFF0 : 0x1DFDFE0; + screen.drawAxisLine(x + 1, y, 1, keyHeight, color); // left border + screen.drawAxisLine(x - 1 + keyWidth, y, 1, keyHeight, color); // right border + screen.drawAxisLine(x, y + 1, 0, keyWidth, color); // top border + screen.drawAxisLine(x, y - 1 + keyHeight, 0, keyWidth, color); // bottom border } x += keyWidth; diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index c871b79da..23926b161 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -1,5 +1,6 @@ package minicraft.screen; +import minicraft.core.CrashHandler; import minicraft.core.Game; import minicraft.core.Renderer; import minicraft.core.io.InputHandler; @@ -25,7 +26,10 @@ import org.json.JSONArray; import org.json.JSONObject; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferInt; import java.io.IOException; +import java.io.UncheckedIOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -298,6 +302,7 @@ private static class SeriesQuestViewerDisplay extends Display { private final int rasterHeight; private final int rasterX; private final int rasterY; + private final MinicraftImage image; private final int[] rasterPixels; private final Screen simulatedRasterScreen = new Screen() { @Override @@ -417,7 +422,14 @@ public SeriesQuestViewerDisplay(QuestSeries series) { Rectangle menuBounds = menus[1].getBounds(); rasterWidth = menuBounds.getWidth() - MinicraftImage.boxWidth*2; rasterHeight = menuBounds.getHeight() - MinicraftImage.boxWidth*2; - rasterPixels = new int[rasterWidth * rasterHeight]; + BufferedImage bufferedImage = new BufferedImage(rasterWidth, rasterHeight, BufferedImage.TYPE_INT_RGB); + try { + image = new MinicraftImage(bufferedImage); + } catch (IOException e) { + CrashHandler.crashHandle(e); + throw new UncheckedIOException(e); + } + rasterPixels = image.pixels; rasterX = menuBounds.getLeft() + MinicraftImage.boxWidth; rasterY = menuBounds.getTop() + MinicraftImage.boxWidth; } @@ -497,20 +509,11 @@ public void render(Screen screen) { menu.render(screen); Arrays.fill(rasterPixels, Color.BLACK); renderRaster(); - final int xPadding = rasterX - 1; - final int yPadding = rasterY - 1; - for (int i = 0; i < rasterWidth + 2; i++) { - for (int j = 0; j < rasterHeight + 2; j++) { - final int pos = xPadding + i + (yPadding + j) * Screen.w; - if (i == 0 || i == rasterWidth + 1 || j == 0 || j == rasterHeight + 1) - screen.pixels[pos] = Color.WHITE; // Raster border. - else { - final int x = i - 1; // Also < rasterWidth. - final int y = j - 1; // Also < rasterHeight. - screen.pixels[pos] = rasterPixels[x + y * rasterWidth]; - } - } - } + screen.drawAxisLine(rasterX - 1, rasterY - 1, 1, rasterHeight + 2, Color.WHITE); // left border + screen.drawAxisLine(rasterX + rasterWidth, rasterY - 1, 1, rasterHeight + 2, Color.WHITE); // right border + screen.drawAxisLine(rasterX - 1, rasterY - 1, 0, rasterWidth + 2, Color.WHITE); // top border + screen.drawAxisLine(rasterX - 1, rasterY + rasterHeight, 0, rasterWidth + 2, Color.WHITE); // right border + screen.render(rasterX, rasterY, 0, 0, rasterWidth, rasterHeight, image); } private void renderRaster() { diff --git a/src/client/java/minicraft/screen/TutorialDisplayHandler.java b/src/client/java/minicraft/screen/TutorialDisplayHandler.java index 06be9c594..a22a80c7a 100644 --- a/src/client/java/minicraft/screen/TutorialDisplayHandler.java +++ b/src/client/java/minicraft/screen/TutorialDisplayHandler.java @@ -207,15 +207,13 @@ public static void render(Screen screen) { int textWidth = Font.textWidth(lines); int xPadding = Screen.w/2 - (textWidth + 8)/2; int yPadding = Screen.h/2 - (lines.length * 8 + 8)/2; - int yPad = Screen.h/2 - (lines.length * 8)/2; - for (int i = 0; i < lines.length * 8 + 8; i++) { // Background. - for (int j = 0; j < textWidth + 8; j++) { - screen.pixels[xPadding + j + (yPadding + i) * Screen.w] = - i == 0 || i == lines.length * 8 + 7 || - j == 0 || j == textWidth + 7 ? Color.WHITE : Color.BLUE; - } - } + screen.fillRect(xPadding + 1, yPadding + 1, textWidth + 6, lines.length * 8 + 6, Color.BLUE); + screen.drawAxisLine(xPadding, yPadding, 0, textWidth + 8, Color.WHITE); // left border + screen.drawAxisLine(xPadding, yPadding + lines.length * 8 + 7, 0, textWidth + 8, Color.WHITE); // right border + screen.drawAxisLine(xPadding, yPadding, 1, lines.length * 8 + 8, Color.WHITE); // top border + screen.drawAxisLine(xPadding + lines.length * 8 + 7, yPadding, 1, lines.length * 8 + 8, Color.WHITE); // bottom border + int yPad = Screen.h/2 - (lines.length * 8)/2; for (int i = 0; i < lines.length; i++) { Font.drawCentered(lines[i], screen, yPad + 8 * i, Color.WHITE); } @@ -230,10 +228,8 @@ public static void render(Screen screen) { int length = bounds.getWidth() - 4; int bottom = bounds.getBottom() - 2; int left = bounds.getLeft() + 2; - for (int i = 0; i < length * currentGuide.interactedDuration / currentGuide.duration; i++) { - screen.pixels[left + i + bottom * Screen.w] = Color.WHITE; - screen.pixels[left + i + (bottom - 1) * Screen.w] = Color.WHITE; - } + screen.drawAxisLine(left, bottom, 0, length * currentGuide.interactedDuration / currentGuide.duration, Color.WHITE); + screen.drawAxisLine(left, bottom - 1, 0, length * currentGuide.interactedDuration / currentGuide.duration, Color.WHITE); } } else if (currentOngoingElement != null) { // Is ongoing. Menu menu = new Menu.Builder(true, 0, RelPos.RIGHT) diff --git a/src/client/resources/assets/textures/gui/osk.png b/src/client/resources/assets/textures/gui/osk.png new file mode 100644 index 0000000000000000000000000000000000000000..7972c7f9a98cfa0d4ba9ce8f32d86936d0fb84c4 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^20$#s!3HGNb8JolDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheoCO|{#S9F5he4R}c>anMpx|Xs7srqY_qW#`avfISVR=yY{{Okz;za`M z0;7+;IrizVXOH04Ef?0_$@%_cTl(XbH>LgSo8uCuwjXDf(Rh40_{~+*jeKDxg?CPe zRx#=v&|Xke)g_%J$3z*$dA}Nk21m()a%=wTxT#_ZIuU&6WvyM~`*!ewJAHJMq{ujo%l- z4&SWkyUkxb&F(^e#e}6(g1mm}|FZwY8UB687w0XHm;&sxQfKB?Gm3iHbF9k<+6wd@ NgQu&X%Q~loCIGTqg3bT{ literal 0 HcmV?d00001 From 169a9df8ea3c53b39ef0d845d55a6ba790f62e32 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:32:52 +0800 Subject: [PATCH 101/261] Reorganize MinicraftImage and exceptions within Added appropriate exceptions and handles for compatibility validation. --- src/client/java/minicraft/core/Renderer.java | 4 +- .../java/minicraft/gfx/MinicraftImage.java | 134 +++++++++++++----- .../java/minicraft/screen/QuestsDisplay.java | 8 +- .../minicraft/screen/ResourcePackDisplay.java | 58 ++++++-- .../java/minicraft/screen/SkinDisplay.java | 19 ++- 5 files changed, 163 insertions(+), 60 deletions(-) diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index de2c641df..aa70e828d 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -82,12 +82,12 @@ public static MinicraftImage loadDefaultSkinSheet() { MinicraftImage skinsSheet; try { // These set the sprites to be used. - skinsSheet = new MinicraftImage(ImageIO.read(Objects.requireNonNull(Game.class.getResourceAsStream("/resources/textures/skins.png")))); + skinsSheet = MinicraftImage.createDefaultCompatible(ImageIO.read(Objects.requireNonNull(Game.class.getResourceAsStream("/resources/textures/skins.png")))); } catch (NullPointerException e) { // If a provided InputStream has no name. (in practice meaning it cannot be found.) CrashHandler.crashHandle(e, new ErrorInfo("Sprite Sheet Not Found", ErrorInfo.ErrorType.UNEXPECTED, true, "A sprite sheet was not found.")); return null; - } catch (IOException | IllegalArgumentException e) { + } catch (IOException | IllegalArgumentException | MinicraftImage.MinicraftImageDimensionIncompatibleException e) { // If there is an error reading the file. CrashHandler.crashHandle(e, new ErrorInfo("Sprite Sheet Could Not be Loaded", ErrorInfo.ErrorType.UNEXPECTED, true, "Could not load a sprite sheet.")); return null; diff --git a/src/client/java/minicraft/gfx/MinicraftImage.java b/src/client/java/minicraft/gfx/MinicraftImage.java index 9ef850960..cad745f2a 100644 --- a/src/client/java/minicraft/gfx/MinicraftImage.java +++ b/src/client/java/minicraft/gfx/MinicraftImage.java @@ -1,10 +1,12 @@ package minicraft.gfx; -import minicraft.core.CrashHandler; import minicraft.gfx.SpriteLinker.LinkedSprite; +import minicraft.util.Logging; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Range; import java.awt.image.BufferedImage; -import java.io.IOException; +import java.util.Objects; /** * Although we have SpriteLinker, we still need SpriteSheet for buffering. @@ -18,42 +20,45 @@ public class MinicraftImage { public final int[] pixels; // Integer array of the image's pixels /** - * Default with maximum size of image. - * @param image The image to be added. - * @throws IOException if I/O exception occurs. + * Initializes a {@code MinicraftImage} instance from the provided size. + * All values are filled with zero after construction. + * @param width the final width of this image + * @param height the final height of this image + * @throws IllegalArgumentException if either {@code width} or {@code height} is zero or negative */ - public MinicraftImage(BufferedImage image) throws IOException { - this(image, image.getWidth(), image.getHeight()); + public MinicraftImage(int width, int height) { + if (width < 1) throw new IllegalArgumentException("width cannot be zero or negative"); + if (height < 1) throw new IllegalArgumentException("height cannot be zero or negative"); + + this.width = width; + this.height = height; + pixels = new int[width * height]; } + /** - * Custom size. - * @param image The image to be added. - * @param width The width of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. - * @param height The height of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. - * @throws IOException - */ - public MinicraftImage(BufferedImage image, int width, int height) throws IOException { - if (width % 8 != 0) - CrashHandler.errorHandle(new IllegalArgumentException("Invalid width of SpriteSheet."), new CrashHandler.ErrorInfo( - "Invalid SpriteSheet argument.", CrashHandler.ErrorInfo.ErrorType.HANDLED, - String.format("Invalid width: {}, SpriteSheet width should be a multiple of 8.") - )); - if (height % 8 != 0) - CrashHandler.errorHandle(new IllegalArgumentException("Invalid height of SpriteSheet."), new CrashHandler.ErrorInfo( - "Invalid SpriteSheet argument.", CrashHandler.ErrorInfo.ErrorType.HANDLED, - String.format("Invalid height: {}, SpriteSheet height should be a multiple of 8.") - )); - - // Sets width and height to that of the image - this.width = width - width % 8; - this.height = height - height % 8; - - // If size is bigger than image source, throw error. - if (this.width > image.getWidth() || this.height > image.getHeight()) { - throw new IOException(new IndexOutOfBoundsException(String.format("Requested size %s*%s out of source size %s*%s", - this.width, this.height, image.getWidth(), image.getHeight()))); - } + * Constructs a {@code MinicraftImage} with the maximum size of dimension supplied from the source {@code BufferedImage}. + * @param image the {@code BufferedImage} to be constructed from + * @see LinkedSprite + */ + public MinicraftImage(@NotNull BufferedImage image) { + this(image, image.getWidth(), image.getHeight()); + } + /** + * Constructs a {@code MinicraftImage} with the given size from the source {@code BufferedImage}. + * If the requested size is out of the source's dimension, the remaining values will be left {@code 0}. + * @param image the {@code BufferedImage} to be constructed from + * @param width the requested width for this image, must be a non-zero natural number + * @param height the requested height for this image, must be a non-zero natural number + * @throws IllegalArgumentException if either {@code width} or {@code height} is zero or negative + * @see LinkedSprite + */ + public MinicraftImage(@NotNull BufferedImage image, int width, int height) { + Objects.requireNonNull(image, "image"); + if (width < 1) throw new IllegalArgumentException("width cannot be zero or negative"); + if (height < 1) throw new IllegalArgumentException("height cannot be zero or negative"); + this.width = width; + this.height = height; pixels = image.getRGB(0, 0, width, height, null, 0, width); // Gets the color array of the image pixels // Applying the RGB array into Minicraft rendering system 25 bits RBG array. @@ -84,4 +89,65 @@ public MinicraftImage(BufferedImage image, int width, int height) throws IOExcep pixels[i] = (transparent << 24) + red + green + blue; } } + + /** + * Creates a {@link MinicraftImage} from the provided image with default dimension validation. + * @param image the {@code BufferedImage} to be constructed from + * @return the constructed {@code Minicraft} + * @throws MinicraftImageDimensionIncompatibleException if the image's dimension is not a multiple of 8 + */ + public static MinicraftImage createDefaultCompatible(BufferedImage image) throws MinicraftImageDimensionIncompatibleException { + validateImageDimension(image); + return new MinicraftImage(image); + } + + /** + * Validates if the provided image is compatible with the game's general sprite rendering system. + * @param image The image to be validated + * @throws MinicraftImageDimensionIncompatibleException if the image's dimension is not a multiple of 8 + */ + public static void validateImageDimension(BufferedImage image) throws MinicraftImageDimensionIncompatibleException { + if (image.getHeight() % 8 != 0 || image.getWidth() % 8 != 0) + throw new MinicraftImageDimensionIncompatibleException(image.getWidth(), image.getHeight()); + } + + /** + * Validates if the provided image is respective to the required size. + * @param image The image to be validated + * @param width The requested width + * @param height The requested height + * @throws MinicraftImageRequestOutOfBoundsException if the requested size is out of the image's dimension + */ + public static void validateImageDimension(BufferedImage image, int width, int height) + throws MinicraftImageRequestOutOfBoundsException { + if (image.getWidth() < width || image.getHeight() < height) + throw new MinicraftImageRequestOutOfBoundsException(image.getWidth(), image.getHeight(), width, height); + } + + public static class MinicraftImageDimensionIncompatibleException extends Exception { + private final int width, height; + + public MinicraftImageDimensionIncompatibleException(int width, int height) { + this.width = width; + this.height = height; + } + + public final int getWidth() { return width; } + public final int getHeight() { return height; } + } + + public static class MinicraftImageRequestOutOfBoundsException extends Exception { + private final int srcW, srcH, rqtW, rqtH; + public MinicraftImageRequestOutOfBoundsException(int srcW, int srcH, int rqtW, int rqtH) { + this.srcW = srcW; + this.srcH = srcH; + this.rqtW = rqtW; + this.rqtH = rqtH; + } + + public final int getSourceWidth() { return srcW; } + public final int getSourceHeight() { return srcH; } + public final int getRequestedWidth() { return rqtW; } + public final int getRequestedHeight() { return rqtH; } + } } diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index 23926b161..4c1fc6475 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -422,13 +422,7 @@ public SeriesQuestViewerDisplay(QuestSeries series) { Rectangle menuBounds = menus[1].getBounds(); rasterWidth = menuBounds.getWidth() - MinicraftImage.boxWidth*2; rasterHeight = menuBounds.getHeight() - MinicraftImage.boxWidth*2; - BufferedImage bufferedImage = new BufferedImage(rasterWidth, rasterHeight, BufferedImage.TYPE_INT_RGB); - try { - image = new MinicraftImage(bufferedImage); - } catch (IOException e) { - CrashHandler.crashHandle(e); - throw new UncheckedIOException(e); - } + image = new MinicraftImage(rasterWidth, rasterHeight); rasterPixels = image.pixels; rasterX = menuBounds.getLeft() + MinicraftImage.boxWidth; rasterY = menuBounds.getTop() + MinicraftImage.boxWidth; diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index e7fd1822a..49b8054b5 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -35,6 +35,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.UncheckedIOException; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; @@ -154,10 +155,14 @@ public class ResourcePackDisplay extends Display { defaultPack = Objects.requireNonNull(loadPackMetadata(defaultPackURL)); loadedPacks.add(defaultPack); try { - defaultLogo = new MinicraftImage(ImageIO.read(ResourcePackDisplay.class.getResourceAsStream("/resources/default_pack.png"))); + defaultLogo = MinicraftImage.createDefaultCompatible(ImageIO.read(Objects.requireNonNull(ResourcePackDisplay.class.getResourceAsStream("/resources/default_pack.png")))); } catch (IOException e) { CrashHandler.crashHandle(e); - throw new RuntimeException(); + throw new UncheckedIOException(e); + } catch (MinicraftImage.MinicraftImageDimensionIncompatibleException | NullPointerException e) { + CrashHandler.crashHandle(e); + //noinspection ProhibitedExceptionThrown + throw new RuntimeException(e); } } @@ -439,7 +444,7 @@ public void refreshPack() { openStream(); InputStream in = getResourceAsStream("pack.png"); if (in != null) { - logo = new MinicraftImage(ImageIO.read(in)); + logo = MinicraftImage.createDefaultCompatible(ImageIO.read(in)); // Logo size verification. int h = logo.height; @@ -454,12 +459,12 @@ public void refreshPack() { } close(); - } catch (IOException | NullPointerException e) { + } catch (IOException | NullPointerException | MinicraftImage.MinicraftImageDimensionIncompatibleException e) { Logging.RESOURCEHANDLER_RESOURCEPACK.warn(e, "Unable to load logo in pack: {}, loading default logo instead.", name); if (this == defaultPack) { try { - logo = new MinicraftImage(ImageIO.read(getClass().getResourceAsStream("/resources/logo.png"))); - } catch (IOException e1) { + logo = new MinicraftImage(ImageIO.read(Objects.requireNonNull(getClass().getResourceAsStream("/resources/logo.png")))); + } catch (IOException | NullPointerException e1) { CrashHandler.crashHandle(e1); } } else logo = defaultLogo; @@ -768,8 +773,9 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx try { JSONObject obj = new JSONObject(readStringFromInputStream(pack.getResourceAsStream(m))); SpriteLinker.SpriteMeta meta = new SpriteLinker.SpriteMeta(); - pngs.remove(m.substring(0, m.length() - 5)); - BufferedImage image = ImageIO.read(pack.getResourceAsStream(m.substring(0, m.length() - 5))); + String imgName = m.substring(0, m.length() - 5); + pngs.remove(imgName); + BufferedImage image = ImageIO.read(pack.getResourceAsStream(imgName)); // Applying animations. MinicraftImage sheet; @@ -779,9 +785,12 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx meta.frames = image.getHeight() / 16; if (meta.frames == 0) throw new IOException(new IllegalArgumentException(String.format( "Invalid frames 0 detected with {} in pack: {}", m, pack.name))); + validateImageAsset(pack, imgName, image, 16, 16 * meta.frames); sheet = new MinicraftImage(image, 16, 16 * meta.frames); - } else + } else { + validateImageAsset(pack, imgName, image, 16, 16); sheet = new MinicraftImage(image, 16, 16); + } Renderer.spriteLinker.setSprite(type, m.substring(path.length(), m.length() - 9), sheet); JSONObject borderObj = obj.optJSONObject("border"); @@ -792,7 +801,9 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx String borderK = path + meta.border + ".png"; pngs.remove(borderK); try { - Renderer.spriteLinker.setSprite(type, meta.border, new MinicraftImage(ImageIO.read(pack.getResourceAsStream(borderK)), 24, 24)); + BufferedImage img = ImageIO.read(pack.getResourceAsStream(borderK)); + validateImageAsset(pack, borderK, img, 24, 24); + Renderer.spriteLinker.setSprite(type, meta.border, new MinicraftImage(img, 24, 24)); } catch (IOException e) { Logging.RESOURCEHANDLER_RESOURCEPACK.warn(e, "Unable to read {} with {} in pack: {}", borderK, m, pack.name); meta.border = null; @@ -805,7 +816,9 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx String cornerK = path + meta.corner + ".png"; pngs.remove(cornerK); try { - Renderer.spriteLinker.setSprite(type, meta.corner, new MinicraftImage(ImageIO.read(pack.getResourceAsStream(cornerK)), 16, 16)); + BufferedImage img = ImageIO.read(pack.getResourceAsStream(cornerK)); + validateImageAsset(pack, cornerK, img, 16, 16); + Renderer.spriteLinker.setSprite(type, meta.corner, new MinicraftImage(img, 16, 16)); } catch (IOException e) { Logging.RESOURCEHANDLER_RESOURCEPACK.warn(e, "Unable to read {} with {} in pack: {}", cornerK, m, pack.name); meta.corner = null; @@ -827,10 +840,13 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx BufferedImage image = ImageIO.read(pack.getResourceAsStream(p)); MinicraftImage sheet; if (type == SpriteType.Item) { + validateImageAsset(pack, p, image, 8, 8); sheet = new MinicraftImage(image, 8, 8); // Set the minimum tile sprite size. } else if (type == SpriteType.Tile) { + validateImageAsset(pack, p, image, 16, 16); sheet = new MinicraftImage(image, 16, 16); // Set the minimum item sprite size. } else { + validateImageAsset(pack, p, image); sheet = new MinicraftImage(image); } @@ -841,6 +857,26 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx } } + private static void validateImageAsset(ResourcePack pack, String key, BufferedImage image) { + try { + MinicraftImage.validateImageDimension(image); + } catch (MinicraftImage.MinicraftImageDimensionIncompatibleException e) { + Logging.RESOURCEHANDLER_RESOURCEPACK.warn("Potentially incompatible image detected: {} in pack: {}: "+ + "image size ({}x{}) is not in multiple of 8.", key, pack.name, e.getWidth(), e.getHeight()); + } + } + + private static void validateImageAsset(ResourcePack pack, String key, BufferedImage image, int width, int height) { + validateImageAsset(pack, key, image); + try { + MinicraftImage.validateImageDimension(image, width, height); + } catch (MinicraftImage.MinicraftImageRequestOutOfBoundsException e) { + Logging.RESOURCEHANDLER_RESOURCEPACK.warn("Potentially incompatible image detected: {} in pack: {}: "+ + "image size ({}x{}) is smaller than the required ({}x{}).", key, pack.name, + e.getSourceWidth(), e.getSourceWidth(), e.getRequestedWidth(), e.getRequestedHeight()); + } + } + /** * Loading localization from the pack. * @param pack The pack to be loaded. diff --git a/src/client/java/minicraft/screen/SkinDisplay.java b/src/client/java/minicraft/screen/SkinDisplay.java index 40896cd5d..af8ff0409 100644 --- a/src/client/java/minicraft/screen/SkinDisplay.java +++ b/src/client/java/minicraft/screen/SkinDisplay.java @@ -22,14 +22,11 @@ import javax.imageio.ImageIO; import javax.security.auth.DestroyFailedException; +import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.Path; -import java.nio.file.StandardWatchEventKinds; -import java.nio.file.WatchEvent; -import java.nio.file.WatchService; +import java.nio.file.*; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -195,13 +192,23 @@ private synchronized static void refreshSkinFiles(List files) { String skinPath = file.getName(); String name = skinPath.substring(0, skinPath.length() - 4); if (file.exists()) try { - MinicraftImage sheet = new MinicraftImage(ImageIO.read(new FileInputStream(file)), 64, 32); + BufferedImage img = ImageIO.read(Files.newInputStream(file.toPath())); + MinicraftImage.validateImageDimension(img); + MinicraftImage.validateImageDimension(img, 64, 32); + MinicraftImage sheet = new MinicraftImage(img, 64, 32); Renderer.spriteLinker.setSkin("skin." + name, sheet); skins.put(name, Mob.compileMobSpriteAnimations(0, 0, "skin." + name)); } catch (IOException e) { Logging.RESOURCEHANDLER_SKIN.error("Could not read image at path {}. The file is probably missing or formatted wrong.", skinPath); } catch (SecurityException e) { Logging.RESOURCEHANDLER_SKIN.error("Access to file located at {} was denied. Check if game is given permission.", skinPath); + } catch (MinicraftImage.MinicraftImageRequestOutOfBoundsException e) { + Logging.RESOURCEHANDLER_SKIN.warn("Potentially incompatible image at {}:\n" + + "Source: width {}; height {}\nRequested: width {}; height {}", skinPath, + e.getSourceWidth(), e.getSourceHeight(), e.getRequestedWidth(), e.getRequestedHeight()); + } catch (MinicraftImage.MinicraftImageDimensionIncompatibleException e) { + Logging.RESOURCEHANDLER_SKIN.warn("Potentially incompatible image at {}:\n" + + "Source: width {}; height {}", skinPath, e.getWidth(), e.getHeight()); } else { Renderer.spriteLinker.setSkin("skin." + name, null); if (skins.containsKey(name)) for (LinkedSprite[] a : skins.remove(name)) { From b85c420271bd3af4affa396a78628d4d1aa53c7d Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 29 Oct 2023 01:22:30 +0800 Subject: [PATCH 102/261] Improve kernel performance stage 1 Aparapi Kernel transformation of rendering methods: stage 2 --- src/client/java/minicraft/core/Renderer.java | 2 + src/client/java/minicraft/gfx/Screen.java | 758 ++++++++++++++----- 2 files changed, 560 insertions(+), 200 deletions(-) diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index aa70e828d..86ec1162f 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -125,6 +125,8 @@ public static void render() { if (!canvas.hasFocus()) renderFocusNagger(); // Calls the renderFocusNagger() method, which creates the "Click to Focus" message. + screen.flush(); + BufferStrategy bs = canvas.getBufferStrategy(); // Creates a buffer strategy to determine how the graphics should be buffered. Graphics g = bs.getDrawGraphics(); // Gets the graphics in which java draws the picture diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index 6115fc6ba..a04942e37 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -1,20 +1,16 @@ package minicraft.gfx; import com.aparapi.Kernel; -import minicraft.core.Initializer; +import com.aparapi.Range; import minicraft.core.Renderer; import minicraft.core.Updater; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.screen.ResourcePackDisplay; +import minicraft.util.MyUtils; import org.intellij.lang.annotations.MagicConstant; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.ArrayDeque; +import java.util.HashMap; public class Screen { @@ -34,6 +30,27 @@ public class Screen { protected int[] pixels; // Pixels on the screen + private final ArrayDeque renderings = new ArrayDeque<>(); + private ScreenRenderingKernel renderingKernel; +// private SpriteRenderingDelegate spriteRenderingDelegate; +// private ClearRenderingDelegate clearRenderingDelegate; +// private FillRectRenderingDelegate fillRectRenderingDelegate; +// private DrawAxisLineRenderingDelegate drawAxisLineRenderingDelegate; +// private OverlayRenderingDelegate overlayRenderingDelegate; + + private interface Rendering { + void render(); + } + + private abstract static class RenderingDelegate { + protected final Kernel kernel; + + public RenderingDelegate(Kernel kernel) { + this.kernel = kernel; + kernel.setExplicit(true); + } + } + // Outdated Information: // Since each sheet is 256x256 pixels, each one has 1024 8x8 "tiles" // So 0 is the start of the item sheet 1024 the start of the tile sheet, 2048 the start of the entity sheet, @@ -47,20 +64,66 @@ public Screen() { /** Initializes the screen with the given pixel array instance. */ public void init(int[] pixels) { this.pixels = pixels; + renderingKernel = new ScreenRenderingKernel(); + renderingKernel.pixels = pixels; + renderingKernel.setExplicit(true); + renderingKernel.put(pixels); +// spriteRenderingDelegate = new SpriteRenderingDelegate(); +// clearRenderingDelegate = new ClearRenderingDelegate(); +// fillRectRenderingDelegate = new FillRectRenderingDelegate(); +// drawAxisLineRenderingDelegate = new DrawAxisLineRenderingDelegate(); +// overlayRenderingDelegate = new OverlayRenderingDelegate(); } /** Clears all the colors on the screen */ public void clear(int color) { // Turns each pixel into a single color (clearing the screen!) - int[] pixels = this.pixels; - Kernel kernel = new Kernel() { - @Override - public void run() { - pixels[getGlobalId()] = color; - } - }; - kernel.execute(pixels.length); - kernel.dispose(); +// renderings.add(new ClearRendering(color)); + renderingKernel.executeScreenClear(color); + } + +// private class ClearRendering implements Rendering { +// private final int color; +// +// public ClearRendering(int color) { +// this.color = color; +// } +// +// @Override +// public void render() { +// clearRenderingDelegate.render(new int[] {color}, pixels); +// } +// } + +// private static class ClearRenderingDelegate extends RenderingDelegate { +// @SuppressWarnings("MismatchedReadAndWriteOfArray") +// private static Kernel makeKernel() { +// int[] color = new int[1], pixels = new int[1]; +// return new Kernel() { +// @Override +// public void run() { +// pixels[getGlobalId()] = color[0]; +// } +// }; +// } +// +// public ClearRenderingDelegate() { +// super(makeKernel()); +// } +// +// public void render(int[] color, int[] pixels) { +// kernel.put(color).put(pixels); +// kernel.execute(pixels.length); +// kernel.get(pixels); +// } +// } + + public void flush() { +// Rendering rendering; +// while ((rendering = renderings.poll()) != null) { +// rendering.render(); +// } + renderingKernel.get(pixels); } public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet) { render(xp, yp, xt, yt, bits, sheet, -1); } @@ -75,9 +138,12 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee public void render(int xp, int yp, Sprite sprite, boolean fullbright) { render(xp, yp, sprite, 0, fullbright, 0); } public void render(int xp, int yp, Sprite sprite, int mirror, boolean fullbright) { render(xp, yp, sprite, mirror, fullbright, 0); } public void render(int xp, int yp, Sprite sprite, int mirror, boolean fullbright, int color) { + boolean mirrorX = (mirror & BIT_MIRROR_X) > 0; // Horizontally. + boolean mirrorY = (mirror & BIT_MIRROR_Y) > 0; // Vertically. for (int r = 0; r < sprite.spritePixels.length; r++) { - for (int c = 0; c < sprite.spritePixels[r].length; c++) { - Sprite.Px px = sprite.spritePixels[r][c]; + int lr = mirrorY ? sprite.spritePixels.length - 1 - r : r; + for (int c = 0; c < sprite.spritePixels[lr].length; c++) { + Sprite.Px px = sprite.spritePixels[lr][mirrorX ? sprite.spritePixels[lr].length - 1 - c : c]; render(xp + c * 8, yp + r * 8, px, mirror, sprite.color, fullbright, color); } } @@ -95,167 +161,235 @@ public void render(int xp, int yp, Sprite.Px pixel, int mirror, int whiteTint, b public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint, boolean fullbright, int color) { if (sheet == null) return; // Verifying that sheet is not null. - // xp and yp are originally in level coordinates, but offset turns them to screen coordinates. - int xpt = xp - xOffset; //account for screen offset - int ypt = yp - yOffset; - - // Determines if the image should be mirrored... - boolean[] mirrorX = new boolean [] { (bits & BIT_MIRROR_X) > 0 }; // Horizontally. - boolean[] mirrorY = new boolean [] { (bits & BIT_MIRROR_Y) > 0 }; // Vertically. - boolean[] wBright = new boolean [] { fullbright }; - // Validation check if (xt * 8 + yt * 8 * sheet.width + 7 + 7 * sheet.width >= sheet.pixels.length) { render(xp, yp, 0, 0, bits, Renderer.spriteLinker.missingSheet(SpriteType.Item), -1, false, 0); return; } - int toffs = xt * 8 + yt * 8 * sheet.width; // Gets the offset of the sprite into the spritesheet pixel array, the 8's represent the size of the box. (8 by 8 pixel sprite boxes) - int[] sheetPixels = sheet.pixels; - int sheetWidth = sheet.width; - - // THIS LOOPS FOR EVERY PIXEL - int[] pixels = this.pixels; - int w = Screen.w, h = Screen.h; - int WHITE = Color.WHITE; - Kernel kernel = new Kernel() { - @Override - public void run() { - int subPos = getGlobalId(); - int x = subPos % 8; - int y = subPos / 8; - int ys = y; // Current y pixel - if (mirrorY[0]) ys = 7 - y; // Reverses the pixel for a mirroring effect - if (y + ypt < 0 || y + ypt >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. - if (x + xpt < 0 || x + xpt >= w) return; // Skip rest if out of bounds. - - int xs = x; // Current x pixel - if (mirrorX[0]) xs = 7 - x; // Reverses the pixel for a mirroring effect - - int col = sheetPixels[toffs + xs + ys * sheetWidth]; // Gets the color of the current pixel from the value stored in the sheet. - - boolean isTransparent = (col >> 24 == 0); - - if (!isTransparent) { - int index = (x + xpt) + (y + ypt) * w; - - if (whiteTint != -1 && col == 0x1FFFFFF) { - // If this is white, write the whiteTint over it - pixels[index] = Color.upgrade(whiteTint); - } else { - // Inserts the colors into the image - if (wBright[0]) { - pixels[index] = WHITE; - } else { - if (color != 0) { - - pixels[index] = color; - } else { - pixels[index] = Color.upgrade(col); - } - } - } - } - } - }; - kernel.execute(64); // Loops a whole sheet tile. - kernel.dispose(); + // xp and yp are originally in level coordinates, but offset turns them to screen coordinates. + // xOffset and yOffset account for screen offset + render(xp - xOffset, yp - yOffset, xt * 8, yt * 8, 8, 8, sheet, bits, whiteTint, fullbright, color); } public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet) { render(xp, yp, xt, yt ,tw, th, sheet, -1); } - public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int whiteTint) { - render(xp, yp, xt, yt, tw, th, sheet, whiteTint, false); + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors) { + render(xp, yp, xt, yt ,tw, th, sheet, mirrors, -1); } - public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int whiteTint, boolean fullbright) { - render(xp, yp, xt, yt, tw, th, sheet, whiteTint, fullbright, 0); + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors, int whiteTint) { + render(xp, yp, xt, yt, tw, th, sheet, mirrors, whiteTint, false); } - public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int whiteTint, boolean fullbright, int color) { + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors, int whiteTint, boolean fullbright) { + render(xp, yp, xt, yt, tw, th, sheet, mirrors, whiteTint, fullbright, 0); + } + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors, int whiteTint, boolean fullbright, int color) { if (sheet == null) return; // Verifying that sheet is not null. - int toffs = xt + yt * sheet.width; - int[] pixels = this.pixels; - int w = Screen.w, h = Screen.h; - int WHITE = Color.WHITE; - Kernel kernel = new Kernel() { - @Override - public void run() { - int subPos = getGlobalId(); - int x = subPos % 8; - int y = subPos / 8; - if (y + yp < 0 || y + yp >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. - if (x + xp < 0 || x + xp >= w) return; // Skip rest if out of bounds. - - int col = sheet.pixels[toffs + x + y * sheet.width]; // Gets the color of the current pixel from the value stored in the sheet. - - boolean isTransparent = (col >> 24 == 0); - - if (!isTransparent) { - int index = (x + xp) + (y + yp) * w; - - if (whiteTint != -1 && col == 0x1FFFFFF) { - // If this is white, write the whiteTint over it - pixels[index] = Color.upgrade(whiteTint); - } else { - // Inserts the colors into the image - if (fullbright) { - pixels[index] = WHITE; - } else { - if (color != 0) { - pixels[index] = color; - } else { - pixels[index] = Color.upgrade(col); - } - } - } - } - } - }; - kernel.execute(tw * th); // Loops a whole sheet area. - kernel.dispose(); + // Determines if the image should be mirrored... + boolean mirrorX = (mirrors & BIT_MIRROR_X) > 0; // Horizontally. + boolean mirrorY = (mirrors & BIT_MIRROR_Y) > 0; // Vertically. +// renderings.add(new SpriteRendering(xp, yp, xt + yt * sheet.width, tw, th, whiteTint, color, +// mirrorX, mirrorY, fullbright, sheet)); + renderingKernel.executeSpriteRender(xp, yp, xt + yt * sheet.width, tw, th, whiteTint, color, + mirrorX, mirrorY, fullbright, sheet); } - public void fillRect(int xp, int yp, int ww, int hh, int color) { - int[] pixels = this.pixels; - int w = Screen.w, h = Screen.h; - Kernel kernel = new Kernel() { - @Override - public void run() { - int id = getGlobalId(); - int x = xp + id % ww; - int y = yp + id / ww; - if (y < 0 || y >= h || x < 0 || x >= w) return; - pixels[x + y * w] = color; - } - }; - kernel.execute(ww * hh); - kernel.dispose(); +// private class SpriteRendering implements Rendering { +// private final int xp, yp, toffs, tw, th, whiteTint, color; +// private final boolean mirrorX, mirrorY, fullBright; +// private final MinicraftImage sheet; +// +// public SpriteRendering(int xp, int yp, int toffs, int tw, int th, int whiteTint, int color, boolean mirrorX, +// boolean mirrorY, boolean fullBright, MinicraftImage sheet) { +// this.xp = xp; +// this.yp = yp; +// this.toffs = toffs; +// this.tw = tw; +// this.th = th; +// this.whiteTint = whiteTint; +// this.color = color; +// this.mirrorX = mirrorX; +// this.mirrorY = mirrorY; +// this.fullBright = fullBright; +// this.sheet = sheet; +// } +// +// @Override +// public void render() { +// spriteRenderingDelegate.render(new int[] {xp}, new int[] {yp}, new int[] {tw}, new int[] {th}, +// new int[] {toffs}, new int[] {sheet.width}, new int[] {whiteTint}, new int[] {color}, +// new boolean[] {mirrorX}, new boolean[] {mirrorY}, new boolean[] {fullBright}, sheet.pixels, pixels); +// } +// } + +// private static class SpriteRenderingDelegate extends RenderingDelegate { +// @SuppressWarnings("MismatchedReadAndWriteOfArray") +// private static Kernel makeKernel() { +// // Constants +// int WHITE = Color.WHITE; +// int w = Screen.w, h = Screen.h; +// // All of these variables are placeholders to bypass Aparapi limitations. +// int[] yp = new int[1], xp = new int[1], tw = new int[] {2}, th = new int[] {2}, +// toffs = new int[1], sheetWidth = new int[] {2}, whiteTint = new int[] {-1}, color = new int[1]; +// boolean[] mirrorX = new boolean[1], mirrorY = new boolean[1], wBright = new boolean[1]; +// int[][] sheetPixels = f; int[] pixels = Renderer.screen.pixels; +// return new Kernel() { +// @Override +// public void run() { +// int x = getGlobalId(0); +// int y = getGlobalId(1); +// if (y + yp[0] < 0 || y + yp[0] >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. +// if (x + xp[0] < 0 || x + xp[0] >= w) return; // Skip rest if out of bounds. +// +// int sx = mirrorX[0] ? tw[0] - 1 - x : x, sy = mirrorY[0] ? th[0] - 1 - y : y; +// int col = sheetPixels[0][toffs[0] + sx + sy * sheetWidth[0]]; // Gets the color of the current pixel from the value stored in the sheet. +// if (col >> 24 != 0) { // if not transparent +// int index = (x + xp[0]) + (y + yp[0]) * w; +// if (whiteTint[0] != -1 && col == 0x1FFFFFF) { +// // If this is white, write the whiteTint over it +// pixels[index] = Color.upgrade(whiteTint[0]); +// } else { +// // Inserts the colors into the image +// if (wBright[0]) { +// pixels[index] = WHITE; +// } else { +// if (color[0] != 0) { +// +// pixels[index] = color[0]; +// } else { +// pixels[index] = Color.upgrade(col); +// } +// } +// } +// } +// } +// }; +// } +// +// public SpriteRenderingDelegate() { +// super(makeKernel()); +// } +// +// public void render(int[] val$xp, int[] val$yp, int[] val$tw, int[] val$th, int[] val$toffs, int[] val$sheetWidth, int[] val$whiteTint, int[] val$color, +// boolean[] val$mirrorX, boolean[] val$mirrorY, boolean[] val$wBright, int[] val$sheetPixels, int[] val$pixels) { +// f[0] = new int[new Random().nextInt(128)+10]; +// Arrays.fill(f[0], 256); +// kernel.put(f).put(val$xp).put(val$yp).put(val$tw).put(val$th).put(val$toffs).put(val$sheetWidth).put(val$whiteTint) +// .put(val$color).put(val$mirrorX).put(val$mirrorY).put(val$wBright).put(val$sheetPixels).put(val$pixels); +// kernel.execute(Range.create2D(val$tw[0], val$th[0])); // Loops a whole sheet area. +// kernel.get(val$pixels); +// } +// } + + public void fillRect(int xp, int yp, int w, int h, int color) { +// renderings.add(new FillRectRendering(xp, yp, color, w, h)); + renderingKernel.executeFillRect(xp, yp, color, w, h); } +// private class FillRectRendering implements Rendering { +// private final int xp, yp, color, w, h; +// +// public FillRectRendering(int xp, int yp, int color, int w, int h) { +// this.xp = xp; +// this.yp = yp; +// this.color = color; +// this.w = w; +// this.h = h; +// } +// +// @Override +// public void render() { +// fillRectRenderingDelegate.render(new int[] {xp}, new int[] {yp}, new int[] {color}, pixels, w, h); +// } +// } + +// private static class FillRectRenderingDelegate extends RenderingDelegate { +// @SuppressWarnings("MismatchedReadAndWriteOfArray") +// private static Kernel makeKernel() { +// int w = Screen.w, h = Screen.h; +// int[] xp = new int[1], yp = new int[1], color = new int[1], pixels = new int[1]; +// return new Kernel() { +// @Override +// public void run() { +// int x = xp[0] + getGlobalId(0); +// int y = yp[0] + getGlobalId(1); +// if (y < 0 || y >= h || x < 0 || x >= w) return; +// pixels[x + y * w] = color[0]; +// } +// }; +// } +// +// public FillRectRenderingDelegate() { +// super(makeKernel()); +// } +// +// public void render(int[] xp, int[] yp, int[] color, int[] pixels, int w, int h) { +// kernel.put(xp).put(yp).put(color).put(pixels); +// kernel.execute(Range.create2D(w, h)); +// kernel.get(pixels); +// } +// } + /** * Draw a straight line along an axis. * @param axis The axis to draw along: {@code 0} for x-axis; {@code 1} for y-axis * @param l The length of the line */ public void drawAxisLine(int xp, int yp, @MagicConstant(intValues = {0, 1}) int axis, int l, int color) { - int[] pixels = this.pixels; - int w = Screen.w; - Kernel kernel = new Kernel() { - @Override - public void run() { - int id = getGlobalId(); - if (axis == 0) { // x-axis - pixels[xp + id + yp * w] = color; - } else { // y-axis - pixels[xp + (yp + id) * w] = color; - } - } - }; - kernel.execute(l); - kernel.dispose(); +// renderings.add(new DrawAxisLineRendering(xp, yp, axis, color, l)); + renderingKernel.executeDrawAxisLine(xp, yp, axis, color, l); } +// private class DrawAxisLineRendering implements Rendering { +// private final int xp, yp, axis, color, l; +// +// public DrawAxisLineRendering(int xp, int yp, int axis, int color, int l) { +// this.xp = xp; +// this.yp = yp; +// this.axis = axis; +// this.color = color; +// this.l = l; +// } +// +// @Override +// public void render() { +// drawAxisLineRenderingDelegate.render(new int[] {xp}, new int[] {yp}, new int[] {axis}, +// new int[] {color}, pixels, l); +// } +// } + +// private static class DrawAxisLineRenderingDelegate extends RenderingDelegate { +// @SuppressWarnings("MismatchedReadAndWriteOfArray") +// private static Kernel makeKernel() { +// int w = Screen.w; +// int[] axis = new int[1], color = new int[1], xp = new int[1], yp = new int[1]; +// int[] pixels = new int[1]; +// return new Kernel() { +// @Override +// public void run() { +// int id = getGlobalId(); +// if (axis[0] == 0) { // x-axis +// pixels[xp[0] + id + yp[0] * w] = color[0]; +// } else { // y-axis +// pixels[xp[0] + (yp[0] + id) * w] = color[0]; +// } +// } +// }; +// } +// +// public DrawAxisLineRenderingDelegate() { +// super(makeKernel()); +// } +// +// public void render(int[] xp, int[] yp, int[] axis, int[] color, int[] pixels, int l) { +// kernel.put(xp).put(yp).put(axis).put(color).put(pixels); +// kernel.execute(l); +// kernel.get(pixels); +// } +// } + /** Sets the offset of the screen */ public void setOffset(int xOffset, int yOffset) { // This is called in few places, one of which is level.renderBackground, right before all the tiles are rendered. The offset is determined by the Game class (this only place renderBackground is called), by using the screen's width and the player's position in the level. @@ -299,36 +433,72 @@ public void overlay(Screen screen2, int currentLevel, int xa, int ya) { else if(currentLevel >= 5) tintFactor = -MAXDARK; - int[] pixels = this.pixels; - int[] oPixels = screen2.pixels; // The Integer array of pixels to overlay the screen with. - double finalTintFactor = tintFactor; - int w = Screen.w, h = Screen.h; - Kernel kernel = new Kernel() { - @Override - public void run() { - int id = getGlobalId(); - int x = id % w; - int y = id / h; - if (oPixels[id] / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { - - /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... - if (currentLevel < 3) { // if in caves... - /// in the caves, not being lit means being pitch black. - pixels[id] = 0; - } else { - /// Outside the caves, not being lit simply means being darker. - pixels[id] = Color.tintColor(pixels[id], (int) finalTintFactor); // darkens the color one shade. - } - } - - // Increase the tinting of all colors by 20. - pixels[id] = Color.tintColor(pixels[id], 20); - } - }; - kernel.execute(w * h); - kernel.dispose(); + // The Integer array of pixels to overlay the screen with. +// renderings.add(new OverlayRendering(xa, ya, currentLevel, (int) tintFactor, screen2.pixels)); + renderingKernel.executeOverlayRender(xa, ya, currentLevel, (int) tintFactor, screen2.pixels); } +// private class OverlayRendering implements Rendering { +// private final int xa, ya, currentLevel, tintFactor; +// private final int[] oPixels; +// +// public OverlayRendering(int xa, int ya, int currentLevel, int tintFactor, int[] oPixels) { +// this.xa = xa; +// this.ya = ya; +// this.currentLevel = currentLevel; +// this.tintFactor = tintFactor; +// this.oPixels = oPixels; +// } +// +// @Override +// public void render() { +// overlayRenderingDelegate.render(new int[] {xa}, new int[] {ya}, new int[] {currentLevel}, +// new int[] {tintFactor}, oPixels, pixels); +// } +// } + +// private static class OverlayRenderingDelegate extends RenderingDelegate { +// @SuppressWarnings("MismatchedReadAndWriteOfArray") +// private static Kernel makeKernel() { +// int w = Screen.w; +// int[] dither = Screen.dither; +// int[] xa = new int[1], ya = new int[1], currentLevel = new int[1], tintFactor = new int[1]; +// int[] oPixels = new int[1], pixels = new int[1]; +// return new Kernel() { +// @Override +// public void run() { +// int x = getGlobalId(0); +// int y = getGlobalId(1); +// int id = x + y * w; +// if (oPixels[id] / 10 <= dither[((x + xa[0]) & 3) + ((y + ya[0]) & 3) * 4]) { +// +// /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... +// if (currentLevel[0] < 3) { // if in caves... +// /// in the caves, not being lit means being pitch black. +// pixels[id] = 0; +// } else { +// /// Outside the caves, not being lit simply means being darker. +// pixels[id] = Color.tintColor(pixels[id], tintFactor[0]); // darkens the color one shade. +// } +// } +// +// // Increase the tinting of all colors by 20. +// pixels[id] = Color.tintColor(pixels[id], 20); +// } +// }; +// } +// +// public OverlayRenderingDelegate() { +// super(makeKernel()); +// } +// +// public void render(int[] xa, int[] ya, int[] currentLevel, int[] tintFactor, int[] oPixels, int[] pixels) { +// kernel.put(xa).put(ya).put(currentLevel).put(tintFactor).put(oPixels).put(pixels); +// kernel.execute(Range.create2D(w, h)); +// kernel.get(pixels); +// } +// } + public void renderLight(int x, int y, int r) { // Applies offsets: x -= xOffset; @@ -353,26 +523,214 @@ public void renderLight(int x, int y, int r) { int hh = y1 - y0; int[] pixels = this.pixels; int w = Screen.w, h = Screen.h; - Kernel kernel = new Kernel() { - @Override - public void run() { - int id = getGlobalId(); - int xx = xa + id % ww; - int yy = ya + id / ww; - if (xx < 0 || xx >= w || yy < 0 || yy >= h) return; - int yd = yy - yp; // Get distance to the previous y position. - yd = yd * yd; // Square that distance - int xd = xx - xp; // Get x delta - int dist = xd * xd + yd; // Square x delta, then add the y delta, to get total distance. - if (dist <= r * r) { - // If the distance from the center (x,y) is less or equal to the radius... - int br = 255 - dist * 255 / (r * r); // area where light will be rendered. // r*r is becuase dist is still x*x+y*y, of pythag theorem. - // br = brightness... literally. from 0 to 255. - if (pixels[xx + yy * w] < br) pixels[xx + yy * w] = br; // Pixel cannot be smaller than br; in other words, the pixel color (brightness) cannot be less than br. +// renderings.add(new Rendering(new Kernel() { +// @Override +// public void run() { +// int xx = xa + getGlobalId(0); +// int yy = ya + getGlobalId(1); +// if (xx < 0 || xx >= w || yy < 0 || yy >= h) return; +// int yd = yy - yp; // Get distance to the previous y position. +// yd = yd * yd; // Square that distance +// int xd = xx - xp; // Get x delta +// int dist = xd * xd + yd; // Square x delta, then add the y delta, to get total distance. +// if (dist <= r * r) { +// // If the distance from the center (x,y) is less or equal to the radius... +// int br = 255 - dist * 255 / (r * r); // area where light will be rendered. // r*r is becuase dist is still x*x+y*y, of pythag theorem. +// // br = brightness... literally. from 0 to 255. +// if (pixels[xx + yy * w] < br) pixels[xx + yy * w] = br; // Pixel cannot be smaller than br; in other words, the pixel color (brightness) cannot be less than br. +// } +// } +// }, kernel -> kernel.put(pixels), new Range2DParam(ww, hh))); + } + + private static final class ScreenRenderingKernel extends Kernel { + private final HashMap sheetPixelMap = new HashMap<>(); + private @Constant final int[] dither = new int[] { + 0, 8, 2, 10, + 12, 4, 14, 6, + 3, 11, 1, 9, + 15, 7, 13, 5 + }; + final int w = Screen.w, h = Screen.h, WHITE = Color.WHITE; + static final int FUNC_CLEAR = 0; + static final int FUNC_RENDER = 1; + static final int FUNC_FILL_RECT = 2; + static final int FUNC_DRAW_AXIS_LINE = 3; + static final int FUNC_OVERLAY = 4; + int xp, yp, toffs, tw, th, whiteTint, color, sheetWidth, xa, ya, ww, hh, axis, currentLevel, tintFactor; + int[] sheetPixels = new int[65536]; // Limited 65536 pixels + public int[] pixels; + int[] oPixels = new int[w*h]; + @Constant boolean[] mirrorX = new boolean[1], mirrorY = new boolean[1], fullBright = new boolean[1]; + @MagicConstant(intValues = {FUNC_CLEAR, FUNC_RENDER, FUNC_FILL_RECT, FUNC_DRAW_AXIS_LINE, FUNC_OVERLAY}) + private int function; + + @Override + public void run() { + if (function == ScreenRenderingKernel.FUNC_CLEAR) { + screenClear(); + } else if (function == ScreenRenderingKernel.FUNC_RENDER) { + spriteRender(); + } else if (function == ScreenRenderingKernel.FUNC_FILL_RECT) { + fillRect(); + } else if (function == ScreenRenderingKernel.FUNC_DRAW_AXIS_LINE) { + drawAxisLine(); + } else if (function == ScreenRenderingKernel.FUNC_OVERLAY) { + overlayRender(); + } + } + + private void copySheetPixels(int[] src) { + if (sheetPixelMap.containsKey(src)) { + sheetPixels = sheetPixelMap.get(src); + return; + } + int[] target = new int[65536]; + Kernel kernel = new Kernel() { + @Override + public void run() { + int id = getGlobalId(); + target[id] = src[id]; + } + }; + kernel.execute(src.length); + kernel.dispose(); + sheetPixelMap.put(src, target); + sheetPixels = target; + } + + public void screenClear() { + pixels[getGlobalId()] = color; + } + + public void executeScreenClear(int color) { + this.color = color; + this.function = FUNC_CLEAR; + execute(Range.create(pixels.length)); + } + + public void spriteRender() { + int x = getGlobalId(0); + int y = getGlobalId(1); + if (y + yp < 0 || y + yp >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. + if (x + xp < 0 || x + xp >= w) return; // Skip rest if out of bounds. + + int sx = mirrorX[0] ? tw - 1 - x : x, sy = mirrorY[0] ? th - 1 - y : y; + int col = sheetPixels[toffs + sx + sy * sheetWidth]; // Gets the color of the current pixel from the value stored in the sheet. + if (col >> 24 != 0) { // if not transparent + int index = (x + xp) + (y + yp) * w; + if (whiteTint != -1 && col == 0x1FFFFFF) { + // If this is white, write the whiteTint over it + pixels[index] = Color.upgrade(whiteTint); + } else { + // Inserts the colors into the image + if (fullBright[0]) { + pixels[index] = WHITE; + } else { + if (color != 0) { + + pixels[index] = color; + } else { + pixels[index] = Color.upgrade(col); + } + } } } - }; - kernel.execute(ww * hh); - kernel.dispose(); + } + + public void executeSpriteRender(int xp, int yp, int toffs, int tw, int th, int whiteTint, int color, boolean mirrorX, + boolean mirrorY, boolean fullBright, MinicraftImage sheet) { + this.xp = xp; + this.yp = yp; + this.toffs = toffs; + this.tw = tw; + this.th = th; + this.whiteTint = whiteTint; + this.color = color; + this.mirrorX = new boolean[]{mirrorX}; + this.mirrorY = new boolean[]{mirrorY}; + this.fullBright = new boolean[]{fullBright}; + copySheetPixels(sheet.pixels); + this.sheetWidth = sheet.width; + this.function = FUNC_RENDER; + execute(Range.create2D(tw, th)); // Loops a whole sheet area. + } + + public void fillRect() { + int x = xp + getGlobalId(0); + int y = yp + getGlobalId(1); + if (y < 0 || y >= h || x < 0 || x >= w) return; + pixels[x + y * w] = color; + } + + public void executeFillRect(int xp, int yp, int color, int w, int h) { + this.xp = xp; + this.yp = yp; + this.color = color; + this.function = FUNC_FILL_RECT; + execute(Range.create2D(w, h)); + } + + public void drawAxisLine() { + int id = getGlobalId(); + if (axis == 0) { // x-axis + pixels[xp + id + yp * w] = color; + } else { // y-axis + pixels[xp + (yp + id) * w] = color; + } + } + + public void executeDrawAxisLine(int xp, int yp, int axis, int color, int l) { + this.xp = xp; + this.yp = yp; + this.axis = axis; + this.color = color; + this.function = FUNC_DRAW_AXIS_LINE; + execute(Range.create(l)); + } + + public void overlayRender() { + int x = getGlobalId(0); + int y = getGlobalId(1); + int id = x + y * w; + if (oPixels[id] / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { + + /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... + if (currentLevel < 3) { // if in caves... + /// in the caves, not being lit means being pitch black. + pixels[id] = 0; + } else { + /// Outside the caves, not being lit simply means being darker. + pixels[id] = tintColor(pixels[id], tintFactor); // darkens the color one shade. + } + } + + // Increase the tinting of all colors by 20. + pixels[id] = tintColor(pixels[id], 20); + } + + private static int tintColor(int rgbInt, int amount) { + if (rgbInt < 0) return rgbInt; // This is "transparent". + + int r = (rgbInt & 0xFF_00_00) >> 16; + int g = (rgbInt & 0x00_FF_00) >> 8; + int b = (rgbInt & 0x00_00_FF); + + r = MyUtils.clamp(r+amount, 0, 255); + g = MyUtils.clamp(g+amount, 0, 255); + b = MyUtils.clamp(b+amount, 0, 255); + + return r << 16 | g << 8 | b; + } + + public void executeOverlayRender(int xa, int ya, int currentLevel, int tintFactor, int[] oPixels) { + this.xa = xa; + this.ya = ya; + this.currentLevel = currentLevel; + this.tintFactor = tintFactor; + this.oPixels = oPixels; + this.function = FUNC_OVERLAY; + execute(Range.create2D(w, h)); + } } } From e611efdd3a91bc24782b43a18dac3bf8a9da1edf Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:49:35 +0800 Subject: [PATCH 103/261] Remove GPU access and replace with Graphics2D API Aparapi is removed by the efficiency and necessarity. All the rendering funtions are replaced with either Graphics2D API or raw array looping. --- build.gradle | 1 - src/client/java/minicraft/core/Renderer.java | 26 +- src/client/java/minicraft/gfx/Screen.java | 840 ++++++------------ .../screen/OnScreenKeyboardMenu.java | 10 +- .../java/minicraft/screen/QuestsDisplay.java | 8 +- 5 files changed, 308 insertions(+), 577 deletions(-) diff --git a/build.gradle b/build.gradle index 380f9d077..8911d1700 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,6 @@ project(":client") { implementation 'com.badlogicgames.gdx:gdx-box2d:1.11.0' implementation 'com.badlogicgames.gdx:gdx-controllers:1.9.13' implementation 'com.badlogicgames.jamepad:jamepad:2.0.20.0' - implementation 'com.aparapi:aparapi:3.0.0' } application { diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index 86ec1162f..d6a8b943d 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -37,7 +37,7 @@ import javax.imageio.ImageIO; import java.awt.Canvas; -import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.geom.AffineTransform; import java.awt.image.AffineTransformOp; import java.awt.image.BufferStrategy; @@ -67,7 +67,6 @@ private Renderer() { static Canvas canvas = new Canvas(); private static BufferedImage image; // Creates an image to be displayed on the screen. - private static Screen lightScreen; // Creates a front screen to render the darkness in caves (Fog of war). public static boolean readyToRenderGameplay = false; public static boolean showDebugInfo = false; @@ -97,11 +96,10 @@ public static MinicraftImage loadDefaultSkinSheet() { } public static void initScreen() { - screen = new Screen(); - lightScreen = new Screen(); - image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); - screen.init(((DataBufferInt) image.getRaster().getDataBuffer()).getData()); + screen = new Screen(image); + //lightScreen = new Screen(); + hudSheet = new LinkedSprite(SpriteType.Gui, "hud"); canvas.createBufferStrategy(3); @@ -114,6 +112,8 @@ public static void initScreen() { public static void render() { if (screen == null) return; // No point in this if there's no gui... :P + screen.clear(0); + if (readyToRenderGameplay) { renderLevel(); if (player.renderGUI) renderGui(); @@ -125,13 +125,16 @@ public static void render() { if (!canvas.hasFocus()) renderFocusNagger(); // Calls the renderFocusNagger() method, which creates the "Click to Focus" message. - screen.flush(); - BufferStrategy bs = canvas.getBufferStrategy(); // Creates a buffer strategy to determine how the graphics should be buffered. - Graphics g = bs.getDrawGraphics(); // Gets the graphics in which java draws the picture + Graphics2D g = (Graphics2D) bs.getDrawGraphics(); // Gets the graphics in which java draws the picture g.clearRect(0, 0, canvas.getWidth(), canvas.getHeight()); // Draws a rect to fill the whole window (to cover last?) + + + // Flushes the screen to the renderer. + screen.flush(); + // Scale the pixels. int ww = getWindowSize().width; int hh = getWindowSize().height; @@ -211,10 +214,9 @@ private static void renderLevel() { // This creates the darkness in the caves if ((currentLevel != 3 || Updater.tickCount < Updater.dayLength / 4 || Updater.tickCount > Updater.dayLength / 2) && !isMode("minicraft.settings.mode.creative")) { - lightScreen.clear(0); // This doesn't mean that the pixel will be black; it means that the pixel will be DARK, by default; lightScreen is about light vs. dark, not necessarily a color. The light level it has is compared with the minimum light values in dither to decide whether to leave the cell alone, or mark it as "dark", which will do different things depending on the game level and time of day. int brightnessMultiplier = player.potioneffects.containsKey(PotionType.Light) ? 12 : 8; // Brightens all light sources by a factor of 1.5 when the player has the Light potion effect. (8 above is normal) - level.renderLight(lightScreen, xScroll, yScroll, brightnessMultiplier); // Finds (and renders) all the light from objects (like the player, lanterns, and lava). - screen.overlay(lightScreen, currentLevel, xScroll, yScroll); // Overlays the light screen over the main screen. + level.renderLight(screen, xScroll, yScroll, brightnessMultiplier); // Finds (and renders) all the light from objects (like the player, lanterns, and lava). + screen.overlay(currentLevel, xScroll, yScroll); // Overlays the light screen over the main screen. } } diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index a04942e37..616e300a1 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -1,16 +1,21 @@ package minicraft.gfx; -import com.aparapi.Kernel; -import com.aparapi.Range; import minicraft.core.Renderer; import minicraft.core.Updater; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.util.MyUtils; import org.intellij.lang.annotations.MagicConstant; +import java.awt.AlphaComposite; +import java.awt.Graphics2D; +import java.awt.RadialGradientPaint; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferByte; +import java.awt.image.DataBufferInt; +import java.math.BigDecimal; +import java.math.MathContext; import java.util.ArrayDeque; -import java.util.HashMap; +import java.util.ArrayList; public class Screen { @@ -28,102 +33,218 @@ public class Screen { private static final int BIT_MIRROR_X = 0x01; // Written in hexadecimal; binary: 01 private static final int BIT_MIRROR_Y = 0x02; // Binary: 10 - protected int[] pixels; // Pixels on the screen + private final BufferedImage image; + private final int[] pixels; private final ArrayDeque renderings = new ArrayDeque<>(); - private ScreenRenderingKernel renderingKernel; -// private SpriteRenderingDelegate spriteRenderingDelegate; -// private ClearRenderingDelegate clearRenderingDelegate; -// private FillRectRenderingDelegate fillRectRenderingDelegate; -// private DrawAxisLineRenderingDelegate drawAxisLineRenderingDelegate; -// private OverlayRenderingDelegate overlayRenderingDelegate; + private final LightOverlay lightOverlay; + private ClearRendering lastClearRendering = null; + + // Outdated Information: + // Since each sheet is 256x256 pixels, each one has 1024 8x8 "tiles" + // So 0 is the start of the item sheet 1024 the start of the tile sheet, 2048 the start of the entity sheet, + // And 3072 the start of the gui sheet + + public Screen(BufferedImage image) { + /// Screen width and height are determined by the actual game window size, meaning the screen is only as big as the window.buffer = new BufferedImage(Screen.w, Screen.h); + this.image = image; + pixels = ((DataBufferInt) image.getRaster().getDataBuffer()).getData(); + lightOverlay = new LightOverlay(); + } private interface Rendering { - void render(); + /** Invoked by {@link Renderer#render()}. */ + void render(Graphics2D graphics); + } + + private void queue(Rendering rendering) { + renderings.add(rendering); } - private abstract static class RenderingDelegate { - protected final Kernel kernel; + private static abstract class ClearRendering implements Rendering {} - public RenderingDelegate(Kernel kernel) { - this.kernel = kernel; - kernel.setExplicit(true); + private static class SolidClearRendering extends ClearRendering { + private final int color; + + public SolidClearRendering(int color) { + this.color = color; + } + + @Override + public void render(Graphics2D graphics) { + + graphics.setColor(new java.awt.Color(color)); + graphics.fillRect(0, 0, Screen.w, Screen.h); } } - // Outdated Information: - // Since each sheet is 256x256 pixels, each one has 1024 8x8 "tiles" - // So 0 is the start of the item sheet 1024 the start of the tile sheet, 2048 the start of the entity sheet, - // And 3072 the start of the gui sheet + private static class PlainClearRendering extends ClearRendering { + @Override + public void render(Graphics2D graphics) { + graphics.clearRect(0, 0, Screen.w, Screen.h); + } + } + + private class SpriteRendering implements Rendering { + private final int xp, yp, xt, yt, tw, th, mirrors, whiteTint, color; + private final boolean fullBright; + private final MinicraftImage sheet; + + public SpriteRendering(int xp, int yp, int xt, int yt, int tw, int th, + int mirrors, int whiteTint, boolean fullBright, int color, MinicraftImage sheet) { + this.xp = xp; + this.yp = yp; + this.xt = xt; + this.yt = yt; + this.tw = tw; + this.th = th; + this.mirrors = mirrors; + this.whiteTint = whiteTint; + this.fullBright = fullBright; + this.color = color; + this.sheet = sheet; + } + + @Override + public void render(Graphics2D graphics) { + int toffs = xt + yt * sheet.width; + // Determines if the image should be mirrored... + boolean mirrorX = (mirrors & BIT_MIRROR_X) > 0; // Horizontally. + boolean mirrorY = (mirrors & BIT_MIRROR_Y) > 0; // Vertically. + for (int y = 0; y < th; ++y) { // Relative + if (y + yp < 0) continue; // If the pixel is out of bounds, then skip the rest of the loop. + if (y + yp >= h) break; + int sy = mirrorY ? th - 1 - y : y; // Source relative; reverse if necessary + for (int x = 0; x < tw; ++x) { // Relative + if (x + xp < 0) continue; // Skip rest if out of bounds. + if (x + xp >= w) break; + int sx = mirrorX ? tw - 1 - x : x; // Source relative; reverse if necessary + int col = sheet.pixels[toffs + sx + sy * sheet.width]; // Gets the color of the current pixel from the value stored in the sheet. + if (col >> 24 != 0) { // if not transparent + int index = (xp + x) + (yp + y) * w; + if (whiteTint != -1 && col == 0x1FFFFFF) { + // If this is white, write the whiteTint over it + pixels[index] = Color.upgrade(whiteTint); + } else { + // Inserts the colors into the image + if (fullBright) { + pixels[index] = Color.WHITE; + } else { + if (color != 0) { + pixels[index] = color; + } else { + pixels[index] = Color.upgrade(col); + } + } + } + } + } + } + } + } + + private static class FillRectRendering implements Rendering { + private final int xp, yp, w, h, color; + + public FillRectRendering(int xp, int yp, int w, int h, int color) { + this.xp = xp; + this.yp = yp; + this.w = w; + this.h = h; + this.color = color; + } + + @Override + public void render(Graphics2D graphics) { + graphics.setColor(new java.awt.Color(color)); + graphics.fillRect(xp, yp, w, h); + } + } + + private static class DrawRectRendering implements Rendering { + private final int xp, yp, w, h, color; - public Screen() { - /// Screen width and height are determined by the actual game window size, meaning the screen is only as big as the window. - pixels = new int[Screen.w * Screen.h]; // Makes new integer array for all the pixels on the screen. + public DrawRectRendering(int xp, int yp, int w, int h, int color) { + this.xp = xp; + this.yp = yp; + this.w = w; + this.h = h; + this.color = color; + } + + @Override + public void render(Graphics2D graphics) { + graphics.setColor(new java.awt.Color(color)); + graphics.drawRect(xp, yp, w, h); + } } - /** Initializes the screen with the given pixel array instance. */ - public void init(int[] pixels) { - this.pixels = pixels; - renderingKernel = new ScreenRenderingKernel(); - renderingKernel.pixels = pixels; - renderingKernel.setExplicit(true); - renderingKernel.put(pixels); -// spriteRenderingDelegate = new SpriteRenderingDelegate(); -// clearRenderingDelegate = new ClearRenderingDelegate(); -// fillRectRenderingDelegate = new FillRectRenderingDelegate(); -// drawAxisLineRenderingDelegate = new DrawAxisLineRenderingDelegate(); -// overlayRenderingDelegate = new OverlayRenderingDelegate(); + private static class DrawLineRendering implements Rendering { + private final int x0, y0, x1, y1, color; + + public DrawLineRendering(int x0, int y0, int x1, int y1, int color) { + this.x0 = x0; + this.y0 = y0; + this.x1 = x1; + this.y1 = y1; + this.color = color; + } + + @Override + public void render(Graphics2D graphics) { + graphics.setColor(new java.awt.Color(color)); + graphics.drawLine(x0, y0, x1, y1); + } + } + + private class OverlayRendering implements Rendering { + private final int currentLevel, xa, ya; + private final double darkFactor; + + private OverlayRendering(int currentLevel, int xa, int ya, double darkFactor) { + this.currentLevel = currentLevel; + this.xa = xa; + this.ya = ya; + this.darkFactor = darkFactor; + } + + @Override + public void render(Graphics2D graphics) { + double alpha = lightOverlay.getOverlayOpacity(currentLevel, darkFactor); + BufferedImage overlay = lightOverlay.render(xa, ya); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .02f)); // Lightening + graphics.setColor(java.awt.Color.WHITE); + graphics.fillRect(0, 0, w, h); + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) alpha)); // Shaders + graphics.drawImage(overlay, null, 0, 0); + } } /** Clears all the colors on the screen */ public void clear(int color) { // Turns each pixel into a single color (clearing the screen!) -// renderings.add(new ClearRendering(color)); - renderingKernel.executeScreenClear(color); + if (color == 0) { + queueClearRendering(new PlainClearRendering()); + } else { + queueClearRendering(new SolidClearRendering(color)); + } } -// private class ClearRendering implements Rendering { -// private final int color; -// -// public ClearRendering(int color) { -// this.color = color; -// } -// -// @Override -// public void render() { -// clearRenderingDelegate.render(new int[] {color}, pixels); -// } -// } - -// private static class ClearRenderingDelegate extends RenderingDelegate { -// @SuppressWarnings("MismatchedReadAndWriteOfArray") -// private static Kernel makeKernel() { -// int[] color = new int[1], pixels = new int[1]; -// return new Kernel() { -// @Override -// public void run() { -// pixels[getGlobalId()] = color[0]; -// } -// }; -// } -// -// public ClearRenderingDelegate() { -// super(makeKernel()); -// } -// -// public void render(int[] color, int[] pixels) { -// kernel.put(color).put(pixels); -// kernel.execute(pixels.length); -// kernel.get(pixels); -// } -// } + private void queueClearRendering(ClearRendering clearRendering) { + lastClearRendering = clearRendering; + queue(clearRendering); + } public void flush() { -// Rendering rendering; -// while ((rendering = renderings.poll()) != null) { -// rendering.render(); -// } - renderingKernel.get(pixels); + Graphics2D g2d = image.createGraphics(); + Rendering rendering; + do { // Skips until the latest clear rendering is obtained. + rendering = renderings.poll(); // This can prevent redundant renderings operated. + if (rendering == null) return; + } while (rendering != lastClearRendering); + do { // Renders all renderings until all are operated. + rendering.render(g2d); + } while ((rendering = renderings.poll()) != null); } public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet) { render(xp, yp, xt, yt, bits, sheet, -1); } @@ -161,12 +282,6 @@ public void render(int xp, int yp, Sprite.Px pixel, int mirror, int whiteTint, b public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint, boolean fullbright, int color) { if (sheet == null) return; // Verifying that sheet is not null. - // Validation check - if (xt * 8 + yt * 8 * sheet.width + 7 + 7 * sheet.width >= sheet.pixels.length) { - render(xp, yp, 0, 0, bits, Renderer.spriteLinker.missingSheet(SpriteType.Item), -1, false, 0); - return; - } - // xp and yp are originally in level coordinates, but offset turns them to screen coordinates. // xOffset and yOffset account for screen offset render(xp - xOffset, yp - yOffset, xt * 8, yt * 8, 8, 8, sheet, bits, whiteTint, fullbright, color); @@ -184,153 +299,26 @@ public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImag public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors, int whiteTint, boolean fullbright) { render(xp, yp, xt, yt, tw, th, sheet, mirrors, whiteTint, fullbright, 0); } - public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors, int whiteTint, boolean fullbright, int color) { + // Any single pixel from the image can be rendered using this method. + public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors, int whiteTint, boolean fullBright, int color) { if (sheet == null) return; // Verifying that sheet is not null. - // Determines if the image should be mirrored... - boolean mirrorX = (mirrors & BIT_MIRROR_X) > 0; // Horizontally. - boolean mirrorY = (mirrors & BIT_MIRROR_Y) > 0; // Vertically. -// renderings.add(new SpriteRendering(xp, yp, xt + yt * sheet.width, tw, th, whiteTint, color, -// mirrorX, mirrorY, fullbright, sheet)); - renderingKernel.executeSpriteRender(xp, yp, xt + yt * sheet.width, tw, th, whiteTint, color, - mirrorX, mirrorY, fullbright, sheet); - } + // Validation check + if (xt + tw > sheet.width && yt + th > sheet.height) { + render(xp, yp, 0, 0, mirrors, Renderer.spriteLinker.missingSheet(SpriteType.Item)); + return; + } -// private class SpriteRendering implements Rendering { -// private final int xp, yp, toffs, tw, th, whiteTint, color; -// private final boolean mirrorX, mirrorY, fullBright; -// private final MinicraftImage sheet; -// -// public SpriteRendering(int xp, int yp, int toffs, int tw, int th, int whiteTint, int color, boolean mirrorX, -// boolean mirrorY, boolean fullBright, MinicraftImage sheet) { -// this.xp = xp; -// this.yp = yp; -// this.toffs = toffs; -// this.tw = tw; -// this.th = th; -// this.whiteTint = whiteTint; -// this.color = color; -// this.mirrorX = mirrorX; -// this.mirrorY = mirrorY; -// this.fullBright = fullBright; -// this.sheet = sheet; -// } -// -// @Override -// public void render() { -// spriteRenderingDelegate.render(new int[] {xp}, new int[] {yp}, new int[] {tw}, new int[] {th}, -// new int[] {toffs}, new int[] {sheet.width}, new int[] {whiteTint}, new int[] {color}, -// new boolean[] {mirrorX}, new boolean[] {mirrorY}, new boolean[] {fullBright}, sheet.pixels, pixels); -// } -// } - -// private static class SpriteRenderingDelegate extends RenderingDelegate { -// @SuppressWarnings("MismatchedReadAndWriteOfArray") -// private static Kernel makeKernel() { -// // Constants -// int WHITE = Color.WHITE; -// int w = Screen.w, h = Screen.h; -// // All of these variables are placeholders to bypass Aparapi limitations. -// int[] yp = new int[1], xp = new int[1], tw = new int[] {2}, th = new int[] {2}, -// toffs = new int[1], sheetWidth = new int[] {2}, whiteTint = new int[] {-1}, color = new int[1]; -// boolean[] mirrorX = new boolean[1], mirrorY = new boolean[1], wBright = new boolean[1]; -// int[][] sheetPixels = f; int[] pixels = Renderer.screen.pixels; -// return new Kernel() { -// @Override -// public void run() { -// int x = getGlobalId(0); -// int y = getGlobalId(1); -// if (y + yp[0] < 0 || y + yp[0] >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. -// if (x + xp[0] < 0 || x + xp[0] >= w) return; // Skip rest if out of bounds. -// -// int sx = mirrorX[0] ? tw[0] - 1 - x : x, sy = mirrorY[0] ? th[0] - 1 - y : y; -// int col = sheetPixels[0][toffs[0] + sx + sy * sheetWidth[0]]; // Gets the color of the current pixel from the value stored in the sheet. -// if (col >> 24 != 0) { // if not transparent -// int index = (x + xp[0]) + (y + yp[0]) * w; -// if (whiteTint[0] != -1 && col == 0x1FFFFFF) { -// // If this is white, write the whiteTint over it -// pixels[index] = Color.upgrade(whiteTint[0]); -// } else { -// // Inserts the colors into the image -// if (wBright[0]) { -// pixels[index] = WHITE; -// } else { -// if (color[0] != 0) { -// -// pixels[index] = color[0]; -// } else { -// pixels[index] = Color.upgrade(col); -// } -// } -// } -// } -// } -// }; -// } -// -// public SpriteRenderingDelegate() { -// super(makeKernel()); -// } -// -// public void render(int[] val$xp, int[] val$yp, int[] val$tw, int[] val$th, int[] val$toffs, int[] val$sheetWidth, int[] val$whiteTint, int[] val$color, -// boolean[] val$mirrorX, boolean[] val$mirrorY, boolean[] val$wBright, int[] val$sheetPixels, int[] val$pixels) { -// f[0] = new int[new Random().nextInt(128)+10]; -// Arrays.fill(f[0], 256); -// kernel.put(f).put(val$xp).put(val$yp).put(val$tw).put(val$th).put(val$toffs).put(val$sheetWidth).put(val$whiteTint) -// .put(val$color).put(val$mirrorX).put(val$mirrorY).put(val$wBright).put(val$sheetPixels).put(val$pixels); -// kernel.execute(Range.create2D(val$tw[0], val$th[0])); // Loops a whole sheet area. -// kernel.get(val$pixels); -// } -// } + queue(new SpriteRendering(xp, yp, xt, yt, tw, th, mirrors, whiteTint, fullBright, color, sheet)); + } public void fillRect(int xp, int yp, int w, int h, int color) { -// renderings.add(new FillRectRendering(xp, yp, color, w, h)); - renderingKernel.executeFillRect(xp, yp, color, w, h); + queue(new FillRectRendering(xp, yp, w, h, color)); } -// private class FillRectRendering implements Rendering { -// private final int xp, yp, color, w, h; -// -// public FillRectRendering(int xp, int yp, int color, int w, int h) { -// this.xp = xp; -// this.yp = yp; -// this.color = color; -// this.w = w; -// this.h = h; -// } -// -// @Override -// public void render() { -// fillRectRenderingDelegate.render(new int[] {xp}, new int[] {yp}, new int[] {color}, pixels, w, h); -// } -// } - -// private static class FillRectRenderingDelegate extends RenderingDelegate { -// @SuppressWarnings("MismatchedReadAndWriteOfArray") -// private static Kernel makeKernel() { -// int w = Screen.w, h = Screen.h; -// int[] xp = new int[1], yp = new int[1], color = new int[1], pixels = new int[1]; -// return new Kernel() { -// @Override -// public void run() { -// int x = xp[0] + getGlobalId(0); -// int y = yp[0] + getGlobalId(1); -// if (y < 0 || y >= h || x < 0 || x >= w) return; -// pixels[x + y * w] = color[0]; -// } -// }; -// } -// -// public FillRectRenderingDelegate() { -// super(makeKernel()); -// } -// -// public void render(int[] xp, int[] yp, int[] color, int[] pixels, int w, int h) { -// kernel.put(xp).put(yp).put(color).put(pixels); -// kernel.execute(Range.create2D(w, h)); -// kernel.get(pixels); -// } -// } + public void drawRect(int xp, int yp, int w, int h, int color) { + queue(new DrawRectRendering(xp, yp, w, h, color)); + } /** * Draw a straight line along an axis. @@ -338,57 +326,15 @@ public void fillRect(int xp, int yp, int w, int h, int color) { * @param l The length of the line */ public void drawAxisLine(int xp, int yp, @MagicConstant(intValues = {0, 1}) int axis, int l, int color) { -// renderings.add(new DrawAxisLineRendering(xp, yp, axis, color, l)); - renderingKernel.executeDrawAxisLine(xp, yp, axis, color, l); + switch (axis) { + case 0: queue(new DrawLineRendering(xp, yp, xp + l, yp, color)); break; + case 1: queue(new DrawLineRendering(xp, yp, xp, yp + l, color)); break; + } } -// private class DrawAxisLineRendering implements Rendering { -// private final int xp, yp, axis, color, l; -// -// public DrawAxisLineRendering(int xp, int yp, int axis, int color, int l) { -// this.xp = xp; -// this.yp = yp; -// this.axis = axis; -// this.color = color; -// this.l = l; -// } -// -// @Override -// public void render() { -// drawAxisLineRenderingDelegate.render(new int[] {xp}, new int[] {yp}, new int[] {axis}, -// new int[] {color}, pixels, l); -// } -// } - -// private static class DrawAxisLineRenderingDelegate extends RenderingDelegate { -// @SuppressWarnings("MismatchedReadAndWriteOfArray") -// private static Kernel makeKernel() { -// int w = Screen.w; -// int[] axis = new int[1], color = new int[1], xp = new int[1], yp = new int[1]; -// int[] pixels = new int[1]; -// return new Kernel() { -// @Override -// public void run() { -// int id = getGlobalId(); -// if (axis[0] == 0) { // x-axis -// pixels[xp[0] + id + yp[0] * w] = color[0]; -// } else { // y-axis -// pixels[xp[0] + (yp[0] + id) * w] = color[0]; -// } -// } -// }; -// } -// -// public DrawAxisLineRenderingDelegate() { -// super(makeKernel()); -// } -// -// public void render(int[] xp, int[] yp, int[] axis, int[] color, int[] pixels, int l) { -// kernel.put(xp).put(yp).put(axis).put(color).put(pixels); -// kernel.execute(l); -// kernel.get(pixels); -// } -// } + public void drawLine(int x0, int y0, int x1, int y1, int color) { + queue(new DrawLineRendering(x0, y0, x1, y1, color)); + } /** Sets the offset of the screen */ public void setOffset(int xOffset, int yOffset) { @@ -406,15 +352,9 @@ public void setOffset(int xOffset, int yOffset) { In the end, "every other every row", will need, for example in column 1, 15 light to be lit, then 0 light to be lit, then 12 light to be lit, then 3 light to be lit. So, the pixels of lower light levels will generally be lit every other pixel, while the brighter ones appear more often. The reason for the variance in values is to provide EVERY number between 0 and 15, so that all possible light levels (below 16) are represented fittingly with their own pattern of lit and not lit. 16 is the minimum pixel lighness required to ensure that the pixel will always remain lit. */ - private static final int[] dither = new int[] { - 0, 8, 2, 10, - 12, 4, 14, 6, - 3, 11, 1, 9, - 15, 7, 13, 5 - }; /** Overlays the screen with pixels */ - public void overlay(Screen screen2, int currentLevel, int xa, int ya) { + public void overlay(int currentLevel, int xa, int ya) { double tintFactor = 0; if (currentLevel >= 3 && currentLevel < 5) { int transTime = Updater.dayLength / 4; @@ -434,303 +374,101 @@ else if(currentLevel >= 5) tintFactor = -MAXDARK; // The Integer array of pixels to overlay the screen with. -// renderings.add(new OverlayRendering(xa, ya, currentLevel, (int) tintFactor, screen2.pixels)); - renderingKernel.executeOverlayRender(xa, ya, currentLevel, (int) tintFactor, screen2.pixels); + queue(new OverlayRendering(currentLevel, xa, ya, tintFactor)); } -// private class OverlayRendering implements Rendering { -// private final int xa, ya, currentLevel, tintFactor; -// private final int[] oPixels; -// -// public OverlayRendering(int xa, int ya, int currentLevel, int tintFactor, int[] oPixels) { -// this.xa = xa; -// this.ya = ya; -// this.currentLevel = currentLevel; -// this.tintFactor = tintFactor; -// this.oPixels = oPixels; -// } -// -// @Override -// public void render() { -// overlayRenderingDelegate.render(new int[] {xa}, new int[] {ya}, new int[] {currentLevel}, -// new int[] {tintFactor}, oPixels, pixels); -// } -// } - -// private static class OverlayRenderingDelegate extends RenderingDelegate { -// @SuppressWarnings("MismatchedReadAndWriteOfArray") -// private static Kernel makeKernel() { -// int w = Screen.w; -// int[] dither = Screen.dither; -// int[] xa = new int[1], ya = new int[1], currentLevel = new int[1], tintFactor = new int[1]; -// int[] oPixels = new int[1], pixels = new int[1]; -// return new Kernel() { -// @Override -// public void run() { -// int x = getGlobalId(0); -// int y = getGlobalId(1); -// int id = x + y * w; -// if (oPixels[id] / 10 <= dither[((x + xa[0]) & 3) + ((y + ya[0]) & 3) * 4]) { -// -// /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... -// if (currentLevel[0] < 3) { // if in caves... -// /// in the caves, not being lit means being pitch black. -// pixels[id] = 0; -// } else { -// /// Outside the caves, not being lit simply means being darker. -// pixels[id] = Color.tintColor(pixels[id], tintFactor[0]); // darkens the color one shade. -// } -// } -// -// // Increase the tinting of all colors by 20. -// pixels[id] = Color.tintColor(pixels[id], 20); -// } -// }; -// } -// -// public OverlayRenderingDelegate() { -// super(makeKernel()); -// } -// -// public void render(int[] xa, int[] ya, int[] currentLevel, int[] tintFactor, int[] oPixels, int[] pixels) { -// kernel.put(xa).put(ya).put(currentLevel).put(tintFactor).put(oPixels).put(pixels); -// kernel.execute(Range.create2D(w, h)); -// kernel.get(pixels); -// } -// } - public void renderLight(int x, int y, int r) { // Applies offsets: - x -= xOffset; - y -= yOffset; - // Starting, ending, x, y, positions of the circle (of light) - int x0 = x - r; - int x1 = x + r; - int y0 = y - r; - int y1 = y + r; - - // Prevent light from rendering off the screen: - if (x0 < 0) x0 = 0; - if (y0 < 0) y0 = 0; - if (x1 > w) x1 = w; - if (y1 > h) y1 = h; - - int xp = x; - int yp = y; - int xa = x0; - int ya = y0; - int ww = x1 - x0; - int hh = y1 - y0; - int[] pixels = this.pixels; - int w = Screen.w, h = Screen.h; -// renderings.add(new Rendering(new Kernel() { -// @Override -// public void run() { -// int xx = xa + getGlobalId(0); -// int yy = ya + getGlobalId(1); -// if (xx < 0 || xx >= w || yy < 0 || yy >= h) return; -// int yd = yy - yp; // Get distance to the previous y position. -// yd = yd * yd; // Square that distance -// int xd = xx - xp; // Get x delta -// int dist = xd * xd + yd; // Square x delta, then add the y delta, to get total distance. -// if (dist <= r * r) { -// // If the distance from the center (x,y) is less or equal to the radius... -// int br = 255 - dist * 255 / (r * r); // area where light will be rendered. // r*r is becuase dist is still x*x+y*y, of pythag theorem. -// // br = brightness... literally. from 0 to 255. -// if (pixels[xx + yy * w] < br) pixels[xx + yy * w] = br; // Pixel cannot be smaller than br; in other words, the pixel color (brightness) cannot be less than br. -// } -// } -// }, kernel -> kernel.put(pixels), new Range2DParam(ww, hh))); + lightOverlay.renderLight(x - xOffset, y - yOffset, r); } - private static final class ScreenRenderingKernel extends Kernel { - private final HashMap sheetPixelMap = new HashMap<>(); - private @Constant final int[] dither = new int[] { + private static class LightOverlay { + private static final int[] dither = new int[] { 0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5 }; - final int w = Screen.w, h = Screen.h, WHITE = Color.WHITE; - static final int FUNC_CLEAR = 0; - static final int FUNC_RENDER = 1; - static final int FUNC_FILL_RECT = 2; - static final int FUNC_DRAW_AXIS_LINE = 3; - static final int FUNC_OVERLAY = 4; - int xp, yp, toffs, tw, th, whiteTint, color, sheetWidth, xa, ya, ww, hh, axis, currentLevel, tintFactor; - int[] sheetPixels = new int[65536]; // Limited 65536 pixels - public int[] pixels; - int[] oPixels = new int[w*h]; - @Constant boolean[] mirrorX = new boolean[1], mirrorY = new boolean[1], fullBright = new boolean[1]; - @MagicConstant(intValues = {FUNC_CLEAR, FUNC_RENDER, FUNC_FILL_RECT, FUNC_DRAW_AXIS_LINE, FUNC_OVERLAY}) - private int function; - @Override - public void run() { - if (function == ScreenRenderingKernel.FUNC_CLEAR) { - screenClear(); - } else if (function == ScreenRenderingKernel.FUNC_RENDER) { - spriteRender(); - } else if (function == ScreenRenderingKernel.FUNC_FILL_RECT) { - fillRect(); - } else if (function == ScreenRenderingKernel.FUNC_DRAW_AXIS_LINE) { - drawAxisLine(); - } else if (function == ScreenRenderingKernel.FUNC_OVERLAY) { - overlayRender(); + public final float[] graFractions; + public final java.awt.Color[] graColors; + public final BufferedImage buffer = new BufferedImage(w, h, BufferedImage.TYPE_BYTE_GRAY); + public final byte[] bufPixels; + public final BufferedImage overlay = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); + public final int[] olPixels; + public final ArrayDeque lights = new ArrayDeque<>(); + + private static class LightRadius { + public final int x, y, r; + public LightRadius(int x, int y, int r) { + this.x = x; + this.y = y; + this.r = r; } } - private void copySheetPixels(int[] src) { - if (sheetPixelMap.containsKey(src)) { - sheetPixels = sheetPixelMap.get(src); - return; + public LightOverlay() { + bufPixels = ((DataBufferByte) buffer.getRaster().getDataBuffer()).getData(); + olPixels = ((DataBufferInt) overlay.getRaster().getDataBuffer()).getData(); + ArrayList graFractions = new ArrayList<>(); + ArrayList graColors = new ArrayList<>(); + BigDecimal oneFiftieth = BigDecimal.ONE.divide(BigDecimal.valueOf(50), MathContext.UNLIMITED); + BigDecimal twoFiveFive = BigDecimal.valueOf(255); + for (BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) <= 0; i = i.add(oneFiftieth)) { + graFractions.add(i.floatValue()); + graColors.add(new java.awt.Color(255, 255, 255, 255 - i.pow(4).multiply(twoFiveFive).intValue())); } - int[] target = new int[65536]; - Kernel kernel = new Kernel() { - @Override - public void run() { - int id = getGlobalId(); - target[id] = src[id]; - } - }; - kernel.execute(src.length); - kernel.dispose(); - sheetPixelMap.put(src, target); - sheetPixels = target; - } - - public void screenClear() { - pixels[getGlobalId()] = color; + this.graFractions = new float[graFractions.size()]; + for (int i = 0; i < graFractions.size(); ++i) this.graFractions[i] = graFractions.get(i); + this.graColors = graColors.toArray(new java.awt.Color[0]); } - public void executeScreenClear(int color) { - this.color = color; - this.function = FUNC_CLEAR; - execute(Range.create(pixels.length)); - } - - public void spriteRender() { - int x = getGlobalId(0); - int y = getGlobalId(1); - if (y + yp < 0 || y + yp >= h) return; // If the pixel is out of bounds, then skip the rest of the loop. - if (x + xp < 0 || x + xp >= w) return; // Skip rest if out of bounds. - - int sx = mirrorX[0] ? tw - 1 - x : x, sy = mirrorY[0] ? th - 1 - y : y; - int col = sheetPixels[toffs + sx + sy * sheetWidth]; // Gets the color of the current pixel from the value stored in the sheet. - if (col >> 24 != 0) { // if not transparent - int index = (x + xp) + (y + yp) * w; - if (whiteTint != -1 && col == 0x1FFFFFF) { - // If this is white, write the whiteTint over it - pixels[index] = Color.upgrade(whiteTint); - } else { - // Inserts the colors into the image - if (fullBright[0]) { - pixels[index] = WHITE; - } else { - if (color != 0) { - - pixels[index] = color; - } else { - pixels[index] = Color.upgrade(col); - } - } - } + /** + * Gets the overlay light darkness opacity instantly. + * @param currentLevel the current level index of the target + * @param darkFactor the tint factor to darken, from {@code 1} to {@code 128} + * @return opacity of darkness from {@code 0} to {@code 1} + */ + public double getOverlayOpacity(int currentLevel, double darkFactor) { + // The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... + if (currentLevel < 3) { // if in caves... + // in the caves, not being lit means being pitch black. + return 1; + } else { + // Outside the caves, not being lit simply means being darker. + return 1D - darkFactor / 144; // darkens the color one shade. } } - public void executeSpriteRender(int xp, int yp, int toffs, int tw, int th, int whiteTint, int color, boolean mirrorX, - boolean mirrorY, boolean fullBright, MinicraftImage sheet) { - this.xp = xp; - this.yp = yp; - this.toffs = toffs; - this.tw = tw; - this.th = th; - this.whiteTint = whiteTint; - this.color = color; - this.mirrorX = new boolean[]{mirrorX}; - this.mirrorY = new boolean[]{mirrorY}; - this.fullBright = new boolean[]{fullBright}; - copySheetPixels(sheet.pixels); - this.sheetWidth = sheet.width; - this.function = FUNC_RENDER; - execute(Range.create2D(tw, th)); // Loops a whole sheet area. - } - - public void fillRect() { - int x = xp + getGlobalId(0); - int y = yp + getGlobalId(1); - if (y < 0 || y >= h || x < 0 || x >= w) return; - pixels[x + y * w] = color; + public void renderLight(int x, int y, int r) { + lights.add(new LightRadius(x, y, r)); } - public void executeFillRect(int xp, int yp, int color, int w, int h) { - this.xp = xp; - this.yp = yp; - this.color = color; - this.function = FUNC_FILL_RECT; - execute(Range.create2D(w, h)); - } - - public void drawAxisLine() { - int id = getGlobalId(); - if (axis == 0) { // x-axis - pixels[xp + id + yp * w] = color; - } else { // y-axis - pixels[xp + (yp + id) * w] = color; + public BufferedImage render(int xa, int ya) { + Graphics2D g2d = buffer.createGraphics(); + g2d.setBackground(java.awt.Color.BLACK); + g2d.clearRect(0, 0, w, h); + LightRadius lightRadius; + while ((lightRadius = lights.poll()) != null) { + int x = lightRadius.x, y = lightRadius.y, r = lightRadius.r; + g2d.setPaint(new RadialGradientPaint(x, y, r, graFractions, graColors)); + g2d.fillOval(x - r, y - r, r * 2, r * 2); } - } - - public void executeDrawAxisLine(int xp, int yp, int axis, int color, int l) { - this.xp = xp; - this.yp = yp; - this.axis = axis; - this.color = color; - this.function = FUNC_DRAW_AXIS_LINE; - execute(Range.create(l)); - } - - public void overlayRender() { - int x = getGlobalId(0); - int y = getGlobalId(1); - int id = x + y * w; - if (oPixels[id] / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { - - /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... - if (currentLevel < 3) { // if in caves... - /// in the caves, not being lit means being pitch black. - pixels[id] = 0; - } else { - /// Outside the caves, not being lit simply means being darker. - pixels[id] = tintColor(pixels[id], tintFactor); // darkens the color one shade. + g2d.dispose(); + + for (int x = 0; x < w; ++x) { + for (int y = 0; y < h; ++y) { + int i = x + y * w; + int grade = bufPixels[i] & 0xFF; + // (a + b) & 3 acts like (a + b) % 4 + if (grade / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { + olPixels[i] = grade << 24; + } else { + olPixels[i] = 0; + } } } - - // Increase the tinting of all colors by 20. - pixels[id] = tintColor(pixels[id], 20); - } - - private static int tintColor(int rgbInt, int amount) { - if (rgbInt < 0) return rgbInt; // This is "transparent". - - int r = (rgbInt & 0xFF_00_00) >> 16; - int g = (rgbInt & 0x00_FF_00) >> 8; - int b = (rgbInt & 0x00_00_FF); - - r = MyUtils.clamp(r+amount, 0, 255); - g = MyUtils.clamp(g+amount, 0, 255); - b = MyUtils.clamp(b+amount, 0, 255); - - return r << 16 | g << 8 | b; - } - - public void executeOverlayRender(int xa, int ya, int currentLevel, int tintFactor, int[] oPixels) { - this.xa = xa; - this.ya = ya; - this.currentLevel = currentLevel; - this.tintFactor = tintFactor; - this.oPixels = oPixels; - this.function = FUNC_OVERLAY; - execute(Range.create2D(w, h)); + return overlay; } } } diff --git a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java index 109b48c76..60eb79d6a 100644 --- a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java +++ b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java @@ -294,17 +294,11 @@ public void render(Screen screen) { } else Font.draw(String.valueOf(key.output), screen, x + keyWidth/2 - 3, y + keyHeight/2 - 3, color); - screen.drawAxisLine(x, y, 1, keyHeight, 0x1BCBCBC); // left border - screen.drawAxisLine(x + keyWidth, y, 1, keyHeight, 0x1BCBCBC); // right border - screen.drawAxisLine(x, y, 0, keyWidth, 0x1BCBCBC); // top border - screen.drawAxisLine(x, y + keyHeight, 0, keyWidth, 0x1BCBCBC); // bottom border + screen.drawRect(x, y, keyWidth, keyHeight, 0x1BCBCBC); // border if (this.x == c && this.y == r) { color = keyPressed > 0 ? 0x1EFEFF0 : 0x1DFDFE0; - screen.drawAxisLine(x + 1, y, 1, keyHeight, color); // left border - screen.drawAxisLine(x - 1 + keyWidth, y, 1, keyHeight, color); // right border - screen.drawAxisLine(x, y + 1, 0, keyWidth, color); // top border - screen.drawAxisLine(x, y - 1 + keyHeight, 0, keyWidth, color); // bottom border + screen.drawRect(x + 1, y + 1, keyWidth - 2, keyHeight - 2, color); // border } x += keyWidth; diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index 4c1fc6475..916fd4421 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -304,7 +304,7 @@ private static class SeriesQuestViewerDisplay extends Display { private final int rasterY; private final MinicraftImage image; private final int[] rasterPixels; - private final Screen simulatedRasterScreen = new Screen() { + private final Screen simulatedRasterScreen = new Screen(new BufferedImage(Screen.w, Screen.h, BufferedImage.TYPE_INT_RGB)) { @Override public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint, boolean fullbright, int color) { if (sheet == null) return; // Verifying that sheet is not null. @@ -503,10 +503,8 @@ public void render(Screen screen) { menu.render(screen); Arrays.fill(rasterPixels, Color.BLACK); renderRaster(); - screen.drawAxisLine(rasterX - 1, rasterY - 1, 1, rasterHeight + 2, Color.WHITE); // left border - screen.drawAxisLine(rasterX + rasterWidth, rasterY - 1, 1, rasterHeight + 2, Color.WHITE); // right border - screen.drawAxisLine(rasterX - 1, rasterY - 1, 0, rasterWidth + 2, Color.WHITE); // top border - screen.drawAxisLine(rasterX - 1, rasterY + rasterHeight, 0, rasterWidth + 2, Color.WHITE); // right border + // Border + screen.drawRect(rasterX - 1, rasterY - 1, rasterWidth + 2, rasterHeight + 2, Color.WHITE); screen.render(rasterX, rasterY, 0, 0, rasterWidth, rasterHeight, image); } From 84503829221a5b366b5ae82cb3d5ce062bd97865 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 30 Oct 2023 20:02:49 +0800 Subject: [PATCH 104/261] Fix Screen#render mirror default value --- src/client/java/minicraft/gfx/Screen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index 616e300a1..66ee3281b 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -288,7 +288,7 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee } public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet) { - render(xp, yp, xt, yt ,tw, th, sheet, -1); + render(xp, yp, xt, yt ,tw, th, sheet, 0); } public void render(int xp, int yp, int xt, int yt, int tw, int th, MinicraftImage sheet, int mirrors) { render(xp, yp, xt, yt ,tw, th, sheet, mirrors, -1); From 0fc314e5ce9348a7e283015bb65585ea18b2967e Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 5 Nov 2023 16:53:14 +0800 Subject: [PATCH 105/261] Fix screen light rendering problem --- src/client/java/minicraft/gfx/Screen.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index 66ee3281b..02504f6c4 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -355,26 +355,25 @@ public void setOffset(int xOffset, int yOffset) { /** Overlays the screen with pixels */ public void overlay(int currentLevel, int xa, int ya) { - double tintFactor = 0; + double darkFactor = 0; if (currentLevel >= 3 && currentLevel < 5) { int transTime = Updater.dayLength / 4; double relTime = (Updater.tickCount % transTime) * 1.0 / transTime; switch (Updater.getTime()) { - case Morning: tintFactor = Updater.pastDay1 ? (1-relTime) * MAXDARK : 0; break; - case Day: tintFactor = 0; break; - case Evening: tintFactor = relTime * MAXDARK; break; - case Night: tintFactor = MAXDARK; break; + case Morning: darkFactor = Updater.pastDay1 ? (1-relTime) * MAXDARK : 0; break; + case Day: darkFactor = 0; break; + case Evening: darkFactor = relTime * MAXDARK; break; + case Night: darkFactor = MAXDARK; break; } - if (currentLevel > 3) tintFactor -= (tintFactor < 10 ? tintFactor : 10); - tintFactor *= -1; // All previous operations were assuming this was a darkening factor. + if (currentLevel > 3) darkFactor -= (darkFactor < 10 ? darkFactor : 10); } else if(currentLevel >= 5) - tintFactor = -MAXDARK; + darkFactor = MAXDARK; // The Integer array of pixels to overlay the screen with. - queue(new OverlayRendering(currentLevel, xa, ya, tintFactor)); + queue(new OverlayRendering(currentLevel, xa, ya, darkFactor)); } public void renderLight(int x, int y, int r) { @@ -436,7 +435,7 @@ public double getOverlayOpacity(int currentLevel, double darkFactor) { return 1; } else { // Outside the caves, not being lit simply means being darker. - return 1D - darkFactor / 144; // darkens the color one shade. + return darkFactor / 128; // darkens the color one shade. } } @@ -459,10 +458,11 @@ public BufferedImage render(int xa, int ya) { for (int x = 0; x < w; ++x) { for (int y = 0; y < h; ++y) { int i = x + y * w; + // Grade of lightness int grade = bufPixels[i] & 0xFF; // (a + b) & 3 acts like (a + b) % 4 if (grade / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { - olPixels[i] = grade << 24; + olPixels[i] = (255 - grade) << 24; } else { olPixels[i] = 0; } From cd3d7f24c0b2bf42aa25e7ed1c25a095d16a4aa4 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 24 Jun 2023 19:27:02 +0800 Subject: [PATCH 106/261] Add missing movement handles --- src/client/java/minicraft/entity/Entity.java | 64 ++++++++++++++++---- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index 0ff319460..81d245aae 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -1,5 +1,6 @@ package minicraft.entity; +import minicraft.core.Action; import minicraft.core.Updater; import minicraft.entity.mob.Player; import minicraft.gfx.Rectangle; @@ -14,6 +15,8 @@ import java.util.HashSet; import java.util.List; import java.util.Random; +import java.util.function.BiConsumer; +import java.util.function.BiPredicate; import java.util.function.IntSupplier; public abstract class Entity implements Tickable { @@ -124,11 +127,6 @@ public boolean move(int xd, int yd) { //noinspection RedundantIfStatement if (moveX(xd)) stopped = false; // Becomes false if horizontal movement was successful. if (moveY(yd)) stopped = false; // Becomes false if vertical movement was successful. - if (!stopped) { - int xt = x >> 4; // The x tile coordinate that the entity is standing on. - int yt = y >> 4; // The y tile coordinate that the entity is standing on. - level.getTile(xt, yt).steppedOn(level, xt, yt, this); // Calls the steppedOn() method in a tile's class. (used for tiles like sand (footprints) or lava (burning)) - } return !stopped; } @@ -153,8 +151,17 @@ protected boolean moveX(int d) { int hitBoxFront = x + xr * sgn; int maxFront = Level.calculateMaxFrontClosestTile(sgn, d, hitBoxLeft, hitBoxRight, hitBoxFront, (front, horTile) -> level.getTile(front, horTile).mayPass(level, front, horTile, this)); // Maximum position can be reached with front hit box - if (maxFront == hitBoxFront) return false; // No movement can be made. - return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x + sgn, () -> y, () -> x += sgn); + if (maxFront == hitBoxFront) { // Bumping into the facing tile + int hitBoxRightTile = hitBoxRight >> 4; + int frontTile = (hitBoxFront + sgn) >> 4; + for (int horTile = hitBoxLeft >> 4; horTile <= hitBoxRightTile; horTile++) { + level.getTile(frontTile, horTile).bumpedInto(level, frontTile, horTile, this); + } + return false; // No movement can be made. + } + return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x + sgn, () -> y, () -> x += sgn, hitBoxLeft, hitBoxRight, + (front, horTile) -> level.getTile(front, horTile).bumpedInto(level, front, horTile, this), + (front, horTile) -> level.getTile(front, horTile).steppedOn(level, front, horTile, this)); } /** @@ -177,8 +184,17 @@ protected boolean moveY(int d) { int hitBoxFront = y + yr * sgn; int maxFront = Level.calculateMaxFrontClosestTile(sgn, d, hitBoxLeft, hitBoxRight, hitBoxFront, (front, horTile) -> level.getTile(horTile, front).mayPass(level, horTile, front, this)); // Maximum position can be reached with front hit box - if (maxFront == hitBoxFront) return false; // No movement can be made. - return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x, () -> y + sgn, () -> y += sgn); + if (maxFront == hitBoxFront) { // Bumping into the facing tile + int hitBoxRightTile = hitBoxRight >> 4; + int frontTile = (hitBoxFront + sgn) >> 4; + for (int horTile = hitBoxLeft >> 4; horTile <= hitBoxRightTile; horTile++) { + level.getTile(horTile, frontTile).bumpedInto(level, horTile, frontTile, this); + } + return false; // No movement can be made. + } + return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x, () -> y + sgn, () -> y += sgn, hitBoxLeft, hitBoxRight, + (front, horTile) -> level.getTile(horTile, front).bumpedInto(level, horTile, front, this), + (front, horTile) -> level.getTile(horTile, front).steppedOn(level, horTile, front, this)); } /** @@ -189,16 +205,34 @@ protected boolean moveY(int d) { * @param xMove The value of the willing x movement * @param yMove The value of the willing y movement * @param incrementMove The movement call when the movement is possible + * @param hitBoxLeft The left boundary of hit box + * @param hitBoxRight The right boundary of hit box + * @param bumpingHandler The consumer handling bumping into a new tile; + * the first parameter takes the front tile position and second one takes the horizontal position + * @param steppingHandler The consumer handling stepping on a new tile; + * the first parameter takes the front tile position and second one takes the horizontal position * @return {@code true} if the movement is successful, {@code false} otherwise. - * @see #moveByEntityHitBoxChecks(int, int, int, IntSupplier, IntSupplier, Runnable) + * @see Level#calculateMaxFrontClosestTile(int, int, int, int, int, BiPredicate) */ protected boolean moveByEntityHitBoxChecks(int sgn, int hitBoxFront, int maxFront, IntSupplier xMove, - IntSupplier yMove, Runnable incrementMove) { + IntSupplier yMove, Action incrementMove, int hitBoxLeft, int hitBoxRight, + BiConsumer bumpingHandler, BiConsumer steppingHandler) { boolean successful = false; // These lists are named as if the entity has already moved-- it hasn't, though. HashSet wasInside = new HashSet<>(level.getEntitiesInRect(getBounds())); // Gets all the entities that are inside this entity (aka: colliding) before moving. + int frontTile = hitBoxFront << 4; // The original tile the front boundary hit box staying on + boolean handleSteppedOn = false; // Used together with frontTile for (int front = hitBoxFront; sgn < 0 ? front > maxFront : front < maxFront; front += sgn) { + int newFrontTile = (front + sgn) >> 4; + if (newFrontTile != frontTile) { // New tile touched + int hitBoxRightTile = hitBoxRight >> 4; + for (int horTile = hitBoxLeft >> 4; horTile <= hitBoxRightTile; horTile++) { + bumpingHandler.accept(horTile, newFrontTile); + } + frontTile = newFrontTile; + handleSteppedOn = true; + } boolean blocked = false; // If the entity prevents this one from movement, no movement. for (Entity e : level.getEntitiesInRect(new Rectangle(xMove.getAsInt(), yMove.getAsInt(), xr * 2, yr * 2, Rectangle.CENTER_DIMS))) { if (!wasInside.contains(e)) { // Skips entities that were touched. @@ -214,7 +248,13 @@ protected boolean moveByEntityHitBoxChecks(int sgn, int hitBoxFront, int maxFron } } if (blocked) break; - incrementMove.run(); // Movement successful + incrementMove.act(); // Movement successful + if (handleSteppedOn) { // When the movement to a new tile successes + int hitBoxRightTile = hitBoxRight >> 4; + for (int horTile = hitBoxLeft >> 4; horTile <= hitBoxRightTile; horTile++) { + steppingHandler.accept(horTile, frontTile); // Calls the steppedOn() method in a tile's class. (used for tiles like sand (footprints) or lava (burning)) + } + } successful = true; } From f5d6a873552e5c604b5932bb97dd883591c27590 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 24 Jun 2023 19:27:38 +0800 Subject: [PATCH 107/261] Fix movement breaking bug --- src/client/java/minicraft/level/Level.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 716e62a87..57111fbe7 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -783,11 +783,12 @@ public static int calculateMaxFrontClosestTile(int sgn, int d, int hitBoxLeft, i int hitBoxFrontTile1 = hitBoxFront1 >> 4; int maxFrontTile = hitBoxFrontTile1; // Value for full tile movement // Skips the current tile by adding 1. + mainLoop: for (int front = hitBoxFrontTile + sgn; sgn < 0 ? front >= hitBoxFrontTile1 : front <= hitBoxFrontTile1; front += sgn) { for (int horTile = hitBoxLeftTile; horTile <= hitBoxRightTile; horTile++) { if (!frontTilePassableCheck.test(front, horTile)) { maxFrontTile = front - sgn; // Rolls back a tile by subtracting 1. - break; // Tile hit box check stops. + break mainLoop; // Tile hit box check stops. } } } From 2bc6fa839541d358ef0dd8268442297dbebd0b93 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:32:34 +0800 Subject: [PATCH 108/261] Resolve some problems in control guide --- .../screen/TutorialDisplayHandler.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/client/java/minicraft/screen/TutorialDisplayHandler.java b/src/client/java/minicraft/screen/TutorialDisplayHandler.java index 06be9c594..1e86d9ea0 100644 --- a/src/client/java/minicraft/screen/TutorialDisplayHandler.java +++ b/src/client/java/minicraft/screen/TutorialDisplayHandler.java @@ -62,7 +62,7 @@ private static void loadTutorialElement(String criterionName, JSONObject json) { private static ControlGuide currentGuide = null; static { - controlGuides.add(new ControlGuide(120, "move-up|move-down|move-left|move-right", + controlGuides.add(new ControlGuide(300, "move-up|move-down|move-left|move-right", () -> Localization.getLocalized("minicraft.control_guide.move", String.format("%s|%s|%s|%s", Game.input.getMapping("move-up"), Game.input.getMapping("move-left"), Game.input.getMapping("move-down"), @@ -90,16 +90,11 @@ private ControlGuide(int duration, String key, Supplier display) { } private void tick() { - if (this.key.contains("|")) { - InputHandler.Key key = new InputHandler.Key(); - for (String keyposs: this.key.split("\\|")) { - InputHandler.Key aKey = Game.input.getKey(keyposs); - key.down = key.down || aKey.down; - key.clicked = key.clicked || aKey.clicked; + if (key.contains("|")) { + for (String k : key.split("\\|")) { + if (Game.input.inputDown(k)) interactedDuration++; } - - if (key.down) interactedDuration++; - } else if (Game.input.getKey(key).down) + } else if (Game.input.inputDown(key)) interactedDuration++; } } @@ -188,7 +183,8 @@ public static void tick(InputHandler input) { return; } - currentGuide.tick(); + if (Game.getDisplay() == null) + currentGuide.tick(); } if (currentOngoingElement != null) { From 75a4d0c4a054a592764a3f607a0e8cb204908810 Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Tue, 1 Aug 2023 22:47:21 +0100 Subject: [PATCH 109/261] added lowercase letters --- .gitignore | 3 + src/client/java/minicraft/gfx/Font.java | 58 ++++++++++++++++-- src/client/java/minicraft/screen/Menu.java | 2 +- .../minicraft/screen/ResourcePackDisplay.java | 1 + .../resources/assets/textures/gui/font.png | Bin 4214 -> 5436 bytes 5 files changed, 57 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 7537dea4e..05b77b506 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# dev savedir folder +run/ + # Compiled class file *.class diff --git a/src/client/java/minicraft/gfx/Font.java b/src/client/java/minicraft/gfx/Font.java index ff141eea8..b2336a7bb 100644 --- a/src/client/java/minicraft/gfx/Font.java +++ b/src/client/java/minicraft/gfx/Font.java @@ -15,7 +15,32 @@ public class Font { "6789.,!?'\"-+=/\\%()<>:;^@ÁÉÍÓÚÑ¿¡"+ "ÃÊÇÔÕĞÇÜİÖŞÆØÅŰŐ[]#|{}_АБВГДЕЁЖЗ"+ "ИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯÀÂÄÈÎÌÏÒ"+ - "ÙÛÝ*«»£$&€§ªº"; + "ÙÛÝ*«»£$&€§ªºabcdefghijklmnopqrs"+ + "tuvwxyzáàãâäéèêëíìîïóòõôöúùûüçñý"+ + "ÿабвгдеёжзийклмнопрстуфхцчшщъыьэ"+ + "юя"; + private static final int[] charsAdvance = new int[Font.chars.length()]; + + public static void updateCharAdvances(MinicraftImage font) { + for (int i = 0; i < chars.length(); ++i) { + int c = i % 32; + int r = (i / 32); + + int advance = 8; + adfinder: for (int j = 7; j >= 0; --j) { + int u = c * 8 + j; + for (int k = 0; k < 8; ++k) { + int v = r * 8 + k; + if ((font.pixels[v * font.height + u] >> 24) != 0) { + advance = j + 2; + break adfinder; + } + } + } + + Font.charsAdvance[i] = advance; + } + } /* The order of the letters in the chars string is represented in the order that they appear in the sprite-sheet. */ @@ -24,13 +49,14 @@ public class Font { /** Draws the message to the x & y coordinates on the screen. */ public static void draw(String msg, Screen screen, int x, int y, int whiteTint) { - msg = msg.toUpperCase(Localization.getSelectedLocale()); //makes all letters uppercase. + int xx = x; for (int i = 0; i < msg.length(); i++) { // Loops through all the characters that you typed int ix = chars.indexOf(msg.charAt(i)); // The current letter in the message loop if (ix >= 0) { // If that character's position is larger than or equal to 0, then render the character on the screen. - screen.render(x + i * textWidth(msg.substring(i, i+1)), y, ix % 32, ix / 32, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "font"), whiteTint); + screen.render(xx, y, ix % 32, ix / 32, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "font"), whiteTint); } + xx += msg.charAt(i) == ' ' ? 8 : ix >= 0 ? Font.charsAdvance[ix] : 8; } } @@ -66,9 +92,12 @@ public static void drawColor(String message, Screen screen, int x, int y) { public static void drawBackground(String msg, Screen screen, int x, int y) { drawBackground(msg, screen, x, y, -1); } public static void drawBackground(String msg, Screen screen, int x, int y, int whiteTint) { - String newMsg = msg.toUpperCase(Localization.getSelectedLocale()); + String newMsg = msg; + int xx = x; for (int i = 0; i < newMsg.length(); i++) { // Renders the black boxes under the text - screen.render(x + i * textWidth(newMsg.substring(i, i+1)), y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); + screen.render(xx, y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); + int ix = chars.indexOf(newMsg.charAt(i)); + xx += msg.charAt(i) == ' ' ? 8 : ix >= 0 ? Font.charsAdvance[ix] : 8; } // Renders the text @@ -76,8 +105,25 @@ public static void drawBackground(String msg, Screen screen, int x, int y, int w } public static int textWidth(String text) { // Filtering out coloring codes. - return (int) (Math.max(text.length() - text.chars().filter(ch -> ch == Color.COLOR_CHAR).count() * 5, 0) * 8); + if (text == null) return 0; + + int width = 0; + + for (int i = 0; i < text.length(); ++i) { + char chr = text.charAt(i); + + if (chr == Color.COLOR_CHAR) { + i += 5; + continue; + } + + int idx = Font.chars.indexOf(chr); + width += idx >= 0 ? Font.charsAdvance[idx] : 8; + } + + return width; } + public static int textWidth(String[] para) { // This returns the maximum length of all the lines. if (para == null || para.length == 0) return 0; diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index 21738dbad..2a7fcc298 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -303,8 +303,8 @@ public void render(Screen screen) { } else { for (int i = 0; i < title.length(); i++) { if (hasFrame) screen.render(titleLoc.x + i * Font.textWidth(" "), titleLoc.y, 3, 6, 0, hudSheet.getSheet()); - Font.draw(title.substring(i, i + 1), screen, titleLoc.x + i * Font.textWidth(" "), titleLoc.y, titleColor); } + Font.draw(title, screen, titleLoc.x, titleLoc.y, titleColor); } } diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index e7fd1822a..dffcc139b 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -723,6 +723,7 @@ public static void reloadResources() { SpriteAnimation.refreshAnimations(); Renderer.spriteLinker.updateLinkedSheets(); + Font.updateCharAdvances(Renderer.spriteLinker.getSheet(SpriteType.Gui, "font")); Localization.loadLanguage(); // Refreshing skins diff --git a/src/client/resources/assets/textures/gui/font.png b/src/client/resources/assets/textures/gui/font.png index 4f4da089c3fb4ad832a79f9a75298fe6311b5e89..8418ec709bcb055db4900910785bb959e8bc31ce 100644 GIT binary patch literal 5436 zcmeHL`CpP*`^MMGDN}QrTnU=-Z8z6k1I?Or=52~>DmMhp)KXIs7eIx|${aPbMY9Yo z-jYNmHFrVH1ycb{g)*1W01=d2fWU>9X6E}3e1D!Fp7T8S`P}FJe9pPA`@XL8WSlzb zrMJm!6953v`}LQfPXhp2noljjcN;V>cpN$Gn}t5@bp%ks0*W-ox^RyZ9sodPj_ykE zdX2p?_7^`i0HELc?a_+hWNZWgei-=mXOA-&#Ox^Z0nqF2x}Yt)d)lV<*`B$2CgfcD z^Y1AeUcULI&4Rzfx^S=VLp}!AiClf!#FNvw_e`Tfxdp@1fKtC0`f~idR2N8+TE$92 zi-Dj5_Z}@M1;{|aSO;(V4q}a#tH)Q~xAc$@phybjHpy>85AT3*KiA~^Y~*L#G~agY z{=`1q{bSSS!&uy{)M~gN73}atu|o}fynYIj>z!5^x82mC(kja=E4;xb!q?R!Q2c7B zL$#>{$esKWKTGvcG$l_w!;dF!6~7_3`8M3ndgN>Dsn^w$aA9a^##u){XPzSRZ!E$f zov%e~VQZzDk~~*6KKT%%VV9Z=*;#t#@32$q(RaJ2R3*kUk(2z1&#HNI&ZfuxISnMN zzrv!`9*`b$Qt^yyGak^lgM&-N*)c_JuC2Ub)q&<#<$j z8es2VZa@MJ-FUv$QzuW|q!r{5EV}NUhJt@KtzY`mW@>;A>gBAuo9E--Mq2o)$7?<^ z*IUL+z1}c|0b7DkH7VSxn~Aqey?Su>nYgfn)TF?I(EW$RX$$X*o?2NxDXvgjV|A}| zUTrtX&Z%0pRIbN6maF$QO2@>-VCR&LW0@6$O-`Y%o~8VRM81;k7yven#n_(&v)tD_ zGmLW_o`loZeo;oO?a^7<<3oVO=*biU#v@iWg7DwJ)7AkLmSYV6OmyL;(XB#~H7i5t ze5B$MuoK^ne)dFph5jMs!aR@xxjAM=9w&_>*p_K$^{YXl(3zGbdcn5J(I0UI8a%Y^ zBi!eJ%L}Lz;>YEN)qWG)xZc&J1wXyS8R*O`vxpfela$R{)^jATF}XssE@uI~DaiKI zt6Wm-T-%LHy%d}ESk!6jTw zl&RciyfHm%eoU!vg$hz$IFn!3eYV}(|Bj7W1^es17G=!q(TT_4NJ{fIP;t$L8o~4k zIY-bH#i_GV_0D+=lN@nK11< z*n7As)3QB29C1!fep@Hbq{ybR$JZ@*=vDlU`S$wJIA|?&w((6U%)~(hsFAKqgV-pM z{F~2sBe<4`^J`3ABP|`(bIuWqfedftp@xfEl?VHh-zN?;7EXw(<9nXoFb3)imu%=g z=|$SzOtby@zWKg7c?Om-?f$L2z=LX{nEE>XKbrV8W-u5wx&FF02}R7`+mf^f_2l+} z8g%;B>%;J?G9O~9i&`lxa#6**5`KsYR%KDIb1%oI4ok6@>(m+Jl(y2O2Z}D}bO9gS z24!DyaUQp`W{H^W8U(C%rhuQ*w{1zn%25w7ywOuF|9a(D{GtJB%fRl}&r;!JzD*8X z6C4&+s9mXu@P4aXx|b`A)efZ8+t<2%8f-p%|?e$ONRDA!U>ehh!j`T)-Ao z;O?*m(td}Z#V;vk282BE(b?4fZ zOk7;;C=cTb2P~LX6A>G_b4A??S_wo%xuLyiX$8ACm1@zeGlY_aZV?!$J+q@l9|{bn z#lt+dyLv^Tm>^74VXRQm2%QijXzs0drqJ25dh`9G64T+NPUW)%TtRX8eJP7k$wl|3 z90qr}R;3L2XncBVJJv6pH_=WHw3W(AIlTZ`)<7=m{j2+tvpR4_!0XQMJ?r4=*3<3p z&K&@eCJ5?PGB3TTB;C2h3GDDG_K)%sM4o?k$yklaSmDNi7f{oZLcyz{2*~z|w-}d} z5(i`~=FP>(wLfr+hOutfQW}mf*>yK`u{i$-4Zl^SvD(-y3_UJ0oo~QwX|a&s3mblDDg7nKO5n!}|}3 z2mOobkJSbq&X9{gcAe1uC1lB?tZiS;sT^NCx>=?j(dZ65dyf;}7Cb1{9zsQJ-NW%& zSn*B1SJ>-1s$ zl+6r?@hNS6gOBR;9fgD-Wk2O=blHiA9s^f=S8zIom6@#=j3eWf|VP$@TvCK;c*AlcY)+8kT z;jI_4-47(6G>Lq+`Hlh?a`^!Rb+C6GlmuUV$|a>ZAe9$4mmWLxXT50Ec!L0_vmuG}wUTNPtlpOht zvukIAaSf*L6dS!R;j_(*Unqp8RF&uj#b3QROoB{wM}Q-Cp$Kqeu7Y+x@K{FQt#Jw zW;`#Me5cn%S_WKb>&EaaYD`%ishN1QQnqceQ+uHNz8*z)m_QkmW1?amP1bMrhz zSbX+yjgL#Qj`L_&{)^=i$v5!r&eH7I1R8HZjg0~vvX&fxDua^*tRVWUrL#3sQ043F zL9;x494OSaOW5a-9iFI3SdO4P&XliUXvkSaVe)AlpEn@tKS3nxp>WE8g^55*UwFhznv*=~)5K~OCJ z-k=!k8-0FEVzp8ozv5AyBYMC73ll!ONg*#zbSbVaBv7sMzy6>;OrJR|-GuyD;wFJc zM%qaL4#Cgl{vW%zFYdvF?)GI8r;<&f}eqPVePjoN14}Oax7K9vPj}-aU^v z=khtSLl&H8f0|fgwP+ZKPJVMUfZMlP*Vpn~0XigZQGv#*=k!e@4`KUuaBb*78^q-; z#qf}~vcc2M8-S^mKL(OaKa*=hZso|%O0pBi+Y?3fu>7? zLUn~Wi~JX>LwCvQrfy(i^u7Tg|MF;9;Om}Zok@oQ)?TImw8sH_DEXyy3zv&+s?0ps z-0ET%>~iD;^5g4sP47E{W;u+!MA*z=uJ=~43)eT!s#N@)Myr}w~V6NajU-?5v=qGAsW;Sx^Wq}ICym0{*&MI zfcbVkK8pZoD=%Y)1oZq6bz4)G5bxCcUL<0GK#ud?ns@SVryvd~ic?)x?df#X(0L`S zoQTTXZ!YUlk;6kBV)7VK9H**B_PrsF;s8J96Mhd4szKF<%12JU512SmWi{SfOlSO| zetpWVl$PJ@g+31}Tm+%LH&FY~M#44dE8E;6uoALu|O}Ec4xUP4)`O-jR6q0 z@_e3(MK30qy!vbOTYO4F0Oo0Ba~=E)A%VsFQWLgP)tp4AT;nJMKGNK?Oef;iFeUp+ zlc&>z82>5afEihv6}}j5+I*Jv(fw6Qkg|2*D*u~MHn9AtbKU)DYw$gWg)(_!3@}o3 zM_0cjK3FCutM;YC2TjiF9lU*tVQBh#Ql~w@{hMxmL;iM2X@9rTVmWBU;LZB<-&Jnt zo?$lI_Hg&$E=R#{p3q9GZf^~Fgp8LOb;5vzc(kM1PnYo^_+w^M z$8wN&g|+wCd+wk%4j91t|Od)(U80}FgHfuXvK zo|dP$(0YRMz#$0IV}m(skeAR^fX=Q)7)8=jWGawyjLei+^^`TFmmWheEGuB*GAx;4&kN8zQrz|Un<3D3MiMX-3H z)Si_pw}&)V2*eLNlL^N$^Z=qQ-AX}sd}PcWdCon7r2at7m7?<6Sa5#2+#0abf1E<> zJT||LaR)tJUftt$PzNVesw#z(`N89a(F$juMF$runDI(;<>!da2UY?;FQ+AQOqql( z)il?~h?|djlEOr|2aN`Va3i9v*{LR!yrP7>wmm+y$I_H7|IME0A3lM6Z8kT*eH58M zlfpj2i$OE$S#qjI!K)RFsr-v!^6U>IfHmcmjNp~8R&%Y3 z3J-x%YjpIAKH$*d(e($3(#>IV9$&qg493x{=XV9k^)k&5ukoC!W8kBJl{&hgt@6O( z@pUUyt?C#PN5IM*1~@)@wLM0jy*yW>{_3v2H&I5e)oK>1Pl`qx7P)+75+Ll{Ehj+r zn`W(t+XQ;8Wi~N@up3xyoBe%7e+{v7&9QTJ|2JuV#V>dq(6?!EL(sX0-`1_T{51$! wxU)2*Ek4uy@dW&O?BvfCM}n^X4{kvf3IG5A literal 4214 zcmeHL`BT$bwvXLC(%nvrPg_vd7Fyd8gh9n%NQk%)?F=A_Qb2$~glGbSge|*{&qjBKX_BOK6US@y64on z=YH-vr*6@S2*g)kx_k)&fxbF^?8r$FXpMcj2K4z_`-IA_P5UU}P9hG08YOOvcHuL0 zXm}_H)Wle4N&b^v{vzvGEDi)(FZzfz-I=xLK%foljvon)E=YVoHZFS`w((kWYz+M{ zv!e6jmw7Jh&w`7>MG?uIgM*1)}u9C5n%C5NDWj%r@?kee)MU|?4j^eEB za-_R3*GDsQQJ8G&&6*{-b~)?4|2DNzNiJM4W`Ow~ZhQaNo*4=jThPizp0=u*={2(3ln&8T)wkdLHiKiZafdHG1AnH?wfQX7u^Lgp|;_ZG(a~F!cOd+U=M;{i*9{|Jj7K87TlAbd#pMcDq@t^u6sMsVgsTDSI z73omdZDErBG&nsyl`r;JXt9fv@6a?u(ss33nLF(7AviLIM4@vsOI`-h;)IgZRtq}5 zf%`XTdqqv;yk<45*I8=6*TSDa6e6>Ac*1DIbW0Ks7 z8x^SFeqE4?w}mllQugDteEKW-*-8avasFJ)91S?5yQ9Flo10J#$A=MB`NO=vSzo4| z4&JiW1rq3JrFsL$_c6h%lxNvG?ZU}5tGEQolhc#TY^n98_DyANe{B+Qpku*ZoFs;+ z_)og_Et_Z<B}KrQ~|@qFLda#>)b9y(pa zreIXI4{tLw#%&N671VficeXq4wA1k3{uIGYf|s55Y^*fS(zWMRs)AJ5?<$<`B8Nzw z8DO&CWU~NSh>B}j$%3FeSHeTc>mOv&FU@X~A8w@e2QxKQhE7r2%P|C3_$o2FJ8I@+ zy-EM$bLZEWhC5r>a+*bEVw5L5H=}c1i>XNKYWQsRw`{l;(3DPt< z1Mt?U6!0nrCi^w9?D;Qg(W*!2J5-eipDLEEu<&@vdD}>w<}vz?F!kaI=}yi399*f| zqSLZJc^X^mghOOE>dsW&H54oPd6^z5TNU1T`s_r-(Zj;O>-D(@DyU^hz25MERMvaP z1ZjNzo71AelRtkKT+S`0^IB)q&v+J1$SfmcJP$>^34PYO0eck2y^p;V@}%#MNk2E5 z9r$}nVH;D5M%h%GNo_S73)A6imdQ693wk`4H^9hwts+xS>t#LmF(K^U&KM^IGr!KP zPb;px7Aoy-(5JX1Ogw6w*;%@e3S)|Z)!h_`jw540^2ZeXLrl(Fw z5FJsjsZ|82jD`QTWmrDy0Hqtx({kO$an}3DVk8q|x@)zWHNa7e}5lux4;B$nj@sF+~kGOn)JjP_lJ=aT3H1J-cJOG6d67dj>%tj4243ohMxop4z=}ki5`8p0rn8w_HS-4 zi!Xzrx&6p}e&kJBvQ#2;pkQ5@EH5rN*twWUcj;hHPhBB+4>hrU>WT{6`d1HckWTX3 zT}QsX_&9uYw!Bh-228h9+&l#Uads@^j#TfEU+wz28d)`o^q+KnzRxevK49YuAy<(@ z#C(!yifjXCWe$u-xXg%z)b{c+U`0i^chJZAQzf0gOwxOmTrr=R0|AQg9}I zPuB6Np)ekFuD|v>EzeXU?b_J9^t}*6o?skpj%9U27%7bjy;m_I8QGaW>Dd{#jaA># zY*3*_MI@Ba2-+Z5v4)sJu|FBHGL%o}u|_PFVj#^>!3AOT7dTCw=iC!q1dn{`50o?z z!m5&to3pLEA~W{UO}yMR1Mwx~(zp$M4tex^_4~_){Y5*Hb$n8u|6sf!7ScHZ z`Z`6`^h^?S9R3*hI25Yb?#f&bG>2gk8Mlj+c2@b1x9Ioqu$2jBUuVPh zLZ+!FZ!LxNC)~vjwAP{Oi;|kuS5diOiWeZm~&tXYCp80{Sxdw0L?6OJ@Hx(Fi8eh(%GcnMQ7kCA6rF*Q0*gK48i>o{BQXE(awg5o7Y&h+|{SL zl2w}quIcGTOSDGdpPRp$u8~wr;U!M@=zj0{^o=lnnv0K0RXiHl4P0tjtQgE4CI7ke zTX)2|+Wqa)mIsNP+46-knIy`|_^kDVuLDc1P5Pu!@A(;9J*^wG1vufnGH3QfW6k{O`N_S|dlMMb7hWEf1I%V+CI@^ABt)-pkDQ)1cNSDjjUW zdr!o?1ql?Z5yvAUY^|2RP`~*6ow;)@=mNY626S!3 z4RioMRmrvQPX7Zy9qguYpxN1LIKd~NYfW~Ie}~<|i7nDKKbAU6Oke(iBOe|6k2C*? m%>U)h|4+`uY9_3n*cxgsRrEI5{#O7xel+4p Date: Wed, 2 Aug 2023 05:21:01 +0100 Subject: [PATCH 110/261] added more letters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ı ş ő --- src/client/java/minicraft/gfx/Font.java | 3 +-- .../resources/assets/textures/gui/font.png | Bin 5436 -> 5543 bytes 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/java/minicraft/gfx/Font.java b/src/client/java/minicraft/gfx/Font.java index b2336a7bb..51ec50866 100644 --- a/src/client/java/minicraft/gfx/Font.java +++ b/src/client/java/minicraft/gfx/Font.java @@ -1,7 +1,6 @@ package minicraft.gfx; import minicraft.core.Renderer; -import minicraft.core.io.Localization; import minicraft.gfx.SpriteLinker.SpriteType; import java.util.ArrayList; @@ -18,7 +17,7 @@ public class Font { "ÙÛÝ*«»£$&€§ªºabcdefghijklmnopqrs"+ "tuvwxyzáàãâäéèêëíìîïóòõôöúùûüçñý"+ "ÿабвгдеёжзийклмнопрстуфхцчшщъыьэ"+ - "юя"; + "юяışő"; private static final int[] charsAdvance = new int[Font.chars.length()]; public static void updateCharAdvances(MinicraftImage font) { diff --git a/src/client/resources/assets/textures/gui/font.png b/src/client/resources/assets/textures/gui/font.png index 8418ec709bcb055db4900910785bb959e8bc31ce..a334115db88e5baa91ed274779f55dd50126395d 100644 GIT binary patch delta 4609 zcmW+(d05hE*Osx--q*sKzH-+ZXWBHE7+i9priGc&GNvifR9sR_G#7G1;b%H7C2D?^ zrY6)drX@;5=8{5<79{~%idiWsgNUf8fC!3w^gYjC&viZ5Ip;ddecz{hf1}g&v%q%W zUymL6BP(L=GxydH?8*&aUfkJfTHd_j!8Z>~3Xyy13D@_Z{;%ym(-e^BfygQ)acSiN zOKRVRmqQ`FT*re9+#y`T=?Yk`_u6V+jItNRb~Y9-yj??pr$fYEaenyw?tQhq96GC- zTcKUC?<=hOta<0%-DQX!_mcmRNcSys(_%wl35WPQ z_11OYiU{9ROk%``4kkp0TS6`QX;DLuE??;qL_N5w+J4HL_Hsh}QJ6oUsb(J6bCKFnDVV?bOd8rn&O&+RCv4$^@O~%Cw1z)`iw^mRWN5b_ zSmSc4=dcbFfFjCJ5lzWgtM%7q>|~@<;?JGoi))K+rcdu6FCi0Cm(mzLsJM_?g zA7^i!>TP^PMtDuElaH)m>4WfSII`<-xI(zJ!>H7_SO^9D` zeB%6c#O3s479lnIh%Hn!@w9?kuXbyIKYB4_3gv@4`E^kWuRy z{uJ9#<`CfTun<8-Ef3<(&UUhoPP)ZT9YR~9Cv%lAy%%la(->{O@or1w-+#wPAz^`{P|^eEqoE zdF~Ig(V9J!@p@@J*2=_uvu!-jUqbIN+ueM;kMj zltSMmGCSdE#jzk-S6y-=SXZBKWk0PB5AK-#mQrMBgil^chbj(SG^f-N#VxB*vWDu0 zVhJn&Hk7C6VDeIJRc$wpnw2y}k)l4Gbl_yR@ZbGdyu;qhmiNYu`KFj`JY5Gp=R$X( zgPqC9@uIf8-s1Rm#}O28(R|o2PeTd5J^#*493onmt!Dd)D|kTPbZrlM9)!KpTguYw zm{{K*4>1j2dKEQ*puB9=yBgD!|-6+vM$wMN)R^ zDGwGc*01L*-x-K&y^GEytTp?W*V^cJz#4Qwst8l1erbkU_dVs{R%B!lD> zy~uLkr|&GLEqX1z0$=*d&K}?xsq6s?MD!@?0js6wcr6g)pOW<= z9l3jSU;um>=Ji-T zAv4CE=)s?iDZ%GaX;M@F^;d9VGE0~7fP2@0O_&Q5HmBZ4(a1L3g9g}(#YP)aeOuJM z-JD(}?g;^4^ZWRH-gMXIW`WvIm)C4N@TD>9S!IH)N@uCY)9)*oMU+sCsh_Q{SW`Mmz< z7I08#N$UG=-dW@~54mnoAY?F0=*3O&5hyRA!c_lvfKWxYLxDt(TAUj}aTSlzw zX|vIUvn_>v<{@;PCWm_OSGv2~G z#cPPPV!*=1-``{Cu^$;Y7ni|D%6)yS_Vs}I$~zC|o?~Ijm%)~5OK6tgm0mOD{$4uS ztO-=yIA;iy2czfqC)~Bc+yK)}nsXb-=JfSTJ|k@Jl-vGJ0Vkx{n*$`3r0UnlUwR-^}O6t#!SdN^w8Co>I zGUuS4Zltv6C|@d1>bGur3 zNlVOMo35jK=ui7aUbV46J_*sPxvtua;s*O$7bFaxf+gU`D?n`sd$!kzyC5U&NLk~_ z*`&gw)Y$AGze=rWjY*SB_n9jDQg3qQIZzb5Du~jx(}44kItKv+ax*#k zs znu921+t281kJxz=ap$apyVx0i!X4g(dJfPx=}~dEn8^Xy~(B9 z0$g7<*bw1r(CfV32V>0bEsBRKCVXxAZ=oJxw@_;cq?TQ^TR`R(4j!kr-#0FHwV}<+ zmpqLMYdTIlT|RAkr`ck%bE)#|`l*f#pfBye{0+7)sc(uJN(n8ANyCpfoi+u#W=V@0 z+O5K4(&x^Cr$ONM#fD!|b>U%ueH8+|@4lrp&QI9!Hb+Vddm0;o5A~gp+pf;|Gjq@2 z&Pk#tMGZGd@S5^P@73B@5FbO);EHpd#3i@{^teP^I;-mMV>TTKbPkUsJpwMjX!>fi z7XNo0u)$VC^fd2sCCF=$fFQmeEs#s1H|e~Ud`b*eeOd^e3C7qZxuA0A2e|m$x zNo)Oz4H6BTfcl|TOhU-DkvxX0$K{cD6YqpM%SkMLI|HEeAc@sVs1NvIEDcrA^@@Uh ze!H<+bFd#Vg7kB@h#gR?;}ncdCpu>!wFTo@<&MfWD*PsBiRoFM4({J2INo`X7(-5* zmRVQuKry8IBc{qkz2ld_?!y`GVbdv{56Y+ZCW|~|1N#f?OGb|QG%81aHcwb=F0R#{ zO2yX$?KVD7CP9+de~LFk@k#GP=c0>Wd~B&WFh?3{bfoMStcJx%v50W^bMKT7@oz60 zpo3x}BG~g#yIMc}w{D=Kv$iq)m{q)O1+f-sL9_~zU_KwMKfsZh%>*SIg>JOSM}E5J zZOWChug8t5P8)+Am3LcdfmE_2RhMNyQ475Op|kjM#1?t-hf+hD-5;U{%xoiwGg+h( zaR7{Wr8lUseQbW!PQ5Z)`%D4HHy?7)5B<{{ux_%&)t;aECt>UlSkX^5VP-bI#TE}M(yYYI*?IO~7JgPCz?4J}_<*r(M3a9%1;O{jG9rcy zbTbS$4BfErZIwZVQ)j7_aeKch*0-JGdvR`+;iBmOK@1UG2OQEh!X*wCHtys zT`Zx_;cf|r4e5fgX1O5cOUiFTG;pd@qwzM~nEkQumH!Py5Y;SgDE)%wPW!{-?jzYJ z6mUNtn-;($hbW zQ|jvQ5!xagc1)>S*%j|~33&~AhfVt>rh9rZK-<~k0L#04!_ll$iDy8y8qe%4m}bSw zkI7av5-dAo)S4DSeuMeM+@V=g0g-qq_LrP>ubwxNRpgimN3N;bqJo08Tg8^;gzUhC zFmZT(t{P_i*LlAPRI$InABvn6WlvYD;8Nx!*qR9Mb( zqC1~BMH5t{PqUp;@q^xvv+OI>VWRqRyaN(Oc%jh>6OG1_2}e$%9Hrmpd!g{OCtWNA zX^g>JT_s|=wN~S8t$jKAU$U5)exj0A^;=B$s`eflc)IR90(~s&bFOnxjJx^3{_|m- z2Ml-({4fOfWIFQrmzF|8VG(<*#fzF_5*_|kCyh{q9vRNH%UK+UeMgd$&_o)CLMxkk z*_I(qe?Q{$5~EamaU#*JOJ`PXj0n>WXK9mvtz3(l#=aJWh#hN6NlCbze_3rb3>lOnAL2@xDsoqns!43EL zi>0Q0o|D_lSG|OUJ_SoB1%%6XfLrtYnM5Os1L3*JLOV>jo|&s*0qbioI~7|c3g7i$ zquC8Qi#}|}zbjYDPRrc8UUWoB!x-DSvn@|R)23inHk$P=#^H%j@O*Kz&W$k_eUsf) z(^KJ*r!cKWSq&G%W@}cA?b-(3`VVnUuYf5I3mw0HZqS9ApH}RSTweVBak~*jw|ih6 z@_kC~`hCg5lqc+NYuV0A8^4pqE&DGXIJ|bHRD=*DtQ_I)GzQmsUD`#z{NnZ7@o7_i zW(K3{qsc;z-lqX8;R&nJ`i=2%$FmqmwoQT<@@+qXZpgP?wvutG^`>UzrmDb`gH=X` O^Xu_b$69}m%>O_3{I$~n delta 4497 zcmXX~d0f(2_tvp;8grXUMG2bmZPi?J4K!=gnYSsj%^fsTOHIWUQ2AC?W@=`OW*J(% zrHM*P?t+>NrXrdOWiFusA}F~4feSyH-`xN1=X35opL5T1&hwmGV%EI>-Z@~~;9q~Z zoy8#M#u$&l9``o{>h0-io8E7I_S)It^XV^tC2e~B?$0(;?oP|XeOiyX7+fc6?RgVN zN@YI)ML}{4MrPE?e4=S9@e5)tFi~s~BMK=7Lke7b)ZrvB9f{~ac*}bTYp_C@SpC@2 zLqtL%NU*y^pG`fS1AH^K5pZEH;;VIZu^2`&!l$z&jsiFyd5`Avs6O zJcBr;9Q&|mT2W#+8!^S5{Hj;r-67gWv zT`NKWDgBH|mK}idaMv83c#zWKSuTkkjLXKkGvR)=z7@Je$nedVTirGDluhb^Zb5<@ zo@r?Rub}$nZ*3smxWHc4nyX1Z{(Xe0w{oK9Gh?H9^z_?J(-^2Z^i-3~h0;v8TjtS& zd&t0r9wa9P6oi-^5~eMFEP8HX{;arCZi&^p+Ig*A7s$@3UNe_(#M@UW_cw~ig~d?E zl+ELrl|xMqA^i!FN1Tc^TY^?~Z%%On#O2Ddpk<0H(uk zjT@Iv5GRmK^R#n16i5hswk3&Hu)S*RH(Y@V6K(r}hb(AC0eMpRv_hZaGs%waU0YuC z(N3I&&(1N57y%Md`GR>pOXM7#%Qx zT)U_5JuBl%=J)+A^60l?lTV=$q~`6A;+l&!yqVF`99~x>tIp<0rZYm9Li4i~NJM=P zJjMOShu|`WprmMYv}H}|=XVID6abuJK(6!pKgAs?n~?L)b`x^oPwvBea%)^Jz?8CoUh=cFYk9 z!E{g5p@vK9RR{Z$KPHaQ7f%Q&@jcIP8iIBB%T~0W^dgOJhOt?`cfPk~p00UxyKgHe z;GmKK2+42L|EqFPV~jvxlk0DI648YGeJx4raCdeeq(QT9qYeVUCh;PqIw|G+A}2+> zGq5c>NRdUp!M+loIwHnisZ(Z5klMNxYlv*hV-kqEMqs7Vi08t85QD$PRGG zsrgyHH*F;4qX3%|GbtOR@FYCqt>ALfrb7~lM9O3GDslIiJn?|tAHvrVwhEWBzSxT} zYNNe~*MnOt<-&5@YFd=*D?@x{5#kg2LMZeBzIE67)l6J$?HC8+><_3d8dC_!P2IVI z?nU(k0?bRGci$e5xx=Q!#D8Z)!-5KEshv}+ZmB}W7$!d%RItr;7 zOn}V4_srxwx>L41JSqZ>Bz4MPB;X2)!ybzJ=~e8w-ju`8F6Zi$VK0?UPi@D>#S2Cn z=>gVaNg1nG4Ul9F=Au8oc^EOL=}-52+xe?|oxig6bo+<%2Oz{rK)F`RNiQl%cPw#$ z+I@++Q&ED<^UW?9uQ3`g-0b%X4k{_+y%`RN?WlZ@acU{CL&ad;U5Z%0gIm&%ak-w- zaCF(GyP=E8@^fY3u<;q>^-z9c%c-Wq_4StufhI%=v?~3pm2J7yBouVOc9vn6{hL(1 z+J8tlWz__l3am-kukF+D;H6P`gV!{n8A&i<*nASa$HiSZ!T*szGh~OaB{OslTewf0 z5qAMauJoNx{;uxjRO%5cHuuWocf;jT+KD*3yRoia4VJ8ULWE;DnEQ8dw_Wxw>5+M$ zNFeF*waoXlfBInjgVwCL%~;0kjyYS2Mu^_88E4MkUkMvHBpmWBrae{ax;erw{nm9t z>(Ah2xAM0AIj3^G@o~)(jqpZS@VN)9__m-Sp~f&ea_e4}*W#*o@~wK-OiGB1_K>7B zcx?KkHG4Y;4F@(ivi(&3IgW#C1vuM78Z?7jvHqx<|922HY_kLPJmBl~_UFo=gl?4x^yT=bN*0%Ymm&xC;UQyl|f!@Y0+^2fikH*s3HgzMFfal zZocGDZE5em@2kI77H_Glg9hluhKJcy0>UZ* zo(va!k|T_$`vKrf$`TajSyjz-Qf_?@|c#)RP``tO!AELPEM+Q`F1r-LkAJ7yi_iC znjEyiw{eEPAg{JhJO3!8Z;C9FJe}r_Yux9ay7?`>Mcngz!C+dAw{r$N5D?rL9En?a zJLt#?*7nVvs#kSPWYE}~;b(w?dDXE?vv;av3+M}s{MLlJFJ87(y9q}>KmX?` z%|eplRKsHKx%L0nCjuR@hJ?+I{!{n0kMF@&OpKOEY!2^mgmGS)H=QtgnX=m1RD!rF|X|_G)3IQ_Jd1P!}W6uKeywlf+4oOg+ z?P)@Z#gcwNT=KhHe(b)ry1tf|GRPreivlu1nb!eD9K!bPWLwd|R>&)Q#s0zXB}1p1 zH-S^DehVOizLwSm-_DVo6J-Ml6YYrtT4;V+IF(Iy3z!~s3hWyiN&#_8BgzSnGi|!p zK1Jd!(>yB`S-fHg!t~D#ETMkLRhX=+s^872qj9g-Ewt#2PDACw4A_cyS*Ey3m_z;4 z-=Vc^aZ4+pFlzrGn0sX`G~jJdvF4QBVE;b3?~L04d`RhQu^yX^1)8cd&o{R^*#tQq zIf458_I%UF&cHbqJueY4JCy6WRp`X_jURS+g0Z7XNIh}%$IKcm&ZbOOZ0HCBjV!?QdrR$PEuSV_=i|ii9)RE#r|f2ZnJ8r*4t!T>{Io3(Zsv4F1fc-tb~| zeI0TWMRXaHInFm~Te_I_YM6f9{=oO1QEk+h)rxrz5WyirCZRgIr2;!6+RpGB=X7S@ zOLi2NMO?zuLMw|bY8q*a#SX4WVm`DJ)_;%w_u73vW3g~EE);}lT2k>$m;)QLODf|@ z7yn+XGW57zGwy#u1*r4&w`Zx}{o4#S=(JoW^2e}vNfypiQwMPt%C+h7 zT2h0zax!L#VE0dvcU9F1^Gto{K_vL`q&Uy5c_;rh3ScZLO&nIGj0zKu7cL5swWP;j~F;e6$Ni8q|xsv-=1ZaO$tqZgWWqewgP~&2|1~frNg}x0=w^>gFV%YMmtq{614%vp|#aN`#zwwaMM# zQMB(gVbHi#qd#mZ4AgwC|Fi3xlt6jw;x+CM{j6*LS@VYL(bk{`bW?fq-G9jFg7(3?r|9~iw^N$!ey%^n?7Pw*(@Xn@&891Xqq^@lrk_!`#Py6Y znbwE9fuY^@yuaPyRTkZzDkce@C^P8v=fj`4&Z1rLYl*z6@0WC_1Q{U>H}N~Oplg71 z%vx;Uyr=P#$aJjflPxEV!*Z38ii(1*4^*1=mM)2Q`)0N~bUyu_%UmYgug3z)R-<WU;uokJ-@=Yj;O$KC9QBu6XWR{UI#P8L0Ye%=AF6Y4T$Bd_s z<)H5KYw@dUAI{x1|9XEVG~%n=3#%7FTKc}r5=17nEQzY^kW`lk?Ap`=i(DZCBXY*chp8b9g|8Y(4K=3K`d>A0W`u?B56$j?mC`V(LYO$Jx}zOJMtvp@`> zOEJUtGGOOpo~1C5u7P8I!R+uTOJ=GODX%CYuWhdv^{F^T?|<2o10yF;Z;j^{c8sAC zsA9xt|Dt88;J}A(Ys^R*>ZhJQl6Zu681_NeLDYAs5JZ2sM@-GS^{|FE0t`^ zqQcNaQ1m)2ZdFI^(BZL-2MOXWp;8W4xuq0}qgpQP4wPzVnjBu|I8dVf$JAEqXg=2R z1BWLztdi9!(MI-atM};8`0TazXleG!e3A0ItMb8Qd14xy)3)?NO|||ycJhzPBZ1fd4~Vjr&j0`b From 2530c69514b687f2c81a64c4da883a03f6e1624f Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Wed, 2 Aug 2023 05:36:14 +0100 Subject: [PATCH 111/261] updated some letters texture and uv position search by name is no longer done using only lowercase --- src/client/java/minicraft/screen/Menu.java | 4 ++-- .../minicraft/screen/entry/ListEntry.java | 5 +---- .../resources/assets/textures/gui/font.png | Bin 5543 -> 5547 bytes 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index 2a7fcc298..748a834ac 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -218,8 +218,8 @@ public void tick(InputHandler input) { for (int i = 0; entryIt.hasNext(); i++) { ListEntry entry = entryIt.next(); - String stringEntry = entry.toString().toLowerCase(Locale.ENGLISH); - String typingString = typingSearcher.toLowerCase(Locale.ENGLISH); + String stringEntry = entry.toString(); + String typingString = typingSearcher; if (stringEntry.contains(typingString)) { if (shouldSelect) { diff --git a/src/client/java/minicraft/screen/entry/ListEntry.java b/src/client/java/minicraft/screen/entry/ListEntry.java index 9b60eda8d..d1b65c4bd 100644 --- a/src/client/java/minicraft/screen/entry/ListEntry.java +++ b/src/client/java/minicraft/screen/entry/ListEntry.java @@ -5,8 +5,6 @@ import minicraft.gfx.Font; import minicraft.gfx.Screen; -import java.util.Locale; - public abstract class ListEntry { public static final int COL_UNSLCT = Color.GRAY; @@ -30,8 +28,7 @@ public void render(Screen screen, int x, int y, boolean isSelected, String conta return; } - String string = toString().toLowerCase(Locale.ENGLISH); - contain = contain.toLowerCase(Locale.ENGLISH); + String string = toString(); Font.drawColor(string.replace(contain, Color.toStringCode(containColor) + contain + Color.WHITE_CODE), screen, x, y); } diff --git a/src/client/resources/assets/textures/gui/font.png b/src/client/resources/assets/textures/gui/font.png index a334115db88e5baa91ed274779f55dd50126395d..fa7499383e738a5626f352f0d583db7d481dfaa7 100644 GIT binary patch delta 4498 zcmXw+eLU0q`^Py>oO2X)oNw;db~;Y+%~Fz(%{ZO-p06XRQ@Pz@g{*S3+-%s#;Y4M& zq>{T)JK?w+$U7-Gz@Y%y#zo16W1&iCZNZl15}DzmP%et22i zHT%j@K=y#CDp-F0L4mZhn}mI5S6N0a)0J76M|T7$>eKZS5G4=MqYbYFbs@b6 zPNw?~5yuH~ujoa-{=0-{IsxaP4p4h27A0amh(y`c%nd-ea@y?reB~-Gm<`ijrtzuW@#| zZmW2Ymi||s#zZrs;5&fU_A=wxH-cb;o8wLDD}td&+^x^Wh^Dw^ddmE*!qKZBN!q+o z1eq81lsoJr|BoN}l^>h9Ag{5mzj-}AxefP;ect$~&3W!tW6Q3#**1QB7WvgSRJn^_ zU#+%jl1zz9AdX4;Q<*ix%?{U3yI0J|#?32frvf0RQ3(#`Aiw|upmt<-o#&lJp6zwJSqaiNTRB_4q1BoFd>19~Q#1XQXq@j0nNUP`o?hZ0tlfLwq%POLc!Vq){>Lno`Wq~^b z6c23)j?-@sor9u?qP2bW2*>~Gf9=kan*!5w@#@RH+YDvhpFIKmFa13)V-_%ISb>rB zlB6%(Mg)Ur)ja2opQh3W#p8LFR9=yN93CvsWp2H!-X;TE)aoMIUE2Y4aYRovF*L6v z>@mhghJS1=mUm5jmC(@h8-VT z3ciz5*AnY}lOcO0TiFU*%rJ`rbGc3=YHM6fxOUyizQnP(;jXnHas8dYp5N6o$iU)F zrsr5}?YYpbC!STFRXV+vPnmxt6j!f&xAg1R?t46|JBK|{8)zw~15=5bk5O0r3i zUE%`xxUpl)#^$topdK-x22@;TjBGw;2g+-gnNEL6`|wd!fmoZkt^OC|O4=of1@3hZ z(>Q_TLE&c$$ymG;Tg}a>#)m5Hu)E;RQUOXH&6(V2)VjI9{KjqXzG&V99cn8QKDyj* zpN`}i30*%i{C-(W75x?K+h08269S}DE|CQF@Zx>To7st@EdVcx6Ge<2xmw1f@_1Y0 zla~zF#V2m_nBOF!j<&1$5ZcesVp?>*-vFcE>%V)L5t6K)#bW9Lu_T4 zO%2!E0gyp%C5y(~QAr@cR^9d0z}d+bgH9M6{)oDtt;wjVRmPZIh2(+stXOu!jcqku zL`Ktu6lIDFG4`6WiZ&2Ue0=M^{@lCcx(3Z5Jn^OKTy2pl)lN_w{BQ1r;Tw`7Jo6B7 znZ9%XW%|o%f0#RSYpvIhWr*?TfHs(UH)Cv@oQ?kcIq}3fdSCD# zBMGMib5>&r-WZptgty_CodEZIiEer)Z8QKeipSmQaA1x*2^~13Vbo4J zL3zIm-~*&jK-4t}i>oIi;;~-nd&wzKu1p642&j_AX+kq6bdZcjHd`tpfXN(gFP7?e z*ct8@d9G@)#d5(h^4*y#`P$9V;;y_kilgPaTvRdNS_X-Fl7|0YF%WYdM}j?)j9x9f zBCt}R3pYc&g!FW3r;kP%0*8G=j?L}lAtN>PGreB#G!AE!?0~CQ!%4e6<~7iuOw#Jg zZRmh5qu!-@m#BFYQ1AVXm9sx&@^#8dcSwg>)!G;Gd-H}}0f^_Nn=Bvu8(w+_1xQE< z30>e?*ZN4ek^oG-KA0f)?W8E$N;-{sY}*;8)gi z{VPsK(^V++mJcGA(t7IV4c`dO#nXAoUwN_;!;;cgJ){2874VY#N>IK{`p1%=+_ zc_+YV1k#ij>1Ajn2k%Z!JH2zTc3S}6zVo^P_y+cB5%Jk)qw|Y5qKcN~(|go=H)z1N zaFw81EL#G!UQaYRzbj9#BS8%lqlxxDy4{Hk4a5YF`PWk^J~hfgu}^D0E$O80$crKZ zCx+6MGGRqV7m7_V&h(Pb;lt~HwjUe?@VHXSf3~9u%f0Zt7*}tQ2SZ7}BGr`k$qM}# zkO#b8X=^Ue5;;U_4|Wghq6e>m{6wwgcJ)p@p>VjUEBU7?$t*_~-4Cg@tC;o_e{52! zaE0Pai?MI?kajaGpUHXozD+63;4^e*bcAq z^_=14_U$h`8OoYtD+qnKAH;e}~o}ZV(I%G3m zdncPKs;>4wro;J_rH^b1UcBYb^$kjVqJvLi-AcOAL<9P5Y~I)2d0Vb2+((ZR6k7(tTn3yg*rg^jYYw&_U*O57cy ze7773q7p_toIZkG+CQ~|f0h6CGPfP`MvF7|TkUL!6Z(~R_Mz8;H z@WUd1<<8>|{0%d&WV4$7;fpQ4_dWp0GvD)ik7Oiey>aP_aqp3GuDiUz-1Z)elH}9X z6s1Du5)!r@Kg|joojQoVWl1)jGwbZq7L4d>_t-xTWJ2Fz+QyB|hwSs+NdC_08-b{I zJYOOFX6`a34)lwdLD(ZQBM)e!DaeIhD~}+wyd&_j+cG;;nrKRl83{WH=rLA79^DN{ zvX#yp-GLNq&~tF~Ed2x#T^!RLo8=))vGs1&VDzTiV&>--S4qg5L4M4|`wLc)f>Ywb zBWd7!+#j9G<}lCo8aAFhFKxXTh!QS!8dN8=Ih_c0`oRnJ;q~R_vEbS`G1{})Qoh(- zeqUaQfjVXQa`#0UfKCBs*oc27Tt_xbY26VU5NxEfy&`>0veL;CWcwJ2Q*8x{Nm+KB z@mDRaB|9?RlDkm{?=>9A#|{?4(r=G8gCp94e*<&mBSvB&E)YTScysu~;^dilnS{${pqs_-upuRqAS zH~m+#8q8g0wy4X&rHtdh)h*le>aW7moZ9$K`#G-%R(APVRK=Y4u93|A5_Co?wa0G9 z{4pYba#oL_Ts32CK^LOaVWFa2SmaaT&x3Zo2@^%k9yfS1z0Cl)PCL%K&f2dko z_Yc{3AV9+MsiL@7kLZ@J7Rtg5?cP_3jL5vB#Yc@tri-wSN!6yzqmn696>w+geVoJ)-5Ecn_5^n9W@_Gh%@>Tm345(8N|BCl z`RPKQNY}mp9)|0ZLX;hA_vejz*AKK8ADpTEOOUG`}Deg1()*VPuXyOr`i5&jID) z?lq^#OPL`xQgA;+?g(KLoUzeKr!tW2Ft!^Uk}doh{c+^Qvv_kCqp6$g@X6+JYknA? zhfq`&7h`RY)>!nGOF!B8XR-|66>QiQFBae0>e}A^61|)GWFvJ_o^>)YV;<7p51B0} zW!GzO_0cK?>)@%$PtqX=PJtLGrF9v)v7%WQs`xO%Su?>|GU}1=Pr{bgkQWI$_h>T| zGpBUG?Zs3|Hx5Ob(kM*nr&sn!hD#3j&*YJj$i`c^bP=PeY`)#B~|nMA=z z1F?NVvoHp96t5J?;nFFMQru2<3;3QMSc0}kpe!z^k6Z+gs&PPe zSx4dogZXCt(|8EaE}!X-7(Gb7GOK!ly|xMiOX!`>j7^tX!d9wO&K%boiX^ysp)98K zKaXxzA#cP2)RuVmX|}?Yn;^Gq!35n`>}0PbN${Qff+Ts|1cm$z`{uS^4MtXDq}jHg zg|R+ueSa0$bXL0wTyxGtrZz~9%=jGkkZSexdn+>A@^4qdR+T9wNF(5Vvkc&S*fgAN zg39$knfGU6mWITowD;~?c0@7$bFp}goAnvlQS}V_$tK3hj!GLmSCOg($imG!_$)CKFA3|E9>bZs{iqWx# z{13fYNN2@-Skd+4J(na4&XCV<2n_FFhchm-;Dpr8${NM?jRJ9Is{`Zg1cW`Hno7jE z1_=9sR%9&A8>iA<%}Tf{a2aTXtZqdDs_DjLy}pXgZ_L|1WH`33M^cOc zqL-68lrXaTUs}#?JE;iNdc#<$TM6r<9_;ql@i&;GI-Hg-pCz~O z0#fo?zI?4FegP_GE;_X+o%;>TF&6jCQ#+dS7~V+f1#y0Kb<}IW6cj&Q~wYB CN0k=< delta 4510 zcmW+(d0f)j+Lv)gyRU`S+!FUG@3f5OdT~jSnx?ojTE?9z(NtVgOf(mAL*ZvSsU=Fj zm8K@tFs3DnM&^=2jTR*VT8ddIDT9c(10o3W(tFNd=kqzA=XpNQdA`eOc5ZaOeijr^ z8F~mHt*$>{%N%+LOHi+Vo|7jNe;A*1nhekP(`^*QDf>Yj7gNdd8yyln8z%8hfD!I{ z4Ak=T+S%1Svc5TBa20h$tvmVW02{vZy`7-WuBOO0pr{lD}$tJ?Co<7OXs#h4)Z%(7uI9+XWy3>_oZt%N;%H zH|fYeVW`ISRNoOjHV93UqobNquT~qb%Q>ki=j0#ZGZixzCYC@HkgpC%>#^!9UYU$F zYp)uY$u68Slbe+I$UBz{6xqH$CJ`u9PxMH%Zmw?nZNJsE6?gL|cTg8mNhth5SN#aq ztF9zi4*z4qE+*jV+2UVqNl-N6#Qu@M8=FKLikmTvE61M@z|MJvw^-5~My@nioY-Gw zV1lBL#>fhhMd=ZL?*h7%%g?PXanW3%o^4Z2z_@Xn~l0uKR26-T4Fq^4{B&MnoRFW-LPU!%J&o8|>bXjk;3NaX}K=|E7 zbZfoFZRP|s9OE;G0e?n>3CXp5FAq+xvqNmkEl&Cf#s)K;uYBRRVuzT;+928;wSL3= z{3D{|z(+Y1aq!{^n8qFv`r%r=ipd(c z@c`;n1ZVZ9kSak^+pmHqpE`Km)4B05@tL%i@yx)zOIV2by&Cp)8K`7iP<8k~mn6WR zFO@~gMMXjNsKEAopgqJ=VV1hlY-ApFZTUO8J6bk=$w3ddY1=iX!!$gCL zu5$q}o_3M6?s_ASU z^sH;UYdhG5ikd9$DCjRq+;kd4U$7iC!f7NapzrU6slz0j@{L@Wgvf&lFQ`R;VO1p`3(BJ09#{Vi|GX1;b{s}{ z@@XpPaD<5#ng9zkdsQiWwfc`t$|QY<*Uxw&>=*dlm$Myn>tDL5)R9>VrCw9OqJ!DM zrdG}dbSs>y7r3jqjZF6$nXJ;T!#KzP<{t4IpdbmMcih7FbH9es^0Nag!UQk{hyanl zS`9WBCSzX*_@Im9(lIncbsZ7~lR9gb=COT)Y6?mbfN{wkZQCrK+1 z{VLZDvkk5bfW7b=&mSr1KlmgHz=tJ4Dfh7+J^tT53C_dc$*Af7Z}ZBfu6<&OE*Kk_ zmh(IjyLk=2;q*EGYfVPUE6-V6Ir`8!xbRWH;psZj{2hgD5=Z6+{KnP|h}p|<#2Vc9 zk$OsQia*guI2l(;D4;WB=7F0p5u#MKKI;MRt|N!I5G-m=zmH~6Z2_LAk@n(ovBp;4 z7WeM5Y_F2^g#qxzgMtCScDLqcp&F(yXto=1A}qOt3I&yj)d`zFjMQ#gEBV^TyPK94 z4ac^FLxAwo^mkvqg%Gx5+XkIRoT}hb1S`N`@GmBaGUZVFtFiJ4_L0h^>*p|DI)a}7@~$ib6}VIEtEg> zw^J>eKqZX}#!C6{_WZ%5ySCUH;C8d-{06FJ`{qUeF^*r_?Lg7Cmb_ zvSN98!BIWiNNds4K3ASJ?AYGs8WK_@|8orR(H;BD-c(UJ8?r{~69Z@{DJc6Ia$B5z zn8VsM1pCL<>zKawCxc?&+W0~WvQ=|kbpXu^4YVmr8a@S2B21D&9Y_a`@0f=$E8}Q+ zZxgoGhKr7a<7)!E)=E{Neo4lnwqk>h1(0aZz^1N4_BNHiVA}V&9ln11^ zo1J`F*`PdLU&BLs%U?G+s=se%m3`4X;4#06=+;7$uZ=Bn2z@{Ffz{8jW_D3`DJ@sS z>qcaG$TE(@oZjxJy&nmG);eT~wHa>;iTo~HbzlidJrA`s((09s9aW2eJ=hjxr1?~n zw4A?~pb{&BA(5^juxOFGXH(qIQ3d^q!_WTP|8`kRvaLGRYozmgNXu$=7*%psDjP5A zK=qW4Mav3@dAOCw!@k0}ZQ+&EU02M(sqPn1zev%WUf)%$JjbWUT3UbZMIXzAv@o;> zfYh>YgWO&;*pd)x(5r&}2NSGaEsBRK7DBi7r^tY`U#>M4Qp>5@C#3SO3?HX=-Zw3A zvt=wUt@@Z;sp&fHeCf3Loo1`)?$ydOo2R<61~UFf@U@+5`s?C`GGa?|%IKr5r_I4` zIkMu0PV30H%!M=HSrE8$rQv6EU1Y=`z!xXb|MnYNs=>$aN< z;n#(y2$vM`voeKpBH;WdhoZc+T zcc4OyuBP{FA1d{vIT-CNRJ45>=ovq@j*;n#5=4zSt7ksA4(EUmMIX|Sr1%+-K*V&A z&Q#MHMED^;1+8r((;xUf^3PU>KP7C>3sv0gZ<4adC6`xX-$Wfa?+>%1RAl(up=l37 z`a5#**Q_kkpIY7-0P?~lLujW~OXi)*RpOkd<1n;ye{xqgk7b}})XKnEj6Pe`kEvR` z-u~nUXRFrcB?lxPH3JPot60RaYhwjWH}6YhiDrID3y^6XVHdNV@0DDwg!+RY#xu}G zJuhjvXSW-xHJ*dWF%-J2I&jWks?Mkzzj`t3Sk*Tg-)|nuKq$ zDnxy}=V#87ajqwft4^DOos@T58Nqa_G+m$LFjf2NU)?2_qP8!kzArPj+2bK*$igm) zG?zmul?1{0m-|DmbWSX8*sIs)Yo96*1fcn_qhaK){-8~>?QRZ&?B9tKzrl9ufW4=IzeLit8){RRXUwBNm-S?pG76LYHwuhoK2jY9v;W+$N85lNW@$x(0kk5Nus zK`eZ654lF$K=t8n1P^&}b87i$$z94sg!tBbDv!5H(Z;z|Y{x$B9tbS$Ye_5ZIOD)E zYEG{cKa3YTdBc61RctT&ROhC9GaZQh`xYZ4t9(hK8tW6`*yJ}ge-%EP0y>6qivet- zCN`OtSUn_XSWB973miT#|ENNOY02J*Ayd1krocfOQUJp-qehI{GKw%FY&77u%4oUi z^YqFa54P<>eZai-s{J-^`i|gsnP(1W5|i%G z>tDh$j};+i1|JbeChNaAX9$Po!r2kKfZdt~wj+MqL%I0Fq+NycY#E9b)_KLeT*8$6 zp?!)2moT8>PRY3bg%%-oOi^#TC*+Um*?$9Y(?y$!-+*^Em=oB$U|%Ya8o!M6OEnCv zUX^^y-Cq@AG=qWd$)Y_v>#x9d#DKTJ(z|VU_5U!+UxP(68ZjE`r-YX85grk5$+W9H z>P*Ds$iFyLR|wQ4(ml!e**Pz&Su0BWoc4zBFhu+aJ1TFFTr=<2Bz0O1doGiMP1SV9g z@yXqeZC0#*pK8sZz;m<4Z5UD1*VvD&-I`Su5KWNb{*$-q+xI%UiW(Q?#4}f0k!d*l z4P1F%*luhX3r`T_tKp`9oI?-omPNQ;NAZ>zJ01YH4qD0$y}+x^#6>Uce5u-|d~OGR z8n!Trj>ua}_7IR}7(#O9EXO&WFzojz$APSl5Z6x<98qxMbB$J%Y%-BbJbDuCB>Se& z7foP1?qMS-6HNZb1_|4%wVv!~9mq5MCx?{{6PLEC-(Y(;wD&MiHeJS`kK_X`b&iTj zcYpXl-UFL_V90mqUn2+~mJ?raaWyO)9<|>_vZDD(swcecW)O=pW25=@c`K9fos=aC zhQ#2~809lBI(}CDaj%475~o_z@mxUv z9=D!*TS~6GhJ&JSY^cPLv$;3p!$hSsA{xMk=bWz})`il^M1pEsyOZ$_?IkxSF`-#4 zGYPq(lJ+D$lkW+UJZ#kP&5wRqH=X#Tyf>OgrheXh$YsG(aD-v?zH@)-SAvBhOA=5@ zy^leIAMFd2$jk?Prgv3r_=<=F3btMbh}P`gn-_mgHlaBZpP4Op!bO|e`GCe~*mW1Guig*Dsf!mV5L(?~0K{Fn96hTONaE&B5$k4Et@I<71KV*~&J( zJ98oSCa0&SkL+EbFt0^hkCwpaYt~KeJBHo_j_}McgK3V-T|a+n(1%-|R_u#jTY1!J z;-%j=wCS}sEr0XAba}?-2>fnq`F9t$?35?01+E-AqPtusMhcVGkMh1V1=smr+|z#P z`KvdRv*w2EEN0IKv*j9te*;d+7gb{nTM`qF=P=X$xfjH|zBBPFYdN>tU~WNestP_i STxDWhKOaB!Q|ph>h5rY4^MmRD From 437924d4f1d8c2d91c3b965babea93e62daabc7c Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Wed, 2 Aug 2023 15:55:49 +0100 Subject: [PATCH 112/261] revert glyph advance code --- src/client/java/minicraft/gfx/Font.java | 49 ++---------------- src/client/java/minicraft/screen/Menu.java | 2 +- .../minicraft/screen/ResourcePackDisplay.java | 1 - .../resources/assets/textures/gui/font.png | Bin 5547 -> 5540 bytes 4 files changed, 4 insertions(+), 48 deletions(-) diff --git a/src/client/java/minicraft/gfx/Font.java b/src/client/java/minicraft/gfx/Font.java index 51ec50866..5ae806028 100644 --- a/src/client/java/minicraft/gfx/Font.java +++ b/src/client/java/minicraft/gfx/Font.java @@ -18,28 +18,6 @@ public class Font { "tuvwxyzáàãâäéèêëíìîïóòõôöúùûüçñý"+ "ÿабвгдеёжзийклмнопрстуфхцчшщъыьэ"+ "юяışő"; - private static final int[] charsAdvance = new int[Font.chars.length()]; - - public static void updateCharAdvances(MinicraftImage font) { - for (int i = 0; i < chars.length(); ++i) { - int c = i % 32; - int r = (i / 32); - - int advance = 8; - adfinder: for (int j = 7; j >= 0; --j) { - int u = c * 8 + j; - for (int k = 0; k < 8; ++k) { - int v = r * 8 + k; - if ((font.pixels[v * font.height + u] >> 24) != 0) { - advance = j + 2; - break adfinder; - } - } - } - - Font.charsAdvance[i] = advance; - } - } /* The order of the letters in the chars string is represented in the order that they appear in the sprite-sheet. */ @@ -48,14 +26,12 @@ public static void updateCharAdvances(MinicraftImage font) { /** Draws the message to the x & y coordinates on the screen. */ public static void draw(String msg, Screen screen, int x, int y, int whiteTint) { - int xx = x; for (int i = 0; i < msg.length(); i++) { // Loops through all the characters that you typed int ix = chars.indexOf(msg.charAt(i)); // The current letter in the message loop if (ix >= 0) { // If that character's position is larger than or equal to 0, then render the character on the screen. - screen.render(xx, y, ix % 32, ix / 32, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "font"), whiteTint); + screen.render(x + i * textWidth(msg.substring(i, i+1)), y, ix % 32, ix / 32, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "font"), whiteTint); } - xx += msg.charAt(i) == ' ' ? 8 : ix >= 0 ? Font.charsAdvance[ix] : 8; } } @@ -92,11 +68,8 @@ public static void drawColor(String message, Screen screen, int x, int y) { public static void drawBackground(String msg, Screen screen, int x, int y, int whiteTint) { String newMsg = msg; - int xx = x; for (int i = 0; i < newMsg.length(); i++) { // Renders the black boxes under the text - screen.render(xx, y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); - int ix = chars.indexOf(newMsg.charAt(i)); - xx += msg.charAt(i) == ' ' ? 8 : ix >= 0 ? Font.charsAdvance[ix] : 8; + screen.render(x + i * textWidth(newMsg.substring(i, i+1)), y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); } // Renders the text @@ -104,23 +77,7 @@ public static void drawBackground(String msg, Screen screen, int x, int y, int w } public static int textWidth(String text) { // Filtering out coloring codes. - if (text == null) return 0; - - int width = 0; - - for (int i = 0; i < text.length(); ++i) { - char chr = text.charAt(i); - - if (chr == Color.COLOR_CHAR) { - i += 5; - continue; - } - - int idx = Font.chars.indexOf(chr); - width += idx >= 0 ? Font.charsAdvance[idx] : 8; - } - - return width; + return (int) (Math.max(text.length() - text.chars().filter(ch -> ch == Color.COLOR_CHAR).count() * 5, 0) * 8); } public static int textWidth(String[] para) { diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index 748a834ac..79c843435 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -303,8 +303,8 @@ public void render(Screen screen) { } else { for (int i = 0; i < title.length(); i++) { if (hasFrame) screen.render(titleLoc.x + i * Font.textWidth(" "), titleLoc.y, 3, 6, 0, hudSheet.getSheet()); + Font.draw(title.substring(i, i + 1), screen, titleLoc.x + i * Font.textWidth(" "), titleLoc.y, titleColor); } - Font.draw(title, screen, titleLoc.x, titleLoc.y, titleColor); } } diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index dffcc139b..e7fd1822a 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -723,7 +723,6 @@ public static void reloadResources() { SpriteAnimation.refreshAnimations(); Renderer.spriteLinker.updateLinkedSheets(); - Font.updateCharAdvances(Renderer.spriteLinker.getSheet(SpriteType.Gui, "font")); Localization.loadLanguage(); // Refreshing skins diff --git a/src/client/resources/assets/textures/gui/font.png b/src/client/resources/assets/textures/gui/font.png index fa7499383e738a5626f352f0d583db7d481dfaa7..d7e2963a04baeda1516b06e30fb8ec7c199957cf 100644 GIT binary patch literal 5540 zcmeHL`CAj`_770ODvOk>0;Wk7Ewu_MQiNzow1~8IL0eXVgiWHLgb=}O5EV2iOXMmB zB@i{`LJ1l%McEg@u!Tfqr|e5c2ogdFBqYF%-uwLnzQ5mRo|$>i`<(O6yk|b=^EuDl zK6Bc`WRvwK5C~-Q%g@Jt1A+8(Lp{(&L)|SfwlLz8MflC*C(v^dcv@$CfjxTaC`PrWU0-4r+I`v#O{Jt9m+6w>W*ikPc`r}}G)^3lCFGeHS-x)EujcJ?y zu(oOZ?Y4K4SI8funXz}bi*7v$aoD(9Ys)`SS@fl5n0q_Ma?oZMw~fnxh^x_DQHk}M zK2#cHcpD1G>=YjG$Jne1KjmavSc+2~wgknMG_83qkDDnADRd_zXfUt+{3H|J%`qY`1B{JFCU!Gh?db-wyNjC6UU z6jkwRC~$P@GO|4wENf`9?SfQ`_w$-;q~`ohe1EYq;N6?=|LSEWaul(IExgCHKLco) zRU7KYM;maDP_0Y+$?dBCvNi5}%~f7f;{4c&c{DM1W;k1JS@NK_KMO$peJLS)w4qYH zIHpxN|5`;XmLs?;HWIFy1Af=QTFr_yS@Kncr33!mPzS7!k|R+3D#S;>b^H9SV+Hs< zA`cA9LX1xioN&3bdKWl$SfQ7|S2vHtGf2jjPQlf0hKsNd>c6M^oAEbkpt-PJr}ke> z`JUr%=IA#iu8Z=LN~B`4Pk*s2svJlxqW(yaD_q$rZs`kXXSW9_XN%>=WujSYStejD zaFNu|gB|9d$lvF0BV8(In*y5YAn8aO^DwEOI9;rMQMFWP>X4&sM;wB^u^x4s$dA3u zuwT|8ghV3Kh7ZijiBjYN22|urU1@3C&N)==A+pX0KRVtKlfb|&RMI$8Ymte?&tmsg znfG$~D>zXc4#ns04K62F?PL8l`JH!e$G_TrAZJB;FywD}R0i%p%%HQAg z_?tS=AO<>y{3XwrXqYQv-A?6Z;=+hhfSb;;bHV##(AJWzxXNk8LXea){m-PEMo?40 z3sKWTXB#xPgB=U}3jB;<>?*DITg_i@Ec)H{=$_=??g@j>*(sW1SipH9G4zo#ZY1{`H$DMebZ} zz%^{y@*0#h=Th*fHlWSNm9MoUeCg_)2MB6sCYnidoL=AlGZTZKadG`D#+y+}A!Iyh z-G?`A9L{my3v12`q<3q*O=nw_8(le6Ct4QGt4!uG_fS!!E*x_yauXg`ZlZA2{Bka2 zlCRzu$S&I^#eejhAf10;qv*_uYKRsU&v@7YB;(>$WiN(}q^(g~ME4k`X6CrSV>P2@ zF5W2H*_QrTx}tMT|88%#(#z@_4*`eiS*V$Aw|3w>1sI$~R|XpSBqJ>AXf{flZavh= zcZ9z4?H*&G)>Pu<5gN`PQQ+dtODbXKL0ZnH0xrk-#@TMOR^3eAvJLuMuatUCYh=6f@l0#ZOJwMyGy4c(5aUSVP1oB68tCL0#kV9Vijd!^AqDU>o zi`;FD4qWYOe9wG?te`-bONO;7rZoUojehxv{UC~T-hC#gc*sCs(wH z=clNrZ--oN$AsXJ`XZ0JFkR^+u?X5r-76(NQyu0b+K6R1?P)w~Z7F|c+6c9lu?~N^ zUf)51)*v5ayK1&LLiqE>yg{);$?0;MVKpE5 ze8X&|W_?Q|-PV4xq@)g?hD>qtn=+rtWRB#HtbFM-49zIcbo!clp$K{8Ymc1K(1bl= zMkzKWDqZ9oFH41MWY^)7`I{MOOnaRS@aB|g9dnk)xXzE6M3fta)sX_(rIqVuN2$cI z%=3tv8$pw!4Ld30NoJToe z?Pizr3wY_TEn!x=!!;<5J()jNO`$eS6wL225p*XAAG52jY_DD1ASInjdkCcY(LO}f z97LYjOJ{7)E#LyI6f_7-}C1=|fwe=eHB^aU3IoKf=X zo<(G0WGHW|sSZ0T=j}xKPg(5B63NV1VMoRA=GoW;|Falr&xHaxNOF+Hi!! zwobc#55M@E`l(1L`5{N?)yL30^&6S`-9*4box^(7Ztoq7Qz#WKy_MtA7_+K~(T2@k zT&J`AUw)Z$w}Uu#DZoE{4NoKcJY)|ithO2cP;un1nUFkOxRY5t8FEvz6E>t1OkL7~ zYV<}MEb>gK#7vDxm`JQPtyI<1J(DPU(7awfor4KaRw94j0>dvXyen*C*7}dM`7C$x zjiN}?yU-0MwnK&xOty7Km}^hn9s3MBglhg)livVh5vyaf%a$N=rA0|G!wy{&vLne1>c4(Qaq z%nsh1Y{40HE3548)~~wsfZ3Zw5j8xk_N(V#lgg8^`cQlIKLsbYlb%Ih?kO@pV+2L3 z^3$2=|~e~AKm!~}<1R8uvHn5HyV25}O5JmB+?;fC27$aQ7& z3D29o->1e!9a7C-3_~)Qr;1Y%jqCe!Y40ZgzA~q;ig+G>(}Qy6uxX(kfSPIBgM5p+ z%d6<3kMlnM4qeK0g45%HIds%(vryR_VyV7pSvI-wm}q|7Onj-JiC)0DM4yQIQQ01I z8Rhym^=99kfvp_v1D}j)RE9jDG$K5MBsNu&rDT)k=MOcqhcr)_4f1_8_1KiDRn%dU z@SENrkfxTrgBycI4pS@V_tqM+5=wRkH5kWs&03BV61H(2#QTO%PesLp{kUjU(xD~} zp{~yprnq>YBXXdGo)&(yjODAn4LK~OmFOrA(PUm^EhOtH2Q8WqMv^VkMwXSJgaM!Y zZ(y6$fc$FRJmy>U;|fdrD`kUTZ{Whqm-wbWR*Offz8y&TwPqXnOe)4Ia`y0BB`MlD z{>8W+(A?Z+9;qD=l+K3I>j!!OyLivpi4GeJDICa-H7ya@jDo2bT$XelX^Tw~K98=z zrby3)SgbfO6=kLl1{t4ylS`U9)nIHPrEOs)c_qggWS_kGXz|BUmH{y7aNj@9wX2S9 zPCf(p?&%RL$`TQbm{Z|igKltG%Cht9+kr%~Ly_;h&B!XtZaHFdkA+6p9&68Ndp-_h z@C;lK;p$o;&U?8DB!OsNGDp${EzZm6fzqBy`HDRC){d{$SJ zFOWKs;z{(#b@c7Uj9AO_e0VZMSM5>`!dfTruV>uTtFF|qd{=O`=8+K}62Z^Q%5`cr zcAp;`>6x*@!ue-Ciy34eA4LR77?EJZh4T>+{Fk@LZZSo&#+UmG2DMt2 zL9$L&!bBIkETqZcI7l^B6wv)NTT%5!&4El!^y0Ag8MyW*GwKiU7l7*m3vcXgcZbwJ zpE)1F$BhlU=Y5IVyu4P9S=F*q@pwpeS_OOPW|Vq9NPSA%$(|lLxE4!Wud{66?Wy_Z zYJ!bBIz&y6QP5TYnx41>LTP%t@f1dM^a5VKqo_Tu6PTdasrra}dtxB9yE5cYn_#Vk zXHe9&xo z9Wxiu(`PPovhKE7Y@`fS*Oo2K_J^Xa+A+_d(z{Lj@CoDamqZ9-IdCEiodESiCDyA~ zMlOM-ol#E&yvzmtqbzX^_T13Ocf7fWfEqbrEl#}U`|N~#c*G)4<}G%4Bdwlt(&^|s z#{k*`g>`pas82hCbWkYr)E^j8n}Lm3$txcOR~yycr)swLGJ0N~09`!aR{ zXP)s}JzR{66x7u|f{K*g%LuqbfV1x@R`AALMA6G4T(UxzDKmrkV}D$?l5*G>|3LP5 z+=3G~v99b~SZ`!>7Jy9iZxbJC3%<`sOAbT7D3KqoD4$O1j$uGY*DAO*s8{94Y0B?* zp)^FQvW-Hz_DnI3!iXz+okxYr6Bek@(KLXV$3na+;K2ZD(?FKp69-bI%({+FmO}tcf<@rT-bJE^ukoI~5Zn&Sf z*k`o#w>6cTgc1(NJG6!c9YfQ1)Ts?VVz&0sQL|YpgRlL++a;TkBpso5m=One&xO|Z z7#|7}G|)oJSHEws^b;(dP;RN>a} zQ8$aGZHIKiyn7dHF?a27<Clfa~$v~7y#Yhhhs_Y{%`Vs ti~TQWpHT5XX#D@mX<%h>dR=co?~lCXrYNG4l9B=7SFF&6L05sH}8i230)RTX7X~>rq=Dh1kKvgerPQBO?>g?_e0Mw9l z)`PaH*V`h0@xcH9y3Jo+jqss6+W>&?oX-60{98O?VXWuTkL}r8Cf^o(uT3o9^75;f zTDQE-Yr^jxJhvVAlXj$r?V-TOQt4f$GJo;u2RXvpdJOu5b$JP;L`$~H%3(3}>|Ef$ z$WK>_f#h6xrv|JX*pBe%J(lJ@fZel3056)F*DEGz-4D!XUt`ebly%|m%Y?5=UZPC zkF-k(-^JEQGNQO_sAY1Xdj{=m@5nARWq2JvryA`y5GZpD=KZE-;M2+_lcDYTeIz;s z>nl%44h87K3l>jPgBt6eI9JF%NiXLOq{bw(@@0PU%?gJC6M!WI5^yB^2wvtMHOJR^ z7ym@l?<~X?Vgq4(n}eUP&Fwk$LI!?+gLs4-P@e8(l4*l-2?W3q5A zY?z<*s1G=joM339R(7Ihy=W&uXS!B_`r#yA=wt4Hr|cIW(kmZ!=B%vBf_CjnTv9Xk6Z@ROW6N{g^}5Eb z%~Q?%xGd7E4TxeZ-lkGzSuY+J6@%>(b;dKQ1{!RyoNy_diHV(2P>=h8jUwZ1&w_j5 z1WId0dtNUMLHIM#hVW1m_pqED7gr29X&`An1>q6 zTNNKOFjMx#duU_V8t`&KSg2!h#Bs0>wB3pnRHs!YFRkNRcLhFTRk-?)l;FaMkkgR3 z+lT`+(3R@WqUSPK^sK18X`J41i80X$lXJR4ZH8Z}57`oq#|_eGZRL}`G*RNuWVE5+ z$r>o-T{0`}x!a-Ov1qccP$I38iQhgy3n}t;6ajf-dL9kIP4j!PHxX%S-=#fYRAySr z^?=7A?qbp*7O2fne$NVTH}Q7=SqL(7et9=N-0ojG-?*@3MibL`v@pwRn7Be`Z2UZG7a4kXKAu0OBbAQ9Fnm4(z> zR=udA@Xn~rklfzQuzd;9mK*R=2-dDT+ zv8CboEw2*HNdH36%?CA&F&@_#(pS>Y>!EY$#*rW{*Pcjeij5A_s5#c1FdRG3z8oN; z-TeFMEp6R&49;+3n#Ia`7*w!^79W1zklPh)2*^?z>T=pX;}DM z7sh%9n>DT=83tG<%z};>*fp-MO{jWl@LrXY%Z!%JL~lZPEmEV2ZPX7Rm1Xed(HpAo z7?)Bnh)uDtJDCRYL{~CDTS&s-B$!I>gGyY8!Wy#`)*uleWl@~5)jGhnJ*8J~cyvec z?rKt+5U`=e9-A}-PhaTtiQ)6xa?1SQG2T5zGo8VNH1Y+afCekty||X0Fx1FPor%F{HMkmb=#mY*nP?#w%VIU=IO)MW#YS% z(<13nXSVr7Aqhnlk`>90nK73Y71Z9S%!k+S=uE#mqNUpq%oAOx%+Z)PqF4*6gMQ+U z>b)V#!!q_~F48yeJWqRG=?isXt}l1_u=L;_9#Ll_9K)OW-})V9Kx&OW8qikt4*Gxn znsD?iy*udTVEhUH2TRd-542-s{M#_}=3Sg*ccf!VBK?%~Xa~KGI^+i*!eMW=+A>G% zg|-~x0CKYwuej4r;1h_S2$7e?EUvaR6Nhm}-A+n|aHX1Hf`B5fo4_}4Li$K3M1z?; zeCz?Y3q$ca-~jW9I9oB-Xf|sX@$OWGZ28(yQG4z(+0JZ5HeWW=R058Cl#2UN-Wz=d zON8DR4+WN75}3wLqSYS$mE2YZ6YUMC-O0k;}gEPpM#J)_s|2Y>ovjpb=` z)m>XR9|0~VqVk<;n(hnRM=e@wU4#}5^5^~=@@8PrT#6^Fe=9{xFv#F#xak$?a5Z%! z%)4NQn!N&L+4u(G>lXf2%Hz3J-Gv|22{Wp%20;r%IPQ?z$`{%1_8UKTycIt|k%%>r zqiN4`Zi}*dH3XTSsa$=#Mkne~pv2#4rycaV3Y-$Td1uCps#RZed~O%Iy7SU<;%!;n z2fAbL@2o}ID^6>DAOv#V6P`nEI)3e{cewh&(RoSR-B<~siK$C&k$-CmcuC#GNbh=` z!%0tZ2z}Iyz5XD$J~zT$PhSSwk(7F3b6@p_0JL%QbuHmr=&L#SS6>ay%w3HvT$D}h zRP9=&5;lZOc;#Hl0s-)PwBF%eX<7{tqL&brY2&HYk-$)6m%uLXN($MtO3^3sY|5i1 z9@83pR*2_BliQO=%}J;Nks;cFUfectVCAoted^eGLH=bU3cuI|%Z+yO0J<_1^h*+T zP#-JPi3YmDXbLM6S=PL5ghpS-fEKFnGSFwfsnnWg-x&gf&9^6=sSrg%VpJx-b{>MjK&0`S~juFR!%r%$dd0hd|aG3D9}3eJ1Xrk%zcx^NOZn!1ul~ zbGGfPJZ%RUsb%A9w>Um0O`RcKwg5XQe$&w_S)6pjS+vtfL0v(MC9tLrTI-ug66qleS`2@TVk5&xP4>`u+NP6540;Jj-Q*% z+HW~heKVUoUs>sUSd;TRO9xROGm88rNE4ULx}JEop4ww+`M&z*+fsE1zxR@V z))i`1OImmX55TdZi#uj@+$MfoTiosT!LBlB?oXlT3shpS|3G|5iP?Eo81G=R)DlJi0 zfxVe2+aU{};0ImpKY|=vJ~e@Um;LcPrv?4!-9HzsA*atA80rDFz}Yd2z#VY`^Im-PT7P=dW%r)!ae4!HbRl)PA+H4J0#o%^>SY?B zR!;8wFvtIV^Wg{ns*R@ z(N$!HT z)ORoybesFLL&-Gysdnw^qo*&Ly!?^Eg*M&F_-6Z~LG~xzksn@PY#0uzjuoNY8q8#K z9i?|<1!#zUx;J-sq%QEdF(&*!wX7YRrLbs?@e9&dT3wR7CYozz39>!)MJZN-xx_4M z&d96Ars7ShR`IRKeYb1(=3)8@plLUT8bIOAL4SZavO#^35bF;oyS_PabZ+ca9AcL^ zVmPA~i?b?|7pocGaBvCQa$bKeN*9Pf*eHt?i{G?|a>okc^L~Sh)sj6R#IkL2{8D_A zsZ{i0*|2_O(zjGLU%UeumDKDlnZhP4#pCQrk%v1jM@2Apgp723-qXOgN)i5T=>C$F zbItd2R;`KS_w!ay(~9VG9#!JW-vUlaBsQ3h z=$C`CN7@Xf!4Vlk@Mm!e&+GpJrKU&D_bcQw1+bn9Bwskq7^CX7d$%=*9 zZ`Qv54_sZu0$uF~;#~`9c~q#EYUMPXHhAh}*xSFsdSHb0Z1~AYi60bcRtfJu*hS4~ zT$arR2okUxF=F|c*c9`k`uoULUvulRu-zO7^f1Gbd&O^^WOl4jy!L<5BEu%z71>bo11> zS^Eshg+`*1F_WM3`(!u0mS!XUosq4}J@tp6 zVUVIj27?oY7`wzuBjzFTII@CpbMt+ySP#_}H?DHqw4SVb?>>`1^d|JR)_k&LWZg## z{7ACm@ugI*NeouBF5j8a?^@a0QnYWf`fow@IzxN|u;9`0JL{(a?~M~>O`ZF=>h4Z6 z%ajxKvsUG5A;0oJ)$2b1qsFZ4q|i~l7PWX%k^Ri9Pzd~f`l`MO<^YB4Z7^Lb>R7gq zxR4QCB?0w-Wp-dD-T@Ppcsw1!4rM#Tz}doIQ6C4NJ&7}M)E~dL0vl@>vEYaDd2o4o zQ4z-KP?c#{spONTZw5>6UH+_4bX8ZKxg0N2@7gvaDkX=`-M#9`IED3pPz- zy_;GtSOJZXeUkLsa`HtlsO@^rtSHv`3O*En+E{R!guE~O3%?HNcPB!o@2`cRrxmu? zUFdSj>i!5LDw!$y^vVXoaD2f1E9ubkj7Zh2ypQ>~vL1zd@D>7ZZ*;K*k0GJN-k5Ho zaVP^agj3ARV3Kh)qufYx_WP0UUyQPWBTdh%4tjxxRM_l@_hX?$!@I>c#)GEP)`U?8 z^Ucbqkzk&69@7^-w2yRYO8E?Pc?k*<)7u;vYmU|U^%RMWIRfa9z&pDmO~-Y%L^UZ9 zS7Qj2#yIu~w%mvtFSBk$2i%cwW`9l;uX6CSUv0U#yW9@BT~}ae)w0)`2>}1``336Kv(>w(4twd4&x~oFCPR|AF^pNoK9Pg# zEP4kM-FrptRu#*oIWncoF%?L$Ihh^fB0<(TDrJw}$@U}6kTkBIp?qk#Ht$0h2HaLQ z6IyuXNaqFdtOIz|mE#FmCqH2ip$QQ~ z^}s4Mma^h+2^@Rtz)R~91m#3sl6H65+P5anAJf6r8tV(}I@Mm}rnm@Bh+0f+RX|Cq z?*I@&c&>c+Rz){#9d_$X>uC3JxOZh`6cHzZhNiD z{2ExqoU?CK^yrnMO>di|wASY`JQ8(w5hkbNAJ!V<&n4W`NOuR;-BWY)<&X$zs>-3k zC*Zo~YPYJepN86p=OBNyxbyZJw5|FhZuLgW9DPNJ?HmG&j&pJWrh T%QN*4R=}ClXMe6b8JO~KXCz7E From 6cc1d67b74cc1f9da62696cee61c400330598ebb Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 2 Aug 2023 23:58:03 +0800 Subject: [PATCH 113/261] Fix some non-capitalized English localizations --- .../resources/assets/localization/en-us.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 5104b46ff..59cb1d601 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -50,8 +50,8 @@ "minicraft.display.options_display.change_key_bindings": "Change Key Bindings", "minicraft.display.options_display.language": "Language", "minicraft.display.options_display.resource_packs": "Resource packs", - "minicraft.display.popup.enter_confirm": "enter to confirm", - "minicraft.display.popup.escape_cancel": "escape to cancel", + "minicraft.display.popup.enter_confirm": "Enter to confirm", + "minicraft.display.popup.escape_cancel": "Escape to cancel", "minicraft.display.popup.title_confirm": "Confirm Action", "minicraft.displays.achievements": "Achievements", "minicraft.displays.achievements.display.achieved": "Achieved!", @@ -200,7 +200,7 @@ "minicraft.displays.world_gen.enter_world": "Enter World Name", "minicraft.displays.world_gen.title": "World Gen Options", "minicraft.displays.world_gen.troublesome_input": "Trouble with world name?", - "minicraft.displays.world_gen.troublesome_input.msg": "it seems you've set letters as the controls to move the cursor up and down, which is probably annoying. This can be changed in the key binding menu as the \"cursor-XXX\" keys. For now, to type the letter instead of moving the cursor, hold the shift key while typing.", + "minicraft.displays.world_gen.troublesome_input.msg": "It seems you've set letters as the controls to move the cursor up and down, which is probably annoying. This can be changed in the key binding menu as the \"cursor-XXX\" keys. For now, to type the letter instead of moving the cursor, hold the shift key while typing.", "minicraft.displays.world_gen.world_seed": "World Seed", "minicraft.displays.world_select.display.help.0": "%s to confirm", "minicraft.displays.world_select.display.help.1": "%s to return", @@ -385,8 +385,8 @@ "Leather": "Leather", "Wheat": "Wheat", "Key": "Key", - "arrow": "arrow", - "string": "string", + "arrow": "Arrow", + "string": "String", "Coal": "Coal", "Iron Ore": "Iron Ore", "Gold Ore": "Gold Ore", @@ -398,9 +398,9 @@ "Rose": "Rose", "GunPowder": "GunPowder", "Slime": "Slime", - "glass": "glass", - "cloth": "cloth", - "gem": "gem", + "glass": "Glass", + "cloth": "Cloth", + "gem": "Gem", "Scale": "Scale", "Shard": "Shard", "Flower": "Flower", From 6c0127afcd81d204238fca50d17ea115bbedd939 Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Wed, 2 Aug 2023 17:14:17 +0100 Subject: [PATCH 114/261] fix requested changes --- src/client/java/minicraft/gfx/Font.java | 5 ++--- src/client/java/minicraft/screen/Menu.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/client/java/minicraft/gfx/Font.java b/src/client/java/minicraft/gfx/Font.java index 5ae806028..d9e108623 100644 --- a/src/client/java/minicraft/gfx/Font.java +++ b/src/client/java/minicraft/gfx/Font.java @@ -67,9 +67,8 @@ public static void drawColor(String message, Screen screen, int x, int y) { public static void drawBackground(String msg, Screen screen, int x, int y) { drawBackground(msg, screen, x, y, -1); } public static void drawBackground(String msg, Screen screen, int x, int y, int whiteTint) { - String newMsg = msg; - for (int i = 0; i < newMsg.length(); i++) { // Renders the black boxes under the text - screen.render(x + i * textWidth(newMsg.substring(i, i+1)), y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); + for (int i = 0; i < msg.length(); i++) { // Renders the black boxes under the text + screen.render(x + i * textWidth(msg.substring(i, i+1)), y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); } // Renders the text diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index 79c843435..21738dbad 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -218,8 +218,8 @@ public void tick(InputHandler input) { for (int i = 0; entryIt.hasNext(); i++) { ListEntry entry = entryIt.next(); - String stringEntry = entry.toString(); - String typingString = typingSearcher; + String stringEntry = entry.toString().toLowerCase(Locale.ENGLISH); + String typingString = typingSearcher.toLowerCase(Locale.ENGLISH); if (stringEntry.contains(typingString)) { if (shouldSelect) { From b2d00cac9b04a328f54d41bc89a80377210ed957 Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Sat, 9 Sep 2023 18:57:42 +0100 Subject: [PATCH 115/261] capitalize keys and translations of some items. arrow, string, glass, cloth and gem --- src/client/java/minicraft/item/StackableItem.java | 10 +++++----- src/client/resources/assets/localization/en-us.json | 9 ++++----- src/client/resources/assets/localization/es-es.json | 9 ++++----- src/client/resources/assets/localization/fr-fr.json | 9 ++++----- src/client/resources/assets/localization/hu-hu.json | 9 ++++----- src/client/resources/assets/localization/id-id.json | 11 +++++------ src/client/resources/assets/localization/it-it.json | 9 ++++----- src/client/resources/assets/localization/nb-no.json | 9 ++++----- src/client/resources/assets/localization/pt-pt.json | 9 ++++----- src/client/resources/assets/localization/ru-ru.json | 9 ++++----- src/client/resources/assets/localization/tr-tr.json | 9 ++++----- 11 files changed, 46 insertions(+), 56 deletions(-) diff --git a/src/client/java/minicraft/item/StackableItem.java b/src/client/java/minicraft/item/StackableItem.java index 66479a80d..9275a29c5 100644 --- a/src/client/java/minicraft/item/StackableItem.java +++ b/src/client/java/minicraft/item/StackableItem.java @@ -19,8 +19,8 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Leather", new LinkedSprite(SpriteType.Item, "leather"))); items.add(new StackableItem("Wheat", new LinkedSprite(SpriteType.Item, "wheat"))); items.add(new StackableItem("Key", new LinkedSprite(SpriteType.Item, "key"))); - items.add(new StackableItem("arrow", new LinkedSprite(SpriteType.Item, "arrow"))); - items.add(new StackableItem("string", new LinkedSprite(SpriteType.Item, "string"))); + items.add(new StackableItem("Arrow", new LinkedSprite(SpriteType.Item, "arrow"))); + items.add(new StackableItem("String", new LinkedSprite(SpriteType.Item, "string"))); items.add(new StackableItem("Coal", new LinkedSprite(SpriteType.Item, "coal"))); items.add(new StackableItem("Iron Ore", new LinkedSprite(SpriteType.Item, "iron_ore"))); items.add(new StackableItem("Lapis", new LinkedSprite(SpriteType.Item, "lapis"))); @@ -30,9 +30,9 @@ protected static ArrayList getAllInstances() { items.add(new StackableItem("Rose", new LinkedSprite(SpriteType.Item, "red_flower"))); items.add(new StackableItem("Gunpowder", new LinkedSprite(SpriteType.Item, "gunpowder"))); items.add(new StackableItem("Slime", new LinkedSprite(SpriteType.Item, "slime"))); - items.add(new StackableItem("glass", new LinkedSprite(SpriteType.Item, "glass"))); - items.add(new StackableItem("cloth", new LinkedSprite(SpriteType.Item, "cloth"))); - items.add(new StackableItem("gem", new LinkedSprite(SpriteType.Item, "gem"))); + items.add(new StackableItem("Glass", new LinkedSprite(SpriteType.Item, "glass"))); + items.add(new StackableItem("Cloth", new LinkedSprite(SpriteType.Item, "cloth"))); + items.add(new StackableItem("Gem", new LinkedSprite(SpriteType.Item, "gem"))); items.add(new StackableItem("Scale", new LinkedSprite(SpriteType.Item, "scale"))); items.add(new StackableItem("Shard", new LinkedSprite(SpriteType.Item, "shard"))); items.add(new StackableItem("Cloud Ore", new LinkedSprite(SpriteType.Item, "cloud_ore"))); diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 59cb1d601..b3c88679e 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -385,8 +385,8 @@ "Leather": "Leather", "Wheat": "Wheat", "Key": "Key", - "arrow": "Arrow", - "string": "String", + "Arrow": "Arrow", + "String": "String", "Coal": "Coal", "Iron Ore": "Iron Ore", "Gold Ore": "Gold Ore", @@ -398,9 +398,8 @@ "Rose": "Rose", "GunPowder": "GunPowder", "Slime": "Slime", - "glass": "Glass", - "cloth": "Cloth", - "gem": "Gem", + "Glass": "Glass", + "Cloth": "Cloth", "Scale": "Scale", "Shard": "Shard", "Flower": "Flower", diff --git a/src/client/resources/assets/localization/es-es.json b/src/client/resources/assets/localization/es-es.json index e29d00a66..32e93c880 100644 --- a/src/client/resources/assets/localization/es-es.json +++ b/src/client/resources/assets/localization/es-es.json @@ -125,8 +125,8 @@ "Leather": "Cuero", "Wheat": "Trigo", "Key": "Llave", - "arrow": "flecha", - "string": "cuerda", + "Arrow": "Flecha", + "String": "Cuerda", "Coal": "Carbón", "Iron Ore": "Mena de Hierro", "Lapis": "Lapis", @@ -136,9 +136,8 @@ "Rose": "Rosa", "GunPowder": "Pólvora", "Slime": "Slime", - "glass": "cristal", - "cloth": "paño", - "gem": "gema", + "Glass": "Cristal", + "Cloth": "Paño", "Scale": "Escala", "Shard": "Élitro", "Flower": "Flor", diff --git a/src/client/resources/assets/localization/fr-fr.json b/src/client/resources/assets/localization/fr-fr.json index 4f8069960..03fcccbad 100644 --- a/src/client/resources/assets/localization/fr-fr.json +++ b/src/client/resources/assets/localization/fr-fr.json @@ -122,8 +122,8 @@ "Leather": "Cuir", "Wheat": "Ble", "Key": "Cle", - "arrow": "fleche", - "string": "fil", + "Arrow": "Fleche", + "String": "Fil", "Coal": "Charbon", "Iron Ore": "Minerai de Fer", "Lapis": "Lapis", @@ -133,9 +133,8 @@ "Rose": "Rose", "GunPowder": "PoudreACanon", "Slime": "Slime", - "glass": "verre", - "cloth": "chiffon", - "gem": "gemme", + "Glass": "Verre", + "Cloth": "Chiffon", "Scale": "Echelle", "Shard": "Tesson", "Flower": "Fleur", diff --git a/src/client/resources/assets/localization/hu-hu.json b/src/client/resources/assets/localization/hu-hu.json index e879b0b90..3a703b917 100644 --- a/src/client/resources/assets/localization/hu-hu.json +++ b/src/client/resources/assets/localization/hu-hu.json @@ -125,8 +125,8 @@ "Leather": "Bőr", "Wheat": "Búza", "Key": "Kulcs", - "arrow": "Nyíl", - "string": "Fonál", + "Arrow": "Nyíl", + "String": "Fonál", "Coal": "Szén", "Iron Ore": "Vasérc", "Lapis": "Lazurit", @@ -136,9 +136,8 @@ "Rose": "Rózsa", "GunPowder": "Puskapor", "Slime": "Nyálka", - "glass": "Üveg", - "cloth": "Szövet", - "gem": "Kristály", + "Glass": "Üveg", + "Cloth": "Szövet", "Scale": "Pikkely", "Shard": "Szilánk", "Flower": "Virág", diff --git a/src/client/resources/assets/localization/id-id.json b/src/client/resources/assets/localization/id-id.json index 667435ccc..e23539213 100644 --- a/src/client/resources/assets/localization/id-id.json +++ b/src/client/resources/assets/localization/id-id.json @@ -125,8 +125,8 @@ "Leather": "Kulit", "Wheat": "Gandum", "Key": "Kunci", - "arrow": "anak panah", - "string": "benang", + "Arrow": "Anak panah", + "String": "Benang", "Coal": "Batu Bara", "Iron Ore": "Bijih Besi", "Lapis": "Lapis", @@ -135,10 +135,9 @@ "Gold": "Emas", "Rose": "Bunga Mawar", "GunPowder": "Bubuk Mesiu", - "Slime": "lendir", - "glass": "kaca", - "cloth": "kain", - "gem": "gem", + "Slime": "Lendir", + "Glass": "Kaca", + "Cloth": "Kain", "Scale": "Skala", "Shard": "Beling", "Flower": "Bunga", diff --git a/src/client/resources/assets/localization/it-it.json b/src/client/resources/assets/localization/it-it.json index 4a8a54c43..3b12789bb 100644 --- a/src/client/resources/assets/localization/it-it.json +++ b/src/client/resources/assets/localization/it-it.json @@ -125,8 +125,8 @@ "Leather": "Pelle", "Wheat": "Grano", "Key": "Chiave", - "arrow": "freccia", - "string": "corda", + "Arrow": "Freccia", + "String": "Corda", "Coal": "Carbone", "Iron Ore": "Ferro grezzo", "Lapis": "Lapislazzuli", @@ -136,9 +136,8 @@ "Rose": "Rosa", "GunPowder": "Polvere da sparo", "Slime": "Slime", - "glass": "vetro", - "cloth": "stoffa", - "gem": "gemma", + "Glass": "Vetro", + "Cloth": "Stoffa", "Scale": "Squama", "Shard": "Coccio", "Flower": "Fiore", diff --git a/src/client/resources/assets/localization/nb-no.json b/src/client/resources/assets/localization/nb-no.json index 81ecd8049..30e0b0b6d 100644 --- a/src/client/resources/assets/localization/nb-no.json +++ b/src/client/resources/assets/localization/nb-no.json @@ -136,8 +136,8 @@ "Leather": "Lær", "Wheat": "Hvete", "Key": "Nøkkel", - "arrow": "pil", - "string": "tråd", + "Arrow": "Pil", + "String": "Tråd", "Coal": "Kull", "Iron Ore": "Jernmalm", "Gold Ore": "Gullmalm", @@ -149,9 +149,8 @@ "Rose": "Rose", "GunPowder": "Krutt", "Slime": "Slim", - "glass": "glass", - "cloth": "tøystykke", - "gem": "juvel", + "Glass": "Glass", + "Cloth": "Tøystykke", "Scale": "skala", "Shard": "Fragment", "Flower": "Blomst", diff --git a/src/client/resources/assets/localization/pt-pt.json b/src/client/resources/assets/localization/pt-pt.json index 9d2690063..78899203d 100644 --- a/src/client/resources/assets/localization/pt-pt.json +++ b/src/client/resources/assets/localization/pt-pt.json @@ -125,8 +125,8 @@ "Leather": "Couro", "Wheat": "Trigo", "Key": "Chave", - "arrow": "Flecha", - "string": "Linha", + "Arrow": "Flecha", + "String": "Linha", "Coal": "Carvão", "Iron Ore": "Minério de Ferro", "Lapis": "Lápis", @@ -136,9 +136,8 @@ "Rose": "Rosa", "GunPowder": "Pólvora", "Slime": "Gosma", - "glass": "Vidro", - "cloth": "Tecido", - "gem": "Gema", + "Glass": "Vidro", + "Cloth": "Tecido", "Scale": "Esquama", "Shard": "Fragmento", "Flower": "Flor", diff --git a/src/client/resources/assets/localization/ru-ru.json b/src/client/resources/assets/localization/ru-ru.json index 04cde3322..8d4fa8baa 100644 --- a/src/client/resources/assets/localization/ru-ru.json +++ b/src/client/resources/assets/localization/ru-ru.json @@ -138,8 +138,8 @@ "Leather": "Кожа", "Wheat": "Пшеница", "Key": "Ключ", - "arrow": "стрелка", - "string": "строка", + "Arrow": "Стрелка", + "String": "Строка", "Coal": "Уголь", "Iron Ore": "Железная руда", "Lapis": "Лазурит", @@ -149,9 +149,8 @@ "Rose": "Роза", "GunPowder": "Порох", "Slime": "Слизь", - "glass": "Стекло", - "cloth": "Ткань", - "gem": "Алмаз", + "Glass": "Стекло", + "Cloth": "Ткань", "Scale": "Змеиная чешуя", "Shard": "Осколок", "Flower": "Цветок", diff --git a/src/client/resources/assets/localization/tr-tr.json b/src/client/resources/assets/localization/tr-tr.json index 397b17dc0..a69fbd1e3 100644 --- a/src/client/resources/assets/localization/tr-tr.json +++ b/src/client/resources/assets/localization/tr-tr.json @@ -125,8 +125,8 @@ "Leather": "Deri", "Wheat": "Buğday", "Key": "Anahtar", - "arrow": "Ok", - "string": "İp", + "Arrow": "Ok", + "String": "İp", "Coal": "Kömür", "Iron Ore": "Çiğ Demir", "Lapis": "Lapis", @@ -136,9 +136,8 @@ "Rose": "Gül", "GunPowder": "Barut", "Slime": "Balçık", - "glass": "Cam", - "cloth": "Kumaş", - "gem": "Kristal", + "Glass": "Cam", + "Cloth": "Kumaş", "Scale": "Pul", "Shard": "Kırık Parça", "Flower": "Çiçek", From dc7c3d5f6c513844570ee11c50bf33a9a11eca62 Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Sat, 28 Oct 2023 22:46:29 +0100 Subject: [PATCH 116/261] capitalize 2 keys in nb-no and ru-ru minicraft.display.popup.enter_confirm minicraft.display.popup.escape_cancel --- src/client/resources/assets/localization/nb-no.json | 4 ++-- src/client/resources/assets/localization/ru-ru.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/resources/assets/localization/nb-no.json b/src/client/resources/assets/localization/nb-no.json index 30e0b0b6d..00824fe8d 100644 --- a/src/client/resources/assets/localization/nb-no.json +++ b/src/client/resources/assets/localization/nb-no.json @@ -36,8 +36,8 @@ "minicraft.display.achievement.not_achieved": "Ikke oppnådd", "minicraft.display.achievement.score": "Oppnåelse score:", "minicraft.display.key_input.confirm_popup": "Er du sikker på at du vil resette alle tastene?", - "minicraft.display.popup.enter_confirm": "enter for å bekrefte", - "minicraft.display.popup.escape_cancel": "escape for åvbyte", + "minicraft.display.popup.enter_confirm": "Enter for å bekrefte", + "minicraft.display.popup.escape_cancel": "Escape for åvbyte", "minicraft.display.skin": "Utseender", "minicraft.skin.paul": "Pål", "minicraft.skin.paul_cape": "Pål med kappe", diff --git a/src/client/resources/assets/localization/ru-ru.json b/src/client/resources/assets/localization/ru-ru.json index 8d4fa8baa..2b4484ccf 100644 --- a/src/client/resources/assets/localization/ru-ru.json +++ b/src/client/resources/assets/localization/ru-ru.json @@ -38,8 +38,8 @@ "minicraft.display.achievement.not_achieved": "Не достигнуто", "minicraft.display.achievement.score": "Количество достижений:", "minicraft.display.key_input.confirm_popup": "Вы уверены, что хотите сбросить все настройки управления по умолчанию?", - "minicraft.display.popup.enter_confirm": "ENTER, чтобы подтвердить", - "minicraft.display.popup.escape_cancel": "ESCAPE, чтобы отменить", + "minicraft.display.popup.enter_confirm": "Enter, чтобы подтвердить", + "minicraft.display.popup.escape_cancel": "Escape, чтобы отменить", "minicraft.display.skin": "Костюмы", "minicraft.skin.paul": "Paul", "minicraft.skin.paul_cape": "Paul с накидкой", From ba5dd613b9108f99ba6bdcab5462707a4e0f30e3 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 11 Nov 2023 19:32:28 +0800 Subject: [PATCH 117/261] Refresh localization from POEditor via API --- poeditor.yml | 16 + .../resources/assets/localization/es-es.json | 591 +++++++++------- .../resources/assets/localization/fr-fr.json | 658 +++++++++++------- .../resources/assets/localization/hu-hu.json | 461 +++++++----- .../resources/assets/localization/id-id.json | 475 ++++++++----- .../resources/assets/localization/it-it.json | 479 ++++++++----- .../resources/assets/localization/nb-no.json | 442 +++++++----- .../resources/assets/localization/pt-pt.json | 461 +++++++----- .../resources/assets/localization/ru-ru.json | 557 +++++++++------ .../resources/assets/localization/tr-tr.json | 463 +++++++----- 10 files changed, 2864 insertions(+), 1739 deletions(-) create mode 100644 poeditor.yml diff --git a/poeditor.yml b/poeditor.yml new file mode 100644 index 000000000..13e2488bf --- /dev/null +++ b/poeditor.yml @@ -0,0 +1,16 @@ +api_token: 717434b2cbaa8af9a9ac250e3cc8dc05 # readonly token +projects: +- format: key_value_json + id: 590819 + terms: + en-us: src/client/resources/assets/localization/en-us.json + es: src/client/resources/assets/localization/es-es.json + fr: src/client/resources/assets/localization/fr-fr.json + hu: src/client/resources/assets/localization/hu-hu.json + id: src/client/resources/assets/localization/id-id.json + it: src/client/resources/assets/localization/it-it.json + nb: src/client/resources/assets/localization/nb-no.json + pt: src/client/resources/assets/localization/pt-pt.json + ru: src/client/resources/assets/localization/ru-ru.json + tr: src/client/resources/assets/localization/tr-tr.json + terms_path: src/client/resources/assets/localization/en-us.json diff --git a/src/client/resources/assets/localization/es-es.json b/src/client/resources/assets/localization/es-es.json index 32e93c880..4de4465cb 100644 --- a/src/client/resources/assets/localization/es-es.json +++ b/src/client/resources/assets/localization/es-es.json @@ -1,78 +1,220 @@ { - "minicraft.achievement.woodcutter": "Talador", - "minicraft.achievement.woodcutter.desc": "Conseguir madera", - "minicraft.achievement.benchmarking": "¡Hora de trabajar!", - "minicraft.achievement.benchmarking.desc": "Hacer un mesa de trabajo.", - "minicraft.achievement.upgrade": "Actualización!", - "minicraft.achievement.upgrade.desc": "Consigue una herramienta con un material más resistente que la madera.", - "minicraft.achievement.bow": "¡Inclínate ante mí!", - "minicraft.achievement.bow.desc": "Mata a un Mob con un arco.", - "minicraft.achievement.fish": "¡Arriba los peces!", - "minicraft.achievement.fish.desc": "¡Pescar un pez!", - "minicraft.achievement.doors": "Protección de puertas", - "minicraft.achievement.doors.desc": "Coloque todas las puertas.", - "minicraft.achievement.planks": "¡Camina por las tablas!", - "minicraft.achievement.planks.desc": "Coloca todos los tipos de tablas.", - "minicraft.achievement.clothes": "¡Que tengas un día lleno de color!", - "minicraft.achievement.clothes.desc": "Consigue ropa de todos los colores.", - "minicraft.achievement.demolition": "Demostración de demolición", + "minicraft.achievement.woodcutter": "Cortaleña", + "minicraft.achievement.woodcutter.desc": "Obtén Madera.", + "minicraft.achievement.benchmarking": "Trabajo en la Mesa", + "minicraft.achievement.benchmarking.desc": "Haz una Mesa de trabajo.", + "minicraft.achievement.upgrade": "¡Mejorando!", + "minicraft.achievement.upgrade.desc": "Fabrica una herramienta de Piedra.", + "minicraft.achievement.bow": "¡Tiro al blanco!", + "minicraft.achievement.bow.desc": "Dispara una flecha con un arco.", + "minicraft.achievement.fish": "¡De Pesca!", + "minicraft.achievement.fish.desc": "¡Pesca un pez!", + "minicraft.achievement.doors": "Vistazo al Portazo", + "minicraft.achievement.doors.desc": "Fabrica una puerta de madera.", + "minicraft.achievement.planks": "¡Anda sobre las tablas!", + "minicraft.achievement.planks.desc": "Fabrica tablas de madera.", + "minicraft.achievement.clothes": "¡Ten un día colorido!", + "minicraft.achievement.clothes.desc": "Fabrica ropa de algún color", + "minicraft.achievement.demolition": "Demostrando y Demoliendo", "minicraft.achievement.demolition.desc": "Usa dinamita.", - "minicraft.achievement.survive_darkness": "¿Miedo a la oscuridad?", + "minicraft.achievement.survive_darkness": "¿Tienes Nictofobia?", "minicraft.achievement.survive_darkness.desc": "Sobrevive 5 minutos en total oscuridad.", - "minicraft.achievement.lava": "Asuntos candentes", + "minicraft.achievement.lava": "Asuntos ignífugos", "minicraft.achievement.lava.desc": "Usa una poción de lava para nadar en lava.", - "minicraft.achievement.find_gem": "¡Oooh Brillante!", - "minicraft.achievement.find_gem.desc": "Encuentra el mineral de gema y minalo.", - "minicraft.achievement.lowest_caves": "La oscuridad detrás de la luz", + "minicraft.achievement.find_gem": "¡Qué Brillante!", + "minicraft.achievement.find_gem.desc": "Encuentra una Mena de Gema y mínala.", + "minicraft.achievement.lowest_caves": "Lo oscuro tras la luz", "minicraft.achievement.lowest_caves.desc": "Llega a las cuevas más bajas.", - "minicraft.achievement.obsidian_dungeon": "De caballeros y hombres", + "minicraft.achievement.obsidian_dungeon": "Los Nobles y el Hombre", "minicraft.achievement.obsidian_dungeon.desc": "Llega a la mazmorra de obsidiana.", - "minicraft.achievement.airwizard": "Derrota... ¿el aire?", - "minicraft.achievement.airwizard.desc": "¡Derrota al primer Mago del Aire!", - "minicraft.achievement.skin": "Desfile de moda", - "minicraft.achievement.skin.desc": "Cambia de personaje.", - "minicraft.display.achievement": "Logros", - "minicraft.display.achievement.achieved": "¡Conseguido!", - "minicraft.display.achievement.not_achieved": "No se ha conseguido", - "minicraft.display.achievement.score": "Puntuación del logro:", - "minicraft.notification.achievement_unlocked": "Logro desbloqueado:", - "Entities": "Entidades", - "Air Wizard: Defeated!": "Mago de Aire: Derrotado!", - "The Dungeon is now open!": "El calabozo está abierto ahora", - "A costume lies on the ground...": "Un disfraz descansa en el suelo...", - "Can't sleep!": "¡No puedes dormir!", - "Min ": "Min ", - " Sec left!": " Segundo restante!", - "You hear a noise from the surface!": "Escuchas un ruido de la superficie!", - "Death Chest": "Cofre de la Muerte", + "minicraft.achievement.airwizard": "Derrota... ¿al aire?", + "minicraft.achievement.airwizard.desc": "¡Derrota al primer Mago Aéreo!", + "minicraft.achievement.skin": "La Nueva Moda", + "minicraft.achievement.skin.desc": "Cambia de Aspecto.", + "minicraft.display.entries.boolean.false": "No", + "minicraft.display.entries.boolean.true": "Sí", + "minicraft.display.gui.link_opening": "Abriendo en navegador...", + "minicraft.display.gui.perm_status.saving": "Guardando... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Presiona %s para cancelar", + "minicraft.display.gui.perm_status.sleeping": "Durmiendo...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s: ¡Tapar!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Puntaje actual: %s", + "minicraft.display.gui.score.time_left": "Tiempo restante %s%sm %ss", + "minicraft.display.menus.inventory": "Inventario", + "minicraft.display.options_display": "Ajustes", + "minicraft.display.options_display.change_key_bindings": "Atajos de teclado", + "minicraft.display.popup.enter_confirm": "ENTER para confirmar", + "minicraft.display.popup.escape_cancel": "ESC para cancelar", + "minicraft.display.popup.title_confirm": "Confirmar acción", + "minicraft.displays.achievements": "Logros", + "minicraft.displays.achievements.display.achieved": "¡Logrado!", + "minicraft.displays.achievements.display.help": "Usa %s y %s para moverte.", + "minicraft.displays.achievements.display.not_achieved": "No Logrado", + "minicraft.displays.achievements.display.score": "Puntaje de logros: %s", + "minicraft.displays.book.default_book": "Este libro no tiene texto.", + "minicraft.displays.crafting": "Fabricando", + "minicraft.displays.crafting.container_title.cost": "Vale:", + "minicraft.displays.crafting.container_title.have": "Poseo:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Puntaje final: %s", + "minicraft.displays.end_game.display.player_score": "Puntaje del jugador: %s", + "minicraft.displays.end_game.display.unlocked": "¡Desbloqueado! %s Tiempo Cronometro", + "minicraft.displays.end_game.exit": "Salir al menú principal", + "minicraft.displays.info.display.exit_help": "%s/%s:Salir", + "minicraft.displays.info.display.score": "Puntaje actual: %s", + "minicraft.displays.info.display.time": "Tiempo jugado: %s", + "minicraft.displays.info.title": "Datos Jugador", + "minicraft.displays.key_input.display.help.0": "Usa C/ENTER para cambiar atajos", + "minicraft.displays.key_input.display.help.1": "Con A añades un atajo", + "minicraft.displays.key_input.display.help.2": "SHIFT-D reinicia todos los atajos", + "minicraft.displays.key_input.display.help.3": "%s para volver al menú principal", + "minicraft.displays.key_input.popup_display.confirm_reset": "¿Estás seguro de reiniciar atajos de teclado a los predeterminados?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Presiona la tecla que desees", + "minicraft.displays.key_input.title": "Controles", + "minicraft.displays.loading.message.entities": "Entidades", + "minicraft.displays.loading.message.generating": "Generando", + "minicraft.displays.loading.message.level": "Nivel %s", + "minicraft.displays.loading.message.levels": "Niveles", + "minicraft.displays.loading.message.loading": "Cargando", + "minicraft.displays.loading.message.saving": "Guardando", + "minicraft.displays.loading.message.world": "Mundo", + "minicraft.displays.options_main_menu": "Opciones Principales", + "minicraft.displays.options_main_menu.resource_packs": "Lotes de recursos", + "minicraft.displays.options_world": "Opciones de Mundo", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "¿Estás seguro de desactivar los tutoriales para siempre?", + "minicraft.displays.options_world.turn_off_tutorials": "Desactivar tutoriales", + "minicraft.displays.pause": "Pausado", + "minicraft.displays.pause.display.exit_popup.0": "¿Estás seguro de salir de la partida?", + "minicraft.displays.pause.display.exit_popup.1": "Todo el progreso no guardado se perderá", + "minicraft.displays.pause.display.exit_popup.cancel": "Cancelar", + "minicraft.displays.pause.display.exit_popup.quit": "Salir de todas formas", + "minicraft.displays.pause.display.help.choose": "%s: Seleccionar", + "minicraft.displays.pause.display.help.scroll": "%s y %s para desplazarse", + "minicraft.displays.pause.menu": "Menú principal", + "minicraft.displays.pause.return": "Reanudar", + "minicraft.displays.pause.save": "Guardar partida", + "minicraft.displays.player_death.display.score": "Puntaje: %s", + "minicraft.displays.player_death.display.time": "Tiempo: %s", + "minicraft.displays.player_death.quit": "Salir", + "minicraft.displays.player_death.respawn": "Reaparecer", + "minicraft.displays.player_death.save_quit": "Salir y guardar", + "minicraft.displays.player_death.title": "¡Has muerto! ¡Auch!", + "minicraft.displays.player_inv.container_title.items": "Objetos", + "minicraft.displays.player_inv.display.help": "(%s) para buscar.", + "minicraft.displays.quests": "Misiones", + "minicraft.displays.quests.display.header.completed": "Completas", + "minicraft.displays.quests.display.header.unlocked": "Desbloqueadas", + "minicraft.displays.quests.display.no_quest_desc": "Sin misión", + "minicraft.displays.resource_packs.display.help.move": "Usa %s y %s para mover.", + "minicraft.displays.resource_packs.display.help.select": "%s para examinar.", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[FLECHAS] para mover lotes. ", + "minicraft.displays.resource_packs.display.title": "Lotes de recursos", + "minicraft.displays.skin": "Aspectos", + "minicraft.displays.skin.display.help.move": "Usa %s y %s para moverte.", + "minicraft.displays.skin.display.help.select": "%s seleccionar, y %s cancelar.", + "minicraft.displays.title.display.cannot_check": "No pudo buscar actualizaciones.", + "minicraft.displays.title.display.checking": "Buscando actualizaciones...", + "minicraft.displays.title.display.help.0": "(%s, %s para seleccionar)", + "minicraft.displays.title.display.help.1": "(%s para aceptar)", + "minicraft.displays.title.display.help.2": "(%s para volver)", + "minicraft.displays.title.display.latest_already": "Tienes la última versión.", + "minicraft.displays.title.display.new_version": "Nueva: %s", + "minicraft.displays.title.display.version": "Versión %s", + "minicraft.displays.title.help": "Ayuda", + "minicraft.displays.title.help.about": "Acerca de", + "minicraft.displays.title.help.credits": "Créditos", + "minicraft.displays.title.help.instructions": "Instrucciones", + "minicraft.displays.title.help.storyline_guide": "Guía de la historia", + "minicraft.displays.title.link_to_version": "Enlace a la última versión: %s", + "minicraft.displays.title.play": "Jugar", + "minicraft.displays.title.play.load_world": "Cargar Mundo", + "minicraft.displays.title.play.new_world": "Crear Mundo", + "minicraft.displays.title.quit": "Salir", + "minicraft.displays.title.select_to_download": "--Descárgala Aca--", + "minicraft.displays.world_gen.create_world": "Crear Mundo", + "minicraft.displays.world_gen.enter_world": "Nombre del mundo", + "minicraft.displays.world_gen.title": "Opciones de Mundo", + "minicraft.displays.world_gen.troublesome_input": "¿Problemas con el nombre?", + "minicraft.displays.world_gen.troublesome_input.msg": "Parece que has puesto letras como atajos de mover el cursor en vertical, lo cual puede molestar . Esto se puede cambiar en el menú atajos de teclado como las teclas \"cursor-XXX\". Por ahora, para escribir una letra en vez de mover el cursor, mantén SHIFT apretado al escribir.", + "minicraft.displays.world_gen.world_seed": "Semilla", + "minicraft.displays.world_select.display.help.0": "%s para confirmar", + "minicraft.displays.world_select.display.help.1": "%s para volver", + "minicraft.displays.world_select.display.help.2": "SHIFT-C para copiar", + "minicraft.displays.world_select.display.help.3": "SHIFT-R para renombrar", + "minicraft.displays.world_select.display.help.4": "SHIFT-D para eliminar", + "minicraft.displays.world_select.display.world_too_new": "¡No se puede cargar el mundo, versión mayor!", + "minicraft.displays.world_select.display.world_version": "Versión del mundo: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s para cancelar", + "minicraft.displays.world_select.popups.display.change": "Nuevo nombre:", + "minicraft.displays.world_select.popups.display.confirm": "%s para confirmar", + "minicraft.displays.world_select.popups.display.delete": "¿Estás seguro de querer eliminar \n%s\"%s\"%s?\n¡Esto no se puede deshacer!", + "minicraft.displays.world_select.select_world": "Seleccionar mundo", + "minicraft.notification.achievement_unlocked": "Logro desbloqueado: %s", + "minicraft.notification.air_wizard_defeated": "¡Mago aéreo derrotado!", + "minicraft.notification.cannot_sleep": "¡No puedes dormir! ¡Quedan %s Min y %s Seg!", + "minicraft.notification.death_chest_retrieved": "¡Cofre de recuperación obtenido!", + "minicraft.notification.defeat_air_wizard_first": "El mago aéreo debe ser derrotado primero.", + "minicraft.notification.dig_hole": "¡Cava un hoyo primero!", + "minicraft.notification.dungeon_opened": "¡La mazmorra se abrió!", + "minicraft.notification.gem_pickaxe_required": "Pico de gema requerido.", + "minicraft.notification.invalid_placement": "¡Sólo puede colocarse en %s!", + "minicraft.notification.quest_completed": "Misión completada", + "minicraft.notification.quest_unlocked": "Misión desbloqueada", + "minicraft.notification.world_saved": "¡Mundo guardado!", + "minicraft.notification.wrong_level_sky": "Solo se puede invocar en el cielo", + "minicraft.settings.fps": "FPS máximos", + "minicraft.settings.difficulty": "Dificultad", + "minicraft.settings.difficulty.easy": "Fácil", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Difícil", + "minicraft.settings.mode": "Modo de juego", + "minicraft.settings.mode.survival": "Supervivencia", + "minicraft.settings.mode.creative": "Creativo", + "minicraft.settings.mode.hardcore": "Extremo", + "minicraft.settings.mode.score": "Puntaje", + "minicraft.settings.scoretime": "Cronometro (Modo Puntaje)", + "minicraft.settings.screenshot_scale": "Gama captura pantalla", + "minicraft.settings.sound": "Sonido", + "minicraft.settings.autosave": "Autoguardado", + "minicraft.settings.size": "Tamaño del mundo", + "minicraft.settings.theme": "Tema del mundo", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.forest": "Arbolea", + "minicraft.settings.theme.desert": "Desierto", + "minicraft.settings.theme.plain": "Plano", + "minicraft.settings.theme.hell": "Magma", + "minicraft.settings.type": "Tipo de terreno", + "minicraft.settings.type.island": "Isla", + "minicraft.settings.type.box": "Caja", + "minicraft.settings.type.mountain": "Montaña", + "minicraft.settings.type.irregular": "Irregular", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul con capa", + "minicraft.skin.minecraft_steve": "Hombre conocido", + "minicraft.skin.minecraft_alex": "Mujer conocida", + "minicraft.text_particales.key_consumed": "-1 Llave", + "Death Chest": "Cofre de Recuperación", "Player": "Jugador", - "Crafting": "Elaborando", - "Set your home!": "Establece tu casa!", - "Can't set home here!": "No puedes establecer la casa aquí!", - "Home Sweet Home!": "Hogar Dulce Hogar!", - "Mode penalty: -2 health": "Modo de penalización: -2 de salud", - "You don't have a home!": "No tienes una casa!", - "You can't go home from here!": "No puedes ir a casa desde aquí!", "Leather Armor": "Armadura de Cuero", - "Snake Armor": "Armadura de Serpiente", + "Snake Armor": "Armadura de Víbora", "Iron Armor": "Armadura de Hierro", "Gold Armor": "Armadura de Oro", "Gem Armor": "Armadura de Gema", "Book": "Libro", - "Antidious": "Antídoto", + "Antidious": "Antidious", "Empty Bucket": "Cubo vacío", "Water Bucket": "Cubo de Agua", "Lava Bucket": "Cubo de Lava", - " Bucket": " Cubo", "Red Clothes": "Ropa Roja", "Blue Clothes": "Ropa Azul", "Green Clothes": "Ropa Verde", "Yellow Clothes": "Ropa Amarilla", "Black Clothes": "Ropa Negra", - "Orange Clothes": "Ropa Anaranjada", - "Purple Clothes": "Ropa Morado", - "Cyan Clothes": "Ropa Turquesa", - "Reg Clothes": "Ropa Reg", + "Orange Clothes": "Ropa Naranja", + "Purple Clothes": "Ropa Morada", + "Cyan Clothes": "Ropa Cían", + "Reg Clothes": "Ropa Común", "Bread": "Pan", "Apple": "Manzana", "Raw Pork": "Cerdo crudo", @@ -83,7 +225,7 @@ "Cooked Pork": "Cerdo cocido", "Steak": "Bistec", "Gold Apple": "Manzana Dorada", - "Baked Potato": "Patata al Horno", + "Baked Potato": "Patata Cocida", "Cow Spawner": "Generador de Vaca", "Pig Spawner": "Generador de Cerdo", "Sheep Spawner": "Generador de Oveja", @@ -91,68 +233,66 @@ "Zombie Spawner": "Generador de Zombie", "Creeper Spawner": "Generador de Creeper", "Skeleton Spawner": "Generador de Esqueleto", - "Snake Spawner": "Generador de Serpiente", + "Snake Spawner": "Generador de Víbora", "Knight Spawner": "Generador de Caballero", - "AirWizard Spawner": "Generador de MagoAire", + "AirWizard Spawner": "Generador de Mago Aéreo", "Workbench": "Mesa de trabajo", - "Oven": "Horno", + "Oven": "Cocina", "Furnace": "Horno", "Anvil": "Yunque", "Enchanter": "Encantador", "Loom": "Telar", - "Lantern": "Linterna", - "Iron Lantern": "Linterna de Hierro", - "Gold Lantern": "Linterna de Oro", + "Lantern": "Farol", + "Iron Lantern": "Farol de Hierro", + "Gold Lantern": "Farol de Oro", "Tnt": "Dinamita", "Bed": "Cama", "Chest": "Cofre", - "None Potion": "Ninguna Poción", + "None Potion": "Poción de Nada", "Speed Potion": "Poción de Velocidad", "Light Potion": "Poción de Luz", - "Swim Potion": "Poción de Nadar", - "Energy Potion": "Poción de Energía", - "Regen Potion": "Poción de Reneg", + "Swim Potion": "Poción del Mar", + "Energy Potion": "Poción Energética", + "Regen Potion": "Poción de Regen.", "Health Potion": "Poción de Vida", - "Time Potion": "Poción de Tiempo", + "Time Potion": "Poción Contrareloj", "Lava Potion": "Poción de Lava", "Shield Potion": "Poción de Escudo", "Haste Potion": "Poción de Prisa", - "Escape Potion": "Poción de Escapar", + "Escape Potion": "Poción de Escape", "Potion": "Poción", - "Power Glove": "Poder de Guante", + "Power Glove": "Guante Fuerte", "Wood": "Madera", "Stone": "Piedra", "Leather": "Cuero", "Wheat": "Trigo", "Key": "Llave", - "Arrow": "Flecha", - "String": "Cuerda", "Coal": "Carbón", "Iron Ore": "Mena de Hierro", - "Lapis": "Lapis", "Gold Ore": "Mena de Oro", + "Gem Ore": "Mena de Gema", + "Cloud Ore": "Mena Nubosa", "Iron": "Hierro", "Gold": "Oro", + "Lapis": "Lapis", "Rose": "Rosa", "GunPowder": "Pólvora", "Slime": "Slime", - "Glass": "Cristal", - "Cloth": "Paño", - "Scale": "Escala", - "Shard": "Élitro", + "Scale": "Escama", + "Shard": "Pieza", "Flower": "Flor", "Acorn": "Bellota", "Dirt": "Tierra", "Natural Rock": "Roca natural", - "Plank": "Tablón", - "Plank Wall": "Muro de Tablón", + "Plank": "Tabla", + "Plank Wall": "Muro de Tablas", "Wood Door": "Puerta de Madera", "Stone Brick": "Ladrillo de Piedra", - "Ornate Stone": "Piedra Ornamentada", + "Ornate Stone": "Patrón de Piedra", "Stone Wall": "Muro de Piedra", "Stone Door": "Puerta de Piedra", "Obsidian Brick": "Ladrillo de Obsidiana", - "Ornate Obsidian": "Obsidiana Ornamentada", + "Ornate Obsidian": "Patrón de Obsidiana", "Obsidian Wall": "Muro de Obsidiana", "Obsidian Door": "Puerta de Obsidiana", "Wool": "Lana", @@ -164,17 +304,17 @@ "Sand": "Arena", "Cactus": "Cactus", "Seeds": "Semillas", - "Wheat Seeds": "Semilla de Trigo", + "Wheat Seeds": "Semillas de Trigo", "Grass Seeds": "Semillas de Pasto", "Bone": "Hueso", "Cloud": "Nube", "Rock": "Roca", "Gem": "Gema", "Potato": "Patata", - "Wood Fishing Rod": "Caña de pescar de madera", - "Iron Fishing Rod": "Caña de pescar de hierro", - "Gold Fishing Rod": "Caña de pescar de oro", - "Gem Fishing Rod": "Caña de pescar de gema", + "Wood Fishing Rod": "Estrobo de madera", + "Iron Fishing Rod": "Estrobo de hierro", + "Gold Fishing Rod": "Estrobo de oro", + "Gem Fishing Rod": "Estrobo de gema", "Shovel": "Pala", "Hoe": "Azada", "Sword": "Espada", @@ -184,8 +324,7 @@ "Claymore": "Claymore", "Shears": "Tijeras", "Torch": "Antorcha", - "Gem Ore": "Mena de Gema", - "Wood Planks": "Tablón de Madera", + "Wood Planks": "Tablas de Madera", "Stone Bricks": "Ladrillo de piedra", "Obsidian": "Obsidiana", "Wood Wall": "Muro de Madera", @@ -196,155 +335,139 @@ "Water": "Agua", "Tree": "Árbol", "Tree Sapling": "Brote de Árbol", - "Cactus Sapling": "Cactus Joven", + "Cactus Sapling": "Brote de Cactus", "Lava": "Lava", "Lava Brick": "Ladrillo de Lava", - "Explode": "Explotar", - "Farmland": "Tierras de cultivo", + "Explode": "Explosión", + "Farmland": "Tierra Fértil", "Hard Rock": "Roca Dura", "Infinite Fall": "Caída Infinita", - "Cloud Cactus": "Nubes de Cactus", - "Ore": "Mena", - "host not found": "alojamiento no encontrado", - "unable to get localhost address": "incapaz de obtener la dirección localhost", - "World Saved!": "¡Mundo Guardado!", - "On": "On", - "Off": "Off", - "There is nothing of use here.": "No hay nada de uso aquí.", - "Still nothing... :P": "Todavía nada... :P", - "Have:": "Tienes:", - "Cost:": "Costo:", - "Time: ": "Tiempo: ", - "Score: ": "Puntos: ", - "Quit": "Salir", - "Respawn": "Reaparecer", - "You died! Aww!": "Moriste! Aww!", - "Player Score: ": "Puntos del Jugador: ", - "": "", - "Final Score: ": "Puntos final: ", - "Exit to Menu": "Salir al Menu", - "Time Played: ": "Tiempo Jugado: ", - "Current Score: ": "Puntuación Actual: ", - "Exit": "Salir", - "Player Stats": "Estadisticas del Jugador", - "Controls": "Controles", - "Press the desired": "Presione el deseado", - "key sequence": "secuencia de tecla", - "minicraft.display.key_input.confirm_popup": "Estás seguro que quieres reiniciar todos los atajos de teclado a las teclas predeterminadas?", - "minicraft.display.popup.enter_confirm": "enter para confirmar", - "minicraft.display.popup.escape_cancel": "ESC para cancelar", - "Confirm Action": "Confirmar Acción", - "Press C/Enter to change key binding": "Presiona C/Enter para cambiar el atajo de teclado", - "Press A to add key binding": "Presiona A para añadir atajo de teclado", - "Shift-D to reset all keys to default": "Shift-D para restablecer todas las teclas a sus valores predeterminados", - "ESCAPE to Return to menu": "ESC para Regresar al menú", - "Loading": "Cargando", - "Generating": "Generando", - "World": "Mundo", - "waiting": "esperando", - "nothing": "nada", - "attempting log in": "intentando iniciar sesión", - "no internet connection, but no login data saved; cannot enter offline mode.": "no hay conexión a Internet, pero no se guardaron datos de inicio de sesión; no puede ingresar al modo fuera de línea.", - "connecting to server": "conectando al servidor", - "logging in": "iniciando sesión", - "saving credentials": "guardando credenciales", - "login failed.": "error de inicio de sesion.", - "problem with saved login data; please exit and login again.": "problema con los datos de inicio de sesión guardados; por favor salga y vuelva a iniciar sesión.", - "Internal server error: Couldn't fetch username from uuid": "Error interno del servidor: no se pudo obtener el nombre de usuario de uuid", - "logged in as: ": "conectado como: ", - "offline mode: local servers only": "modo fuera de línea: solo servidores locales", - "Enter ip address to connect to:": "Ingrese la dirección de IP para conectarse:", - "Press Shift-Escape to logout": "Presione Shift-ESC para cerrar la sesión", - "Enter email:": "Ingrese correo electronico:", - "Enter password:": "Ingrese contraseña:", - "field is blank": "el campo esta en blanco", - "get an account at:": "obtener una cuenta en:", - "Loading ": "Cargando ", - " from server": " desde el servidor", - "Could not connect to server:": "no pudo conectar al servidor:", - "Press ": "Presione ", - " to return": " para regresar", - "Change Key Bindings": "Cambiar Atajos de Teclado", - "Options": "Opciones", - "Change language": "Cambiar idioma", - "Return to Game": "Regresar al Juego", - "Make World Multiplayer": "Hacer Mundo Multijugador", - "Save Game": "Guardar Juego", - " and ": " y ", - " to Scroll": " para desplazarse", - ": Choose": ": Escoge", - "Paused": "Pausado", - "Main Menu": "Menú Principal", - "Yes": "Sí", - "No": "No", - "Inventory": "Inventario", - "to search.": "para buscar.", - "Play": "Jugar", - "Load World": "Cargar Mundo", - "New World": "Nuevo Mundo", - "Singleplayer": "Un jugador", - "Multiplayer": "Entrar en Mundo en línea", - "Help": "Ayuda", - "Instructions": "Instrucciones", - "Storyline Guide": "Guía de historias", - "About": "Acerca de", - "Credits": "Creditos", - " to select": " para seleccionar", - " to accept": " para aceptar", - "New World Name:": "Nuevo Nombre del Mundo:", - "Are you sure you want to delete": "Estás seguro que quieres eliminarlo", - "This can not be undone!": "¡Esto no se puede deshacer!", - " to confirm": " para confirmar", - " to cancel": " para cancelar", - "World Seed": "Semilla del Mundo", - "Enter World Name": "Ingrese Nombre del Mundo", - "Trouble with world name?": "¿Problema con el nombre?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "de forma predeterminada, w y s mueven el cursor hacia arriba y hacia abajo. Esto se puede cambiar en el menú de enlace de teclas. Para escribir la letra en lugar de mover el cursor, mantenga presionada la tecla Mayús mientras escribe el nombre del mundo.", - "Create World": "Crear Mundo", - "World Gen Options": "Opciones de Generador de Mundo", - " to Copy": " para Copiar", - " to Rename": " para Renombrar", - " to Delete": " para Eliminar", - "Select World": "Seleccionar Mundo", - "Select a World to Delete": "Selecciona un Mundo para Eliminar", - "Select a World to Rename": "Selecciona un Mundo para Renombrar", - "Select a World to Copy": "Selecciona un Mundo para Copiar", - "Higher version, cannot load world!": "Version más nueva, ¡no se puede cargar el mundo!", - "World Version:": "Version del Mundo:", - "Languages": "Idiomas", - "Language": "Idioma", - "Select": "Selecionar", - "Max FPS": "Max FPS", - "Difficulty": "Dificultad", - "Easy": "Facíl", - "Normal": "Normal", - "Hard": "Difícil", - "Game Mode": "Modo de Juego", - "Survival": "Supervivencia", - "Creative": "Creativo", - "Hardcore": "Hardcore", - "Score": "Puntos", - "Time (Score Mode)": "Tiempo (Modo Puntos)", - "Sound": "Sonido", - "Autosave": "Autoguardado", - "World Size": "Tamaño del Mundo", - "World Theme": "Tema del Mundo", - "Forest": "Bosque", - "Desert": "Desierto", - "Plain": "Plano", - "Hell": "Infierno", - "Terrain Type": "Tipo de Terreno", - "Island": "Isla", - "Box": "Caja", - "Mountain": "Montaña", - "Irregular": "Inrregular", - "Wear Suit": "Usar traje", - "You have the latest version.": "Tienes la última version.", - "minicraft.display.skin": "Personajes", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul con capa", - "minicraft.skin.minecraft_steve": "Hombre conocido", - "minicraft.skin.minecraft_alex": "Mujer conocida", - "minicraft.notification.invalid_placement": "Sólo puede colocarse en", - "minicraft.notification.dig_hole": "¡Cava un agujero primero!" + "Cloud Cactus": "Cactus Nuboso", + "Raw Obsidian": "Obsidiana cruda", + "Totem of Air": "Totem aéreo", + "minicraft.control_guide.attack": "Usa %s para atacar enemigos o destruir objetos.", + "minicraft.control_guide.craft": "Usa %s para abrir tu menú de fabricación.", + "minicraft.control_guide.menu": "Usa %s para abrir tu inventario.", + "minicraft.control_guide.move": "Usa %s para moverte.", + "minicraft.displays.controls": "Controles", + "minicraft.displays.controls.display.controller": "Mando", + "minicraft.displays.controls.display.controller.00": "Mueve al jugador con el DPAD", + "minicraft.displays.controls.display.controller.01": "Mueve el cursor con el DPAD", + "minicraft.displays.controls.display.controller.02": "Selecciona opciones con A", + "minicraft.displays.controls.display.controller.03": "Sal de páginas con B", + "minicraft.displays.controls.display.controller.04": "Ataca enemigos, destruye e interactúa con objetos con A", + "minicraft.displays.controls.display.controller.05": "Abre menús en-juego con X", + "minicraft.displays.controls.display.controller.06": "Abre menús de fabricación con Y", + "minicraft.displays.controls.display.controller.07": "Coge muebles con LB", + "minicraft.displays.controls.display.controller.08": "Tira 1 objeto con RB", + "minicraft.displays.controls.display.controller.09": "Tira un montón entero de objetos con el STICK DERECHO", + "minicraft.displays.controls.display.controller.10": "Alterna la barra de búsqueda en menús de objetos con START", + "minicraft.displays.controls.display.controller.11": "Pausa el juego con START", + "minicraft.displays.controls.display.controller.12": "Usa X para alternar el teclado en pantalla", + "minicraft.displays.controls.display.controller.13": "Usa B como atajo de retroceso en teclado en pantalla", + "minicraft.displays.controls.display.controller.14": "Usa X para eliminar un objeto seleccionado en el inventario del modo creativo", + "minicraft.displays.controls.display.controller.15": "Usa Y para eliminar un montón entero de objetos en el inventario del modo creativo", + "minicraft.displays.controls.display.controller.desc.0": "Mapeos depuración inaccesibles", + "minicraft.displays.controls.display.controller.desc.1": "Mapeos detallados inusables", + "minicraft.displays.controls.display.help.0": "con %s/%s ves otros controles.", + "minicraft.displays.controls.display.keyboard": "Teclado", + "minicraft.displays.controls.display.keyboard.00": "Mueve al jugador con MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Mueve el cursor con CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Selecciona opciones con SELECT", + "minicraft.displays.controls.display.keyboard.03": "Sal de páginas con EXIT", + "minicraft.displays.controls.display.keyboard.04": "Haz un guardado rápido con QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Ataca enemigos, destruye e interactúa con objetos con ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Abre menús en-juego con MENU", + "minicraft.displays.controls.display.keyboard.07": "Abre menús de fabricación con CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Coge muebles con PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Tira 1 objeto con DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Tira un montón entero de objetos con DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Alterna la barra de búsqueda en menús de objetos con SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Navega entre resultados de búsqueda con PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Pausa el juego con PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Alterna notificaciones de efectos de poción con POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Alterna notificaciones de pociones simplificadas con SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Expande notificaciones de misiones en-juego con EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Alterna la HUD con TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Toma capturas de pantalla con SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Muestra información de la partida con INFO", + "minicraft.displays.controls.display.keyboard.20": "Alterna pantalla completa con FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Usa D para eliminar un objeto seleccionado en el inventario del modo creativo", + "minicraft.displays.controls.display.keyboard.22": "Usa SHIFT-D para eliminar un montón entero de objetos en el inventario del modo creativo", + "minicraft.displays.controls.display.keyboard.desc": "Mapeos depuración no explicados", + "minicraft.displays.loading.message.dungeon_regeneration": "Regenerando B4", + "minicraft.displays.loading.message.quests": "Misiones", + "minicraft.displays.loading.regeneration_popup.display.0": "La mazmorra versión antigua (Piso B4) fue detectada.", + "minicraft.displays.loading.regeneration_popup.display.1": "Se necesita una regeneración.", + "minicraft.displays.loading.regeneration_popup.display.2": "Los datos antiguos en ese piso serán eliminados:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s para continuar", + "minicraft.displays.loading.regeneration_popup.display.4": "%s para cancelar la carga del mundo", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "La carga del mundo fue cancelada", + "minicraft.displays.quests.display.no_quest": "No se han desbloqueado misiones", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Solo se acepta teclado.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Con %s examinas los detalles del tutorial actual.", + "minicraft.notification.obsidian_knight_defeated": "Caballero Obsidiano: ¡Derrotado!", + "minicraft.notification.obsidian_knight_awoken": "¡El Caballero Obsidiano ha despertado!", + "minicraft.notification.defeat_obsidian_knight_first": "El Caballero Obsidiano debe ser derrotado primero.", + "minicraft.notification.wrong_level_dungeon": "Solo se puede invocar en la mazmorra", + "minicraft.notification.boss_limit": "Ya no se pueden invocar más jefes", + "minicraft.notification.spawn_on_boss_tile": "Solo se puede invocar en la Sala de Combate", + "minicraft.notifications.statue_tapped": "Hay susurros farfullurros...", + "minicraft.notifications.statue_touched": "La estatua vibra con calibra...", + "minicraft.quest.farming": "Agricultor", + "minicraft.quest.farming.crafting_hoe": "Fabrica una azada", + "minicraft.quest.farming.crafting_hoe.description": "Fabrica cualquier azada en una mesa de trabajo", + "minicraft.quest.farming.description": "Lo básico de un agricultor.", + "minicraft.quest.farming.getting_wheat": "Sembradío de Trigo", + "minicraft.quest.farming.getting_wheat.description": "Recoge trigo rompiendo una siembra de trigo ya crecida.", + "minicraft.quest.farming.making_farmland": "Cultivo Activo", + "minicraft.quest.farming.making_farmland.description": "Haz tierra fértil interactuando con una azada a un trozo de tierra.", + "minicraft.quest.farming.planting_potato": "Plantando patatas", + "minicraft.quest.farming.planting_potato.description": "Planta una patata poniendo una patata en tierra fértil", + "minicraft.quest.farming.planting_wheat": "Plantando Trigo", + "minicraft.quest.farming.planting_wheat.description": "Planta trigo poniendo semillas de trigo en tierra fértil.", + "minicraft.quest.gems": "Llévame a la Gema", + "minicraft.quest.gems.description": "Preparando equipamiento de gema.", + "minicraft.quest.gems.gem_armor": "Listo para Luchar", + "minicraft.quest.gems.gem_armor.description": "Obtén armadura de gema.", + "minicraft.quest.gems.gem_claymore": "As de la Espada", + "minicraft.quest.gems.gem_claymore.description": "Obtén claymore de gema.", + "minicraft.quest.iron_equipments": "Herrero Nuevo", + "minicraft.quest.iron_equipments.description": "Obtén todo el equipamiento de hierro.", + "minicraft.quest.iron_equipments.getting_more_iron": "Me Sobra el Hierro", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Obtén aún más hierro.", + "minicraft.quest.iron_equipments.iron_armor": "Mejora de armadura", + "minicraft.quest.iron_equipments.iron_armor.description": "Mejora tu armadura a hierro.", + "minicraft.quest.iron_equipments.iron_tools": "Mejora toda herramienta", + "minicraft.quest.iron_equipments.iron_tools.description": "Mejora tus herramientas a hierro.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Pico Mejorado", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Mejora tu pico.", + "minicraft.quest.potions": "Mago Destilador", + "minicraft.quest.potions.all_potions_prepared": "Alquímia Mixta", + "minicraft.quest.potions.all_potions_prepared.description": "Obtén todos los efectos de poción al mismo tiempo.", + "minicraft.quest.potions.awkward_potions": "Poción Extraña", + "minicraft.quest.potions.awkward_potions.description": "Obtén una poción extraña.", + "minicraft.quest.potions.description": "Obteniendo Pociones.", + "minicraft.quest.potions.powerful_potions": "Pociones Poderosas", + "minicraft.quest.potions.powerful_potions.description": "Obtén las pociones útiles y poderosas.", + "minicraft.tutorial.getting_rocks": "Rocas y Carbón", + "minicraft.tutorial.getting_rocks.description": "Obtén al menos 5 de piedra y 5 de carbón destruyendo rocas con el pico fabricado.", + "minicraft.tutorial.getting_wood": "Mucha más madera", + "minicraft.tutorial.getting_wood.description": "Obtén al menos 10 de madera de los arboles.", + "minicraft.tutorial.getting_wooden_pickaxe": "El Pico de madera", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Fabrica un pico de madera en el menú de fabricación de la mesa de trabajo.", + "minicraft.tutorial.getting_workbench": "La útil mesa de trabajo", + "minicraft.tutorial.getting_workbench.description": "Fabrica una mesa de trabajo en el menú de fabricación. Luego colócala.", + "minicraft.tutorial.start_getting_wood": "Dónde Todo Comienza", + "minicraft.tutorial.start_getting_wood.description": "Ataca Arboles continuamente para obtener madera.", + "minicraft.display.options_display.language": "Idioma", + "minicraft.display.options_display.resource_packs": "Lotes de recursos", + "minicraft.displays.language_settings.title": "Idioma...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Flecha", + "String": "Cuerda", + "Glass": "Cristal", + "Cloth": "Paño" } diff --git a/src/client/resources/assets/localization/fr-fr.json b/src/client/resources/assets/localization/fr-fr.json index 03fcccbad..da2c2deb5 100644 --- a/src/client/resources/assets/localization/fr-fr.json +++ b/src/client/resources/assets/localization/fr-fr.json @@ -3,341 +3,471 @@ "minicraft.achievement.woodcutter.desc": "Obtenir du bois.", "minicraft.achievement.benchmarking": "Artisanat", "minicraft.achievement.benchmarking.desc": "Fabriquez un établi.", - "minicraft.achievement.upgrade": "Mise à niveau!", - "minicraft.achievement.upgrade.desc": "Fabriquer n'importe quel outil à partir de la pierre.", + "minicraft.achievement.upgrade": "Amélioration !", + "minicraft.achievement.upgrade.desc": "Fabriquez n'importe quel outil en pierre.", "minicraft.achievement.bow": "Prosternez-vous devant moi !", "minicraft.achievement.bow.desc": "Tirez une flèche avec un arc.", - "minicraft.achievement.fish": "Allez les poissons!", - "minicraft.achievement.fish.desc": "attraper un poisson!", + "minicraft.achievement.fish": "Allez pêcher!", + "minicraft.achievement.fish.desc": "Pêcher un poisson!", "minicraft.achievement.doors": "Protection des adorateurs", - "minicraft.achievement.doors.desc": "Fabrication d'une porte en bois.", + "minicraft.achievement.doors.desc": "Fabriquez une porte en bois.", "minicraft.achievement.planks": "Marche sur les planches!", - "minicraft.achievement.planks.desc": "Planches de bois artisanales.", + "minicraft.achievement.planks.desc": "Fabriquez des planches en bois.", "minicraft.achievement.clothes": "Passez une journée haute en couleurs!", "minicraft.achievement.clothes.desc": "Créez des vêtements de n'importe quelle couleur", "minicraft.achievement.demolition": "Démonstration de démolition", - "minicraft.achievement.demolition.desc": "Utilisez du TNT.", - "minicraft.achievement.survive_darkness": "Peur de l'obscurité?", + "minicraft.achievement.demolition.desc": "Utilisez de la TNT.", + "minicraft.achievement.survive_darkness": "Appeuré(e) par la nuit ?", "minicraft.achievement.survive_darkness.desc": "Survivre 5 minutes dans l'obscurité totale.", "minicraft.achievement.lava": "Affaires chaudes", - "minicraft.achievement.lava.desc": "Utilisez une potion de lave pour nager dans la lave..", + "minicraft.achievement.lava.desc": "Utilisez une potion de résistance à la lave pour nager dedans", "minicraft.achievement.find_gem": "Oooh Brillant!", - "minicraft.achievement.find_gem.desc": "Trouvez le minerai de gemme et exploitez-le.", + "minicraft.achievement.find_gem.desc": "Trouvez un minerai de gemmes et minez-le.", "minicraft.achievement.lowest_caves": "L'obscurité derrière la lumière", - "minicraft.achievement.lowest_caves.desc": "Atteindre les grottes les plus basses.", + "minicraft.achievement.lowest_caves.desc": "Atteignez les grottes les plus profondes.", "minicraft.achievement.obsidian_dungeon": "Des chevaliers et des hommes", - "minicraft.achievement.obsidian_dungeon.desc": "Atteindre le donjon d'obsidienne.", - "minicraft.achievement.airwizard": "Vaincre... l'air?", - "minicraft.achievement.airwizard.desc": "Battez le premier magicien de l'air!", + "minicraft.achievement.obsidian_dungeon.desc": "Atteignez le donjon d'obsidienne.", + "minicraft.achievement.airwizard": "Vainqueur de... l'air?", + "minicraft.achievement.airwizard.desc": "Tuez votre premier magicien de l'air!", "minicraft.achievement.skin": "Défilé de mode", - "minicraft.achievement.skin.desc": "Changez votre peau.", - "minicraft.display.achievement": "Réalisations", - "minicraft.display.achievement.achieved": "Atteint!", - "minicraft.display.achievement.not_achieved": "Non atteint", - "minicraft.display.achievement.score": "Score de réussite:", - "Entities": "Entités", - "Air Wizard: Defeated!": "Sorcier Des Airs: Vaincu!", - "The Dungeon is now open!": "Le donjon est ouvert !", - "A costume lies on the ground...": "Un costume git sur le sol...", - "Can't sleep! ": "Tu peux pas dormir!", - "Min ": "Min ", - " Sec left!": " Sec left!", - "You hear a noise from the surface!": "Tu entend du bruit venant de la surface!", - "Death Chest": "Coffre Morbide", + "minicraft.achievement.skin.desc": "Changez votre skin.", + "minicraft.display.entries.boolean.false": "Éteint", + "minicraft.display.entries.boolean.true": "Allumé", + "minicraft.display.gui.link_opening": "ouverture avec votre navigateur web", + "minicraft.display.gui.perm_status.saving": "Sauvegarde... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Appuyer sur %s pour annuler", + "minicraft.display.gui.perm_status.sleeping": "Vous êtes en train de dormir", + "minicraft.display.gui.potion_effects.hide_hint": "(%s pour cacher l'interface!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Score actuel : %s", + "minicraft.display.gui.score.time_left": "Temps restant %s%sm %ss", + "minicraft.display.menus.inventory": "Inventaire", + "minicraft.display.options_display": "Options", + "minicraft.display.options_display.change_key_bindings": "Changer la configuration des touches", + "minicraft.display.popup.enter_confirm": "Appuyez sur entrée pour confirmer", + "minicraft.display.popup.escape_cancel": "Appuyez sur Echap pour annuler", + "minicraft.display.popup.title_confirm": "Confirmer l'action", + "minicraft.displays.achievements": "Succès", + "minicraft.displays.achievements.display.achieved": "Réussi !", + "minicraft.displays.achievements.display.help": "Utilisez %s et %s pour vous déplacer.", + "minicraft.displays.achievements.display.not_achieved": "Pas encore réussi", + "minicraft.displays.achievements.display.score": "Atteignez le score : %s", + "minicraft.displays.book.default_book": "Ce livre n'a pas de texte", + "minicraft.displays.crafting": "Fabrication", + "minicraft.displays.crafting.container_title.cost": "Coût :", + "minicraft.displays.crafting.container_title.have": "Vous avez:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Score final : %s", + "minicraft.displays.end_game.display.player_score": "Score du joueur: %s", + "minicraft.displays.end_game.display.unlocked": "Vous débloquez! %s Temps de Score", + "minicraft.displays.end_game.exit": "Allez au Menu", + "minicraft.displays.info.display.exit_help": "%s/%s:Sortie", + "minicraft.displays.info.display.score": "Score Actuel : %s", + "minicraft.displays.info.display.time": "Temps de jeu : %s", + "minicraft.displays.info.title": "Statistiques du joueur", + "minicraft.displays.key_input.display.help.0": "Appuyez sur C ou Entrée pour changer la configuration de touche", + "minicraft.displays.key_input.display.help.1": "Appuyez sur A pour ajouter une configuration de touche", + "minicraft.displays.key_input.display.help.2": "Appuyez sur MAJ-S pour réinitialiser toutes les touches", + "minicraft.displays.key_input.display.help.3": "%s Pour retourner au menu", + "minicraft.displays.key_input.popup_display.confirm_reset": "Êtes-vous sûr(e) de vouloir réinitialiser la configuration des touches ?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Pressez la combinaison de touches désirée", + "minicraft.displays.key_input.title": "Contrôles", + "minicraft.displays.loading.message.entities": "Entités", + "minicraft.displays.loading.message.generating": "Génération en cours", + "minicraft.displays.loading.message.level": "Niveau %s", + "minicraft.displays.loading.message.levels": "Niveaux", + "minicraft.displays.loading.message.loading": "Chargement", + "minicraft.displays.loading.message.saving": "Sauvegarde", + "minicraft.displays.loading.message.world": "Monde", + "minicraft.displays.options_main_menu": "Options du menu principal", + "minicraft.displays.options_main_menu.resource_packs": "Pack de ressources", + "minicraft.displays.options_world": "Option du monde", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Êtes-vous sûr(e) de vouloir désactiver le tutoriel pour toujours ?", + "minicraft.displays.options_world.turn_off_tutorials": "Désactivation du tutoriel", + "minicraft.displays.pause": "En pause", + "minicraft.displays.pause.display.exit_popup.0": "Êtes-vous sûr(e) de vouloir quitter le jeu ?", + "minicraft.displays.pause.display.exit_popup.1": "Toutes les données non sauvegardées seront perdues", + "minicraft.displays.pause.display.exit_popup.cancel": "Annuler", + "minicraft.displays.pause.display.exit_popup.quit": "Quitter sans sauvegarder", + "minicraft.displays.pause.display.help.choose": "%s: Choisir", + "minicraft.displays.pause.display.help.scroll": "%s et %s pour faire défiler", + "minicraft.displays.pause.menu": "Menu principal", + "minicraft.displays.pause.return": "Retour en jeu", + "minicraft.displays.pause.save": "Sauvegarder la partie", + "minicraft.displays.player_death.display.score": "Score : %s", + "minicraft.displays.player_death.display.time": "Temps: %s", + "minicraft.displays.player_death.quit": "Quitter", + "minicraft.displays.player_death.respawn": "Réapparaître", + "minicraft.displays.player_death.save_quit": "Sauvegarder et quitter", + "minicraft.displays.player_death.title": "Vous êtes mort! Ohhh!", + "minicraft.displays.player_inv.container_title.items": "Objets", + "minicraft.displays.player_inv.display.help": "(%s) pour chercher.", + "minicraft.displays.quests": "Quêtes", + "minicraft.displays.quests.display.header.completed": "Complétée", + "minicraft.displays.quests.display.header.unlocked": "Débloquer", + "minicraft.displays.quests.display.no_quest_desc": "Pas de quête", + "minicraft.displays.resource_packs.display.help.move": "Utilisez %s et %s pour bouger", + "minicraft.displays.resource_packs.display.help.select": "%s pour examiner", + "minicraft.displays.resource_packs.display.help.position": "MAJ-[GAUCHE|DROITE|HAUT|BAS] pour bouger des paquets. ␣", + "minicraft.displays.resource_packs.display.title": "Pack de Ressource", + "minicraft.displays.skin": "Skins", + "minicraft.displays.skin.display.help.move": "Utilisez %s et %s pour bouger", + "minicraft.displays.skin.display.help.select": "%s pour sélectionner, et %s pour annuler", + "minicraft.displays.title.display.cannot_check": "N'a pas pu chercher de mises à jour.", + "minicraft.displays.title.display.checking": "Cherche des mises à jour...", + "minicraft.displays.title.display.help.0": "(%s, %s pour sélectionner)", + "minicraft.displays.title.display.help.1": "(%s pour accepter)", + "minicraft.displays.title.display.help.2": "(%s pour retourner en arrière)", + "minicraft.displays.title.display.latest_already": "Vous avez la dernière version", + "minicraft.displays.title.display.new_version": "Nouveau: %s", + "minicraft.displays.title.display.version": "Version %s", + "minicraft.displays.title.help": "Aide", + "minicraft.displays.title.help.about": "À propos", + "minicraft.displays.title.help.credits": "Crédits", + "minicraft.displays.title.help.instructions": "Instructions", + "minicraft.displays.title.help.storyline_guide": "Guide du déroulement de l'histoire", + "minicraft.displays.title.link_to_version": "Lien directe à la dernière version", + "minicraft.displays.title.play": "Jouer", + "minicraft.displays.title.play.load_world": "Charger un monde", + "minicraft.displays.title.play.new_world": "Nouveau monde", + "minicraft.displays.title.quit": "Quitter", + "minicraft.displays.title.select_to_download": "--Sélectionner ici pour télécharger--", + "minicraft.displays.world_gen.create_world": "Créer un Monde", + "minicraft.displays.world_gen.enter_world": "Entrer le nom du monde", + "minicraft.displays.world_gen.title": "Options de génération du monde", + "minicraft.displays.world_gen.troublesome_input": "Un soucis avec le nom de votre monde ?", + "minicraft.displays.world_gen.troublesome_input.msg": "Il semblerait que vous ayez mis les lettres comme contrôles pour bouger le curseur de haut en bas, ce qui parait embêtant. Ceci peut être changer dans le menu de configuration de touche en tant que touche \"curseur-XXX\". Pour l'instant, pour taper des lettres et ne pas bouger, rester appuyer sur MAJ pendant que vous tapez.", + "minicraft.displays.world_gen.world_seed": "Seed du monde", + "minicraft.displays.world_select.display.help.0": "%s pour confirmer", + "minicraft.displays.world_select.display.help.1": "%s pour revenir en arrière", + "minicraft.displays.world_select.display.help.2": "MAJ-C pour copier", + "minicraft.displays.world_select.display.help.3": "MAJ-R pour renommer", + "minicraft.displays.world_select.display.help.4": "MAJ-D pour supprimer", + "minicraft.displays.world_select.display.world_too_new": "Version supérieure nécessaire pour charger le monde !", + "minicraft.displays.world_select.display.world_version": "Version du Monde: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s pour annuler", + "minicraft.displays.world_select.popups.display.change": "Nom du Nouveau Monde: ", + "minicraft.displays.world_select.popups.display.confirm": "%s pour confirmer", + "minicraft.displays.world_select.popups.display.delete": "Êtes-vous certain(e) de vouloir supprimer\n%s\"%s\"%s?\nCela ne peut pas être annulé!", + "minicraft.displays.world_select.select_world": "Sélection du monde", + "minicraft.notification.achievement_unlocked": "Succès atteint: %s", + "minicraft.notification.air_wizard_defeated": "Sorcier de l'Air Battu!", + "minicraft.notification.cannot_sleep": "Vous ne pouvez pas encore dormir! %sMin %s Sec restant!", + "minicraft.notification.death_chest_retrieved": "Coffre de la Mort récupéré!", + "minicraft.notification.defeat_air_wizard_first": "Le Sorcier de l'Air doit être vaincu d'abord.", + "minicraft.notification.dig_hole": "Vous devez creuser un trou avant!", + "minicraft.notification.dungeon_opened": "Le Donjon est maintenant ouvert!", + "minicraft.notification.gem_pickaxe_required": "Pioche en Gemme requise", + "minicraft.notification.invalid_placement": "Ceci ne peut être placé que sur %s!", + "minicraft.notification.quest_completed": "Quête complétée", + "minicraft.notification.quest_unlocked": "Quête débloquée", + "minicraft.notification.world_saved": "Monde Sauvegardé!", + "minicraft.notification.wrong_level_sky": "Ne peut être invoqué qu'au niveau du Ciel", + "minicraft.settings.fps": "FPS Max", + "minicraft.settings.difficulty": "Difficulté", + "minicraft.settings.difficulty.easy": "Facile", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Difficile", + "minicraft.settings.mode": "Mode de Jeu", + "minicraft.settings.mode.survival": "Survie", + "minicraft.settings.mode.creative": "Créatif", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Score", + "minicraft.settings.scoretime": "Temps (Mode Score)", + "minicraft.settings.screenshot_scale": "Échelle du Screenshot", + "minicraft.settings.sound": "Son", + "minicraft.settings.autosave": "Sauvegarde automatique", + "minicraft.settings.size": "Taille du monde", + "minicraft.settings.theme": "Thème du monde", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.forest": "Forêt", + "minicraft.settings.theme.desert": "Désert", + "minicraft.settings.theme.plain": "Plaine", + "minicraft.settings.theme.hell": "Enfer", + "minicraft.settings.type": "Type de Terrain", + "minicraft.settings.type.island": "Îles", + "minicraft.settings.type.box": "Boîte", + "minicraft.settings.type.mountain": "Montagne", + "minicraft.settings.type.irregular": "Irrégulier", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul avec cape", + "minicraft.skin.minecraft_steve": "Garçon familier", + "minicraft.skin.minecraft_alex": "Fille familière", + "minicraft.text_particales.key_consumed": "-1 clé", + "Death Chest": "Coffre de la Mort", "Player": "Joueur", - "Crafting": "Crafting", - "Set your home!": "Place ta maison!", - "Can't set home here!": "Tu ne peux pas placer de maison ici!", - "Home Sweet Home!": "Home Sweet Home!", - "Mode penalty: -2 health": "Mode penalty: -2 vies", - "You don't have a home!": "Tu n'as pas de maison!", - "You can't go home from here!": "Tu ne peux pas rentrez chez toi depuis ici!", "Leather Armor": "Armure en Cuir", - "Snake Armor": "Armure en Serpent", + "Snake Armor": "Armure de Serpent", "Iron Armor": "Armure en Fer", "Gold Armor": "Armure en Or", "Gem Armor": "Armure en Gemme", "Book": "Livre", "Antidious": "Antidious", - "Empty Bucket": "Seau Vide", - "Water Bucket": "Seau d'Eau", - "Lava Bucket": "Seau de Lave", - " Bucket": " Seau", - "Red Clothes": "Vetements Rouge", - "Blue Clothes": "Vetements Bleu", - "Green Clothes": "Vetements Vert", - "Yellow Clothes": "Vetements Jaune", - "Black Clothes": "Vetements Noir", - "Orange Clothes": "Vetements Orange", - "Purple Clothes": "Vetements Violet", - "Cyan Clothes": "Vetements Cyan", - "Reg Clothes": "Vetements de Chifons", + "Empty Bucket": "Seau vide", + "Water Bucket": "Seau d'eau", + "Lava Bucket": "Seau de lave", + "Red Clothes": "Vêtements rouges", + "Blue Clothes": "Vêtements bleus", + "Green Clothes": "Vêtements verts", + "Yellow Clothes": "Vêtements jaunes", + "Black Clothes": "Vêtements noirs", + "Orange Clothes": "Vêtements oranges", + "Purple Clothes": "Vêtements violets", + "Cyan Clothes": "Vêtements cyans", + "Reg Clothes": "Guenilles", "Bread": "Pain", "Apple": "Pomme", - "Raw Pork": "Cochon Cru", - "Raw Fish": "Poisson Cru", - "Raw Beef": "Beuf Cru", - "Pork Chop": "Cotelette", - "Cooked Fish": "Poisson Fume", - "Cooked Pork": "Cochon Cuit", + "Raw Pork": "Porc cru", + "Raw Fish": "Poisson cru", + "Raw Beef": "Bœuf cru", + "Pork Chop": "Côtelette de porc", + "Cooked Fish": "Poisson cuit", + "Cooked Pork": "Côtelette de porc cuite", "Steak": "Steak", "Gold Apple": "Pomme d'Or", - "Cow Spawner": "Generateur a Vaches", - "Pig Spawner": "Generateur a Cochons", - "Sheep Spawner": "Generateur a Moutons", - "Slime Spawner": "Generateur a Slime", - "Zombie Spawner": "Generateur a Zombie", - "Creeper Spawner": "Generateur a Creeper", - "Skeleton Spawner": "Generateur a Squelettes", - "Snake Spawner": "Generateur a Serpents", - "Knight Spawner": "Generateur a Chevalier", - "AirWizard Spawner": "Generateur a Sorciers des Airs ", - "Workbench": "Atelier", + "Baked Potato": "Patate cuite", + "Cow Spawner": "Générateur de vaches", + "Pig Spawner": "Générateur de cochons", + "Sheep Spawner": "Générateur de moutons", + "Slime Spawner": "Générateur de slimes", + "Zombie Spawner": "Générateur de zombies", + "Creeper Spawner": "Générateur de creepers", + "Skeleton Spawner": "Générateur de squelettes", + "Snake Spawner": "Générateur de serpents", + "Knight Spawner": "Générateur de chevaliers", + "AirWizard Spawner": "Générateur de sorciers de l'Air ", + "Workbench": "Établi", "Oven": "Four", "Furnace": "Fourneau", "Anvil": "Enclume", "Enchanter": "Enchanteur", - "Loom": "Metier a Tisser", + "Loom": "Métier à tisser", "Lantern": "Lanterne", - "Iron Lantern": "Lanterne en Fer", - "Gold Lantern": "Lanterne en Or", - "Tnt": "Tnt", + "Iron Lantern": "Lanterne en fer", + "Gold Lantern": "Lanterne en or", + "Tnt": "TNT", "Bed": "Lit", "Chest": "Coffre", - "None Potion": "Potion Nulle", - "Speed Potion": "Potion de Vitesse", - "Light Potion": "Potion de Phosphorescence", - "Swim Potion": "Potion de Nage", - "Energy Potion": "Potion Energetique", - "Regen Potion": "Potion de Regeneration", - "Health Potion": "Potion de Vitalite.", - "Time Potion": "Potion de Temps", - "Lava Potion": "Potion de Lave", - "Shield Potion": "Potion de Bouclier", - "Haste Potion": "Potion de Hate", + "None Potion": "Potion nulle", + "Speed Potion": "Potion de vitesse", + "Light Potion": "Potion de lumière", + "Swim Potion": "Potion de nage", + "Energy Potion": "Potion d'énergie", + "Regen Potion": "Potion de régénération", + "Health Potion": "Potion de soin", + "Time Potion": "Potion de temps", + "Lava Potion": "Potion de résistance à la lave", + "Shield Potion": "Potion de bouclier", + "Haste Potion": "Potion de hâte", + "Escape Potion": "Potion d'échappement", "Potion": "Potion", - "Power Glove": "Gant de Force", + "Power Glove": "Gant de force", "Wood": "Bois", "Stone": "Pierre", "Leather": "Cuir", - "Wheat": "Ble", - "Key": "Cle", - "Arrow": "Fleche", - "String": "Fil", + "Wheat": "Blé", + "Key": "Clé", "Coal": "Charbon", - "Iron Ore": "Minerai de Fer", - "Lapis": "Lapis", - "Gold Ore": "Minerai d'Or", + "Iron Ore": "Minerai de fer", + "Gold Ore": "Minerai d'or", + "Gem Ore": "Minerai de gemme", + "Cloud Ore": "Minerai de nuage", "Iron": "Fer", "Gold": "Or", + "Lapis": "Lapis", "Rose": "Rose", - "GunPowder": "PoudreACanon", + "GunPowder": "Poudre noire", "Slime": "Slime", - "Glass": "Verre", - "Cloth": "Chiffon", - "Scale": "Echelle", + "Scale": "Écaille", "Shard": "Tesson", "Flower": "Fleur", "Acorn": "Gland", "Dirt": "Terre", "Natural Rock": "Roche naturelle", "Plank": "Planche", - "Plank Wall": "Mur De Planches", - "Wood Door": "Porte en Bois", - "Stone Brick": "Brique de Pierre", + "Plank Wall": "Mur de planches", + "Wood Door": "Porte en bois", + "Stone Brick": "Brique de pierre", "Ornate Stone": "Pierre ornée", - "Stone Wall": "Mur de Pierre", - "Stone Door": "Porte de Pierre", - "Obsidian Brick": "Brique d'Obsidienne", + "Stone Wall": "Mur de pierre", + "Stone Door": "Porte en pierre", + "Obsidian Brick": "Brique d'obsidienne", "Ornate Obsidian": "Obsidienne ornée", - "Obsidian Wall": "Mur d'Obsidienne", - "Obsidian Door": "Porte d'Obsidienne", + "Obsidian Wall": "Mur d'obsidienne", + "Obsidian Door": "Porte en obsidienne", "Wool": "Laine", - "Red Wool": "Laine Rouge", - "Blue Wool": "Laine Bleue", - "Green Wool": "Laine Verte", - "Yellow Wool": "Laine Jaune", - "Black Wool": "Laine Noire", + "Red Wool": "Laine rouge", + "Blue Wool": "Laine bleue", + "Green Wool": "Laine verte", + "Yellow Wool": "Laine jaune", + "Black Wool": "Laine noire", "Sand": "Sable", "Cactus": "Cactus", - "Wheat Seeds": "Graines de blé", "Seeds": "Graines", - "Grass Seeds": "Graines d'Herbe", + "Wheat Seeds": "Graines de blé", + "Grass Seeds": "Graines d'herbe", "Bone": "Os", "Cloud": "Nuage", "Rock": "Roche", "Gem": "Gemme", + "Potato": "Patate", "Wood Fishing Rod": "Canne à pêche en bois", "Iron Fishing Rod": "Canne à pêche en fer", "Gold Fishing Rod": "Canne à pêche en or", - "Gem Fishing Rod": "Canne à pêche Gem", + "Gem Fishing Rod": "Canne à pêche en gemme", "Shovel": "Pelle", "Hoe": "Houe", - "Sword": "Epee", + "Sword": "Épée", "Pickaxe": "Pioche", "Axe": "Hache", "Bow": "Arc", - "Claymore": "Argile", + "Claymore": "Claymore", "Shears": "Ciseaux", "Torch": "Torche", - "Gem Ore": "Minerai de Gemme", - "Wood Planks": "Planches de Bois", - "Stone Bricks": "Briques de Pierre", + "Wood Planks": "Planches de bois", + "Stone Bricks": "Briques de pierre", "Obsidian": "Obsidienne", - "Wood Wall": "Mur de Bois", + "Wood Wall": "Mur de bois", "Grass": "Herbe", "Hole": "Trou", - "Stairs Up": "Escaliers Montants", - "Stairs Down": "Escaliers Descendants", + "Stairs Up": "Monter l'escalier", + "Stairs Down": "Descendre l'escalier", "Water": "Eau", "Tree": "Arbre", - "Tree Sapling": "Arbrisseau", - "Cactus Sapling": "Pousse de Cactus", + "Tree Sapling": "Pousse d'arbre", + "Cactus Sapling": "Pousse de cactus", "Lava": "Lave", - "Lava Brick": "Brique de Lave", + "Lava Brick": "Brique de lave", "Explode": "Exploser", - "Farmland": "Terre Agricole", - "Hard Rock": "Roche Dure", - "Infinite Fall": "Chute Infinie", - "Cloud Cactus": "Cactus Nuage", - "Ore": "Minerai", - "host not found": "hote non trouve", - "unable to get localhost address": "incapable d'avoir l'adresse locale", - "World Saved!": "Monde sauvé!", - "On": "Marche", - "Off": "Arret", - "There is nothing of use here.": "Il n'y a rien d'utile ici.", - "Still nothing... :P": "Toujours rien... :P", - "Have:": "A:", - "Cost:": "Coute:", - "Time: ": "Temps:", - "Score: ": "Score: ", - "Quit": "Quitter", - "Respawn": "Reapparaitre", - "You died! Aww!": "Tu es mort! Aww!", - "With the default controls...\\n\\nMove your character with arrow keys or WSAD. Press C to attack and X to open the inventory, and to use items. Select an item in the inventory to equip it.\\n\\nKill the air wizard to win the game!": "Avec les controles par defaut...\\n\\nBougez votre avatar avec les fleches ou WSAD. Appuyez sur C pour attaquer et X pour ouvrir l'inventaire, et utiliser des objets. Choisissez un objet de l'inventaire pour l'equiper.\\n\\nTuez le sorcier des airs pour gagner!", - "Player Score: ": "Score du Joueur: ", - "": "", - "Final Score: ": "Score Final: ", - "Exit to Menu": "Retour au Menu", - "Time Played: ": "Temps Joue: ", - "Current Score: ": "Score Actuel: ", - "Exit": "Retour", - "Player Stats": "Stats du Joueur", - "Controls": "Controles", - "Press the desired": "Appuiez sur la", - "key sequence": "suite de touches desire", - "minicraft.display.key_input.confirm_popup": "Etes vous sur que vous voulez remettre toute les touches par defaut?", - "minicraft.display.popup.enter_confirm": "Entree pour confirmer", - "minicraft.display.popup.escape_cancel": "Echap pour annuler", - "Confirm Action": "Confirmer l'Action", - "Press C/Enter to change key binding": "Appuyez sur C/Entree pour changer la touche", - "Press A to add key binding": "Appuyez sur A pour ajouter un touche", - "Shift-D to reset all keys to default": "Maj-D pour remettre les touches par defaut.", - "ESCAPE to Return to menu": "Echap pour retourner au menu", - "Loading": "Chargement", - "waiting": "attente", - "nothing": "rien", - "attempting log in": "tentative de connection", - "no internet connection, but no login data saved; cannot enter offline mode.": "pas de connection internet, mais pas de d'identifiant enregiste; on ne peut entre en mode hors-ligne.", - "connecting to server": "connection au serveur", - "logging in": "identification", - "saving credentials": "enregistrement de l'identite", - "login failed.": "indentification rate", - "problem with saved login data; please exit and login again.": "probleme avec l'identifiant enregistre", - "Internal server error: Couldn't fetch username from uuid": "Erreur du serveur interne: Ne peut recuperer le pseudo depuis l'uuid", - "logged in as: ": "connecte en tant que:", - "offline mode: local servers only": "mode hors-ligne: serveurs locaux seulement", - "Enter ip address to connect to:": "Entrez l'adresse ip a qui se connecter:", - "Press Shift-Escape to logout": "Appuyez sur Maj-Echap pour vous deconnecter", - "Enter email:": "Entrez votre email", - "Enter password:": "Entrez votre mot de passe", - "field is blank": "champ de texte vide", - "get an account at:": "obtenez un compte sur:", - "Loading ": "Chargement ", - " from server": " depuis le serveur", - "Could not connect to server:": "N'a pas pu se connecter au serveur:", - "Press ": "Appuyez", - " to return": " pour revenir", - "Change Key Bindings": "Modifier les Touches", - "Options": "Options", - "Change language": "Changer de langue", - "Return to Game": "Retourner au Jeu", - "Make World Multiplayer": "Rendre le Monde Jouable en Multijoueur", - "Save Game": "Sauvegarder", - " and ": " et", - " to Scroll": " pour Defiler", - ": Choose": ": Choisissez", - "Paused": "Pause", - "Main Menu": "Menu Principal", - "Inventory": "Inventaire", - "to search.": "à rechercher.", - "Play": "Jouer", - "Load World": "Charger un Monde", - "New World": "Creer un Monde", - "Multiplayer": "Joindre un Monde en Ligne", - "Singleplayer": "Jeu solo", - "Help": "Aide", - "Instructions": "Instructions", - "Storyline Guide": "Guide d'Histoire", - "About": "A Propos", - "Credits": "Crédits", - " to select": " pour choisir", - " to accept": " pour accepter", - "New World Name:": "Nom du Monde:", - "Are you sure you want to delete": "Etes vous sur de vouloir effacer", - "This can not be undone!": "Ceci ne peut etre annule!", - " to confirm": " pour confirmer", - " to cancel": " pour annuler", - "World Seed": "Graine du Monde", - "Enter World Name": "Entrez le Nom du Monde", - "Trouble with world name?": "Un probleme avec le nom du monde?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "par defaut, w et s bougent le curseur de haut en bas. Ceci peut etre change dans le menu de changement des touches. Pour taper la lette au lieu de bouger le curseur, maintenez le bouton Maj pendant que vous tapez le nom du monde.", - "Create World": "Creer le Monde", - "World Gen Options": "Options de Generation", - " to Copy": " à Copier", - " to Rename": " à Renommer", - " to Delete": " à Effacer", - "Select World": "Choisir un Monde", - "Select a World to Delete": "Choisissez un Monde pour Effacer", - "Select a World to Rename": "Choisissez un Monde pour Renommer", - "Select a World to Copy": "Choisissez un Monde pour Copier", - "Higher version, cannot load world!": "Version supérieure, ne peut pas charger le monde!", - "World Version:": "Version monde:", - "Languages": "Languages", - "Language": "Language", - "Select": "Selectionner", - "Max FPS": "FPS Max", - "Difficulty": "Difficulte", - "Easy": "Facile", - "Normal": "Normal", - "Hard": "Difficile", - "Game Mode": "Mode de Jeu", - "Survival": "Survie", - "Creative": "Creatif", - "Hardcore": "Hardcore", - "Score": "Score", - "Time (Score Mode)": "Temps (Mode Score)", - "Sound": "Son", - "Autosave": "Sauvegarde Auto", - "World Size": "Taille du Monde", - "World Theme": "Theme du Monde", - "Forest": "Foret", - "Desert": "Desert", - "Plain": "Plaines", - "Hell": "Enfer", - "Terrain Type": "Type de Terrain", - "Island": "Ile", - "Box": "Boite", - "Mountain": "Montagne", - "Irregular": "Irregulier", - "Wear Suit": "Porter Combinaison", - "You have the latest version.": "Vous avez la dernière version.", - "minicraft.display.skin": "Skins", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul avec cape", - "minicraft.skin.minecraft_steve": "Garçon familier", - "minicraft.skin.minecraft_alex": "Fille familière", - "minicraft.notification.invalid_placement": "Ne peut être placé que sur", - "minicraft.notification.dig_hole": "Creusez d'abord un trou!" + "Farmland": "Terre labourée", + "Hard Rock": "Roche dure", + "Infinite Fall": "Chute infinie", + "Cloud Cactus": "Cactus des nuages", + "Raw Obsidian": "Obsidienne brute", + "Totem of Air": "Totem de l'Air", + "minicraft.control_guide.attack": "Utilisez %s pour attaquer les mobs ou détruire les entités", + "minicraft.control_guide.craft": "Utilisez %s pour ouvrir votre menu de fabrication", + "minicraft.control_guide.menu": "Utilisez %s pour ouvrir votre inventaire", + "minicraft.control_guide.move": "Utilisez %s pour bouger", + "minicraft.displays.controls": "Contrôles", + "minicraft.displays.controls.display.controller": "Manette", + "minicraft.displays.controls.display.controller.00": "Bouger le joueur en utilisant de le DPAD", + "minicraft.displays.controls.display.controller.01": "Bouger le curseur en utilisant le DPAD", + "minicraft.displays.controls.display.controller.02": "Pour sélectionner, appuyez sur le bouton A", + "minicraft.displays.controls.display.controller.03": "Pour annuler, appuyez sur le bouton B", + "minicraft.displays.controls.display.controller.04": "Pour attaquer des entités, détruire et interagir avec les tuiles, appuyez sur le bouton A", + "minicraft.displays.controls.display.controller.05": "Pour ouvrir les menus en jeu, appuyez sur le bouton X", + "minicraft.displays.controls.display.controller.06": "Pour ouvrir le menu de fabrication, appuyez sur le bouton Y", + "minicraft.displays.controls.display.controller.07": "Pour récupérer des meubles, appuyez sur le bouton LB", + "minicraft.displays.controls.display.controller.08": "Pour jeter un objet, appuyez sur le bouton RB", + "minicraft.displays.controls.display.controller.09": "Pour jeter un tas entier, appuyez sur le stick directionnel droit", + "minicraft.displays.controls.display.controller.10": "Pour activer/désactiver la barre de recherche dans les menus, appuyez sur START", + "minicraft.displays.controls.display.controller.11": "Pour mettre le jeu en pause, appuyez sur START", + "minicraft.displays.controls.display.controller.12": "Pour activer/désactiver le clavier virtuel, appuyez sur X", + "minicraft.displays.controls.display.controller.13": "Pour effacer un caractère sur le clavier virtuel, appuyez sur B", + "minicraft.displays.controls.display.controller.14": "Pour retirer un objet sélectionné de l'inventaire créatif, appuyez sur X", + "minicraft.displays.controls.display.controller.15": "Pour retirer un tas entier de l'inventaire créatif, appuyez sur Y", + "minicraft.displays.controls.display.controller.desc.0": "Les mappings de débogage sont inaccessibles", + "minicraft.displays.controls.display.controller.desc.1": "Les mappings détaillés sont inusables", + "minicraft.displays.controls.display.help.0": "%s/%s pour voir d'autres contrôles.", + "minicraft.displays.controls.display.keyboard": "Clavier", + "minicraft.displays.controls.display.keyboard.00": "Pour déplacer le joueur, utilisez MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Pour déplacer le cursor, utilisez CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Pour sélectionner des entrées, appuyez sur SELECT", + "minicraft.displays.controls.display.keyboard.03": "Pour sortir des pages, appuyez sur EXIT", + "minicraft.displays.controls.display.keyboard.04": "Pour la sauvegarde rapide, appuyez sur QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Attaquer des entités, détruire et interagir avec des tuiles utiliser ATTACK", + "minicraft.displays.controls.display.keyboard.06": "L'ouverture du Menu dans le jeu utiliser MENU", + "minicraft.displays.controls.display.keyboard.07": "L'ouverture des menus d'artisanat utiliser CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Ramasser des meubles utiliser PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Dropper 1 article utiliser DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Dropper une pile entière d'éléments utiliser DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Basculer la barre de recherche dans les menus d'éléments utilise SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Pour parcourir les résultats de la recherche, utilisez PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Pour mettre en pause le jeu, appuyez sur PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Pour activer/désactiver l'interface des effets de potions, appuyez sur POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Pour activer/désactiver l'interface simplifiée de potions, appuyez sur SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "L'affichage des quêtes en expansion temporaire dans le jeu utilise EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Pour activer/désactiver le HUD, appuyez sur TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Pour prendre une capture d'écran, appuyez sur SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Pour des informations sur la partie, appuyez sur INFO", + "minicraft.displays.controls.display.keyboard.20": "Pour le mode plein écran, appuyez sur FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Pour retirer un objet sélectionné de l'inventaire créatif, appuyez sur D", + "minicraft.displays.controls.display.keyboard.22": "Utilisez MAJ-D pour jeter un stack entier d'un item dans votre inventaire en créatif", + "minicraft.displays.controls.display.keyboard.desc": "Le Debug Mappings n'est pas expliqué", + "minicraft.displays.loading.message.dungeon_regeneration": "Régénération du B4", + "minicraft.displays.loading.message.quests": "Quêtes", + "minicraft.displays.loading.regeneration_popup.display.0": "L'ancienne version du donjon (étage B4) a été détecté.", + "minicraft.displays.loading.regeneration_popup.display.1": "Une régénération est nécessaire.", + "minicraft.displays.loading.regeneration_popup.display.2": "Les anciennes données de cet étage vont être effacer.", + "minicraft.displays.loading.regeneration_popup.display.3": "%s pour continuer", + "minicraft.displays.loading.regeneration_popup.display.4": "%s pour annuler le chargement du monde", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Chargement du monde annulé", + "minicraft.displays.quests.display.no_quest": "Aucune quête débloquée", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Seul les entrées par clavier sont acceptées", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Appuyez sur %s pour examiner les détails du tuto actuel.", + "minicraft.notification.obsidian_knight_defeated": "Chevalier d'Obsidienne: Battu!", + "minicraft.notification.obsidian_knight_awoken": "Le Chevalier d'Obsidienne est réveillé!", + "minicraft.notification.defeat_obsidian_knight_first": "Le Chevalier d'Obsidienne doit être battu avant.", + "minicraft.notification.wrong_level_dungeon": "Peut seulement être invoqué dans le donjon", + "minicraft.notification.boss_limit": "Plus aucun boss ne peut apparaître", + "minicraft.notification.spawn_on_boss_tile": "Peut seulement être invoqué dans la sale du boss", + "minicraft.notifications.statue_tapped": "Vous entendez des murmures en échos... ", + "minicraft.notifications.statue_touched": "Vous entendez la statue vibrer...", + "minicraft.quest.farming": "Fermier qui farm", + "minicraft.quest.farming.crafting_hoe": "Créez une Houe", + "minicraft.quest.farming.crafting_hoe.description": "Créez n'importe quelle houe depuis l'établi", + "minicraft.quest.farming.description": "Les bases pour être fermier.", + "minicraft.quest.farming.getting_wheat": "Récoltez du blé", + "minicraft.quest.farming.getting_wheat.description": "Récoltez du blé en cassant un plant de blé mûr.", + "minicraft.quest.farming.making_farmland": "Labourez la terre", + "minicraft.quest.farming.making_farmland.description": "Labourez la terre avec une houe.", + "minicraft.quest.farming.planting_potato": "Plantez une patate", + "minicraft.quest.farming.planting_potato.description": "Plantez une patate dans la terre labourée", + "minicraft.quest.farming.planting_wheat": "Plantez du blé", + "minicraft.quest.farming.planting_wheat.description": "Plantez du blé dans la terre labourée.", + "minicraft.quest.gems": "Route des gemmes", + "minicraft.quest.gems.description": "Obtenez de l'équipement en gemme.", + "minicraft.quest.gems.gem_armor": "Maître de la protection", + "minicraft.quest.gems.gem_armor.description": "Obtenez une armure en gemme.", + "minicraft.quest.gems.gem_claymore": "Maître d'armes", + "minicraft.quest.gems.gem_claymore.description": "Obtenez une claymore en gemme.", + "minicraft.quest.iron_equipments": "Maître du fer", + "minicraft.quest.iron_equipments.description": "Obtenez l'entièreté de l'équipement en fer.", + "minicraft.quest.iron_equipments.getting_more_iron": "Riche en fer", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Obtenez encore plus de fer.", + "minicraft.quest.iron_equipments.iron_armor": "Amélioration d'armure", + "minicraft.quest.iron_equipments.iron_armor.description": "Faites-vous une armure en fer.", + "minicraft.quest.iron_equipments.iron_tools": "Améliorer tous les outils", + "minicraft.quest.iron_equipments.iron_tools.description": "Faites-vous tous les outils en fer.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Meilleure pioche", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Améliorez votre pioche.", + "minicraft.quest.potions": "Maître des potions", + "minicraft.quest.potions.all_potions_prepared": "Chercheur en potions", + "minicraft.quest.potions.all_potions_prepared.description": "Buvez toutes les potions en même temps", + "minicraft.quest.potions.awkward_potions": "Potion étrange", + "minicraft.quest.potions.awkward_potions.description": "Obtenez une potion étrange.", + "minicraft.quest.potions.description": "Obtenez toutes les potions.", + "minicraft.quest.potions.powerful_potions": "Potions puissantes", + "minicraft.quest.potions.powerful_potions.description": "Obtenez les potions puissantes et utiles.", + "minicraft.tutorial.getting_rocks": "Récupérez de la pierre et du charbon", + "minicraft.tutorial.getting_rocks.description": "Avoir récupéré au moins 5 pierres et 5 charbons en cassant des roches avec la pioche.", + "minicraft.tutorial.getting_wood": "Prendre plus de bois", + "minicraft.tutorial.getting_wood.description": "Avoir récupéré au moins 10 bois en coupant des arbres.", + "minicraft.tutorial.getting_wooden_pickaxe": "Obtenez une pioche en bois", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Fabriquez une pioche en bois dans un établi.", + "minicraft.tutorial.getting_workbench": "Obtenir un établi", + "minicraft.tutorial.getting_workbench.description": "Construisez un établi depuis le menu de fabrication. Placez-le juste après.", + "minicraft.tutorial.start_getting_wood": "Le commencement", + "minicraft.tutorial.start_getting_wood.description": "Frapper des arbres en continu pour avoir du bois.", + "minicraft.display.options_display.language": "Langue", + "minicraft.display.options_display.resource_packs": "Packs de ressources", + "minicraft.displays.language_settings.title": "Langue...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Fleche", + "String": "Fil", + "Glass": "Verre", + "Cloth": "Chiffon" } diff --git a/src/client/resources/assets/localization/hu-hu.json b/src/client/resources/assets/localization/hu-hu.json index 3a703b917..5491e7f75 100644 --- a/src/client/resources/assets/localization/hu-hu.json +++ b/src/client/resources/assets/localization/hu-hu.json @@ -31,28 +31,171 @@ "minicraft.achievement.airwizard.desc": "Győzd le az első légvarázslót!", "minicraft.achievement.skin": "Divatbemutató", "minicraft.achievement.skin.desc": "Változtassa meg a bőrét.", - "minicraft.display.achievement": "Eredmények", - "minicraft.display.achievement.achieved": "Elérve!", - "minicraft.display.achievement.not_achieved": "Nem teljesült", - "minicraft.display.achievement.score": "Teljesítmény pontszám:", + "minicraft.display.entries.boolean.false": "", + "minicraft.display.entries.boolean.true": "", + "minicraft.display.gui.link_opening": "", + "minicraft.display.gui.perm_status.saving": "", + "minicraft.display.gui.perm_status.sleep_cancel": "", + "minicraft.display.gui.perm_status.sleeping": "", + "minicraft.display.gui.potion_effects.hide_hint": "", + "minicraft.display.gui.potion_effects.potion_dur": "", + "minicraft.display.gui.score.current_score": "", + "minicraft.display.gui.score.time_left": "", + "minicraft.display.menus.inventory": "", + "minicraft.display.options_display": "", + "minicraft.display.options_display.change_key_bindings": "", + "minicraft.display.popup.enter_confirm": "Enter ha jó", + "minicraft.display.popup.escape_cancel": "Escape a visszamenéshez", + "minicraft.display.popup.title_confirm": "", + "minicraft.displays.achievements": "", + "minicraft.displays.achievements.display.achieved": "", + "minicraft.displays.achievements.display.help": "", + "minicraft.displays.achievements.display.not_achieved": "", + "minicraft.displays.achievements.display.score": "", + "minicraft.displays.book.default_book": "", + "minicraft.displays.crafting": "", + "minicraft.displays.crafting.container_title.cost": "", + "minicraft.displays.crafting.container_title.have": "", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "", + "minicraft.displays.end_game.display.player_score": "", + "minicraft.displays.end_game.display.unlocked": "", + "minicraft.displays.end_game.exit": "", + "minicraft.displays.info.display.exit_help": "", + "minicraft.displays.info.display.score": "", + "minicraft.displays.info.display.time": "", + "minicraft.displays.info.title": "", + "minicraft.displays.key_input.display.help.0": "", + "minicraft.displays.key_input.display.help.1": "", + "minicraft.displays.key_input.display.help.2": "", + "minicraft.displays.key_input.display.help.3": "", + "minicraft.displays.key_input.popup_display.confirm_reset": "", + "minicraft.displays.key_input.popup_display.press_key_sequence": "", + "minicraft.displays.key_input.title": "", + "minicraft.displays.loading.message.entities": "", + "minicraft.displays.loading.message.generating": "", + "minicraft.displays.loading.message.level": "", + "minicraft.displays.loading.message.levels": "", + "minicraft.displays.loading.message.loading": "", + "minicraft.displays.loading.message.saving": "", + "minicraft.displays.loading.message.world": "", + "minicraft.displays.options_main_menu": "", + "minicraft.displays.options_main_menu.resource_packs": "", + "minicraft.displays.options_world": "", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "", + "minicraft.displays.options_world.turn_off_tutorials": "", + "minicraft.displays.pause": "", + "minicraft.displays.pause.display.exit_popup.0": "", + "minicraft.displays.pause.display.exit_popup.1": "", + "minicraft.displays.pause.display.exit_popup.cancel": "", + "minicraft.displays.pause.display.exit_popup.quit": "", + "minicraft.displays.pause.display.help.choose": "", + "minicraft.displays.pause.display.help.scroll": "", + "minicraft.displays.pause.menu": "", + "minicraft.displays.pause.return": "", + "minicraft.displays.pause.save": "", + "minicraft.displays.player_death.display.score": "", + "minicraft.displays.player_death.display.time": "", + "minicraft.displays.player_death.quit": "", + "minicraft.displays.player_death.respawn": "", + "minicraft.displays.player_death.save_quit": "", + "minicraft.displays.player_death.title": "", + "minicraft.displays.player_inv.container_title.items": "", + "minicraft.displays.player_inv.display.help": "", + "minicraft.displays.quests": "", + "minicraft.displays.quests.display.header.completed": "", + "minicraft.displays.quests.display.header.unlocked": "", + "minicraft.displays.quests.display.no_quest_desc": "", + "minicraft.displays.resource_packs.display.help.move": "", + "minicraft.displays.resource_packs.display.help.select": "", + "minicraft.displays.resource_packs.display.help.position": "", + "minicraft.displays.resource_packs.display.title": "", + "minicraft.displays.skin": "", + "minicraft.displays.skin.display.help.move": "", + "minicraft.displays.skin.display.help.select": "", + "minicraft.displays.title.display.cannot_check": "", + "minicraft.displays.title.display.checking": "", + "minicraft.displays.title.display.help.0": "", + "minicraft.displays.title.display.help.1": "", + "minicraft.displays.title.display.help.2": "", + "minicraft.displays.title.display.latest_already": "", + "minicraft.displays.title.display.new_version": "", + "minicraft.displays.title.display.version": "", + "minicraft.displays.title.help": "", + "minicraft.displays.title.help.about": "", + "minicraft.displays.title.help.credits": "", + "minicraft.displays.title.help.instructions": "", + "minicraft.displays.title.help.storyline_guide": "", + "minicraft.displays.title.link_to_version": "", + "minicraft.displays.title.play": "", + "minicraft.displays.title.play.load_world": "", + "minicraft.displays.title.play.new_world": "", + "minicraft.displays.title.quit": "", + "minicraft.displays.title.select_to_download": "", + "minicraft.displays.world_gen.create_world": "", + "minicraft.displays.world_gen.enter_world": "", + "minicraft.displays.world_gen.title": "", + "minicraft.displays.world_gen.troublesome_input": "", + "minicraft.displays.world_gen.troublesome_input.msg": "", + "minicraft.displays.world_gen.world_seed": "", + "minicraft.displays.world_select.display.help.0": "", + "minicraft.displays.world_select.display.help.1": "", + "minicraft.displays.world_select.display.help.2": "", + "minicraft.displays.world_select.display.help.3": "", + "minicraft.displays.world_select.display.help.4": "", + "minicraft.displays.world_select.display.world_too_new": "", + "minicraft.displays.world_select.display.world_version": "", + "minicraft.displays.world_select.popups.display.cancel": "", + "minicraft.displays.world_select.popups.display.change": "", + "minicraft.displays.world_select.popups.display.confirm": "", + "minicraft.displays.world_select.popups.display.delete": "", + "minicraft.displays.world_select.select_world": "", "minicraft.notification.achievement_unlocked": "Elérés feloldva:", - "Entities": "Jogalanyok", - "Air Wizard: Defeated!": "Megölted a levegővarázslót!", - "The Dungeon is now open!": "A Dungeon ki van nyitva!", - "A costume lies on the ground...": "Egy jelmez van a földön...", - "Can't sleep!": "Nem tudsz aludni!", - "Min ": "Perc ", - " Sec left!": " Másodperc van hátra!", - "You hear a noise from the surface!": "Hallasz egy zajot felülről...", + "minicraft.notification.air_wizard_defeated": "", + "minicraft.notification.cannot_sleep": "", + "minicraft.notification.death_chest_retrieved": "", + "minicraft.notification.defeat_air_wizard_first": "", + "minicraft.notification.dig_hole": "Először áss egy gödröt!", + "minicraft.notification.dungeon_opened": "", + "minicraft.notification.gem_pickaxe_required": "", + "minicraft.notification.invalid_placement": "Csak a következőkre helyezhető el", + "minicraft.notification.quest_completed": "", + "minicraft.notification.quest_unlocked": "", + "minicraft.notification.world_saved": "", + "minicraft.notification.wrong_level_sky": "", + "minicraft.settings.fps": "", + "minicraft.settings.difficulty": "", + "minicraft.settings.difficulty.easy": "", + "minicraft.settings.difficulty.normal": "", + "minicraft.settings.difficulty.hard": "", + "minicraft.settings.mode": "", + "minicraft.settings.mode.survival": "", + "minicraft.settings.mode.creative": "", + "minicraft.settings.mode.hardcore": "", + "minicraft.settings.mode.score": "", + "minicraft.settings.scoretime": "", + "minicraft.settings.screenshot_scale": "", + "minicraft.settings.sound": "", + "minicraft.settings.autosave": "", + "minicraft.settings.size": "", + "minicraft.settings.theme": "", + "minicraft.settings.theme.normal": "", + "minicraft.settings.theme.forest": "", + "minicraft.settings.theme.desert": "", + "minicraft.settings.theme.plain": "", + "minicraft.settings.theme.hell": "", + "minicraft.settings.type": "", + "minicraft.settings.type.island": "", + "minicraft.settings.type.box": "", + "minicraft.settings.type.mountain": "", + "minicraft.settings.type.irregular": "", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul with cape", + "minicraft.skin.minecraft_steve": "Familiar boy", + "minicraft.skin.minecraft_alex": "Familiar girl", + "minicraft.text_particales.key_consumed": "", "Death Chest": "Halálláda", "Player": "Játékos", - "Crafting": "Barkácsolás", - "Set your home!": "Megjelölted az otthonodat!", - "Can't set home here!": "Nem tudsz otthont jelölni itt!", - "Home Sweet Home!": "Otthon, édes otthon!", - "Mode penalty: -2 health": "Mód büntetés: -2 élet", - "You don't have a home!": "Nincs otthonod!", - "You can't go home from here!": "Nem tudsz innen haza menni!", "Leather Armor": "Bőrpáncél", "Snake Armor": "Kígyópáncél", "Iron Armor": "Vaspáncél", @@ -63,7 +206,6 @@ "Empty Bucket": "Üres vödör", "Water Bucket": "Vizesvödör", "Lava Bucket": "Lávásvödör", - " Bucket": " Vödör", "Red Clothes": "Piros ruha", "Blue Clothes": "Kék ruha", "Green Clothes": "Zöld ruha", @@ -125,19 +267,17 @@ "Leather": "Bőr", "Wheat": "Búza", "Key": "Kulcs", - "Arrow": "Nyíl", - "String": "Fonál", "Coal": "Szén", "Iron Ore": "Vasérc", - "Lapis": "Lazurit", "Gold Ore": "Aranyérc", + "Gem Ore": "Kristályérc", + "Cloud Ore": "", "Iron": "Vas", "Gold": "Arany", + "Lapis": "Lazurit", "Rose": "Rózsa", "GunPowder": "Puskapor", "Slime": "Nyálka", - "Glass": "Üveg", - "Cloth": "Szövet", "Scale": "Pikkely", "Shard": "Szilánk", "Flower": "Virág", @@ -184,7 +324,6 @@ "Claymore": "Nagykard", "Shears": "olló", "Torch": "Fáklya", - "Gem Ore": "Kristályérc", "Wood Planks": "Fadeszka", "Stone Bricks": "Kőtégla", "Obsidian": "Obszidián", @@ -204,147 +343,131 @@ "Hard Rock": "Nehéz kő", "Infinite Fall": "Végtelen esés", "Cloud Cactus": "Felhőkaktusz", - "Ore": "Érc", - "host not found": "gazda nem található", - "unable to get localhost address": "nem lehet localhost címjét megkapni", - "World Saved!": "A világ megmenekült!", - "On": "Be", - "Off": "Ki", - "There is nothing of use here.": "Itt nincs semmi hasznos.", - "Still nothing... :P": "Még mindig semmi... :)", - "Have:": "Van:", - "Cost:": "Ár:", - "Time: ": "Idő: ", - "Score: ": "Pont: ", - "Quit": "Kilépés", - "Respawn": "Újraéledés", - "You died! Aww!": "Meghaltál%", - "Player Score: ": "Pontok: ", - "": "", - "Final Score: ": "Utolsó pont: ", - "Exit to Menu": "Kilépés a menűre", - "Time Played: ": "Játékidő: ", - "Current Score: ": "Jelenlegi pont: ", - "Exit": "Kilépés", - "Player Stats": "Statisztikák", - "Controls": "Irányítások", - "Press the desired": "Nyomd meg egy", - "key sequence": "billentyűkombinációt", - "minicraft.display.key_input.confirm_popup": "Akarod az öszzes irányítást az alapra újrakezdeni?", - "minicraft.display.popup.enter_confirm": "Enter ha jó", - "minicraft.display.popup.escape_cancel": "Escape a visszamenéshez", - "Confirm Action": "Akció végzése", - "Press C/Enter to change key binding": "Nyomd meg a C-t/Entert hogy a billentyűt változtasd", - "Press A to add key binding": "A-val billentyt adsz hozzá", - "Shift-D to reset all keys to default": "Shift-D-vel alapra állítod a billentyűket", - "ESCAPE to Return to menu": "Escape-pel visszamész a menűre", - "Loading": "Világ", - "Generating": "Generálás", - "World": "Betöltése", - "waiting...": "várakozás...", - "nothing": "semmi", - "attempting log in": "bejelentkezés probálkozás", - "no internet connection, but no login data saved; cannot enter offline mode.": "nincs internet, és nincs bejelentkezési adat mentve; nem lehet offline módra lépni.", - "connecting to server": "csatlakozás a szerverre", - "logging in": "bejelentkezés", - "saving credentials": "bejelentkezésadat mentése", - "login failed.": "bejelentkezés hibásul készült el.", - "problem with saved login data; please exit and login again.": "probléma a mentett adattal: lépj ki és jelentkezz be újra.", - "Internal server error: Couldn't fetch username from uuid": "Belső szerverhiba: Nem lehetett felhasználónevet kapni uuid-től", - "logged in as: ": "ezként bejelentkezve: ", - "offline mode: local servers only": "offline mód: csak közeli server", - "Enter ip address to connect to:": "Írj be egy IP-t hogy csatlakozz:", - "Press Shift-Escape to logout": "Nyomd meg a Shift+Escape-t hogy jelentkezz ki", - "Enter email:": "Írd be az emailedet:", - "Enter password:": "Írd be a jelszavadat:", - "field is blank": "szövegdoboz üres", - "get an account at:": "itt szerezz fiókot:", - "Loading ": "Betöltés ", - " from server": " a szerverről", - "Could not connect to server:": "Nem lehetett szerverhez csatlakozni:", - "Press ": "Nyomd ezd: ", - " to return": " hogy menj vissza", - "Change Key Bindings": "Billentyűk változtatása", - "Options": "Beállítások", - "Change language": "Nyelv változtatása", - "Return to Game": "Folytatás", - "Make World Multiplayer": "Világ többjátékossá készítése", - "Save Game": "Mentés", - " and ": " és ", - " to Scroll": " hogy görgess", - ": Choose": ": Válassz", - "Paused": "Szünet", - "Main Menu": "Menű", - "Yes": "Igen", - "No": "Nem", - "Inventory": "Leltár", - "to search.": "keresni.", - "Play": "Indítás", - "Load World": "Világ betöltése", - "New World": "Új világ", - "Multiplayer": "Többjátékos", - "Singleplayer": "Egyjátékos", - "Help": "Segítség", - "Instructions": "Játékleírás", - "Storyline Guide (for the weak)": "Játéksztori", - "About": "Névjegy", - "Credits": "Hitelek", - " to select": " hogy válassz", - " to accept": " ha jó", - "New World Name:": "Új világnév:", - "Are you sure you want to delete": "Akarod törölni", - "This can not be undone!": "Ézt nem lehet visszatenni!", - " to confirm": " ha jó", - " to cancel": " hogy menj vissza", - "World Seed": "Világmag", - "Enter World Name": "Világ neve", - "Trouble with world name?": "Nehezen tudsz tudsz nevet adni?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "Alapból, a W és S a választásot mozgatja. Ez a billentyűmenűben válzoztatható. Hogy a betűt írd és ne mozgasz a választásot, tartsd le a Shift billentyűt míg írsz.", - "Create World": "Világ létrehozása", - "World Gen Options": "Generálásbeállítások", - " to Copy": " a Másolás", - " to Rename": " a Átnevezés", - " to Delete": " a Törlés", - "Select World": "Világválasztás", - "Select a World to Delete": "Törlendő világ kiválasztása", - "Select a World to Rename": "Válasszon ki egy világot az átnevezéshez", - "Select a World to Copy": "Másolandó világ kiválasztása", - "Higher version, cannot load world!": "Magasabb verzió, nem lehet betölteni a világot!", - "World Version:": "Világverzió:", - "Languages": "Nyelvek", - "Language": "Nyelv", - "Select": "Választás", - "Max FPS": "Maximum képkockasebesség", - "Difficulty": "Nehézség", - "Easy": "Könnyű", - "Normal": "Normális", - "Hard": "Nehés", - "Game Mode": "Játékmód", - "Survival": "Túlélő", - "Creative": "Kreatív", - "Hardcore": "Hardcore", - "Score": "Pont", - "Time (Score Mode)": "Idő ellen (Pont mód)", - "Sound": "Hang", - "Autosave": "Automatikus mentés", - "World Size": "Világméret", - "World Theme": "Világtéma", - "Forest": "Erdő", - "Desert": "Sivatag", - "Plain": "Sima", - "Hell": "Pokol", - "Terrain Type": "Domborzatféle", - "Island": "Sziget", - "Box": "Doboz", - "Mountain": "Hegy", - "Irregular": "Szabálytalan", - "Wear Suit": "Ruha viselése", - "You have the latest version.": "Önnek a legújabb verziója van.", - "minicraft.display.skin": "Skins", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul with cape", - "minicraft.skin.minecraft_steve": "Familiar boy", - "minicraft.skin.minecraft_alex": "Familiar girl", - "minicraft.notification.invalid_placement": "Csak a következőkre helyezhető el", - "minicraft.notification.dig_hole": "Először áss egy gödröt!" + "Raw Obsidian": "", + "Totem of Air": "", + "minicraft.control_guide.attack": "", + "minicraft.control_guide.craft": "", + "minicraft.control_guide.menu": "", + "minicraft.control_guide.move": "", + "minicraft.displays.controls": "", + "minicraft.displays.controls.display.controller": "", + "minicraft.displays.controls.display.controller.00": "", + "minicraft.displays.controls.display.controller.01": "", + "minicraft.displays.controls.display.controller.02": "", + "minicraft.displays.controls.display.controller.03": "", + "minicraft.displays.controls.display.controller.04": "", + "minicraft.displays.controls.display.controller.05": "", + "minicraft.displays.controls.display.controller.06": "", + "minicraft.displays.controls.display.controller.07": "", + "minicraft.displays.controls.display.controller.08": "", + "minicraft.displays.controls.display.controller.09": "", + "minicraft.displays.controls.display.controller.10": "", + "minicraft.displays.controls.display.controller.11": "", + "minicraft.displays.controls.display.controller.12": "", + "minicraft.displays.controls.display.controller.13": "", + "minicraft.displays.controls.display.controller.14": "", + "minicraft.displays.controls.display.controller.15": "", + "minicraft.displays.controls.display.controller.desc.0": "", + "minicraft.displays.controls.display.controller.desc.1": "", + "minicraft.displays.controls.display.help.0": "", + "minicraft.displays.controls.display.keyboard": "", + "minicraft.displays.controls.display.keyboard.00": "", + "minicraft.displays.controls.display.keyboard.01": "", + "minicraft.displays.controls.display.keyboard.02": "", + "minicraft.displays.controls.display.keyboard.03": "", + "minicraft.displays.controls.display.keyboard.04": "", + "minicraft.displays.controls.display.keyboard.05": "", + "minicraft.displays.controls.display.keyboard.06": "", + "minicraft.displays.controls.display.keyboard.07": "", + "minicraft.displays.controls.display.keyboard.08": "", + "minicraft.displays.controls.display.keyboard.09": "", + "minicraft.displays.controls.display.keyboard.10": "", + "minicraft.displays.controls.display.keyboard.11": "", + "minicraft.displays.controls.display.keyboard.12": "", + "minicraft.displays.controls.display.keyboard.13": "", + "minicraft.displays.controls.display.keyboard.14": "", + "minicraft.displays.controls.display.keyboard.15": "", + "minicraft.displays.controls.display.keyboard.16": "", + "minicraft.displays.controls.display.keyboard.17": "", + "minicraft.displays.controls.display.keyboard.18": "", + "minicraft.displays.controls.display.keyboard.19": "", + "minicraft.displays.controls.display.keyboard.20": "", + "minicraft.displays.controls.display.keyboard.21": "", + "minicraft.displays.controls.display.keyboard.22": "", + "minicraft.displays.controls.display.keyboard.desc": "", + "minicraft.displays.loading.message.dungeon_regeneration": "", + "minicraft.displays.loading.message.quests": "", + "minicraft.displays.loading.regeneration_popup.display.0": "", + "minicraft.displays.loading.regeneration_popup.display.1": "", + "minicraft.displays.loading.regeneration_popup.display.2": "", + "minicraft.displays.loading.regeneration_popup.display.3": "", + "minicraft.displays.loading.regeneration_popup.display.4": "", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "", + "minicraft.displays.quests.display.no_quest": "", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", + "minicraft.notification.obsidian_knight_defeated": "", + "minicraft.notification.obsidian_knight_awoken": "", + "minicraft.notification.defeat_obsidian_knight_first": "", + "minicraft.notification.wrong_level_dungeon": "", + "minicraft.notification.boss_limit": "", + "minicraft.notification.spawn_on_boss_tile": "", + "minicraft.notifications.statue_tapped": "", + "minicraft.notifications.statue_touched": "", + "minicraft.quest.farming": "", + "minicraft.quest.farming.crafting_hoe": "", + "minicraft.quest.farming.crafting_hoe.description": "", + "minicraft.quest.farming.description": "", + "minicraft.quest.farming.getting_wheat": "", + "minicraft.quest.farming.getting_wheat.description": "", + "minicraft.quest.farming.making_farmland": "", + "minicraft.quest.farming.making_farmland.description": "", + "minicraft.quest.farming.planting_potato": "", + "minicraft.quest.farming.planting_potato.description": "", + "minicraft.quest.farming.planting_wheat": "", + "minicraft.quest.farming.planting_wheat.description": "", + "minicraft.quest.gems": "", + "minicraft.quest.gems.description": "", + "minicraft.quest.gems.gem_armor": "", + "minicraft.quest.gems.gem_armor.description": "", + "minicraft.quest.gems.gem_claymore": "", + "minicraft.quest.gems.gem_claymore.description": "", + "minicraft.quest.iron_equipments": "", + "minicraft.quest.iron_equipments.description": "", + "minicraft.quest.iron_equipments.getting_more_iron": "", + "minicraft.quest.iron_equipments.getting_more_iron.description": "", + "minicraft.quest.iron_equipments.iron_armor": "", + "minicraft.quest.iron_equipments.iron_armor.description": "", + "minicraft.quest.iron_equipments.iron_tools": "", + "minicraft.quest.iron_equipments.iron_tools.description": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", + "minicraft.quest.potions": "", + "minicraft.quest.potions.all_potions_prepared": "", + "minicraft.quest.potions.all_potions_prepared.description": "", + "minicraft.quest.potions.awkward_potions": "", + "minicraft.quest.potions.awkward_potions.description": "", + "minicraft.quest.potions.description": "", + "minicraft.quest.potions.powerful_potions": "", + "minicraft.quest.potions.powerful_potions.description": "", + "minicraft.tutorial.getting_rocks": "", + "minicraft.tutorial.getting_rocks.description": "", + "minicraft.tutorial.getting_wood": "", + "minicraft.tutorial.getting_wood.description": "", + "minicraft.tutorial.getting_wooden_pickaxe": "", + "minicraft.tutorial.getting_wooden_pickaxe.description": "", + "minicraft.tutorial.getting_workbench": "", + "minicraft.tutorial.getting_workbench.description": "", + "minicraft.tutorial.start_getting_wood": "", + "minicraft.tutorial.start_getting_wood.description": "", + "minicraft.display.options_display.language": "", + "minicraft.display.options_display.resource_packs": "", + "minicraft.displays.language_settings.title": "", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Nyíl", + "String": "Fonál", + "Glass": "Üveg", + "Cloth": "Szövet" } diff --git a/src/client/resources/assets/localization/id-id.json b/src/client/resources/assets/localization/id-id.json index e23539213..abf2e030b 100644 --- a/src/client/resources/assets/localization/id-id.json +++ b/src/client/resources/assets/localization/id-id.json @@ -1,7 +1,7 @@ { "minicraft.achievement.woodcutter": "Penebang", "minicraft.achievement.woodcutter.desc": "Dapatkan kayu.", - "minicraft.achievement.benchmarking": "Bekerja!", + "minicraft.achievement.benchmarking": "Bekerja", "minicraft.achievement.benchmarking.desc": "Membuat meja kerja.", "minicraft.achievement.upgrade": "Meningkatkan!", "minicraft.achievement.upgrade.desc": "Buat alat Batu apa saja.", @@ -28,31 +28,174 @@ "minicraft.achievement.obsidian_dungeon": "Ksatria dan Pria", "minicraft.achievement.obsidian_dungeon.desc": "Mencapai ruang bawah tanah obsidian.", "minicraft.achievement.airwizard": "Mengalahkan... udara?", - "minicraft.achievement.airwizard.desc": "Kalahkan penyihir Udara pertama", + "minicraft.achievement.airwizard.desc": "Kalahkan Penyihir Angin pertama!", "minicraft.achievement.skin": "Peragaan busana", "minicraft.achievement.skin.desc": "Ubah kulit Anda.", - "minicraft.display.achievement": "Prestasi", - "minicraft.display.achievement.achieved": "Tercapai!", - "minicraft.display.achievement.not_achieved": "Tidak tercapai", - "minicraft.display.achievement.score": "Skor Prestasi:", - "minicraft.notification.achievement_unlocked": "Prestasi tidak terkunci:", - "Entities": "Entitas", - "Air Wizard: Defeated!": "Penyihir Udara: Dikalahkan!", - "The Dungeon is now open!": "Penjara Bawah Tanah terbuka!", - "A costume lies on the ground...": "Sebuah kostum tergeletak di tanah...", - "Can't sleep!": "Tidak bisa tidur!", - "Min ": "Min ", - " Sec left!": " Detik lagi!", - "You hear a noise from the surface!": "Anda mendengar suara dari permukaan!", + "minicraft.display.entries.boolean.false": "Mati", + "minicraft.display.entries.boolean.true": "Hidup", + "minicraft.display.gui.link_opening": "Membuka dengan browser...", + "minicraft.display.gui.perm_status.saving": "Menyimpan... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Tekan %s untuk membatalkan", + "minicraft.display.gui.perm_status.sleeping": "Sedang tidur...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s untuk disembunyikan!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Skor saat ini: %s", + "minicraft.display.gui.score.time_left": "Waktu tersisa %s%sm %sd", + "minicraft.display.menus.inventory": "Inventaris", + "minicraft.display.options_display": "Opsi", + "minicraft.display.options_display.change_key_bindings": "Ganti Tombol Pintasan", + "minicraft.display.popup.enter_confirm": "tekan enter untuk konfirmasi", + "minicraft.display.popup.escape_cancel": "tekan escape untuk membatalkan", + "minicraft.display.popup.title_confirm": "Konfirm Aksi", + "minicraft.displays.achievements": "Pencapaian", + "minicraft.displays.achievements.display.achieved": "Tercapai!", + "minicraft.displays.achievements.display.help": "Gunakan %s dan %s untuk bergerak.", + "minicraft.displays.achievements.display.not_achieved": "Tidak Tercapai", + "minicraft.displays.achievements.display.score": "Skor Pencapaian: %s", + "minicraft.displays.book.default_book": "Buku ini tidak memiliki teks.", + "minicraft.displays.crafting": "Kerajinan", + "minicraft.displays.crafting.container_title.cost": "Biaya:", + "minicraft.displays.crafting.container_title.have": "Memiliki:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Skor Akhir: %s", + "minicraft.displays.end_game.display.player_score": "Skor Pemain: %s", + "minicraft.displays.end_game.display.unlocked": "Terbuka! %s Waktu Skor", + "minicraft.displays.end_game.exit": "Keluar ke Menu", + "minicraft.displays.info.display.exit_help": "%s/%s:Keluar", + "minicraft.displays.info.display.score": "Skor saat ini: %s", + "minicraft.displays.info.display.time": "Waktu Bermain: %s", + "minicraft.displays.info.title": "Statistik Pemain", + "minicraft.displays.key_input.display.help.0": "Tekan C/Enter untuk mengganti tombol pintasan", + "minicraft.displays.key_input.display.help.1": "Tekan A untuk menambah tombol pintasan", + "minicraft.displays.key_input.display.help.2": "Shift-D untuk mengatur ulang semua tombol pintasan ke default", + "minicraft.displays.key_input.display.help.3": "%s untuk Kembali ke menu", + "minicraft.displays.key_input.popup_display.confirm_reset": "Apakah anda yakin ingin menyetel ulang semua pengikatan tombol pintasan ke tombol pintasan default?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Tekan urutan tombol yang diinginkan", + "minicraft.displays.key_input.title": "Kontrol", + "minicraft.displays.loading.message.entities": "Entitas", + "minicraft.displays.loading.message.generating": "Sedang Menggenerasi", + "minicraft.displays.loading.message.level": "Level %s", + "minicraft.displays.loading.message.levels": "Level", + "minicraft.displays.loading.message.loading": "Memuat", + "minicraft.displays.loading.message.saving": "Menyimpan", + "minicraft.displays.loading.message.world": "Dunia", + "minicraft.displays.options_main_menu": "Pilihan Menu Utama", + "minicraft.displays.options_main_menu.resource_packs": "Resourse Pack", + "minicraft.displays.options_world": "Opsi Dunia", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Apakah anda yakin ingin mematikan tutorial selamanya?", + "minicraft.displays.options_world.turn_off_tutorials": "Matikan tutorial", + "minicraft.displays.pause": "Dijeda", + "minicraft.displays.pause.display.exit_popup.0": "Apakah anda yakin ingin keluar dari permainan?", + "minicraft.displays.pause.display.exit_popup.1": "Semua progres yang belum disimpan akan hilang", + "minicraft.displays.pause.display.exit_popup.cancel": "Batalkan", + "minicraft.displays.pause.display.exit_popup.quit": "Keluar tanpa menyimpan", + "minicraft.displays.pause.display.help.choose": "%s: Pilih", + "minicraft.displays.pause.display.help.scroll": "%s dan %s untuk Menggulir", + "minicraft.displays.pause.menu": "Menu Utama", + "minicraft.displays.pause.return": "Kembali ke permainan", + "minicraft.displays.pause.save": "Simpan Game", + "minicraft.displays.player_death.display.score": "Skor: %s", + "minicraft.displays.player_death.display.time": "Waktu: %s", + "minicraft.displays.player_death.quit": "Keluar", + "minicraft.displays.player_death.respawn": "Respawn", + "minicraft.displays.player_death.save_quit": "Simpan dan Keluar", + "minicraft.displays.player_death.title": "Kamu mati! Aww!", + "minicraft.displays.player_inv.container_title.items": "Item", + "minicraft.displays.player_inv.display.help": "(%s) untuk mencari.", + "minicraft.displays.quests": "Misi", + "minicraft.displays.quests.display.header.completed": "Selesai", + "minicraft.displays.quests.display.header.unlocked": "Terbuka", + "minicraft.displays.quests.display.no_quest_desc": "Tidak ada misi", + "minicraft.displays.resource_packs.display.help.move": "Gunakan %s dan %s untuk bergerak.", + "minicraft.displays.resource_packs.display.help.select": "%s untuk periksa.", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] untuk menggerak pack. ", + "minicraft.displays.resource_packs.display.title": "Resourse pack", + "minicraft.displays.skin": "Skin-skin", + "minicraft.displays.skin.display.help.move": "Gunakan %s dan %s untuk bergerak.", + "minicraft.displays.skin.display.help.select": "%s untuk memilih, dan %s untuk membatalkan.", + "minicraft.displays.title.display.cannot_check": "Tidak dapat cek pembaruan.", + "minicraft.displays.title.display.checking": "Mengecek pembaruan...", + "minicraft.displays.title.display.help.0": "(%s, %s untuk memilih)", + "minicraft.displays.title.display.help.1": "(%s untuk menerima)", + "minicraft.displays.title.display.help.2": "(%s untuk kembali)", + "minicraft.displays.title.display.latest_already": "Anda memiliki versi terbaru.", + "minicraft.displays.title.display.new_version": "Versi Baru: %s", + "minicraft.displays.title.display.version": "Versi %s", + "minicraft.displays.title.help": "Bantu", + "minicraft.displays.title.help.about": "Tentang", + "minicraft.displays.title.help.credits": "Kredit-kredit", + "minicraft.displays.title.help.instructions": "Instruksi", + "minicraft.displays.title.help.storyline_guide": "Panduan Alur Cerita", + "minicraft.displays.title.link_to_version": "Tautan langsung ke versi terbaru: %s", + "minicraft.displays.title.play": "Main", + "minicraft.displays.title.play.load_world": "Muat Dunia", + "minicraft.displays.title.play.new_world": "Dunia Baru", + "minicraft.displays.title.quit": "Keluar", + "minicraft.displays.title.select_to_download": "--Pilih di sini untuk Mengunduh--", + "minicraft.displays.world_gen.create_world": "Ciptakan Dunia", + "minicraft.displays.world_gen.enter_world": "Masukkan Nama Dunia", + "minicraft.displays.world_gen.title": "Opsi Generasi Dunia", + "minicraft.displays.world_gen.troublesome_input": "Masalah dengan nama dunia?", + "minicraft.displays.world_gen.troublesome_input.msg": "sepertinya Anda telah menyetel huruf sebagai kontrol untuk menggerakkan kursor ke atas dan ke bawah, yang mungkin mengganggu. Ini dapat diubah di menu pengikatan tombol sebagai tombol \"cursor-XXX\". Untuk saat ini, untuk mengetik huruf daripada menggerakkan kursor, tahan tombol shift saat mengetik.", + "minicraft.displays.world_gen.world_seed": "Benih Dunia", + "minicraft.displays.world_select.display.help.0": "%s untuk konfirmasi", + "minicraft.displays.world_select.display.help.1": "%s untuk kembali", + "minicraft.displays.world_select.display.help.2": "SHIFT-C untuk menyalin", + "minicraft.displays.world_select.display.help.3": "SHIFT-R untuk mengganti nama", + "minicraft.displays.world_select.display.help.4": "SHIFT-D untuk menghapus", + "minicraft.displays.world_select.display.world_too_new": "Versi yang lebih tinggi, tidak dapat memuat dunia!", + "minicraft.displays.world_select.display.world_version": "Versi Dunia: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s untuk membatalkan", + "minicraft.displays.world_select.popups.display.change": "Nama Dunia Baru:", + "minicraft.displays.world_select.popups.display.confirm": "%s untuk konfirmasi", + "minicraft.displays.world_select.popups.display.delete": "Anda yakin ingin menghapus\n%s\"%s\"%s?\nIni tidak dapat dibatalkan!", + "minicraft.displays.world_select.select_world": "Pilih Dunia", + "minicraft.notification.achievement_unlocked": "Prestasi terbuka: %s", + "minicraft.notification.air_wizard_defeated": "Penyihir Udara Dikalahkan!", + "minicraft.notification.cannot_sleep": "Tidak bisa tidur! %sMin %s Detik tersisa!", + "minicraft.notification.death_chest_retrieved": "Peti kematian diambil!", + "minicraft.notification.defeat_air_wizard_first": "Penyihir udara harus dikalahkan terlebih dahulu.", + "minicraft.notification.dig_hole": "Gali lubang dulu!", + "minicraft.notification.dungeon_opened": "Dungeon sekarang terbuka!", + "minicraft.notification.gem_pickaxe_required": "Beliung Gem Diperlukan.", + "minicraft.notification.invalid_placement": "Hanya dapat ditempatkan pada %s!", + "minicraft.notification.quest_completed": "Misi selesai", + "minicraft.notification.quest_unlocked": "Misi terbuka", + "minicraft.notification.world_saved": "Dunia tersimpan!", + "minicraft.notification.wrong_level_sky": "Hanya bisa summon di tingkat langit", + "minicraft.settings.fps": "FPS Maks", + "minicraft.settings.difficulty": "Kesulitan", + "minicraft.settings.difficulty.easy": "Mudah", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Susah", + "minicraft.settings.mode": "Mode Permainan", + "minicraft.settings.mode.survival": "Surviv", + "minicraft.settings.mode.creative": "Kreatif", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Skor", + "minicraft.settings.scoretime": "Waktu (Mode Skor)", + "minicraft.settings.screenshot_scale": "Skala Tangkapan Layar", + "minicraft.settings.sound": "Suara", + "minicraft.settings.autosave": "Simpan otomatis", + "minicraft.settings.size": "Ukuran dunia", + "minicraft.settings.theme": "Tema Dunia", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.forest": "Hutan", + "minicraft.settings.theme.desert": "Gurun", + "minicraft.settings.theme.plain": "Plain", + "minicraft.settings.theme.hell": "Neraka", + "minicraft.settings.type": "Tipe Terrain", + "minicraft.settings.type.island": "Pulau", + "minicraft.settings.type.box": "Kotak", + "minicraft.settings.type.mountain": "Gunung", + "minicraft.settings.type.irregular": "Tidak teratur", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul dengan jubah", + "minicraft.skin.minecraft_steve": "Anak laki-laki yang akrab", + "minicraft.skin.minecraft_alex": "Gadis yang akrab", + "minicraft.text_particales.key_consumed": "-1 tombol", "Death Chest": "Peti Mati", "Player": "Pemain", - "Crafting": "Kerajinan", - "Set your home!": "Tetapkan rumah Anda!", - "Can't set home here!": "Tidak dapat mengatur rumah di sini!", - "Home Sweet Home!": "Rumahku Surgaku!", - "Mode penalty: -2 health": "Penalti mode: -2 darah", - "You don't have a home!": "Anda tidak punya rumah!", - "You can't go home from here!": "Anda tidak bisa pulang dari sini!", "Leather Armor": "Armor Kulit", "Snake Armor": "Armor Ular", "Iron Armor": "Armor Besi", @@ -63,7 +206,6 @@ "Empty Bucket": "Ember Kosong", "Water Bucket": "Ember Air", "Lava Bucket": "Ember Lava", - " Bucket": " Ember", "Red Clothes": "Pakaian Merah", "Blue Clothes": "Pakaian Biru", "Green Clothes": "Pakaian Ijo", @@ -72,7 +214,7 @@ "Orange Clothes": "Pakaian Oranye", "Purple Clothes": "Pakaian Ungu", "Cyan Clothes": "Pakaian Cyan", - "Reg Clothes": "Pakaian Reg", + "Reg Clothes": "Pakaian Reguler", "Bread": "Roti", "Apple": "Apel", "Raw Pork": "Babi Mentah", @@ -119,25 +261,23 @@ "Haste Potion": "Ramuan Tergesa-gesa", "Escape Potion": "Ramuan Melarikan Diri", "Potion": "Ramuan", - "Power Glove": "Sarung Kekuatan", + "Power Glove": "Sarung Tangan Kekuatan", "Wood": "Kayu", "Stone": "Batu", "Leather": "Kulit", "Wheat": "Gandum", "Key": "Kunci", - "Arrow": "Anak panah", - "String": "Benang", "Coal": "Batu Bara", "Iron Ore": "Bijih Besi", - "Lapis": "Lapis", "Gold Ore": "Bijih Emas", + "Gem Ore": "Bijih Gem", + "Cloud Ore": "Bijih Awan", "Iron": "Besi", "Gold": "Emas", + "Lapis": "Lapis", "Rose": "Bunga Mawar", "GunPowder": "Bubuk Mesiu", "Slime": "Lendir", - "Glass": "Kaca", - "Cloth": "Kain", "Scale": "Skala", "Shard": "Beling", "Flower": "Bunga", @@ -156,7 +296,7 @@ "Obsidian Wall": "Dinding Obsidian", "Obsidian Door": "Pintu Obsidian", "Wool": "Wol", - "Red Wool": "Wol", + "Red Wool": "Wol Merah", "Blue Wool": "Wol Biru", "Green Wool": "Wol Ijo", "Yellow Wool": "Wol Kuning", @@ -177,14 +317,13 @@ "Gem Fishing Rod": "Pancing Gem", "Shovel": "Sekop", "Hoe": "Cankul", - "Sword": "pedang", + "Sword": "Pedang", "Pickaxe": "Beliung", "Axe": "Kapak", "Bow": "Busur", "Claymore": "Claymore", "Shears": "Sepasang gunting", "Torch": "Obor", - "Gem Ore": "Bijih Gem", "Wood Planks": "Papan Kayu", "Stone Bricks": "Batu Bata", "Obsidian": "Obsidian", @@ -204,147 +343,131 @@ "Hard Rock": "Batu Keras", "Infinite Fall": "Jatuh Tak Terbatas", "Cloud Cactus": "Kaktus Awan", - "Ore": "Bijih", - "host not found": "host tidak ditemukan", - "unable to get localhost address": "tidak bisa mendapatkan alamat localhost", - "World Saved!": "Dunia Disimpan!", - "On": "Aktif", - "Off": "Nonaktif", - "There is nothing of use here.": "Tidak ada yang bisa digunakan disini.", - "Still nothing... :P": "Masih tidak ada... :V", - "Have:": "Punya:", - "Cost:": "Harga", - "Time: ": "Waktu: ", - "Score: ": "Skor: ", - "Quit": "Quit", - "Respawn": "Respawn", - "You died! Aww!": "Anda mati! Aww!", - "Player Score: ": "Skor Pemain: ", - "": "", - "Final Score: ": "Skor Terakhir: ", - "Exit to Menu": "Keluar ke Menu", - "Time Played: ": "Waktu Dimainkan: ", - "Current Score: ": "Skor saat ini: ", - "Exit": "Exit", - "Player Stats": "Statistik Pemain", - "Controls": "Kontrol", - "Press the desired": "Tekan yang diinginkan", - "key sequence": "urutan tombol", - "minicraft.display.key_input.confirm_popup": "Apakah Anda yakin ingin mengatur ulang semua ikatan kunci ke kunci default?", - "minicraft.display.popup.enter_confirm": "tekan enter untuk konfirmasi", - "minicraft.display.popup.escape_cancel": "tekan escape untuk membatalkan", - "Confirm Action": "Konfirmasi Tindakan", - "Press C/Enter to change key binding": "Tekan C/Enter untuk mengubah ikatan tombol", - "Press A to add key binding": "Tekan A untuk menambahkan pengikatan tombol", - "Shift-D to reset all keys to default": "Shift-D untuk mengatur ulang semua tombol ke default", - "ESCAPE to Return to menu": "Tekan ESCAPE untuk Kembali ke menu", - "Loading": "Memuat", - "Generating": "Membuat", - "World": "Dunia", - "waiting...": "menunggu...", - "nothing": "tidak ada apa-apa", - "attempting log in": "mencoba masuk", - "no internet connection, but no login data saved; cannot enter offline mode.": "tidak ada koneksi internet, tetapi tidak ada data login yang disimpan; tidak dapat masuk ke mode offline.", - "connecting to server": "menghubungkan ke server", - "logging in": "masuk", - "saving credentials": "menyimpan kredensial", - "login failed.": "gagal masuk.", - "problem with saved login data; please exit and login again.": "masalah dengan data login yang disimpan; silahkan keluar dan login kembali.", - "Internal server error: Couldn't fetch username from uuid": "Kesalahan server internal: Tidak dapat mengambil nama pengguna dari uuid", - "logged in as: ": "masuk sebagai:", - "offline mode: local servers only": "mode offline: hanya server lokal", - "Enter ip address to connect to:": "Masukkan alamat ip untuk terhubung ke:", - "Press Shift-Escape to logout": "Tekan Shift-Escape untuk keluar", - "Enter email:": "Masukan email:", - "Enter password:": "Masukkan sandi:", - "field is blank": "tidak ada isi", - "get an account at:": "dapatkan akun di:", - "Loading ": "Memuat ", - " from server": " dari server", - "Could not connect to server:": "Tidak bisa terhubung ke server:", - "Press ": "tekan ", - " to return": " mengembalikan", - "Change Key Bindings": "Ubah Ikatan Tombol", - "Options": "Opsi", - "Change language": "Ganti bahasa", - "Return to Game": "Kembali ke Permainan", - "Make World Multiplayer": "Jadikan Multiplayer Dunia", - "Save Game": "Simpan permainan", - " and ": " dan ", - " to Scroll": " untuk Menggulir", - ": Choose": ": Memilih", - "Paused": "Dijeda", - "Main Menu": "Menu utama", - "No": "Tidak", - "Yes": "Ya", - "Inventory": "Inventaris", - "to search.": "untuk mencari.", - "Play": "Bermain", - "Load World": "Muat Dunia", - "New World": "Dunia baru", - "Multiplayer": "Bermain Bersama", - "Singleplayer": "Bermain Sendiri", - "Help": "Bantu", - "Instructions": "Instruksi", - "Storyline Guide": "Panduan alur cerita", - "About": "Tentang", - "Credits": "Kredit", - " to select": " memilih", - " to accept": " menerima", - "New World Name:": "Nama Dunia Baru:", - "Are you sure you want to delete": "Anda yakin ingin menghapus", - "This can not be undone!": "Ini tidak dapat dibatalkan!", - " to confirm": " untuk mengkonfirmasi", - " to cancel": " untuk membatalkan", - "World Seed": "Benih Dunia", - "Enter World Name": "Masukkan Nama Dunia", - "Trouble with world name?": "Masalah dengan nama dunia?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "secara default, w dan s memindahkan kursor ke atas dan ke bawah. Ini dapat diubah di menu pengikatan kunci. Untuk mengetik huruf alih-alih memindahkan kursor, tahan tombol shift saat mengetik nama dunia.", - "Create World": "Buat Dunia", - "World Gen Options": "Opsi Generasi Dunia", - " to Copy": " untuk Menyalin", - " to Rename": " untuk Mengganti Nama", - " to Delete": " untuk Menghapus", - "Select World": "Pilih Dunia", - "Select a World to Delete": "Pilih Dunia untuk Dihapus", - "Select a World to Rename": "Pilih Dunia untuk Diganti Nama", - "Select a World to Copy": "Pilih Dunia untuk Disalin", - "Higher version, cannot load world!": "Versi yang lebih tinggi, tidak dapat memuat dunia!", - "World Version:": "Versi Dunia:", - "Languages": "Bahasa-Bahasa", - "Language": "Bahasa", - "Select": "Pilih", - "Max FPS": "FPS maks", - "Difficulty": "Kesulitan", - "Easy": "Mudah", - "Normal": "Normal", - "Hard": "Susah", - "Game Mode": "Mode Permainan", - "Survival": "Bertahan hidup", - "Creative": "Kreatif", - "Hardcore": "Hardcore", - "Score": "Skor", - "Time (Score Mode)": "Waktu (Mode Skor)", - "Sound": "Suara", - "Autosave": "Penyimpanan otomatis", - "World Size": "Ukuran dunia", - "World Theme": "Tema Dunia", - "Forest": "hutan", - "Desert": "Gurun", - "Plain": "Polos", - "Hell": "Neraka", - "Terrain Type": "Tipe Terrain", - "Island": "Pulau", - "Box": "Kotak", - "Mountain": "Gunung", - "Irregular": "Tidak Teratur", - "Wear Suit": "Pakai Jas", - "You have the latest version.": "Anda memiliki versi terbaru.", - "minicraft.display.skin": "Kulit", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul dengan jubah", - "minicraft.skin.minecraft_steve": "Anak laki-laki yang akrab", - "minicraft.skin.minecraft_alex": "Gadis yang akrab", - "minicraft.notification.invalid_placement": "Hanya dapat ditempatkan pada", - "minicraft.notification.dig_hole": "Gali lubang dulu!" + "Raw Obsidian": "Obsidian Mentah", + "Totem of Air": "Totem Udara", + "minicraft.control_guide.attack": "Gunakan %s untuk menyerang atau menghancur.", + "minicraft.control_guide.craft": "Gunakan %s untuk membuka menu kerajinanmu.", + "minicraft.control_guide.menu": "Gunakan %s untuk membuka menu inventaris.", + "minicraft.control_guide.move": "Gunakan %s untuk bergerak.", + "minicraft.displays.controls": "Kontrol", + "minicraft.displays.controls.display.controller": "Kontroller", + "minicraft.displays.controls.display.controller.00": "Menggerak pemain menggunakan DPAD", + "minicraft.displays.controls.display.controller.01": "Menggerak kursor menggunakan DPAD", + "minicraft.displays.controls.display.controller.02": "Memilih entri menggunakan A", + "minicraft.displays.controls.display.controller.03": "Keluar halaman menggunakan B", + "minicraft.displays.controls.display.controller.04": "Menyerang entitas, menghancurkan dan berinteraksi tile menggunakan A", + "minicraft.displays.controls.display.controller.05": "Membuka menu dalam game menggunakan X", + "minicraft.displays.controls.display.controller.06": "Membuka menu kerajinan menggunakan Y", + "minicraft.displays.controls.display.controller.07": "Mengambil furnitur menggunakan LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "Menjatuhkan 1 item menggunakan RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Menjatuhkan seluruh tumpukan item menggunakan RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "Mengalihkan bilah pencarian di menu-menu item menggunakan START", + "minicraft.displays.controls.display.controller.11": "Menjeda permainan menggunakan START", + "minicraft.displays.controls.display.controller.12": "Gunakan X untuk mengaktifkan keyboard on-screen pada input", + "minicraft.displays.controls.display.controller.13": "Gunakan B sebagai pinstasan buat backspace di keyboard on-screen", + "minicraft.displays.controls.display.controller.14": "Gunakan X untuk menghapus item dalam inventaris mode kreatif", + "minicraft.displays.controls.display.controller.15": "Gunakan Y untuk menghapus seluruh tumpukan item dalam inventaris mode kreatif", + "minicraft.displays.controls.display.controller.desc.0": "Pemetaan debug tidak dapat diakses", + "minicraft.displays.controls.display.controller.desc.1": "Pemetaan terperinci tidak dapat digunakan", + "minicraft.displays.controls.display.help.0": "%s/%s untuk melihat kontrol-kontrol lain.", + "minicraft.displays.controls.display.keyboard": "Keyboard", + "minicraft.displays.controls.display.keyboard.00": "Menggerak pemain menggunakan MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Menggerak kursor menggunakan CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Mempilih entri menggunakan SELECT", + "minicraft.displays.controls.display.keyboard.03": "Keluar halaman menggunakan EXIT", + "minicraft.displays.controls.display.keyboard.04": "Menyimpan cepat menggunakan QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Menyerang entitas, menghancur dan interaksi pada tile menggunakan ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Membuka menu-menu dalam game menggunakan MENU", + "minicraft.displays.controls.display.keyboard.07": "Membuka menu kerajinan menggunakan CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Mengangkat furnitur menggunakan PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Menjatuhkan 1 item menggunakan DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Menjatuhkan seluruh tumpukan item menggunakan DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Beralih bilah pencarian di menu item menggunakan SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Browsing hasil pencarian menggunakan PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Menjeda game menggunakan PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Mengalih tampilan efek ramuan menggunakan POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Beralih tampilan ramuan yang disederhanakan menggunakan SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Mengembang tampilan misi dalam game menggunakan EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Mengalih HUD menggunakan TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Mengambil tangkapan layar menggunakan SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Menampil info dalam game menggunakan INFO", + "minicraft.displays.controls.display.keyboard.20": "Mengalih fullscreen menggunakan FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Gunakan D untuk menghapus item terpilih dalam inventaris mode kreatif", + "minicraft.displays.controls.display.keyboard.22": "Gunakan SHIFT-D untuk menghapus seluruh tumpukan item dalam inventaris mode kreatif", + "minicraft.displays.controls.display.keyboard.desc": "Pemetaan debug tidak dijelaskan", + "minicraft.displays.loading.message.dungeon_regeneration": "Regenerasi B4", + "minicraft.displays.loading.message.quests": "Misi-misi", + "minicraft.displays.loading.regeneration_popup.display.0": "Versi dungeon lama (B4 floor) terdeteksi.", + "minicraft.displays.loading.regeneration_popup.display.1": "Diperlukan regenerasi.", + "minicraft.displays.loading.regeneration_popup.display.2": "Data lama di lantai itu akan dihapus:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s untuk melanjutkan", + "minicraft.displays.loading.regeneration_popup.display.4": "%s untuk membatalkan pemuatan dunia", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Pemuatan dunia telah dibatalkan", + "minicraft.displays.quests.display.no_quest": "Tidak ada misi terbuka", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Hanya input melalui keyboard diterima.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Tekan %s untuk meneliti rincian tutorial.", + "minicraft.notification.obsidian_knight_defeated": "Ksatria Obsidian: Dikalahkan!", + "minicraft.notification.obsidian_knight_awoken": "Ksatria Obsidian telah terbangun!", + "minicraft.notification.defeat_obsidian_knight_first": "Ksatria Obsidian harus dikalahkan terlebih dahulu.", + "minicraft.notification.wrong_level_dungeon": "Hanya bisa dipanggil di level dungeon", + "minicraft.notification.boss_limit": "Tidak ada lagi bos yang bisa dihasilkan", + "minicraft.notification.spawn_on_boss_tile": "Hanya bisa dipanggil di Boss Room", + "minicraft.notifications.statue_tapped": "Anda mendengar bisikan bergema...", + "minicraft.notifications.statue_touched": "Anda mendengar patungnya bergetar...", + "minicraft.quest.farming": "Petani Pertanian", + "minicraft.quest.farming.crafting_hoe": "Membuat cangkul", + "minicraft.quest.farming.crafting_hoe.description": "Membuat cangkul apa pun dari meja kerja", + "minicraft.quest.farming.description": "Dasar-dasar sebagai petani.", + "minicraft.quest.farming.getting_wheat": "Memanen gandum", + "minicraft.quest.farming.getting_wheat.description": "Memanen gandum dengan menghancur tanaman gandum yang tumbuh.", + "minicraft.quest.farming.making_farmland": "Membuat tanah pertanian", + "minicraft.quest.farming.making_farmland.description": "Membuat tanah pertanian dengan menggunakan cangkul untuk berinteraksi dengan tile tanah.", + "minicraft.quest.farming.planting_potato": "Menanam kentang", + "minicraft.quest.farming.planting_potato.description": "Menanam kentang dengan cara meletakkan kentang di tanah pertanian", + "minicraft.quest.farming.planting_wheat": "Menanam gandum", + "minicraft.quest.farming.planting_wheat.description": "Menanam gandum dengan cara meletakkan biji gandum di tanah pertanian.", + "minicraft.quest.gems": "Jalan Gem", + "minicraft.quest.gems.description": "Mempersiapkan peralatan gem.", + "minicraft.quest.gems.gem_armor": "Master akan Pelindungan", + "minicraft.quest.gems.gem_armor.description": "Mendapatkan armor gem.", + "minicraft.quest.gems.gem_claymore": "Master akan Senjata", + "minicraft.quest.gems.gem_claymore.description": "Mendapatkan gem claymore.", + "minicraft.quest.iron_equipments": "Master akan Besi", + "minicraft.quest.iron_equipments.description": "Mendapatkan semua peralatan besi.", + "minicraft.quest.iron_equipments.getting_more_iron": "Kaya akan Besi", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Mendapatkan lebih banyak besi.", + "minicraft.quest.iron_equipments.iron_armor": "Meningkat armor", + "minicraft.quest.iron_equipments.iron_armor.description": "Meningkat armor ke besi.", + "minicraft.quest.iron_equipments.iron_tools": "Meningkat semua alat", + "minicraft.quest.iron_equipments.iron_tools.description": "Meningkat alat-alatmu ke besi.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Beliung Advanced", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Meningkat beliungmu.", + "minicraft.quest.potions": "Master akan Ramuan", + "minicraft.quest.potions.all_potions_prepared": "Murid akan Ramuan", + "minicraft.quest.potions.all_potions_prepared.description": "Mendapatkan semua ramuan sekaligus.", + "minicraft.quest.potions.awkward_potions": "Ramuan Canggung", + "minicraft.quest.potions.awkward_potions.description": "Mendapatkan ramuan canggung.", + "minicraft.quest.potions.description": "Mendapatkan ramuan-ramuannya.", + "minicraft.quest.potions.powerful_potions": "Ramuan Kuat", + "minicraft.quest.potions.powerful_potions.description": "Mendapatkan ramuan yang berguna dan kuat.", + "minicraft.tutorial.getting_rocks": "Mendapatkan batu dan bara", + "minicraft.tutorial.getting_rocks.description": "Dapatkan setidaknya 5 item batu dan 5 item batu bara dengan menghancurkan batu dengan beliung yang dibuat.", + "minicraft.tutorial.getting_wood": "Mendapatkan lebih banyak kayu", + "minicraft.tutorial.getting_wood.description": "Mendapatkan setidaknya 10 item kayu dari pohon-pohon.", + "minicraft.tutorial.getting_wooden_pickaxe": "Mendapatkan beliung kayu", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Membuat beliung kayu di menu kerajinan dari meja kerja.", + "minicraft.tutorial.getting_workbench": "Mendapatkan meja kerja", + "minicraft.tutorial.getting_workbench.description": "Membuat meja kerja di menu kerajinan. Menempatkannya setelah itu.", + "minicraft.tutorial.start_getting_wood": "Awal dari Semua", + "minicraft.tutorial.start_getting_wood.description": "Terus Menyerang pohon untuk mendapatkan kayu.", + "minicraft.display.options_display.language": "Bahasa", + "minicraft.display.options_display.resource_packs": "Resours pack", + "minicraft.displays.language_settings.title": "Bahasa...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Anak panah", + "String": "Benang", + "Glass": "Kaca", + "Cloth": "Kain" } diff --git a/src/client/resources/assets/localization/it-it.json b/src/client/resources/assets/localization/it-it.json index 3b12789bb..81cc79ad6 100644 --- a/src/client/resources/assets/localization/it-it.json +++ b/src/client/resources/assets/localization/it-it.json @@ -2,7 +2,7 @@ "minicraft.achievement.woodcutter": "Taglialegna", "minicraft.achievement.woodcutter.desc": "Prendi del legno.", "minicraft.achievement.benchmarking": "Ora del lavoro", - "minicraft.achievement.benchmarking.desc": "Costruisci un banco da lavoro", + "minicraft.achievement.benchmarking.desc": "Costruisci un banco da lavoro.", "minicraft.achievement.upgrade": "Potenzia!", "minicraft.achievement.upgrade.desc": "Costruisci qualsiasi utensile di ferro.", "minicraft.achievement.bow": "Scocca la freccia verso di me!", @@ -11,8 +11,8 @@ "minicraft.achievement.fish.desc": "Pesca un pesce!", "minicraft.achievement.doors": "Adooro la protezione", "minicraft.achievement.doors.desc": "Costruisci una porta di legno.", - "minicraft.achievement.planks": "Cammina sulle asse!", - "minicraft.achievement.planks.desc": "Costruisci delle assi di legno", + "minicraft.achievement.planks": "Cammina sulle assi!", + "minicraft.achievement.planks.desc": "Costruisci delle assi di legno.", "minicraft.achievement.clothes": "Che tu abbia una giornata colorata!", "minicraft.achievement.clothes.desc": "Costruisci un vestito di qualsiasi colore", "minicraft.achievement.demolition": "Demolizione Demo", @@ -24,35 +24,178 @@ "minicraft.achievement.find_gem": "Oooh Splendente!", "minicraft.achievement.find_gem.desc": "Trova dell'oro grezzo e minalo.", "minicraft.achievement.lowest_caves": "Oscurità dietro la luce", - "minicraft.achievement.lowest_caves.desc": "Raggiungi il livello più basso di caverne", + "minicraft.achievement.lowest_caves.desc": "Raggiungi il livello più basso delle caverne.", "minicraft.achievement.obsidian_dungeon": "Di cavalieri e uomini", "minicraft.achievement.obsidian_dungeon.desc": "Raggiungi il dungeon di ossidiana.", "minicraft.achievement.airwizard": "Sconfiggi... l'aria?", - "minicraft.achievement.airwizard.desc": "Sconfiggi il primo mago del vento", + "minicraft.achievement.airwizard.desc": "Sconfiggi il primo mago del vento!", "minicraft.achievement.skin": "Sfilata di moda", "minicraft.achievement.skin.desc": "Cambia la tua skin.", - "minicraft.display.achievement": "Achievements", - "minicraft.display.achievement.achieved": "Completato!", - "minicraft.display.achievement.not_achieved": "Non completato", - "minicraft.display.achievement.score": "Punteggio degli achievement:", - "minicraft.notification.achievement_unlocked": "Achivement unlocked:", - "Entities": "Entitià", - "Air Wizard: Defeated!": "Mago del Vento: Sconfitto!", - "The Dungeon is now open!": "Ora il dungeon è aperto!", - "A costume lies on the ground...": "Un costume e sul terreno...", - "Can't sleep!": "Non puoi dormire!", - "Min ": "Minuti ", - " Sec left!": " Secondi mancanti!", - "You hear a noise from the surface!": "Senti un rumore dalla superfice!", + "minicraft.display.entries.boolean.false": "Off", + "minicraft.display.entries.boolean.true": "On", + "minicraft.display.gui.link_opening": "Apertura con il browser...", + "minicraft.display.gui.perm_status.saving": "Salvataggio... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Premi %s per annullare", + "minicraft.display.gui.perm_status.sleeping": "Dormendo...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s per nasconderti!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Puntaggio attuale: %s", + "minicraft.display.gui.score.time_left": "Tempo rimanente %s%sm %ss", + "minicraft.display.menus.inventory": "Inventario", + "minicraft.display.options_display": "Opzioni", + "minicraft.display.options_display.change_key_bindings": "Cambia la sequenza tasti", + "minicraft.display.popup.enter_confirm": "invio per confermare", + "minicraft.display.popup.escape_cancel": "esc per annullare", + "minicraft.display.popup.title_confirm": "Conferma azione", + "minicraft.displays.achievements": "Obiettivi", + "minicraft.displays.achievements.display.achieved": "Obiettivo completato!", + "minicraft.displays.achievements.display.help": "Usa %s e %s per muoverti.", + "minicraft.displays.achievements.display.not_achieved": "Non completato", + "minicraft.displays.achievements.display.score": "Punteggio Obiettivi: %s", + "minicraft.displays.book.default_book": "Questo libro non contiene scritte.", + "minicraft.displays.crafting": "Creazione", + "minicraft.displays.crafting.container_title.cost": "Costo:", + "minicraft.displays.crafting.container_title.have": "Hai:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Punteggio finale: %s", + "minicraft.displays.end_game.display.player_score": "Punteggio giocatore: %s", + "minicraft.displays.end_game.display.unlocked": "Sbloccato! %s Punteggio a tempo", + "minicraft.displays.end_game.exit": "Esci al menù", + "minicraft.displays.info.display.exit_help": "%s/%s:Esci", + "minicraft.displays.info.display.score": "Punteggio attuale: %s", + "minicraft.displays.info.display.time": "Tempo di gioco: %s", + "minicraft.displays.info.title": "Statistiche giocatore", + "minicraft.displays.key_input.display.help.0": "Premi C/Invio per cambiare la sequenza tasti", + "minicraft.displays.key_input.display.help.1": "Premi A per aggiungere la sequenza tasti", + "minicraft.displays.key_input.display.help.2": "Maiusc-D per resettare le sequenza tasti", + "minicraft.displays.key_input.display.help.3": "%s per tornare al menù", + "minicraft.displays.key_input.popup_display.confirm_reset": "Sei sicuro di voler resettare tutte le sequenza tasti?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Premi la sequenza t asti desiderata", + "minicraft.displays.key_input.title": "Controlli", + "minicraft.displays.loading.message.entities": "Entità", + "minicraft.displays.loading.message.generating": "Generazione", + "minicraft.displays.loading.message.level": "Livello %s", + "minicraft.displays.loading.message.levels": "Livelli", + "minicraft.displays.loading.message.loading": "Caricamento", + "minicraft.displays.loading.message.saving": "Salvataggio", + "minicraft.displays.loading.message.world": "Mondo", + "minicraft.displays.options_main_menu": "Opzioni del menù principale", + "minicraft.displays.options_main_menu.resource_packs": "Pacchetti risorse", + "minicraft.displays.options_world": "Opzioni del mondo", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Sei sicuro di voler disattivare i tutorial per sempre?", + "minicraft.displays.options_world.turn_off_tutorials": "Disattiva tutorial", + "minicraft.displays.pause": "In pausa", + "minicraft.displays.pause.display.exit_popup.0": "Sei sicuro di voler uscire dal gioco?", + "minicraft.displays.pause.display.exit_popup.1": "Tutti i progressi non salvati andranno persi", + "minicraft.displays.pause.display.exit_popup.cancel": "Annulla", + "minicraft.displays.pause.display.exit_popup.quit": "Esci senza salvare", + "minicraft.displays.pause.display.help.choose": "%s: scegli", + "minicraft.displays.pause.display.help.scroll": "%s e %s per scorrere", + "minicraft.displays.pause.menu": "Menù principal", + "minicraft.displays.pause.return": "Torna al gioco", + "minicraft.displays.pause.save": "Salva gioco", + "minicraft.displays.player_death.display.score": "Punteggio: %s", + "minicraft.displays.player_death.display.time": "Tempo: %s", + "minicraft.displays.player_death.quit": "Esci", + "minicraft.displays.player_death.respawn": "Rinasci", + "minicraft.displays.player_death.save_quit": "Salva ed esci", + "minicraft.displays.player_death.title": "Sei morto! Aww!", + "minicraft.displays.player_inv.container_title.items": "Oggetti", + "minicraft.displays.player_inv.display.help": "(%s) per cercare.", + "minicraft.displays.quests": "Quest", + "minicraft.displays.quests.display.header.completed": "Completato", + "minicraft.displays.quests.display.header.unlocked": "Sbloccato", + "minicraft.displays.quests.display.no_quest_desc": "Nessuna quest", + "minicraft.displays.resource_packs.display.help.move": "Usa %s e %s per muoverti.", + "minicraft.displays.resource_packs.display.help.select": "%s per esaminare.", + "minicraft.displays.resource_packs.display.help.position": "MAIUSC-[SINISTRA|DESTRA|SU|GIU'] per spostare i pacchetti.␣", + "minicraft.displays.resource_packs.display.title": "Pacchetti risorse", + "minicraft.displays.skin": "Skin", + "minicraft.displays.skin.display.help.move": "Usa %s e %s per muoverti.", + "minicraft.displays.skin.display.help.select": "%s per selezionare, %s per annullare.", + "minicraft.displays.title.display.cannot_check": "Non è stato possibile cercare aggiornamenti.", + "minicraft.displays.title.display.checking": "Cerco gli aggiornamenti...", + "minicraft.displays.title.display.help.0": "(%s, %s per selezionare)", + "minicraft.displays.title.display.help.1": "(%s per accettare)", + "minicraft.displays.title.display.help.2": "(%s per tornare indietro)", + "minicraft.displays.title.display.latest_already": "Hai la versione più recente.", + "minicraft.displays.title.display.new_version": "Nuova: %s", + "minicraft.displays.title.display.version": "Versione %s", + "minicraft.displays.title.help": "Aiuto", + "minicraft.displays.title.help.about": "Informazioni", + "minicraft.displays.title.help.credits": "Crediti", + "minicraft.displays.title.help.instructions": "Istruzioni", + "minicraft.displays.title.help.storyline_guide": "Guida alla storia", + "minicraft.displays.title.link_to_version": "Link diretto all'ultima versione: %s", + "minicraft.displays.title.play": "Gioca", + "minicraft.displays.title.play.load_world": "Carica mondo", + "minicraft.displays.title.play.new_world": "Nuovo mondo", + "minicraft.displays.title.quit": "Esci", + "minicraft.displays.title.select_to_download": "--Seleziona per scaricare--", + "minicraft.displays.world_gen.create_world": "Crea mondo", + "minicraft.displays.world_gen.enter_world": "Inserisci il nome del mondo", + "minicraft.displays.world_gen.title": "Opzioni di generazione del mondo", + "minicraft.displays.world_gen.troublesome_input": "Problemi con il nome del mondo?", + "minicraft.displays.world_gen.troublesome_input.msg": "sembra tu abbia scelto delle lettere come controlli per muovere il cursore su e giù, il che è probabilmente fastidioso. Puoi modificarlo nel menù per la sequenza dei tasti al tasto \"cursore-XXX\". Al momento per scrivere una lettera puoi tenere premuto il tasto MAIUSC e poi cliccare sulla lettera.", + "minicraft.displays.world_gen.world_seed": "Seme del mondo", + "minicraft.displays.world_select.display.help.0": "%s per confermare", + "minicraft.displays.world_select.display.help.1": "%s per tornare indietro", + "minicraft.displays.world_select.display.help.2": "MAIUSC-C per copiare", + "minicraft.displays.world_select.display.help.3": "MAIUSC-R per rinominare", + "minicraft.displays.world_select.display.help.4": "MAIUSC-D per cancellare", + "minicraft.displays.world_select.display.world_too_new": "La tua versione è più recente, non è possibile caricare il mondo!", + "minicraft.displays.world_select.display.world_version": "Versione mondo: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s per cancallare", + "minicraft.displays.world_select.popups.display.change": "Nome del nuovo mondo:", + "minicraft.displays.world_select.popups.display.confirm": "%s per confermare", + "minicraft.displays.world_select.popups.display.delete": "Sei sicuro di voler cancellare\n%s\"%s\"%s?\nNon si può tornare indietro!", + "minicraft.displays.world_select.select_world": "Scegli il mondo", + "minicraft.notification.achievement_unlocked": "Obiettivo sbloccato: %s", + "minicraft.notification.air_wizard_defeated": "Stregone dell'Aria sconfitto!", + "minicraft.notification.cannot_sleep": "Non puoi dormire! %sMinuti %s Secondi rimasti!", + "minicraft.notification.death_chest_retrieved": "Cassa della morte recuperata!", + "minicraft.notification.defeat_air_wizard_first": "Devi prima sconfiggere lo Stregone dell'Aria.", + "minicraft.notification.dig_hole": "Scava una buca prima!", + "minicraft.notification.dungeon_opened": "Il Dungeon è aperto!", + "minicraft.notification.gem_pickaxe_required": "Piccozza di gemme richiesta.", + "minicraft.notification.invalid_placement": "Può essere collocato solo su %s!", + "minicraft.notification.quest_completed": "Quest completata", + "minicraft.notification.quest_unlocked": "Quest sbloccata", + "minicraft.notification.world_saved": "Mondo salvato!", + "minicraft.notification.wrong_level_sky": "Può essere evocato solo al livello del cielo", + "minicraft.settings.fps": "Massimo FPS", + "minicraft.settings.difficulty": "Difficoltà", + "minicraft.settings.difficulty.easy": "Facile", + "minicraft.settings.difficulty.normal": "Normale", + "minicraft.settings.difficulty.hard": "Difficile", + "minicraft.settings.mode": "Modaligà di gioco", + "minicraft.settings.mode.survival": "Sopravvivenza", + "minicraft.settings.mode.creative": "Creativa", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Punteggio", + "minicraft.settings.scoretime": "Tempo (Modalità a Punteggio)", + "minicraft.settings.screenshot_scale": "Proporzioni Screenshot", + "minicraft.settings.sound": "Suono", + "minicraft.settings.autosave": "Autosalvataggio", + "minicraft.settings.size": "Dimensione mondo", + "minicraft.settings.theme": "Tema mondo", + "minicraft.settings.theme.normal": "Normale", + "minicraft.settings.theme.forest": "Foresta", + "minicraft.settings.theme.desert": "Deserto", + "minicraft.settings.theme.plain": "Pianura", + "minicraft.settings.theme.hell": "Inferno", + "minicraft.settings.type": "Tipo di terreno", + "minicraft.settings.type.island": "Isola", + "minicraft.settings.type.box": "Scatola", + "minicraft.settings.type.mountain": "Montagna", + "minicraft.settings.type.irregular": "Irregolare", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul col mantello", + "minicraft.skin.minecraft_steve": "Ragazzo familiare", + "minicraft.skin.minecraft_alex": "Ragazza familiare", + "minicraft.text_particales.key_consumed": "-1 chiave", "Death Chest": "Cassa della morte", "Player": "Giocatore", - "Crafting": "Fabbricazione", - "Set your home!": "Piazza la tua casa!", - "Can't set home here!": "Non puoi piazzare la tua casa qui!", - "Home Sweet Home!": "Casa dolce casa!", - "Mode penalty: -2 health": "Modalità penalità: -2 punti vita", - "You don't have a home!": "Non hai una casa!", - "You can't go home from here!": "Non puoi andare a casa da qui", "Leather Armor": "Armatura di pelle", "Snake Armor": "Armatura di serpenti", "Iron Armor": "Armatura di ferro", @@ -63,7 +206,6 @@ "Empty Bucket": "Secchio vuoto", "Water Bucket": "Secchio d'acqua", "Lava Bucket": "Secchio di lava", - " Bucket": " Secchio", "Red Clothes": "Vestiti rossi", "Blue Clothes": "Vestiti blu", "Green Clothes": "Vestiti verdi", @@ -93,7 +235,7 @@ "Skeleton Spawner": "Generatore di scheletri", "Snake Spawner": "Generatore di serpenti", "Knight Spawner": "Generatore di cavalieri", - "AirWizard Spawner": "Generatore di mago del vento", + "AirWizard Spawner": "Generatore di maghi del vento", "Workbench": "Banco da lavoro", "Oven": "Forno", "Furnace": "Fornace", @@ -125,19 +267,17 @@ "Leather": "Pelle", "Wheat": "Grano", "Key": "Chiave", - "Arrow": "Freccia", - "String": "Corda", "Coal": "Carbone", "Iron Ore": "Ferro grezzo", - "Lapis": "Lapislazzuli", "Gold Ore": "Oro grezzo", + "Gem Ore": "Gemma grezza", + "Cloud Ore": "Oro del cielo", "Iron": "Ferro", "Gold": "Oro", + "Lapis": "Lapislazzuli", "Rose": "Rosa", "GunPowder": "Polvere da sparo", "Slime": "Slime", - "Glass": "Vetro", - "Cloth": "Stoffa", "Scale": "Squama", "Shard": "Coccio", "Flower": "Fiore", @@ -148,10 +288,10 @@ "Plank Wall": "Muro d'assi", "Wood Door": "Porta di legno", "Stone Brick": "Mattone di pietra", - "Ornate Stone": "Pietra d'ornamento", + "Ornate Stone": "Pietra ornamentale", "Stone Wall": "Muro di pietra", "Stone Door": "Porta di pietra", - "Obsidian Brick": "Mattono d'ossidiana", + "Obsidian Brick": "Mattone d'ossidiana", "Ornate Obsidian": "Ornamento d'ossidiana", "Obsidian Wall": "Muro d'ossidiana", "Obsidian Door": "Porta d'ossidiana", @@ -184,7 +324,6 @@ "Claymore": "Claymore", "Shears": "Cesoie", "Torch": "Torcia", - "Gem Ore": "Gemma grezza", "Wood Planks": "Assi di legno", "Stone Bricks": "Mattoni di ferro", "Obsidian": "Ossidiana", @@ -204,147 +343,131 @@ "Hard Rock": "Terra dura", "Infinite Fall": "Caduta infinita", "Cloud Cactus": "Cactus di nuvole", - "Ore": "grezzo", - "host not found": "host non trovato", - "unable to get localhost address": "impossibile ricevere l'indirizzo localhost", - "World Saved!": "Mondo salvato!", - "On": "On", - "Off": "Off", - "There is nothing of use here.": "Non c'è nulla da usare qui.", - "Still nothing... :P": "Ancora niente... :P", - "Have:": "Hai:", - "Cost:": "Costo:", - "Time: ": "Tempo: ", - "Score: ": "Punteggio: ", - "Quit": "Esci", - "Respawn": "Respawn", - "You died! Aww!": "Sei morto! Aww!", - "Player Score: ": "Punteggo del giocatore: ", - "": "", - "Final Score: ": "Punteggio finale: ", - "Exit to Menu": "Esci al menù", - "Time Played: ": "Tempo di gioco: ", - "Current Score: ": "Punteggio attuale: ", - "Exit": "Esci", - "Player Stats": "Statistiche del giocatore:", - "Controls": "Controlli", - "Press the desired": "Premi la desiderata", - "key sequence": "sequenza di tasti", - "minicraft.display.key_input.confirm_popup": "Sei sicuro di voler ripristinare le sequenza di tasti a quelle predefinite?", - "minicraft.display.popup.enter_confirm": "invio per confermare", - "minicraft.display.popup.escape_cancel": "esc per annullare", - "Confirm Action": "Conferma", - "Press C/Enter to change key binding": "Premi C/Invio per cambiare il tasto", - "Press A to add key binding": "Premi A per aggiungere una sequenza di tasti", - "Shift-D to reset all keys to default": "Maiusc-D per ripristinare tutte le sequenze di tasti a quelle predefinite", - "ESCAPE to Return to menu": "ESC per ritornare al menù", - "Loading": "Caricamento", - "Generating": "Generazione", - "World": "Mondo", - "waiting...": "attesa...", - "nothing": "nulla", - "attempting log in": "tentando di entrare", - "no internet connection, but no login data saved; cannot enter offline mode.": "no connessione internet, ma niente dati di login, non puoi entrare la modalità offline.", - "connecting to server": "connessione al server", - "logging in": "entrando", - "saving credentials": "salvando le credenziali", - "login failed.": "Login fallito. F", - "problem with saved login data; please exit and login again.": "problemi con il salvataggio dei dati di login, per favore esci e rientra.", - "Internal server error: Couldn't fetch username from uuid": "Errore del server interno: non è possibile ricevere il nome utente dall'UUID", - "logged in as: ": "entrato come: ", - "offline mode: local servers only": "modalità offline: solo server interni", - "Enter ip address to connect to:": "Inserisci l'indirizzo IP alla quale connettersi:", - "Press Shift-Escape to logout": "Premi Maiusc-Esc per uscire dall'account", - "Enter email:": "Inserisci email:", - "Enter password:": "Inserisci la password:", - "field is blank": "campo vuoto", - "get an account at:": "fai un account a:", - "Loading ": "Caricamento ", - " from server": " dal server", - "Could not connect to server:": "Impossibile connettersi al server:", - "Press ": "Premi ", - " to return": " per ritornare", - "Change Key Bindings": "Cambia tasti", - "Options": "Opzioni", - "Change language": "Cambia linguaggio", - "Return to Game": "Ritorna al gioco", - "Make World Multiplayer": "Crea mondo multiplayer", - "Save Game": "Salva gioco", - " and ": " e ", - " to Scroll": " per scendere", - ": Choose": ": Scegli", - "Paused": "Pausa", - "Main Menu": "Menù", - "Yes": "Si", - "No": "No", - "Inventory": "Inventaeio", - "to search.": "per cercare.", - "Play": "Gioca", - "Load World": "Carica mondo", - "New World": "Nuovo mondo", - "Multiplayer": "Multiplayer", - "Singleplayer": "Singlolo giocatore", - "Help": "Aiuto", - "Instructions": "Istruzioni", - "Storyline Guide": "Guiida alla storia", - "About": "Info", - "Credits": "Crediti", - " to select": " per selezionare", - " to accept": " per accettare", - "New World Name:": "Nome del nuovo mondo:", - "Are you sure you want to delete": "Sei sicuro di voler eliminare", - "This can not be undone!": "Questo non può essere fatto!", - " to confirm": " per confermare", - " to cancel": " per annullare", - "World Seed": "Seme del mondo", - "Enter World Name": "Inserisci nome del mondo", - "Trouble with world name?": "Problemi col nome del mondo?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "secondo le impostazioni predefinite, w e s muovono il cursore su e giu'. Questo puo' essere cambiato nel menu dei tasti. Per scrivere la lettera invece di scorrere, tieni premuto shift mentre stai scrivendo.", - "Create World": "Crea Mondo", - "World Gen Options": "Opzioni di generazione del mondo", - " to Copy": " per copiare", - " to Rename": " per rinominare", - " to Delete": " per eliminare", - "Select World": "seleziona mondo", - "Select a World to Delete": "seleziona un mondo da eliminare", - "Select a World to Rename": "seleziona un mondo da rinominare", - "Select a World to Copy": "Seleziona un mondo da copiare", - "Higher version, cannot load world!": "Versione troppo nuova, il mondo non può essere caricato", - "World Version:": "Versione del mondo:", - "Languages": "Lingue", - "Language": "Lingua", - "Select": "Seleziona", - "Max FPS": "FPS massimi", - "Difficulty": "Difficoltà", - "Easy": "Facile", - "Normal": "Normale", - "Hard": "Difficile", - "Game Mode": "Modalità", - "Survival": "Sopravvivenza", - "Creative": "Creativa", - "Hardcore": "Hardcore", - "Score": "Punteggio", - "Time (Score Mode)": "Tempo (Modalità punteggio)", - "Sound": "Suono", - "Autosave": "Autosalvataggi", - "World Size": "Dimensione del mondo", - "World Theme": "Tema del mondo", - "Forest": "Foresta", - "Desert": "Deserto", - "Plain": "Piatto", - "Hell": "Inferno", - "Terrain Type": "Tipo di terreno", - "Island": "Isola", - "Box": "Scatola", - "Mountain": "Montagna", - "Irregular": "Irregolare", - "Wear Suit": "Indossa vestito", - "You have the latest version.": "Hai l'ultima versione.", - "minicraft.display.skin": "Skin", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul col mantello", - "minicraft.skin.minecraft_steve": "Ragazzo familiare", - "minicraft.skin.minecraft_alex": "Ragazza familiare", - "minicraft.notification.invalid_placement": "Può essere collocato solo su", - "minicraft.notification.dig_hole": "Scavare una buca prima!" + "Raw Obsidian": "Ossidiana grezza", + "Totem of Air": "Totem dell'aria", + "minicraft.control_guide.attack": "Usa %s per attaccare i mostri o distruggere le piastrelle.", + "minicraft.control_guide.craft": "Usa %s per aprire il menù di creazione.", + "minicraft.control_guide.menu": "Usa %s per aprire l'inventario.", + "minicraft.control_guide.move": "Usa %s per muoverti.", + "minicraft.displays.controls": "Controlli", + "minicraft.displays.controls.display.controller": "Joystick", + "minicraft.displays.controls.display.controller.00": "Muovi il giocatore con gli analogici", + "minicraft.displays.controls.display.controller.01": "Muovi il cursore con gli analogici", + "minicraft.displays.controls.display.controller.02": "Seleziona con il tasto A", + "minicraft.displays.controls.display.controller.03": "Esci dalle pagine con il tasto B", + "minicraft.displays.controls.display.controller.04": "Attaccare entità, distruggere e interagire con la piestrelle con il tasto A", + "minicraft.displays.controls.display.controller.05": "Aprire i menù di gioco con il tasto X", + "minicraft.displays.controls.display.controller.06": "Aprire i menù di creazione con il tasto Y", + "minicraft.displays.controls.display.controller.07": "Raccogli gli arredamenti con il Grilletto di Sinistra", + "minicraft.displays.controls.display.controller.08": "Butta un oggetto con il Grilletto di Destra", + "minicraft.displays.controls.display.controller.09": "Butta una pila di oggetti schiacciando l'Analogico di Destra", + "minicraft.displays.controls.display.controller.10": "Usa il tasto START per Attivare/Disattivare la barra di ricerca nel menù dell'oggetto", + "minicraft.displays.controls.display.controller.11": "Usa il tasto START per mettere in pausa il gioco", + "minicraft.displays.controls.display.controller.12": "Usa il tasto X per Attivare/Disattivare la tastiera a schermo", + "minicraft.displays.controls.display.controller.13": "Usa il tasto B come scorciatoia per lo spazio nella tastiera a schermo", + "minicraft.displays.controls.display.controller.14": "Usa il tasto X per rimuovere l'oggetto selezionato nell'inventario in modalità creativa", + "minicraft.displays.controls.display.controller.15": "Usa il tasto Y per rimuovere un'intera pila di oggetti dall'inventario in modalità creativa", + "minicraft.displays.controls.display.controller.desc.0": "Debugging delle mappe non accessibile", + "minicraft.displays.controls.display.controller.desc.1": "Mappe Dettagliate non utilizzabili", + "minicraft.displays.controls.display.help.0": "%s/%s per vedere altri controlli.", + "minicraft.displays.controls.display.keyboard": "Tastiera", + "minicraft.displays.controls.display.keyboard.00": "Muovere il giocatore con MOVIMENTO-(DIREZIONE)", + "minicraft.displays.controls.display.keyboard.01": "Muovere il cursore con CURSORE-(DIREZIONE)", + "minicraft.displays.controls.display.keyboard.02": "Seleziona con il tasto SELEZIONA", + "minicraft.displays.controls.display.keyboard.03": "Esci dalle pagine con il tasto ESCI", + "minicraft.displays.controls.display.keyboard.04": "Salvataggio rapido con SALVATAGGIO-RAPIDO", + "minicraft.displays.controls.display.keyboard.05": "Attaccare entità, distruggere e interagire con le piastrelle con ATTACCO", + "minicraft.displays.controls.display.keyboard.06": "Aprire i menù di gioco con MENU", + "minicraft.displays.controls.display.keyboard.07": "Aprire i menù di creazione con CREAZIONE", + "minicraft.displays.controls.display.keyboard.08": "Raccogli gli arredamenti con RACCOLTA", + "minicraft.displays.controls.display.keyboard.09": "Butta un oggetto con BUTTA-UNO", + "minicraft.displays.controls.display.keyboard.10": "Butta una pila di oggetti con BUTTA-PILA", + "minicraft.displays.controls.display.keyboard.11": "Usa BARRA-DI-RICERCA per Attivare/Disattivare la barra di ricerca nel menù dell'oggetto", + "minicraft.displays.controls.display.keyboard.12": "Consulta i risultati di ricerca con PAGINA-SU/GIU'", + "minicraft.displays.controls.display.keyboard.13": "Usa PAUSA per mettere in pausa il gioco", + "minicraft.displays.controls.display.keyboard.14": "Attiva/Disattiva gli effetti della pozione con POZIONEEFFETTI", + "minicraft.displays.controls.display.keyboard.15": "Attiva/Disattiva la semplificazione delle pozioni con POZIONEEFFETTISEMPL", + "minicraft.displays.controls.display.keyboard.16": "Espanzione moderata della schermata delle quest con QUESTSCHERMATAESPANDI", + "minicraft.displays.controls.display.keyboard.17": "Attiva/Disattiva l'HDU con ALTERNAHUD", + "minicraft.displays.controls.display.keyboard.18": "Fai uno screenshot con SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Mostra informazioni in-gioco con INFO", + "minicraft.displays.controls.display.keyboard.20": "Attiva/Disattiva lo schermo intero con SCHERMOINTERO", + "minicraft.displays.controls.display.keyboard.21": "Usa D per rimuovere l'oggetto selezionato dall'inventario in modalità creativa", + "minicraft.displays.controls.display.keyboard.22": "Usa MAIUSC-D per rimuovere l'intera pila di articoli nell'inventario in modalità creativa", + "minicraft.displays.controls.display.keyboard.desc": "Debug delle mappe non spiegato", + "minicraft.displays.loading.message.dungeon_regeneration": "Rigenerazione B4", + "minicraft.displays.loading.message.quests": "Quest", + "minicraft.displays.loading.regeneration_popup.display.0": "Una vecchia versione del dungeon (piano B4) è stata rilevata.", + "minicraft.displays.loading.regeneration_popup.display.1": "Rigenerazione necessaria.", + "minicraft.displays.loading.regeneration_popup.display.2": "I dati vecchi in quel piano verranno cancellati:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s per continuare", + "minicraft.displays.loading.regeneration_popup.display.4": "%s per annullare il caricamento del mondo", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Caricamento del mondo annullato", + "minicraft.displays.quests.display.no_quest": "Nessuna quest sbloccata", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Sono accettati solo input dalla tastiera.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Premere %s per esaminare i dettagli del tutorial attuale.", + "minicraft.notification.obsidian_knight_defeated": "Cavaliere d'Ossidiana: sconfitto!", + "minicraft.notification.obsidian_knight_awoken": "Il Cavaliere d'Ossidiana si è risvegliato!", + "minicraft.notification.defeat_obsidian_knight_first": "Devi prima sconfiggere il Cavaliere d'Ossidiana.", + "minicraft.notification.wrong_level_dungeon": "Può essere evocato solo al livello dei dungeon", + "minicraft.notification.boss_limit": "Non possono essere generati altri boss", + "minicraft.notification.spawn_on_boss_tile": "Può essere evocato solo in una Stanza del Boss", + "minicraft.notifications.statue_tapped": "Senti echeggiare dei sussurri...", + "minicraft.notifications.statue_touched": "Senti vibrare la statua...", + "minicraft.quest.farming": "Contadino che lavora", + "minicraft.quest.farming.crafting_hoe": "Creare una zappa", + "minicraft.quest.farming.crafting_hoe.description": "Creare qualunque zappa dal banco da lavoro", + "minicraft.quest.farming.description": "Le basi dell'essere un contadino.", + "minicraft.quest.farming.getting_wheat": "Raccolta di grano", + "minicraft.quest.farming.getting_wheat.description": "Raccolta di grano rompendo il grano maturo.", + "minicraft.quest.farming.making_farmland": "Creare una fattoria", + "minicraft.quest.farming.making_farmland.description": "Creare una fattoria con una zappa interagento con le pistrelle di terra.", + "minicraft.quest.farming.planting_potato": "Piantare una patata", + "minicraft.quest.farming.planting_potato.description": "Piantare una patata nella fattoria", + "minicraft.quest.farming.planting_wheat": "Piantare il grano", + "minicraft.quest.farming.planting_wheat.description": "Piantare il grano con i semi nella fattoria.", + "minicraft.quest.gems": "Via delle Gemme", + "minicraft.quest.gems.description": "Preparare equipaggiamenti di gemme.", + "minicraft.quest.gems.gem_armor": "Maestro della Protezione", + "minicraft.quest.gems.gem_armor.description": "Ottenere un'armatura di gemme.", + "minicraft.quest.gems.gem_claymore": "Maestro dell'Arma", + "minicraft.quest.gems.gem_claymore.description": "Ottenere una spada di gemme.", + "minicraft.quest.iron_equipments": "Maestro del Ferro", + "minicraft.quest.iron_equipments.description": "Ottenere gli equipaggiamenti di ferro.", + "minicraft.quest.iron_equipments.getting_more_iron": "Ricco in ferro", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Ottenere più ferro.", + "minicraft.quest.iron_equipments.iron_armor": "Migliorara un'armatura", + "minicraft.quest.iron_equipments.iron_armor.description": "Migliorare l'armatura di ferro.", + "minicraft.quest.iron_equipments.iron_tools": "Migliorare tutti gli utensili", + "minicraft.quest.iron_equipments.iron_tools.description": "Trasformare gli utensili in utensili di ferro.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Piccozza avanzata", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Migliorare la piccozza.", + "minicraft.quest.potions": "Maestro delle Pozioni", + "minicraft.quest.potions.all_potions_prepared": "Studioso delle Pozioni", + "minicraft.quest.potions.all_potions_prepared.description": "Ottenere tutte le pozioni in una volta.", + "minicraft.quest.potions.awkward_potions": "Pozione Strana", + "minicraft.quest.potions.awkward_potions.description": "Ottenere una pozione strana.", + "minicraft.quest.potions.description": "Ottenere le pozioni.", + "minicraft.quest.potions.powerful_potions": "Pozioni potenti", + "minicraft.quest.potions.powerful_potions.description": "Ottenere pozioni utili e potenti.", + "minicraft.tutorial.getting_rocks": "Ottenere Pietra e Carbone", + "minicraft.tutorial.getting_rocks.description": "Ottenere almeno 5 oggetti di Pietra e 5 di Carbone distruggendo rocce con la piccozza craftata.", + "minicraft.tutorial.getting_wood": "Ottenere più legno", + "minicraft.tutorial.getting_wood.description": "Ottenere almeno 10 oggetti di legno dagli alberi.", + "minicraft.tutorial.getting_wooden_pickaxe": "Ottenere una piccozza di legno.", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Creare una piccozza di legno nel menù di creazione con il banco di lavoro.", + "minicraft.tutorial.getting_workbench": "Ottenere un bagno di lavoro", + "minicraft.tutorial.getting_workbench.description": "Creare un banco di lavoro nel menù di creazione. E piazzarlo.", + "minicraft.tutorial.start_getting_wood": "L'inizio di tutto", + "minicraft.tutorial.start_getting_wood.description": "Attacca continuamente gli alberi per ottenere il legno.", + "minicraft.display.options_display.language": "Lingua", + "minicraft.display.options_display.resource_packs": "Pacchetti di risorse", + "minicraft.displays.language_settings.title": "Lingua...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Freccia", + "String": "Corda", + "Glass": "Vetro", + "Cloth": "Stoffa" } diff --git a/src/client/resources/assets/localization/nb-no.json b/src/client/resources/assets/localization/nb-no.json index 00824fe8d..1ee8e7072 100644 --- a/src/client/resources/assets/localization/nb-no.json +++ b/src/client/resources/assets/localization/nb-no.json @@ -31,39 +31,171 @@ "minicraft.achievement.airwizard.desc": "Beseire den første lufttrollmannen!", "minicraft.achievement.skin": "Fashion Show", "minicraft.achievement.skin.desc": "Endre utseendet ditt.", - "minicraft.display.achievement": "Oppnåelser", - "minicraft.display.achievement.achieved": "Oppnådd!", - "minicraft.display.achievement.not_achieved": "Ikke oppnådd", - "minicraft.display.achievement.score": "Oppnåelse score:", - "minicraft.display.key_input.confirm_popup": "Er du sikker på at du vil resette alle tastene?", + "minicraft.display.entries.boolean.false": "Av", + "minicraft.display.entries.boolean.true": "På", + "minicraft.display.gui.link_opening": "Åpner med nettleser...", + "minicraft.display.gui.perm_status.saving": "Lager... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Trykk på %s for å avbryte", + "minicraft.display.gui.perm_status.sleeping": "Sover...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s for å gjømme!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Nåværende stilling: %s", + "minicraft.display.gui.score.time_left": "Tid igjen %s%sm %ss", + "minicraft.display.menus.inventory": "Inventar", + "minicraft.display.options_display": "Instillinger", + "minicraft.display.options_display.change_key_bindings": "Endre tastaturoppsett", "minicraft.display.popup.enter_confirm": "Enter for å bekrefte", "minicraft.display.popup.escape_cancel": "Escape for åvbyte", - "minicraft.display.skin": "Utseender", + "minicraft.display.popup.title_confirm": "Bekreft handling", + "minicraft.displays.achievements": "Oppnåelser", + "minicraft.displays.achievements.display.achieved": "Oppnådd!", + "minicraft.displays.achievements.display.help": "Bruk %s og %s for å bevege deg.", + "minicraft.displays.achievements.display.not_achieved": "Ikkje oppnådd", + "minicraft.displays.achievements.display.score": "Stilling av oppnåelser: %s", + "minicraft.displays.book.default_book": "Denne boka har ingen tekst.", + "minicraft.displays.crafting": "Skaping", + "minicraft.displays.crafting.container_title.cost": "Koster:", + "minicraft.displays.crafting.container_title.have": "Har:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Endelig stilling: %s", + "minicraft.displays.end_game.display.player_score": "Spillers stilling: %s", + "minicraft.displays.end_game.display.unlocked": "Låst opp! Det tok %s", + "minicraft.displays.end_game.exit": "Gå tilbake til meny", + "minicraft.displays.info.display.exit_help": "%s/%s:Lukk", + "minicraft.displays.info.display.score": "Nåværende stilling: %s", + "minicraft.displays.info.display.time": "Tid spillt: %s", + "minicraft.displays.info.title": "Statistikk", + "minicraft.displays.key_input.display.help.0": "Trykk på C/Enter for å endre bindinger", + "minicraft.displays.key_input.display.help.1": "Trykk på A for å legge til binding", + "minicraft.displays.key_input.display.help.2": "Shift-D for å stille bindingene tilbake til standard", + "minicraft.displays.key_input.display.help.3": "%s for å gå tilbake til meny", + "minicraft.displays.key_input.popup_display.confirm_reset": "Er du sikker på at du vil stille alle tastebindinger tilbake til standard?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Trykk på den ønskede tastesekvensen", + "minicraft.displays.key_input.title": "Kontroller", + "minicraft.displays.loading.message.entities": "Enheter", + "minicraft.displays.loading.message.generating": "Genererer", + "minicraft.displays.loading.message.level": "Nivå %s", + "minicraft.displays.loading.message.levels": "Nivåer", + "minicraft.displays.loading.message.loading": "Laster", + "minicraft.displays.loading.message.saving": "Lagrer", + "minicraft.displays.loading.message.world": "Verden", + "minicraft.displays.options_main_menu": "Hovedmenyinstillinger", + "minicraft.displays.options_main_menu.resource_packs": "Resurspakker", + "minicraft.displays.options_world": "Verdensinstillinger", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Er du sikker på at du vil sku av spillmanualen permanent?", + "minicraft.displays.options_world.turn_off_tutorials": "Sku av spillmanual", + "minicraft.displays.pause": "Pauset", + "minicraft.displays.pause.display.exit_popup.0": "Er du sikker på at du ønsker å lukke spillet?", + "minicraft.displays.pause.display.exit_popup.1": "All ulagra framgang vil gå tapt", + "minicraft.displays.pause.display.exit_popup.cancel": "Avbryt", + "minicraft.displays.pause.display.exit_popup.quit": "Lukk uten å lagre", + "minicraft.displays.pause.display.help.choose": "%s: Velg", + "minicraft.displays.pause.display.help.scroll": "%s og %s for å skrolle", + "minicraft.displays.pause.menu": "Hovedmeny", + "minicraft.displays.pause.return": "Gå tilbake til spill", + "minicraft.displays.pause.save": "Lagre spill", + "minicraft.displays.player_death.display.score": "Stilling: %s", + "minicraft.displays.player_death.display.time": "Tid: %s", + "minicraft.displays.player_death.quit": "Lukk program", + "minicraft.displays.player_death.respawn": "Start på nytt", + "minicraft.displays.player_death.save_quit": "Lagre og lukk program", + "minicraft.displays.player_death.title": "Du døde! Bedre lykke neste gang!", + "minicraft.displays.player_inv.container_title.items": "Gjenstander", + "minicraft.displays.player_inv.display.help": "(%s) for å søke.", + "minicraft.displays.quests": "Oppgaver", + "minicraft.displays.quests.display.header.completed": "Ferdig", + "minicraft.displays.quests.display.header.unlocked": "Låst opp", + "minicraft.displays.quests.display.no_quest_desc": "Ingen oppgave", + "minicraft.displays.resource_packs.display.help.move": "Brul %s og %s for bevege.", + "minicraft.displays.resource_packs.display.help.select": "%s for å eksaminere.", + "minicraft.displays.resource_packs.display.help.position": "Shift-[Venstetast|Høyretast|Opptast|Nedtast] for å bevege ressurspakker. ", + "minicraft.displays.resource_packs.display.title": "Resurspakker", + "minicraft.displays.skin": "Drakter", + "minicraft.displays.skin.display.help.move": "Bruk %s og %s for å bevege.", + "minicraft.displays.skin.display.help.select": "%s for å velge og %s for å kansellere.", + "minicraft.displays.title.display.cannot_check": "Kunne ikke skjekke etter oppdateringer.", + "minicraft.displays.title.display.checking": "Skjekker etter oppdateringer...", + "minicraft.displays.title.display.help.0": "(%s, %s for å velge)", + "minicraft.displays.title.display.help.1": "(%s for å akseptere)", + "minicraft.displays.title.display.help.2": "(%s for å gå tilbake)", + "minicraft.displays.title.display.latest_already": "Du har den nyeste versjonen.", + "minicraft.displays.title.display.new_version": "Ny: %s", + "minicraft.displays.title.display.version": "Versjon %s", + "minicraft.displays.title.help": "Hjelp", + "minicraft.displays.title.help.about": "Om spillet", + "minicraft.displays.title.help.credits": "Akkreditasjon", + "minicraft.displays.title.help.instructions": "Instrukser", + "minicraft.displays.title.help.storyline_guide": "Historieomviser", + "minicraft.displays.title.link_to_version": "Direktelink til nyeste versjon: %s", + "minicraft.displays.title.play": "Spill", + "minicraft.displays.title.play.load_world": "Last verden", + "minicraft.displays.title.play.new_world": "Ny verden", + "minicraft.displays.title.quit": "Lukk spill", + "minicraft.displays.title.select_to_download": "--Trykk her for å laste ned--", + "minicraft.displays.world_gen.create_world": "Lag verden", + "minicraft.displays.world_gen.enter_world": "Skriv inn navnet til verdenen", + "minicraft.displays.world_gen.title": "Verdengenerator-instillinger", + "minicraft.displays.world_gen.troublesome_input": "Problemer med navnet til verdenen?", + "minicraft.displays.world_gen.troublesome_input.msg": "", + "minicraft.displays.world_gen.world_seed": "Verdengenerator-frø", + "minicraft.displays.world_select.display.help.0": "%s for å bekrefte", + "minicraft.displays.world_select.display.help.1": "%s for å gå tilbake", + "minicraft.displays.world_select.display.help.2": "Shift-C for å kopiere", + "minicraft.displays.world_select.display.help.3": "Shift-R for å endre navn", + "minicraft.displays.world_select.display.help.4": "Shift-d for slette", + "minicraft.displays.world_select.display.world_too_new": "Nyere versjon, kan ikke laste verden!", + "minicraft.displays.world_select.display.world_version": "Verdens spillversjon: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s for å avbryte", + "minicraft.displays.world_select.popups.display.change": "Nytt navn:", + "minicraft.displays.world_select.popups.display.confirm": "%s for å bekrefte", + "minicraft.displays.world_select.popups.display.delete": "Er du sikker på at du vil slette\n%s\"%s\"%s?\nDette er en irreversibel handling!", + "minicraft.displays.world_select.select_world": "Velg verden", + "minicraft.notification.achievement_unlocked": "Oppnåelse låst opp:", + "minicraft.notification.air_wizard_defeated": "Lufttrollmann bekjempet!", + "minicraft.notification.cannot_sleep": "Kan ikkje sove! %s:%s igjen!", + "minicraft.notification.death_chest_retrieved": "Dødskiste plukket opp!", + "minicraft.notification.defeat_air_wizard_first": "Lufttrollmannen må bekjempes først.", + "minicraft.notification.dig_hole": "Grav et hull først!", + "minicraft.notification.dungeon_opened": "Hulen er nå åpen!", + "minicraft.notification.gem_pickaxe_required": "Juvelsteinhakke er krevd.", + "minicraft.notification.invalid_placement": "Kan kun bli plassert på", + "minicraft.notification.quest_completed": "Oppgave gjennomført", + "minicraft.notification.quest_unlocked": "Oppgave låst opp", + "minicraft.notification.world_saved": "Lagret verden!", + "minicraft.notification.wrong_level_sky": "Kan kun bli framkalt i skyene", + "minicraft.settings.fps": "Maks FPS", + "minicraft.settings.difficulty": "Vanskelighetsgrad", + "minicraft.settings.difficulty.easy": "Lett", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Vanskelig", + "minicraft.settings.mode": "Spillmodus", + "minicraft.settings.mode.survival": "Overlevelse", + "minicraft.settings.mode.creative": "Kreativ", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Stilling", + "minicraft.settings.scoretime": "Tid (Stillingmodus)", + "minicraft.settings.screenshot_scale": "Skala til skjermbilde", + "minicraft.settings.sound": "Lyd", + "minicraft.settings.autosave": "Lagre automatisk", + "minicraft.settings.size": "Størrelse på verden", + "minicraft.settings.theme": "Tema på verden", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.forest": "Skog", + "minicraft.settings.theme.desert": "Ørken", + "minicraft.settings.theme.plain": "Slette", + "minicraft.settings.theme.hell": "Helvete", + "minicraft.settings.type": "Terrengtype", + "minicraft.settings.type.island": "Øy", + "minicraft.settings.type.box": "Boks", + "minicraft.settings.type.mountain": "Fjell", + "minicraft.settings.type.irregular": "Unormalt", "minicraft.skin.paul": "Pål", "minicraft.skin.paul_cape": "Pål med kappe", "minicraft.skin.minecraft_steve": "Gjenkjennelig gutt", "minicraft.skin.minecraft_alex": "Gjenkjennelig jente", - "minicraft.notification.invalid_placement": "Kan kun bli plassert på", - "minicraft.notification.dig_hole": "Grav et hull først!", - "minicraft.notification.achievement_unlocked": "Oppnåelse låst opp:", - "You have the latest version.": "Du har den nyeste versjonen.", - "Entities": "Enheter", - "Air Wizard: Defeated!": "Luft Trollmann: Slått", - "The Dungeon is now open!": "Fangehullet er nå åpent!", - "A costume lies on the ground...": "Et kostyme ligger på bakken...", - "Can't sleep!": "Kan ikke sove!", - "Min ": "Minst ", - " Sec left!": " sekunder igjen!", - "You hear a noise from the surface!": "Du hører en lyd fra overflaten!", + "minicraft.text_particales.key_consumed": "-1 nøkkel", "Death Chest": "Døds Kiste", "Player": "Spiller", - "Crafting": "Sløyd", - "Set your home!": "Velg hjem!", - "Can't set home here!": "Kan ikke sette hjem her!", - "Home Sweet Home!": "Hjem kjære hjem!", - "Mode penalty: -2 health": "Modus straff: -2 helse", - "You don't have a home!": "Du har ikke et hjem!", - "You can't go home from here!": "Du kan ikke gå hjem herfra!", "Leather Armor": "Lær rustning", "Snake Armor": "Slange rustning", "Iron Armor": "Jern rustning", @@ -74,7 +206,6 @@ "Empty Bucket": "Tom Bøtte", "Water Bucket": "Vann Bøtte", "Lava Bucket": "Lava Bøtte", - " Bucket": " Bøtte", "Red Clothes": "Røde Klær", "Blue Clothes": "Blå Klær", "Green Clothes": "Grønne Klær", @@ -136,8 +267,6 @@ "Leather": "Lær", "Wheat": "Hvete", "Key": "Nøkkel", - "Arrow": "Pil", - "String": "Tråd", "Coal": "Kull", "Iron Ore": "Jernmalm", "Gold Ore": "Gullmalm", @@ -149,8 +278,6 @@ "Rose": "Rose", "GunPowder": "Krutt", "Slime": "Slim", - "Glass": "Glass", - "Cloth": "Tøystykke", "Scale": "skala", "Shard": "Fragment", "Flower": "Blomst", @@ -218,134 +345,129 @@ "Cloud Cactus": "Sky kaktus", "Raw Obsidian": "Rå obsidian", "Totem of Air": "Totem av luft", - - "host not found": "finner ikke verten", - "unable to get localhost address": "kan ikke hente localhost adressen", - "World Saved!": "Verden Lagret!", - "On": "På", - "Off": "Av", - "Have:": "Har:", - "Cost:": "Kostnad:", - "Time: ": "Tid: ", - "Score: ": "Poeng: ", - "Quit": "Avslutt", - "Respawn": "Gjennoppstå", - "You died! Aww!": "Du døde! Aww!", - "Player Score: ": "Spiller poeng: ", - "": "", - "Final Score: ": "Endelig poeng: ", - "Exit to Menu": "Avslutt til menyen", - "Time Played: ": "Tid Spillt: ", - "Current Score: ": "Nåværende poeng: ", - "Exit": "Gå ut", - "Player Stats": "Spiller statistikk", - "Controls": "Kontroller", - "Press the desired": "Trykk ønsket", - "key sequence": "tastesekvens", - "Confirm Action": "Bekreft handling", - "Press C/Enter to change key binding": "Trykk C/Enter for å endre tast", - "Press A to add key binding": "Trykk A for å legge til tastebinding", - "Shift-D to reset all keys to default": "Shift-D for å resette alle tastene", - "ESCAPE to Return to menu": "ESC for å gå tilbake til menyen ", - "Loading": "Laster", - "Generating": "Genererer", - "World": "Verden", - "waiting...": "venter...", - "nothing": "ingenting", - "attempting log in": "forsøker å logge inn", - "no internet connection, but no login data saved; cannot enter offline mode.": "ingen internett tilgang, og ingen login data lagret; kan ikke gå i offline modus.", - "connecting to server": "kobler til serveren", - "logging in": "logger inn", - "saving credentials": "lagrer legitimasjon", - "login failed.": "login mislyktes.", - "problem with saved login data; please exit and login again.": "problemer med lagret login data; vennligst logg inn på nytt.", - "Internal server error: Couldn't fetch username from uuid": "Intern server feil: Kunne ikke hente brukernavn fra uuid", - "logged in as: ": "logget inn som: ", - "offline mode: local servers only": "offline modus: bare lokale servere", - "Enter ip address to connect to:": "Skriv inn ipadressen du vil koble til", - "Press Shift-Escape to logout": "Trykk Shift-Escape for å logge ut", - "Enter email:": "Skriv email:", - "Enter password:": "Skriv passord:", - "field is blank": "feltet er tomt", - "get an account at:": "få en bruker på:", - "Loading ": "Laster ", - " from server": " fra server", - "Could not connect to server:": "Kunne ikke koble til server:", - "Press ": "Trykk ", - " to return": " for å avbryte", - "Change Key Bindings": "Endre tastene", - "Options": "Innstilinger", - "Change language": "Skift språk", - "Return to Game": "Gå tilbake til spillet", - "Make World Multiplayer": "Gjør verdenen til flerspiller", - "Save Game": "Lagre spill", - " and ": " og ", - " to Scroll": " for å skrolle", - ": Choose": ": Velg", - "Paused": "Pauset", - "Main Menu": "Hovedmeny", - "Yes": "Ja", - "No": "Nei", - "Inventory": "Inventar", - "to search.": "for å søke.", - "Play": "Start spill", - "Load World": "Last verden", - "New World": "Ny verden", - "Multiplayer": "Flerspiller", - "Singleplayer": "Enspiller", - "Help": "Hjelp", - "Instructions": "Instruksjoner", - "Storyline Guide": "Historie guide", - "About": "Om spillet", - "Credits": "Credits", - " to select": " for å velge", - " to accept": " for å akseptere", - "New World Name:": "Nytt navn:", - "Are you sure you want to delete": "Er du sikker på at du vil slette", - "This can not be undone!": "Du kan ikke angre dette!", - " to confirm": " for å bekrefte", - " to cancel": " for å avbryte", - "World Seed": "Verden frø", - "Enter World Name": "Navn på verden", - "Trouble with world name?": "Problemer med navnet?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "vanligvis brukes w og s til å flytte pekeren opp og ned. Dette kan du endre i key binding menyen. For å skrive i stedet for å flytte pekeren kan du holde inne shift knappen.", - "Create World": "Lag verden", - "World Gen Options": "Verden instillinger", - " to Copy": " for å kopiere", - " to Rename": " for å gi nytt navn", - " to Delete": " for å slette", - "Select World": "Velg verden", - "Select a World to Delete": "Velg en verden til å Slette", - "Select a World to Rename": "Velg en verden til å endre navn", - "Select a World to Copy": "Velg en verden til å Kopiere", - "Higher version, cannot load world!": "Høyere versjon, kan ikke laste verden!", - "World Version:": "Verden Versjon:", - "Languages": "Språkmeny", - "Language": "Språk", - "Select": "Velg", - "Max FPS": "Maks FPS", - "Difficulty": "Vanskelighetsgrad", - "Easy": "Lett", - "Normal": "Normal", - "Hard": "Vanskelig", - "Game Mode": "Spillmodus", - "Survival": "Overlevelse", - "Creative": "Kreativ", - "Hardcore": "Hardcore", - "Score": "Poeng", - "Time (Score Mode)": "Tid (Poeng modus)", - "Sound": "Lyd", - "Autosave": "Autolagre", - "World Size": "Verden størrelse", - "World Theme": "Verden tema", - "Forest": "Skog", - "Desert": "Ørken", - "Plain": "Slette", - "Hell": "Helvete", - "Terrain Type": "Terreng type", - "Island": "Øy", - "Box": "Boks", - "Mountain": "Fjell", - "Irregular": "Uregulær", - "Wear Suit": "Ta på drakt" + "minicraft.control_guide.attack": "Bruk %s for å angripe eller ødelegge.", + "minicraft.control_guide.craft": "Bruk %s for å åpne skapermeny.", + "minicraft.control_guide.menu": "Bruk %s for å åpne inventar.", + "minicraft.control_guide.move": "Bruk %s for å bevege deg.", + "minicraft.displays.controls": "Kontroller", + "minicraft.displays.controls.display.controller": "Spillkontroller", + "minicraft.displays.controls.display.controller.00": "", + "minicraft.displays.controls.display.controller.01": "", + "minicraft.displays.controls.display.controller.02": "", + "minicraft.displays.controls.display.controller.03": "", + "minicraft.displays.controls.display.controller.04": "", + "minicraft.displays.controls.display.controller.05": "", + "minicraft.displays.controls.display.controller.06": "", + "minicraft.displays.controls.display.controller.07": "", + "minicraft.displays.controls.display.controller.08": "", + "minicraft.displays.controls.display.controller.09": "", + "minicraft.displays.controls.display.controller.10": "", + "minicraft.displays.controls.display.controller.11": "", + "minicraft.displays.controls.display.controller.12": "", + "minicraft.displays.controls.display.controller.13": "", + "minicraft.displays.controls.display.controller.14": "", + "minicraft.displays.controls.display.controller.15": "", + "minicraft.displays.controls.display.controller.desc.0": "", + "minicraft.displays.controls.display.controller.desc.1": "Detaljerte bindinskart er ubrukelige", + "minicraft.displays.controls.display.help.0": "%s/%s for å se andre kontroller.", + "minicraft.displays.controls.display.keyboard": "Tastatur", + "minicraft.displays.controls.display.keyboard.00": "", + "minicraft.displays.controls.display.keyboard.01": "", + "minicraft.displays.controls.display.keyboard.02": "", + "minicraft.displays.controls.display.keyboard.03": "", + "minicraft.displays.controls.display.keyboard.04": "", + "minicraft.displays.controls.display.keyboard.05": "", + "minicraft.displays.controls.display.keyboard.06": "", + "minicraft.displays.controls.display.keyboard.07": "", + "minicraft.displays.controls.display.keyboard.08": "", + "minicraft.displays.controls.display.keyboard.09": "", + "minicraft.displays.controls.display.keyboard.10": "", + "minicraft.displays.controls.display.keyboard.11": "", + "minicraft.displays.controls.display.keyboard.12": "", + "minicraft.displays.controls.display.keyboard.13": "", + "minicraft.displays.controls.display.keyboard.14": "", + "minicraft.displays.controls.display.keyboard.15": "", + "minicraft.displays.controls.display.keyboard.16": "", + "minicraft.displays.controls.display.keyboard.17": "", + "minicraft.displays.controls.display.keyboard.18": "", + "minicraft.displays.controls.display.keyboard.19": "", + "minicraft.displays.controls.display.keyboard.20": "", + "minicraft.displays.controls.display.keyboard.21": "", + "minicraft.displays.controls.display.keyboard.22": "", + "minicraft.displays.controls.display.keyboard.desc": "", + "minicraft.displays.loading.message.dungeon_regeneration": "", + "minicraft.displays.loading.message.quests": "Oppgaver", + "minicraft.displays.loading.regeneration_popup.display.0": "", + "minicraft.displays.loading.regeneration_popup.display.1": "Regenereing er krevd.", + "minicraft.displays.loading.regeneration_popup.display.2": "Gammel informasjon på bakken vil bli slettet:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s for å fortsette", + "minicraft.displays.loading.regeneration_popup.display.4": "%s for å avbryte lastingen av verden", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Lasting av verden avbrutt", + "minicraft.displays.quests.display.no_quest": "Ingen oppgave låst opp", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Kun tastaturinndata er godtatt.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Trykk på %s for å se detaljene av spillmanualen.", + "minicraft.notification.obsidian_knight_defeated": "", + "minicraft.notification.obsidian_knight_awoken": "", + "minicraft.notification.defeat_obsidian_knight_first": "", + "minicraft.notification.wrong_level_dungeon": "Kan kun bli tilkalt i hulen", + "minicraft.notification.boss_limit": "Ingen flere hovedfiender kan bli tilkalt", + "minicraft.notification.spawn_on_boss_tile": "Kan kun bli tilkalt i sluttrommet", + "minicraft.notifications.statue_tapped": "Du hører gjenklang av kviskring...", + "minicraft.notifications.statue_touched": "Du skimter at stuatuen vibrerer...", + "minicraft.quest.farming": "Jordbrukende jordbruker", + "minicraft.quest.farming.crafting_hoe": "Lag en hjå", + "minicraft.quest.farming.crafting_hoe.description": "Lag en hjå på arbeidsbenken.", + "minicraft.quest.farming.description": "Det grunnleggende som jordbruker.", + "minicraft.quest.farming.getting_wheat": "Høsting av hvete", + "minicraft.quest.farming.getting_wheat.description": "Høst hvete.", + "minicraft.quest.farming.making_farmland": "Lag dyrka mark", + "minicraft.quest.farming.making_farmland.description": "Lag dyka mark ved å bruke en hjå.", + "minicraft.quest.farming.planting_potato": "Plant en potet", + "minicraft.quest.farming.planting_potato.description": "Plant en potet på dryrka mark.", + "minicraft.quest.farming.planting_wheat": "Plant hvete", + "minicraft.quest.farming.planting_wheat.description": "Plant frø på dyrka mark.", + "minicraft.quest.gems": "Veien av juveler", + "minicraft.quest.gems.description": "Få klart juvelutstyr.", + "minicraft.quest.gems.gem_armor": "Mester av beskyttelse", + "minicraft.quest.gems.gem_armor.description": "Få tak i juvelrustning.", + "minicraft.quest.gems.gem_claymore": "Mester av våpen", + "minicraft.quest.gems.gem_claymore.description": "Få tak i et juvelsverd. (claymore)", + "minicraft.quest.iron_equipments": "Mester av jern", + "minicraft.quest.iron_equipments.description": "Få tak i alt av jernutstyr.", + "minicraft.quest.iron_equipments.getting_more_iron": "Rik på jern", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Få tak i enda mer jern.", + "minicraft.quest.iron_equipments.iron_armor": "Oppgrader rustning", + "minicraft.quest.iron_equipments.iron_armor.description": "Oppgrader rustningen din til jern.", + "minicraft.quest.iron_equipments.iron_tools": "Oppgrader alle redskaper", + "minicraft.quest.iron_equipments.iron_tools.description": "Oppgrader alle redskapene dine til jern.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Avansert hakke", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Oppgrader hakken din til jern.", + "minicraft.quest.potions": "Mester av trylledrikker", + "minicraft.quest.potions.all_potions_prepared": "Ekspert på trylledrikker", + "minicraft.quest.potions.all_potions_prepared.description": "Få tak i alle trylledrikker på samme tid.", + "minicraft.quest.potions.awkward_potions": "Klein trylledrikk", + "minicraft.quest.potions.awkward_potions.description": "Få tak i en klein trylledrikk.", + "minicraft.quest.potions.description": "Få tak i trylledrikkene.", + "minicraft.quest.potions.powerful_potions": "Kraftige trylledrikker", + "minicraft.quest.potions.powerful_potions.description": "Få tak i brukbare og kraftige trylledrikker.", + "minicraft.tutorial.getting_rocks": "Få tak i stein og kull", + "minicraft.tutorial.getting_rocks.description": "Få tak i minst 5 stein og 5 kull av å ødelegge stein med en hakke.", + "minicraft.tutorial.getting_wood": "Få tak i mer tre", + "minicraft.tutorial.getting_wood.description": "Få tak i minst 10 tre fra trær.", + "minicraft.tutorial.getting_wooden_pickaxe": "Få tak i trehakke", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Lag en trehakke i skapermenyen til arbeidsbenken.", + "minicraft.tutorial.getting_workbench": "Få tak i en arbeidsbenk", + "minicraft.tutorial.getting_workbench.description": "Lag en arbeidsbenk i skapermenyen. Plasser den etterpå.", + "minicraft.tutorial.start_getting_wood": "Starten på alt", + "minicraft.tutorial.start_getting_wood.description": "Slå trer for å få tak i tre.", + "minicraft.display.options_display.language": "", + "minicraft.display.options_display.resource_packs": "", + "minicraft.displays.language_settings.title": "", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Pil", + "String": "Tråd", + "Glass": "Glass", + "Cloth": "Tøystykke" } diff --git a/src/client/resources/assets/localization/pt-pt.json b/src/client/resources/assets/localization/pt-pt.json index 78899203d..5abc5d208 100644 --- a/src/client/resources/assets/localization/pt-pt.json +++ b/src/client/resources/assets/localization/pt-pt.json @@ -31,28 +31,171 @@ "minicraft.achievement.airwizard.desc": "Derrote o primeiro Mago dos ventos!", "minicraft.achievement.skin": "Desfile de moda", "minicraft.achievement.skin.desc": "Muda a tua skin", - "minicraft.display.achievement": "Conquistas", - "minicraft.display.achievement.achieved": "Alcançou!", - "minicraft.display.achievement.not_achieved": "Não alcançado", - "minicraft.display.achievement.score": "Pontuação da conquista:", + "minicraft.display.entries.boolean.false": "Não", + "minicraft.display.entries.boolean.true": "Sim", + "minicraft.display.gui.link_opening": "A abrir no browser...", + "minicraft.display.gui.perm_status.saving": "A guardar... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Pressiona %s para cancelar", + "minicraft.display.gui.perm_status.sleeping": "A dormir...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s to ocultar!)", + "minicraft.display.gui.potion_effects.potion_dur": "", + "minicraft.display.gui.score.current_score": "Pontuação atual: %s", + "minicraft.display.gui.score.time_left": "Tempo restante %s%sm %ss", + "minicraft.display.menus.inventory": "Inventário", + "minicraft.display.options_display": "Definições", + "minicraft.display.options_display.change_key_bindings": "Redefinir atalhos", + "minicraft.display.popup.enter_confirm": "enter para confirmar", + "minicraft.display.popup.escape_cancel": "esc para cancelar", + "minicraft.display.popup.title_confirm": "Confirmar ação", + "minicraft.displays.achievements": "Conquistas", + "minicraft.displays.achievements.display.achieved": "Conquistado!", + "minicraft.displays.achievements.display.help": "Usa %s e %s para te movimentares.", + "minicraft.displays.achievements.display.not_achieved": "Não conquistado", + "minicraft.displays.achievements.display.score": "Pontuação da conquista: %s", + "minicraft.displays.book.default_book": "Este livro não contém nenhum texto.", + "minicraft.displays.crafting": "Criação", + "minicraft.displays.crafting.container_title.cost": "Custo:", + "minicraft.displays.crafting.container_title.have": "Tens:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Pontuação final: %s", + "minicraft.displays.end_game.display.player_score": "Pontuação do jogador: %s", + "minicraft.displays.end_game.display.unlocked": "", + "minicraft.displays.end_game.exit": "Sair para o menu principal", + "minicraft.displays.info.display.exit_help": "%s/%s:Sair", + "minicraft.displays.info.display.score": "Pontuação atual: %s", + "minicraft.displays.info.display.time": "Tempo de jogo: %s", + "minicraft.displays.info.title": "Estatísticas do jogador", + "minicraft.displays.key_input.display.help.0": "", + "minicraft.displays.key_input.display.help.1": "Prime A para adicionar atalho", + "minicraft.displays.key_input.display.help.2": "Shift-D para repor teclas", + "minicraft.displays.key_input.display.help.3": "%s para voltar ao menu principal", + "minicraft.displays.key_input.popup_display.confirm_reset": "", + "minicraft.displays.key_input.popup_display.press_key_sequence": "", + "minicraft.displays.key_input.title": "Controlos", + "minicraft.displays.loading.message.entities": "Entidades", + "minicraft.displays.loading.message.generating": "A gerar", + "minicraft.displays.loading.message.level": "Nível %s", + "minicraft.displays.loading.message.levels": "Níveis", + "minicraft.displays.loading.message.loading": "A carregar", + "minicraft.displays.loading.message.saving": "A salvar", + "minicraft.displays.loading.message.world": "Mundo", + "minicraft.displays.options_main_menu": "", + "minicraft.displays.options_main_menu.resource_packs": "Pacotes de recursos", + "minicraft.displays.options_world": "", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Tens a certeza que queres desativar tutoriais para sempre?", + "minicraft.displays.options_world.turn_off_tutorials": "Desativar tutoriais", + "minicraft.displays.pause": "Pausa", + "minicraft.displays.pause.display.exit_popup.0": "Tens a certeza que queres sair do jogo?", + "minicraft.displays.pause.display.exit_popup.1": "", + "minicraft.displays.pause.display.exit_popup.cancel": "Cancelar", + "minicraft.displays.pause.display.exit_popup.quit": "Sair sem guardar", + "minicraft.displays.pause.display.help.choose": "%s: Escolher", + "minicraft.displays.pause.display.help.scroll": "", + "minicraft.displays.pause.menu": "Menu principal", + "minicraft.displays.pause.return": "Voltar ao jogo", + "minicraft.displays.pause.save": "Guardar jogo", + "minicraft.displays.player_death.display.score": "Pontuação: %s", + "minicraft.displays.player_death.display.time": "Tempo: %s", + "minicraft.displays.player_death.quit": "Sair", + "minicraft.displays.player_death.respawn": "Renascer", + "minicraft.displays.player_death.save_quit": "Guardar e sair", + "minicraft.displays.player_death.title": "Morreste! Ah!", + "minicraft.displays.player_inv.container_title.items": "Itens", + "minicraft.displays.player_inv.display.help": "(%s) para procurar.", + "minicraft.displays.quests": "Missões", + "minicraft.displays.quests.display.header.completed": "Completado", + "minicraft.displays.quests.display.header.unlocked": "Desbloqueada", + "minicraft.displays.quests.display.no_quest_desc": "Nenhuma missão", + "minicraft.displays.resource_packs.display.help.move": "Usa %s e %s para te movimentares.", + "minicraft.displays.resource_packs.display.help.select": "%s para examinar.", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] para mover pacotes.␣", + "minicraft.displays.resource_packs.display.title": "Pacotes de recurso", + "minicraft.displays.skin": "Skins", + "minicraft.displays.skin.display.help.move": "Usa %s e %s para te movimentares.", + "minicraft.displays.skin.display.help.select": "%s para selecionar e %s para cancelar.", + "minicraft.displays.title.display.cannot_check": "", + "minicraft.displays.title.display.checking": "", + "minicraft.displays.title.display.help.0": "(%s, %s para selecionar)", + "minicraft.displays.title.display.help.1": "(%s para aceitar)", + "minicraft.displays.title.display.help.2": "(%s para voltar)", + "minicraft.displays.title.display.latest_already": "", + "minicraft.displays.title.display.new_version": "", + "minicraft.displays.title.display.version": "Versão %s", + "minicraft.displays.title.help": "Ajuda", + "minicraft.displays.title.help.about": "Sobre", + "minicraft.displays.title.help.credits": "Créditos", + "minicraft.displays.title.help.instructions": "Instruções", + "minicraft.displays.title.help.storyline_guide": "", + "minicraft.displays.title.link_to_version": "", + "minicraft.displays.title.play": "Jogar", + "minicraft.displays.title.play.load_world": "Carregar mundo", + "minicraft.displays.title.play.new_world": "Novo mundo", + "minicraft.displays.title.quit": "Sair", + "minicraft.displays.title.select_to_download": "", + "minicraft.displays.world_gen.create_world": "Criar mundo", + "minicraft.displays.world_gen.enter_world": "", + "minicraft.displays.world_gen.title": "", + "minicraft.displays.world_gen.troublesome_input": "", + "minicraft.displays.world_gen.troublesome_input.msg": "", + "minicraft.displays.world_gen.world_seed": "Seed do mundo", + "minicraft.displays.world_select.display.help.0": "%s para confirmar", + "minicraft.displays.world_select.display.help.1": "%s para voltar", + "minicraft.displays.world_select.display.help.2": "SHIFT-C para copiar", + "minicraft.displays.world_select.display.help.3": "SHIFT-R para renomear", + "minicraft.displays.world_select.display.help.4": "SHIFT-D para eliminar", + "minicraft.displays.world_select.display.world_too_new": "", + "minicraft.displays.world_select.display.world_version": "Versão do mundo: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s para cancelar", + "minicraft.displays.world_select.popups.display.change": "", + "minicraft.displays.world_select.popups.display.confirm": "%s para confirmar", + "minicraft.displays.world_select.popups.display.delete": "", + "minicraft.displays.world_select.select_world": "Selecionar mundo", "minicraft.notification.achievement_unlocked": "Conquista desbloqueada:", - "Entities": "Entidades", - "Air Wizard: Defeated!": "Mago dos ventos: Derrotado!", - "The Dungeon is now open!": "A masmorra agora está aberta!", - "A costume lies on the ground...": "Uma fantasia se encontra no chão...", - "Can't sleep! ": "Impossível dormir no momento! ", - "Min ": "Min ", - " Sec left!": "Segundo restante!", - "You hear a noise from the surface!": "Ouviste um som vindo da superfíce!", + "minicraft.notification.air_wizard_defeated": "Mago do Ar foi derrotado!", + "minicraft.notification.cannot_sleep": "", + "minicraft.notification.death_chest_retrieved": "", + "minicraft.notification.defeat_air_wizard_first": "", + "minicraft.notification.dig_hole": "Cava um buraco primeiro!", + "minicraft.notification.dungeon_opened": "", + "minicraft.notification.gem_pickaxe_required": "", + "minicraft.notification.invalid_placement": "Só pode ser colocado em", + "minicraft.notification.quest_completed": "Missão completada", + "minicraft.notification.quest_unlocked": "Missão desbloqueada", + "minicraft.notification.world_saved": "O mundo foi salvo!", + "minicraft.notification.wrong_level_sky": "", + "minicraft.settings.fps": "", + "minicraft.settings.difficulty": "Dificuldade", + "minicraft.settings.difficulty.easy": "Fácil", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Difícil", + "minicraft.settings.mode": "Modo de jogo", + "minicraft.settings.mode.survival": "Sobrevivência", + "minicraft.settings.mode.creative": "Criativo", + "minicraft.settings.mode.hardcore": "", + "minicraft.settings.mode.score": "Pontuação", + "minicraft.settings.scoretime": "", + "minicraft.settings.screenshot_scale": "", + "minicraft.settings.sound": "Som", + "minicraft.settings.autosave": "Gravação automática", + "minicraft.settings.size": "Tamanho do mundo", + "minicraft.settings.theme": "Tema do mundo", + "minicraft.settings.theme.normal": "", + "minicraft.settings.theme.forest": "Floresta", + "minicraft.settings.theme.desert": "Deserto", + "minicraft.settings.theme.plain": "Planície", + "minicraft.settings.theme.hell": "Inferno", + "minicraft.settings.type": "Tipo de terreno", + "minicraft.settings.type.island": "Ilha", + "minicraft.settings.type.box": "", + "minicraft.settings.type.mountain": "Montanha", + "minicraft.settings.type.irregular": "", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul com capa", + "minicraft.skin.minecraft_steve": "Rapaz conhecido", + "minicraft.skin.minecraft_alex": "Rapariga conhecida", + "minicraft.text_particales.key_consumed": "", "Death Chest": "Baú da Morte", "Player": "Jogador", - "Crafting": "Fabricação", - "Set your home!": "Define a tua casa!", - "Can't set home here!": "Não é possível definir uma casa aqui!", - "Home Sweet Home!": "Lar Doce Lar!", - "Mode penalty: -2 health": "Penalita': -2 pontos de vida", - "You don't have a home!": "Não tens uma casa!", - "You can't go home from here!": "Não podes voltar para a tua casa daqui!", "Leather Armor": "Armadura de Couro", "Snake Armor": "Armadura de Serpente", "Iron Armor": "Armadura de Ferro", @@ -63,7 +206,6 @@ "Empty Bucket": "Balde vazio", "Water Bucket": "Balde com Água", "Lava Bucket": "Balde com Lava", - " Bucket": " Balde", "Red Clothes": "Camisa Vermelha", "Blue Clothes": "Camisa Azul", "Green Clothes": "Camisa Verde", @@ -125,19 +267,17 @@ "Leather": "Couro", "Wheat": "Trigo", "Key": "Chave", - "Arrow": "Flecha", - "String": "Linha", "Coal": "Carvão", "Iron Ore": "Minério de Ferro", - "Lapis": "Lápis", "Gold Ore": "Minério de Ouro", + "Gem Ore": "Minério de gema", + "Cloud Ore": "", "Iron": "Ferro", "Gold": "Ouro", + "Lapis": "Lápis", "Rose": "Rosa", "GunPowder": "Pólvora", "Slime": "Gosma", - "Glass": "Vidro", - "Cloth": "Tecido", "Scale": "Esquama", "Shard": "Fragmento", "Flower": "Flor", @@ -184,7 +324,6 @@ "Claymore": "Espada Escocesa", "Shears": "Tesoura", "Torch": "Tocha", - "Gem Ore": "Minério de gema", "Wood Planks": "Tábuas de Madeira", "Stone Bricks": "Tijolos de Pedra", "Obsidian": "Obsidiana", @@ -204,147 +343,131 @@ "Hard Rock": "Pedra Dura", "Infinite Fall": "Queda Infinita", "Cloud Cactus": "Nuvem de Cacto", - "Ore": "Minério", - "host not found": "host não foi encontrado", - "unable to get localhost address": "não foi possível obter o endereço local", - "World Saved!": "Mundo salvo!", - "On": "Ativado", - "Off": "Desativado", - "There is nothing of use here.": "Não há nada de útil aqui.", - "Still nothing... :P": "Ainda nada... :P", - "Have:": "Tem:", - "Cost:": "Custo:", - "Time: ": "Tempo: ", - "Score: ": "Pontuação: ", - "Quit": "Sair", - "Respawn": "Renascer", - "You died! Aww!": "Morreste! Aww!", - "Player Score: ": "Pontuação do jogador: ", - "": "", - "Final Score: ": "Pontuação final: ", - "Exit to Menu": "Voltar ao Menu", - "Time Played: ": "Tempo Jogado: ", - "Current Score: ": "Pontuação atual: ", - "Exit": "Sair", - "Player Stats": "Estatísticas", - "Controls": "Controles", - "Press the desired": "Pressione o botão desejado", - "key sequence": "sequência de teclas", - "minicraft.display.key_input.confirm_popup": "Tens a certeza de que queres redefinir todas as teclas para os padrões?", - "minicraft.display.popup.enter_confirm": "enter para confirmar", - "minicraft.display.popup.escape_cancel": "esc para cancelar", - "Confirm Action": "Confirmar Ação", - "Press C/Enter to change key binding": "Pressione C/Enter para mudar a vinculação de tecla", - "Press A to add key binding": "Pressione A para adicionar vinculação nova", - "Shift-D to reset all keys to default": "Shift-D para redefinir as teclas para o padrão", - "ESCAPE to Return to menu": "ESC para Retornar ao menu ", - "Loading": "A carregar", - "Generating": "A gerar", - "World": "Mundo", - "waiting": "A esperar", - "nothing": "nada", - "attempting log in": "a tentar iniciar sessão", - "no internet connection, but no login data saved; cannot enter offline mode.": "não há conexão à internet, mas não foi salvo os dados de login; não foi possível entrar no modo offline.", - "connecting to server": "a conectar ao servidor", - "logging in": "a iniciar sessão", - "saving credentials": "a salvar credenciais", - "login failed.": "login falhou.", - "problem with saved login data; please exit and login again.": "problema ao salvar dados de login; por favor saia e inicie uma nova sessão.", - "Internal server error: Couldn't fetch username from uuid": "Erro: Não foi possível obter o nome de usuário por uuid", - "logged in as: ": "identificado como: ", - "offline mode: local servers only": "modo offline: apenas servidores locais", - "Enter ip address to connect to:": "Insira o endereço de conexão:", - "Press Shift-Escape to logout": "Pressione Shift-Escape para encerrar sessão", - "Enter email:": "Insira o e-mail:", - "Enter password:": "Insira a senha:", - "field is blank": "o campo está vazio", - "get an account at:": "cria uma conta em:", - "Loading ": "A carregar ", - " from server": " do servidor", - "Could not connect to server:": "Não foi possível conectar ao servidor:", - "Press ": "Pressione ", - " to return": " para retornar", - "Change Key Bindings": "Mudar atalhos", - "Options": "Opções", - "Change language": "Mudar idioma", - "Return to Game": "Voltar ao Jogo", - "Make World Multiplayer": "Abrir para Multiplayer", - "Save Game": "Salvar o Mundo", - " and ": " e ", - " to Scroll": " para rolar", - ": Choose": ": Selecione", - "Paused": "Pausado", - "Main Menu": "Menu Principal", - "Yes": "Sim", - "No": "Não", - "Inventory": "Inventário", - "to search.": "para pesquisar item", - "Play": "Jogar", - "Load World": "Carregar Mundo", - "New World": "Novo Mundo", - "Multiplayer": "Multijogador", - "Singleplayer": "Um jogador", - "Help": "Ajuda", - "Instructions": "Instruções", - "Storyline Guide": "História", - "About": "Sobre", - "Credits": "Créditos", - " to select": " para selecionar", - " to accept": " para aceitar", - "New World Name:": "Nome do Mundo:", - "Are you sure you want to delete": "Queres mesmo remover", - "This can not be undone!": "Não podes voltar a trás!", - " to confirm": " para confirmar", - " to cancel": " para cancelar", - "World Seed": "Semente", - "Enter World Name": "Insira o nome do mundo", - "Trouble with world name?": "Problemas com o nome?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "por padrão, w e s movem o cursor para cima e para baixo. Isso pode ser mudado no menu de atalhos de tecla. Para digitar a letra ao invés de mover o cursor, segure shift enquanto digita o nome do mundo.", - "Create World": "Criar Mundo", - "World Gen Options": "Opções de Geração", - " to Copy": " para Copiar", - " to Rename": " para Renomear", - " to Delete": " para Deletar", - "Select World": "Selecionar mundo", - "Select a World to Delete": "Seleciona um mundo para deletar", - "Select a World to Rename": "Seleciona um mundo para renomear", - "Select a World to Copy": "Seleciona um mundo para copiar", - "Higher version, cannot load world!": "Versão superior, não podes carregar o mundo!", - "World Version:": "Versão do mundo:", - "Languages": "Idiomas", - "Language": "Idioma", - "Select": "Selecione", - "Max FPS": "Limite de fps", - "Difficulty": "Dificuldade", - "Easy": "Fácil", - "Normal": "Normal", - "Hard": "Difícil", - "Game Mode": "Modo de Jogo", - "Survival": "Sobrevivência", - "Creative": "Criativo", - "Hardcore": "Extremo", - "Score": "Pontuação", - "Time (Score Mode)": "Tempo (Modo Pontuação)", - "Sound": "Som", - "Autosave": "Autosalvar", - "World Size": "Tamanho", - "World Theme": "Tema", - "Forest": "Floresta", - "Desert": "Deserto", - "Plain": "Planíce", - "Hell": "Inferno", - "Terrain Type": "Tipo de Terreno", - "Island": "Ilha", - "Box": "Caixa", - "Mountain": "Montanha", - "Irregular": "Irregular", - "Wear Suit": "Guarda-Roupa", - "You have the latest version.": "Tens a última versão.", - "minicraft.display.skin": "Skins", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul com capa", - "minicraft.skin.minecraft_steve": "Rapaz conhecido", - "minicraft.skin.minecraft_alex": "Rapariga conhecida", - "minicraft.notification.invalid_placement": "Só pode ser colocado em", - "minicraft.notification.dig_hole": "Cava um buraco primeiro!" + "Raw Obsidian": "", + "Totem of Air": "Totem do ar", + "minicraft.control_guide.attack": "", + "minicraft.control_guide.craft": "", + "minicraft.control_guide.menu": "", + "minicraft.control_guide.move": "Usa %s para te movimentares.", + "minicraft.displays.controls": "Controlos", + "minicraft.displays.controls.display.controller": "Comando", + "minicraft.displays.controls.display.controller.00": "", + "minicraft.displays.controls.display.controller.01": "", + "minicraft.displays.controls.display.controller.02": "", + "minicraft.displays.controls.display.controller.03": "", + "minicraft.displays.controls.display.controller.04": "", + "minicraft.displays.controls.display.controller.05": "", + "minicraft.displays.controls.display.controller.06": "", + "minicraft.displays.controls.display.controller.07": "", + "minicraft.displays.controls.display.controller.08": "", + "minicraft.displays.controls.display.controller.09": "", + "minicraft.displays.controls.display.controller.10": "", + "minicraft.displays.controls.display.controller.11": "Para pausar o jogo usa START", + "minicraft.displays.controls.display.controller.12": "", + "minicraft.displays.controls.display.controller.13": "", + "minicraft.displays.controls.display.controller.14": "", + "minicraft.displays.controls.display.controller.15": "", + "minicraft.displays.controls.display.controller.desc.0": "", + "minicraft.displays.controls.display.controller.desc.1": "", + "minicraft.displays.controls.display.help.0": "", + "minicraft.displays.controls.display.keyboard": "Teclado", + "minicraft.displays.controls.display.keyboard.00": "", + "minicraft.displays.controls.display.keyboard.01": "", + "minicraft.displays.controls.display.keyboard.02": "", + "minicraft.displays.controls.display.keyboard.03": "", + "minicraft.displays.controls.display.keyboard.04": "", + "minicraft.displays.controls.display.keyboard.05": "", + "minicraft.displays.controls.display.keyboard.06": "", + "minicraft.displays.controls.display.keyboard.07": "", + "minicraft.displays.controls.display.keyboard.08": "", + "minicraft.displays.controls.display.keyboard.09": "", + "minicraft.displays.controls.display.keyboard.10": "", + "minicraft.displays.controls.display.keyboard.11": "", + "minicraft.displays.controls.display.keyboard.12": "", + "minicraft.displays.controls.display.keyboard.13": "", + "minicraft.displays.controls.display.keyboard.14": "", + "minicraft.displays.controls.display.keyboard.15": "", + "minicraft.displays.controls.display.keyboard.16": "", + "minicraft.displays.controls.display.keyboard.17": "", + "minicraft.displays.controls.display.keyboard.18": "", + "minicraft.displays.controls.display.keyboard.19": "", + "minicraft.displays.controls.display.keyboard.20": "", + "minicraft.displays.controls.display.keyboard.21": "", + "minicraft.displays.controls.display.keyboard.22": "", + "minicraft.displays.controls.display.keyboard.desc": "", + "minicraft.displays.loading.message.dungeon_regeneration": "", + "minicraft.displays.loading.message.quests": "Missões", + "minicraft.displays.loading.regeneration_popup.display.0": "", + "minicraft.displays.loading.regeneration_popup.display.1": "", + "minicraft.displays.loading.regeneration_popup.display.2": "", + "minicraft.displays.loading.regeneration_popup.display.3": "%s para continuar", + "minicraft.displays.loading.regeneration_popup.display.4": "%s para cancelar o carregamento do mundo", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Carregamento do mundo foi cancelado", + "minicraft.displays.quests.display.no_quest": "Nenhuma missão desbloqueada", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", + "minicraft.notification.obsidian_knight_defeated": "", + "minicraft.notification.obsidian_knight_awoken": "", + "minicraft.notification.defeat_obsidian_knight_first": "", + "minicraft.notification.wrong_level_dungeon": "", + "minicraft.notification.boss_limit": "", + "minicraft.notification.spawn_on_boss_tile": "", + "minicraft.notifications.statue_tapped": "", + "minicraft.notifications.statue_touched": "", + "minicraft.quest.farming": "", + "minicraft.quest.farming.crafting_hoe": "Criar uma enxada", + "minicraft.quest.farming.crafting_hoe.description": "", + "minicraft.quest.farming.description": "", + "minicraft.quest.farming.getting_wheat": "Recolher trigo", + "minicraft.quest.farming.getting_wheat.description": "", + "minicraft.quest.farming.making_farmland": "", + "minicraft.quest.farming.making_farmland.description": "", + "minicraft.quest.farming.planting_potato": "", + "minicraft.quest.farming.planting_potato.description": "", + "minicraft.quest.farming.planting_wheat": "", + "minicraft.quest.farming.planting_wheat.description": "", + "minicraft.quest.gems": "", + "minicraft.quest.gems.description": "", + "minicraft.quest.gems.gem_armor": "", + "minicraft.quest.gems.gem_armor.description": "", + "minicraft.quest.gems.gem_claymore": "", + "minicraft.quest.gems.gem_claymore.description": "", + "minicraft.quest.iron_equipments": "", + "minicraft.quest.iron_equipments.description": "", + "minicraft.quest.iron_equipments.getting_more_iron": "Rico em ferro", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Recolhe mais ferro.", + "minicraft.quest.iron_equipments.iron_armor": "Melhorar armadura", + "minicraft.quest.iron_equipments.iron_armor.description": "Melhorar a tua armadura para ferro.", + "minicraft.quest.iron_equipments.iron_tools": "Melhorar todas as ferramentas", + "minicraft.quest.iron_equipments.iron_tools.description": "Melhorar todas as tuas ferramentas para ferro.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Picareta avançada", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Melhorar a tua picareta.", + "minicraft.quest.potions": "", + "minicraft.quest.potions.all_potions_prepared": "", + "minicraft.quest.potions.all_potions_prepared.description": "", + "minicraft.quest.potions.awkward_potions": "", + "minicraft.quest.potions.awkward_potions.description": "", + "minicraft.quest.potions.description": "Obtém poções", + "minicraft.quest.potions.powerful_potions": "", + "minicraft.quest.potions.powerful_potions.description": "", + "minicraft.tutorial.getting_rocks": "Recolhe pedra e carvão", + "minicraft.tutorial.getting_rocks.description": "", + "minicraft.tutorial.getting_wood": "Recolhe mais madeira", + "minicraft.tutorial.getting_wood.description": "", + "minicraft.tutorial.getting_wooden_pickaxe": "Obtém uma picareta de madeira", + "minicraft.tutorial.getting_wooden_pickaxe.description": "", + "minicraft.tutorial.getting_workbench": "Obtém uma mesa de trabalho", + "minicraft.tutorial.getting_workbench.description": "", + "minicraft.tutorial.start_getting_wood": "O começo", + "minicraft.tutorial.start_getting_wood.description": "", + "minicraft.display.options_display.language": "Idioma", + "minicraft.display.options_display.resource_packs": "Pacotes de recursos", + "minicraft.displays.language_settings.title": "Idioma...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Flecha", + "String": "Linha", + "Glass": "Vidro", + "Cloth": "Tecido" } diff --git a/src/client/resources/assets/localization/ru-ru.json b/src/client/resources/assets/localization/ru-ru.json index 2b4484ccf..186f07ff0 100644 --- a/src/client/resources/assets/localization/ru-ru.json +++ b/src/client/resources/assets/localization/ru-ru.json @@ -1,82 +1,211 @@ { "minicraft.achievement.woodcutter": "Лесоруб", "minicraft.achievement.woodcutter.desc": "Добыть древесину.", - "minicraft.achievement.benchmarking": "Бенчмаркинг", - "minicraft.achievement.benchmarking.desc": "Смастерите верстак.", + "minicraft.achievement.benchmarking": "Верстачество", + "minicraft.achievement.benchmarking.desc": "Создайте верстак.", "minicraft.achievement.upgrade": "Обновка!", "minicraft.achievement.upgrade.desc": "Создайте любой каменный инструмент.", - "minicraft.achievement.bow": "Кланяйтесь мне!", - "minicraft.achievement.bow.desc": "Выпустить стрелу из лука.", - "minicraft.achievement.fish": "Смотри! Клюнуло!", - "minicraft.achievement.fish.desc": "Словите рыбу!", + "minicraft.achievement.bow": "Стрелок!", + "minicraft.achievement.bow.desc": "Выстрелить из лука.", + "minicraft.achievement.fish": "Идем рыбачить!", + "minicraft.achievement.fish.desc": "Поймайте рыбу!", "minicraft.achievement.doors": "Дверная защита", - "minicraft.achievement.doors.desc": "Сделайте деревянную дверь.", - "minicraft.achievement.planks": "Ходите по доскам!", - "minicraft.achievement.planks.desc": "Сделайте деревянные доски.", - "minicraft.achievement.clothes": "Желаю красочного вам дня!", + "minicraft.achievement.doors.desc": "Создайте деревянную дверь.", + "minicraft.achievement.planks": "Пройдись по доскам!", + "minicraft.achievement.planks.desc": "Создайте деревянные доски.", + "minicraft.achievement.clothes": "Красочного вам дня!", "minicraft.achievement.clothes.desc": "Создайте одежду любого цвета.", "minicraft.achievement.demolition": "Демонстрация разрушения", - "minicraft.achievement.demolition.desc": "Используйте динамит.", - "minicraft.achievement.survive_darkness": "Боишся темноты?", + "minicraft.achievement.demolition.desc": "Используйте взрывчатку.", + "minicraft.achievement.survive_darkness": "Боишься темноты?", "minicraft.achievement.survive_darkness.desc": "Выживите 5 минут в полной темноте.", "minicraft.achievement.lava": "Горячие делишки", - "minicraft.achievement.lava.desc": "Используйте зелье лавы, чтобы плавать в лаве.", + "minicraft.achievement.lava.desc": "Используйте зелье жаростойкости, чтобы плавать в лаве.", "minicraft.achievement.find_gem": "Ооо, блестяшка!", - "minicraft.achievement.find_gem.desc": "Найдите самоцветную руду и добывайте ее.", + "minicraft.achievement.find_gem.desc": "Найдите самоцветную руду и вскопайте ее.", "minicraft.achievement.lowest_caves": "Тьма за светом", - "minicraft.achievement.lowest_caves.desc": "Достигните самый нижнего уровня пещер.", + "minicraft.achievement.lowest_caves.desc": "Достигните самого нижнего уровня пещер.", "minicraft.achievement.obsidian_dungeon": "О рыцарях и людях", - "minicraft.achievement.obsidian_dungeon.desc": "Достигните обсидианового подземелья.", + "minicraft.achievement.obsidian_dungeon.desc": "Попадите в обсидиановое подземелье.", "minicraft.achievement.airwizard": "Победить... воздух?", - "minicraft.achievement.airwizard.desc": "Победите первого Небесного Колдуна!", - "minicraft.achievement.second_airwizard": "Воздушный подвиг!", - "minicraft.achievement.second_airwizard.desc": "Победите второго Небесного Колдуна!", + "minicraft.achievement.airwizard.desc": "Победите первого Небесного колдуна!", "minicraft.achievement.skin": "Модный приговор", "minicraft.achievement.skin.desc": "Измените свой прикид.", - "minicraft.display.achievement": "Достижения", - "minicraft.display.achievement.achieved": "Достигнуто!", - "minicraft.display.achievement.not_achieved": "Не достигнуто", - "minicraft.display.achievement.score": "Количество достижений:", - "minicraft.display.key_input.confirm_popup": "Вы уверены, что хотите сбросить все настройки управления по умолчанию?", - "minicraft.display.popup.enter_confirm": "Enter, чтобы подтвердить", - "minicraft.display.popup.escape_cancel": "Escape, чтобы отменить", - "minicraft.display.skin": "Костюмы", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul с накидкой", + "minicraft.display.entries.boolean.false": "Выкл", + "minicraft.display.entries.boolean.true": "Вкл", + "minicraft.display.gui.link_opening": "Открывается в браузере...", + "minicraft.display.gui.perm_status.saving": "Сохранение... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Нажмите %s чтобы отменить", + "minicraft.display.gui.perm_status.sleeping": "Ночёвка...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s чтобы спрятать!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Текущий счёт: %s", + "minicraft.display.gui.score.time_left": "Осталось %s%s мин %s сек", + "minicraft.display.menus.inventory": "Инвентарь", + "minicraft.display.options_display": "Настройки", + "minicraft.display.options_display.change_key_bindings": "Изменить управление", + "minicraft.display.popup.enter_confirm": "ENTER, чтобы подтвердить", + "minicraft.display.popup.escape_cancel": "ESCAPE для отмены", + "minicraft.display.popup.title_confirm": "Подтвердить действие", + "minicraft.displays.achievements": "Достижения", + "minicraft.displays.achievements.display.achieved": "Получено!", + "minicraft.displays.achievements.display.help": "Используйте %s и %s для навигации.", + "minicraft.displays.achievements.display.not_achieved": "Не получено", + "minicraft.displays.achievements.display.score": "Очков достижений: %s", + "minicraft.displays.book.default_book": "В данной книге нет текста.", + "minicraft.displays.crafting": "Создание", + "minicraft.displays.crafting.container_title.cost": "Цена:", + "minicraft.displays.crafting.container_title.have": "Есть:", + "minicraft.displays.end_game.display.bonuses": "<Бонусы>", + "minicraft.displays.end_game.display.final_score": "Финальный счёт: %s", + "minicraft.displays.end_game.display.player_score": "Счёт игрока: %s", + "minicraft.displays.end_game.display.unlocked": "Открыто! %s Счёт на время", + "minicraft.displays.end_game.exit": "Выйти в меню", + "minicraft.displays.info.display.exit_help": "%s/%s: Выйти", + "minicraft.displays.info.display.score": "Счёт: %s", + "minicraft.displays.info.display.time": "Время игры: %s", + "minicraft.displays.info.title": "Статистика игрока", + "minicraft.displays.key_input.display.help.0": "Нажмите C/Enter чтобы поменять назначенную клавишу.", + "minicraft.displays.key_input.display.help.1": "Нажмите A чтобы добавить клавишу управления.", + "minicraft.displays.key_input.display.help.2": "Shift-D чтобы сбросить управление.", + "minicraft.displays.key_input.display.help.3": "%s чтобы вернутся в меню", + "minicraft.displays.key_input.popup_display.confirm_reset": "Вы уверены, что хотите сбросить все клавиши управления?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Нажмите желаемую последовательность клавиш", + "minicraft.displays.key_input.title": "Управление", + "minicraft.displays.loading.message.entities": "Существа", + "minicraft.displays.loading.message.generating": "Генерация", + "minicraft.displays.loading.message.level": "Уровень %s", + "minicraft.displays.loading.message.levels": "Уровни", + "minicraft.displays.loading.message.loading": "Загрузка", + "minicraft.displays.loading.message.saving": "Сохранение", + "minicraft.displays.loading.message.world": "Мир", + "minicraft.displays.options_main_menu": "Настройки", + "minicraft.displays.options_main_menu.resource_packs": "Пакеты ресурсов", + "minicraft.displays.options_world": "Настройки мира", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Вы уверены, что хотите навсегда выключить обучение?", + "minicraft.displays.options_world.turn_off_tutorials": "Выключить обучение", + "minicraft.displays.pause": "Пауза", + "minicraft.displays.pause.display.exit_popup.0": "Вы уверены, что хотите выйти из игры?", + "minicraft.displays.pause.display.exit_popup.1": "Весь несохранённый прогресс будет потерян", + "minicraft.displays.pause.display.exit_popup.cancel": "Отмена", + "minicraft.displays.pause.display.exit_popup.quit": "Выйти без сохранения", + "minicraft.displays.pause.display.help.choose": "%s: Выбрать", + "minicraft.displays.pause.display.help.scroll": "%s и %s для навигации", + "minicraft.displays.pause.menu": "Главное меню", + "minicraft.displays.pause.return": "Вернутся к игре", + "minicraft.displays.pause.save": "Сохранить игру", + "minicraft.displays.player_death.display.score": "Счёт: %s", + "minicraft.displays.player_death.display.time": "Время: %s", + "minicraft.displays.player_death.quit": "Выйти", + "minicraft.displays.player_death.respawn": "Возродится", + "minicraft.displays.player_death.save_quit": "Сохранить и выйти", + "minicraft.displays.player_death.title": "Ой! Вы умерли!", + "minicraft.displays.player_inv.container_title.items": "Предметы", + "minicraft.displays.player_inv.display.help": "(%s) для поиска.", + "minicraft.displays.quests": "Задания", + "minicraft.displays.quests.display.header.completed": "Выполнено", + "minicraft.displays.quests.display.header.unlocked": "Открыто", + "minicraft.displays.quests.display.no_quest_desc": "Нет задания", + "minicraft.displays.resource_packs.display.help.move": "Используйте %s и %s для навигации.", + "minicraft.displays.resource_packs.display.help.select": "%s чтобы изучить.", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] чтобы двигать пакеты. ", + "minicraft.displays.resource_packs.display.title": "Пакеты ресурсов", + "minicraft.displays.skin": "Скины", + "minicraft.displays.skin.display.help.move": "Используйте %s и %s для навигации.", + "minicraft.displays.skin.display.help.select": "%s для выбора, и %s для отмены.", + "minicraft.displays.title.display.cannot_check": "Невозможно проверить обновления.", + "minicraft.displays.title.display.checking": "Проверка наличия обновлений...", + "minicraft.displays.title.display.help.0": "(%s, %s чтобы выбрать)", + "minicraft.displays.title.display.help.1": "(%s чтобы принять)", + "minicraft.displays.title.display.help.2": "(%s чтобы вернутся)", + "minicraft.displays.title.display.latest_already": "У вас последняя версия.", + "minicraft.displays.title.display.new_version": "Новая: %s", + "minicraft.displays.title.display.version": "Версия %s", + "minicraft.displays.title.help": "Помощь", + "minicraft.displays.title.help.about": "Об игре", + "minicraft.displays.title.help.credits": "Титры", + "minicraft.displays.title.help.instructions": "Инструкции", + "minicraft.displays.title.help.storyline_guide": "Сюжетная линия", + "minicraft.displays.title.link_to_version": "Прямая ссылка на последнюю версию: %s", + "minicraft.displays.title.play": "Играть", + "minicraft.displays.title.play.load_world": "Загрузить мир", + "minicraft.displays.title.play.new_world": "Создать мир", + "minicraft.displays.title.quit": "Выйти", + "minicraft.displays.title.select_to_download": "--Выберите это, чтобы скачать--", + "minicraft.displays.world_gen.create_world": "Создать мир", + "minicraft.displays.world_gen.enter_world": "Название мира", + "minicraft.displays.world_gen.title": "Настройки генератора", + "minicraft.displays.world_gen.troublesome_input": "Не можете придумать название?", + "minicraft.displays.world_gen.troublesome_input.msg": "Похоже, вы поставили буквенные клавиши в качестве навигационных. Вы можете изменить это в меню Настроек управления, где они обозначены как \"Курсор-XXX\". Сейчас, чтобы вводить текст вместо перемещения курсора, зажимайте Shift.", + "minicraft.displays.world_gen.world_seed": "Ключ генерации", + "minicraft.displays.world_select.display.help.0": "%s чтобы подтвердить", + "minicraft.displays.world_select.display.help.1": "%s чтобы вернутся", + "minicraft.displays.world_select.display.help.2": "SHIFT-C чтобы скопировать", + "minicraft.displays.world_select.display.help.3": "SHIFT-R чтобы переименовать", + "minicraft.displays.world_select.display.help.4": "SHIFT-D чтобы удалить", + "minicraft.displays.world_select.display.world_too_new": "Более новая версия, невозможно загрузить!", + "minicraft.displays.world_select.display.world_version": "Версия мира: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s для отмены", + "minicraft.displays.world_select.popups.display.change": "Новое название мира:", + "minicraft.displays.world_select.popups.display.confirm": "%s, чтобы подтвердить", + "minicraft.displays.world_select.popups.display.delete": "Вы уверены, что вы хотите удалить %s\"%s\"%s? Это действие необратимо!", + "minicraft.displays.world_select.select_world": "Выбор мира", + "minicraft.notification.achievement_unlocked": "Получено достижение: %s", + "minicraft.notification.air_wizard_defeated": "Небесный колдун побеждён!", + "minicraft.notification.cannot_sleep": "Вы сможете спать через %s мин %s сек!", + "minicraft.notification.death_chest_retrieved": "Сундук смерти возвращён!", + "minicraft.notification.defeat_air_wizard_first": "Сначала необходимо победить Небесного колдуна.", + "minicraft.notification.dig_hole": "Сначала выкопайте яму!", + "minicraft.notification.dungeon_opened": "Темница теперь открыта!", + "minicraft.notification.gem_pickaxe_required": "Нужна самоцветовая кирка.", + "minicraft.notification.invalid_placement": "Это можно разместить только на %s!", + "minicraft.notification.quest_completed": "Задание выполнено", + "minicraft.notification.quest_unlocked": "Задание открыто", + "minicraft.notification.world_saved": "Мир сохранён!", + "minicraft.notification.wrong_level_sky": "Можно призвать только на небесах", + "minicraft.settings.fps": "Максимальный FPS", + "minicraft.settings.difficulty": "Сложность", + "minicraft.settings.difficulty.easy": "Легкая", + "minicraft.settings.difficulty.normal": "Нормальная", + "minicraft.settings.difficulty.hard": "Тяжелая", + "minicraft.settings.mode": "Режим игры", + "minicraft.settings.mode.survival": "Выживание", + "minicraft.settings.mode.creative": "Творческий", + "minicraft.settings.mode.hardcore": "Хардкор", + "minicraft.settings.mode.score": "Счёт", + "minicraft.settings.scoretime": "Время (Режим счёта)", + "minicraft.settings.screenshot_scale": "Мастштаб скриншота", + "minicraft.settings.sound": "Звук", + "minicraft.settings.autosave": "Автосохранение", + "minicraft.settings.size": "Размер мира", + "minicraft.settings.theme": "Тип мира", + "minicraft.settings.theme.normal": "Обычный", + "minicraft.settings.theme.forest": "Лес", + "minicraft.settings.theme.desert": "Пустыня", + "minicraft.settings.theme.plain": "Плоский", + "minicraft.settings.theme.hell": "Ад", + "minicraft.settings.type": "Тип ландшафта", + "minicraft.settings.type.island": "Остров", + "minicraft.settings.type.box": "Коробка", + "minicraft.settings.type.mountain": "Гора", + "minicraft.settings.type.irregular": "Неравномерный", + "minicraft.skin.paul": "Павел", + "minicraft.skin.paul_cape": "Павел в плаще", "minicraft.skin.minecraft_steve": "Знакомый парень", "minicraft.skin.minecraft_alex": "Знакомая девушка", - "minicraft.notification.invalid_placement": "Данный предмет можно поместить только на", - "minicraft.notification.dig_hole": "Сначала выкопайте яму!", - "minicraft.notification.achievement_unlocked": "Достижение получено:", - "minicraft.notification.wrong_level_sky": "Может быть призван только в небесах", - "Entities": "Сущности", - "Air Wizard: Defeated!": "Воздушный Колдун: Побежден!", - "The Dungeon is now open!": "Подземелье теперь открыто!", - "A costume lies on the ground...": "Костюм лежит на земле...", - "Can't sleep!": "Не могу спать!", - "Min ": "Мин ", - " Sec left!": " Остались секунды!", - "You hear a noise from the surface!": "Вы слышите шум с поверхности!", - "Death Chest": "Послесмертный сундук", + "minicraft.text_particales.key_consumed": "-1 ключ", + "Death Chest": "Сундук смерти", "Player": "Игрок", - "Crafting": "Крафтинг", - "Set your home!": "Установите свой дом!", - "Can't set home here!": "Здесь дом не может быть установлен!", - "Home Sweet Home!": "Дом, милый дом!", - "Mode penalty: -2 health": "Штраф за режим: -2 здоровья", - "You don't have a home!": "У тебя нет дома!", - "You can't go home from here!": "Отсюда нельзя вернуться домой!", "Leather Armor": "Кожаные доспехи", "Snake Armor": "Змеиная броня", "Iron Armor": "Железная броня", "Gold Armor": "Золотая броня", - "Gem Armor": "Алмазная броня", + "Gem Armor": "Самоцветовая броня", "Book": "Книга", "Antidious": "Антидия (английский)", "Empty Bucket": "Пустое ведро", - "Water Bucket": "Ведро с водой", - "Lava Bucket": "Ведро с лавой", - " Bucket": " Ведро", + "Water Bucket": "Ведро воды", + "Lava Bucket": "Ведро лавы", "Red Clothes": "Красная одежда", "Blue Clothes": "Синяя одежда", "Green Clothes": "Зеленая одежда", @@ -91,44 +220,44 @@ "Raw Pork": "Сырая свинина", "Raw Fish": "Сырая рыба", "Raw Beef": "Сырая говядина", - "Pork Chop": "Свинная отбивная", - "Cooked Fish": "Приготовленная рыба", - "Cooked Pork": "Приготовленная свинина", + "Pork Chop": "Жареная свинина", + "Cooked Fish": "Копченая рыба", + "Cooked Pork": "Жареная свинина", "Steak": "Стейк", "Gold Apple": "Золотое яблоко", - "Baked Potato": "Печёная картошка", + "Baked Potato": "Печёный картофель", "Cow Spawner": "Призыватель коров", "Pig Spawner": "Призыватель свиней", "Sheep Spawner": "Призыватель овец", "Slime Spawner": "Призыватель слизней", "Zombie Spawner": "Призыватель зомби", - "Creeper Spawner": "Призыватель крипера", + "Creeper Spawner": "Призыватель криперов", "Skeleton Spawner": "Призыватель скелетов", "Snake Spawner": "Призыватель змей", "Knight Spawner": "Призыватель рыцарей", - "AirWizard Spawner": "Призыватель Небесного Колдуна", + "AirWizard Spawner": "Призыватель Небесных колдунов", "Workbench": "Верстак", "Oven": "Духовка", "Furnace": "Печь", "Anvil": "Наковальня", - "Enchanter": "Алтарь зачарований", + "Enchanter": "Алтарь", "Loom": "Ткацкий станок", "Lantern": "Фонарь", "Iron Lantern": "Железный фонарь", "Gold Lantern": "Золотой фонарь", - "Tnt": "Динамит", + "Tnt": "Взрывчатка", "Bed": "Кровать", "Chest": "Сундук", - "None Potion": "Зелье без эффекта", + "None Potion": "Пустое зелье", "Speed Potion": "Зелье скорости", - "Light Potion": "Зелье света", - "Swim Potion": "Зелье плаванья", + "Light Potion": "Зелье ночного зрения", + "Swim Potion": "Зелье плавучести", "Energy Potion": "Зелье энергии", "Regen Potion": "Зелье регенерации", "Health Potion": "Зелье здоровья", "Time Potion": "Зелье времени", - "Lava Potion": "Зелье плаванья в лаве", - "Shield Potion": "Зелье щита", + "Lava Potion": "Зелье жаростойкости", + "Shield Potion": "Зелье защиты", "Haste Potion": "Зелье спешки", "Escape Potion": "Зелье возврата", "Potion": "Зелье", @@ -138,33 +267,32 @@ "Leather": "Кожа", "Wheat": "Пшеница", "Key": "Ключ", - "Arrow": "Стрелка", - "String": "Строка", "Coal": "Уголь", "Iron Ore": "Железная руда", - "Lapis": "Лазурит", "Gold Ore": "Золотая руда", + "Gem Ore": "Самоцветная руда", + "Cloud Ore": "Облачная руда", "Iron": "Железный слиток", "Gold": "Золотой слиток", + "Lapis": "Лазурит", "Rose": "Роза", "GunPowder": "Порох", "Slime": "Слизь", - "Glass": "Стекло", - "Cloth": "Ткань", - "Scale": "Змеиная чешуя", + "Scale": "Чешуя", "Shard": "Осколок", "Flower": "Цветок", - "Acorn": "Желудь", - "Dirt": "Грязь", + "Acorn": "Жёлудь", + "Dirt": "Земля", + "Natural Rock": "Природный камень", "Plank": "Доска", - "Plank Wall": "Стена из досок", + "Plank Wall": "Деревянная стена", "Wood Door": "Деревянная дверь", "Stone Brick": "Каменный кирпич", - "Ornate Stone": "Украшенный камень", + "Ornate Stone": "Резной камень", "Stone Wall": "Каменная стена", "Stone Door": "Каменная дверь", "Obsidian Brick": "Обсидиановый кирпич", - "Ornate Obsidian": "Украшенный обсидиан", + "Ornate Obsidian": "Резной обсидиан", "Obsidian Wall": "Обсидиановая стена", "Obsidian Door": "Обсидиановая дверь", "Wool": "Шерсть", @@ -175,17 +303,18 @@ "Black Wool": "Черная шерсть", "Sand": "Песок", "Cactus": "Кактус", + "Seeds": "Семена", "Wheat Seeds": "Семена пшеницы", "Grass Seeds": "Семена травы", "Bone": "Кость", "Cloud": "Облако", "Rock": "Камень", - "Gem": "Алмаз", + "Gem": "Самоцвет", "Potato": "Картофель", "Wood Fishing Rod": "Деревянная удочка", "Iron Fishing Rod": "Железная удочка", "Gold Fishing Rod": "Золотая удочка", - "Gem Fishing Rod": "Алмазная удочка", + "Gem Fishing Rod": "Самоцветовая удочка", "Shovel": "Лопата", "Hoe": "Мотыга", "Sword": "Меч", @@ -195,13 +324,11 @@ "Claymore": "Клеймор", "Shears": "Ножницы", "Torch": "Факел", - "Gem Ore": "Алмазная руда", "Wood Planks": "Деревянные доски", "Stone Bricks": "Каменные кирпичи", "Obsidian": "Обсидиан", "Wood Wall": "Деревянная стена", "Grass": "Трава", - "Natural Rock": "Природный камень", "Hole": "Дыра", "Stairs Up": "Лестница вверх", "Stairs Down": "Лестница вниз", @@ -212,143 +339,135 @@ "Lava": "Лава", "Lava Brick": "Лавовый кирпич", "Explode": "Взорвать", - "Farmland": "Фермерские угодья", - "Hard Rock": "Хард-рок", - "Infinite Fall": "Бесконечное падение", + "Farmland": "Вспаханная земля", + "Hard Rock": "Твёрдая скала", + "Infinite Fall": "Бездна", "Cloud Cactus": "Облачный кактус", - "Ore": "Руда", - "host not found": "хост не найден", - "unable to get localhost address": "не удается получить адрес localhost", - "World Saved!": "Мир спасен!", - "On": "Включено", - "Off": "Не включено", - "There is nothing of use here.": "Здесь нет ничего полезного.", - "Still nothing... :P": "Все еще ничего... :P", - "Have:": "Есть:", - "Cost:": "Затраты:", - "Time: ": "Время: ", - "Score: ": "Счет: ", - "Quit": "Выйти", - "Respawn": "Возродится", - "You died! Aww!": "Ты умер! Какая жалость!", - "Player Score: ": "Счет игрока: ", - "": "<Бонусы>", - "Final Score: ": "Итоговый счет: ", - "Exit to Menu": "Выход в меню", - "Time Played: ": "Время игры: ", - "Current Score: ": "Текущий счет: ", - "Exit": "Выход", - "Player Stats": "Статистика игрока", - "Controls": "Управление", - "Press the desired": "Нажмите нужную", - "key sequence": "последовательность клавиш", - "Are you sure you want to reset all key bindings to the default keys?": "Вы уверены, что хотите сбросить управление полностью по умолчанию?", - "enter to confirm": "ENTER, чтобы подтвердить", - "escape to cancel": "ESCAPE, чтобы отменить", - "Confirm Action": "Подтвердить действие", - "Press C/Enter to change key binding": "Нажмите C/Enter, чтобы изменить привязку клавиш", - "Press A to add key binding": "Нажмите A, чтобы добавить привязку клавиш", - "Shift-D to reset all keys to default": "Нажмите Shift-D для сброса управления по умолчанию", - "ESCAPE to Return to menu": "ESCAPE для возврата к меню ", - "Loading": "Загрузка", - "Generating": "Генерация", - "World": "Мир", - "waiting...": "жду...", - "nothing": "ничего", - "attempting log in": "попытка входа в систему", - "no internet connection, but no login data saved; cannot enter offline mode.": "нет подключения к Интернету, но данные для входа не сохранены; невозможно войти в автономный режим.", - "connecting to server": "подключение к серверу", - "logging in": "вход в систему", - "saving credentials": "сохранение реквизитов", - "login failed.": "не удалось войти в систему", - "problem with saved login data; please exit and login again.": "проблема с сохраненными данными входа; пожалуйста, выйдите и войдите снова.", - "Internal server error: Couldn't fetch username from uuid": "Внутренняя ошибка сервера: Не удалось получить имя пользователя из uuid", - "logged in as: ": "вошел в систему как: ", - "offline mode: local servers only": "автономный режим: только локальные серверы", - "Enter ip address to connect to:": "Введите ip-адрес для подключения:", - "Press Shift-Escape to logout": "Нажмите Shift-Escape для выхода из системы", - "Enter email:": "Введите e-mail:", - "Enter password:": "Введите пароль:", - "field is blank": "поле пустое", - "get an account at:": "получите аккаунт на:", - " from server": " с сервера", - "Could not connect to server:": "Не удалось подключиться к серверу:", - "Press ": "Нажмите ", - " to return": " вернутся", - "Change Key Bindings": "Изменение управления", - "Options": "Опции", - "Change language": "Изменить язык", - "Return to Game": "Вернуться в игру", - "Make World Multiplayer": "Сделать мир многопользовательским", - "Save Game": "Сохранить игру", - " and ": " и ", - " to Scroll": " прокручивать", - ": Choose": ": Выберите", - "Paused": "Приостановлено", - "Main Menu": "Главное меню", - "No": "Нет", - "Yes": "Да", - "Inventory": "Инвентарь", - "to search.": "для поиска.", - "Play": "Играть", - "Load World": "Загрузить мир", - "New World": "Новый мир", - "Multiplayer": "Мультиплеер", - "Singleplayer": "Одиночная игра", - "Help": "Помощь", - "Instructions": "Инструкции", - "Storyline Guide": "Руководство по сюжету", - "About": "О сайте", - "Credits": "Титры", - " to select": " чтобы выбрать", - " to accept": " чтобы принять", - "New World Name:": "Имя нового мира:", - "Are you sure you want to delete": "Вы уверены, что хотите удалить", - "This can not be undone!": "Этого нельзя отменить!", - " to confirm": " чтобы подтвердить", - " to cancel": " чтобы отменить", - "World Seed": "Сид мира", - "Enter World Name": "Введите имя мира", - "Trouble with world name?": "Проблема с названием мира?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "по умолчанию w и s перемещают курсор вверх и вниз. Это можно изменить в меню привязки клавиш. Чтобы набрать букву вместо перемещения курсора, удерживайте клавишу shift при наборе названия мира.", - "Create World": "Создать мир", - "World Gen Options": "Опции генерации мира", - " to Copy": " чтобы копировать", - " to Rename": " чтобы переименовать", - " to Delete": " чтобы удалить", - "Select World": "Выбрать мир", - "Select a World to Delete": "Выберите мир для удаления", - "Select a World to Rename": "Выберите мир для переименования", - "Select a World to Copy": "Выберите мир для копирования", - "Higher version, cannot load world!": "Более высокая версия, невозможно загрузить мир!", - "World Version:": "Версия мира:", - "Languages": "Языки", - "Language": "Язык", - "Select": "Выберите", - "Max FPS": "Максимальный FPS", - "Difficulty": "Сложность", - "Easy": "Легко", - "Normal": "Нормально", - "Hard": "Сложно", - "Game Mode": "Игровой режим", - "Survival": "Выживание", - "Creative": "Творческий", - "Hardcore": "Хардкор", - "Score": "На счет", - "Time (Score Mode)": "Время (режим на счет)", - "Sound": "Звук", - "Autosave": "Автосохранение", - "World Size": "Размер мира", - "World Theme": "Тематика мира", - "Forest": "Лес", - "Desert": "Пустыня", - "Plain": "Простой", - "Hell": "Ад", - "Terrain Type": "Тип местности", - "Island": "Остров", - "Box": "Коробка", - "Mountain": "Горная", - "Irregular": "Необычная", - "Wear Suit": "Надеть костюм", - "You have the latest version.": "У вас последняя версия." + "Raw Obsidian": "Обсидиан", + "Totem of Air": "Тотем воздуха", + "minicraft.control_guide.attack": "Используйте %s, чтобы атаковать мобов или разрушать блоки.", + "minicraft.control_guide.craft": "Используйте %s, чтобы открыть Меню создания.", + "minicraft.control_guide.menu": "Используйте %s, чтобы открыть Меню инвентаря.", + "minicraft.control_guide.move": "Используйте %s, чтобы двигатся.", + "minicraft.displays.controls": "Управление", + "minicraft.displays.controls.display.controller": "Контроллер", + "minicraft.displays.controls.display.controller.00": "За передвижение игрока отвечает DPAD", + "minicraft.displays.controls.display.controller.01": "За передвижение курсора отвечает DPAD", + "minicraft.displays.controls.display.controller.02": "За выбор элемента отвечает A", + "minicraft.displays.controls.display.controller.03": "За выход со страниц отвечает B", + "minicraft.displays.controls.display.controller.04": "За атаку, разрушение и использование отвечает A", + "minicraft.displays.controls.display.controller.05": "За открытие меню в игре отвечает X", + "minicraft.displays.controls.display.controller.06": "За открытие меню создания отвечает Y", + "minicraft.displays.controls.display.controller.07": "За перетаскивание мебели отвечает LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "За выбрасывание 1 предмета отвечает RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "За выбрасывание стака предметов отвечает RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "За открытие строки поиска в инвентаре отвечает START", + "minicraft.displays.controls.display.controller.11": "За паузу во время игры отвечает START", + "minicraft.displays.controls.display.controller.12": "Используйте X, чтобы активировать экранную клавиатуру", + "minicraft.displays.controls.display.controller.13": "Используйте B как Backspace на экранной клавиатуре", + "minicraft.displays.controls.display.controller.14": "Используйте X, чтобы убрать выбранный предмет в инвентаре Творческого режима", + "minicraft.displays.controls.display.controller.15": "Используйте Y, чтобы удалить стак предметов в инвентаре Творческого режима", + "minicraft.displays.controls.display.controller.desc.0": "Клавиши отладки недоступны", + "minicraft.displays.controls.display.controller.desc.1": "Детализированные назначения неиспользуемы", + "minicraft.displays.controls.display.help.0": "%s/%s чтобы увидеть другие клавиши управления.", + "minicraft.displays.controls.display.keyboard": "Клавиатура", + "minicraft.displays.controls.display.keyboard.00": "За передвижение игрока отвечает MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "За передвижение курсора отвечает CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "За выбор ячеек отвечает SELECT", + "minicraft.displays.controls.display.keyboard.03": "За выход со страниц отвечает EXIT", + "minicraft.displays.controls.display.keyboard.04": "За быстрое сохранение отвечает QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "За атаку, разрушение и использование отвечает ATTACK", + "minicraft.displays.controls.display.keyboard.06": "За открытие внутриигровых меню отвечает MENU", + "minicraft.displays.controls.display.keyboard.07": "За открытие меню создания отвечает CRAFT", + "minicraft.displays.controls.display.keyboard.08": "За перетаскивание мебели отвечает PICKUP", + "minicraft.displays.controls.display.keyboard.09": "За выбрасывание 1 предмета отвечает DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "За выбрасывание стака предметов отвечает DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "За переключение строки поиска в меню предметов отвечает SEARCHER_BAR", + "minicraft.displays.controls.display.keyboard.12": "За навигацию по результатам поиска отвечает PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "За паузу отвечает PAUSE", + "minicraft.displays.controls.display.keyboard.14": "За переключение экрана эффектов зелий отвечает POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "За переключение упрощенного экрана зелий отвечает SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "За временное разворачивание экрана заданий во время игры отвечает EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "За переключение интерфейса отвечает TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "За создание скриншота отвечает SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "За отображение внутриигровой информации отвечает INFO", + "minicraft.displays.controls.display.keyboard.20": "За переключение полноэкранного режима отвечает FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Используйте D, чтобы удалить выбранный предмет в инвентаре творческого режима", + "minicraft.displays.controls.display.keyboard.22": "Используйте SHIFT-D чтобы удалить стак предметов в инвентаре в творческого режима", + "minicraft.displays.controls.display.keyboard.desc": "Отладочные клавиши не описаны", + "minicraft.displays.loading.message.dungeon_regeneration": "Восстановление B4", + "minicraft.displays.loading.message.quests": "Задания", + "minicraft.displays.loading.regeneration_popup.display.0": "Обнаружено подземелье старой версии (этаж B4).", + "minicraft.displays.loading.regeneration_popup.display.1": "Необходима регенерация.", + "minicraft.displays.loading.regeneration_popup.display.2": "Старые данные на этом этаже будут стёрты:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s чтобы продолжить", + "minicraft.displays.loading.regeneration_popup.display.4": "%s чтобы отменить загрузку мира", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Загрузка мира отменена", + "minicraft.displays.quests.display.no_quest": "Нет открытых заданий", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Доступен только ввод с клавиатуры.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Нажмите %s, чтобы узнать подробности текущего туторила.", + "minicraft.notification.obsidian_knight_defeated": "Обсидиановый Рыцарь: Повержен!", + "minicraft.notification.obsidian_knight_awoken": "Обсидиановый Рыцарь был пробужден!", + "minicraft.notification.defeat_obsidian_knight_first": "Сначала необходимо победить Обсидианового Рыцаря.", + "minicraft.notification.wrong_level_dungeon": "Может быть призван только на этаже темницы", + "minicraft.notification.boss_limit": "Нельзя призвать больше боссов", + "minicraft.notification.spawn_on_boss_tile": "Может быть призван только в Комнате Босса", + "minicraft.notifications.statue_tapped": "Вы слышите раздающийся эхом шёпот...", + "minicraft.notifications.statue_touched": "Вы слышите, как статуя вибрирует...", + "minicraft.quest.farming": "Фермерство", + "minicraft.quest.farming.crafting_hoe": "Создание мотыги", + "minicraft.quest.farming.crafting_hoe.description": "Создание любой мотыги на верстаке", + "minicraft.quest.farming.description": "Основы фермерства.", + "minicraft.quest.farming.getting_wheat": "Сбор пшеницы", + "minicraft.quest.farming.getting_wheat.description": "Сбор пшеницы ломанием выросшего урожая.", + "minicraft.quest.farming.making_farmland": "Вспахивание земли", + "minicraft.quest.farming.making_farmland.description": "Вспахивание земли мотыгой путём взаимодействия ей с плиткой земли.", + "minicraft.quest.farming.planting_potato": "Посадка картофеля", + "minicraft.quest.farming.planting_potato.description": "Посадка картофеля путём его размещения во вспаханную землю", + "minicraft.quest.farming.planting_wheat": "Посев пшеницы", + "minicraft.quest.farming.planting_wheat.description": "Посев пшеницы путём рассыпания её семян на вспаханную землю.", + "minicraft.quest.gems": "Дорога самоцветов", + "minicraft.quest.gems.description": "Получение самоцветовой экипировки.", + "minicraft.quest.gems.gem_armor": "Мастер защиты", + "minicraft.quest.gems.gem_armor.description": "Получение самоцветовой брони.", + "minicraft.quest.gems.gem_claymore": "Мастер оружия", + "minicraft.quest.gems.gem_claymore.description": "Получение самоцветового клеймора.", + "minicraft.quest.iron_equipments": "Мастер железа", + "minicraft.quest.iron_equipments.description": "Получение всей железной экипировки.", + "minicraft.quest.iron_equipments.getting_more_iron": "Железный магнат", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Ещё больше железа.", + "minicraft.quest.iron_equipments.iron_armor": "Улучшение брони", + "minicraft.quest.iron_equipments.iron_armor.description": "Улучшение вашей брони до железной.", + "minicraft.quest.iron_equipments.iron_tools": "Улучшение инструментов", + "minicraft.quest.iron_equipments.iron_tools.description": "Улучшение всех ваших инструментов до железных", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Улучшенная кирка", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Улучшение вашей кирки.", + "minicraft.quest.potions": "Зельевар", + "minicraft.quest.potions.all_potions_prepared": "Изучение зелий", + "minicraft.quest.potions.all_potions_prepared.description": "Получение всех зелий одномоментно.", + "minicraft.quest.potions.awkward_potions": "Пустое зелье", + "minicraft.quest.potions.awkward_potions.description": "Получение пустого зелья", + "minicraft.quest.potions.description": "Получение зелий.", + "minicraft.quest.potions.powerful_potions": "Мощные Зелья", + "minicraft.quest.potions.powerful_potions.description": "Получение полезных и мощных зелий.", + "minicraft.tutorial.getting_rocks": "Получение камня и угля", + "minicraft.tutorial.getting_rocks.description": "Получение как минимум 5 камней и 5 углей путём разрушения скал при помощи кирки.", + "minicraft.tutorial.getting_wood": "Больше дерева", + "minicraft.tutorial.getting_wood.description": "Получение как минимум 10 древесины из деревев.", + "minicraft.tutorial.getting_wooden_pickaxe": "Получение деревянной кирки", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Создание деревянной кирки в меню создания на верстаке.", + "minicraft.tutorial.getting_workbench": "Получение верстака", + "minicraft.tutorial.getting_workbench.description": "Создание верстака в меню создание и размещение его.", + "minicraft.tutorial.start_getting_wood": "Начало Начал", + "minicraft.tutorial.start_getting_wood.description": "Продолжительно атаковать деревья для получения древесины.", + "minicraft.display.options_display.language": "Язык", + "minicraft.display.options_display.resource_packs": "Наборы ресурсов", + "minicraft.displays.language_settings.title": "Язык...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Стрелка", + "String": "Строка", + "Glass": "Стекло", + "Cloth": "Ткань" } diff --git a/src/client/resources/assets/localization/tr-tr.json b/src/client/resources/assets/localization/tr-tr.json index a69fbd1e3..8b246b2c3 100644 --- a/src/client/resources/assets/localization/tr-tr.json +++ b/src/client/resources/assets/localization/tr-tr.json @@ -31,28 +31,171 @@ "minicraft.achievement.airwizard.desc": "İlk Hava Sihirbazını yen!", "minicraft.achievement.skin": "Moda şovu", "minicraft.achievement.skin.desc": "Cildinizi değiştirin.", - "minicraft.display.achievement": "Başarılar", - "minicraft.display.achievement.achieved": "Başarıldı!", - "minicraft.display.achievement.not_achieved": "Başarılamadı", - "minicraft.display.achievement.score": "Başarı Puanı:", + "minicraft.display.entries.boolean.false": "Kapalı", + "minicraft.display.entries.boolean.true": "Açık", + "minicraft.display.gui.link_opening": "Tarayıcıda açılıyor...", + "minicraft.display.gui.perm_status.saving": "Kaydediliyor... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "İptal etmek için %s", + "minicraft.display.gui.perm_status.sleeping": "Uyuyor...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s ile saklan!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Skor: %s", + "minicraft.display.gui.score.time_left": "Kalan zaman %s%sm %ss", + "minicraft.display.menus.inventory": "Envanter", + "minicraft.display.options_display": "Ayarlar", + "minicraft.display.options_display.change_key_bindings": "Tuş atamalarını değiştir", + "minicraft.display.popup.enter_confirm": "enter tuşuna basarak kabul edin", + "minicraft.display.popup.escape_cancel": "escape tuşuna basarak iptal edin", + "minicraft.display.popup.title_confirm": "Onayla", + "minicraft.displays.achievements": "Başarımlar", + "minicraft.displays.achievements.display.achieved": "Başarıldı!", + "minicraft.displays.achievements.display.help": "%s ve %s ile haraket et", + "minicraft.displays.achievements.display.not_achieved": "Başarılmadı", + "minicraft.displays.achievements.display.score": "Başarım Skoru: %s", + "minicraft.displays.book.default_book": "Bu kitapta yazı yok.", + "minicraft.displays.crafting": "Üretim", + "minicraft.displays.crafting.container_title.cost": "Maaliyet:", + "minicraft.displays.crafting.container_title.have": "Sahip:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Son skor: %s", + "minicraft.displays.end_game.display.player_score": "Oyuncu skoru: %s", + "minicraft.displays.end_game.display.unlocked": "Açıldı! %s Skor Zamanı", + "minicraft.displays.end_game.exit": "Menüye çık", + "minicraft.displays.info.display.exit_help": "%s/%s: Çık", + "minicraft.displays.info.display.score": "Skor: %s", + "minicraft.displays.info.display.time": "Oynama süresi: %s", + "minicraft.displays.info.title": "Oyuncu İstatistikleri", + "minicraft.displays.key_input.display.help.0": "Atama değiştirmek için C/Enter'a bas", + "minicraft.displays.key_input.display.help.1": "Atama eklemek için A'ya bas", + "minicraft.displays.key_input.display.help.2": "Bütün tuşları sıfırlamak için Shift-D'ye bas", + "minicraft.displays.key_input.display.help.3": "%s ile menüye dön", + "minicraft.displays.key_input.popup_display.confirm_reset": "Bütm atamaları sıfırlamak istediğine emin misin?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Atamak istediğin tuş sekansına bas", + "minicraft.displays.key_input.title": "Kontroller", + "minicraft.displays.loading.message.entities": "Varlıklar", + "minicraft.displays.loading.message.generating": "Oluşturuluyor", + "minicraft.displays.loading.message.level": "Katman %s", + "minicraft.displays.loading.message.levels": "Katmanlar", + "minicraft.displays.loading.message.loading": "Yükleniyor", + "minicraft.displays.loading.message.saving": "Kaydediliyor", + "minicraft.displays.loading.message.world": "Dünya", + "minicraft.displays.options_main_menu": "Ana Menü Ayaları", + "minicraft.displays.options_main_menu.resource_packs": "Kaynak paketleri", + "minicraft.displays.options_world": "Dünya Ayarları", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Eğitimleri kalıcı olarak kapatmak istediğinize emin misiniz?", + "minicraft.displays.options_world.turn_off_tutorials": "Eğitimleri kapat", + "minicraft.displays.pause": "Durduruldu", + "minicraft.displays.pause.display.exit_popup.0": "Oyunu kapatmak istediğinize emin misiniz?", + "minicraft.displays.pause.display.exit_popup.1": "Kaydedilmemiş ilerleme kaybedilecek", + "minicraft.displays.pause.display.exit_popup.cancel": "İptal et", + "minicraft.displays.pause.display.exit_popup.quit": "Kaydetmeden Çık", + "minicraft.displays.pause.display.help.choose": "%s: Seç", + "minicraft.displays.pause.display.help.scroll": "%s ve %s ile kaydır", + "minicraft.displays.pause.menu": "Ana Menü", + "minicraft.displays.pause.return": "Oyuna Dön", + "minicraft.displays.pause.save": "Oyunu Kaydet", + "minicraft.displays.player_death.display.score": "Skor: %s", + "minicraft.displays.player_death.display.time": "Zaman: %s", + "minicraft.displays.player_death.quit": "Çık", + "minicraft.displays.player_death.respawn": "Yeniden Doğ", + "minicraft.displays.player_death.save_quit": "Kaydet ve Çık", + "minicraft.displays.player_death.title": "Ah, öldün!", + "minicraft.displays.player_inv.container_title.items": "Eşyalar", + "minicraft.displays.player_inv.display.help": "(%s) ile ara.", + "minicraft.displays.quests": "Görevler", + "minicraft.displays.quests.display.header.completed": "Tamamlandı", + "minicraft.displays.quests.display.header.unlocked": "Açıldı", + "minicraft.displays.quests.display.no_quest_desc": "Görev yok", + "minicraft.displays.resource_packs.display.help.move": "%s ve %s ile haraket et.", + "minicraft.displays.resource_packs.display.help.select": "%s ile incele.", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[SOL|SAĞ|YUKARI|AŞAĞI] ile paketleri sırala", + "minicraft.displays.resource_packs.display.title": "Kaynak Paketleri", + "minicraft.displays.skin": "Skinler", + "minicraft.displays.skin.display.help.move": "%s ve %s ile hareket et", + "minicraft.displays.skin.display.help.select": "%s ile seç, %s ile iptal et", + "minicraft.displays.title.display.cannot_check": "Güncellemeler kontrol edilemedi", + "minicraft.displays.title.display.checking": "Güncellemer kontrol ediliyor...", + "minicraft.displays.title.display.help.0": "(%s, %s ile seç)", + "minicraft.displays.title.display.help.1": "(%s ile kabul et)", + "minicraft.displays.title.display.help.2": "(%s ile geri dön)", + "minicraft.displays.title.display.latest_already": "En son versiyondasınız.", + "minicraft.displays.title.display.new_version": "Yeni: %s", + "minicraft.displays.title.display.version": "Versiyon %s", + "minicraft.displays.title.help": "Yardım", + "minicraft.displays.title.help.about": "Hakkında", + "minicraft.displays.title.help.credits": "Jenerik", + "minicraft.displays.title.help.instructions": "Talimatlar", + "minicraft.displays.title.help.storyline_guide": "Hikaye Rehberi", + "minicraft.displays.title.link_to_version": "En yeni versiyon linki: %s", + "minicraft.displays.title.play": "Oyna", + "minicraft.displays.title.play.load_world": "Dünya Yükle", + "minicraft.displays.title.play.new_world": "Yeni Dünya", + "minicraft.displays.title.quit": "Çık", + "minicraft.displays.title.select_to_download": "--İndirmek için seç--", + "minicraft.displays.world_gen.create_world": "Dünya Oluştur", + "minicraft.displays.world_gen.enter_world": "Dünya İsmini Gir", + "minicraft.displays.world_gen.title": "Dünya Jenerasyon Ayarları", + "minicraft.displays.world_gen.troublesome_input": "Dünya isminde sorun mu var?", + "minicraft.displays.world_gen.troublesome_input.msg": "", + "minicraft.displays.world_gen.world_seed": "", + "minicraft.displays.world_select.display.help.0": "%s ile onayla", + "minicraft.displays.world_select.display.help.1": "%s ile geri dön", + "minicraft.displays.world_select.display.help.2": "SHIFT-C ile kopyala", + "minicraft.displays.world_select.display.help.3": "SHIFT-R ile ismini değiştir", + "minicraft.displays.world_select.display.help.4": "SHIFT-D ile sil", + "minicraft.displays.world_select.display.world_too_new": "Yeni versiyon, dünya yüklenemez!", + "minicraft.displays.world_select.display.world_version": "Dünya Versiyonu: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s ile iptal et", + "minicraft.displays.world_select.popups.display.change": "Yeni Dünya İsmi:", + "minicraft.displays.world_select.popups.display.confirm": "%s ile ", + "minicraft.displays.world_select.popups.display.delete": "%s\"%s\"%s dünyasını silmek istediğine emin misin? Bu geri alınamaz!", + "minicraft.displays.world_select.select_world": "Dünya Seç", "minicraft.notification.achievement_unlocked": "Başarının kilidi açıldı:", - "Entities": "Varlıklar", - "Air Wizard: Defeated!": "Hava Büyücüsü: Yenildi!", - "The Dungeon is now open!": "Zindan açıldı!", - "A costume lies on the ground...": "Bir kostüm yerde duruyor...", - "Can't sleep! ": "Uyuyamam! ", - "Min ": "Dk", - " Sec left!": " Sn kaldı!", - "You hear a noise from the surface!": "Yeryüzünden Bir Ses Duydun!", + "minicraft.notification.air_wizard_defeated": "", + "minicraft.notification.cannot_sleep": "Uyuyamazsın! %s Dakika %s Saniye kaldı!", + "minicraft.notification.death_chest_retrieved": "Ölüm sandığı alındı!", + "minicraft.notification.defeat_air_wizard_first": "", + "minicraft.notification.dig_hole": "Önce bir delik kazın!", + "minicraft.notification.dungeon_opened": "Zindan artık açık!", + "minicraft.notification.gem_pickaxe_required": "Mücevher Kazma Gerekli.", + "minicraft.notification.invalid_placement": "Sadece üzerine yerleştirilebilir", + "minicraft.notification.quest_completed": "Görev tamamlandı", + "minicraft.notification.quest_unlocked": "Görev açıldı", + "minicraft.notification.world_saved": "Dünya Kaydedildi!", + "minicraft.notification.wrong_level_sky": "Sadece gökyüzü seviyesinde çağırılabilir", + "minicraft.settings.fps": "Maks FPS", + "minicraft.settings.difficulty": "Zorluk", + "minicraft.settings.difficulty.easy": "Kolay", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Zor", + "minicraft.settings.mode": "Oyun Modu", + "minicraft.settings.mode.survival": "Hayatta Kalma", + "minicraft.settings.mode.creative": "Yaratıcı", + "minicraft.settings.mode.hardcore": "Zorlayıcı", + "minicraft.settings.mode.score": "Skor", + "minicraft.settings.scoretime": "Zaman (Skor Modu)", + "minicraft.settings.screenshot_scale": "Ekran Görüntüsü Büyüklüğü", + "minicraft.settings.sound": "Ses", + "minicraft.settings.autosave": "Otomatik Kayıt", + "minicraft.settings.size": "Dün Büyüklüğü", + "minicraft.settings.theme": "Dünya Teması", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.forest": "Orman", + "minicraft.settings.theme.desert": "Çöl", + "minicraft.settings.theme.plain": "Düzlük", + "minicraft.settings.theme.hell": "Cehennem", + "minicraft.settings.type": "Arazi Türü", + "minicraft.settings.type.island": "Ada", + "minicraft.settings.type.box": "Kutu", + "minicraft.settings.type.mountain": "Dağ", + "minicraft.settings.type.irregular": "Düzensiz", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul pelerinli", + "minicraft.skin.minecraft_steve": "tanıdık çocuk", + "minicraft.skin.minecraft_alex": "tanıdık kız", + "minicraft.text_particales.key_consumed": "-1 anahtar", "Death Chest": "Ölüm Sandığı", "Player": "Karakter", - "Crafting": "Üretim", - "Set your home!": "Eviniz ayarlandı!", - "Can't set home here!": "Burası ev ayarlanamıyor!", - "Home Sweet Home!": "Evim Evim Güzel Evim!", - "Mode penalty: -2 health": "Mod cezası: -2 can", - "You don't have a home!": "Eviniz yok!", - "You can't go home from here!": "Buradan eve gidemezsiniz!", "Leather Armor": "Deri Zırh", "Snake Armor": "Yılan Zırh", "Iron Armor": "Demir Zırh", @@ -63,7 +206,6 @@ "Empty Bucket": "Boş Kova", "Water Bucket": "Su Kovası", "Lava Bucket": "Lav Kovası", - " Bucket": " Kova", "Red Clothes": "Kırmızı Kıyafet", "Blue Clothes": "Mavi Kıyafet", "Green Clothes": "Yeşil Kıyafet", @@ -125,19 +267,17 @@ "Leather": "Deri", "Wheat": "Buğday", "Key": "Anahtar", - "Arrow": "Ok", - "String": "İp", "Coal": "Kömür", "Iron Ore": "Çiğ Demir", - "Lapis": "Lapis", "Gold Ore": "Çiğ Altın", + "Gem Ore": "Çiğ Kristal", + "Cloud Ore": "Bulut Madeni", "Iron": "Demir", "Gold": "Altın", + "Lapis": "Lapis", "Rose": "Gül", "GunPowder": "Barut", "Slime": "Balçık", - "Glass": "Cam", - "Cloth": "Kumaş", "Scale": "Pul", "Shard": "Kırık Parça", "Flower": "Çiçek", @@ -181,10 +321,9 @@ "Pickaxe": "Kazma", "Axe": "Balta", "Bow": "Yay", - "FishingRod": "Olta", "Claymore": "Güçlü Kılıç", + "Shears": "Makas", "Torch": "Meşale", - "Gem Ore": "Çiğ Kristal", "Wood Planks": "Kalas", "Stone Bricks": "Taş Tuğla", "Obsidian": "Obsidyen", @@ -204,147 +343,131 @@ "Hard Rock": "Sert Taş", "Infinite Fall": "Sonsuz Uçurum", "Cloud Cactus": "Bulut Kaktüsü", - "Ore": "Maden", - "host not found": "Ağ Bulunamadı", - "unable to get localhost address": "Lokal Ağa Bağlanılamıyor", - "World Saved!": "Dünya Kurtarıldı!", - "On": "Aç", - "Off": "Kapa", - "There is nothing of use here.": "Burda Kullanılcak Birşey Yok.", - "Still nothing... :P": "Hala Bişey Yok... :P", - "Have:": "Elde Bulunan:", - "Cost:": "Gereken Malzemeler:", - "Time: ": "Süre: ", - "Score: ": "Puan: ", - "Quit": "Çıkış", - "Respawn": "Yeniden Doğ", - "You died! Aww!": "Sen Öldün! Iyy!", - "Player Score: ": "Karakter Puanı: ", - "": "", - "Final Score: ": "Final Puan: ", - "Exit to Menu": "Menüye Çık", - "Time Played: ": "Şu Kadar Süre Oynandı: ", - "Current Score: ": "Şuanki Puan: ", - "Exit": "Çıkış", - "Player Stats": "Karakter Özellikleri", - "Controls": "Kontroller", - "Press the desired": "İstenilene Tıkla", - "key sequence": "Tuş Sırası", - "minicraft.display.key_input.confirm_popup": "Bütün Kontrolleri Orjinale Döndürmek İstediğine Eminmisin?", - "minicraft.display.popup.enter_confirm": "enter tuşuna basarak kabul edin", - "minicraft.display.popup.escape_cancel": "escape tuşuna basarak iptal edin", - "Confirm Action": "Eylemi Kabul Et", - "Press C/Enter to change key binding": "C veya Enter tuşuna basarak kontrolleri değiştirin", - "Press A to add key binding": "A'ya basarak tuş ataması ekle", - "Shift-D to reset all keys to default": "Kontrolleri Resetlemek İçin Shift-D Bas", - "ESCAPE to Return to menu": "Menüye Dönmek İçin Escape'ye Bas ", - "Loading": "Yükleniyor", - "Generating": "Oluşturuluyor", - "World": "Dünya", - "waiting...": "Bekleniyor...", - "nothing": "Hiçbişey Yok", - "attempting log in": "Girilmeye Çalışılıyor", - "no internet connection, but no login data saved; cannot enter offline mode.": "İnternet Yok, Fakat Giriş Bilgisi Kaydedilmedi; Offline Moda Geçiliyor.", - "connecting to server": "Servere Bağlanılıyor", - "logging in": "Giriş Yapılıyor", - "saving credentials": "Bilgiler Kaydediliyor", - "login failed.": "Giriş Yapılamadı.", - "problem with saved login data; please exit and login again.": "Giriş Bilgisinde Sorun Oldu; Lütfen Çıkıp Tekrar Girin.", - "Internal server error: Couldn't fetch username from uuid": "Server Sorunu: Uuid'den Kullanıcı Adı Getirilemedi", - "logged in as: ": "Şu Hesapla Girildi: ", - "offline mode: local servers only": "Offline Mod: Sadece Lokal Serverler Kullanılabilir", - "Enter ip address to connect to:": "İp Adresi Girin Ve Buraya Katılın:", - "Press Shift-Escape to logout": "Shift-Escape Bas Ve Hesaptan Çık", - "Enter email:": "Eposta Girin:", - "Enter password:": "Şifre Girin:", - "field is blank": "Alan Boş!", - "get an account at:": "Şuradan Bir Hesap Alın:", - "Loading ": "Yükleniyor ", - " from server": " Serverden", - "Could not connect to server:": "Bu Yüzden Servere Girilmedi:", - "Press ": "Bas ", - " to return": " İle Geri Dönün", - "Change Key Bindings": "Kontrolleri Değiştir", - "Options": "Ayarlar", - "Change language": "Dil Değiştir", - "Return to Game": "Oyuna Dön", - "Make World Multiplayer": "Dünyayı Çokoyunculu Yapın", - "Save Game": "Oyunu Kaydet", - " and ": " Ve ", - " to Scroll": " Kaydırmak İçin", - ": Choose": ": Seç", - "Paused": "Durduruldu", - "Main Menu": "Ana Menü", - "No": "Hayır", - "Yes": "Evet", - "Inventory": "Envanter", - "to search.": "öğe aramak için.", - "Play": "Oyna", - "Load World": "Dünya Yükle", - "New World": "Yeni Dünya", - "Multiplayer": "Online Dünyaya Katıl", - "Singleplayer": "Tek oyuncu", - "Help": "Yardım", - "Instructions": "Talimatlar", - "Storyline Guide": "Hikaye Kılavuzu", - "About": "Hakkında", - "Credits": "Krediler", - " to select": " ile seç", - " to accept": " ile kabul et", - "New World Name:": "Dünya İsmi:", - "Are you sure you want to delete": "Silmek İçin Eminmisiniz?", - "This can not be undone!": "Bu Tamamlanamıyor!", - " to confirm": " İle Kabul Et", - " to cancel": " İle İptal Et", - "World Seed": "Dünya Oluşum Tohumu", - "Enter World Name": "Dünya İsmi Girin", - "Trouble with world name?": "Dünya İsmi İçin Emin misiniz?", - "by default, w and s move the cursor up and down. This can be changed in the key binding menu. To type the letter instead of moving the cursor, hold the shift key while typing the world name.": "Orjinal Kontrollerle W ve S İle Fareyi Yukarı Ve Aşağı Hareket Ettirin. Bu Kontrol Değiştirme Menüsünden Değiştirilebilir.", - "Create World": "Dünya Oluşturun", - "World Gen Options": "Dünya Oluşum Ayarları", - " to Copy": " kopyalamak", - " to Rename": " yeniden adlandırmak", - " to Delete": " silmek", - "Select World": "Dünya Seç", - "Select a World to Delete": "Silinecek Bir Dünya Seçin", - "Select a World to Rename": "Yeniden Adlandırılacak Bir Dünya Seçin", - "Select a World to Copy": "Kopyalanacak Bir Dünya Seçin", - "Higher version, cannot load world!": "Daha yüksek sürüm, dünyayı yükleyemez!", - "World Version:": "Dünya Versiyonu:", - "Languages": "Diller", - "Language": "Dil", - "Select": "Seç", - "Max FPS": "Maks FPS", - "Difficulty": "Zorluk", - "Easy": "Kolay", - "Normal": "Normal", - "Hard": "Zor", - "Game Mode": "Oyun Modu", - "Survival": "Hayatta Kalma", - "Creative": "Yaratıcılık", - "Hardcore": "Aşırı Zor", - "Score": "Puan", - "Time (Score Mode)": "Süre (Puan Modu)", - "Sound": "Ses", - "Autosave": "Oto-Kayıt", - "World Size": "Dünya Boyutu", - "World Theme": "Dünya Teması", - "Forest": "Orman", - "Desert": "Çöl", - "Plain": "Çayır", - "Hell": "Cehennem", - "Terrain Type": "Arazi Tipi", - "Island": "Ada", - "Box": "Kutu", - "Mountain": "Dağ", - "Irregular": "Düzensiz", - "Wear Suit": "Kıyafet Giy", - "You have the latest version.": "En son sürüme sahipsiniz.", - "minicraft.display.skin": "Ciltler", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul pelerinli", - "minicraft.skin.minecraft_steve": "tanıdık çocuk", - "minicraft.skin.minecraft_alex": "tanıdık kız", - "minicraft.notification.invalid_placement": "Sadece üzerine yerleştirilebilir", - "minicraft.notification.dig_hole": "Önce bir delik kazın!" + "Raw Obsidian": "İşlenmemiş Obsidyen", + "Totem of Air": "Hava Totemi", + "minicraft.control_guide.attack": "%s ile moblara saldır veya blok kır.", + "minicraft.control_guide.craft": "%s ile üretim menüsünü aç.", + "minicraft.control_guide.menu": "%s ile envater menünü aç.", + "minicraft.control_guide.move": "%s ile haraket et.", + "minicraft.displays.controls": "Kontroller", + "minicraft.displays.controls.display.controller": "Kontrolcü", + "minicraft.displays.controls.display.controller.00": "Oyuncu DPAD ile haraket ettirilir", + "minicraft.displays.controls.display.controller.01": "İmleç DPAD ile haraket ettirilir", + "minicraft.displays.controls.display.controller.02": "", + "minicraft.displays.controls.display.controller.03": "Sayfalardan B ile çıkılır", + "minicraft.displays.controls.display.controller.04": "Varlıklara saldırmak, parçalamak ve bloklarla etkileşime geçmek A'yı kullanır", + "minicraft.displays.controls.display.controller.05": "Oyun içi menüleri X ile açılır", + "minicraft.displays.controls.display.controller.06": "Üretim menüsü Y ile açılır", + "minicraft.displays.controls.display.controller.07": "", + "minicraft.displays.controls.display.controller.08": "", + "minicraft.displays.controls.display.controller.09": "", + "minicraft.displays.controls.display.controller.10": "", + "minicraft.displays.controls.display.controller.11": "", + "minicraft.displays.controls.display.controller.12": "", + "minicraft.displays.controls.display.controller.13": "", + "minicraft.displays.controls.display.controller.14": "", + "minicraft.displays.controls.display.controller.15": "", + "minicraft.displays.controls.display.controller.desc.0": "", + "minicraft.displays.controls.display.controller.desc.1": "", + "minicraft.displays.controls.display.help.0": "", + "minicraft.displays.controls.display.keyboard": "", + "minicraft.displays.controls.display.keyboard.00": "", + "minicraft.displays.controls.display.keyboard.01": "", + "minicraft.displays.controls.display.keyboard.02": "", + "minicraft.displays.controls.display.keyboard.03": "", + "minicraft.displays.controls.display.keyboard.04": "", + "minicraft.displays.controls.display.keyboard.05": "Varlıklara saldırmak, parçalamak ve bloklarla etkileşime geçmek SALDIRI'yı kullanır", + "minicraft.displays.controls.display.keyboard.06": "", + "minicraft.displays.controls.display.keyboard.07": "", + "minicraft.displays.controls.display.keyboard.08": "", + "minicraft.displays.controls.display.keyboard.09": "", + "minicraft.displays.controls.display.keyboard.10": "", + "minicraft.displays.controls.display.keyboard.11": "", + "minicraft.displays.controls.display.keyboard.12": "", + "minicraft.displays.controls.display.keyboard.13": "", + "minicraft.displays.controls.display.keyboard.14": "", + "minicraft.displays.controls.display.keyboard.15": "", + "minicraft.displays.controls.display.keyboard.16": "", + "minicraft.displays.controls.display.keyboard.17": "", + "minicraft.displays.controls.display.keyboard.18": "", + "minicraft.displays.controls.display.keyboard.19": "", + "minicraft.displays.controls.display.keyboard.20": "", + "minicraft.displays.controls.display.keyboard.21": "", + "minicraft.displays.controls.display.keyboard.22": "", + "minicraft.displays.controls.display.keyboard.desc": "", + "minicraft.displays.loading.message.dungeon_regeneration": "", + "minicraft.displays.loading.message.quests": "", + "minicraft.displays.loading.regeneration_popup.display.0": "", + "minicraft.displays.loading.regeneration_popup.display.1": "", + "minicraft.displays.loading.regeneration_popup.display.2": "", + "minicraft.displays.loading.regeneration_popup.display.3": "", + "minicraft.displays.loading.regeneration_popup.display.4": "", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "", + "minicraft.displays.quests.display.no_quest": "", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", + "minicraft.notification.obsidian_knight_defeated": "", + "minicraft.notification.obsidian_knight_awoken": "", + "minicraft.notification.defeat_obsidian_knight_first": "", + "minicraft.notification.wrong_level_dungeon": "", + "minicraft.notification.boss_limit": "Daha fazla Boss çağırılamaz", + "minicraft.notification.spawn_on_boss_tile": "Sadece Boss odasında çağırılabilir", + "minicraft.notifications.statue_tapped": "", + "minicraft.notifications.statue_touched": "", + "minicraft.quest.farming": "", + "minicraft.quest.farming.crafting_hoe": "Çapa üretmek", + "minicraft.quest.farming.crafting_hoe.description": "Tezgahtan herhangi bir çapa üret", + "minicraft.quest.farming.description": "Çiftçi olmanın", + "minicraft.quest.farming.getting_wheat": "Buğday Hasadı", + "minicraft.quest.farming.getting_wheat.description": "", + "minicraft.quest.farming.making_farmland": "Tarım arazisi yapmak", + "minicraft.quest.farming.making_farmland.description": "Toprak bloğunu çapa ile işleyerek tarım arazisi yap", + "minicraft.quest.farming.planting_potato": "Patates ekmek", + "minicraft.quest.farming.planting_potato.description": "", + "minicraft.quest.farming.planting_wheat": "Buğday ekmek", + "minicraft.quest.farming.planting_wheat.description": "", + "minicraft.quest.gems": "Mücevher Yolu", + "minicraft.quest.gems.description": "", + "minicraft.quest.gems.gem_armor": "Korunmanın Ustası", + "minicraft.quest.gems.gem_armor.description": "", + "minicraft.quest.gems.gem_claymore": "", + "minicraft.quest.gems.gem_claymore.description": "", + "minicraft.quest.iron_equipments": "Demirin Ustası", + "minicraft.quest.iron_equipments.description": "", + "minicraft.quest.iron_equipments.getting_more_iron": "Demirden Zengin", + "minicraft.quest.iron_equipments.getting_more_iron.description": "", + "minicraft.quest.iron_equipments.iron_armor": "", + "minicraft.quest.iron_equipments.iron_armor.description": "", + "minicraft.quest.iron_equipments.iron_tools": "Bütün aletlerini geliştir", + "minicraft.quest.iron_equipments.iron_tools.description": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Gelişmiş kazma", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Kazmanı geliştir.", + "minicraft.quest.potions": "İksirlerin Ustası", + "minicraft.quest.potions.all_potions_prepared": "İksirlerin Araştırmacısı", + "minicraft.quest.potions.all_potions_prepared.description": "Bütün iksirlerini aynı anda elde et.", + "minicraft.quest.potions.awkward_potions": "Garip İksir", + "minicraft.quest.potions.awkward_potions.description": "Garip iksir elde et.", + "minicraft.quest.potions.description": "", + "minicraft.quest.potions.powerful_potions": "", + "minicraft.quest.potions.powerful_potions.description": "", + "minicraft.tutorial.getting_rocks": "", + "minicraft.tutorial.getting_rocks.description": "", + "minicraft.tutorial.getting_wood": "Daha fazla odun", + "minicraft.tutorial.getting_wood.description": "", + "minicraft.tutorial.getting_wooden_pickaxe": "Tahta kazma elde etmek", + "minicraft.tutorial.getting_wooden_pickaxe.description": "", + "minicraft.tutorial.getting_workbench": "Tezgah masası almak", + "minicraft.tutorial.getting_workbench.description": "", + "minicraft.tutorial.start_getting_wood": "Her şeyin başlangıcı", + "minicraft.tutorial.start_getting_wood.description": "Ağaçlara aralıksız saldırarak odun alırsın", + "minicraft.display.options_display.language": "Dil", + "minicraft.display.options_display.resource_packs": "", + "minicraft.displays.language_settings.title": "", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "Ok", + "String": "İp", + "Glass": "Cam", + "Cloth": "Kumaş" } From f727101e6a686b89983f23b196b9b5c2a6b928cc Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 12 Nov 2023 00:32:12 +0800 Subject: [PATCH 118/261] Update ChangeLog.md --- ChangeLog.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index e2a8c6884..e8cb34421 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -16,7 +16,8 @@ but some sections are changed to compliant this project. * Added obsidian knight as the second boss * Added limitation to inventories * Added limitation to stackable items -* Added four new debug arguments - `--debug-log-time`, `--debug-log-thread`, `--debug-log-trace`, `--debug-filelog-full` +* Added seven new debug arguments - `--debug-log-time`, `--debug-log-thread`, `--debug-log-trace`, `--debug-filelog-full`, `--debug-level`, `--debug-locale`, `--debug-unloc-tracing` +* Added a new argument for disabling hardware acceleration - `--no-hardware-acceleration` * Added a toggle for HUD display * Added a toggle for simplified effect display * Added a new menu for creative mode @@ -36,6 +37,7 @@ but some sections are changed to compliant this project. * Added coloured sheep (#445) * Added ability to dye sheep and beds (#445) * Cow and sheep now graze on grasses +* Added a trigger to auto-enable hardware acceleration ### Changes @@ -51,10 +53,15 @@ but some sections are changed to compliant this project. * Made languages fallback to English * Improved the tile place indicator * Overhauled debugging actions +* Overhauled the farming system +* Changed the languaging setting menu +* Optimized CPU usage +* Reduced food stamina cost ### Removals * Removed stepped sand texture +* Removed Chrismas-related splash text ### Fixes @@ -62,6 +69,7 @@ but some sections are changed to compliant this project. * Fixed rendering positioning problem of color code styled texts * Fixed lights disappearing when out of screen * Fixed animals and items destroying plants +* Fixed various old world loading crashes ## [2.1.3] From 17bb6dc918a30dd84be099e9d276229674011aec Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 12 Nov 2023 00:35:15 +0800 Subject: [PATCH 119/261] Update ChangeLog.md --- ChangeLog.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index e8cb34421..932775048 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -61,7 +61,6 @@ but some sections are changed to compliant this project. ### Removals * Removed stepped sand texture -* Removed Chrismas-related splash text ### Fixes From ed881bbd5d1fda106f229a67901db919e43b180b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:57:19 +0800 Subject: [PATCH 120/261] Refresh localization from POEditor via API With languages being worked on added --- poeditor.yml | 5 + src/client/java/minicraft/item/Recipes.java | 280 +++++------ .../resources/assets/localization/de-de.json | 473 ++++++++++++++++++ .../resources/assets/localization/en-gb.json | 473 ++++++++++++++++++ .../resources/assets/localization/es-es.json | 40 +- .../resources/assets/localization/nl-nl.json | 473 ++++++++++++++++++ .../resources/assets/localization/pl-pl.json | 473 ++++++++++++++++++ .../resources/assets/localization/uk-ua.json | 473 ++++++++++++++++++ 8 files changed, 2530 insertions(+), 160 deletions(-) create mode 100644 src/client/resources/assets/localization/de-de.json create mode 100644 src/client/resources/assets/localization/en-gb.json create mode 100644 src/client/resources/assets/localization/nl-nl.json create mode 100644 src/client/resources/assets/localization/pl-pl.json create mode 100644 src/client/resources/assets/localization/uk-ua.json diff --git a/poeditor.yml b/poeditor.yml index 13e2488bf..b01f72bcb 100644 --- a/poeditor.yml +++ b/poeditor.yml @@ -3,6 +3,8 @@ projects: - format: key_value_json id: 590819 terms: + de: src/client/resources/assets/localization/de-de.json + en-gb: src/client/resources/assets/localization/en-gb.json en-us: src/client/resources/assets/localization/en-us.json es: src/client/resources/assets/localization/es-es.json fr: src/client/resources/assets/localization/fr-fr.json @@ -10,7 +12,10 @@ projects: id: src/client/resources/assets/localization/id-id.json it: src/client/resources/assets/localization/it-it.json nb: src/client/resources/assets/localization/nb-no.json + nl: src/client/resources/assets/localization/nl-nl.json + pl: src/client/resources/assets/localization/pl-pl.json pt: src/client/resources/assets/localization/pt-pt.json ru: src/client/resources/assets/localization/ru-ru.json tr: src/client/resources/assets/localization/tr-tr.json + uk: src/client/resources/assets/localization/uk-ua.json terms_path: src/client/resources/assets/localization/en-us.json diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 534561380..1c28699d2 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -1,140 +1,140 @@ -package minicraft.item; - -import java.util.ArrayList; - -public class Recipes { - - public static final ArrayList anvilRecipes = new ArrayList<>(); - public static final ArrayList ovenRecipes = new ArrayList<>(); - public static final ArrayList furnaceRecipes = new ArrayList<>(); - public static final ArrayList workbenchRecipes = new ArrayList<>(); - public static final ArrayList enchantRecipes = new ArrayList<>(); - public static final ArrayList craftRecipes = new ArrayList<>(); - public static final ArrayList loomRecipes = new ArrayList<>(); - - static { - craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); - craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - craftRecipes.add(new Recipe("plank_2", "Wood_1")); - craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); - - workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); - workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); - workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); - workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); - workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); - workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); - workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); - workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); - workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); - workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); - workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); - workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); - workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); - workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); - workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); - workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); - workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); - workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); - workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); - - workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); - workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); - - workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); - workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); - - loomRecipes.add(new Recipe("String_2", "Wool_1")); - loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); - loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); - loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); - loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); - loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); - loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); - - loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); - loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); - loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); - loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); - loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); - loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); - loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); - loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); - - loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - - anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); - anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); - anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); - anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); - anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); - anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); - anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); - anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); - anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); - - furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); - - ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); - ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); - ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); - ovenRecipes.add(new Recipe("bread_1", "wheat_4")); - ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); - - enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); - enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); - enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); - enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); - enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); - enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); - enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); - enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); - enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); - enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); - enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); - enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); - enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); - enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); - } -} +package minicraft.item; + +import java.util.ArrayList; + +public class Recipes { + + public static final ArrayList anvilRecipes = new ArrayList<>(); + public static final ArrayList ovenRecipes = new ArrayList<>(); + public static final ArrayList furnaceRecipes = new ArrayList<>(); + public static final ArrayList workbenchRecipes = new ArrayList<>(); + public static final ArrayList enchantRecipes = new ArrayList<>(); + public static final ArrayList craftRecipes = new ArrayList<>(); + public static final ArrayList loomRecipes = new ArrayList<>(); + + static { + craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); + craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + craftRecipes.add(new Recipe("plank_2", "Wood_1")); + craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); + + workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); + workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); + workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); + workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); + workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); + workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); + workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); + workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); + workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); + workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); + workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); + workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); + workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); + workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); + workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); + workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); + workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); + workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); + workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); + + workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); + workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); + + workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); + workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); + + loomRecipes.add(new Recipe("String_2", "Wool_1")); + loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); + loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); + loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); + loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); + loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); + loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); + + loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); + loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); + loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); + loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); + loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); + loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); + loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); + loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); + + loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + + anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); + anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); + anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); + anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); + anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); + anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); + anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); + anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); + anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); + + furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); + + ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); + ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); + ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); + ovenRecipes.add(new Recipe("bread_1", "wheat_4")); + ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); + + enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); + enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); + enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); + enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); + enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); + enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); + enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); + enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); + enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); + enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); + enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); + enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); + enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); + enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); + } +} diff --git a/src/client/resources/assets/localization/de-de.json b/src/client/resources/assets/localization/de-de.json new file mode 100644 index 000000000..8fec043ee --- /dev/null +++ b/src/client/resources/assets/localization/de-de.json @@ -0,0 +1,473 @@ +{ + "minicraft.achievement.woodcutter": "Holzfäller", + "minicraft.achievement.woodcutter.desc": "Sammel Holz.", + "minicraft.achievement.benchmarking": "Handwerker", + "minicraft.achievement.benchmarking.desc": "Baue eine Werkbank.", + "minicraft.achievement.upgrade": "Fortschritt!", + "minicraft.achievement.upgrade.desc": "Baue ein beliebiges Steinwerkzeug.", + "minicraft.achievement.bow": "", + "minicraft.achievement.bow.desc": "Schieße einen Pfeil mit einem Bogen ab.", + "minicraft.achievement.fish": "Geh Angeln!", + "minicraft.achievement.fish.desc": "Fische einen Fisch!", + "minicraft.achievement.doors": "Schutz durch die Tür", + "minicraft.achievement.doors.desc": "Baue eine Holztür.", + "minicraft.achievement.planks": "Du bist auf dem Holzweg!", + "minicraft.achievement.planks.desc": "Baue Holzplanken.", + "minicraft.achievement.clothes": "Hab einen Farbenfrohen Tag!", + "minicraft.achievement.clothes.desc": "Stelle Kleidung in einer Farbe her", + "minicraft.achievement.demolition": "Abriss-Vorschau", + "minicraft.achievement.demolition.desc": "Benutze TNT.", + "minicraft.achievement.survive_darkness": "Wer hat Angst vor der Dunkelheit?", + "minicraft.achievement.survive_darkness.desc": "Überlebe 5 Minuten in der absoluten Dunkelheit.", + "minicraft.achievement.lava": "Heiße Angelegenheiten", + "minicraft.achievement.lava.desc": "Trinke einen Lava Trank und versuche in Lava zu schwimmen.", + "minicraft.achievement.find_gem": "Sehr glänzend!", + "minicraft.achievement.find_gem.desc": "Finde Edelsteinerz und baue es ab.", + "minicraft.achievement.lowest_caves": "Dunkelheit hinter dem Licht", + "minicraft.achievement.lowest_caves.desc": "Erreiche die untersten Höhlen.", + "minicraft.achievement.obsidian_dungeon": "Von Rittern und Männern", + "minicraft.achievement.obsidian_dungeon.desc": "Erreiche den Obsidian-Dungeon.", + "minicraft.achievement.airwizard": "Besiege... die Luft?", + "minicraft.achievement.airwizard.desc": "Besiege den ersten Luftzauberer!", + "minicraft.achievement.skin": "Modenschau", + "minicraft.achievement.skin.desc": "Verändere dein Aussehen.", + "minicraft.display.entries.boolean.false": "Aus", + "minicraft.display.entries.boolean.true": "An", + "minicraft.display.gui.link_opening": "Im Browser öffnen", + "minicraft.display.gui.perm_status.saving": "Speichern... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Drücke %s zum Abbrechen", + "minicraft.display.gui.perm_status.sleeping": "Schlafen...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s zum verstecken!)", + "minicraft.display.gui.potion_effects.potion_dur": "", + "minicraft.display.gui.score.current_score": "Aktuelle Punktzahl: %s", + "minicraft.display.gui.score.time_left": "Zeit übrig %s%sm %ss", + "minicraft.display.menus.inventory": "Inventar", + "minicraft.display.options_display": "Einstellungen", + "minicraft.display.options_display.change_key_bindings": "Tastenbelegung", + "minicraft.display.popup.enter_confirm": "Eingabe zum bestätigen", + "minicraft.display.popup.escape_cancel": "Esc zum abbrechen", + "minicraft.display.popup.title_confirm": "Bestätigen", + "minicraft.displays.achievements": "Errungenschaften", + "minicraft.displays.achievements.display.achieved": "Erreicht!", + "minicraft.displays.achievements.display.help": "Benutze %s und %s um dich zu bewegen.", + "minicraft.displays.achievements.display.not_achieved": "Nicht erreicht", + "minicraft.displays.achievements.display.score": "Errungenschaftspunkte: %s", + "minicraft.displays.book.default_book": "Dieses Buch hat keinen Inhalt.", + "minicraft.displays.crafting": "Bauen", + "minicraft.displays.crafting.container_title.cost": "Kosten:", + "minicraft.displays.crafting.container_title.have": "Du hast:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Punktzahl: %s", + "minicraft.displays.end_game.display.player_score": "Spielerpunktzahl: %s", + "minicraft.displays.end_game.display.unlocked": "Freigeschaltet in %s Sekunden", + "minicraft.displays.end_game.exit": "Zurück zum Menü", + "minicraft.displays.info.display.exit_help": "%s/%s:Verlassen", + "minicraft.displays.info.display.score": "Aktuelle Punktzahl: %s", + "minicraft.displays.info.display.time": "Zeit gespielt: %s Sekunden", + "minicraft.displays.info.title": "Spieler Status", + "minicraft.displays.key_input.display.help.0": "Drücke C/Eingabe um die Tastenbelegung zu ändern", + "minicraft.displays.key_input.display.help.1": "Drücke A um eine Tastenbelegung hinzuzufügen", + "minicraft.displays.key_input.display.help.2": "Shift-D setzt alle Tastenbelegungen auf den Standard", + "minicraft.displays.key_input.display.help.3": "%s um zum Menü zurückzukommen", + "minicraft.displays.key_input.popup_display.confirm_reset": "Bist du sicher das du alle Tastenbelegungen auf Werkseinstellungen zurücksetzen willst?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Drücke die gewünschte Tastenkombination", + "minicraft.displays.key_input.title": "Steuerung", + "minicraft.displays.loading.message.entities": "Entitäten", + "minicraft.displays.loading.message.generating": "Generierung", + "minicraft.displays.loading.message.level": "Level %s", + "minicraft.displays.loading.message.levels": "Level", + "minicraft.displays.loading.message.loading": "Laden", + "minicraft.displays.loading.message.saving": "Speichern", + "minicraft.displays.loading.message.world": "Welt", + "minicraft.displays.options_main_menu": "Hautpmenü-Optionen", + "minicraft.displays.options_main_menu.resource_packs": "Ressourcen-Pakete", + "minicraft.displays.options_world": "Weltoptionen", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Bist du dir sicher das du die Tutorials für immer deaktivieren möchtests?", + "minicraft.displays.options_world.turn_off_tutorials": "Tutorials deaktivieren", + "minicraft.displays.pause": "Pausiert", + "minicraft.displays.pause.display.exit_popup.0": "Bist du sicher das du das Spiel verlassen möchtest?", + "minicraft.displays.pause.display.exit_popup.1": "Dein ungespeicherter Vortschritt wird verloren gehen", + "minicraft.displays.pause.display.exit_popup.cancel": "Abbrechen", + "minicraft.displays.pause.display.exit_popup.quit": "Verlassen ohne zu speichern", + "minicraft.displays.pause.display.help.choose": "%s: Wähle", + "minicraft.displays.pause.display.help.scroll": "%s und %s zum Scrollen", + "minicraft.displays.pause.menu": "Hauptmenü", + "minicraft.displays.pause.return": "Zurück zum Spiel", + "minicraft.displays.pause.save": "Spiel speichern", + "minicraft.displays.player_death.display.score": "Punktzahl: %s", + "minicraft.displays.player_death.display.time": "Zeit: %s", + "minicraft.displays.player_death.quit": "Verlassen", + "minicraft.displays.player_death.respawn": "Wiederbeleben", + "minicraft.displays.player_death.save_quit": "Speichern und verlassen", + "minicraft.displays.player_death.title": "Du bist gestorben! Aww!", + "minicraft.displays.player_inv.container_title.items": "Gegenstände", + "minicraft.displays.player_inv.display.help": "(%s) zum suchen.", + "minicraft.displays.quests": "Aufgaben", + "minicraft.displays.quests.display.header.completed": "Erfüllt", + "minicraft.displays.quests.display.header.unlocked": "Freigeschaltet", + "minicraft.displays.quests.display.no_quest_desc": "Keine Aufgaben", + "minicraft.displays.resource_packs.display.help.move": "Benutze %s und %s um dich zu bewegen.", + "minicraft.displays.resource_packs.display.help.select": "%s zum prüfen.", + "minicraft.displays.resource_packs.display.help.position": "UMSCHALT-[LINKS|RECHTS|OBEN|UNTEN], um Pakete zu verschieben.␣", + "minicraft.displays.resource_packs.display.title": "Ressourcen-Pakete", + "minicraft.displays.skin": "Skins", + "minicraft.displays.skin.display.help.move": "Benutze %s und %s um dich zu bewegen.", + "minicraft.displays.skin.display.help.select": "%s zum Auswählen und %s zum Abbrechen.", + "minicraft.displays.title.display.cannot_check": "Es konnte nicht nach Updates gesucht werden.", + "minicraft.displays.title.display.checking": "Suche nach Updates...", + "minicraft.displays.title.display.help.0": "(%s, %s zur Auswahl)", + "minicraft.displays.title.display.help.1": "(%s to accept)", + "minicraft.displays.title.display.help.2": "(%s um zurückzukehren)", + "minicraft.displays.title.display.latest_already": "Du hast die aktuelle Version.", + "minicraft.displays.title.display.new_version": "Neu: %s", + "minicraft.displays.title.display.version": "Version %s", + "minicraft.displays.title.help": "Hilfe", + "minicraft.displays.title.help.about": "Über", + "minicraft.displays.title.help.credits": "Credits", + "minicraft.displays.title.help.instructions": "Anweisungen", + "minicraft.displays.title.help.storyline_guide": "Storyline-Leitfaden", + "minicraft.displays.title.link_to_version": "Direkter Link zur neuesten Version: %s", + "minicraft.displays.title.play": "Spielen", + "minicraft.displays.title.play.load_world": "Welt laden", + "minicraft.displays.title.play.new_world": "Neue Welt", + "minicraft.displays.title.quit": "Verlassen", + "minicraft.displays.title.select_to_download": "--Hier zum Herunterladen auswählen--", + "minicraft.displays.world_gen.create_world": "Welt erschaffen", + "minicraft.displays.world_gen.enter_world": "Gib einen Weltnamen ein", + "minicraft.displays.world_gen.title": "Welt generierungsoptionen", + "minicraft.displays.world_gen.troublesome_input": "Probleme mit dem Weltnamen?", + "minicraft.displays.world_gen.troublesome_input.msg": "Es scheint, dass Sie Buchstaben als Steuerelemente für die Bewegung des Cursors nach oben und unten festgelegt haben, was wahrscheinlich störend ist. Dies kann im Tastenbelegungsmenü als \"Cursor-XXX\"-Tasten geändert werden. Um den Buchstaben einzugeben, anstatt den Cursor zu bewegen, halten Sie die Umschalttaste während der Eingabe gedrückt.", + "minicraft.displays.world_gen.world_seed": "Welt Seed", + "minicraft.displays.world_select.display.help.0": "%s zum bestätigen", + "minicraft.displays.world_select.display.help.1": "%s um zurückzukehren", + "minicraft.displays.world_select.display.help.2": "SHIFT-C zum kopieren", + "minicraft.displays.world_select.display.help.3": "SHIFT-R zum umbenennen", + "minicraft.displays.world_select.display.help.4": "SHIFT-D zum löschen", + "minicraft.displays.world_select.display.world_too_new": "Neuere version, laden der Welt nicht möglich!", + "minicraft.displays.world_select.display.world_version": "Welt version: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s um abzubrechen", + "minicraft.displays.world_select.popups.display.change": "Neuer Weltname:", + "minicraft.displays.world_select.popups.display.confirm": "%s zum bestätigen", + "minicraft.displays.world_select.popups.display.delete": "Bist du sicher das du folgende Welt löschen möchtest?\n%s\"%s\"%s\nEs gibt kein zurück!", + "minicraft.displays.world_select.select_world": "Welt auswählen", + "minicraft.notification.achievement_unlocked": "Errungenschaft freigeschaltet: %s", + "minicraft.notification.air_wizard_defeated": "Luftzauberer besiegt!", + "minicraft.notification.cannot_sleep": "Kann nicht schlafen! %smin %s sek übrig!", + "minicraft.notification.death_chest_retrieved": "Todestruhe wiedergefunden!", + "minicraft.notification.defeat_air_wizard_first": "Der Luftzauberer muss zuerst besiegt werden.", + "minicraft.notification.dig_hole": "Erst ein Loch graben!", + "minicraft.notification.dungeon_opened": "Der Dungeon ist jetzt geöffnet!", + "minicraft.notification.gem_pickaxe_required": "Edelstein-Spitzhacke erforderlich.", + "minicraft.notification.invalid_placement": "Kann nur auf %s platziert werden!", + "minicraft.notification.quest_completed": "Aufgabe abgeschlossen", + "minicraft.notification.quest_unlocked": "Aufgabe freigeschaltet", + "minicraft.notification.world_saved": "Welt gespeichert!", + "minicraft.notification.wrong_level_sky": "Kann nur in der Himmelsebene beschworen werden", + "minicraft.settings.fps": "Maximale FPS", + "minicraft.settings.difficulty": "Schwierigkeit", + "minicraft.settings.difficulty.easy": "Einfach", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Schwer", + "minicraft.settings.mode": "Gamemode", + "minicraft.settings.mode.survival": "Überlebensmodus", + "minicraft.settings.mode.creative": "Kreativmodus", + "minicraft.settings.mode.hardcore": "Hardcoremodus", + "minicraft.settings.mode.score": "Punktzahl", + "minicraft.settings.scoretime": "Zeit (Punktzahlmodus)", + "minicraft.settings.screenshot_scale": "Schnappschuss-Auflösung", + "minicraft.settings.sound": "Soundeinstellungen", + "minicraft.settings.autosave": "Automtisches Speichern", + "minicraft.settings.size": "Weltgröße", + "minicraft.settings.theme": "Thema der Welt", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.forest": "Wald", + "minicraft.settings.theme.desert": "Wüste", + "minicraft.settings.theme.plain": "Grasland", + "minicraft.settings.theme.hell": "Hölle", + "minicraft.settings.type": "Oberflächen-Typ", + "minicraft.settings.type.island": "Insel", + "minicraft.settings.type.box": "Box", + "minicraft.settings.type.mountain": "Berg", + "minicraft.settings.type.irregular": "Uneben", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul mit Umhang", + "minicraft.skin.minecraft_steve": "Bekannte Junge", + "minicraft.skin.minecraft_alex": "Bekanntes Mädchen", + "minicraft.text_particales.key_consumed": "-1 Schlüssel", + "Death Chest": "Todesschatztruhe", + "Player": "Spieler", + "Leather Armor": "Lederrüstung", + "Snake Armor": "Schlangerüstung", + "Iron Armor": "Eisenrüstung", + "Gold Armor": "Goldrüstung", + "Gem Armor": "Edelsteinrüstung", + "Book": "Buch", + "Antidious": "Gefährlich", + "Empty Bucket": "Leerer Eimer", + "Water Bucket": "Wassereimer", + "Lava Bucket": "Lavaeimer", + "Red Clothes": "Rote Kleidung", + "Blue Clothes": "Blaue Kleidung", + "Green Clothes": "Grüne Kleidung", + "Yellow Clothes": "Gelbe Kleidung", + "Black Clothes": "Schwarze Kleidung", + "Orange Clothes": "Orange Kleidung", + "Purple Clothes": "Lilane Kleidung", + "Cyan Clothes": "Cyan Kleidung", + "Reg Clothes": "Reg Kleidung", + "Bread": "Brot", + "Apple": "Apfel", + "Raw Pork": "Rohes Schweinefleisch", + "Raw Fish": "Roher Fisch", + "Raw Beef": "Rohes Rindfleisch", + "Pork Chop": "Schweinekotelett", + "Cooked Fish": "Gebratener Fisch", + "Cooked Pork": "Gebratenes Schweinerfleisch", + "Steak": "Gebratenens Rindfleisch", + "Gold Apple": "Goldener Apfel", + "Baked Potato": "Gebackene Kartoffeln", + "Cow Spawner": "Kuh-Monsterspawner", + "Pig Spawner": "Schweine-Monsterspawner", + "Sheep Spawner": "Schaf-Monsterspawner", + "Slime Spawner": "Schleim-Monsterspawner", + "Zombie Spawner": "Zombie-Monsterspawner", + "Creeper Spawner": "Creeper-Monsterspawner", + "Skeleton Spawner": "Skellett-Monsterspawner", + "Snake Spawner": "Schlangen-Monsterspawner", + "Knight Spawner": "Ritter-Monsterspawner", + "AirWizard Spawner": "Luftmagier-Monsterspawner", + "Workbench": "Werkbank", + "Oven": "Backofen", + "Furnace": "Ofen", + "Anvil": "Amboss", + "Enchanter": "Verzauberungstisch", + "Loom": "Webstuhl", + "Lantern": "Laterne", + "Iron Lantern": "Eisen-Laterne", + "Gold Lantern": "Gold-Laterne", + "Tnt": "TNT", + "Bed": "Bett", + "Chest": "Kiste", + "None Potion": "Kein Trank", + "Speed Potion": "Geschwindigkeitstrank", + "Light Potion": "Lichttrank", + "Swim Potion": "Schwimmtrank", + "Energy Potion": "Energietrank", + "Regen Potion": "Regenerationstrank", + "Health Potion": "Gesundheitstrank", + "Time Potion": "Zeittrank", + "Lava Potion": "Lavatrank", + "Shield Potion": "Schildtrank", + "Haste Potion": "Eiltrank", + "Escape Potion": "Fluchttrank", + "Potion": "Trank", + "Power Glove": "Krafthanschuh", + "Wood": "Holz", + "Stone": "Stein", + "Leather": "Leder", + "Wheat": "Weizen", + "Key": "Schlüssel", + "Coal": "Kohle", + "Iron Ore": "Eisenerz", + "Gold Ore": "Golderz", + "Gem Ore": "Edelsteinerz", + "Cloud Ore": "Wolkenerz", + "Iron": "Eisen", + "Gold": "Gold", + "Lapis": "Lapis", + "Rose": "Rose", + "GunPowder": "Schießpulver", + "Slime": "Schleim", + "Scale": "Schuppe", + "Shard": "Scherbe", + "Flower": "Blume", + "Acorn": "Eichel", + "Dirt": "Erde", + "Natural Rock": "Naturgestein", + "Plank": "Planke", + "Plank Wall": "Bretterwand", + "Wood Door": "Holztür", + "Stone Brick": "Steinziegel", + "Ornate Stone": "Verzierter Stein", + "Stone Wall": "Steinwand", + "Stone Door": "Steintür", + "Obsidian Brick": "Obsidianziegel", + "Ornate Obsidian": "Verzierter Obsidian", + "Obsidian Wall": "Obsidianwand", + "Obsidian Door": "Obsidiantür", + "Wool": "Wolle", + "Red Wool": "Rote Wolle", + "Blue Wool": "Blaue Wolle", + "Green Wool": "Grüne Wolle", + "Yellow Wool": "Gelbe Wolle", + "Black Wool": "Schwarze Wolle", + "Sand": "Sand", + "Cactus": "Kaktus", + "Seeds": "Samen", + "Wheat Seeds": "Weizensamen", + "Grass Seeds": "Grasssamen", + "Bone": "Knochen", + "Cloud": "Wolke", + "Rock": "Stein", + "Gem": "Edelstein", + "Potato": "Kartoffel", + "Wood Fishing Rod": "Holzrute", + "Iron Fishing Rod": "Steinrute", + "Gold Fishing Rod": "Goldrute", + "Gem Fishing Rod": "Edelsteinrute", + "Shovel": "Schaufel", + "Hoe": "Feldhacke", + "Sword": "Schwert", + "Pickaxe": "Spitzhacke", + "Axe": "Axt", + "Bow": "Bogen", + "Claymore": "Sprengmiene", + "Shears": "Schere", + "Torch": "Fackel", + "Wood Planks": "Holzplanken", + "Stone Bricks": "Steinziegel", + "Obsidian": "Obsidian", + "Wood Wall": "Holzwand", + "Grass": "Gras", + "Hole": "Loch", + "Stairs Up": "Treppen rauf", + "Stairs Down": "Treppen runter", + "Water": "Wasser", + "Tree": "Baum", + "Tree Sapling": "Baumsetzling", + "Cactus Sapling": "Kaktussetzling", + "Lava": "Lava", + "Lava Brick": "Lavaziegel", + "Explode": "Explodieren", + "Farmland": "Ackerland", + "Hard Rock": "Hartgestein", + "Infinite Fall": "Unendlicher Fall", + "Cloud Cactus": "Wolken Kaktus", + "Raw Obsidian": "Roher Obsidian", + "Totem of Air": "Totem der Luft", + "minicraft.control_guide.attack": "Benutze %s, um Mobs anzugreifen oder Kacheln zu zerstören.", + "minicraft.control_guide.craft": "Benutze %s, um dein Handwerksmenü zu öffnen.", + "minicraft.control_guide.menu": "Verwenden Sie %s, um Ihr Inventarmenü zu öffnen.", + "minicraft.control_guide.move": "Verwende %s um dich zu bewegen.", + "minicraft.displays.controls": "Steuerung", + "minicraft.displays.controls.display.controller": "Controller", + "minicraft.displays.controls.display.controller.00": "Bewegen des Spielers durch das DPAD", + "minicraft.displays.controls.display.controller.01": "Bewegen des Cursors durch das DPAD", + "minicraft.displays.controls.display.controller.02": "Die Auswahl der Einträge erfolgt mit A", + "minicraft.displays.controls.display.controller.03": "Das Verlassen der Seiten erfolgt mit B", + "minicraft.displays.controls.display.controller.04": "Angreifen, Zerstören und Interagieren mit Kacheln erfolgt mit A", + "minicraft.displays.controls.display.controller.05": "Das Öffnen von Menüs im Spiel erfolgt mit X", + "minicraft.displays.controls.display.controller.06": "Das Öffnen von Handwerk-Menüs erfolgt mit Y", + "minicraft.displays.controls.display.controller.07": "Das aufheben von Möbel erfolgt mit der linken Schultertaste", + "minicraft.displays.controls.display.controller.08": "Das fallenlassen von Gegenständen erfolgt mit der rechten Schultertaste", + "minicraft.displays.controls.display.controller.09": "Das fallenlassen eines ganzen Stapels erfolgt mit dem rechten Stick", + "minicraft.displays.controls.display.controller.10": "", + "minicraft.displays.controls.display.controller.11": "", + "minicraft.displays.controls.display.controller.12": "", + "minicraft.displays.controls.display.controller.13": "", + "minicraft.displays.controls.display.controller.14": "", + "minicraft.displays.controls.display.controller.15": "", + "minicraft.displays.controls.display.controller.desc.0": "", + "minicraft.displays.controls.display.controller.desc.1": "", + "minicraft.displays.controls.display.help.0": "", + "minicraft.displays.controls.display.keyboard": "", + "minicraft.displays.controls.display.keyboard.00": "", + "minicraft.displays.controls.display.keyboard.01": "", + "minicraft.displays.controls.display.keyboard.02": "", + "minicraft.displays.controls.display.keyboard.03": "", + "minicraft.displays.controls.display.keyboard.04": "", + "minicraft.displays.controls.display.keyboard.05": "", + "minicraft.displays.controls.display.keyboard.06": "", + "minicraft.displays.controls.display.keyboard.07": "", + "minicraft.displays.controls.display.keyboard.08": "", + "minicraft.displays.controls.display.keyboard.09": "", + "minicraft.displays.controls.display.keyboard.10": "", + "minicraft.displays.controls.display.keyboard.11": "", + "minicraft.displays.controls.display.keyboard.12": "", + "minicraft.displays.controls.display.keyboard.13": "", + "minicraft.displays.controls.display.keyboard.14": "", + "minicraft.displays.controls.display.keyboard.15": "", + "minicraft.displays.controls.display.keyboard.16": "", + "minicraft.displays.controls.display.keyboard.17": "", + "minicraft.displays.controls.display.keyboard.18": "", + "minicraft.displays.controls.display.keyboard.19": "", + "minicraft.displays.controls.display.keyboard.20": "", + "minicraft.displays.controls.display.keyboard.21": "", + "minicraft.displays.controls.display.keyboard.22": "", + "minicraft.displays.controls.display.keyboard.desc": "", + "minicraft.displays.loading.message.dungeon_regeneration": "", + "minicraft.displays.loading.message.quests": "", + "minicraft.displays.loading.regeneration_popup.display.0": "", + "minicraft.displays.loading.regeneration_popup.display.1": "", + "minicraft.displays.loading.regeneration_popup.display.2": "", + "minicraft.displays.loading.regeneration_popup.display.3": "", + "minicraft.displays.loading.regeneration_popup.display.4": "", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "", + "minicraft.displays.quests.display.no_quest": "", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", + "minicraft.notification.obsidian_knight_defeated": "", + "minicraft.notification.obsidian_knight_awoken": "", + "minicraft.notification.defeat_obsidian_knight_first": "", + "minicraft.notification.wrong_level_dungeon": "", + "minicraft.notification.boss_limit": "", + "minicraft.notification.spawn_on_boss_tile": "", + "minicraft.notifications.statue_tapped": "", + "minicraft.notifications.statue_touched": "", + "minicraft.quest.farming": "", + "minicraft.quest.farming.crafting_hoe": "", + "minicraft.quest.farming.crafting_hoe.description": "", + "minicraft.quest.farming.description": "", + "minicraft.quest.farming.getting_wheat": "", + "minicraft.quest.farming.getting_wheat.description": "", + "minicraft.quest.farming.making_farmland": "", + "minicraft.quest.farming.making_farmland.description": "", + "minicraft.quest.farming.planting_potato": "", + "minicraft.quest.farming.planting_potato.description": "", + "minicraft.quest.farming.planting_wheat": "", + "minicraft.quest.farming.planting_wheat.description": "", + "minicraft.quest.gems": "", + "minicraft.quest.gems.description": "", + "minicraft.quest.gems.gem_armor": "", + "minicraft.quest.gems.gem_armor.description": "", + "minicraft.quest.gems.gem_claymore": "", + "minicraft.quest.gems.gem_claymore.description": "", + "minicraft.quest.iron_equipments": "", + "minicraft.quest.iron_equipments.description": "", + "minicraft.quest.iron_equipments.getting_more_iron": "", + "minicraft.quest.iron_equipments.getting_more_iron.description": "", + "minicraft.quest.iron_equipments.iron_armor": "", + "minicraft.quest.iron_equipments.iron_armor.description": "", + "minicraft.quest.iron_equipments.iron_tools": "", + "minicraft.quest.iron_equipments.iron_tools.description": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", + "minicraft.quest.potions": "", + "minicraft.quest.potions.all_potions_prepared": "", + "minicraft.quest.potions.all_potions_prepared.description": "", + "minicraft.quest.potions.awkward_potions": "", + "minicraft.quest.potions.awkward_potions.description": "", + "minicraft.quest.potions.description": "", + "minicraft.quest.potions.powerful_potions": "", + "minicraft.quest.potions.powerful_potions.description": "", + "minicraft.tutorial.getting_rocks": "", + "minicraft.tutorial.getting_rocks.description": "", + "minicraft.tutorial.getting_wood": "", + "minicraft.tutorial.getting_wood.description": "", + "minicraft.tutorial.getting_wooden_pickaxe": "", + "minicraft.tutorial.getting_wooden_pickaxe.description": "", + "minicraft.tutorial.getting_workbench": "", + "minicraft.tutorial.getting_workbench.description": "", + "minicraft.tutorial.start_getting_wood": "", + "minicraft.tutorial.start_getting_wood.description": "", + "minicraft.display.options_display.language": "", + "minicraft.display.options_display.resource_packs": "", + "minicraft.displays.language_settings.title": "", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "", + "String": "", + "Glass": "", + "Cloth": "" +} diff --git a/src/client/resources/assets/localization/en-gb.json b/src/client/resources/assets/localization/en-gb.json new file mode 100644 index 000000000..67c15c9ed --- /dev/null +++ b/src/client/resources/assets/localization/en-gb.json @@ -0,0 +1,473 @@ +{ + "minicraft.achievement.woodcutter": "Woodcutter", + "minicraft.achievement.woodcutter.desc": "Get wood.", + "minicraft.achievement.benchmarking": "Benchmarking", + "minicraft.achievement.benchmarking.desc": "Make a workbench.", + "minicraft.achievement.upgrade": "Upgrade!", + "minicraft.achievement.upgrade.desc": "Craft any Stone tool.", + "minicraft.achievement.bow": "Bow down to me!", + "minicraft.achievement.bow.desc": "Fire an arrow with a bow.", + "minicraft.achievement.fish": "Go Fish!", + "minicraft.achievement.fish.desc": "Fish up a Fish!", + "minicraft.achievement.doors": "Adooring Protection", + "minicraft.achievement.doors.desc": "Craft a wood door.", + "minicraft.achievement.planks": "Walk the Planks!", + "minicraft.achievement.planks.desc": "Craft wood planks.", + "minicraft.achievement.clothes": "Have a colourful day!", + "minicraft.achievement.clothes.desc": "Craft any color of clothes", + "minicraft.achievement.demolition": "Demolition Demo", + "minicraft.achievement.demolition.desc": "Use TNT.", + "minicraft.achievement.survive_darkness": "Afraid of the Dark?", + "minicraft.achievement.survive_darkness.desc": "Survive 5 minutes in total darkness.", + "minicraft.achievement.lava": "Hot Affairs", + "minicraft.achievement.lava.desc": "Use a lava potion to swim in lava.", + "minicraft.achievement.find_gem": "Oooh Shiny!", + "minicraft.achievement.find_gem.desc": "Find Gem Ore and mine it.", + "minicraft.achievement.lowest_caves": "What the light hides behind", + "minicraft.achievement.lowest_caves.desc": "Reach the lowest caves.", + "minicraft.achievement.obsidian_dungeon": "Of Knights and Men", + "minicraft.achievement.obsidian_dungeon.desc": "Reach the obsidian dungeon.", + "minicraft.achievement.airwizard": "Defeat... the air?", + "minicraft.achievement.airwizard.desc": "Defeat the first Air Wizard!", + "minicraft.achievement.skin": "Glamour Show", + "minicraft.achievement.skin.desc": "Change your look.", + "minicraft.display.entries.boolean.false": "Off", + "minicraft.display.entries.boolean.true": "On", + "minicraft.display.gui.link_opening": "Opening with browser...", + "minicraft.display.gui.perm_status.saving": "Saving... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Press %s to cancel", + "minicraft.display.gui.perm_status.sleeping": "Taking a Nap...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s to hide!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Current score: %s", + "minicraft.display.gui.score.time_left": "Time left %s%sm %ss", + "minicraft.display.menus.inventory": "Inventory", + "minicraft.display.options_display": "Settings", + "minicraft.display.options_display.change_key_bindings": "Key bindings", + "minicraft.display.popup.enter_confirm": "enter to confirm", + "minicraft.display.popup.escape_cancel": "escape to cancel", + "minicraft.display.popup.title_confirm": "Confirm Action", + "minicraft.displays.achievements": "Achievements", + "minicraft.displays.achievements.display.achieved": "Completed!", + "minicraft.displays.achievements.display.help": "Use %s and %s to move.", + "minicraft.displays.achievements.display.not_achieved": "Uncompleted", + "minicraft.displays.achievements.display.score": "Achievement Score: %s", + "minicraft.displays.book.default_book": "The book has no text.", + "minicraft.displays.crafting": "Crafting", + "minicraft.displays.crafting.container_title.cost": "Cost:", + "minicraft.displays.crafting.container_title.have": "Have:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Final Score: %s", + "minicraft.displays.end_game.display.player_score": "Player Score: %s", + "minicraft.displays.end_game.display.unlocked": "Unlocked! %s Score Time", + "minicraft.displays.end_game.exit": "Exit to Menu", + "minicraft.displays.info.display.exit_help": "%s/%s:Exit", + "minicraft.displays.info.display.score": "Current Score: %s", + "minicraft.displays.info.display.time": "Time Played: %s", + "minicraft.displays.info.title": "Player Statistics", + "minicraft.displays.key_input.display.help.0": "Press C/Enter to change key binding", + "minicraft.displays.key_input.display.help.1": "Press A to add key binding", + "minicraft.displays.key_input.display.help.2": "Shift-D to reset all keys to default", + "minicraft.displays.key_input.display.help.3": "%s to Return to menu", + "minicraft.displays.key_input.popup_display.confirm_reset": "Are you sure you want to reset all key bindings to the default keys?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Press the desired key sequence", + "minicraft.displays.key_input.title": "Controls", + "minicraft.displays.loading.message.entities": "Entities", + "minicraft.displays.loading.message.generating": "Generating", + "minicraft.displays.loading.message.level": "Level %s", + "minicraft.displays.loading.message.levels": "Levels", + "minicraft.displays.loading.message.loading": "Loading", + "minicraft.displays.loading.message.saving": "Saving", + "minicraft.displays.loading.message.world": "World", + "minicraft.displays.options_main_menu": "Main Menu Options", + "minicraft.displays.options_main_menu.resource_packs": "Resource packs", + "minicraft.displays.options_world": "World Options", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Are you sure you want to turn off the tutorials forever?", + "minicraft.displays.options_world.turn_off_tutorials": "Turn off tutorials", + "minicraft.displays.pause": "Paused", + "minicraft.displays.pause.display.exit_popup.0": "Are you sure you want to exit the game?", + "minicraft.displays.pause.display.exit_popup.1": "All unsaved progress will be lost", + "minicraft.displays.pause.display.exit_popup.cancel": "Cancel", + "minicraft.displays.pause.display.exit_popup.quit": "Quit without saving", + "minicraft.displays.pause.display.help.choose": "%s: Choose", + "minicraft.displays.pause.display.help.scroll": "%s and %s to Scroll", + "minicraft.displays.pause.menu": "Main Menu", + "minicraft.displays.pause.return": "Return to Game", + "minicraft.displays.pause.save": "Save Game", + "minicraft.displays.player_death.display.score": "Score: %s", + "minicraft.displays.player_death.display.time": "Time: %s", + "minicraft.displays.player_death.quit": "Quit", + "minicraft.displays.player_death.respawn": "Respawn", + "minicraft.displays.player_death.save_quit": "Save and Quit", + "minicraft.displays.player_death.title": "You Died! Yikes!", + "minicraft.displays.player_inv.container_title.items": "Items", + "minicraft.displays.player_inv.display.help": "(%s) to search.", + "minicraft.displays.quests": "Quests", + "minicraft.displays.quests.display.header.completed": "Completed", + "minicraft.displays.quests.display.header.unlocked": "Unlocked", + "minicraft.displays.quests.display.no_quest_desc": "No quest", + "minicraft.displays.resource_packs.display.help.move": "Use %s and %s to move.", + "minicraft.displays.resource_packs.display.help.select": "%s to examine", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[ARROW KEYS] to move packs. ", + "minicraft.displays.resource_packs.display.title": "Resource Packs", + "minicraft.displays.skin": "Skins", + "minicraft.displays.skin.display.help.move": "Use %s and %s to move.", + "minicraft.displays.skin.display.help.select": "%s to select, and %s to cancel.", + "minicraft.displays.title.display.cannot_check": "Couldn't check for updates.", + "minicraft.displays.title.display.checking": "Checking for updates...", + "minicraft.displays.title.display.help.0": "(%s, %s to select)", + "minicraft.displays.title.display.help.1": "(%s to accept)", + "minicraft.displays.title.display.help.2": "(%s to return)", + "minicraft.displays.title.display.latest_already": "You have the latest version.", + "minicraft.displays.title.display.new_version": "New: %s", + "minicraft.displays.title.display.version": "Version %s", + "minicraft.displays.title.help": "Help", + "minicraft.displays.title.help.about": "About", + "minicraft.displays.title.help.credits": "Credits", + "minicraft.displays.title.help.instructions": "Instructions", + "minicraft.displays.title.help.storyline_guide": "Storyline", + "minicraft.displays.title.link_to_version": "Direct link to latest version: %s", + "minicraft.displays.title.play": "Play", + "minicraft.displays.title.play.load_world": "Load World", + "minicraft.displays.title.play.new_world": "New World", + "minicraft.displays.title.quit": "Quit", + "minicraft.displays.title.select_to_download": "--Select here to Download--", + "minicraft.displays.world_gen.create_world": "Create World", + "minicraft.displays.world_gen.enter_world": "Enter World Name", + "minicraft.displays.world_gen.title": "World Gen Options", + "minicraft.displays.world_gen.troublesome_input": "Trouble typing world name?", + "minicraft.displays.world_gen.troublesome_input.msg": "it seems you've set letters as the controls to move the cursor up and down, which is probably annoying. This can be changed in the key binding menu as the \"cursor-XXX\" keys. For now, to type the letter instead of using the cursor, hold the shift key while typing.", + "minicraft.displays.world_gen.world_seed": "World Seed", + "minicraft.displays.world_select.display.help.0": "%s to confirm", + "minicraft.displays.world_select.display.help.1": "%s to return", + "minicraft.displays.world_select.display.help.2": "SHIFT-C to copy", + "minicraft.displays.world_select.display.help.3": "SHIFT-R to rename", + "minicraft.displays.world_select.display.help.4": "SHIFT-D to delete", + "minicraft.displays.world_select.display.world_too_new": "Higher version, cannot load world!", + "minicraft.displays.world_select.display.world_version": "World Version: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s to cancel", + "minicraft.displays.world_select.popups.display.change": "New World Name:", + "minicraft.displays.world_select.popups.display.confirm": "%s to confirm", + "minicraft.displays.world_select.popups.display.delete": "Are you sure you want to delete\n%s\"%s\"%s?\nThis cannot be undone!", + "minicraft.displays.world_select.select_world": "Select World", + "minicraft.notification.achievement_unlocked": "Achivement unlocked: %s", + "minicraft.notification.air_wizard_defeated": "Air Wizard Defeated!", + "minicraft.notification.cannot_sleep": "Can't sleep! %sMin %s Sec left!", + "minicraft.notification.death_chest_retrieved": "Death chest retrieved!", + "minicraft.notification.defeat_air_wizard_first": "The Air Wizard must be defeated first.", + "minicraft.notification.dig_hole": "Dig a hole first!", + "minicraft.notification.dungeon_opened": "The Dungeon is now open!", + "minicraft.notification.gem_pickaxe_required": "Gem Pickaxe Required.", + "minicraft.notification.invalid_placement": "Can only be placed on %s!", + "minicraft.notification.quest_completed": "Quest Completed", + "minicraft.notification.quest_unlocked": "Quest unlocked", + "minicraft.notification.world_saved": "World Saved!", + "minicraft.notification.wrong_level_sky": "Can only be summoned on the sky level", + "minicraft.settings.fps": "Max FPS", + "minicraft.settings.difficulty": "Difficulty", + "minicraft.settings.difficulty.easy": "Easy", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.difficulty.hard": "Hard", + "minicraft.settings.mode": "Gamemode", + "minicraft.settings.mode.survival": "Survival", + "minicraft.settings.mode.creative": "Creative", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Score", + "minicraft.settings.scoretime": "Time (Score Mode)", + "minicraft.settings.screenshot_scale": "Screenshot Scale", + "minicraft.settings.sound": "Sound", + "minicraft.settings.autosave": "Autosave", + "minicraft.settings.size": "World Size", + "minicraft.settings.theme": "World Theme", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.forest": "Forest", + "minicraft.settings.theme.desert": "Desert", + "minicraft.settings.theme.plain": "Plain", + "minicraft.settings.theme.hell": "Hell", + "minicraft.settings.type": "Terrain Type", + "minicraft.settings.type.island": "Island", + "minicraft.settings.type.box": "Box", + "minicraft.settings.type.mountain": "Mountain", + "minicraft.settings.type.irregular": "Irregular", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul with Cape", + "minicraft.skin.minecraft_steve": "Familiar Boy", + "minicraft.skin.minecraft_alex": "Familiar Girl", + "minicraft.text_particales.key_consumed": "-1 Key", + "Death Chest": "Death Chest", + "Player": "Player", + "Leather Armor": "Leather Armor", + "Snake Armor": "Snake Armor", + "Iron Armor": "Iron Armor", + "Gold Armor": "Gold Armor", + "Gem Armor": "Gem Armor", + "Book": "Book", + "Antidious": "Antidious", + "Empty Bucket": "Empty Bucket", + "Water Bucket": "Water Bucket", + "Lava Bucket": "Lava Bucket", + "Red Clothes": "Red Clothes", + "Blue Clothes": "Blue Clothes", + "Green Clothes": "Green Clothes", + "Yellow Clothes": "Yellow Clothes", + "Black Clothes": "Black Clothes", + "Orange Clothes": "Orange Clothes", + "Purple Clothes": "Purple Clothes", + "Cyan Clothes": "Cyan Clothes", + "Reg Clothes": "Reg Clothes", + "Bread": "Bread", + "Apple": "Apple", + "Raw Pork": "Raw Pork", + "Raw Fish": "Raw Fish", + "Raw Beef": "Raw Beef", + "Pork Chop": "Pork Chop", + "Cooked Fish": "Cooked Fish", + "Cooked Pork": "Cooked Pork", + "Steak": "Steak", + "Gold Apple": "Gold Apple", + "Baked Potato": "Baked Potato", + "Cow Spawner": "Cow Spawner", + "Pig Spawner": "Pig Spawner", + "Sheep Spawner": "Sheep Spawner", + "Slime Spawner": "Slime Spawner", + "Zombie Spawner": "Zombie Spawner", + "Creeper Spawner": "Creeper Spawner", + "Skeleton Spawner": "Skeleton Spawner", + "Snake Spawner": "Snake Spawner", + "Knight Spawner": "Knight Spawner", + "AirWizard Spawner": "AirWizard Spawner", + "Workbench": "Workbench", + "Oven": "Oven", + "Furnace": "Furnace", + "Anvil": "Anvil", + "Enchanter": "Enchanter", + "Loom": "Loom", + "Lantern": "Lantern", + "Iron Lantern": "Iron Lantern", + "Gold Lantern": "Gold Lantern", + "Tnt": "Tnt", + "Bed": "Bed", + "Chest": "Chest", + "None Potion": "None Potion", + "Speed Potion": "Speed Potion", + "Light Potion": "Light Potion", + "Swim Potion": "Swim Potion", + "Energy Potion": "Energy Potion", + "Regen Potion": "Regen Potion", + "Health Potion": "Health Potion", + "Time Potion": "Time Potion", + "Lava Potion": "Lava Potion", + "Shield Potion": "Shield Potion", + "Haste Potion": "Haste Potion", + "Escape Potion": "Escape Potion", + "Potion": "Potion", + "Power Glove": "Power Glove", + "Wood": "Wood", + "Stone": "Stone", + "Leather": "Leather", + "Wheat": "Wheat", + "Key": "Key", + "Coal": "Coal", + "Iron Ore": "Iron Ore", + "Gold Ore": "Gold Ore", + "Gem Ore": "Gem Ore", + "Cloud Ore": "Cloud Ore", + "Iron": "Iron", + "Gold": "Gold", + "Lapis": "Lapis", + "Rose": "Rose", + "GunPowder": "Gunpowder", + "Slime": "Slime", + "Scale": "Scale", + "Shard": "Shard", + "Flower": "Flower", + "Acorn": "Acorn", + "Dirt": "Dirt", + "Natural Rock": "Natural Rock", + "Plank": "Plank", + "Plank Wall": "Plank Wall", + "Wood Door": "Wood Door", + "Stone Brick": "Stone Brick", + "Ornate Stone": "Ornate Stone", + "Stone Wall": "Stone Wall", + "Stone Door": "Stone Door", + "Obsidian Brick": "Obsidian Brick", + "Ornate Obsidian": "Ornate Obsidian", + "Obsidian Wall": "Obsidian Wall", + "Obsidian Door": "Obsidian Door", + "Wool": "Wool", + "Red Wool": "Red Wool", + "Blue Wool": "Blue Wool", + "Green Wool": "Green Wool", + "Yellow Wool": "Yellow Wool", + "Black Wool": "Black Wool", + "Sand": "Sand", + "Cactus": "Cactus", + "Seeds": "Seeds", + "Wheat Seeds": "Wheat Seeds", + "Grass Seeds": "Grass Seeds", + "Bone": "Bone", + "Cloud": "Cloud", + "Rock": "Rock", + "Gem": "Gem", + "Potato": "Potato", + "Wood Fishing Rod": "Wood Fishing Rod", + "Iron Fishing Rod": "Iron Fishing Rod", + "Gold Fishing Rod": "Gold Fishing Rod", + "Gem Fishing Rod": "Gem Fishing Rod", + "Shovel": "Shovel", + "Hoe": "Hoe", + "Sword": "Sword", + "Pickaxe": "Pickaxe", + "Axe": "Axe", + "Bow": "Bow", + "Claymore": "Claymore", + "Shears": "Shears", + "Torch": "Torch", + "Wood Planks": "Wood Planks", + "Stone Bricks": "Stone Brisk", + "Obsidian": "Obsidian", + "Wood Wall": "Wood Wall", + "Grass": "Grass", + "Hole": "Hole", + "Stairs Up": "Stairs Up", + "Stairs Down": "Stairs Down", + "Water": "Water", + "Tree": "Tre", + "Tree Sapling": "Tree Sapling", + "Cactus Sapling": "Cactus Sapling", + "Lava": "Lava", + "Lava Brick": "Lava Brick", + "Explode": "Explode", + "Farmland": "Farmland", + "Hard Rock": "Hard Rock", + "Infinite Fall": "Infinite Fall", + "Cloud Cactus": "Cloud Cactus", + "Raw Obsidian": "Raw Obsidian", + "Totem of Air": "Totem of Air", + "minicraft.control_guide.attack": "Use %s to attack mobs or destroy tiles.", + "minicraft.control_guide.craft": "Use %s to open your crafting menu.", + "minicraft.control_guide.menu": "Use %s to open your inventory menu.", + "minicraft.control_guide.move": "Use %s to move.", + "minicraft.displays.controls": "Controls", + "minicraft.displays.controls.display.controller": "Controller", + "minicraft.displays.controls.display.controller.00": "Moving player uses DPAD", + "minicraft.displays.controls.display.controller.01": "Moving cursor uses DPAD", + "minicraft.displays.controls.display.controller.02": "Selecting entries uses A", + "minicraft.displays.controls.display.controller.03": "Exiting pages uses B", + "minicraft.displays.controls.display.controller.04": "Attacking entities, destroying and interacting tiles use A", + "minicraft.displays.controls.display.controller.05": "Opening menus in-game uses X", + "minicraft.displays.controls.display.controller.06": "Opening crafting menus uses Y", + "minicraft.displays.controls.display.controller.07": "Picking up furniture uses LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "Dropping 1 item uses RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Dropping whole stack of item uses RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "Toggling search bar in item menus uses START", + "minicraft.displays.controls.display.controller.11": "Pausing game uses START", + "minicraft.displays.controls.display.controller.12": "Use X to toggle on-screen keyboard on input", + "minicraft.displays.controls.display.controller.13": "Use B as shortcut for backspace on on-screen keyboard", + "minicraft.displays.controls.display.controller.14": "Use X to remove an selected item in inventory on creative mode", + "minicraft.displays.controls.display.controller.15": "Use Y to remove whole stack of item in inventory on creative mode", + "minicraft.displays.controls.display.controller.desc.0": "Debugging mappings are inaccessible", + "minicraft.displays.controls.display.controller.desc.1": "Detailed mappings are unusable", + "minicraft.displays.controls.display.help.0": "%s/%s to see another controls.", + "minicraft.displays.controls.display.keyboard": "Keyboard", + "minicraft.displays.controls.display.keyboard.00": "Moving player uses MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Moving cursor uses CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Selecting entries uses SELECT", + "minicraft.displays.controls.display.keyboard.03": "Exiting pags uses EXIT", + "minicraft.displays.controls.display.keyboard.04": "Quick saving uses QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Attacking entities, destroying and interacting tiles use ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Opening menus in-game uses MENU", + "minicraft.displays.controls.display.keyboard.07": "Opening crafting menus uses CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Picking up furniture uses PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Dropping 1 item uses DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Dropping whole stack of item uses DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Toggling search bar in item menus uses SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Browsing searched results uses PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Pausing game uses PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Toggling potion effect display uses POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Toggling simplified potion display uses SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Temperately expanding quest display in-game uses EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Toggling HUD uses TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Taking screenshot uses SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Showing in-game info uses INFO", + "minicraft.displays.controls.display.keyboard.20": "Toggling fullscreen uses FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Use D to remove an selected item in inventory on creative mode", + "minicraft.displays.controls.display.keyboard.22": "Use SHIFT-D to remove whole stack of item in inventory on creative mode", + "minicraft.displays.controls.display.keyboard.desc": "Debug mappings are not explained", + "minicraft.displays.loading.message.dungeon_regeneration": "Regenerating B4", + "minicraft.displays.loading.message.quests": "Quests", + "minicraft.displays.loading.regeneration_popup.display.0": "Old version dungeon (B4 floor) is detected.", + "minicraft.displays.loading.regeneration_popup.display.1": "Regeneration is needed.", + "minicraft.displays.loading.regeneration_popup.display.2": "Old data on that floor are going to be erased:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s to continue", + "minicraft.displays.loading.regeneration_popup.display.4": "%s to cancel world loading", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "World loading cancelled", + "minicraft.displays.quests.display.no_quest": "No quest unlocked", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Only keyboard input is accepted.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Press %s to examine the details of the current tutorial.", + "minicraft.notification.obsidian_knight_defeated": "Obsidian Knight: Defeated!", + "minicraft.notification.obsidian_knight_awoken": "The Obsidian Knight has awoken!", + "minicraft.notification.defeat_obsidian_knight_first": "The Obsidian Knight must be defeated first.", + "minicraft.notification.wrong_level_dungeon": "Can only be summoned on the dungeon level", + "minicraft.notification.boss_limit": "No more bosses can be spawned", + "minicraft.notification.spawn_on_boss_tile": "Can only be summoned in the Boss Room", + "minicraft.notifications.statue_tapped": "You hear echoed whispers...", + "minicraft.notifications.statue_touched": "You hear the statue vibrating...", + "minicraft.quest.farming": "Farming Farmer", + "minicraft.quest.farming.crafting_hoe": "Crafting a hoe", + "minicraft.quest.farming.crafting_hoe.description": "Crafting any hoe from the workbench", + "minicraft.quest.farming.description": "The basics as being a farmer.", + "minicraft.quest.farming.getting_wheat": "Harvesting a wheat", + "minicraft.quest.farming.getting_wheat.description": "Harvesting a wheat by breaking a grown wheat crop.", + "minicraft.quest.farming.making_farmland": "Making a farmland", + "minicraft.quest.farming.making_farmland.description": "Making a farmland with a hoe by interacting a dirt tile.", + "minicraft.quest.farming.planting_potato": "Planting a potato", + "minicraft.quest.farming.planting_potato.description": "Planting a potato by putting a potato on a farmland", + "minicraft.quest.farming.planting_wheat": "Planting a wheat", + "minicraft.quest.farming.planting_wheat.description": "Planting a wheat by putting a wheat seeds on a farmland.", + "minicraft.quest.gems": "Road of Gem", + "minicraft.quest.gems.description": "Getting gem equipments prepared.", + "minicraft.quest.gems.gem_armor": "Master of Protection", + "minicraft.quest.gems.gem_armor.description": "Getting a gem armor.", + "minicraft.quest.gems.gem_claymore": "Master of Weapon", + "minicraft.quest.gems.gem_claymore.description": "Getting a gem claymore.", + "minicraft.quest.iron_equipments": "Master Of Iron", + "minicraft.quest.iron_equipments.description": "Getting all of the iron equipments.", + "minicraft.quest.iron_equipments.getting_more_iron": "Rich of Iron", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Getting more of iron.", + "minicraft.quest.iron_equipments.iron_armor": "Upgrading armor", + "minicraft.quest.iron_equipments.iron_armor.description": "Upgrading your armor to iron.", + "minicraft.quest.iron_equipments.iron_tools": "Upgrading all tools", + "minicraft.quest.iron_equipments.iron_tools.description": "Upgrading your tools to iron.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Advanced pickaxe", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Upgrading your pickaxe.", + "minicraft.quest.potions": "Master of Potions", + "minicraft.quest.potions.all_potions_prepared": "Studier of Potions", + "minicraft.quest.potions.all_potions_prepared.description": "Getting all the potions at the same time.", + "minicraft.quest.potions.awkward_potions": "Awkward Potion", + "minicraft.quest.potions.awkward_potions.description": "Getting a awkward potion.", + "minicraft.quest.potions.description": "Getting the potions.", + "minicraft.quest.potions.powerful_potions": "Powerful Potions", + "minicraft.quest.potions.powerful_potions.description": "Getting the useful and powerful potions.", + "minicraft.tutorial.getting_rocks": "Getting stones and coals", + "minicraft.tutorial.getting_rocks.description": "Getting at least 5 stone and 5 coal items by destroying rocks with the pickaxe crafted.", + "minicraft.tutorial.getting_wood": "Getting more wood", + "minicraft.tutorial.getting_wood.description": "Getting at least 10 wood items from trees.", + "minicraft.tutorial.getting_wooden_pickaxe": "Getting a wooden pickaxe", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Crafting a wooden pickaxe in the crafting menu from the workbench.", + "minicraft.tutorial.getting_workbench": "Getting a workbench", + "minicraft.tutorial.getting_workbench.description": "Crafting a workbench in the crafting menu. Placing it after that.", + "minicraft.tutorial.start_getting_wood": "Beginning of All", + "minicraft.tutorial.start_getting_wood.description": "Continuously attacking trees to get wood.", + "minicraft.display.options_display.language": "Language", + "minicraft.display.options_display.resource_packs": "Resource packs", + "minicraft.displays.language_settings.title": "Language...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "", + "String": "", + "Glass": "", + "Cloth": "" +} diff --git a/src/client/resources/assets/localization/es-es.json b/src/client/resources/assets/localization/es-es.json index 4de4465cb..1ac4d46cb 100644 --- a/src/client/resources/assets/localization/es-es.json +++ b/src/client/resources/assets/localization/es-es.json @@ -1,36 +1,36 @@ { "minicraft.achievement.woodcutter": "Cortaleña", "minicraft.achievement.woodcutter.desc": "Obtén Madera.", - "minicraft.achievement.benchmarking": "Trabajo en la Mesa", + "minicraft.achievement.benchmarking": "¡A fabricar!", "minicraft.achievement.benchmarking.desc": "Haz una Mesa de trabajo.", - "minicraft.achievement.upgrade": "¡Mejorando!", + "minicraft.achievement.upgrade": "Edad de piedra", "minicraft.achievement.upgrade.desc": "Fabrica una herramienta de Piedra.", "minicraft.achievement.bow": "¡Tiro al blanco!", "minicraft.achievement.bow.desc": "Dispara una flecha con un arco.", - "minicraft.achievement.fish": "¡De Pesca!", - "minicraft.achievement.fish.desc": "¡Pesca un pez!", + "minicraft.achievement.fish": "Pesca marina", + "minicraft.achievement.fish.desc": "¡Pesca un pez con un estrobo!", "minicraft.achievement.doors": "Vistazo al Portazo", "minicraft.achievement.doors.desc": "Fabrica una puerta de madera.", "minicraft.achievement.planks": "¡Anda sobre las tablas!", "minicraft.achievement.planks.desc": "Fabrica tablas de madera.", "minicraft.achievement.clothes": "¡Ten un día colorido!", "minicraft.achievement.clothes.desc": "Fabrica ropa de algún color", - "minicraft.achievement.demolition": "Demostrando y Demoliendo", - "minicraft.achievement.demolition.desc": "Usa dinamita.", - "minicraft.achievement.survive_darkness": "¿Tienes Nictofobia?", + "minicraft.achievement.demolition": "¡La cosa está que explota!", + "minicraft.achievement.demolition.desc": "Explota una dinamita.", + "minicraft.achievement.survive_darkness": "¿Tienes nictofobia?", "minicraft.achievement.survive_darkness.desc": "Sobrevive 5 minutos en total oscuridad.", "minicraft.achievement.lava": "Asuntos ignífugos", "minicraft.achievement.lava.desc": "Usa una poción de lava para nadar en lava.", - "minicraft.achievement.find_gem": "¡Qué Brillante!", - "minicraft.achievement.find_gem.desc": "Encuentra una Mena de Gema y mínala.", - "minicraft.achievement.lowest_caves": "Lo oscuro tras la luz", - "minicraft.achievement.lowest_caves.desc": "Llega a las cuevas más bajas.", - "minicraft.achievement.obsidian_dungeon": "Los Nobles y el Hombre", - "minicraft.achievement.obsidian_dungeon.desc": "Llega a la mazmorra de obsidiana.", - "minicraft.achievement.airwizard": "Derrota... ¿al aire?", - "minicraft.achievement.airwizard.desc": "¡Derrota al primer Mago Aéreo!", - "minicraft.achievement.skin": "La Nueva Moda", - "minicraft.achievement.skin.desc": "Cambia de Aspecto.", + "minicraft.achievement.find_gem": "¡Qué brillante!", + "minicraft.achievement.find_gem.desc": "Encuentra una mena de gema y mínala.", + "minicraft.achievement.lowest_caves": "La oscuridad tras la luz", + "minicraft.achievement.lowest_caves.desc": "Llega al nivel de cuevas más bajo.", + "minicraft.achievement.obsidian_dungeon": "Los nobles y el hombre", + "minicraft.achievement.obsidian_dungeon.desc": "Entra a la mazmorra de obsidiana.", + "minicraft.achievement.airwizard": "Desvanecido cual aire", + "minicraft.achievement.airwizard.desc": "¡Derrota al primer Mago aéreo!", + "minicraft.achievement.skin": "La nueva moda", + "minicraft.achievement.skin.desc": "Cambia de aspecto.", "minicraft.display.entries.boolean.false": "No", "minicraft.display.entries.boolean.true": "Sí", "minicraft.display.gui.link_opening": "Abriendo en navegador...", @@ -463,9 +463,9 @@ "minicraft.display.options_display.language": "Idioma", "minicraft.display.options_display.resource_packs": "Lotes de recursos", "minicraft.displays.language_settings.title": "Idioma...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", + "minicraft.achievement.plant_seed": "¡Crece pequeña!", + "minicraft.achievement.plant_seed.desc": "Planta una semilla de cualquier tipo y espera a que crezca.", + "minicraft.notification.knight_statue_exists": "Ya existe una estatua", "Arrow": "Flecha", "String": "Cuerda", "Glass": "Cristal", diff --git a/src/client/resources/assets/localization/nl-nl.json b/src/client/resources/assets/localization/nl-nl.json new file mode 100644 index 000000000..11c9208a8 --- /dev/null +++ b/src/client/resources/assets/localization/nl-nl.json @@ -0,0 +1,473 @@ +{ + "minicraft.achievement.woodcutter": "Houthakker", + "minicraft.achievement.woodcutter.desc": "Krijg hout.", + "minicraft.achievement.benchmarking": "Benchmarking", + "minicraft.achievement.benchmarking.desc": "Maak een werkbank.", + "minicraft.achievement.upgrade": "Upgrade!", + "minicraft.achievement.upgrade.desc": "Maak een stenen werktuig.", + "minicraft.achievement.bow": "Buig voor mij!", + "minicraft.achievement.bow.desc": "Schiet een pijl met een boog.", + "minicraft.achievement.fish": "Ga Vissen!", + "minicraft.achievement.fish.desc": "Vis een Vis!", + "minicraft.achievement.doors": "Met de deur in huis vallen", + "minicraft.achievement.doors.desc": "Maak een houten deur.", + "minicraft.achievement.planks": "De Planken Lopen!", + "minicraft.achievement.planks.desc": "Maak houten planken.", + "minicraft.achievement.clothes": "Heb een kleurrijke dag!", + "minicraft.achievement.clothes.desc": "Maak kleren met een kleur", + "minicraft.achievement.demolition": "Ouwe slopert!", + "minicraft.achievement.demolition.desc": "Gebruik TNT.", + "minicraft.achievement.survive_darkness": "Bang van het Donker?", + "minicraft.achievement.survive_darkness.desc": "Overleef 5 minuten in totale duisternis.", + "minicraft.achievement.lava": "Hete Zaken", + "minicraft.achievement.lava.desc": "Gebruik een lava brouwsel om in lava te zwemmen.", + "minicraft.achievement.find_gem": "Oooh glimmend!", + "minicraft.achievement.find_gem.desc": "Zoek een Juweel Steen and hak het.", + "minicraft.achievement.lowest_caves": "Duisternis achter licht", + "minicraft.achievement.lowest_caves.desc": "Bereik de laagste grotten.", + "minicraft.achievement.obsidian_dungeon": "Van Ridders en Men", + "minicraft.achievement.obsidian_dungeon.desc": "Bereik de obsidiaan kerker.", + "minicraft.achievement.airwizard": "Versla... de lucht?", + "minicraft.achievement.airwizard.desc": "Versla de eerste Lucht Tovenaar!", + "minicraft.achievement.skin": "Mode Show", + "minicraft.achievement.skin.desc": "Verander jouw uiterlijk.", + "minicraft.display.entries.boolean.false": "Uit", + "minicraft.display.entries.boolean.true": "Aan", + "minicraft.display.gui.link_opening": "Aan het openen met web browser...", + "minicraft.display.gui.perm_status.saving": "Aan het opslaan... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Druk %s om te annuleren", + "minicraft.display.gui.perm_status.sleeping": "Aan het slapen...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s om te verbergen!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Huidige score: %s", + "minicraft.display.gui.score.time_left": "Tijd over %s%sm %ss", + "minicraft.display.menus.inventory": "Inventaris", + "minicraft.display.options_display": "Opties", + "minicraft.display.options_display.change_key_bindings": "Verander toets opties", + "minicraft.display.popup.enter_confirm": "Enter om te bevestigen", + "minicraft.display.popup.escape_cancel": "Escape om te annuleren", + "minicraft.display.popup.title_confirm": "Bevestig Actie", + "minicraft.displays.achievements": "Prestaties", + "minicraft.displays.achievements.display.achieved": "Behaald!", + "minicraft.displays.achievements.display.help": "Gebruik %s and %s om te bewegen.", + "minicraft.displays.achievements.display.not_achieved": "Nog niet behaald", + "minicraft.displays.achievements.display.score": "Prestatie Score: %s", + "minicraft.displays.book.default_book": "Dit boek heeft geen tekst.", + "minicraft.displays.crafting": "Maken", + "minicraft.displays.crafting.container_title.cost": "Kost:", + "minicraft.displays.crafting.container_title.have": "Heeft:", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Uiteneindelijke Score: %s", + "minicraft.displays.end_game.display.player_score": "Speler Score: %s", + "minicraft.displays.end_game.display.unlocked": "Ontgrendeld! %s Scorren tijd", + "minicraft.displays.end_game.exit": "Terug naar het Menu", + "minicraft.displays.info.display.exit_help": "%s/%s:Verlaten", + "minicraft.displays.info.display.score": "Huidige Score: %s", + "minicraft.displays.info.display.time": "Tijd gespeeld: %s", + "minicraft.displays.info.title": "Speler statisktieken", + "minicraft.displays.key_input.display.help.0": "Toets C/Enter om de toets binding the veranderen", + "minicraft.displays.key_input.display.help.1": "Toets A om een toets binding te maken", + "minicraft.displays.key_input.display.help.2": "Shift-D om alle toetsen to resetten", + "minicraft.displays.key_input.display.help.3": "%s om Terug te gaan naar het menu", + "minicraft.displays.key_input.popup_display.confirm_reset": "Ben je zeker dat je alle sneltoetsen wilt resetten naar de standaard toetsen?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Druk op de gewenste reeks toetsen", + "minicraft.displays.key_input.title": "Besturing", + "minicraft.displays.loading.message.entities": "Entiteiten", + "minicraft.displays.loading.message.generating": "Generen", + "minicraft.displays.loading.message.level": "Level %s", + "minicraft.displays.loading.message.levels": "Levels", + "minicraft.displays.loading.message.loading": "Laden", + "minicraft.displays.loading.message.saving": "Aan het Opslaan", + "minicraft.displays.loading.message.world": "Wereld", + "minicraft.displays.options_main_menu": "Hoofdmenu opties", + "minicraft.displays.options_main_menu.resource_packs": "resourcepakketten", + "minicraft.displays.options_world": "Wereld Opties", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Weet je zeker dat je de uitleg wilt uitzetten voor altijd?", + "minicraft.displays.options_world.turn_off_tutorials": "Uitleg uitzetten", + "minicraft.displays.pause": "gepauzeerd", + "minicraft.displays.pause.display.exit_popup.0": "Weet je zeker dat je uit het spel wilt gaan?", + "minicraft.displays.pause.display.exit_popup.1": "Alle niet opgeslagen progressie zal verloren gaan", + "minicraft.displays.pause.display.exit_popup.cancel": "Annuleer", + "minicraft.displays.pause.display.exit_popup.quit": "Stoppen zonder opteslaan", + "minicraft.displays.pause.display.help.choose": "%s: Kiezen", + "minicraft.displays.pause.display.help.scroll": "%s en %s om te Scrollen", + "minicraft.displays.pause.menu": "Hoofdmenu", + "minicraft.displays.pause.return": "Terug naar het spel", + "minicraft.displays.pause.save": "Spel opslaan", + "minicraft.displays.player_death.display.score": "Score: %s", + "minicraft.displays.player_death.display.time": "Tijd: %s", + "minicraft.displays.player_death.quit": "Stoppen", + "minicraft.displays.player_death.respawn": "Hereizen", + "minicraft.displays.player_death.save_quit": "Opslaan en stoppen", + "minicraft.displays.player_death.title": "Oh nee! je bent dood!", + "minicraft.displays.player_inv.container_title.items": "Spullen", + "minicraft.displays.player_inv.display.help": "(%s) om te zoeken.", + "minicraft.displays.quests": "Uitdagingen", + "minicraft.displays.quests.display.header.completed": "Voltooid", + "minicraft.displays.quests.display.header.unlocked": "Ontgrendeld", + "minicraft.displays.quests.display.no_quest_desc": "Geen uitdaging", + "minicraft.displays.resource_packs.display.help.move": "Gebruik %s en %s om te bewegen.", + "minicraft.displays.resource_packs.display.help.select": "%s om te onderzoeken.", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LINKS|RECHTS|OMHOOG|OMLAAG] om pakketten te bewegen.", + "minicraft.displays.resource_packs.display.title": "resourcepakketten", + "minicraft.displays.skin": "Skins", + "minicraft.displays.skin.display.help.move": "Gebruik %s en %s om te bewegen.", + "minicraft.displays.skin.display.help.select": "%s om te selecteren en %s om te annuleren.", + "minicraft.displays.title.display.cannot_check": "Kon niet checken voor updates.", + "minicraft.displays.title.display.checking": "Aan het kijken voor updates..", + "minicraft.displays.title.display.help.0": "(%s, %s om te selecteren)", + "minicraft.displays.title.display.help.1": "(%s om te accepteren)", + "minicraft.displays.title.display.help.2": "(%s om terug te keren)", + "minicraft.displays.title.display.latest_already": "Je hebt de nieuwste versie.", + "minicraft.displays.title.display.new_version": "Nieuwe: %s", + "minicraft.displays.title.display.version": "Versie %s", + "minicraft.displays.title.help": "Help", + "minicraft.displays.title.help.about": "Over", + "minicraft.displays.title.help.credits": "Credits", + "minicraft.displays.title.help.instructions": "Intructies", + "minicraft.displays.title.help.storyline_guide": "Verhaallijn Gids", + "minicraft.displays.title.link_to_version": "Directe link naar de nieuwste versie: %s", + "minicraft.displays.title.play": "Spelen", + "minicraft.displays.title.play.load_world": "Laad Wereld", + "minicraft.displays.title.play.new_world": "Nieuwe werled", + "minicraft.displays.title.quit": "Stoppen", + "minicraft.displays.title.select_to_download": "--Selecteer hier om te downloaden--", + "minicraft.displays.world_gen.create_world": "Maak Wereld", + "minicraft.displays.world_gen.enter_world": "Schrijf hier de wereld naam", + "minicraft.displays.world_gen.title": "Wereld Gen Opties", + "minicraft.displays.world_gen.troublesome_input": "Problemen met de wereld naam?", + "minicraft.displays.world_gen.troublesome_input.msg": "Het ziet er naar uit dat je letter toetsen hebt gebruikt om de muis omhoog en omlaag te bewegen, dat is waarschijnlijk irritant. Dit kan veranderd worden in de toetsen bindings menu. Dit staat er als \"cursor-XXX\" toetsen. Voor nu typ de letters inplaats de muis bewegen. Hou shift in gedrukt terwijl je typt.", + "minicraft.displays.world_gen.world_seed": "Wereld zaad", + "minicraft.displays.world_select.display.help.0": "%s om te bevestigen", + "minicraft.displays.world_select.display.help.1": "%s om terug te keren", + "minicraft.displays.world_select.display.help.2": "SHIFT-C om te kopiëren", + "minicraft.displays.world_select.display.help.3": "SHIFT-R om te hernoemen", + "minicraft.displays.world_select.display.help.4": "SHIFT-D om te verwijderen", + "minicraft.displays.world_select.display.world_too_new": "Hogere versie, kan de wereld niet laden!", + "minicraft.displays.world_select.display.world_version": "Wereld Versie: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s om te annuleren", + "minicraft.displays.world_select.popups.display.change": "Nieuwe Wereld Naam:", + "minicraft.displays.world_select.popups.display.confirm": "%s om te bevestigen", + "minicraft.displays.world_select.popups.display.delete": "Ben je zeker dat je\n%s\"%s\"%s wilt verwijderen?\nDit kan niet ongedaan worden!", + "minicraft.displays.world_select.select_world": "Selecteer Wereld", + "minicraft.notification.achievement_unlocked": "Prestatie ontgrendeld: %s", + "minicraft.notification.air_wizard_defeated": "Lucht Tovenaar Verslagen!", + "minicraft.notification.cannot_sleep": "Kan niet slapen! %sMin %s Sec over!", + "minicraft.notification.death_chest_retrieved": "Doodskist verkregen!", + "minicraft.notification.defeat_air_wizard_first": "De lucht tovenaar moet eerst verslagen worden.", + "minicraft.notification.dig_hole": "Graaf eerst een put!", + "minicraft.notification.dungeon_opened": "De Kerker is nu open!", + "minicraft.notification.gem_pickaxe_required": "Edelsteen Pikhouweel Vereist.", + "minicraft.notification.invalid_placement": "Kan alleen op %s geplaatst worden!", + "minicraft.notification.quest_completed": "Uitdaging voltooid", + "minicraft.notification.quest_unlocked": "Uitdaging ontgrendeld", + "minicraft.notification.world_saved": "Wereld Opgeslagen!", + "minicraft.notification.wrong_level_sky": "Kan alleen op lucht level opgeroepen worden", + "minicraft.settings.fps": "Max FPS", + "minicraft.settings.difficulty": "Moeilijkheid", + "minicraft.settings.difficulty.easy": "Makkelijk", + "minicraft.settings.difficulty.normal": "Normaal", + "minicraft.settings.difficulty.hard": "Moeilijk", + "minicraft.settings.mode": "Spel Modus", + "minicraft.settings.mode.survival": "Survival", + "minicraft.settings.mode.creative": "Creatief", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Score", + "minicraft.settings.scoretime": "Tijd (Score Modus)", + "minicraft.settings.screenshot_scale": "Schermafbeelding Grootte", + "minicraft.settings.sound": "Geluid", + "minicraft.settings.autosave": "Automatisch opslaan", + "minicraft.settings.size": "Wereld Grootte", + "minicraft.settings.theme": "Wereld Thema", + "minicraft.settings.theme.normal": "Normaal", + "minicraft.settings.theme.forest": "Bos", + "minicraft.settings.theme.desert": "Woestijn", + "minicraft.settings.theme.plain": "Vlakte", + "minicraft.settings.theme.hell": "Hel", + "minicraft.settings.type": "Type Terrein", + "minicraft.settings.type.island": "Eiland", + "minicraft.settings.type.box": "Doos", + "minicraft.settings.type.mountain": "Berg", + "minicraft.settings.type.irregular": "Onregelmatig", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul met cape", + "minicraft.skin.minecraft_steve": "Bekende jongen", + "minicraft.skin.minecraft_alex": "Bekend meisje", + "minicraft.text_particales.key_consumed": "-1 sleutel", + "Death Chest": "Doodskist", + "Player": "Speler", + "Leather Armor": "Leren Uitrusting", + "Snake Armor": "Slangen Uitrusting", + "Iron Armor": "Ijzeren Uitrusting", + "Gold Armor": "Gouden Uitrusting", + "Gem Armor": "Edelsteen Uitrusting", + "Book": "Boek", + "Antidious": "Tegendraads", + "Empty Bucket": "Lege Emmer", + "Water Bucket": "Emmer met Water", + "Lava Bucket": "Emmer met Lava", + "Red Clothes": "Rode Kleren", + "Blue Clothes": "Blauwe Kleren", + "Green Clothes": "Groene Kleren", + "Yellow Clothes": "Gele Kleren", + "Black Clothes": "Zwarte Kleren", + "Orange Clothes": "Oranje Kleren", + "Purple Clothes": "Paarse Kleren", + "Cyan Clothes": "Cyaan Kleren", + "Reg Clothes": "Reg Kleren", + "Bread": "Brood", + "Apple": "Appel", + "Raw Pork": "Rauw Varkensvlees", + "Raw Fish": "Rauwe Vis", + "Raw Beef": "Rauw Biefstuk", + "Pork Chop": "Varkensvlees", + "Cooked Fish": "Gekookte Vis", + "Cooked Pork": "Gebraden Varkensvlees", + "Steak": "Biefstuk", + "Gold Apple": "Gouden Appel", + "Baked Potato": "Gebakken Aardappel", + "Cow Spawner": "Koe Spawner", + "Pig Spawner": "Varken Spawner", + "Sheep Spawner": "Schaap Spawner", + "Slime Spawner": "Slijm Spawner", + "Zombie Spawner": "Zombie Spawner", + "Creeper Spawner": "Creeper Spawner", + "Skeleton Spawner": "Skelet Spawner", + "Snake Spawner": "Slang Spawner", + "Knight Spawner": "Ridder Spawner", + "AirWizard Spawner": "Lucht Tovenaar Spawner", + "Workbench": "Werkbank", + "Oven": "Oven", + "Furnace": "Smeltoven", + "Anvil": "Aambeeld", + "Enchanter": "Betoveraar", + "Loom": "Weefgetouw", + "Lantern": "Lantaarn", + "Iron Lantern": "Ijzeren Lantaarn", + "Gold Lantern": "Gouden Lantaarn", + "Tnt": "Tnt", + "Bed": "Bed", + "Chest": "Kist", + "None Potion": "Geen Drank", + "Speed Potion": "Snelheids Drank", + "Light Potion": "Licht Drank", + "Swim Potion": "Zwem Drank", + "Energy Potion": "Energie Drank", + "Regen Potion": "Regeneratie Drank", + "Health Potion": "Genezings Drank", + "Time Potion": "Tijd Drank", + "Lava Potion": "Lava Drank", + "Shield Potion": "Schild Drank", + "Haste Potion": "Haast Drank", + "Escape Potion": "Onstappings Drank", + "Potion": "Drank", + "Power Glove": "Power Handschoen", + "Wood": "Hout", + "Stone": "Steen", + "Leather": "Leer", + "Wheat": "Tarwe", + "Key": "Sleutel", + "Coal": "Steenkool", + "Iron Ore": "Ijzererts", + "Gold Ore": "Gouderts", + "Gem Ore": "Edelsteen Erts", + "Cloud Ore": "Wolk Erts", + "Iron": "Ijzer", + "Gold": "Goud", + "Lapis": "Lapis", + "Rose": "Roos", + "GunPowder": "Buskruit", + "Slime": "Slijm", + "Scale": "Grootte", + "Shard": "Scherf", + "Flower": "Bloem", + "Acorn": "Eikel", + "Dirt": "Aarde", + "Natural Rock": "Natuurlijke Steen", + "Plank": "Plank", + "Plank Wall": "Planken Muur", + "Wood Door": "Houten Deur", + "Stone Brick": "Stenen Baksteen", + "Ornate Stone": "Sierlijk Steen", + "Stone Wall": "Stenen Muur", + "Stone Door": "Stenen Deur", + "Obsidian Brick": "Obsidaan Baksteen", + "Ornate Obsidian": "Sierlijk Obsidiaan", + "Obsidian Wall": "Obsidiaan Muur", + "Obsidian Door": "Obsidiaan Muur", + "Wool": "Wol", + "Red Wool": "Rood Wol", + "Blue Wool": "Blauw Wol", + "Green Wool": "Groen Wol", + "Yellow Wool": "Geel Wol", + "Black Wool": "Zwart Wol", + "Sand": "Zand", + "Cactus": "Cactus", + "Seeds": "Zaden", + "Wheat Seeds": "Tarwe Zaden", + "Grass Seeds": "Gras Zaden", + "Bone": "Bot", + "Cloud": "Wolk", + "Rock": "Rots", + "Gem": "Edelsteen", + "Potato": "Aardappel", + "Wood Fishing Rod": "Houten Vishengel", + "Iron Fishing Rod": "Ijzeren Vishengel", + "Gold Fishing Rod": "Gouden Vishengel", + "Gem Fishing Rod": "Edelsteen Vishengel", + "Shovel": "Schep", + "Hoe": "Schoffel", + "Sword": "Zwaard", + "Pickaxe": "Pikhouweel", + "Axe": "Bijl", + "Bow": "Boog", + "Claymore": "Claymore", + "Shears": "Schaar", + "Torch": "Toorts", + "Wood Planks": "Houten Planken", + "Stone Bricks": "Stenen Bakstenen", + "Obsidian": "Obsidiaan", + "Wood Wall": "Houten Muur", + "Grass": "Gras", + "Hole": "Put", + "Stairs Up": "Trappen Omhoog", + "Stairs Down": "Trappen Omloog", + "Water": "Water", + "Tree": "Boom", + "Tree Sapling": "Boom Kiemplant", + "Cactus Sapling": "Cactus Kiemplant", + "Lava": "Lava", + "Lava Brick": "Lava Baksteen", + "Explode": "Explodeer", + "Farmland": "Akkerland", + "Hard Rock": "Hard Steen", + "Infinite Fall": "Oneindige Val", + "Cloud Cactus": "Wolk Cactus", + "Raw Obsidian": "Rauw Obsidiaan", + "Totem of Air": "Totem van de Lucht", + "minicraft.control_guide.attack": "Gebruik %s om monsters aan te vallen of om tegels te verwoesten.", + "minicraft.control_guide.craft": "Gebruik %s om je werk menu te openen.", + "minicraft.control_guide.menu": "Gebruik %s om je inventaris te openen.", + "minicraft.control_guide.move": "Gebruik %s om te bewegen.", + "minicraft.displays.controls": "Besturing", + "minicraft.displays.controls.display.controller": "Controller", + "minicraft.displays.controls.display.controller.00": "Speler bewegen gebruikt DPAD", + "minicraft.displays.controls.display.controller.01": "Cursor bewegen gebruikt DPAD", + "minicraft.displays.controls.display.controller.02": "Items selecteren gebruikt A", + "minicraft.displays.controls.display.controller.03": "Pagina's verlaten gebruikt B", + "minicraft.displays.controls.display.controller.04": "Aanvallen, tegels kapot maken en gebruiken via A", + "minicraft.displays.controls.display.controller.05": "Menu in-spel openen via X", + "minicraft.displays.controls.display.controller.06": "Maak menu openen via Y", + "minicraft.displays.controls.display.controller.07": "Meubels oppakken via LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "1 item laten vallen via RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Een hele stack van items laten vallen via RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "", + "minicraft.displays.controls.display.controller.11": "Het spel pauzeren via START", + "minicraft.displays.controls.display.controller.12": "", + "minicraft.displays.controls.display.controller.13": "", + "minicraft.displays.controls.display.controller.14": "", + "minicraft.displays.controls.display.controller.15": "", + "minicraft.displays.controls.display.controller.desc.0": "", + "minicraft.displays.controls.display.controller.desc.1": "", + "minicraft.displays.controls.display.help.0": "", + "minicraft.displays.controls.display.keyboard": "", + "minicraft.displays.controls.display.keyboard.00": "", + "minicraft.displays.controls.display.keyboard.01": "", + "minicraft.displays.controls.display.keyboard.02": "", + "minicraft.displays.controls.display.keyboard.03": "", + "minicraft.displays.controls.display.keyboard.04": "", + "minicraft.displays.controls.display.keyboard.05": "", + "minicraft.displays.controls.display.keyboard.06": "", + "minicraft.displays.controls.display.keyboard.07": "", + "minicraft.displays.controls.display.keyboard.08": "", + "minicraft.displays.controls.display.keyboard.09": "", + "minicraft.displays.controls.display.keyboard.10": "", + "minicraft.displays.controls.display.keyboard.11": "", + "minicraft.displays.controls.display.keyboard.12": "", + "minicraft.displays.controls.display.keyboard.13": "", + "minicraft.displays.controls.display.keyboard.14": "", + "minicraft.displays.controls.display.keyboard.15": "", + "minicraft.displays.controls.display.keyboard.16": "", + "minicraft.displays.controls.display.keyboard.17": "", + "minicraft.displays.controls.display.keyboard.18": "", + "minicraft.displays.controls.display.keyboard.19": "", + "minicraft.displays.controls.display.keyboard.20": "", + "minicraft.displays.controls.display.keyboard.21": "", + "minicraft.displays.controls.display.keyboard.22": "", + "minicraft.displays.controls.display.keyboard.desc": "", + "minicraft.displays.loading.message.dungeon_regeneration": "", + "minicraft.displays.loading.message.quests": "", + "minicraft.displays.loading.regeneration_popup.display.0": "", + "minicraft.displays.loading.regeneration_popup.display.1": "", + "minicraft.displays.loading.regeneration_popup.display.2": "", + "minicraft.displays.loading.regeneration_popup.display.3": "", + "minicraft.displays.loading.regeneration_popup.display.4": "", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "", + "minicraft.displays.quests.display.no_quest": "", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", + "minicraft.notification.obsidian_knight_defeated": "", + "minicraft.notification.obsidian_knight_awoken": "", + "minicraft.notification.defeat_obsidian_knight_first": "", + "minicraft.notification.wrong_level_dungeon": "", + "minicraft.notification.boss_limit": "", + "minicraft.notification.spawn_on_boss_tile": "", + "minicraft.notifications.statue_tapped": "", + "minicraft.notifications.statue_touched": "", + "minicraft.quest.farming": "", + "minicraft.quest.farming.crafting_hoe": "", + "minicraft.quest.farming.crafting_hoe.description": "", + "minicraft.quest.farming.description": "", + "minicraft.quest.farming.getting_wheat": "", + "minicraft.quest.farming.getting_wheat.description": "", + "minicraft.quest.farming.making_farmland": "", + "minicraft.quest.farming.making_farmland.description": "", + "minicraft.quest.farming.planting_potato": "", + "minicraft.quest.farming.planting_potato.description": "", + "minicraft.quest.farming.planting_wheat": "", + "minicraft.quest.farming.planting_wheat.description": "", + "minicraft.quest.gems": "", + "minicraft.quest.gems.description": "", + "minicraft.quest.gems.gem_armor": "", + "minicraft.quest.gems.gem_armor.description": "", + "minicraft.quest.gems.gem_claymore": "", + "minicraft.quest.gems.gem_claymore.description": "", + "minicraft.quest.iron_equipments": "", + "minicraft.quest.iron_equipments.description": "", + "minicraft.quest.iron_equipments.getting_more_iron": "", + "minicraft.quest.iron_equipments.getting_more_iron.description": "", + "minicraft.quest.iron_equipments.iron_armor": "", + "minicraft.quest.iron_equipments.iron_armor.description": "", + "minicraft.quest.iron_equipments.iron_tools": "", + "minicraft.quest.iron_equipments.iron_tools.description": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", + "minicraft.quest.potions": "", + "minicraft.quest.potions.all_potions_prepared": "", + "minicraft.quest.potions.all_potions_prepared.description": "", + "minicraft.quest.potions.awkward_potions": "", + "minicraft.quest.potions.awkward_potions.description": "", + "minicraft.quest.potions.description": "", + "minicraft.quest.potions.powerful_potions": "", + "minicraft.quest.potions.powerful_potions.description": "", + "minicraft.tutorial.getting_rocks": "", + "minicraft.tutorial.getting_rocks.description": "", + "minicraft.tutorial.getting_wood": "", + "minicraft.tutorial.getting_wood.description": "", + "minicraft.tutorial.getting_wooden_pickaxe": "", + "minicraft.tutorial.getting_wooden_pickaxe.description": "", + "minicraft.tutorial.getting_workbench": "", + "minicraft.tutorial.getting_workbench.description": "", + "minicraft.tutorial.start_getting_wood": "", + "minicraft.tutorial.start_getting_wood.description": "", + "minicraft.display.options_display.language": "", + "minicraft.display.options_display.resource_packs": "", + "minicraft.displays.language_settings.title": "", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "", + "String": "", + "Glass": "", + "Cloth": "" +} diff --git a/src/client/resources/assets/localization/pl-pl.json b/src/client/resources/assets/localization/pl-pl.json new file mode 100644 index 000000000..9c6b55ab5 --- /dev/null +++ b/src/client/resources/assets/localization/pl-pl.json @@ -0,0 +1,473 @@ +{ + "minicraft.achievement.woodcutter": "Drwal", + "minicraft.achievement.woodcutter.desc": "Zdobądź drewno.", + "minicraft.achievement.benchmarking": "", + "minicraft.achievement.benchmarking.desc": "Stwórz warsztat.", + "minicraft.achievement.upgrade": "Ulepszenie!", + "minicraft.achievement.upgrade.desc": "Stwórz dowolne kamienne narzędzie.", + "minicraft.achievement.bow": "Uklęknij przede mną!", + "minicraft.achievement.bow.desc": "Wystrzel strzałę z łuku.", + "minicraft.achievement.fish": "Idź na ryby!", + "minicraft.achievement.fish.desc": "Wyłów rybę!", + "minicraft.achievement.doors": "", + "minicraft.achievement.doors.desc": "Stwórz drewniane drzwi.", + "minicraft.achievement.planks": "", + "minicraft.achievement.planks.desc": "Stwórz deski.", + "minicraft.achievement.clothes": "", + "minicraft.achievement.clothes.desc": "Stwórz ubranie dowolnego koloru", + "minicraft.achievement.demolition": "", + "minicraft.achievement.demolition.desc": "Użyj TNT.", + "minicraft.achievement.survive_darkness": "Boisz się ciemności?", + "minicraft.achievement.survive_darkness.desc": "Przetrwaj 5 minut w zupełnej ciemności.", + "minicraft.achievement.lava": "", + "minicraft.achievement.lava.desc": "", + "minicraft.achievement.find_gem": "Oooo, świeci się!", + "minicraft.achievement.find_gem.desc": "", + "minicraft.achievement.lowest_caves": "", + "minicraft.achievement.lowest_caves.desc": "Dojdź do najniższych jaskiń.", + "minicraft.achievement.obsidian_dungeon": "", + "minicraft.achievement.obsidian_dungeon.desc": "Dostań się do lochu z obsydianu.", + "minicraft.achievement.airwizard": "Pokonaj... powietrze?", + "minicraft.achievement.airwizard.desc": "Pokonaj pierwszego Air Wizarda!", + "minicraft.achievement.skin": "Pokaz mody", + "minicraft.achievement.skin.desc": "Zmień swoją skórkę.", + "minicraft.display.entries.boolean.false": "Wył.", + "minicraft.display.entries.boolean.true": "Wł.", + "minicraft.display.gui.link_opening": "", + "minicraft.display.gui.perm_status.saving": "Zapisywanie... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Naciśnij %s aby anulować", + "minicraft.display.gui.perm_status.sleeping": "Spanie...", + "minicraft.display.gui.potion_effects.hide_hint": "", + "minicraft.display.gui.potion_effects.potion_dur": "", + "minicraft.display.gui.score.current_score": "Bieżący wynik: %s", + "minicraft.display.gui.score.time_left": "Pozostało %s%sm %ss", + "minicraft.display.menus.inventory": "Ekwipunek", + "minicraft.display.options_display": "Opcje", + "minicraft.display.options_display.change_key_bindings": "Zmień przypisanie klawiszy", + "minicraft.display.popup.enter_confirm": "", + "minicraft.display.popup.escape_cancel": "", + "minicraft.display.popup.title_confirm": "Potwierdź akcję", + "minicraft.displays.achievements": "Osiągnięcia", + "minicraft.displays.achievements.display.achieved": "Osiągnięto!", + "minicraft.displays.achievements.display.help": "", + "minicraft.displays.achievements.display.not_achieved": "Nie osiągnięto", + "minicraft.displays.achievements.display.score": "", + "minicraft.displays.book.default_book": "", + "minicraft.displays.crafting": "", + "minicraft.displays.crafting.container_title.cost": "Koszt:", + "minicraft.displays.crafting.container_title.have": "", + "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.end_game.display.final_score": "Wynik ostateczny: %s", + "minicraft.displays.end_game.display.player_score": "Wynik gracza: %s", + "minicraft.displays.end_game.display.unlocked": "", + "minicraft.displays.end_game.exit": "Wyjdź do Menu", + "minicraft.displays.info.display.exit_help": "", + "minicraft.displays.info.display.score": "Bieżący wynik: %s", + "minicraft.displays.info.display.time": "", + "minicraft.displays.info.title": "Statystyki gracza", + "minicraft.displays.key_input.display.help.0": "Naciśnij C/Enter aby zmienić", + "minicraft.displays.key_input.display.help.1": "Naciśnij A aby dodać", + "minicraft.displays.key_input.display.help.2": "", + "minicraft.displays.key_input.display.help.3": "", + "minicraft.displays.key_input.popup_display.confirm_reset": "Czy jesteś pewien że chcesz zresetować wszystkie przypisania klawiszy do ustawień domyślnych?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "", + "minicraft.displays.key_input.title": "Sterowanie", + "minicraft.displays.loading.message.entities": "", + "minicraft.displays.loading.message.generating": "", + "minicraft.displays.loading.message.level": "", + "minicraft.displays.loading.message.levels": "", + "minicraft.displays.loading.message.loading": "", + "minicraft.displays.loading.message.saving": "", + "minicraft.displays.loading.message.world": "", + "minicraft.displays.options_main_menu": "Opcje menu głównego", + "minicraft.displays.options_main_menu.resource_packs": "Paczki z zasobami", + "minicraft.displays.options_world": "Opcje świata", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Czy jesteś pewien że chcesz trawle wyłączyć samouczki?", + "minicraft.displays.options_world.turn_off_tutorials": "Wyłącz samouczki", + "minicraft.displays.pause": "", + "minicraft.displays.pause.display.exit_popup.0": "", + "minicraft.displays.pause.display.exit_popup.1": "", + "minicraft.displays.pause.display.exit_popup.cancel": "", + "minicraft.displays.pause.display.exit_popup.quit": "", + "minicraft.displays.pause.display.help.choose": "", + "minicraft.displays.pause.display.help.scroll": "", + "minicraft.displays.pause.menu": "", + "minicraft.displays.pause.return": "", + "minicraft.displays.pause.save": "", + "minicraft.displays.player_death.display.score": "", + "minicraft.displays.player_death.display.time": "", + "minicraft.displays.player_death.quit": "", + "minicraft.displays.player_death.respawn": "", + "minicraft.displays.player_death.save_quit": "", + "minicraft.displays.player_death.title": "", + "minicraft.displays.player_inv.container_title.items": "", + "minicraft.displays.player_inv.display.help": "", + "minicraft.displays.quests": "", + "minicraft.displays.quests.display.header.completed": "", + "minicraft.displays.quests.display.header.unlocked": "", + "minicraft.displays.quests.display.no_quest_desc": "", + "minicraft.displays.resource_packs.display.help.move": "", + "minicraft.displays.resource_packs.display.help.select": "", + "minicraft.displays.resource_packs.display.help.position": "", + "minicraft.displays.resource_packs.display.title": "Paczki z zasobami", + "minicraft.displays.skin": "Skórki", + "minicraft.displays.skin.display.help.move": "", + "minicraft.displays.skin.display.help.select": "", + "minicraft.displays.title.display.cannot_check": "", + "minicraft.displays.title.display.checking": "Sprawdzanie aktualizacji...", + "minicraft.displays.title.display.help.0": "", + "minicraft.displays.title.display.help.1": "", + "minicraft.displays.title.display.help.2": "", + "minicraft.displays.title.display.latest_already": "Posiadasz już najnowszą wersję.", + "minicraft.displays.title.display.new_version": "Nowa wersja: %s", + "minicraft.displays.title.display.version": "Wersja %s", + "minicraft.displays.title.help": "Pomoc", + "minicraft.displays.title.help.about": "O grze", + "minicraft.displays.title.help.credits": "Autorzy", + "minicraft.displays.title.help.instructions": "Instrukcja", + "minicraft.displays.title.help.storyline_guide": "Przewodnik fabularny", + "minicraft.displays.title.link_to_version": "Bezpośredni link do najnowszej wersji: %s", + "minicraft.displays.title.play": "Graj", + "minicraft.displays.title.play.load_world": "Załaduj świat", + "minicraft.displays.title.play.new_world": "Nowy świat", + "minicraft.displays.title.quit": "Wyjdź", + "minicraft.displays.title.select_to_download": "", + "minicraft.displays.world_gen.create_world": "", + "minicraft.displays.world_gen.enter_world": "", + "minicraft.displays.world_gen.title": "Opcje generatora świata", + "minicraft.displays.world_gen.troublesome_input": "", + "minicraft.displays.world_gen.troublesome_input.msg": "", + "minicraft.displays.world_gen.world_seed": "", + "minicraft.displays.world_select.display.help.0": "", + "minicraft.displays.world_select.display.help.1": "", + "minicraft.displays.world_select.display.help.2": "", + "minicraft.displays.world_select.display.help.3": "", + "minicraft.displays.world_select.display.help.4": "", + "minicraft.displays.world_select.display.world_too_new": "Zbyt nowa wersja, nie można załadować!", + "minicraft.displays.world_select.display.world_version": "Wersja Świata: %s", + "minicraft.displays.world_select.popups.display.cancel": "", + "minicraft.displays.world_select.popups.display.change": "", + "minicraft.displays.world_select.popups.display.confirm": "", + "minicraft.displays.world_select.popups.display.delete": "", + "minicraft.displays.world_select.select_world": "", + "minicraft.notification.achievement_unlocked": "", + "minicraft.notification.air_wizard_defeated": "", + "minicraft.notification.cannot_sleep": "", + "minicraft.notification.death_chest_retrieved": "", + "minicraft.notification.defeat_air_wizard_first": "", + "minicraft.notification.dig_hole": "", + "minicraft.notification.dungeon_opened": "", + "minicraft.notification.gem_pickaxe_required": "", + "minicraft.notification.invalid_placement": "", + "minicraft.notification.quest_completed": "", + "minicraft.notification.quest_unlocked": "", + "minicraft.notification.world_saved": "", + "minicraft.notification.wrong_level_sky": "", + "minicraft.settings.fps": "Maksymalne FPS", + "minicraft.settings.difficulty": "", + "minicraft.settings.difficulty.easy": "", + "minicraft.settings.difficulty.normal": "", + "minicraft.settings.difficulty.hard": "", + "minicraft.settings.mode": "", + "minicraft.settings.mode.survival": "", + "minicraft.settings.mode.creative": "", + "minicraft.settings.mode.hardcore": "", + "minicraft.settings.mode.score": "", + "minicraft.settings.scoretime": "", + "minicraft.settings.screenshot_scale": "Skala zrzutów ekranu", + "minicraft.settings.sound": "Dźwięk", + "minicraft.settings.autosave": "", + "minicraft.settings.size": "", + "minicraft.settings.theme": "", + "minicraft.settings.theme.normal": "", + "minicraft.settings.theme.forest": "", + "minicraft.settings.theme.desert": "", + "minicraft.settings.theme.plain": "", + "minicraft.settings.theme.hell": "", + "minicraft.settings.type": "", + "minicraft.settings.type.island": "", + "minicraft.settings.type.box": "", + "minicraft.settings.type.mountain": "", + "minicraft.settings.type.irregular": "", + "minicraft.skin.paul": "Paweł", + "minicraft.skin.paul_cape": "Paweł z peleryną", + "minicraft.skin.minecraft_steve": "Znajomy chłopak", + "minicraft.skin.minecraft_alex": "Znajoma dziewczyna", + "minicraft.text_particales.key_consumed": "", + "Death Chest": "Skrzynia śmierci", + "Player": "", + "Leather Armor": "Skórzana zbroja", + "Snake Armor": "", + "Iron Armor": "Żelazna zbroja", + "Gold Armor": "Złota zbroja", + "Gem Armor": "", + "Book": "Książka", + "Antidious": "", + "Empty Bucket": "Puste wiaderko", + "Water Bucket": "", + "Lava Bucket": "Wiaderko z lawą", + "Red Clothes": "", + "Blue Clothes": "Niebieskie ubranie", + "Green Clothes": "Zielone ubranie", + "Yellow Clothes": "", + "Black Clothes": "Czarne ubranie", + "Orange Clothes": "", + "Purple Clothes": "", + "Cyan Clothes": "Turkusowe ubranie", + "Reg Clothes": "", + "Bread": "Chleb", + "Apple": "Jabłko", + "Raw Pork": "", + "Raw Fish": "", + "Raw Beef": "", + "Pork Chop": "", + "Cooked Fish": "Przyrządzona ryba", + "Cooked Pork": "Przyrządzona wołowina", + "Steak": "", + "Gold Apple": "Złote jabłko", + "Baked Potato": "Pieczony ziemniak", + "Cow Spawner": "Spawner krów", + "Pig Spawner": "", + "Sheep Spawner": "", + "Slime Spawner": "", + "Zombie Spawner": "", + "Creeper Spawner": "Spawner creeperów", + "Skeleton Spawner": "", + "Snake Spawner": "", + "Knight Spawner": "Spawner rycerzy", + "AirWizard Spawner": "Spawner AirWizarda", + "Workbench": "", + "Oven": "", + "Furnace": "Piec", + "Anvil": "Kowadło", + "Enchanter": "", + "Loom": "", + "Lantern": "Lampion", + "Iron Lantern": "Żelazny lampion", + "Gold Lantern": "Złoty lampion", + "Tnt": "", + "Bed": "Łóżko", + "Chest": "Skrzynia", + "None Potion": "", + "Speed Potion": "", + "Light Potion": "", + "Swim Potion": "", + "Energy Potion": "Mikstura energii", + "Regen Potion": "", + "Health Potion": "Mikstura zdrowia", + "Time Potion": "", + "Lava Potion": "Mikstura pływania w lawie", + "Shield Potion": "", + "Haste Potion": "Mikstura pośpiechu", + "Escape Potion": "Mikstura ucieczki", + "Potion": "", + "Power Glove": "", + "Wood": "", + "Stone": "", + "Leather": "Skóra", + "Wheat": "", + "Key": "Klucz", + "Coal": "Węgiel", + "Iron Ore": "Złoże żelaza", + "Gold Ore": "Złoże złota", + "Gem Ore": "", + "Cloud Ore": "", + "Iron": "Żelazo", + "Gold": "Złoto", + "Lapis": "Lapis", + "Rose": "", + "GunPowder": "Proch", + "Slime": "", + "Scale": "", + "Shard": "", + "Flower": "Kwiatek", + "Acorn": "Żołądź", + "Dirt": "Ziemia", + "Natural Rock": "", + "Plank": "", + "Plank Wall": "", + "Wood Door": "", + "Stone Brick": "", + "Ornate Stone": "", + "Stone Wall": "", + "Stone Door": "", + "Obsidian Brick": "", + "Ornate Obsidian": "", + "Obsidian Wall": "", + "Obsidian Door": "", + "Wool": "", + "Red Wool": "", + "Blue Wool": "Niebieska wełna", + "Green Wool": "Zielona wełna", + "Yellow Wool": "", + "Black Wool": "Czarna wełna", + "Sand": "", + "Cactus": "Kaktus", + "Seeds": "", + "Wheat Seeds": "", + "Grass Seeds": "Nasiona trawy", + "Bone": "Kość", + "Cloud": "Chmura", + "Rock": "", + "Gem": "", + "Potato": "", + "Wood Fishing Rod": "", + "Iron Fishing Rod": "Żelazna wędka", + "Gold Fishing Rod": "Złota wędka", + "Gem Fishing Rod": "", + "Shovel": "", + "Hoe": "Motyka", + "Sword": "", + "Pickaxe": "", + "Axe": "Topór", + "Bow": "Łuk", + "Claymore": "", + "Shears": "", + "Torch": "", + "Wood Planks": "", + "Stone Bricks": "", + "Obsidian": "", + "Wood Wall": "", + "Grass": "Trawa", + "Hole": "Dziura", + "Stairs Up": "", + "Stairs Down": "", + "Water": "", + "Tree": "", + "Tree Sapling": "", + "Cactus Sapling": "Sadzonka kaktusa", + "Lava": "Lawa", + "Lava Brick": "Lawowa cegła", + "Explode": "", + "Farmland": "Ziemia uprawna", + "Hard Rock": "Twarda skała", + "Infinite Fall": "", + "Cloud Cactus": "", + "Raw Obsidian": "", + "Totem of Air": "", + "minicraft.control_guide.attack": "", + "minicraft.control_guide.craft": "", + "minicraft.control_guide.menu": "", + "minicraft.control_guide.move": "Używaj %s do poruszania się.", + "minicraft.displays.controls": "Sterowanie", + "minicraft.displays.controls.display.controller": "Kontroler", + "minicraft.displays.controls.display.controller.00": "", + "minicraft.displays.controls.display.controller.01": "", + "minicraft.displays.controls.display.controller.02": "", + "minicraft.displays.controls.display.controller.03": "", + "minicraft.displays.controls.display.controller.04": "", + "minicraft.displays.controls.display.controller.05": "", + "minicraft.displays.controls.display.controller.06": "", + "minicraft.displays.controls.display.controller.07": "", + "minicraft.displays.controls.display.controller.08": "", + "minicraft.displays.controls.display.controller.09": "", + "minicraft.displays.controls.display.controller.10": "", + "minicraft.displays.controls.display.controller.11": "", + "minicraft.displays.controls.display.controller.12": "", + "minicraft.displays.controls.display.controller.13": "", + "minicraft.displays.controls.display.controller.14": "", + "minicraft.displays.controls.display.controller.15": "", + "minicraft.displays.controls.display.controller.desc.0": "", + "minicraft.displays.controls.display.controller.desc.1": "", + "minicraft.displays.controls.display.help.0": "", + "minicraft.displays.controls.display.keyboard": "", + "minicraft.displays.controls.display.keyboard.00": "", + "minicraft.displays.controls.display.keyboard.01": "", + "minicraft.displays.controls.display.keyboard.02": "", + "minicraft.displays.controls.display.keyboard.03": "", + "minicraft.displays.controls.display.keyboard.04": "", + "minicraft.displays.controls.display.keyboard.05": "", + "minicraft.displays.controls.display.keyboard.06": "", + "minicraft.displays.controls.display.keyboard.07": "", + "minicraft.displays.controls.display.keyboard.08": "", + "minicraft.displays.controls.display.keyboard.09": "", + "minicraft.displays.controls.display.keyboard.10": "", + "minicraft.displays.controls.display.keyboard.11": "", + "minicraft.displays.controls.display.keyboard.12": "", + "minicraft.displays.controls.display.keyboard.13": "", + "minicraft.displays.controls.display.keyboard.14": "", + "minicraft.displays.controls.display.keyboard.15": "", + "minicraft.displays.controls.display.keyboard.16": "", + "minicraft.displays.controls.display.keyboard.17": "", + "minicraft.displays.controls.display.keyboard.18": "", + "minicraft.displays.controls.display.keyboard.19": "", + "minicraft.displays.controls.display.keyboard.20": "", + "minicraft.displays.controls.display.keyboard.21": "", + "minicraft.displays.controls.display.keyboard.22": "", + "minicraft.displays.controls.display.keyboard.desc": "", + "minicraft.displays.loading.message.dungeon_regeneration": "", + "minicraft.displays.loading.message.quests": "", + "minicraft.displays.loading.regeneration_popup.display.0": "", + "minicraft.displays.loading.regeneration_popup.display.1": "", + "minicraft.displays.loading.regeneration_popup.display.2": "", + "minicraft.displays.loading.regeneration_popup.display.3": "", + "minicraft.displays.loading.regeneration_popup.display.4": "", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "", + "minicraft.displays.quests.display.no_quest": "", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", + "minicraft.notification.obsidian_knight_defeated": "", + "minicraft.notification.obsidian_knight_awoken": "", + "minicraft.notification.defeat_obsidian_knight_first": "", + "minicraft.notification.wrong_level_dungeon": "", + "minicraft.notification.boss_limit": "", + "minicraft.notification.spawn_on_boss_tile": "", + "minicraft.notifications.statue_tapped": "", + "minicraft.notifications.statue_touched": "", + "minicraft.quest.farming": "", + "minicraft.quest.farming.crafting_hoe": "", + "minicraft.quest.farming.crafting_hoe.description": "", + "minicraft.quest.farming.description": "", + "minicraft.quest.farming.getting_wheat": "", + "minicraft.quest.farming.getting_wheat.description": "", + "minicraft.quest.farming.making_farmland": "", + "minicraft.quest.farming.making_farmland.description": "", + "minicraft.quest.farming.planting_potato": "", + "minicraft.quest.farming.planting_potato.description": "", + "minicraft.quest.farming.planting_wheat": "", + "minicraft.quest.farming.planting_wheat.description": "", + "minicraft.quest.gems": "", + "minicraft.quest.gems.description": "", + "minicraft.quest.gems.gem_armor": "", + "minicraft.quest.gems.gem_armor.description": "", + "minicraft.quest.gems.gem_claymore": "", + "minicraft.quest.gems.gem_claymore.description": "", + "minicraft.quest.iron_equipments": "", + "minicraft.quest.iron_equipments.description": "", + "minicraft.quest.iron_equipments.getting_more_iron": "", + "minicraft.quest.iron_equipments.getting_more_iron.description": "", + "minicraft.quest.iron_equipments.iron_armor": "", + "minicraft.quest.iron_equipments.iron_armor.description": "", + "minicraft.quest.iron_equipments.iron_tools": "", + "minicraft.quest.iron_equipments.iron_tools.description": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", + "minicraft.quest.potions": "", + "minicraft.quest.potions.all_potions_prepared": "", + "minicraft.quest.potions.all_potions_prepared.description": "", + "minicraft.quest.potions.awkward_potions": "", + "minicraft.quest.potions.awkward_potions.description": "", + "minicraft.quest.potions.description": "", + "minicraft.quest.potions.powerful_potions": "", + "minicraft.quest.potions.powerful_potions.description": "", + "minicraft.tutorial.getting_rocks": "", + "minicraft.tutorial.getting_rocks.description": "", + "minicraft.tutorial.getting_wood": "", + "minicraft.tutorial.getting_wood.description": "", + "minicraft.tutorial.getting_wooden_pickaxe": "", + "minicraft.tutorial.getting_wooden_pickaxe.description": "", + "minicraft.tutorial.getting_workbench": "", + "minicraft.tutorial.getting_workbench.description": "", + "minicraft.tutorial.start_getting_wood": "", + "minicraft.tutorial.start_getting_wood.description": "", + "minicraft.display.options_display.language": "", + "minicraft.display.options_display.resource_packs": "", + "minicraft.displays.language_settings.title": "", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "", + "String": "", + "Glass": "", + "Cloth": "" +} diff --git a/src/client/resources/assets/localization/uk-ua.json b/src/client/resources/assets/localization/uk-ua.json new file mode 100644 index 000000000..c2a78343a --- /dev/null +++ b/src/client/resources/assets/localization/uk-ua.json @@ -0,0 +1,473 @@ +{ + "minicraft.achievement.woodcutter": "Лісоруб", + "minicraft.achievement.woodcutter.desc": "Добути деревину.", + "minicraft.achievement.benchmarking": "Зверстати верстат", + "minicraft.achievement.benchmarking.desc": "Змайструйте верстат з дерева.", + "minicraft.achievement.upgrade": "Оновлення!", + "minicraft.achievement.upgrade.desc": "Змайструйте будь-який кам'яний інструмент.", + "minicraft.achievement.bow": "Лук — всьому голова!", + "minicraft.achievement.bow.desc": "Вистреліть з лука.", + "minicraft.achievement.fish": "Порибальмо!", + "minicraft.achievement.fish.desc": "Впіймайте рибу!", + "minicraft.achievement.doors": "Дверний захист", + "minicraft.achievement.doors.desc": "Змайструйте дерев'яні двері.", + "minicraft.achievement.planks": "Пройдися по дошці!", + "minicraft.achievement.planks.desc": "Змайструйте дошки.", + "minicraft.achievement.clothes": "Який же кольоровий день!", + "minicraft.achievement.clothes.desc": "Зшийте одяг будь-якого кольору", + "minicraft.achievement.demolition": "Деконструкція", + "minicraft.achievement.demolition.desc": "Використайте динаміт.", + "minicraft.achievement.survive_darkness": "Боїтеся темряви?", + "minicraft.achievement.survive_darkness.desc": "Виживіть 5 хвилин в непроглядній тьмі.", + "minicraft.achievement.lava": "Гаряча ванна", + "minicraft.achievement.lava.desc": "Використайте зілля лави, щоб поплавати у лаві.", + "minicraft.achievement.find_gem": "Ох, блищить!", + "minicraft.achievement.find_gem.desc": "Знайдіть та видобудьте кристалічну руду.", + "minicraft.achievement.lowest_caves": "Темрява за світлом", + "minicraft.achievement.lowest_caves.desc": "Досягніть найглибших печер.", + "minicraft.achievement.obsidian_dungeon": "Серед лицарів і людей", + "minicraft.achievement.obsidian_dungeon.desc": "Досягнути обсидіанового підземелля.", + "minicraft.achievement.airwizard": "Перемогти... повітря?", + "minicraft.achievement.airwizard.desc": "Перемогти першого Повітряного Чарівника!", + "minicraft.achievement.skin": "Показ моди", + "minicraft.achievement.skin.desc": "Змініть свій скін.", + "minicraft.display.entries.boolean.false": "Вимк", + "minicraft.display.entries.boolean.true": "Увімк", + "minicraft.display.gui.link_opening": "Відкриваємо в браузері...", + "minicraft.display.gui.perm_status.saving": "Зберігаємось... %s%%", + "minicraft.display.gui.perm_status.sleep_cancel": "Натисніть %s, щоб скасувати", + "minicraft.display.gui.perm_status.sleeping": "Сплю...", + "minicraft.display.gui.potion_effects.hide_hint": "(%s, щоб сховатись!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", + "minicraft.display.gui.score.current_score": "Поточний рахунок: %s", + "minicraft.display.gui.score.time_left": "Часу залишилось %s%sm %ss", + "minicraft.display.menus.inventory": "Інвертар", + "minicraft.display.options_display": "Налаштування", + "minicraft.display.options_display.change_key_bindings": "Змінити прив'язки клавіш", + "minicraft.display.popup.enter_confirm": "enter для підтвердження", + "minicraft.display.popup.escape_cancel": "escape, щоб скасувати", + "minicraft.display.popup.title_confirm": "Підтвердити дію", + "minicraft.displays.achievements": "Досягнення", + "minicraft.displays.achievements.display.achieved": "Досягнено!", + "minicraft.displays.achievements.display.help": "Використовуйте %s і %s для переміщення.", + "minicraft.displays.achievements.display.not_achieved": "Не досягнено", + "minicraft.displays.achievements.display.score": "Рахунок досягнень: %s", + "minicraft.displays.book.default_book": "У цій книзі немає тексту.", + "minicraft.displays.crafting": "Майстрування", + "minicraft.displays.crafting.container_title.cost": "Ціна:", + "minicraft.displays.crafting.container_title.have": "Маю:", + "minicraft.displays.end_game.display.bonuses": "<Бонуси>", + "minicraft.displays.end_game.display.final_score": "Фінальний рахунок: %s", + "minicraft.displays.end_game.display.player_score": "Рахунок гравця: %s", + "minicraft.displays.end_game.display.unlocked": "Розблоковано! Ваш час %s", + "minicraft.displays.end_game.exit": "Вийти у меню", + "minicraft.displays.info.display.exit_help": "%s/%s:Вихід", + "minicraft.displays.info.display.score": "Поточний рахунок: %s", + "minicraft.displays.info.display.time": "Скільки граємо: %s", + "minicraft.displays.info.title": "Статистика гравця", + "minicraft.displays.key_input.display.help.0": "Натисніть C/Enter, щоб змінити прив'язку клавіш", + "minicraft.displays.key_input.display.help.1": "Натисніть A, щоб додати прив'язку клавіш", + "minicraft.displays.key_input.display.help.2": "Shift-D, щоб скинути усі клавіші до налаштувань по замочуванню", + "minicraft.displays.key_input.display.help.3": "%s для повернення в меню", + "minicraft.displays.key_input.popup_display.confirm_reset": "Ви впевнені, що хочете стерти усі прив'язки клавіш?", + "minicraft.displays.key_input.popup_display.press_key_sequence": "Натисніть бажану послідовність клавіш", + "minicraft.displays.key_input.title": "Керування", + "minicraft.displays.loading.message.entities": "Істоти", + "minicraft.displays.loading.message.generating": "Генеруємо", + "minicraft.displays.loading.message.level": "Рівень %s", + "minicraft.displays.loading.message.levels": "Рівні", + "minicraft.displays.loading.message.loading": "Завантаження", + "minicraft.displays.loading.message.saving": "Збереження", + "minicraft.displays.loading.message.world": "Світ", + "minicraft.displays.options_main_menu": "Опції головного меню", + "minicraft.displays.options_main_menu.resource_packs": "Пакунки ресурсів", + "minicraft.displays.options_world": "Налаштування світу", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Ви впевнені, що хочете вимкнути підказки назавжди?", + "minicraft.displays.options_world.turn_off_tutorials": "Вимкнути підказки", + "minicraft.displays.pause": "Призупинено", + "minicraft.displays.pause.display.exit_popup.0": "Ви впевнені, що хочете вийти з гри?", + "minicraft.displays.pause.display.exit_popup.1": "Весь незбережений прогрес буде втрачено", + "minicraft.displays.pause.display.exit_popup.cancel": "Скасувати", + "minicraft.displays.pause.display.exit_popup.quit": "Вийти без збереження", + "minicraft.displays.pause.display.help.choose": "%s: оберіть", + "minicraft.displays.pause.display.help.scroll": "%s і %s для прокрутки", + "minicraft.displays.pause.menu": "Головне меню", + "minicraft.displays.pause.return": "Повернутися в гру", + "minicraft.displays.pause.save": "Зберегти гру", + "minicraft.displays.player_death.display.score": "Рахунок: %s", + "minicraft.displays.player_death.display.time": "Час: %s", + "minicraft.displays.player_death.quit": "Вийти", + "minicraft.displays.player_death.respawn": "Відновитись", + "minicraft.displays.player_death.save_quit": "Зберегти та вийти", + "minicraft.displays.player_death.title": "Ви мертвий! Щасти наступного разу!", + "minicraft.displays.player_inv.container_title.items": "Предмети", + "minicraft.displays.player_inv.display.help": "(%s) для пошуку.", + "minicraft.displays.quests": "Завдання", + "minicraft.displays.quests.display.header.completed": "Виконані", + "minicraft.displays.quests.display.header.unlocked": "Розблоковані", + "minicraft.displays.quests.display.no_quest_desc": "Немає завдань", + "minicraft.displays.resource_packs.display.help.move": "Використовуйте %s і %s для переміщення.", + "minicraft.displays.resource_packs.display.help.select": "%s, щоб дослідити.", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] щоб переміщати пакунки. ", + "minicraft.displays.resource_packs.display.title": "Пакунки ресурсів", + "minicraft.displays.skin": "Скіни", + "minicraft.displays.skin.display.help.move": "Використовуйте %s та %s для переміщення.", + "minicraft.displays.skin.display.help.select": "%s, щоб обрати та %s, щоб скасувати.", + "minicraft.displays.title.display.cannot_check": "Не вдалося перевірити оновлення.", + "minicraft.displays.title.display.checking": "Перевіряємо оновлення...", + "minicraft.displays.title.display.help.0": "(%s, %s, щоб обрати)", + "minicraft.displays.title.display.help.1": "(%s для підтвердження)", + "minicraft.displays.title.display.help.2": "(%s для повернення)", + "minicraft.displays.title.display.latest_already": "Ви маєте останню версію.", + "minicraft.displays.title.display.new_version": "Нова версія: %s", + "minicraft.displays.title.display.version": "Версія %s", + "minicraft.displays.title.help": "Допомога", + "minicraft.displays.title.help.about": "Про", + "minicraft.displays.title.help.credits": "Титри", + "minicraft.displays.title.help.instructions": "Інструкції", + "minicraft.displays.title.help.storyline_guide": "Ввід у сюжет", + "minicraft.displays.title.link_to_version": "Посилання на останню версію: %s", + "minicraft.displays.title.play": "Грати", + "minicraft.displays.title.play.load_world": "Завантажити світ", + "minicraft.displays.title.play.new_world": "Новий світ", + "minicraft.displays.title.quit": "Вийти", + "minicraft.displays.title.select_to_download": "--Оберіть тут для завантаження--", + "minicraft.displays.world_gen.create_world": "Створити світ", + "minicraft.displays.world_gen.enter_world": "Введіть ім'я для світу", + "minicraft.displays.world_gen.title": "Налаштування генерації світу", + "minicraft.displays.world_gen.troublesome_input": "Проблеми з вводом імені?", + "minicraft.displays.world_gen.troublesome_input.msg": "схоже, що ви прив'язали клавіші з літерами до переміщення вказівника вгору та вниз, що може набридати. Це можна змінити в меню прив'язок клавіш у полях \"cursor-XXX\". Доки що ви можете надрукувати літеру не переміщуючи курсор натискаючи клавішу shift.", + "minicraft.displays.world_gen.world_seed": "Сід світу", + "minicraft.displays.world_select.display.help.0": "%s для підтвердження", + "minicraft.displays.world_select.display.help.1": "%s для повернення", + "minicraft.displays.world_select.display.help.2": "SHIFT-C для копіювання", + "minicraft.displays.world_select.display.help.3": "SHIFT-R для перейменування", + "minicraft.displays.world_select.display.help.4": "SHIFT-D для видалення", + "minicraft.displays.world_select.display.world_too_new": "Не можу завантажити світ з вищої версії, ніж у вас!", + "minicraft.displays.world_select.display.world_version": "Версія світу: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s, щоб скасувати", + "minicraft.displays.world_select.popups.display.change": "Нове ім'я світу:", + "minicraft.displays.world_select.popups.display.confirm": "%s для підтвердження", + "minicraft.displays.world_select.popups.display.delete": "Ви впевнені, що хочете видалити\n%s\"%s\"%s?\nЦе не може бути скасовано!", + "minicraft.displays.world_select.select_world": "Оберіть світ", + "minicraft.notification.achievement_unlocked": "Досягнення розблоковано: %s", + "minicraft.notification.air_wizard_defeated": "Повітряного чарівника подолано!", + "minicraft.notification.cannot_sleep": "Не можу спати! Залишилося %s хвилин і %s секунд!", + "minicraft.notification.death_chest_retrieved": "Скриню мертв'яка забрано!", + "minicraft.notification.defeat_air_wizard_first": "Спочатку треба перемогти повітряного чарівника.", + "minicraft.notification.dig_hole": "Спочатку викопайте яму!", + "minicraft.notification.dungeon_opened": "Підземелля відчинено!", + "minicraft.notification.gem_pickaxe_required": "Необхідна кристалічна кирка.", + "minicraft.notification.invalid_placement": "Можна поставити тільки на %s!", + "minicraft.notification.quest_completed": "Завдання виконано", + "minicraft.notification.quest_unlocked": "Завдання розблоковано", + "minicraft.notification.world_saved": "Світ збережено!", + "minicraft.notification.wrong_level_sky": "Можна викликати тільки на повітряному рівні", + "minicraft.settings.fps": "Максимальний FPS", + "minicraft.settings.difficulty": "Складність", + "minicraft.settings.difficulty.easy": "Легко", + "minicraft.settings.difficulty.normal": "Звичайно", + "minicraft.settings.difficulty.hard": "Важко", + "minicraft.settings.mode": "Режим гри", + "minicraft.settings.mode.survival": "Виживання", + "minicraft.settings.mode.creative": "Творчість", + "minicraft.settings.mode.hardcore": "Хардкор", + "minicraft.settings.mode.score": "Рахунок", + "minicraft.settings.scoretime": "Час (Режим рахунку)", + "minicraft.settings.screenshot_scale": "Розмір знімка екрана", + "minicraft.settings.sound": "Звук", + "minicraft.settings.autosave": "Автоматичне збереження", + "minicraft.settings.size": "Розмір світу", + "minicraft.settings.theme": "Тема світу", + "minicraft.settings.theme.normal": "Звичайна", + "minicraft.settings.theme.forest": "Ліс", + "minicraft.settings.theme.desert": "Пустеля", + "minicraft.settings.theme.plain": "Рівнина", + "minicraft.settings.theme.hell": "Ад", + "minicraft.settings.type": "Тип світу", + "minicraft.settings.type.island": "Острів", + "minicraft.settings.type.box": "Коробка", + "minicraft.settings.type.mountain": "Скеля", + "minicraft.settings.type.irregular": "Незвичайний", + "minicraft.skin.paul": "Павел", + "minicraft.skin.paul_cape": "Павел з накидкою", + "minicraft.skin.minecraft_steve": "Знайомий хлопчик", + "minicraft.skin.minecraft_alex": "Знайома дівчинка", + "minicraft.text_particales.key_consumed": "Ключ використано", + "Death Chest": "Скриня мертв'яка", + "Player": "Гравець", + "Leather Armor": "Шкіряна броня", + "Snake Armor": "Броня зі зміїної шкури", + "Iron Armor": "Залізна броня", + "Gold Armor": "Золота броня", + "Gem Armor": "Кристалічна броня", + "Book": "Книга", + "Antidious": "Античний", + "Empty Bucket": "Пусте відро", + "Water Bucket": "Відро з водою", + "Lava Bucket": "Відро з лавою", + "Red Clothes": "Червоний одяг", + "Blue Clothes": "Синій одяг", + "Green Clothes": "Зелений одяг", + "Yellow Clothes": "Жовтий одяг", + "Black Clothes": "Чорний одяг", + "Orange Clothes": "Помаранчевий одяг", + "Purple Clothes": "Фіолетовий одяг", + "Cyan Clothes": "Блакитний одяг", + "Reg Clothes": "Стара одежа", + "Bread": "Хліб", + "Apple": "Яблуко", + "Raw Pork": "Сира свинина", + "Raw Fish": "Сира риба", + "Raw Beef": "Сира яловичина", + "Pork Chop": "Свиняча відбивна", + "Cooked Fish": "Приготована риба", + "Cooked Pork": "Приготована яловичина", + "Steak": "Стейк", + "Gold Apple": "Золоте яблука", + "Baked Potato": "Приготована картопля", + "Cow Spawner": "Викликач корови", + "Pig Spawner": "Викликач свині", + "Sheep Spawner": "Викликач овець", + "Slime Spawner": "Викликач слаймів", + "Zombie Spawner": "Викликач зомбі", + "Creeper Spawner": "Викликач кріперів", + "Skeleton Spawner": "Викликач скелетів", + "Snake Spawner": "Викликач змій", + "Knight Spawner": "Викликач лицарів", + "AirWizard Spawner": "Викликач повітряного чарівника", + "Workbench": "Верстат", + "Oven": "Духова шафа", + "Furnace": "Піч", + "Anvil": "Ковадло", + "Enchanter": "Чарувальний стіл", + "Loom": "Ткацький станок", + "Lantern": "Ліхтар", + "Iron Lantern": "Залізний ліхтар", + "Gold Lantern": "Золотий ліхтар", + "Tnt": "Динаміт", + "Bed": "Ліжко", + "Chest": "Скриня", + "None Potion": "Пусте зілля", + "Speed Potion": "Зілля швидкості", + "Light Potion": "Зілля світла", + "Swim Potion": "Зілля плавання", + "Energy Potion": "Зілля енергії", + "Regen Potion": "Зілля відновлення", + "Health Potion": "Зілля здоров'я", + "Time Potion": "Зілля часу", + "Lava Potion": "Зілля лави", + "Shield Potion": "Зілля захисту", + "Haste Potion": "Зілля поспіху", + "Escape Potion": "Зілля втечі", + "Potion": "Зілля", + "Power Glove": "Рукавиця сили", + "Wood": "Деревина", + "Stone": "Каміння", + "Leather": "Шкіра", + "Wheat": "Пшениця", + "Key": "Ключ", + "Coal": "Вугілля", + "Iron Ore": "Залізна руда", + "Gold Ore": "Золота руда", + "Gem Ore": "Кристалічна руда", + "Cloud Ore": "Повітряна руда", + "Iron": "Залізо", + "Gold": "Золото", + "Lapis": "Ляпіс", + "Rose": "Роза", + "GunPowder": "Порох", + "Slime": "Слайм", + "Scale": "Зміїна луска", + "Shard": "Осколок", + "Flower": "Квітка", + "Acorn": "Жолудь", + "Dirt": "Земля", + "Natural Rock": "Натуральний камінь", + "Plank": "Доска", + "Plank Wall": "Стіна з досок", + "Wood Door": "Дерев'яні двері", + "Stone Brick": "Кам'яна цегла", + "Ornate Stone": "Оздоблений камінь", + "Stone Wall": "Кам'яна стіна", + "Stone Door": "Кам'яні двері", + "Obsidian Brick": "Обсидіанова цегля", + "Ornate Obsidian": "Оздоблений обсидіан", + "Obsidian Wall": "Обсідіанова стіна", + "Obsidian Door": "Обсідіанові двері", + "Wool": "Шерсть", + "Red Wool": "Червона шерсть", + "Blue Wool": "Синя шерсть", + "Green Wool": "Зелена шерсть", + "Yellow Wool": "Жовта шерсть", + "Black Wool": "Чорна шерсть", + "Sand": "Пісок", + "Cactus": "Кактус", + "Seeds": "Зерно", + "Wheat Seeds": "Зерно пшениці", + "Grass Seeds": "Зерно трави", + "Bone": "Кістка", + "Cloud": "Хмара", + "Rock": "Камінь", + "Gem": "Кристал", + "Potato": "Картопля", + "Wood Fishing Rod": "Дерев'яна вудка", + "Iron Fishing Rod": "Залізна вудка", + "Gold Fishing Rod": "Золота вудка", + "Gem Fishing Rod": "Кристалічна вудка", + "Shovel": "Лопата", + "Hoe": "Мотика", + "Sword": "Меч", + "Pickaxe": "Кирка", + "Axe": "Сокира", + "Bow": "Лук", + "Claymore": "Великий меч", + "Shears": "Ножиці", + "Torch": "Смолоскип", + "Wood Planks": "Доски", + "Stone Bricks": "Кам'яна цегла", + "Obsidian": "Обсідіан", + "Wood Wall": "Дерев'яна стіна", + "Grass": "Трава", + "Hole": "Яма", + "Stairs Up": "Сходи вгору", + "Stairs Down": "Сходи вних", + "Water": "Вода", + "Tree": "Дерево", + "Tree Sapling": "Саджанець дерева", + "Cactus Sapling": "Саджанець кактуса", + "Lava": "Лава", + "Lava Brick": "Лавова цегла", + "Explode": "Взірвати", + "Farmland": "Угіддя", + "Hard Rock": "Міцний камінь", + "Infinite Fall": "Нескінчене падіння", + "Cloud Cactus": "Повітряний кактус", + "Raw Obsidian": "Сирий обсидіан", + "Totem of Air": "Тотем повітря", + "minicraft.control_guide.attack": "Використовуйте %s щоб атакувати істот чи знищувати стіни й скелі.", + "minicraft.control_guide.craft": "Використовуйте %s, щоб відкрити меню крафту.", + "minicraft.control_guide.menu": "Використовуйте %s, щоб відкрити інвентар.", + "minicraft.control_guide.move": "Використовуйте %s для руху.", + "minicraft.displays.controls": "Керування", + "minicraft.displays.controls.display.controller": "Контролер", + "minicraft.displays.controls.display.controller.00": "Для переміщення гравця використовуйте DPAD", + "minicraft.displays.controls.display.controller.01": "Для переміщення вказівника використовуйте DPAD", + "minicraft.displays.controls.display.controller.02": "Обирайте елементи меню з A", + "minicraft.displays.controls.display.controller.03": "Для виходу зі сторінок використовуйте B", + "minicraft.displays.controls.display.controller.04": "Атакуйте сутності, руйнуйте та взаємодійте з об'єктами використовуючи A", + "minicraft.displays.controls.display.controller.05": "Щоб відкривати ігрові меню використовуйте X", + "minicraft.displays.controls.display.controller.06": "Відкривайте меню крафту з Y", + "minicraft.displays.controls.display.controller.07": "Для підняття меблів використовуйте LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "Щоб кинути один предмет, використовуйте RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Щоб кинути повний стак предмету, використовуйте RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "Перемикайте строку пошуку в меню предметів з START", + "minicraft.displays.controls.display.controller.11": "START для призупинки гри", + "minicraft.displays.controls.display.controller.12": "Використовуйте X для перемикання екранної клавіатури при вводі", + "minicraft.displays.controls.display.controller.13": "Використовуйте B як комбінацію клавіш для повернення на екранну клавіатуру", + "minicraft.displays.controls.display.controller.14": "Натисніть X щоб видалити обраний предмет з інвентарю творчого режиму", + "minicraft.displays.controls.display.controller.15": "Натисніть Y щоб видалити стак предметів з інвентарю творчого режиму", + "minicraft.displays.controls.display.controller.desc.0": "Налагоджувальні прив'язки недоступні", + "minicraft.displays.controls.display.controller.desc.1": "Детальні прив'язки дуже важко використовувати", + "minicraft.displays.controls.display.help.0": "%s/%s щоб побачити інші елементи керування.", + "minicraft.displays.controls.display.keyboard": "Клавіатура", + "minicraft.displays.controls.display.keyboard.00": "Рухайте гравця з MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Для переміщення вказівника використовуйте CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Обирайте елементи меню з SELECT", + "minicraft.displays.controls.display.keyboard.03": "Виходьте зі сторінок з EXIT", + "minicraft.displays.controls.display.keyboard.04": "Швидке збереження використовує QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Атакуйте істот, знищуйте та взаємодійте з предметами за допомогою ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Відкривайте ігрові меню з MENU", + "minicraft.displays.controls.display.keyboard.07": "Відкривайте меню крафту з CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Для підняття меблів використовуйте PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Щоб кинути один предмет, використовуйте DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Щоб кинути цілий стак предмету, використовуйте DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Перемикайте пошукову строку з SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Проглядайте результати пошуку використовуючи PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Для призупинки гри використовуйте PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Перемикайте показ зілля з POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Перемикайте спрощений показ зілля з SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Поступове розширення відображення квестів у грі використовує EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Перемикайте HUD з TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Використовуйте SCREENSHOT, щоб зняти знімок екрана", + "minicraft.displays.controls.display.keyboard.19": "Показ ігрової інформації використовує INFO", + "minicraft.displays.controls.display.keyboard.20": "Перемикайте повноекранного режиму з FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Натисніть D щоб видалити обраний предмет з інвентарю творчого режиму", + "minicraft.displays.controls.display.keyboard.22": "Використайте SHIFT-D, щоб видалити цілий стак предмету в інвентарі в творчому режимі", + "minicraft.displays.controls.display.keyboard.desc": "Налагоджувальні прив'язки не мають пояснень", + "minicraft.displays.loading.message.dungeon_regeneration": "Перестворюємо B4", + "minicraft.displays.loading.message.quests": "Завдання", + "minicraft.displays.loading.regeneration_popup.display.0": "Стара версія підземелля (рівень B4) помічена.", + "minicraft.displays.loading.regeneration_popup.display.1": "Необхідне перестворення.", + "minicraft.displays.loading.regeneration_popup.display.2": "Старі дані на цьому рівні будуть стерті:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s, щоб продовжити", + "minicraft.displays.loading.regeneration_popup.display.4": "%s, щоб скасувати завантаження світу", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Завантаження світу скасовано", + "minicraft.displays.quests.display.no_quest": "Немає розблокованих завдань", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Тільки ввід з клавіатури приймається.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Натисніть %s, щоб переглянути подробиці щодо підказки.", + "minicraft.notification.obsidian_knight_defeated": "Обсидіановий лицар: Знищений!", + "minicraft.notification.obsidian_knight_awoken": "Обсидіановий лицар повстав!", + "minicraft.notification.defeat_obsidian_knight_first": "Спочатку треба перемогти обсидіанового лицаря.", + "minicraft.notification.wrong_level_dungeon": "Можна викликати тільки в підземеллі", + "minicraft.notification.boss_limit": "Не можна викликати більше босів", + "minicraft.notification.spawn_on_boss_tile": "Можна викликати тільки в кімнаті боса", + "minicraft.notifications.statue_tapped": "Ви чуєте відлуння шепіту...", + "minicraft.notifications.statue_touched": "Ви відчуваєте, що статуя вібрує...", + "minicraft.quest.farming": "Фермер", + "minicraft.quest.farming.crafting_hoe": "Створити мотику", + "minicraft.quest.farming.crafting_hoe.description": "Створіть мотику в будь-якому верстаті", + "minicraft.quest.farming.description": "Основи фермерства.", + "minicraft.quest.farming.getting_wheat": "Збирати врожай пшениці", + "minicraft.quest.farming.getting_wheat.description": "Зберіть врожай пшениці зламавши вирощену пшеницю.", + "minicraft.quest.farming.making_farmland": "Створити угіддя", + "minicraft.quest.farming.making_farmland.description": "Створіть угіддя мотикою, використавши мотику на землі.", + "minicraft.quest.farming.planting_potato": "Посадити картоплю", + "minicraft.quest.farming.planting_potato.description": "Посадіть картоплю поклавши картоплю на угіддя", + "minicraft.quest.farming.planting_wheat": "Посадити пшеницю", + "minicraft.quest.farming.planting_wheat.description": "Посадіть пшеницю поклавши насіння пшениці на угіддя.", + "minicraft.quest.gems": "Дорога кристалів", + "minicraft.quest.gems.description": "Підготувати кристалічні інструменти.", + "minicraft.quest.gems.gem_armor": "Майстер захисту", + "minicraft.quest.gems.gem_armor.description": "Дістати кристалічну броню.", + "minicraft.quest.gems.gem_claymore": "Майстер зброї", + "minicraft.quest.gems.gem_claymore.description": "Дістати великий кристалічний меч.", + "minicraft.quest.iron_equipments": "Майстер заліза", + "minicraft.quest.iron_equipments.description": "Зібрати все залізне устаткування.", + "minicraft.quest.iron_equipments.getting_more_iron": "Залізне багатство", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Дістати більше заліза.", + "minicraft.quest.iron_equipments.iron_armor": "Покращити броню", + "minicraft.quest.iron_equipments.iron_armor.description": "Зробити залізну броню.", + "minicraft.quest.iron_equipments.iron_tools": "Покращити всі інструменти", + "minicraft.quest.iron_equipments.iron_tools.description": "Зробіть інструменти з заліза.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Продвинута кирка", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Створіть залізну кирку.", + "minicraft.quest.potions": "Майстер зілля", + "minicraft.quest.potions.all_potions_prepared": "Дослідник зілля", + "minicraft.quest.potions.all_potions_prepared.description": "Дістати всі зілля в один раз.", + "minicraft.quest.potions.awkward_potions": "Дивне зілля", + "minicraft.quest.potions.awkward_potions.description": "Дістати дивне зілля.", + "minicraft.quest.potions.description": "Діставати зілля.", + "minicraft.quest.potions.powerful_potions": "Могутні зілля", + "minicraft.quest.potions.powerful_potions.description": "Дістаньте корисні та могутні зілля.", + "minicraft.tutorial.getting_rocks": "Видобути каміння та вугілля", + "minicraft.tutorial.getting_rocks.description": "Дістаньте хоча б 5 камінців і 5 штук вугілля з каміння раніше створеною киркою.", + "minicraft.tutorial.getting_wood": "Видобути більше деревини", + "minicraft.tutorial.getting_wood.description": "Добудьте хоча б 10 штук деревини.", + "minicraft.tutorial.getting_wooden_pickaxe": "Дістати дерев'яну кирку", + "minicraft.tutorial.getting_wooden_pickaxe.description": "Створіть дерев'яну кирку в меню крафту від верстату.", + "minicraft.tutorial.getting_workbench": "Дістати верстат", + "minicraft.tutorial.getting_workbench.description": "Створіть верстат в меню крафту. Та поставте на землю.", + "minicraft.tutorial.start_getting_wood": "Початок всього", + "minicraft.tutorial.start_getting_wood.description": "Атакуйте дерева, щоб отримати деревину.", + "minicraft.display.options_display.language": "Мова", + "minicraft.display.options_display.resource_packs": "Пакунки ресурсів", + "minicraft.displays.language_settings.title": "Мова...", + "minicraft.achievement.plant_seed": "", + "minicraft.achievement.plant_seed.desc": "", + "minicraft.notification.knight_statue_exists": "", + "Arrow": "", + "String": "", + "Glass": "", + "Cloth": "" +} From 6227f35a40cbfd3f7fb265b6cf8733cf325ff088 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 15 Nov 2023 01:04:28 +0800 Subject: [PATCH 121/261] Delete poeditor.yml --- poeditor.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 poeditor.yml diff --git a/poeditor.yml b/poeditor.yml deleted file mode 100644 index b01f72bcb..000000000 --- a/poeditor.yml +++ /dev/null @@ -1,21 +0,0 @@ -api_token: 717434b2cbaa8af9a9ac250e3cc8dc05 # readonly token -projects: -- format: key_value_json - id: 590819 - terms: - de: src/client/resources/assets/localization/de-de.json - en-gb: src/client/resources/assets/localization/en-gb.json - en-us: src/client/resources/assets/localization/en-us.json - es: src/client/resources/assets/localization/es-es.json - fr: src/client/resources/assets/localization/fr-fr.json - hu: src/client/resources/assets/localization/hu-hu.json - id: src/client/resources/assets/localization/id-id.json - it: src/client/resources/assets/localization/it-it.json - nb: src/client/resources/assets/localization/nb-no.json - nl: src/client/resources/assets/localization/nl-nl.json - pl: src/client/resources/assets/localization/pl-pl.json - pt: src/client/resources/assets/localization/pt-pt.json - ru: src/client/resources/assets/localization/ru-ru.json - tr: src/client/resources/assets/localization/tr-tr.json - uk: src/client/resources/assets/localization/uk-ua.json - terms_path: src/client/resources/assets/localization/en-us.json From 1147b77832d402413811457f1969b33474e35c57 Mon Sep 17 00:00:00 2001 From: Makkkkus <37084190+Makkkkus@users.noreply.github.com> Date: Wed, 15 Nov 2023 01:08:39 +0100 Subject: [PATCH 122/261] Revert "Added fences" --- src/client/java/minicraft/item/Recipes.java | 284 +++++++++--------- src/client/java/minicraft/item/TileItem.java | 3 - .../java/minicraft/level/tile/FenceTile.java | 178 ----------- .../java/minicraft/level/tile/Tiles.java | 3 - .../resources/assets/localization/en-us.json | 5 +- .../assets/textures/item/obsidian_fence.png | Bin 182 -> 0 bytes .../assets/textures/item/stone_fence.png | Bin 171 -> 0 bytes .../assets/textures/item/wood_fence.png | Bin 182 -> 0 bytes .../assets/textures/tile/obsidian_fence.png | Bin 193 -> 0 bytes .../textures/tile/obsidian_fence_bottom.png | Bin 159 -> 0 bytes .../textures/tile/obsidian_fence_left.png | Bin 180 -> 0 bytes .../textures/tile/obsidian_fence_right.png | Bin 161 -> 0 bytes .../textures/tile/obsidian_fence_top.png | Bin 115 -> 0 bytes .../assets/textures/tile/stone_fence.png | Bin 181 -> 0 bytes .../textures/tile/stone_fence_bottom.png | Bin 138 -> 0 bytes .../assets/textures/tile/stone_fence_left.png | Bin 177 -> 0 bytes .../textures/tile/stone_fence_right.png | Bin 146 -> 0 bytes .../assets/textures/tile/stone_fence_top.png | Bin 111 -> 0 bytes .../assets/textures/tile/wood_fence.png | Bin 229 -> 0 bytes .../textures/tile/wood_fence_bottom.png | Bin 212 -> 0 bytes .../assets/textures/tile/wood_fence_left.png | Bin 194 -> 0 bytes .../assets/textures/tile/wood_fence_right.png | Bin 193 -> 0 bytes .../assets/textures/tile/wood_fence_top.png | Bin 159 -> 0 bytes src/client/resources/resources/recipes.json | 78 ----- 24 files changed, 141 insertions(+), 410 deletions(-) delete mode 100644 src/client/java/minicraft/level/tile/FenceTile.java delete mode 100644 src/client/resources/assets/textures/item/obsidian_fence.png delete mode 100644 src/client/resources/assets/textures/item/stone_fence.png delete mode 100644 src/client/resources/assets/textures/item/wood_fence.png delete mode 100644 src/client/resources/assets/textures/tile/obsidian_fence.png delete mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_bottom.png delete mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_left.png delete mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_right.png delete mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_top.png delete mode 100644 src/client/resources/assets/textures/tile/stone_fence.png delete mode 100644 src/client/resources/assets/textures/tile/stone_fence_bottom.png delete mode 100644 src/client/resources/assets/textures/tile/stone_fence_left.png delete mode 100644 src/client/resources/assets/textures/tile/stone_fence_right.png delete mode 100644 src/client/resources/assets/textures/tile/stone_fence_top.png delete mode 100644 src/client/resources/assets/textures/tile/wood_fence.png delete mode 100644 src/client/resources/assets/textures/tile/wood_fence_bottom.png delete mode 100644 src/client/resources/assets/textures/tile/wood_fence_left.png delete mode 100644 src/client/resources/assets/textures/tile/wood_fence_right.png delete mode 100644 src/client/resources/assets/textures/tile/wood_fence_top.png diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 2ad9218c7..534561380 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -1,144 +1,140 @@ -package minicraft.item; - -import java.util.ArrayList; - -public class Recipes { - - public static final ArrayList anvilRecipes = new ArrayList<>(); - public static final ArrayList ovenRecipes = new ArrayList<>(); - public static final ArrayList furnaceRecipes = new ArrayList<>(); - public static final ArrayList workbenchRecipes = new ArrayList<>(); - public static final ArrayList enchantRecipes = new ArrayList<>(); - public static final ArrayList craftRecipes = new ArrayList<>(); - public static final ArrayList loomRecipes = new ArrayList<>(); - - static { - craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); - craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - craftRecipes.add(new Recipe("plank_2", "Wood_1")); - craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); - craftRecipes.add(new Recipe("Wood Fence_1", "plank_3")); - - workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); - workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); - workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); - workbenchRecipes.add(new Recipe("Wood Fence_1", "plank_3")); - workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); - workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); - workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); - workbenchRecipes.add(new Recipe("Stone Fence_1", "Stone Brick_3")); - workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); - workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); - workbenchRecipes.add(new Recipe("Obsidian Fence_1", "Obsidian Brick_3")); - workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); - workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); - workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); - workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); - workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); - workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); - workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); - workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); - workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); - workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); - workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); - - workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); - workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); - - workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); - workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); - - loomRecipes.add(new Recipe("String_2", "Wool_1")); - loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); - loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); - loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); - loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); - loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); - loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); - - loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); - loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); - loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); - loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); - loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); - loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); - loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); - loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); - - loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - - anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); - anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); - anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); - anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); - anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); - anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); - anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); - anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); - anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); - - furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); - - ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); - ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); - ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); - ovenRecipes.add(new Recipe("bread_1", "wheat_4")); - ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); - - enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); - enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); - enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); - enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); - enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); - enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); - enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); - enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); - enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); - enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); - enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); - enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5","Cloud Ore_5")); - enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5","Shard_15")); - enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); - } -} +package minicraft.item; + +import java.util.ArrayList; + +public class Recipes { + + public static final ArrayList anvilRecipes = new ArrayList<>(); + public static final ArrayList ovenRecipes = new ArrayList<>(); + public static final ArrayList furnaceRecipes = new ArrayList<>(); + public static final ArrayList workbenchRecipes = new ArrayList<>(); + public static final ArrayList enchantRecipes = new ArrayList<>(); + public static final ArrayList craftRecipes = new ArrayList<>(); + public static final ArrayList loomRecipes = new ArrayList<>(); + + static { + craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); + craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + craftRecipes.add(new Recipe("plank_2", "Wood_1")); + craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); + + workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); + workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); + workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); + workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); + workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); + workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); + workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); + workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); + workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); + workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); + workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); + workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); + workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); + workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); + workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); + workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); + workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); + workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); + workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); + + workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); + workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); + + workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); + workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); + + loomRecipes.add(new Recipe("String_2", "Wool_1")); + loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); + loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); + loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); + loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); + loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); + loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); + + loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); + loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); + loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); + loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); + loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); + loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); + loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); + loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); + + loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + + anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); + anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); + anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); + anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); + anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); + anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); + anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); + anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); + anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); + + furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); + + ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); + ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); + ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); + ovenRecipes.add(new Recipe("bread_1", "wheat_4")); + ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); + + enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); + enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); + enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); + enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); + enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); + enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); + enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); + enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); + enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); + enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); + enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); + enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); + enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); + enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); + } +} diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index ffa1a91d7..dad79ffee 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -35,19 +35,16 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), new TileModel("Wood Planks"), "hole", "water", "cloud")); items.add(new TileItem("Plank Wall", new LinkedSprite(SpriteType.Item, "plank_wall"), new TileModel("Wood Wall"), "Wood Planks")); items.add(new TileItem("Wood Door", new LinkedSprite(SpriteType.Item, "wood_door"), new TileModel("Wood Door"), "Wood Planks")); - items.add(new TileItem("Wood Fence", new LinkedSprite(SpriteType.Item, "wood_fence"), new TileModel("Wood Fence"), "grass")); items.add(new TileItem("Stone", new LinkedSprite(SpriteType.Item, "stone"), new TileModel("Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Stone Bricks"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Ornate Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Wall"), "Stone Bricks")); items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Door"), "Stone Bricks")); - items.add(new TileItem("Stone Fence", new LinkedSprite(SpriteType.Item, "stone_fence"), new TileModel("Stone Fence"), "Stone Bricks")); items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), new TileModel("Raw Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Ornate Obsidian"),"hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Wall", new LinkedSprite(SpriteType.Item, "obsidian_wall"), new TileModel("Obsidian Wall"), "Obsidian")); items.add(new TileItem("Obsidian Door", new LinkedSprite(SpriteType.Item, "obsidian_door"), new TileModel("Obsidian Door"), "Obsidian")); - items.add(new TileItem("Obsidian Fence", new LinkedSprite(SpriteType.Item, "obsidian_fence"), new TileModel("Obsidian Fence"), "Obsidian")); items.add(new TileItem("Wool", new LinkedSprite(SpriteType.Item, "wool"), new TileModel("Wool"), "hole", "water")); items.add(new TileItem("Red Wool", new LinkedSprite(SpriteType.Item, "red_wool"), new TileModel("Red Wool"), "hole", "water")); diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java deleted file mode 100644 index 2fd0c3e0d..000000000 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ /dev/null @@ -1,178 +0,0 @@ -package minicraft.level.tile; - -import minicraft.core.Game; -import minicraft.core.io.Sound; -import minicraft.entity.Direction; -import minicraft.entity.Entity; -import minicraft.entity.mob.Mob; -import minicraft.entity.mob.Player; -import minicraft.entity.particle.SmashParticle; -import minicraft.entity.particle.TextParticle; -import minicraft.gfx.Color; -import minicraft.gfx.Screen; -import minicraft.gfx.Sprite; -import minicraft.gfx.SpriteAnimation; -import minicraft.gfx.SpriteLinker; -import minicraft.gfx.SpriteLinker.LinkedSprite; -import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.item.Item; -import minicraft.item.Items; -import minicraft.item.ToolItem; -import minicraft.level.Level; -import minicraft.util.AdvancementElement; -import minicraft.util.Logging; - -public class FenceTile extends Tile { - - private static SpriteAnimation wood = new SpriteAnimation(SpriteType.Tile, "wood_fence"); - private static SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_fence"); - private static SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_fence"); - - protected Material type; - - protected SpriteAnimation top, bottom, left, right; - - public boolean connectUp = false, connectDown = false, connectLeft = false, connectRight = false; - - protected FenceTile(Material type) { this(type, null); } - protected FenceTile(Material type, String name) { - super(type.name() + " " + (name == null ? "Fence" : name), null); - this.type = type; - switch (type) - { - case Wood: - sprite = wood; - connectsToGrass = true; - break; - case Stone: - sprite = stone; - break; - case Obsidian: - sprite = obsidian; - break; - } - top = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_top"); - bottom = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_bottom"); - left = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_left"); - right = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_right"); - } - - public void updateConnections(Level level, int x, int y) - { - connectUp = level.getTile(x, y - 1).name.equals(name); - connectDown = level.getTile(x, y + 1).name.equals(name); - connectLeft = level.getTile(x - 1, y).name.equals(name); - connectRight = level.getTile(x + 1, y).name.equals(name); - } - - public boolean mayPass(Level level, int x, int y, Entity e) { - return false; - } - - public void render(Screen screen, Level level, int x, int y) - { - switch (type) - { - case Wood: Tiles.get("Grass").render(screen, level, x, y); break; - case Stone: Tiles.get("Stone Bricks").render(screen, level, x, y); break; - case Obsidian: Tiles.get("Obsidian").render(screen, level, x, y); break; - } - - sprite.render(screen, level, x, y); - - updateConnections(level, x, y); - - // up - if (connectUp) { - top.render(screen, level, x, y); - } - // bottom - if (connectDown) { - bottom.render(screen, level, x, y); - } - // left - if (connectLeft) { - left.render(screen, level, x, y); - } - // right - if (connectRight) { - right.render(screen, level, x, y); - } - } - - @Override - public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { - hurt(level, x, y, dmg); - return true; - } - - @Override - public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if(Game.isMode("minicraft.settings.mode.creative")) - return false; // Go directly to hurt method - if (item instanceof ToolItem) { - ToolItem tool = (ToolItem) item; - if (tool.type == type.getRequiredTool()) { - if (player.payStamina(4 - tool.level) && tool.payDurability()) { - int data = level.getData(xt, yt); - hurt(level, xt, yt, tool.getDamage()); - AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( - new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( - item, this, data, xt, yt, level.depth)); - return true; - } - } - } - return false; - } - - public void hurt(Level level, int x, int y, int dmg) { - int damage = level.getData(x, y) + dmg; - int fenceHealth = 5; - if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = fenceHealth; - - level.add(new SmashParticle(x * 16, y * 16)); - Sound.play("monsterhurt"); - - level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); - - if (damage >= fenceHealth) { - String itemName = "", tilename = ""; - switch (type) { // Get what tile to set and what item to drop - case Wood: { - itemName = "Wood Fence"; - tilename = "Grass"; - break; - } - case Stone: { - itemName = "Stone Fence"; - tilename = "Stone Bricks"; - break; - } - case Obsidian: { - itemName = "Obsidian Fence"; - tilename = "Obsidian"; - break; - } - } - - level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(itemName)); - level.setTile(x, y, Tiles.get(tilename)); - } else { - level.setData(x, y, damage); - } - } - - public boolean tick(Level level, int xt, int yt) { - int damage = level.getData(xt, yt); - if (damage > 0) { - level.setData(xt, yt, damage - 1); - return true; - } - return false; - } - - public String getName(int data) { - return Material.values[data].name() + " Fence"; - } -} diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index 30856124b..d138b227a 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -76,9 +76,6 @@ public static void initTileList() { tiles.put((short)47, new BossWallTile()); tiles.put((short)48, new BossFloorTile()); tiles.put((short)49, new BossDoorTile()); - tiles.put((short)50, new FenceTile(Tile.Material.Wood)); - tiles.put((short)51, new FenceTile(Tile.Material.Stone)); - tiles.put((short)52, new FenceTile(Tile.Material.Obsidian)); tiles.put((short)50, new TomatoTile("Tomato")); tiles.put((short)51, new CarrotTile("Carrot")); tiles.put((short)52, new HeavenlyBerriesTile("Heavenly Berries")); diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 22a2d1de9..e10178853 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -469,8 +469,5 @@ "Infinite Fall": "Infinite Fall", "Cloud Cactus": "Cloud Cactus", "Raw Obsidian": "Raw Obsidian", - "Totem of Air": "Totem of Air", - "Wood Fence": "Wood Fence", - "Stone Fence": "Stone Fence", - "Obsidian Fence": "Obsidian Fence" + "Totem of Air": "Totem of Air" } diff --git a/src/client/resources/assets/textures/item/obsidian_fence.png b/src/client/resources/assets/textures/item/obsidian_fence.png deleted file mode 100644 index 9a7a86e5795634c71ed41dca4ea23fa1e9718e84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|3OrpLLnNm5 z_8W3F7znVa2RhX>wEAAK+kayB-`2fJlMk_LI4z2`IC|*iyJ^ySjt_1Z{4|RxTAs3E zHDALVrOReo466FS(ijqMK2KWlJ1xPMzo=`?^FXH9Qj6q^dkT)(J&SrZXXDXH!6`TE eZGJvj{fyV_nod}->Y)Un-3*?telF{r5}E)cuSH-0 diff --git a/src/client/resources/assets/textures/item/stone_fence.png b/src/client/resources/assets/textures/item/stone_fence.png deleted file mode 100644 index 08b69d2306448b5ff9ab2bede5000b29eee5ddbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|QaxQ9LnNl= z_HPtqQRHF%Ubo`-#;%2Y;*PQ*k2-Gfemux)Ur>K4=kzVXoJl6CzV}oz-H!Bh91i)W zXxz`<5R`rNOhNgXH|ZH`C(f*yx5Acn!IyjekG%@N-!?e5L#)_+&ENRR>1Xwi)#y&h T^b-;WTFBt(>gTe~DWM4fDF8ph diff --git a/src/client/resources/assets/textures/item/wood_fence.png b/src/client/resources/assets/textures/item/wood_fence.png deleted file mode 100644 index 4e0f48340ba8f2273e928964a6fd36f216a2e85e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|3OrpLLnNjq zCpa*@{5S3Y<-fZBmAf}8c(=J`9N6(cJQd9=@7tULZVUOR0-Q zg4Nbimj_*kluRT*+!+!V7&hgt3CnohVX!8ukolpz=EC2ui diff --git a/src/client/resources/assets/textures/tile/obsidian_fence.png b/src/client/resources/assets/textures/tile/obsidian_fence.png deleted file mode 100644 index 7266237126e6eea8c654f229394c3fd9d3b6c80e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|sy$sCLo9le z6C^SYbogFy*K2)v@cZxo6OZcczjgS;iH?c%*`I6^M1)wt+JYD@<);T3K0RT?AN9h0n diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png b/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png deleted file mode 100644 index 1c98de36ac6208af4fd2f8703dcfd51e3d0da881..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|B0XIkLo9le z6C_wG8v9m!u9ppb{{P1ngGZOo9ML&>00=(3e_!0Dz5aVr=;@~OC6;D_vzJ|BbBC$S5@89!&5yeI4^O?`+jHZJ;X|VYk)EbNgDVUS^~&rl58qa%0yQ#t My85}Sb4q9e0O!CYdjJ3c diff --git a/src/client/resources/assets/textures/tile/stone_fence.png b/src/client/resources/assets/textures/tile/stone_fence.png deleted file mode 100644 index 9df75239360a767abb05c791b3520b0aa174f761..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|@;zM~Lo9le z|NQ@N&%Ci=;zU8`p3aQB77W~aoZjBvBFkm%>trrh#jr(0Mg4pK>eZn%g*HWt*n*dr zRAYiP7}6zPynJ~uQ)0FXa|i2|Zq^710WR)2Yzn`n=PNoZ@SG@P-1xFVFg)+bH1Q2j c-MSbVBp8(qcD76C1FdH8boFyt=akR{0BE5*3jhEB diff --git a/src/client/resources/assets/textures/tile/stone_fence_bottom.png b/src/client/resources/assets/textures/tile/stone_fence_bottom.png deleted file mode 100644 index 5091f520ee83a06b175cb4d25b2067786bfbaf9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|Ts&PILo9le z6C_wG8e3bB)^l@r|4+%bD|vC@zjHg^L(>-4`HIu^VwExkh3!0TZEa8SD6n0)#*lP~ jAzy*7*FfS&2?K*?pO~ZZ)_u}I^B6o`{an^LB{Ts5&k86) diff --git a/src/client/resources/assets/textures/tile/stone_fence_left.png b/src/client/resources/assets/textures/tile/stone_fence_left.png deleted file mode 100644 index 2c52b36951c17cfb96b0e3870eb538ec4b8aa984..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|vOQfKLo9mV zPTI(Oz<`5A{^aL?+r8?EHvUeoXPuT5iQMG%+@*0{Veb)cxd!=FTaRhYl3dCgVtPmR zOikC`?^_%T%NY)=Dc4NyaqkuGx}n4nSj9Z$+O2mCPmBd7`kHM1!*c!0_3V_2zwGi4 Z7;4lMC*^m)egm|Y!PC{xWt~$(698SkKz{%L diff --git a/src/client/resources/assets/textures/tile/stone_fence_right.png b/src/client/resources/assets/textures/tile/stone_fence_right.png deleted file mode 100644 index 0fa689d4ab5a7019519edfec22822d37ecd15d8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|d^}woLo9le z6C_xBmS}9-u;GXQM8ib~h|B r=;-V`D4=|j;mL*eqijdxB!D)&VvwwEd?IN8G?&5C)z4*}Q$iB}z8o&> diff --git a/src/client/resources/assets/textures/tile/stone_fence_top.png b/src/client/resources/assets/textures/tile/stone_fence_top.png deleted file mode 100644 index 725f6a6de1bcc7458969ccf83108464fc91b9563..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|G(BA$Lo9le z6Am!y=;-{Dw<>w@e~M=CzvzgFKgXB$aZW#?A;G#hVFe?@DmKo*eY5{w1ZraNboFyt I=akR{02Op0p8x;= diff --git a/src/client/resources/assets/textures/tile/wood_fence.png b/src/client/resources/assets/textures/tile/wood_fence.png deleted file mode 100644 index e714c6788a4725258ca3e25f5b7d54315b69e1fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP_Wk1 z#WBR9H~G*1|MtwP4V_ANd3bnqcBq)JuwI;dtm5(C>PI{m1VsMazmn6f6c%3n!=9O$ zS^1*gj;g1;dYU2)#ynd}T^^Y9_)cOx!gT8>lMW9@E2|&#gulJ#CnyTArR;9FQF5R| z*F1}Z%gDgMV1Y+Vd$y6;ISaQrj7u08Qlr%z0`nZ+0v*Da8sVAd>&u`8WOD#92wV!D P45B<;{an^LB{Ts5aq&a} diff --git a/src/client/resources/assets/textures/tile/wood_fence_bottom.png b/src/client/resources/assets/textures/tile/wood_fence_bottom.png deleted file mode 100644 index eb91e92cd123db3bd9273d46585f02cbc93a913d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP%y{S z#WBR9H~G*1|MtwP4V_ANn-4LF#R&EE^zgi5V%orvwCCeL+f2Oxae*KAujHJ*0K^9l z9B43JQn;(3v9a;ttEuKcmVDd|Vmn5=w-_;ZFm5qzm|<{0y5oaEgy%ADAm6)_ho{7g so#8>V==3fg6EUE@e5nzhX}-P;T0k}j5QD&_;K?A$)78&qol`;+064EifB*mh diff --git a/src/client/resources/assets/textures/tile/wood_fence_left.png b/src/client/resources/assets/textures/tile/wood_fence_left.png deleted file mode 100644 index ca1baee05b26c1bdc2bfec3e0af90f43d588319c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP%z5V z#WBR9H~G*1|MtwP4V_ANn-4L#l`=B+IPCcN&sKRO+XfTU+eR^aKeahVySM0wZvZhH zfq>C%GMC18r-~hF7rQc_F?q=xIM5{X>&X$eqj3o`zh-hWa355e>Hk_x1ZWFiYJ_K+ buP=iZkj(+aAaE&oGKlhY^>bP0l+XkK7^OR4 diff --git a/src/client/resources/assets/textures/tile/wood_fence_right.png b/src/client/resources/assets/textures/tile/wood_fence_right.png deleted file mode 100644 index ae919603751b702670bae687da49c0503a8fba35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP%zTd z#WBR9H~G*1|MtwP4V_ANn-4LF1&L&Ha3!%wC~G$E$m+WPe|7jhgN)Z56P`B#Sqm}HrP?os4eu|rLHm&D!J21U0?j3*ZIck_1bb(q9>THIGnzopr0B9RI=>Px# diff --git a/src/client/resources/assets/textures/tile/wood_fence_top.png b/src/client/resources/assets/textures/tile/wood_fence_top.png deleted file mode 100644 index 3a5f0267e0c0cbcbbbe2f1a4feea9dd867f5eefc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP|)1d z#WBR9H~Gi^|MtvgYxER8)IUwR|G)I*wEtIGS^hl^I)21KG2stT)|D;bO;aGV8?S^Z t0~14>xt@miEz#{jBluDyJkxxA8MJ_G4j=}BOTm*tl&7no%Q~loCIB8LENK7$ diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index aa51e66b6..335f7e8c2 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -142,32 +142,6 @@ } } }, - "minicraft.advancements.recipes.wood_fence": { - "criteria": { - "has_plank": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "plank" - ] - } - ] - } - } - }, - "requirements": [ - [ - "has_plank" - ] - ], - "rewards": { - "recipes": { - "Wood Fence_1": ["plank_3"] - } - } - }, "minicraft.advancements.recipes.lantern": { "criteria": { "has_wood": { @@ -324,32 +298,6 @@ } } }, - "minicraft.advancements.recipes.stone_fence": { - "criteria": { - "has_stone_brick": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "stone brick" - ] - } - ] - } - } - }, - "requirements": [ - [ - "has_stone_brick" - ] - ], - "rewards": { - "recipes": { - "Stone Fence_1": ["Stone Brick_3"] - } - } - }, "minicraft.advancements.recipes.obsidian_brick": { "criteria": { "has_raw_obsidian": { @@ -454,32 +402,6 @@ } } }, - "minicraft.advancements.recipes.obsidian_fence": { - "criteria": { - "has_obsidian_brick": { - "trigger": "inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "obsidian brick" - ] - } - ] - } - } - }, - "requirements": [ - [ - "has_obsidian_brick" - ] - ], - "rewards": { - "recipes": { - "Obsidian Fence_1": ["Obsidian Brick_3"] - } - } - }, "minicraft.advancements.recipes.oven": { "criteria": { "has_stone": { From 9874bcda7619a7815c4684fc5711eb02a5a417f2 Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:17:16 +0100 Subject: [PATCH 123/261] ?? --- src/client/java/minicraft/item/Recipes.java | 280 ++++++++++---------- 1 file changed, 140 insertions(+), 140 deletions(-) diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 534561380..1c28699d2 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -1,140 +1,140 @@ -package minicraft.item; - -import java.util.ArrayList; - -public class Recipes { - - public static final ArrayList anvilRecipes = new ArrayList<>(); - public static final ArrayList ovenRecipes = new ArrayList<>(); - public static final ArrayList furnaceRecipes = new ArrayList<>(); - public static final ArrayList workbenchRecipes = new ArrayList<>(); - public static final ArrayList enchantRecipes = new ArrayList<>(); - public static final ArrayList craftRecipes = new ArrayList<>(); - public static final ArrayList loomRecipes = new ArrayList<>(); - - static { - craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); - craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - craftRecipes.add(new Recipe("plank_2", "Wood_1")); - craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); - - workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); - workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); - workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); - workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); - workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); - workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); - workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); - workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); - workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); - workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); - workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); - workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); - workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); - workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); - workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); - workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); - workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); - workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); - workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); - - workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); - workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); - - workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); - workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); - - loomRecipes.add(new Recipe("String_2", "Wool_1")); - loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); - loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); - loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); - loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); - loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); - loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); - - loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); - loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); - loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); - loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); - loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); - loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); - loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); - loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); - - loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - - anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); - anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); - anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); - anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); - anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); - anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); - anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); - anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); - anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); - - furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); - - ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); - ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); - ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); - ovenRecipes.add(new Recipe("bread_1", "wheat_4")); - ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); - - enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); - enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); - enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); - enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); - enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); - enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); - enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); - enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); - enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); - enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); - enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); - enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); - enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); - enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); - } -} +package minicraft.item; + +import java.util.ArrayList; + +public class Recipes { + + public static final ArrayList anvilRecipes = new ArrayList<>(); + public static final ArrayList ovenRecipes = new ArrayList<>(); + public static final ArrayList furnaceRecipes = new ArrayList<>(); + public static final ArrayList workbenchRecipes = new ArrayList<>(); + public static final ArrayList enchantRecipes = new ArrayList<>(); + public static final ArrayList craftRecipes = new ArrayList<>(); + public static final ArrayList loomRecipes = new ArrayList<>(); + + static { + craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); + craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + craftRecipes.add(new Recipe("plank_2", "Wood_1")); + craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); + + workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); + workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); + workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); + workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); + workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); + workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); + workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); + workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); + workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); + workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); + workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); + workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); + workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); + workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); + workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); + workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); + workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); + workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); + workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); + + workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); + workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); + + workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); + workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); + + loomRecipes.add(new Recipe("String_2", "Wool_1")); + loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); + loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); + loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); + loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); + loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); + loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); + + loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); + loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); + loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); + loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); + loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); + loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); + loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); + loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); + + loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + + anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); + anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); + anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); + anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); + anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); + anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); + anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); + anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); + anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); + + furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); + + ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); + ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); + ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); + ovenRecipes.add(new Recipe("bread_1", "wheat_4")); + ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); + + enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); + enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); + enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); + enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); + enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); + enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); + enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); + enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); + enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); + enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); + enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); + enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); + enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); + enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); + } +} From 3974d0362ed86387058873733ad6acb8a4601391 Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:22:05 +0100 Subject: [PATCH 124/261] added fences again --- src/client/java/minicraft/item/Recipes.java | 4 + src/client/java/minicraft/item/TileItem.java | 3 + .../java/minicraft/level/tile/FenceTile.java | 178 ++++++++++++++++++ .../java/minicraft/level/tile/Tiles.java | 3 + .../resources/assets/localization/en-us.json | 5 +- .../assets/textures/item/obsidian_fence.png | Bin 0 -> 182 bytes .../assets/textures/item/stone_fence.png | Bin 0 -> 171 bytes .../assets/textures/item/wood_fence.png | Bin 0 -> 182 bytes .../assets/textures/tile/obsidian_fence.png | Bin 0 -> 193 bytes .../textures/tile/obsidian_fence_bottom.png | Bin 0 -> 159 bytes .../textures/tile/obsidian_fence_left.png | Bin 0 -> 180 bytes .../textures/tile/obsidian_fence_right.png | Bin 0 -> 161 bytes .../textures/tile/obsidian_fence_top.png | Bin 0 -> 115 bytes .../assets/textures/tile/stone_fence.png | Bin 0 -> 181 bytes .../textures/tile/stone_fence_bottom.png | Bin 0 -> 138 bytes .../assets/textures/tile/stone_fence_left.png | Bin 0 -> 177 bytes .../textures/tile/stone_fence_right.png | Bin 0 -> 146 bytes .../assets/textures/tile/stone_fence_top.png | Bin 0 -> 111 bytes .../assets/textures/tile/wood_fence.png | Bin 0 -> 229 bytes .../textures/tile/wood_fence_bottom.png | Bin 0 -> 212 bytes .../assets/textures/tile/wood_fence_left.png | Bin 0 -> 194 bytes .../assets/textures/tile/wood_fence_right.png | Bin 0 -> 193 bytes .../assets/textures/tile/wood_fence_top.png | Bin 0 -> 159 bytes src/client/resources/resources/recipes.json | 78 ++++++++ 24 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 src/client/java/minicraft/level/tile/FenceTile.java create mode 100644 src/client/resources/assets/textures/item/obsidian_fence.png create mode 100644 src/client/resources/assets/textures/item/stone_fence.png create mode 100644 src/client/resources/assets/textures/item/wood_fence.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_bottom.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_left.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_right.png create mode 100644 src/client/resources/assets/textures/tile/obsidian_fence_top.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_bottom.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_left.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_right.png create mode 100644 src/client/resources/assets/textures/tile/stone_fence_top.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_bottom.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_left.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_right.png create mode 100644 src/client/resources/assets/textures/tile/wood_fence_top.png diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 1c28699d2..4b22b981d 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -18,21 +18,25 @@ public class Recipes { craftRecipes.add(new Recipe("plank_2", "Wood_1")); craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); + craftRecipes.add(new Recipe("Wood Fence_1", "plank_3")); workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); + workbenchRecipes.add(new Recipe("Wood Fence_1", "plank_3")); workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); + workbenchRecipes.add(new Recipe("Stone Fence_1", "Stone Brick_3")); workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); + workbenchRecipes.add(new Recipe("Obsidian Fence_1", "Obsidian Brick_3")); workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index dad79ffee..ffa1a91d7 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -35,16 +35,19 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), new TileModel("Wood Planks"), "hole", "water", "cloud")); items.add(new TileItem("Plank Wall", new LinkedSprite(SpriteType.Item, "plank_wall"), new TileModel("Wood Wall"), "Wood Planks")); items.add(new TileItem("Wood Door", new LinkedSprite(SpriteType.Item, "wood_door"), new TileModel("Wood Door"), "Wood Planks")); + items.add(new TileItem("Wood Fence", new LinkedSprite(SpriteType.Item, "wood_fence"), new TileModel("Wood Fence"), "grass")); items.add(new TileItem("Stone", new LinkedSprite(SpriteType.Item, "stone"), new TileModel("Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Stone Bricks"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Ornate Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Wall"), "Stone Bricks")); items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Door"), "Stone Bricks")); + items.add(new TileItem("Stone Fence", new LinkedSprite(SpriteType.Item, "stone_fence"), new TileModel("Stone Fence"), "Stone Bricks")); items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), new TileModel("Raw Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Ornate Obsidian"),"hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Wall", new LinkedSprite(SpriteType.Item, "obsidian_wall"), new TileModel("Obsidian Wall"), "Obsidian")); items.add(new TileItem("Obsidian Door", new LinkedSprite(SpriteType.Item, "obsidian_door"), new TileModel("Obsidian Door"), "Obsidian")); + items.add(new TileItem("Obsidian Fence", new LinkedSprite(SpriteType.Item, "obsidian_fence"), new TileModel("Obsidian Fence"), "Obsidian")); items.add(new TileItem("Wool", new LinkedSprite(SpriteType.Item, "wool"), new TileModel("Wool"), "hole", "water")); items.add(new TileItem("Red Wool", new LinkedSprite(SpriteType.Item, "red_wool"), new TileModel("Red Wool"), "hole", "water")); diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java new file mode 100644 index 000000000..2fd0c3e0d --- /dev/null +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -0,0 +1,178 @@ +package minicraft.level.tile; + +import minicraft.core.Game; +import minicraft.core.io.Sound; +import minicraft.entity.Direction; +import minicraft.entity.Entity; +import minicraft.entity.mob.Mob; +import minicraft.entity.mob.Player; +import minicraft.entity.particle.SmashParticle; +import minicraft.entity.particle.TextParticle; +import minicraft.gfx.Color; +import minicraft.gfx.Screen; +import minicraft.gfx.Sprite; +import minicraft.gfx.SpriteAnimation; +import minicraft.gfx.SpriteLinker; +import minicraft.gfx.SpriteLinker.LinkedSprite; +import minicraft.gfx.SpriteLinker.SpriteType; +import minicraft.item.Item; +import minicraft.item.Items; +import minicraft.item.ToolItem; +import minicraft.level.Level; +import minicraft.util.AdvancementElement; +import minicraft.util.Logging; + +public class FenceTile extends Tile { + + private static SpriteAnimation wood = new SpriteAnimation(SpriteType.Tile, "wood_fence"); + private static SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_fence"); + private static SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_fence"); + + protected Material type; + + protected SpriteAnimation top, bottom, left, right; + + public boolean connectUp = false, connectDown = false, connectLeft = false, connectRight = false; + + protected FenceTile(Material type) { this(type, null); } + protected FenceTile(Material type, String name) { + super(type.name() + " " + (name == null ? "Fence" : name), null); + this.type = type; + switch (type) + { + case Wood: + sprite = wood; + connectsToGrass = true; + break; + case Stone: + sprite = stone; + break; + case Obsidian: + sprite = obsidian; + break; + } + top = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_top"); + bottom = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_bottom"); + left = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_left"); + right = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_right"); + } + + public void updateConnections(Level level, int x, int y) + { + connectUp = level.getTile(x, y - 1).name.equals(name); + connectDown = level.getTile(x, y + 1).name.equals(name); + connectLeft = level.getTile(x - 1, y).name.equals(name); + connectRight = level.getTile(x + 1, y).name.equals(name); + } + + public boolean mayPass(Level level, int x, int y, Entity e) { + return false; + } + + public void render(Screen screen, Level level, int x, int y) + { + switch (type) + { + case Wood: Tiles.get("Grass").render(screen, level, x, y); break; + case Stone: Tiles.get("Stone Bricks").render(screen, level, x, y); break; + case Obsidian: Tiles.get("Obsidian").render(screen, level, x, y); break; + } + + sprite.render(screen, level, x, y); + + updateConnections(level, x, y); + + // up + if (connectUp) { + top.render(screen, level, x, y); + } + // bottom + if (connectDown) { + bottom.render(screen, level, x, y); + } + // left + if (connectLeft) { + left.render(screen, level, x, y); + } + // right + if (connectRight) { + right.render(screen, level, x, y); + } + } + + @Override + public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { + hurt(level, x, y, dmg); + return true; + } + + @Override + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + if(Game.isMode("minicraft.settings.mode.creative")) + return false; // Go directly to hurt method + if (item instanceof ToolItem) { + ToolItem tool = (ToolItem) item; + if (tool.type == type.getRequiredTool()) { + if (player.payStamina(4 - tool.level) && tool.payDurability()) { + int data = level.getData(xt, yt); + hurt(level, xt, yt, tool.getDamage()); + AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( + new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( + item, this, data, xt, yt, level.depth)); + return true; + } + } + } + return false; + } + + public void hurt(Level level, int x, int y, int dmg) { + int damage = level.getData(x, y) + dmg; + int fenceHealth = 5; + if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = fenceHealth; + + level.add(new SmashParticle(x * 16, y * 16)); + Sound.play("monsterhurt"); + + level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + + if (damage >= fenceHealth) { + String itemName = "", tilename = ""; + switch (type) { // Get what tile to set and what item to drop + case Wood: { + itemName = "Wood Fence"; + tilename = "Grass"; + break; + } + case Stone: { + itemName = "Stone Fence"; + tilename = "Stone Bricks"; + break; + } + case Obsidian: { + itemName = "Obsidian Fence"; + tilename = "Obsidian"; + break; + } + } + + level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(itemName)); + level.setTile(x, y, Tiles.get(tilename)); + } else { + level.setData(x, y, damage); + } + } + + public boolean tick(Level level, int xt, int yt) { + int damage = level.getData(xt, yt); + if (damage > 0) { + level.setData(xt, yt, damage - 1); + return true; + } + return false; + } + + public String getName(int data) { + return Material.values[data].name() + " Fence"; + } +} diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index d138b227a..30856124b 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -76,6 +76,9 @@ public static void initTileList() { tiles.put((short)47, new BossWallTile()); tiles.put((short)48, new BossFloorTile()); tiles.put((short)49, new BossDoorTile()); + tiles.put((short)50, new FenceTile(Tile.Material.Wood)); + tiles.put((short)51, new FenceTile(Tile.Material.Stone)); + tiles.put((short)52, new FenceTile(Tile.Material.Obsidian)); tiles.put((short)50, new TomatoTile("Tomato")); tiles.put((short)51, new CarrotTile("Carrot")); tiles.put((short)52, new HeavenlyBerriesTile("Heavenly Berries")); diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index e10178853..22a2d1de9 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -469,5 +469,8 @@ "Infinite Fall": "Infinite Fall", "Cloud Cactus": "Cloud Cactus", "Raw Obsidian": "Raw Obsidian", - "Totem of Air": "Totem of Air" + "Totem of Air": "Totem of Air", + "Wood Fence": "Wood Fence", + "Stone Fence": "Stone Fence", + "Obsidian Fence": "Obsidian Fence" } diff --git a/src/client/resources/assets/textures/item/obsidian_fence.png b/src/client/resources/assets/textures/item/obsidian_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..9a7a86e5795634c71ed41dca4ea23fa1e9718e84 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|3OrpLLnNm5 z_8W3F7znVa2RhX>wEAAK+kayB-`2fJlMk_LI4z2`IC|*iyJ^ySjt_1Z{4|RxTAs3E zHDALVrOReo466FS(ijqMK2KWlJ1xPMzo=`?^FXH9Qj6q^dkT)(J&SrZXXDXH!6`TE eZGJvj{fyV_nod}->Y)Un-3*?telF{r5}E)cuSH-0 literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/item/stone_fence.png b/src/client/resources/assets/textures/item/stone_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..08b69d2306448b5ff9ab2bede5000b29eee5ddbf GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|QaxQ9LnNl= z_HPtqQRHF%Ubo`-#;%2Y;*PQ*k2-Gfemux)Ur>K4=kzVXoJl6CzV}oz-H!Bh91i)W zXxz`<5R`rNOhNgXH|ZH`C(f*yx5Acn!IyjekG%@N-!?e5L#)_+&ENRR>1Xwi)#y&h T^b-;WTFBt(>gTe~DWM4fDF8ph literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/item/wood_fence.png b/src/client/resources/assets/textures/item/wood_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..4e0f48340ba8f2273e928964a6fd36f216a2e85e GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|3OrpLLnNjq zCpa*@{5S3Y<-fZBmAf}8c(=J`9N6(cJQd9=@7tULZVUOR0-Q zg4Nbimj_*kluRT*+!+!V7&hgt3CnohVX!8ukolpz=EC2ui literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/obsidian_fence.png b/src/client/resources/assets/textures/tile/obsidian_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..7266237126e6eea8c654f229394c3fd9d3b6c80e GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|sy$sCLo9le z6C^SYbogFy*K2)v@cZxo6OZcczjgS;iH?c%*`I6^M1)wt+JYD@<);T3K0RT?AN9h0n literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png b/src/client/resources/assets/textures/tile/obsidian_fence_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..1c98de36ac6208af4fd2f8703dcfd51e3d0da881 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|B0XIkLo9le z6C_wG8v9m!u9ppb{{P1ngGZOo9ML&>00=(3e_!0Dz5aVr=;@~OC6;D_vzJ|BbBC$S5@89!&5yeI4^O?`+jHZJ;X|VYk)EbNgDVUS^~&rl58qa%0yQ#t My85}Sb4q9e0O!CYdjJ3c literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence.png b/src/client/resources/assets/textures/tile/stone_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..9df75239360a767abb05c791b3520b0aa174f761 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|@;zM~Lo9le z|NQ@N&%Ci=;zU8`p3aQB77W~aoZjBvBFkm%>trrh#jr(0Mg4pK>eZn%g*HWt*n*dr zRAYiP7}6zPynJ~uQ)0FXa|i2|Zq^710WR)2Yzn`n=PNoZ@SG@P-1xFVFg)+bH1Q2j c-MSbVBp8(qcD76C1FdH8boFyt=akR{0BE5*3jhEB literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence_bottom.png b/src/client/resources/assets/textures/tile/stone_fence_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..5091f520ee83a06b175cb4d25b2067786bfbaf9e GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|Ts&PILo9le z6C_wG8e3bB)^l@r|4+%bD|vC@zjHg^L(>-4`HIu^VwExkh3!0TZEa8SD6n0)#*lP~ jAzy*7*FfS&2?K*?pO~ZZ)_u}I^B6o`{an^LB{Ts5&k86) literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence_left.png b/src/client/resources/assets/textures/tile/stone_fence_left.png new file mode 100644 index 0000000000000000000000000000000000000000..2c52b36951c17cfb96b0e3870eb538ec4b8aa984 GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|vOQfKLo9mV zPTI(Oz<`5A{^aL?+r8?EHvUeoXPuT5iQMG%+@*0{Veb)cxd!=FTaRhYl3dCgVtPmR zOikC`?^_%T%NY)=Dc4NyaqkuGx}n4nSj9Z$+O2mCPmBd7`kHM1!*c!0_3V_2zwGi4 Z7;4lMC*^m)egm|Y!PC{xWt~$(698SkKz{%L literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence_right.png b/src/client/resources/assets/textures/tile/stone_fence_right.png new file mode 100644 index 0000000000000000000000000000000000000000..0fa689d4ab5a7019519edfec22822d37ecd15d8c GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|d^}woLo9le z6C_xBmS}9-u;GXQM8ib~h|B r=;-V`D4=|j;mL*eqijdxB!D)&VvwwEd?IN8G?&5C)z4*}Q$iB}z8o&> literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/stone_fence_top.png b/src/client/resources/assets/textures/tile/stone_fence_top.png new file mode 100644 index 0000000000000000000000000000000000000000..725f6a6de1bcc7458969ccf83108464fc91b9563 GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|G(BA$Lo9le z6Am!y=;-{Dw<>w@e~M=CzvzgFKgXB$aZW#?A;G#hVFe?@DmKo*eY5{w1ZraNboFyt I=akR{02Op0p8x;= literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/wood_fence.png b/src/client/resources/assets/textures/tile/wood_fence.png new file mode 100644 index 0000000000000000000000000000000000000000..e714c6788a4725258ca3e25f5b7d54315b69e1fb GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP_Wk1 z#WBR9H~G*1|MtwP4V_ANd3bnqcBq)JuwI;dtm5(C>PI{m1VsMazmn6f6c%3n!=9O$ zS^1*gj;g1;dYU2)#ynd}T^^Y9_)cOx!gT8>lMW9@E2|&#gulJ#CnyTArR;9FQF5R| z*F1}Z%gDgMV1Y+Vd$y6;ISaQrj7u08Qlr%z0`nZ+0v*Da8sVAd>&u`8WOD#92wV!D P45B<;{an^LB{Ts5aq&a} literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/wood_fence_bottom.png b/src/client/resources/assets/textures/tile/wood_fence_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..eb91e92cd123db3bd9273d46585f02cbc93a913d GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP%y{S z#WBR9H~G*1|MtwP4V_ANn-4LF#R&EE^zgi5V%orvwCCeL+f2Oxae*KAujHJ*0K^9l z9B43JQn;(3v9a;ttEuKcmVDd|Vmn5=w-_;ZFm5qzm|<{0y5oaEgy%ADAm6)_ho{7g so#8>V==3fg6EUE@e5nzhX}-P;T0k}j5QD&_;K?A$)78&qol`;+064EifB*mh literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/wood_fence_left.png b/src/client/resources/assets/textures/tile/wood_fence_left.png new file mode 100644 index 0000000000000000000000000000000000000000..ca1baee05b26c1bdc2bfec3e0af90f43d588319c GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP%z5V z#WBR9H~G*1|MtwP4V_ANn-4L#l`=B+IPCcN&sKRO+XfTU+eR^aKeahVySM0wZvZhH zfq>C%GMC18r-~hF7rQc_F?q=xIM5{X>&X$eqj3o`zh-hWa355e>Hk_x1ZWFiYJ_K+ buP=iZkj(+aAaE&oGKlhY^>bP0l+XkK7^OR4 literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/wood_fence_right.png b/src/client/resources/assets/textures/tile/wood_fence_right.png new file mode 100644 index 0000000000000000000000000000000000000000..ae919603751b702670bae687da49c0503a8fba35 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP%zTd z#WBR9H~G*1|MtwP4V_ANn-4LF1&L&Ha3!%wC~G$E$m+WPe|7jhgN)Z56P`B#Sqm}HrP?os4eu|rLHm&D!J21U0?j3*ZIck_1bb(q9>THIGnzopr0B9RI=>Px# literal 0 HcmV?d00001 diff --git a/src/client/resources/assets/textures/tile/wood_fence_top.png b/src/client/resources/assets/textures/tile/wood_fence_top.png new file mode 100644 index 0000000000000000000000000000000000000000..3a5f0267e0c0cbcbbbe2f1a4feea9dd867f5eefc GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP|)1d z#WBR9H~Gi^|MtvgYxER8)IUwR|G)I*wEtIGS^hl^I)21KG2stT)|D;bO;aGV8?S^Z t0~14>xt@miEz#{jBluDyJkxxA8MJ_G4j=}BOTm*tl&7no%Q~loCIB8LENK7$ literal 0 HcmV?d00001 diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 335f7e8c2..aa51e66b6 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -142,6 +142,32 @@ } } }, + "minicraft.advancements.recipes.wood_fence": { + "criteria": { + "has_plank": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "plank" + ] + } + ] + } + } + }, + "requirements": [ + [ + "has_plank" + ] + ], + "rewards": { + "recipes": { + "Wood Fence_1": ["plank_3"] + } + } + }, "minicraft.advancements.recipes.lantern": { "criteria": { "has_wood": { @@ -298,6 +324,32 @@ } } }, + "minicraft.advancements.recipes.stone_fence": { + "criteria": { + "has_stone_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "stone brick" + ] + } + ] + } + } + }, + "requirements": [ + [ + "has_stone_brick" + ] + ], + "rewards": { + "recipes": { + "Stone Fence_1": ["Stone Brick_3"] + } + } + }, "minicraft.advancements.recipes.obsidian_brick": { "criteria": { "has_raw_obsidian": { @@ -402,6 +454,32 @@ } } }, + "minicraft.advancements.recipes.obsidian_fence": { + "criteria": { + "has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "obsidian brick" + ] + } + ] + } + } + }, + "requirements": [ + [ + "has_obsidian_brick" + ] + ], + "rewards": { + "recipes": { + "Obsidian Fence_1": ["Obsidian Brick_3"] + } + } + }, "minicraft.advancements.recipes.oven": { "criteria": { "has_stone": { From fc4317b33f42616e10ec65f4b987042e8dfac43f Mon Sep 17 00:00:00 2001 From: Makkkkus <37084190+Makkkkus@users.noreply.github.com> Date: Sat, 30 Dec 2023 00:02:06 +0100 Subject: [PATCH 125/261] Update build.gradle --- build.gradle | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build.gradle b/build.gradle index 8911d1700..ff66896ca 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { id 'application' + id 'maven-publish' } allprojects { @@ -97,6 +98,19 @@ jar { from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }} } +publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/MinicraftPlus/minicraft-plus-revived" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} + // Don't override if we're building a tar package. tasks.withType(Tar){ duplicatesStrategy = DuplicatesStrategy.EXCLUDE From 71577901a535d08dbf64ee5415a0115841ccae92 Mon Sep 17 00:00:00 2001 From: Makkkkus <37084190+Makkkkus@users.noreply.github.com> Date: Sat, 30 Dec 2023 01:09:33 +0100 Subject: [PATCH 126/261] publish.yml --- .github/workflows/publish.yml | 37 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c003ebe5b..8349d4ae4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,18 +1,25 @@ -name: publish -on: [workflow_dispatch] # Manual trigger +name: Publish package to GitHub Packages +on: + release: + types: [created] jobs: - build: - strategy: - matrix: - java: [ 8-jdk ] - runs-on: ubuntu-20.04 - container: - image: eclipse-temurin:${{ matrix.java }} - options: --user root + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - uses: actions/checkout@v1 - - uses: gradle/wrapper-validation-action@v1 - - run: ./gradlew publish --stacktrace + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'oracle' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 + - name: Publish package + uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 + with: + arguments: publish env: - MAVEN_PUBLISH_TOKEN: ${{ secrets.MAVEN_PUBLISH_TOKEN }} - MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} From dee874eea2f4aa9b9181972d08c8b105f4f2c698 Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Sat, 30 Dec 2023 14:32:10 +0100 Subject: [PATCH 127/261] fix incorrect tile ids --- src/client/java/minicraft/level/tile/FenceTile.java | 6 +++--- src/client/java/minicraft/level/tile/Tiles.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index 2fd0c3e0d..231933040 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -24,9 +24,9 @@ public class FenceTile extends Tile { - private static SpriteAnimation wood = new SpriteAnimation(SpriteType.Tile, "wood_fence"); - private static SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_fence"); - private static SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_fence"); + private static final SpriteAnimation wood = new SpriteAnimation(SpriteType.Tile, "wood_fence"); + private static final SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_fence"); + private static final SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_fence"); protected Material type; diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index 30856124b..393caaa2c 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -79,10 +79,10 @@ public static void initTileList() { tiles.put((short)50, new FenceTile(Tile.Material.Wood)); tiles.put((short)51, new FenceTile(Tile.Material.Stone)); tiles.put((short)52, new FenceTile(Tile.Material.Obsidian)); - tiles.put((short)50, new TomatoTile("Tomato")); - tiles.put((short)51, new CarrotTile("Carrot")); - tiles.put((short)52, new HeavenlyBerriesTile("Heavenly Berries")); - tiles.put((short)53, new HellishBerriesTile("Hellish Berries")); + tiles.put((short)53, new TomatoTile("Tomato")); + tiles.put((short)54, new CarrotTile("Carrot")); + tiles.put((short)55, new HeavenlyBerriesTile("Heavenly Berries")); + tiles.put((short)56, new HellishBerriesTile("Hellish Berries")); // WARNING: don't use this tile for anything! tiles.put((short)255, new ConnectTile()); From 0b0335e490529c52e2a6fbcaa00127675cd53965 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:02:20 +0800 Subject: [PATCH 128/261] Fix wrong enemy level in mob generation --- src/client/java/minicraft/level/Level.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 3777ecb74..2b5dfba35 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -35,6 +35,7 @@ import minicraft.level.tile.TorchTile; import minicraft.level.tile.TreeTile; import minicraft.util.Logging; +import minicraft.util.MyUtils; import java.util.ArrayList; import java.util.Arrays; @@ -607,7 +608,7 @@ private void trySpawn() { boolean spawned = false; for (Player player : players) { assert player.getLevel().depth == depth; - int lvl = World.lvlIdx(player.getLevel().depth); + int lvl = -MyUtils.clamp(player.getLevel().depth, -4, 0); for (int i = 0; i < 30 && !spawned; i++) { int rnd = random.nextInt(100); int nx = random.nextInt(w) * 16 + 8, ny = random.nextInt(h) * 16 + 8; From d97174ed0c6deaadbc6f63dc56b7793a8c51038c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:22:29 +0800 Subject: [PATCH 129/261] Add key classes for InputHandler --- src/client/java/minicraft/core/Updater.java | 48 ++--- .../java/minicraft/core/io/InputHandler.java | 186 +++++++++++++----- .../java/minicraft/entity/mob/Player.java | 4 +- .../minicraft/screen/ContainerDisplay.java | 16 +- .../minicraft/screen/CraftingDisplay.java | 2 +- src/client/java/minicraft/screen/Display.java | 4 +- .../minicraft/screen/KeyInputDisplay.java | 2 +- src/client/java/minicraft/screen/Menu.java | 16 +- .../minicraft/screen/PlayerInvDisplay.java | 6 +- .../java/minicraft/screen/PopupDisplay.java | 2 +- .../java/minicraft/screen/QuestsDisplay.java | 20 +- .../minicraft/screen/ResourcePackDisplay.java | 12 +- .../java/minicraft/screen/TitleDisplay.java | 2 +- .../screen/TutorialDisplayHandler.java | 4 +- .../minicraft/screen/WorldSelectDisplay.java | 6 +- .../minicraft/screen/entry/ArrayEntry.java | 4 +- .../minicraft/screen/entry/InputEntry.java | 6 +- .../minicraft/screen/entry/KeyInputEntry.java | 4 +- 18 files changed, 216 insertions(+), 128 deletions(-) diff --git a/src/client/java/minicraft/core/Updater.java b/src/client/java/minicraft/core/Updater.java index fb45c9e29..7e1178a62 100644 --- a/src/client/java/minicraft/core/Updater.java +++ b/src/client/java/minicraft/core/Updater.java @@ -92,19 +92,19 @@ static void updateFullscreen() { public static void tick() { // Quick Level change: move the player for -1, or 1 levels - if (isMode("minicraft.settings.mode.creative") && input.getKey("SHIFT-S").clicked ) { + if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-S").isClicked() ) { Game.setDisplay(new LevelTransitionDisplay(-1)); - } else if (isMode("minicraft.settings.mode.creative") && input.getKey("SHIFT-W").clicked ){ + } else if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-W").isClicked() ){ Game.setDisplay(new LevelTransitionDisplay(1)); } - if (input.getKey("FULLSCREEN").clicked) { + if (input.getMappedKey("FULLSCREEN").isClicked()) { Updater.FULLSCREEN = !Updater.FULLSCREEN; Updater.updateFullscreen(); } - if (input.getKey("screenshot").clicked) { + if (input.getMappedKey("screenshot").isClicked()) { screenshot++; } @@ -218,13 +218,13 @@ public static void tick() { Tile.tickCount++; } - if (currentDisplay == null && input.getKey("F3").clicked) { // Shows debug info in upper-left + if (currentDisplay == null && input.getMappedKey("F3").isClicked()) { // Shows debug info in upper-left Renderer.showDebugInfo = !Renderer.showDebugInfo; } // For debugging only { - if (input.getKey("F3-L").clicked) { + if (input.getMappedKey("F3-L").isClicked()) { // Print all players on all levels, and their coordinates. Logging.WORLD.info("Printing players on all levels."); for (Level value : levels) { @@ -234,56 +234,56 @@ public static void tick() { } // Host-only cheats. - if (input.getKey("F3-T-1").clicked) changeTimeOfDay(Time.Morning); - if (input.getKey("F3-T-2").clicked) changeTimeOfDay(Time.Day); - if (input.getKey("F3-T-3").clicked) changeTimeOfDay(Time.Evening); - if (input.getKey("F3-T-4").clicked) changeTimeOfDay(Time.Night); + if (input.getMappedKey("F3-T-1").isClicked()) changeTimeOfDay(Time.Morning); + if (input.getMappedKey("F3-T-2").isClicked()) changeTimeOfDay(Time.Day); + if (input.getMappedKey("F3-T-3").isClicked()) changeTimeOfDay(Time.Evening); + if (input.getMappedKey("F3-T-4").isClicked()) changeTimeOfDay(Time.Night); String prevMode = (String)Settings.get("mode"); - if (input.getKey("F3-F4-2").clicked) { + if (input.getMappedKey("F3-F4-2").isClicked()) { Settings.set("mode", "minicraft.settings.mode.creative"); Logging.WORLDNAMED.trace("Game mode changed from {} into {}.", prevMode, "minicraft.settings.mode.creative"); } - if (input.getKey("F3-F4-1").clicked) { + if (input.getMappedKey("F3-F4-1").isClicked()) { Settings.set("mode", "minicraft.settings.mode.survival"); Logging.WORLDNAMED.trace("Game mode changed from {} into {}.", prevMode, "minicraft.settings.mode.survival"); } - if (input.getKey("F3-F4-3").clicked) { + if (input.getMappedKey("F3-F4-3").isClicked()) { Settings.set("mode", "minicraft.settings.mode.score"); Logging.WORLDNAMED.trace("Game mode changed from {} into {}.", prevMode, "minicraft.settings.mode.score"); } - if (isMode("minicraft.settings.mode.score") && input.getKey("F3-SHIFT-T").clicked) { + if (isMode("minicraft.settings.mode.score") && input.getMappedKey("F3-SHIFT-T").isClicked()) { scoreTime = normSpeed * 5; // 5 seconds } float prevSpeed = gamespeed; - if (input.getKey("F3-S-0").clicked) { + if (input.getMappedKey("F3-S-0").isClicked()) { gamespeed = 1; Logging.WORLDNAMED.trace("Tick speed reset from {} into 1.", prevSpeed); } - if (input.getKey("F3-S-equals").clicked) { + if (input.getMappedKey("F3-S-equals").isClicked()) { if (gamespeed < 1) gamespeed *= 2; else if (normSpeed*gamespeed < 2000) gamespeed++; Logging.WORLDNAMED.trace("Tick speed increased from {} into {}.", prevSpeed, gamespeed); } - if (input.getKey("F3-S-minus").clicked) { + if (input.getMappedKey("F3-S-minus").isClicked()) { if (gamespeed > 1) gamespeed--; else if (normSpeed*gamespeed > 5) gamespeed /= 2; Logging.WORLDNAMED.trace("Tick speed decreased from {} into {}.", prevSpeed, gamespeed); } - if (input.getKey("F3-h").clicked) player.health--; - if (input.getKey("F3-b").clicked) player.hunger--; + if (input.getMappedKey("F3-h").isClicked()) player.health--; + if (input.getMappedKey("F3-b").isClicked()) player.hunger--; - if (input.getKey("F3-M-0").clicked) player.moveSpeed = 1; - if (input.getKey("F3-M-equals").clicked) player.moveSpeed++; - if (input.getKey("F3-M-minus").clicked && player.moveSpeed > 1) player.moveSpeed--; // -= 0.5D; + if (input.getMappedKey("F3-M-0").isClicked()) player.moveSpeed = 1; + if (input.getMappedKey("F3-M-equals").isClicked()) player.moveSpeed++; + if (input.getMappedKey("F3-M-minus").isClicked() && player.moveSpeed > 1) player.moveSpeed--; // -= 0.5D; - if (input.getKey("F3-u").clicked) { + if (input.getMappedKey("F3-u").isClicked()) { levels[currentLevel].setTile(player.x>>4, player.y>>4, Tiles.get("Stairs Up")); } - if (input.getKey("F3-d").clicked) { + if (input.getMappedKey("F3-d").isClicked()) { levels[currentLevel].setTile(player.x>>4, player.y>>4, Tiles.get("Stairs Down")); } } // End debug only cond. diff --git a/src/client/java/minicraft/core/io/InputHandler.java b/src/client/java/minicraft/core/io/InputHandler.java index d24b53c37..aa9c6b0ad 100644 --- a/src/client/java/minicraft/core/io/InputHandler.java +++ b/src/client/java/minicraft/core/io/InputHandler.java @@ -14,11 +14,13 @@ import java.awt.event.KeyListener; import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map.Entry; import java.util.Stack; +import java.util.function.Predicate; public class InputHandler implements KeyListener { /** @@ -84,7 +86,7 @@ public String getChangedKey() { } private HashMap keymap; // The symbolic map of actions to physical key names. - private HashMap keyboard; // The actual map of key names to Key objects. + private HashMap keyboard; // The actual map of key names to Key objects. private String lastKeyTyped = ""; // Used for things like typing world names. private String keyTypedBuffer = ""; // Used to store the last key typed before putting it into the main var during tick(). @@ -102,9 +104,9 @@ public InputHandler() { } // I'm not entirely sure if this is necessary... but it doesn't hurt. - keyboard.put("SHIFT", new Key(true)); - keyboard.put("CTRL", new Key(true)); - keyboard.put("ALT", new Key(true)); + keyboard.put("SHIFT", new PhysicalKey(true)); + keyboard.put("CTRL", new PhysicalKey(true)); + keyboard.put("ALT", new PhysicalKey(true)); controllerManager.initSDLGamepad(); controllerIndex = controllerManager.getControllerIndex(0); @@ -200,8 +202,9 @@ public void resetKeyBindings() { public void tick() { lastKeyTyped = keyTypedBuffer; keyTypedBuffer = ""; + inputMask = null; synchronized ("lock") { - for (Key key: keyboard.values()) + for (PhysicalKey key: keyboard.values()) key.tick(); // Call tick() for each key. } @@ -225,23 +228,43 @@ public void tick() { } // The Key class. - public static class Key { + public static abstract class Key { + public abstract boolean isDown(); + + public abstract boolean isClicked(); + + public String toString() { // For debugging + return "down:" + isDown() + "; clicked:" + isClicked(); + } + } + + private static class PhysicalKey extends Key { // presses = how many times the Key has been pressed. // absorbs = how many key presses have been processed. private int presses, absorbs; // down = if the key is currently physically being held down. // clicked = if the key is still being processed at the current tick. - public boolean down, clicked; + protected boolean down, clicked; // sticky = true if presses reaches 3, and the key continues to be held down. private boolean sticky; - boolean stayDown; + protected boolean stayDown; - public Key() { this(false); } - public Key(boolean stayDown) { + public PhysicalKey() { this(false); } + public PhysicalKey(boolean stayDown) { this.stayDown = stayDown; } + @Override + public boolean isDown() { + return down; + } + + @Override + public boolean isClicked() { + return clicked; + } + /** toggles the key down or not down. */ public void toggle(boolean pressed) { down = pressed; // Set down to the passed in value; the if statement is probably unnecessary... @@ -279,9 +302,64 @@ public String toString() { } } + private static class CompoundedKey extends Key { + private final HashSet keys; + + public CompoundedKey(Collection keys) { + this.keys = new HashSet<>(keys); + } + + @Override + public boolean isDown() { // All keys down. + return keys.stream().allMatch(Key::isDown); + } + + @Override + public boolean isClicked() { // If the whole key binding is clicked, then the all keys must be down and at least one of these is/are just clicked. + return isDown() && keys.stream().anyMatch(Key::isClicked); + } + } + + private static class ORKey extends Key { + private final HashSet keys; + + public ORKey(Collection keys) { + this.keys = new HashSet<>(keys); + } + + @Override + public boolean isDown() { + return keys.stream().anyMatch(Key::isDown); + } + + @Override + public boolean isClicked() { + return keys.stream().anyMatch(Key::isClicked); + } + } + + private static final Predicate maskAll = k -> true; + private static final Key keyMask = new Key() { + @Override + public boolean isDown() { + return false; + } + + @Override + public boolean isClicked() { + return false; + } + }; + private @Nullable Predicate inputMask = null; + + public void maskInput(@Nullable Predicate filter) { + if (filter == null) filter = maskAll; + inputMask = inputMask == null ? filter : inputMask.and(filter); + } + /** This is used to stop all of the actions when the game is out of focus. */ public void releaseAll() { - for (Key key: keyboard.values().toArray(new Key[0])) { + for (PhysicalKey key: keyboard.values()) { key.release(); } } @@ -331,31 +409,52 @@ public int getLastInputType() { } /// THIS is pretty much the only way you want to be interfacing with this class; it has all the auto-create and protection functions and such built-in. - public Key getKey(String keytext) { return getKey(keytext, true); } - private Key getKey(String keytext, boolean getFromMap) { - // If the passed-in key is blank, or null, then return null. - if (keytext == null || keytext.length() == 0) return new Key(); + // For mapped keys + public Key getMappedKey(String keyText) { + keyText = keyText.toUpperCase(java.util.Locale.ENGLISH); // Prevent errors due to improper "casing" + synchronized ("lock") { + // If the passed-in key equals one in keymap, then replace it with its match, a key in keyboard. + if (keymap.containsKey(keyText)) // If false, we assume that keytext is a physical key. + keyText = keymap.get(keyText); // Converts action name to physical key name + } - keytext = keytext.toUpperCase(java.util.Locale.ENGLISH); // Prevent errors due to improper "casing" + if (keyText.contains("|")) { + /// Multiple key possibilities exist for this action; so, combine the results of each one! + ArrayList keys = new ArrayList<>(); + for (String keyposs: keyText.split("\\|")) { // String.split() uses regex, and "|" is a special character, so it must be escaped; but the backslash must be passed in, so it needs escaping. + // It really does combine using "or": + keys.add(getMappedKey(keyposs)); + } + return new ORKey(keys); + } + + // Complex compound key binding support. + HashSet keys = new HashSet<>(); synchronized ("lock") { - if(getFromMap) { // If false, we assume that keytext is a physical key. - // If the passed-in key equals one in keymap, then replace it with it's match, a key in keyboard. - if (keymap.containsKey(keytext)) - keytext = keymap.get(keytext); // Converts action name to physical key name + String[] split = keyText.split("\\+"); + for (String s : split) { + keys.add(getKey(s)); } } + //if(key.clicked && Game.debug) System.out.println("Processed key: " + keytext + " is clicked; tickNum=" + ticks); + return new CompoundedKey(keys); // Return the Key object. + } + // Physical keys only + private Key getKey(String keytext) { + // If the passed-in key is blank, or null, then return null. + if (keytext == null || keytext.isEmpty()) return keyMask; + + keytext = keytext.toUpperCase(java.util.Locale.ENGLISH); // Prevent errors due to improper "casing" + if (keytext.contains("|")) { /// Multiple key possibilities exist for this action; so, combine the results of each one! - Key key = new Key(); + ArrayList keys = new ArrayList<>(); for (String keyposs: keytext.split("\\|")) { // String.split() uses regex, and "|" is a special character, so it must be escaped; but the backslash must be passed in, so it needs escaping. - Key aKey = getKey(keyposs, false); // This time, do NOT attempt to fetch from keymap. - // It really does combine using "or": - key.down = key.down || aKey.down; - key.clicked = key.clicked || aKey.clicked; + keys.add(getKey(keyposs)); } - return key; + return new ORKey(keys); } // Complex compound key binding support. @@ -364,10 +463,11 @@ private Key getKey(String keytext, boolean getFromMap) { String[] split = keytext.split("-"); for (String s : split) { if (keyboard.containsKey(s)) - keys.add(keyboard.get(s)); // Gets the key object from keyboard, if if exists. + // Gets the key object from keyboard, if it exists. + keys.add(inputMask == null || !inputMask.test(s) ? keyboard.get(s) : keyMask); else { // If the specified key does not yet exist in keyboard, then create a new Key, and put it there. - Key key = new Key(); // Make new key + PhysicalKey key = new PhysicalKey(); // Make new key keyboard.put(s, key); // Add it to keyboard keys.add(key); @@ -376,17 +476,11 @@ private Key getKey(String keytext, boolean getFromMap) { } } - //if(key.clicked && Game.debug) System.out.println("Processed key: " + keytext + " is clicked; tickNum=" + ticks); + // Returns the key itself if there is only one key. + if (keys.size() == 1) return keys.iterator().next(); - Key key = new Key(); - key.down = true; // The set is not empty, so this will not be returned directly. - key.clicked = false; - return keys.stream().reduce(key, (k0, k1) -> { - k0.down = k0.down && k1.down; // All keys down. - // If the whole key binding is clicked, then the all keys must be down and at least one of these is/are just clicked. - k0.clicked = k0.down && (k0.clicked || k1.clicked); - return k0; - }); // Return the Key object. + //if(key.clicked && Game.debug) System.out.println("Processed key: " + keytext + " is clicked; tickNum=" + ticks); + return new CompoundedKey(keys); // Return the Key object. } /// This method provides a way to press physical keys without actually generating a key event. @@ -400,7 +494,7 @@ public ArrayList getAllPressedKeys() { ArrayList keyList = new ArrayList<>(keyboard.size()); synchronized ("lock") { - for (Entry entry : keyboard.entrySet()) { + for (Entry entry : keyboard.entrySet()) { if (entry.getValue().down) { keyList.add(entry.getKey()); } @@ -411,14 +505,14 @@ public ArrayList getAllPressedKeys() { } /// This gets a key from key text, w/o adding to the key list. - private Key getPhysKey(String keytext) { + private PhysicalKey getPhysKey(String keytext) { keytext = keytext.toUpperCase(); if (keyboard.containsKey(keytext)) return keyboard.get(keytext); else { //System.out.println("UNKNOWN KEYBOARD KEY: " + keytext); // it's okay really; was just checking - return new Key(); // Won't matter where I'm calling it. + return new PhysicalKey(); // Won't matter where I'm calling it. } } @@ -486,9 +580,9 @@ private static boolean isMod(String keyname) { } private String getCurModifiers() { - return (getKey("ctrl").down ? "CTRL-" : "") + - (getKey("alt").down ? "ALT-" : "") + - (getKey("shift").down ? "SHIFT-" : ""); + return (getKey("ctrl").isDown() ? "CTRL-" : "") + + (getKey("alt").isDown() ? "ALT-" : "") + + (getKey("shift").isDown() ? "SHIFT-" : ""); } /** Used by Save.java, to save user key preferences. */ @@ -580,12 +674,12 @@ public ArrayList getAllPressedButtons() { public boolean inputPressed(String mapping) { mapping = mapping.toUpperCase(java.util.Locale.ENGLISH); - return getKey(mapping).clicked || (buttonMap.containsKey(mapping) && buttonPressed(buttonMap.get(mapping))); + return getMappedKey(mapping).isClicked() || (buttonMap.containsKey(mapping) && buttonPressed(buttonMap.get(mapping))); } public boolean inputDown(String mapping) { mapping = mapping.toUpperCase(java.util.Locale.ENGLISH); - return getKey(mapping).down || (buttonMap.containsKey(mapping) && buttonDown(buttonMap.get(mapping))); + return getMappedKey(mapping).isDown() || (buttonMap.containsKey(mapping) && buttonDown(buttonMap.get(mapping))); } /** diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index a21c083f5..f5b168199 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -267,10 +267,10 @@ public void addPotionEffect(PotionType type) { public void tick() { if (level == null || isRemoved()) return; if (Game.getDisplay() != null) return; // Don't tick player when menu is open - if (input.getKey("F3-Y").clicked) { + if (input.getMappedKey("F3-Y").isClicked()) { World.scheduleLevelChange(1); return; - } else if (input.getKey("F3-H").clicked) { + } else if (input.getMappedKey("F3-H").isClicked()) { World.scheduleLevelChange(-1); return; } diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 3912f0f93..3b14a3d00 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -20,7 +20,7 @@ public class ContainerDisplay extends Display { public ContainerDisplay(Player player, Chest chest) { super( - new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT), + new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT), new InventoryMenu(chest, chest.getInventory(), chest.name, RelPos.RIGHT) ); @@ -44,14 +44,14 @@ public ContainerDisplay(Player player, Chest chest) { @Override protected void onSelectionChange(int oldSel, int newSel) { super.onSelectionChange(oldSel, newSel); - + if (oldSel == newSel) return; // this also serves as a protection against access to menus[0] when such may not exist. - + int shift = 0; - + if (newSel == 0) shift = padding - menus[0].getBounds().getLeft(); if (newSel == 1) shift = (Screen.w - padding) - menus[1].getBounds().getRight(); - + for (Menu m: menus) { m.translate(shift, 0); } @@ -95,7 +95,7 @@ public void tick(InputHandler input) { if (!acted) curMenu.tick(input); - if (input.getKey("menu").clicked || chest.isRemoved()) { + if (input.getMappedKey("menu").isClicked() || chest.isRemoved()) { Game.setDisplay(null); return; } @@ -110,7 +110,7 @@ public void tick(InputHandler input) { } if (mainMethod || !onScreenKeyboardMenu.isVisible()) - if (input.inputPressed("attack") || input.getKey("shift-enter").clicked) { + if (input.inputPressed("attack") || input.getMappedKey("shift-enter").isClicked()) { if (curMenu.getEntries().length == 0) return; // switch inventories @@ -128,7 +128,7 @@ public void tick(InputHandler input) { Item fromItem = from.get(fromSel); - boolean transferAll = input.getKey("shift-enter").clicked || !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; + boolean transferAll = input.getMappedKey("shift-enter").isClicked() || !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; Item toItem = fromItem.copy(); diff --git a/src/client/java/minicraft/screen/CraftingDisplay.java b/src/client/java/minicraft/screen/CraftingDisplay.java index 1957c3f62..2432335e8 100644 --- a/src/client/java/minicraft/screen/CraftingDisplay.java +++ b/src/client/java/minicraft/screen/CraftingDisplay.java @@ -134,7 +134,7 @@ public void tick(InputHandler input) { if (!acted) recipeMenu.tick(input); - if (input.getKey("menu").clicked || (isPersonalCrafter && input.inputPressed("craft"))) { + if (input.getMappedKey("menu").isClicked() || (isPersonalCrafter && input.inputPressed("craft"))) { Game.exitDisplay(); return; } diff --git a/src/client/java/minicraft/screen/Display.java b/src/client/java/minicraft/screen/Display.java index e2528438e..d02ecdc31 100644 --- a/src/client/java/minicraft/screen/Display.java +++ b/src/client/java/minicraft/screen/Display.java @@ -56,8 +56,8 @@ public void tick(InputHandler input) { int prevSel = selection; String shift = menus[selection].getCurEntry() instanceof ArrayEntry ? "shift-" : ""; - if (input.getKey(shift+"left").clicked || input.leftTriggerPressed()) selection--; - if (input.getKey(shift+"right").clicked || input.rightTriggerPressed()) selection++; + if (input.getMappedKey(shift+"left").isClicked() || input.leftTriggerPressed()) selection--; + if (input.getMappedKey(shift+"right").isClicked() || input.rightTriggerPressed()) selection++; if (prevSel != selection) { Sound.play("select"); diff --git a/src/client/java/minicraft/screen/KeyInputDisplay.java b/src/client/java/minicraft/screen/KeyInputDisplay.java index 4c4de4c6e..59759f9a8 100644 --- a/src/client/java/minicraft/screen/KeyInputDisplay.java +++ b/src/client/java/minicraft/screen/KeyInputDisplay.java @@ -76,7 +76,7 @@ public void tick(InputHandler input) { Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig(null, callbacks, 4), StringEntry.useLines(Color.YELLOW, "minicraft.displays.key_input.popup_display.press_key_sequence"))); - } else if (input.getKey("shift-d").clicked) { + } else if (input.getMappedKey("shift-d").isClicked()) { ArrayList callbacks = new ArrayList<>(); callbacks.add(new PopupDisplay.PopupActionCallback("select", popup -> { input.resetKeyBindings(); diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index 21738dbad..50701ec62 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -172,18 +172,18 @@ public void tick(InputHandler input) { int prevSel = selection; if (input.inputPressed("cursor-up")) selection--; if (input.inputPressed("cursor-down")) selection++; - if (input.getKey("shift-cursor-up").clicked && selectionSearcher == 0) selectionSearcher -= 2; - if (input.getKey("shift-cursor-down").clicked && selectionSearcher == 0) selectionSearcher += 2; + if (input.getMappedKey("shift+cursor-up").isClicked() && selectionSearcher == 0) selectionSearcher -= 2; + if (input.getMappedKey("shift+cursor-down").isClicked() && selectionSearcher == 0) selectionSearcher += 2; if (prevSel != selection && selectionSearcher != 0) selection = prevSel; if (useSearcherBar) { - if (input.getKey("searcher-bar").clicked) { + if (input.getMappedKey("searcher-bar").isClicked()) { searcherBarActive = !searcherBarActive; input.addKeyTyped("", null); // clear pressed key } if (!listSearcher.isEmpty() && selectionSearcher == 0) { - int speed = input.getKey("PAGE-UP").clicked ? -1 : input.getKey("PAGE-DOWN").clicked ? 1 : 0; + int speed = input.getMappedKey("PAGE-UP").isClicked() ? -1 : input.getMappedKey("PAGE-DOWN").isClicked() ? 1 : 0; if (speed != 0) { int listPosition = listPositionSearcher + speed; if (listPosition < 0) { @@ -199,13 +199,7 @@ public void tick(InputHandler input) { if (searcherBarActive) { String typingSearcher = input.addKeyTyped(this.typingSearcher, null); - for (String pressedKey : input.getAllPressedKeys()) { - if (pressedKey.equals("ENTER")) { - continue; - } - - input.getKey(pressedKey).clicked = false; - } + input.maskInput(k -> !k.equals("ENTER")); // check if word was updated if (typingSearcher.length() <= Menu.LIMIT_TYPING_SEARCHER && typingSearcher.length() != this.typingSearcher.length()) { diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index c152accc1..9a89932a2 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -100,7 +100,7 @@ public void tick(InputHandler input) { if (!acted) curMenu.tick(input); - if (input.getKey("menu").clicked) { // Should not listen button press. + if (input.getMappedKey("menu").isClicked()) { // Should not listen button press. Game.exitDisplay(); return; } @@ -135,9 +135,9 @@ public void tick(InputHandler input) { Item fromItem = from.get(fromSel); boolean deleteAll; - if (input.getKey("SHIFT-D").clicked || input.buttonPressed(ControllerButton.Y)) { + if (input.getMappedKey("SHIFT-D").isClicked() || input.buttonPressed(ControllerButton.Y)) { deleteAll = true; - } else if (input.getKey("D").clicked || input.buttonPressed(ControllerButton.X)) { + } else if (input.getMappedKey("D").isClicked() || input.buttonPressed(ControllerButton.X)) { deleteAll = !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; } else return; diff --git a/src/client/java/minicraft/screen/PopupDisplay.java b/src/client/java/minicraft/screen/PopupDisplay.java index 80142eeee..d1597a2bf 100644 --- a/src/client/java/minicraft/screen/PopupDisplay.java +++ b/src/client/java/minicraft/screen/PopupDisplay.java @@ -105,7 +105,7 @@ public void tick(InputHandler input) { private boolean tickCallbacks(InputHandler input) { if (callbacks != null) { for (PopupActionCallback callback : callbacks) { - if (callback.key == null || input.getKey(callback.key).clicked) { + if (callback.key == null || input.getMappedKey(callback.key).isClicked()) { if (callback.callback != null && callback.callback.acts(menus[0])) { // This overrides the original #tick check. return true; diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index c871b79da..9873a76c7 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -427,22 +427,22 @@ public void tick(InputHandler input) { super.tick(input); if (questsTree.length > 0) { - if (input.getKey("shift").down) { // Browsing mode. + if (input.getMappedKey("shift").isDown()) { // Browsing mode. inBrowsing = true; - if (input.getKey("shift-down").clicked) + if (input.getMappedKey("shift-down").isClicked()) yScroll += 3; - else if (input.getKey("shift-up").clicked) + else if (input.getMappedKey("shift-up").isClicked()) yScroll -= 3; - else if (input.getKey("shift-right").clicked) + else if (input.getMappedKey("shift-right").isClicked()) xScroll += 3; - else if (input.getKey("shift-left").clicked) + else if (input.getMappedKey("shift-left").isClicked()) xScroll -= 3; } else { if (inBrowsing) { scrollIfNeeded(); inBrowsing = false; } - if (input.getKey("cursor-down").clicked) { + if (input.getMappedKey("cursor-down").isClicked()) { if (cursorY < questsTree.length - 1) { cursorY++; if (cursorX >= questsTree[cursorY].length) @@ -450,7 +450,7 @@ else if (input.getKey("shift-left").clicked) Sound.play("select"); scrollIfNeeded(); } - } else if (input.getKey("cursor-up").clicked) { + } else if (input.getMappedKey("cursor-up").isClicked()) { if (cursorY > 0) { cursorY--; if (cursorX >= questsTree[cursorY].length) @@ -458,19 +458,19 @@ else if (input.getKey("shift-left").clicked) Sound.play("select"); scrollIfNeeded(); } - } else if (input.getKey("cursor-right").clicked) { + } else if (input.getMappedKey("cursor-right").isClicked()) { if (cursorX < questsTree[cursorY].length - 1) { cursorX++; Sound.play("select"); scrollIfNeeded(); } - } else if (input.getKey("cursor-left").clicked) { + } else if (input.getMappedKey("cursor-left").isClicked()) { if (cursorX > 0) { cursorX--; Sound.play("select"); scrollIfNeeded(); } - } else if (input.getKey("select").clicked) { + } else if (input.getMappedKey("select").isClicked()) { Sound.play("confirm"); Game.setDisplay(new QuestInformationDisplay(questsTree[cursorY][cursorX])); } diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index e7fd1822a..0ba490451 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -322,21 +322,21 @@ public void onExit() { @Override public void tick(InputHandler input) { // Overrides the default tick handler. - if (input.getKey("right").clicked) { // Move cursor to the second list. + if (input.getMappedKey("right").isClicked()) { // Move cursor to the second list. if (selection == 0) { Sound.play("select"); onSelectionChange(0, 1); } return; - } else if (input.getKey("left").clicked) { // Move cursor to the first list. + } else if (input.getMappedKey("left").isClicked()) { // Move cursor to the first list. if (selection == 1) { Sound.play("select"); onSelectionChange(1, 0); } return; - } else if (input.getKey("shift-right").clicked) { // Move the selected pack to the second list. + } else if (input.getMappedKey("shift-right").isClicked()) { // Move the selected pack to the second list. if (selection == 0 && resourcePacks.size() > 0) { loadedPacks.add(loadedPacks.indexOf(defaultPack), resourcePacks.remove(menus[0].getSelection())); changed = true; @@ -345,7 +345,7 @@ public void tick(InputHandler input) { } return; - } else if (input.getKey("shift-left").clicked) { // Move the selected pack to the first list. + } else if (input.getMappedKey("shift-left").isClicked()) { // Move the selected pack to the first list. if (selection == 1 && loadedPacks.get(menus[1].getSelection()) != defaultPack) { resourcePacks.add(loadedPacks.remove(menus[1].getSelection())); changed = true; @@ -354,7 +354,7 @@ public void tick(InputHandler input) { } return; - } else if (input.getKey("shift-up").clicked) { // Move up the selected pack in the second list. + } else if (input.getMappedKey("shift-up").isClicked()) { // Move up the selected pack in the second list. if (selection == 1 && menus[1].getSelection() > 0) { if (loadedPacks.get(menus[1].getSelection()) == defaultPack) return; // Default pack remains bottom. loadedPacks.add(menus[1].getSelection() - 1, loadedPacks.remove(menus[1].getSelection())); @@ -364,7 +364,7 @@ public void tick(InputHandler input) { } return; - } else if (input.getKey("shift-down").clicked) { // Move down the selected pack in the second list. + } else if (input.getMappedKey("shift-down").isClicked()) { // Move down the selected pack in the second list. if (selection == 1 && menus[1].getSelection() < loadedPacks.size() - 1) { if (loadedPacks.get(menus[1].getSelection() + 1) == defaultPack) return; // Default pack remains bottom. loadedPacks.add(menus[1].getSelection() + 1, loadedPacks.remove(menus[1].getSelection())); diff --git a/src/client/java/minicraft/screen/TitleDisplay.java b/src/client/java/minicraft/screen/TitleDisplay.java index 4fc688322..6459e3a91 100644 --- a/src/client/java/minicraft/screen/TitleDisplay.java +++ b/src/client/java/minicraft/screen/TitleDisplay.java @@ -105,7 +105,7 @@ private void checkVersion() { @Override public void tick(InputHandler input) { - if (input.getKey("F3-r").clicked) rand = random.nextInt(splashes.length - 3) + 3; + if (input.getMappedKey("F3-r").isClicked()) rand = random.nextInt(splashes.length - 3) + 3; super.tick(input); } diff --git a/src/client/java/minicraft/screen/TutorialDisplayHandler.java b/src/client/java/minicraft/screen/TutorialDisplayHandler.java index 1e86d9ea0..7c7ac5f5b 100644 --- a/src/client/java/minicraft/screen/TutorialDisplayHandler.java +++ b/src/client/java/minicraft/screen/TutorialDisplayHandler.java @@ -166,7 +166,7 @@ private static void turnOffGuides() { public static void tick(InputHandler input) { if (currentGuide != null) { if (ControlGuide.animation > 0) ControlGuide.animation--; - if (input.getKey("expandQuestDisplay").clicked) { + if (input.getMappedKey("expandQuestDisplay").isClicked()) { Logging.TUTORIAL.debug("Force-completed the guides."); turnOffGuides(); return; @@ -188,7 +188,7 @@ public static void tick(InputHandler input) { } if (currentOngoingElement != null) { - if (input.getKey("expandQuestDisplay").clicked && Game.getDisplay() == null) { + if (input.getMappedKey("expandQuestDisplay").isClicked() && Game.getDisplay() == null) { Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig(currentOngoingElement.key, null, 4), currentOngoingElement.description)); } diff --git a/src/client/java/minicraft/screen/WorldSelectDisplay.java b/src/client/java/minicraft/screen/WorldSelectDisplay.java index 82f47f654..5b0b4255a 100644 --- a/src/client/java/minicraft/screen/WorldSelectDisplay.java +++ b/src/client/java/minicraft/screen/WorldSelectDisplay.java @@ -80,7 +80,7 @@ private void updateEntries() { public void tick(InputHandler input) { super.tick(input); - if (input.getKey("SHIFT-C").clicked || input.buttonPressed(ControllerButton.LEFTBUMPER)) { + if (input.getMappedKey("SHIFT-C").isClicked() || input.buttonPressed(ControllerButton.LEFTBUMPER)) { ArrayList entries = new ArrayList<>(); ArrayList names = WorldSelectDisplay.getWorldNames(); entries.add(new StringEntry("minicraft.displays.world_select.popups.display.change", Color.BLUE)); @@ -127,7 +127,7 @@ public void tick(InputHandler input) { })); Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig(null, callbacks, 0), entries.toArray(new ListEntry[0]))); - } else if (input.getKey("SHIFT-R").clicked || input.buttonPressed(ControllerButton.RIGHTBUMPER)) { + } else if (input.getMappedKey("SHIFT-R").isClicked() || input.buttonPressed(ControllerButton.RIGHTBUMPER)) { ArrayList entries = new ArrayList<>(); ArrayList names = WorldSelectDisplay.getWorldNames(); names.remove(worldName); @@ -173,7 +173,7 @@ public void tick(InputHandler input) { })); Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig(null, callbacks, 0), entries.toArray(new ListEntry[0]))); - } else if (input.getKey("SHIFT-D").clicked || input.leftTriggerPressed() && input.rightTriggerPressed()) { + } else if (input.getMappedKey("SHIFT-D").isClicked() || input.leftTriggerPressed() && input.rightTriggerPressed()) { ArrayList entries = new ArrayList<>(); entries.addAll(Arrays.asList(StringEntry.useLines(Color.RED, Localization.getLocalized("minicraft.displays.world_select.popups.display.delete", Color.toStringCode(Color.tint(Color.RED, 1, true)), worldNames.get(menus[0].getSelection()), diff --git a/src/client/java/minicraft/screen/entry/ArrayEntry.java b/src/client/java/minicraft/screen/entry/ArrayEntry.java index e1b33dae2..98431cf5f 100644 --- a/src/client/java/minicraft/screen/entry/ArrayEntry.java +++ b/src/client/java/minicraft/screen/entry/ArrayEntry.java @@ -96,8 +96,8 @@ public void tick(InputHandler input) { int selection = this.selection; if (this instanceof RangeEntry) { - if (input.inputPressed("cursor-left")) selection -= input.getKey("ALT").down ? 10 : 1; - if (input.inputPressed("cursor-right")) selection += input.getKey("ALT").down ? 10 : 1; + if (input.inputPressed("cursor-left")) selection -= input.getMappedKey("ALT").isDown() ? 10 : 1; + if (input.inputPressed("cursor-right")) selection += input.getMappedKey("ALT").isDown() ? 10 : 1; } else { if (input.inputPressed("cursor-left")) selection--; if (input.inputPressed("cursor-right")) selection++; diff --git a/src/client/java/minicraft/screen/entry/InputEntry.java b/src/client/java/minicraft/screen/entry/InputEntry.java index 0ca8aab3c..df32e3ba8 100644 --- a/src/client/java/minicraft/screen/entry/InputEntry.java +++ b/src/client/java/minicraft/screen/entry/InputEntry.java @@ -42,14 +42,14 @@ public void tick(InputHandler input) { if (maxLength > 0 && userInput.length() > maxLength) userInput = userInput.substring(0, maxLength); // truncates extra - if (input.getKey("CTRL-V").clicked) { + if (input.getMappedKey("CTRL-V").isClicked()) { userInput = userInput + clipboardHandler.getClipboardContents(); } if (!userInput.equals("")) { - if (input.getKey("CTRL-C").clicked) { + if (input.getMappedKey("CTRL-C").isClicked()) { clipboardHandler.setClipboardContents(userInput); } - if (input.getKey("CTRL-X").clicked) { + if (input.getMappedKey("CTRL-X").isClicked()) { clipboardHandler.setClipboardContents(userInput); userInput = ""; } diff --git a/src/client/java/minicraft/screen/entry/KeyInputEntry.java b/src/client/java/minicraft/screen/entry/KeyInputEntry.java index c75fec687..a21bb8049 100644 --- a/src/client/java/minicraft/screen/entry/KeyInputEntry.java +++ b/src/client/java/minicraft/screen/entry/KeyInputEntry.java @@ -39,9 +39,9 @@ private void setMapping(String mapping, Set duplicated) { @Override public void tick(InputHandler input) { - if (input.getKey("c").clicked || input.getKey("enter").clicked) + if (input.getMappedKey("c").isClicked() || input.getMappedKey("enter").isClicked()) input.changeKeyBinding(action); - else if (input.getKey("a").clicked) + else if (input.getMappedKey("a").isClicked()) // Add a binding, don't remove previous. input.addKeyBinding(action); } From d34c2063dc5adc45f85ce71cea11c549b5ef0427 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:32:12 +0800 Subject: [PATCH 130/261] Generalized mapping support for some keys --- .../java/minicraft/core/io/InputHandler.java | 2 +- .../minicraft/screen/ContainerDisplay.java | 4 +-- .../java/minicraft/screen/QuestsDisplay.java | 8 ++--- .../minicraft/screen/ResourcePackDisplay.java | 36 +++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/client/java/minicraft/core/io/InputHandler.java b/src/client/java/minicraft/core/io/InputHandler.java index aa9c6b0ad..d7037ced3 100644 --- a/src/client/java/minicraft/core/io/InputHandler.java +++ b/src/client/java/minicraft/core/io/InputHandler.java @@ -433,7 +433,7 @@ public Key getMappedKey(String keyText) { synchronized ("lock") { String[] split = keyText.split("\\+"); for (String s : split) { - keys.add(getKey(s)); + keys.add(getKey(keymap.getOrDefault(s, s))); } } diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 3b14a3d00..5fc031384 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -110,7 +110,7 @@ public void tick(InputHandler input) { } if (mainMethod || !onScreenKeyboardMenu.isVisible()) - if (input.inputPressed("attack") || input.getMappedKey("shift-enter").isClicked()) { + if (input.inputPressed("attack")) { if (curMenu.getEntries().length == 0) return; // switch inventories @@ -128,7 +128,7 @@ public void tick(InputHandler input) { Item fromItem = from.get(fromSel); - boolean transferAll = input.getMappedKey("shift-enter").isClicked() || !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; + boolean transferAll = input.getMappedKey("shift").isDown() || !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; Item toItem = fromItem.copy(); diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index 9873a76c7..98841a634 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -429,13 +429,13 @@ public void tick(InputHandler input) { if (questsTree.length > 0) { if (input.getMappedKey("shift").isDown()) { // Browsing mode. inBrowsing = true; - if (input.getMappedKey("shift-down").isClicked()) + if (input.getMappedKey("shift+cursor-down").isClicked()) yScroll += 3; - else if (input.getMappedKey("shift-up").isClicked()) + else if (input.getMappedKey("shift+cursor-up").isClicked()) yScroll -= 3; - else if (input.getMappedKey("shift-right").isClicked()) + else if (input.getMappedKey("shift+cursor-right").isClicked()) xScroll += 3; - else if (input.getMappedKey("shift-left").isClicked()) + else if (input.getMappedKey("shift+cursor-left").isClicked()) xScroll -= 3; } else { if (inBrowsing) { diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index 0ba490451..039c89330 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -322,21 +322,7 @@ public void onExit() { @Override public void tick(InputHandler input) { // Overrides the default tick handler. - if (input.getMappedKey("right").isClicked()) { // Move cursor to the second list. - if (selection == 0) { - Sound.play("select"); - onSelectionChange(0, 1); - } - - return; - } else if (input.getMappedKey("left").isClicked()) { // Move cursor to the first list. - if (selection == 1) { - Sound.play("select"); - onSelectionChange(1, 0); - } - - return; - } else if (input.getMappedKey("shift-right").isClicked()) { // Move the selected pack to the second list. + if (input.getMappedKey("shift+cursor-right").isClicked()) { // Move the selected pack to the second list. if (selection == 0 && resourcePacks.size() > 0) { loadedPacks.add(loadedPacks.indexOf(defaultPack), resourcePacks.remove(menus[0].getSelection())); changed = true; @@ -345,7 +331,7 @@ public void tick(InputHandler input) { } return; - } else if (input.getMappedKey("shift-left").isClicked()) { // Move the selected pack to the first list. + } else if (input.getMappedKey("shift+cursor-left").isClicked()) { // Move the selected pack to the first list. if (selection == 1 && loadedPacks.get(menus[1].getSelection()) != defaultPack) { resourcePacks.add(loadedPacks.remove(menus[1].getSelection())); changed = true; @@ -354,7 +340,7 @@ public void tick(InputHandler input) { } return; - } else if (input.getMappedKey("shift-up").isClicked()) { // Move up the selected pack in the second list. + } else if (input.getMappedKey("shift+cursor-up").isClicked()) { // Move up the selected pack in the second list. if (selection == 1 && menus[1].getSelection() > 0) { if (loadedPacks.get(menus[1].getSelection()) == defaultPack) return; // Default pack remains bottom. loadedPacks.add(menus[1].getSelection() - 1, loadedPacks.remove(menus[1].getSelection())); @@ -364,7 +350,7 @@ public void tick(InputHandler input) { } return; - } else if (input.getMappedKey("shift-down").isClicked()) { // Move down the selected pack in the second list. + } else if (input.getMappedKey("shift+cursor-down").isClicked()) { // Move down the selected pack in the second list. if (selection == 1 && menus[1].getSelection() < loadedPacks.size() - 1) { if (loadedPacks.get(menus[1].getSelection() + 1) == defaultPack) return; // Default pack remains bottom. loadedPacks.add(menus[1].getSelection() + 1, loadedPacks.remove(menus[1].getSelection())); @@ -373,6 +359,20 @@ public void tick(InputHandler input) { Sound.play("select"); } + return; + } else if (input.getMappedKey("cursor-right").isClicked()) { // Move cursor to the second list. + if (selection == 0) { + Sound.play("select"); + onSelectionChange(0, 1); + } + + return; + } else if (input.getMappedKey("cursor-left").isClicked()) { // Move cursor to the first list. + if (selection == 1) { + Sound.play("select"); + onSelectionChange(1, 0); + } + return; } From 590a6f8b4acdb5fe6037d573b8d5b86e8c9a500f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:47:40 +0800 Subject: [PATCH 131/261] Increment version to 2.2.0-dev4 --- build.gradle | 2 +- src/client/java/minicraft/core/Game.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8911d1700..3c1e4c6ee 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev3" + version = "2.2.0-dev4" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 8fc3f1e7a..544d6de12 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() {} // Can't instantiate the Game class. public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev3"); + public static final Version VERSION = new Version("2.2.0-dev4"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From 6a3237b97371a13c15f13fc0c11dfd7fd0ce0cc4 Mon Sep 17 00:00:00 2001 From: El-Virus <36414402+El-Virus@users.noreply.github.com> Date: Sat, 30 Dec 2023 15:57:50 +0000 Subject: [PATCH 132/261] Change square braces to angular braces for dir in README Just because of convention --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 274f59a34..c16169dbf 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Because this project uses a build tool called gradle it is very easy to build or 1. Download the source code by clicking the green code button, and download it as a ZIP. 2. Extract the contents of the folder. -3. Open command prompt and enter `cd [folder_location]`, this will open the folder in the command prompt. +3. Open command prompt and enter `cd `, this will open the folder in the command prompt. 4. Type `gradlew run` or `gradlew build` to run or build the program. This might take some time. If on unix, add "./" to the front. 1. If you built the project, the jar file is found in `build/libs` 2. If you get an error screaming that you're missing java. You need to [set up](https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html) your JAVA_HOME environment variable, or download a JDK if you haven't already. From bc86433b86edd7d7b9be624465c7bc1547f32533 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 30 Dec 2023 22:55:39 +0800 Subject: [PATCH 133/261] Update ChangeLog.md --- ChangeLog.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 932775048..68880e22c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -38,6 +38,8 @@ but some sections are changed to compliant this project. * Added ability to dye sheep and beds (#445) * Cow and sheep now graze on grasses * Added a trigger to auto-enable hardware acceleration +* Added support for lower-cased letters +* Added item description menu ### Changes @@ -48,8 +50,9 @@ but some sections are changed to compliant this project. * If the application flag `--savedir` is present, '.playminicraft/mods/Minecraft Plus' will no longer be appended * Updated all ore-related and metal-related textures * Made the parent display render in the background -* Made recipies unlockable +* Made recipes unlockable * Made you reobtain your old clothes when putting on new clothing +* Made you reobtain empty bottles when a bottle of potion is consumed * Made languages fallback to English * Improved the tile place indicator * Overhauled debugging actions @@ -57,6 +60,8 @@ but some sections are changed to compliant this project. * Changed the languaging setting menu * Optimized CPU usage * Reduced food stamina cost +* Made some strings lower-cased +* Updated spawning and despawning conditions ### Removals From e0628ca6e22450b5653736c43deeee2575117735 Mon Sep 17 00:00:00 2001 From: Litorom Date: Sat, 30 Dec 2023 11:15:36 -0500 Subject: [PATCH 134/261] Converted to LF line separator --- .editorconfig | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 6 +- .github/workflows/autobuild.yml | 46 +- .github/workflows/codeql-analysis.yml | 54 +- .github/workflows/publish.yml | 2 +- ChangeLog.md | 7 +- Credits.md | 6 + README.md | 49 +- build.gradle | 6 +- settings.gradle | 2 +- src/client/java/minicraft/core/Action.java | 4 +- .../java/minicraft/core/CrashHandler.java | 101 +++- src/client/java/minicraft/core/Game.java | 25 +- .../java/minicraft/core/Initializer.java | 55 +- src/client/java/minicraft/core/Renderer.java | 10 +- src/client/java/minicraft/core/Updater.java | 42 +- src/client/java/minicraft/core/World.java | 58 +- .../minicraft/core/io/ClipboardHandler.java | 38 +- .../java/minicraft/core/io/FileHandler.java | 16 +- .../java/minicraft/core/io/InputHandler.java | 132 +++-- .../java/minicraft/core/io/Localization.java | 26 +- .../java/minicraft/core/io/Settings.java | 22 +- src/client/java/minicraft/core/io/Sound.java | 28 +- src/client/java/minicraft/entity/Arrow.java | 16 +- .../java/minicraft/entity/ClientTickable.java | 4 +- .../java/minicraft/entity/Direction.java | 19 +- src/client/java/minicraft/entity/Entity.java | 139 +++-- .../java/minicraft/entity/FireSpark.java | 13 +- .../java/minicraft/entity/ItemEntity.java | 31 +- .../java/minicraft/entity/ItemHolder.java | 4 +- src/client/java/minicraft/entity/Spark.java | 15 +- .../java/minicraft/entity/Tickable.java | 4 +- .../java/minicraft/entity/furniture/Bed.java | 22 +- .../minicraft/entity/furniture/Chest.java | 14 +- .../minicraft/entity/furniture/Crafter.java | 18 +- .../entity/furniture/DeathChest.java | 25 +- .../entity/furniture/DungeonChest.java | 12 +- .../minicraft/entity/furniture/Furniture.java | 46 +- .../entity/furniture/KnightStatue.java | 9 +- .../minicraft/entity/furniture/Lantern.java | 7 +- .../minicraft/entity/furniture/Spawner.java | 49 +- .../java/minicraft/entity/furniture/Tnt.java | 34 +- .../java/minicraft/entity/mob/AirWizard.java | 33 +- src/client/java/minicraft/entity/mob/Cow.java | 15 +- .../java/minicraft/entity/mob/Creeper.java | 15 +- .../java/minicraft/entity/mob/EnemyMob.java | 47 +- .../java/minicraft/entity/mob/Knight.java | 5 +- src/client/java/minicraft/entity/mob/Mob.java | 85 ++- .../java/minicraft/entity/mob/MobAi.java | 48 +- .../minicraft/entity/mob/ObsidianKnight.java | 23 +- .../java/minicraft/entity/mob/PassiveMob.java | 13 +- src/client/java/minicraft/entity/mob/Pig.java | 15 +- .../java/minicraft/entity/mob/Player.java | 205 ++++--- .../java/minicraft/entity/mob/Sheep.java | 15 +- .../java/minicraft/entity/mob/Skeleton.java | 3 +- .../java/minicraft/entity/mob/Slime.java | 14 +- .../java/minicraft/entity/mob/Snake.java | 4 +- .../java/minicraft/entity/mob/Zombie.java | 7 +- .../minicraft/entity/particle/Particle.java | 18 +- .../entity/particle/SandParticle.java | 1 + .../entity/particle/TextParticle.java | 25 +- src/client/java/minicraft/gfx/Color.java | 51 +- src/client/java/minicraft/gfx/Dimension.java | 15 +- src/client/java/minicraft/gfx/Ellipsis.java | 153 ++++-- src/client/java/minicraft/gfx/Font.java | 67 ++- src/client/java/minicraft/gfx/FontStyle.java | 75 ++- src/client/java/minicraft/gfx/Insets.java | 35 +- .../java/minicraft/gfx/MinicraftImage.java | 15 +- src/client/java/minicraft/gfx/Point.java | 25 +- src/client/java/minicraft/gfx/Rectangle.java | 114 ++-- src/client/java/minicraft/gfx/Screen.java | 126 +++-- src/client/java/minicraft/gfx/Sprite.java | 26 +- .../java/minicraft/gfx/SpriteAnimation.java | 45 +- .../java/minicraft/gfx/SpriteLinker.java | 174 ++++-- src/client/java/minicraft/item/ArmorItem.java | 9 +- src/client/java/minicraft/item/BookItem.java | 9 +- .../java/minicraft/item/BucketItem.java | 31 +- .../java/minicraft/item/ClothingItem.java | 23 +- .../java/minicraft/item/FishingData.java | 28 +- .../java/minicraft/item/FishingRodItem.java | 143 ++--- src/client/java/minicraft/item/FoodItem.java | 13 +- .../java/minicraft/item/FurnitureItem.java | 14 +- src/client/java/minicraft/item/HeartItem.java | 16 +- src/client/java/minicraft/item/Inventory.java | 84 ++- src/client/java/minicraft/item/Item.java | 45 +- src/client/java/minicraft/item/Items.java | 31 +- .../java/minicraft/item/PotionItem.java | 20 +- .../java/minicraft/item/PotionType.java | 26 +- src/client/java/minicraft/item/Recipe.java | 24 +- src/client/java/minicraft/item/Recipes.java | 280 +++++----- .../java/minicraft/item/StackableItem.java | 11 +- .../java/minicraft/item/SummonItem.java | 20 +- src/client/java/minicraft/item/TileItem.java | 25 +- src/client/java/minicraft/item/ToolItem.java | 27 +- src/client/java/minicraft/item/ToolType.java | 24 +- src/client/java/minicraft/item/TorchItem.java | 11 +- .../java/minicraft/item/WateringCanItem.java | 20 +- src/client/java/minicraft/level/Level.java | 186 ++++--- src/client/java/minicraft/level/LevelGen.java | 22 +- .../java/minicraft/level/Structure.java | 142 ++--- .../java/minicraft/level/tile/CactusTile.java | 2 +- .../minicraft/level/tile/ConnectTile.java | 22 +- .../java/minicraft/level/tile/DecorTile.java | 11 +- .../java/minicraft/level/tile/DirtTile.java | 23 +- .../java/minicraft/level/tile/DoorTile.java | 5 +- .../java/minicraft/level/tile/FloorTile.java | 27 +- .../java/minicraft/level/tile/FlowerTile.java | 4 +- .../java/minicraft/level/tile/GrassTile.java | 4 - .../minicraft/level/tile/HardRockTile.java | 2 +- .../level/tile/InfiniteFallTile.java | 9 +- .../minicraft/level/tile/LavaBrickTile.java | 8 +- .../minicraft/level/tile/MaterialTile.java | 21 +- .../java/minicraft/level/tile/OreTile.java | 24 +- .../java/minicraft/level/tile/PathTile.java | 40 +- .../java/minicraft/level/tile/RockTile.java | 2 +- .../java/minicraft/level/tile/SandTile.java | 12 +- .../java/minicraft/level/tile/Tile.java | 99 ++-- .../java/minicraft/level/tile/Tiles.java | 165 +++--- .../java/minicraft/level/tile/TorchTile.java | 12 +- .../java/minicraft/level/tile/TreeTile.java | 11 +- .../java/minicraft/level/tile/WallTile.java | 17 +- .../level/tile/farming/CarrotTile.java | 2 +- .../level/tile/farming/CropTile.java | 18 +- .../level/tile/farming/FarmTile.java | 31 +- .../tile/farming/HeavenlyBerriesTile.java | 2 +- .../tile/farming/HellishBerriesTile.java | 2 +- .../level/tile/farming/PotatoTile.java | 18 +- .../level/tile/farming/TomatoTile.java | 2 +- .../level/tile/farming/WheatTile.java | 2 +- .../java/minicraft/network/Analytics.java | 11 +- .../minicraft/network/MinicraftProtocol.java | 6 +- .../java/minicraft/network/Network.java | 15 +- .../java/minicraft/saveload/LegacyLoad.java | 120 +++-- src/client/java/minicraft/saveload/Load.java | 195 ++++--- src/client/java/minicraft/saveload/Save.java | 39 +- .../java/minicraft/saveload/Version.java | 28 +- .../minicraft/screen/AchievementsDisplay.java | 380 ++++++------- .../java/minicraft/screen/BookDisplay.java | 34 +- .../minicraft/screen/ContainerDisplay.java | 19 +- .../minicraft/screen/ControlsDisplay.java | 6 +- .../minicraft/screen/CraftingDisplay.java | 25 +- src/client/java/minicraft/screen/Display.java | 45 +- .../java/minicraft/screen/EndGameDisplay.java | 10 +- .../java/minicraft/screen/InfoDisplay.java | 8 +- .../java/minicraft/screen/InventoryMenu.java | 12 +- .../java/minicraft/screen/ItemListMenu.java | 5 +- .../minicraft/screen/KeyInputDisplay.java | 8 +- .../screen/LanguageSettingsDisplay.java | 8 +- .../screen/LevelTransitionDisplay.java | 12 +- .../java/minicraft/screen/LoadingDisplay.java | 10 +- src/client/java/minicraft/screen/Menu.java | 253 +++++---- .../minicraft/screen/MultiplayerDisplay.java | 84 +-- .../screen/OnScreenKeyboardMenu.java | 99 ++-- .../screen/OptionsMainMenuDisplay.java | 16 +- .../minicraft/screen/OptionsWorldDisplay.java | 5 +- .../java/minicraft/screen/PauseDisplay.java | 10 +- .../java/minicraft/screen/PlayDisplay.java | 28 +- .../minicraft/screen/PlayerDeathDisplay.java | 2 +- .../minicraft/screen/PlayerInvDisplay.java | 31 +- .../java/minicraft/screen/PopupDisplay.java | 38 +- .../java/minicraft/screen/QuestsDisplay.java | 62 ++- .../java/minicraft/screen/RecipeMenu.java | 6 +- src/client/java/minicraft/screen/RelPos.java | 23 +- .../minicraft/screen/ResourcePackDisplay.java | 132 +++-- .../java/minicraft/screen/SkinDisplay.java | 9 +- .../java/minicraft/screen/TempDisplay.java | 20 +- .../java/minicraft/screen/TitleDisplay.java | 59 +- .../screen/TutorialDisplayHandler.java | 22 +- .../minicraft/screen/WorldGenDisplay.java | 59 +- .../minicraft/screen/WorldSelectDisplay.java | 17 +- .../minicraft/screen/entry/ArrayEntry.java | 44 +- .../minicraft/screen/entry/BlankEntry.java | 10 +- .../minicraft/screen/entry/BooleanEntry.java | 2 +- .../minicraft/screen/entry/InputEntry.java | 6 +- .../minicraft/screen/entry/ItemEntry.java | 11 +- .../minicraft/screen/entry/ItemListing.java | 12 +- .../minicraft/screen/entry/KeyInputEntry.java | 2 +- .../minicraft/screen/entry/LinkEntry.java | 25 +- .../minicraft/screen/entry/ListEntry.java | 35 +- .../minicraft/screen/entry/RangeEntry.java | 22 +- .../minicraft/screen/entry/RecipeEntry.java | 3 +- .../minicraft/screen/entry/SelectEntry.java | 25 +- .../minicraft/screen/entry/StringEntry.java | 31 +- .../minicraft/util/AdvancementElement.java | 129 +++-- src/client/java/minicraft/util/Logging.java | 8 +- src/client/java/minicraft/util/MyUtils.java | 10 +- src/client/java/minicraft/util/Quest.java | 9 +- .../util/TinylogLoggingConfiguration.java | 55 +- .../util/TinylogLoggingProvider.java | 24 +- .../java/minicraft/util/TutorialElement.java | 4 +- src/client/java/minicraft/util/Vector2.java | 6 +- src/client/resources/resources/recipes.json | 503 ++++++++++++++---- src/client/resources/tinylog.properties | 42 +- 193 files changed, 4753 insertions(+), 2847 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6effc03c5..642cf1e89 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ charset = utf-8 indent_style = tab indent_size = tab tab_width = 4 -ij_java_imports_layout = *,|,javax.**,|,java.**,|,$* +ij_java_imports_layout = *, |, javax.**, |, java.**, |, $* ij_java_packages_to_use_import_on_demand = unset ij_java_class_count_to_use_import_on_demand = 99999999 ij_java_names_count_to_use_import_on_demand = 99999999 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 50ae616dc..9a69af588 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,6 +12,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. See error @@ -23,8 +24,9 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. Windows] - - Game version [e.g. 2.0.7] + +- OS: [e.g. Windows] +- Game version [e.g. 2.0.7] **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 2c260ae31..9bff81a7e 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,33 +1,33 @@ name: Nightly build on: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * *' workflow_dispatch: - + jobs: gradle: strategy: matrix: - os: [ubuntu-latest] + os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 8 - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 - - - name: Execute Gradle build - run: ./gradlew build - - - uses: actions/upload-artifact@v3.1.2 - with: - name: "Nightly release" - path: | - LICENSE - ChangeLog.md - build/libs/**.jar - if-no-files-found: error + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.4.2 + + - name: Execute Gradle build + run: ./gradlew build + + - uses: actions/upload-artifact@v3.1.2 + with: + name: "Nightly release" + path: | + LICENSE + ChangeLog.md + build/libs/**.jar + if-no-files-found: error diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c1d66f49d..a0fefaba5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,36 +37,36 @@ jobs: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c003ebe5b..a51f90c97 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,5 @@ name: publish -on: [workflow_dispatch] # Manual trigger +on: [ workflow_dispatch ] # Manual trigger jobs: build: strategy: diff --git a/ChangeLog.md b/ChangeLog.md index 68880e22c..bae0c1a36 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -16,7 +16,8 @@ but some sections are changed to compliant this project. * Added obsidian knight as the second boss * Added limitation to inventories * Added limitation to stackable items -* Added seven new debug arguments - `--debug-log-time`, `--debug-log-thread`, `--debug-log-trace`, `--debug-filelog-full`, `--debug-level`, `--debug-locale`, `--debug-unloc-tracing` +* Added seven new debug + arguments - `--debug-log-time`, `--debug-log-thread`, `--debug-log-trace`, `--debug-filelog-full`, `--debug-level`, `--debug-locale`, `--debug-unloc-tracing` * Added a new argument for disabling hardware acceleration - `--no-hardware-acceleration` * Added a toggle for HUD display * Added a toggle for simplified effect display @@ -412,7 +413,11 @@ but some sections are changed to compliant this project. > * Added an Iron Lantern at the entrance of the purple dungeon [2.2.0]: https://github.com/MinicraftPlus/minicraft-plus-revived/compare/v2.1.3...HEAD + [2.1.3]: https://github.com/MinicraftPlus/minicraft-plus-revived/compare/v2.1.2...v2.1.3 + [2.1.2]: https://github.com/MinicraftPlus/minicraft-plus-revived/compare/v2.1.1...v2.1.2 + [2.1.1]: https://github.com/MinicraftPlus/minicraft-plus-revived/compare/v2.1.0...v2.1.1 + [2.1.0]: https://github.com/MinicraftPlus/minicraft-plus-revived/compare/v2.0.7...v2.1.0 diff --git a/Credits.md b/Credits.md index 2d13f6ee4..87c04ecf3 100644 --- a/Credits.md +++ b/Credits.md @@ -1,16 +1,20 @@ ## Credits + Original game by Markus "Notch" Persson. ### Former maintainers + * David.b * Dillyg10 * Chris J * afyber ### Current maintainer + * Makkkkus ### Code contributions from + * A.L.I.C.E * BenCheung0422 * Christoffer Holmesland @@ -21,11 +25,13 @@ Original game by Markus "Notch" Persson. * rocketedsocks ### Art contributions from + * TheBigEye * JamesTDG * Geek_Joystick ### Localisation contributions from + * A.L.I.C.E * Christoffer Holmesland * GladfanIsHere diff --git a/README.md b/README.md index c16169dbf..8404efba3 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,27 @@ [![CodeQL](https://github.com/MinicraftPlus/minicraft-plus-revived/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/MinicraftPlus/minicraft-plus-revived/actions/workflows/codeql-analysis.yml) # Minicraft+ + ![Minicraft+](https://user-images.githubusercontent.com/37084190/138313821-75ac3112-7044-45c1-bdbb-d89f2333c2c0.png) -Minicraft+ is an overhaul mod of Minicraft, a game made by Markus "Notch" Persson in the Ludum Dare 22 contest. To learn more about Minicraft take a look at [playminicraft.com](https://www.playminicraft.com), talk to the community at our [Discord](https://discord.me/minicraft), or check out our [Fandom Wiki](https://minicraft.fandom.com/wiki/Minicraft_Wiki). +Minicraft+ is an overhaul mod of Minicraft, a game made by Markus "Notch" Persson in the Ludum Dare 22 contest. To learn +more about Minicraft take a look at [playminicraft.com](https://www.playminicraft.com), talk to the community at +our [Discord](https://discord.me/minicraft), or check out +our [Fandom Wiki](https://minicraft.fandom.com/wiki/Minicraft_Wiki). -Check the [releases](https://github.com/minicraftplus/minicraft-plus-revived/releases) page to download the latest version, or older versions. +Check the [releases](https://github.com/minicraftplus/minicraft-plus-revived/releases) page to download the latest +version, or older versions. ## Major features + * Four new gamemodes - * Creative - * Hardcore - * Score - * Survival + * Creative + * Hardcore + * Score + * Survival * Saving and loading -* Multiplayer mode and an account system (Now supported by [El-Virus](https://www.github.com/ElVir-Software/minicraft-plus-online)) +* Multiplayer mode and an account system (Now supported + by [El-Virus](https://www.github.com/ElVir-Software/minicraft-plus-online)) * More mobs * Personal crafting menu * Beds @@ -33,24 +40,36 @@ Check the [releases](https://github.com/minicraftplus/minicraft-plus-revived/rel * and many, many more! ## Current goals and ideas -Take a look at the [ideas](ideas/) folder or the [issues](https://github.com/minicraftplus/minicraft-plus-revived/issues) page. + +Take a look at the [ideas](ideas/) folder or +the [issues](https://github.com/minicraftplus/minicraft-plus-revived/issues) page. ## Getting the game and run the game -Head over [releases](https://github.com/minicraftplus/minicraft-plus-revived/releases) and find the latest version of Minicraft+. -There, you can find an file called `minicraft_plus.jar`. Click the file, and after you have downloaded the file, you must double-click the file in downloads folder to open it. -You must first confirm that you have [Java](https://www.java.com/en/download/) (at least version 8) installed on your computer. + +Head over [releases](https://github.com/minicraftplus/minicraft-plus-revived/releases) and find the latest version of +Minicraft+. +There, you can find an file called `minicraft_plus.jar`. Click the file, and after you have downloaded the file, you +must double-click the file in downloads folder to open it. +You must first confirm that you have [Java](https://www.java.com/en/download/) (at least version 8) installed on your +computer. ## Localization -This project is running with an external localization platform called POEditor. You can contribute localization by clicking the image below! + +This project is running with an external localization platform called POEditor. You can contribute localization by +clicking the image below! [![Minicraft+ POEditor Stats](https://minicraft-plus-poeditor-stats.vercel.app/api/card)](https://minicraft-plus-poeditor-stats.vercel.app) ## How to build/run in development + Because this project uses a build tool called gradle it is very easy to build or run the project from the source code. 1. Download the source code by clicking the green code button, and download it as a ZIP. 2. Extract the contents of the folder. 3. Open command prompt and enter `cd `, this will open the folder in the command prompt. -4. Type `gradlew run` or `gradlew build` to run or build the program. This might take some time. If on unix, add "./" to the front. - 1. If you built the project, the jar file is found in `build/libs` - 2. If you get an error screaming that you're missing java. You need to [set up](https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html) your JAVA_HOME environment variable, or download a JDK if you haven't already. +4. Type `gradlew run` or `gradlew build` to run or build the program. This might take some time. If on unix, add "./" to + the front. + 1. If you built the project, the jar file is found in `build/libs` + 2. If you get an error screaming that you're missing java. You need + to [set up](https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html) your + JAVA_HOME environment variable, or download a JDK if you haven't already. diff --git a/build.gradle b/build.gradle index 3c1e4c6ee..f8e2d2271 100644 --- a/build.gradle +++ b/build.gradle @@ -94,13 +94,13 @@ jar { from files(sourceSets.main.output.classesDirs) from files(sourceSets.main.output.resourcesDir) - from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }} + from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } } // Don't override if we're building a tar package. -tasks.withType(Tar){ +tasks.withType(Tar) { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } -tasks.withType(Zip){ +tasks.withType(Zip) { duplicatesStrategy = DuplicatesStrategy.INCLUDE } diff --git a/settings.gradle b/settings.gradle index ed6c13faa..0360f2e6a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,6 +4,6 @@ include "common" include "client" include "server" -rootProject.children.each {project -> +rootProject.children.each { project -> project.projectDir = new File(settingsDir, "src/${project.name}") } diff --git a/src/client/java/minicraft/core/Action.java b/src/client/java/minicraft/core/Action.java index 4b931e34b..520187682 100644 --- a/src/client/java/minicraft/core/Action.java +++ b/src/client/java/minicraft/core/Action.java @@ -2,7 +2,7 @@ @FunctionalInterface public interface Action { - + void act(); - + } diff --git a/src/client/java/minicraft/core/CrashHandler.java b/src/client/java/minicraft/core/CrashHandler.java index 15157c31e..ddeb5b206 100644 --- a/src/client/java/minicraft/core/CrashHandler.java +++ b/src/client/java/minicraft/core/CrashHandler.java @@ -28,10 +28,18 @@ import java.util.concurrent.Future; public class CrashHandler { - public static void crashHandle(Thread thread, Throwable throwable) { crashHandle(throwable); } - public static void crashHandle(Throwable throwable) { crashHandle(throwable, new ErrorInfo(true)); } - /** This handles application crashing errors by giving notification to the user clearly.
- * The user can only exit the program. */ + public static void crashHandle(Thread thread, Throwable throwable) { + crashHandle(throwable); + } + + public static void crashHandle(Throwable throwable) { + crashHandle(throwable, new ErrorInfo(true)); + } + + /** + * This handles application crashing errors by giving notification to the user clearly.
+ * The user can only exit the program. + */ public static void crashHandle(Throwable throwable, ErrorInfo info) { Logging.CRASHHANDLER.error(throwable); @@ -45,7 +53,8 @@ public static void crashHandle(Throwable throwable, ErrorInfo info) { if (GraphicsEnvironment.isHeadless() && ping != null) { try { ping.get(); - } catch (Exception ignored) {} + } catch (Exception ignored) { + } return; } @@ -100,11 +109,20 @@ public static void crashHandle(Throwable throwable, ErrorInfo info) { System.exit(info.type.exitCode); } - public static void errorHandle(Throwable throwable) { errorHandle(throwable, new ErrorInfo()); } - public static void errorHandle(Throwable throwable, ErrorInfo info) { errorHandle(throwable, info, null); } - /** This handles application crashing errors by giving notification to the user clearly.
+ public static void errorHandle(Throwable throwable) { + errorHandle(throwable, new ErrorInfo()); + } + + public static void errorHandle(Throwable throwable, ErrorInfo info) { + errorHandle(throwable, info, null); + } + + /** + * This handles application crashing errors by giving notification to the user clearly.
* The user can ignore the error, continue handling the error or exit the program (only in serious errors or error reports). - * @param handling The handling function of the error. */ + * + * @param handling The handling function of the error. + */ public static void errorHandle(Throwable throwable, ErrorInfo info, @Nullable Action handling) { throwable.printStackTrace(); @@ -118,7 +136,8 @@ public static void errorHandle(Throwable throwable, ErrorInfo info, @Nullable Ac if (GraphicsEnvironment.isHeadless() && ping != null) { try { ping.get(); - } catch (Exception ignored) {} + } catch (Exception ignored) { + } return; } @@ -161,13 +180,18 @@ public static void errorHandle(Throwable throwable, ErrorInfo info, @Nullable Ac dialog.setVisible(true); // Shows the dialog. } - /** Getting the stack trace display component. */ + /** + * Getting the stack trace display component. + */ private static JScrollPane getErrorScrollPane(String stackTrace) { JTextArea errorDisplay = new JTextArea(stackTrace); errorDisplay.setEditable(false); return new JScrollPane(errorDisplay); } - /** Getting the panel for crashing handling dialog. */ + + /** + * Getting the panel for crashing handling dialog. + */ private static JPanel getCrashPanel(ErrorInfo info, JScrollPane errorPane, JDialog dialog, String stackTrace) { JPanel panel = new JPanel(new BorderLayout()); panel.add(errorPane); @@ -190,6 +214,7 @@ private static JPanel getCrashPanel(ErrorInfo info, JScrollPane errorPane, JDial panel.add(buttonPanel, BorderLayout.SOUTH); return panel; } + private static JPanel getErrorPanel(ErrorInfo info, JScrollPane errorPane, JDialog dialog, String stackTrace, Action callback, Future> ping) { JPanel panel = new JPanel(new BorderLayout()); panel.add(errorPane); @@ -249,13 +274,31 @@ public static class ErrorInfo { public final String message; public final boolean serious; - public ErrorInfo() { this(false); } - public ErrorInfo(boolean crashing) { this(crashing ? "General Application Crash" : "General Application Error", - crashing ? ErrorType.DEFAULT : ErrorType.REPORT); } - public ErrorInfo(String topic) { this(topic, ErrorType.DEFAULT); } - public ErrorInfo(String topic, ErrorType type) { this(topic, type, type.exitCode != 0); } - public ErrorInfo(String topic, ErrorType type, boolean serious) { this(topic, type, serious, null); } - public ErrorInfo(String topic, ErrorType type, String message) { this(topic, type, type.exitCode < 0, message); } + public ErrorInfo() { + this(false); + } + + public ErrorInfo(boolean crashing) { + this(crashing ? "General Application Crash" : "General Application Error", + crashing ? ErrorType.DEFAULT : ErrorType.REPORT); + } + + public ErrorInfo(String topic) { + this(topic, ErrorType.DEFAULT); + } + + public ErrorInfo(String topic, ErrorType type) { + this(topic, type, type.exitCode != 0); + } + + public ErrorInfo(String topic, ErrorType type, boolean serious) { + this(topic, type, serious, null); + } + + public ErrorInfo(String topic, ErrorType type, String message) { + this(topic, type, type.exitCode < 0, message); + } + public ErrorInfo(String topic, ErrorType type, boolean serious, String message) { this.title = topic; this.type = type; @@ -263,17 +306,21 @@ public ErrorInfo(String topic, ErrorType type, boolean serious, String message) this.serious = serious; } - /** The error types. Add more types when needed. */ + /** + * The error types. Add more types when needed. + */ public static enum ErrorType { - DEFAULT (-1, "Unhandled error"), - UNEXPECTED (-2, "Unexpected error"), - UNHANDLEABLE (-3, "Unhandleable error"), - SERIOUS (1, "Serious error"), - HANDLED (0, "Handled error"), - REPORT (0, "Error report"), + DEFAULT(-1, "Unhandled error"), + UNEXPECTED(-2, "Unexpected error"), + UNHANDLEABLE(-3, "Unhandleable error"), + SERIOUS(1, "Serious error"), + HANDLED(0, "Handled error"), + REPORT(0, "Error report"), ; - /** The exit codes are referring to https://www.techiedelight.com/exit-codes-java-system-exit-method/ */ + /** + * The exit codes are referring to https://www.techiedelight.com/exit-codes-java-system-exit-method/ + */ public final int exitCode; public final String name; diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 544d6de12..226af77d5 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -4,7 +4,6 @@ import minicraft.core.io.Settings; import minicraft.core.io.Sound; import minicraft.entity.mob.Player; -import minicraft.gfx.Screen; import minicraft.level.Level; import minicraft.level.tile.Tiles; import minicraft.network.Analytics; @@ -21,7 +20,8 @@ import java.util.List; public class Game { - protected Game() {} // Can't instantiate the Game class. + protected Game() { + } // Can't instantiate the Game class. public static final String NAME = "Minicraft Plus"; // This is the name on the application window. @@ -37,13 +37,18 @@ protected Game() {} // Can't instantiate the Game class. // DISPLAY static Display currentDisplay = null; static final ArrayDeque displayQuery = new ArrayDeque<>(); + public static void setDisplay(@Nullable Display display) { if (display == null) displayQuery.clear(); else displayQuery.add(display); } - public static void exitDisplay() { exitDisplay(1); } + + public static void exitDisplay() { + exitDisplay(1); + } + public static void exitDisplay(int depth) { if (depth < 1) return; // There is nothing needed to exit. if (displayQuery.isEmpty()) { @@ -61,11 +66,16 @@ public static void exitDisplay(int depth) { displayQuery.add(parent); } } + @Nullable - public static Display getDisplay() { return displayQuery.isEmpty() ? null : displayQuery.peekLast(); } + public static Display getDisplay() { + return displayQuery.isEmpty() ? null : displayQuery.peekLast(); + } // GAMEMODE - public static boolean isMode(String mode) { return ((String)Settings.get("mode")).equalsIgnoreCase(mode); } + public static boolean isMode(String mode) { + return ((String) Settings.get("mode")).equalsIgnoreCase(mode); + } // LEVEL public static Level[] levels = new Level[6]; // This array stores the different levels. @@ -76,7 +86,10 @@ public static void exitDisplay(int depth) { static boolean gameOver = false; // If the player wins this is set to true. static boolean running = true; - public static void quit() { running = false; } + + public static void quit() { + running = false; + } public static void main(String[] args) { diff --git a/src/client/java/minicraft/core/Initializer.java b/src/client/java/minicraft/core/Initializer.java index 95872d3b2..fa0149844 100644 --- a/src/client/java/minicraft/core/Initializer.java +++ b/src/client/java/minicraft/core/Initializer.java @@ -21,7 +21,8 @@ import java.io.IOException; public class Initializer extends Game { - private Initializer() {} + private Initializer() { + } /** * Reference to actual frame, also it may be null. @@ -29,8 +30,13 @@ private Initializer() {} static JFrame frame; static int fra, tik; // These store the number of frames and ticks in the previous second; used for fps, at least. - public static JFrame getFrame() { return frame; } - public static int getCurFps() { return fra; } + public static JFrame getFrame() { + return frame; + } + + public static int getCurFps() { + return fra; + } static void parseArgs(String[] args) { // Parses command line arguments @@ -68,10 +74,11 @@ static void parseArgs(String[] args) { FileHandler.determineGameDir(saveDir); } - /** This is the main loop that runs the game. It: - * -keeps track of the amount of time that has passed - * -fires the ticks needed to run the game - * -fires the command to render out the screen. + /** + * This is the main loop that runs the game. It: + * -keeps track of the amount of time that has passed + * -fires the ticks needed to run the game + * -fires the command to render out the screen. */ static void run() { long lastTick = System.nanoTime(); @@ -109,7 +116,8 @@ static void run() { //noinspection BusyWait Thread.sleep((long) Math.floor(timeToWait / 1E6), (int) ((timeToWait - Math.floor(timeToWait)) % 1E6)); } - } catch (InterruptedException ignored) {} + } catch (InterruptedException ignored) { + } if (System.currentTimeMillis() - lastTimer1 > 1000) { //updates every 1 second long interval = System.currentTimeMillis() - lastTimer1; @@ -153,12 +161,25 @@ public void componentResized(ComponentEvent e) { }); frame.addWindowListener(new WindowListener() { - public void windowActivated(WindowEvent e) {} - public void windowDeactivated(WindowEvent e) {} - public void windowIconified(WindowEvent e) {} - public void windowDeiconified(WindowEvent e) {} - public void windowOpened(WindowEvent e) {} - public void windowClosed(WindowEvent e) { Logging.GAMEHANDLER.debug("Window closed"); } + public void windowActivated(WindowEvent e) { + } + + public void windowDeactivated(WindowEvent e) { + } + + public void windowIconified(WindowEvent e) { + } + + public void windowDeiconified(WindowEvent e) { + } + + public void windowOpened(WindowEvent e) { + } + + public void windowClosed(WindowEvent e) { + Logging.GAMEHANDLER.debug("Window closed"); + } + public void windowClosing(WindowEvent e) { Logging.GAMEHANDLER.info("Window closing"); quit(); @@ -166,7 +187,9 @@ public void windowClosing(WindowEvent e) { }); } - /** Launching the main window. */ + /** + * Launching the main window. + */ static void launchWindow() { frame.setVisible(true); frame.requestFocus(); @@ -178,7 +201,7 @@ static void launchWindow() { * that is extracted via PrintStream. * * @param throwable Throwable/Exception from which stack trace is to be - * extracted. + * extracted. * @return String with provided Throwable's stack trace. */ public static String getExceptionTrace(final Throwable throwable) { diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index 3d2fcce91..63a12cb55 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -330,7 +330,7 @@ private static void renderGui() { // Draws the text WateringCanItem tin = (WateringCanItem) player.activeItem; int dura = tin.content * 100 / tin.CAPACITY; - int green = (int)(dura * 2.55f); // Let duration show as normal. + int green = (int) (dura * 2.55f); // Let duration show as normal. Font.drawBackground(dura + "%", screen, 164, Screen.h - 16, Color.get(1, 255 - green, green, 0)); } @@ -445,7 +445,7 @@ public static void renderBossbar(int length, String title) { } } - screen.render(x - 5 , y , 0, ACTIVE_BOSSBAR, 0, hudSheet.getSheet()); // right corner + screen.render(x - 5, y, 0, ACTIVE_BOSSBAR, 0, hudSheet.getSheet()); // right corner for (int bx = 0; bx < bar_length; bx++) { for (int by = 0; by < 1; by++) { @@ -467,10 +467,10 @@ private static void renderQuestsDisplay() { for (Quest q : quests) { QuestSeries series = q.getSeries(); - questsShown.add(!expanding? - new StringEntry(Localization.getLocalized(q.key), Color.WHITE, false): + questsShown.add(!expanding ? + new StringEntry(Localization.getLocalized(q.key), Color.WHITE, false) : new StringEntry(q.shouldAllCriteriaBeCompleted() && q.getTotalNumCriteria() > 1 ? - String.format("%s (%d/%d)", Localization.getLocalized(series.key), q.getNumCriteriaCompleted(), q.getTotalNumCriteria()) : + String.format("%s (%d/%d)", Localization.getLocalized(series.key), q.getNumCriteriaCompleted(), q.getTotalNumCriteria()) : Localization.getLocalized(series.key), Color.WHITE, false) ); diff --git a/src/client/java/minicraft/core/Updater.java b/src/client/java/minicraft/core/Updater.java index 7e1178a62..70dacc202 100644 --- a/src/client/java/minicraft/core/Updater.java +++ b/src/client/java/minicraft/core/Updater.java @@ -20,7 +20,8 @@ import java.awt.GraphicsDevice; public class Updater extends Game { - private Updater() {} + private Updater() { + } // TIME AND TICKS @@ -31,8 +32,8 @@ private Updater() {} public static int tickCount = 0; // The number of ticks since the beginning of the game day. static int time = 0; // Facilites time of day / sunlight. public static final int dayLength = 64800; // This value determines how long one game day is. - public static final int sleepEndTime = dayLength/8; // This value determines when the player "wakes up" in the morning. - public static final int sleepStartTime = dayLength/2+dayLength/8; // This value determines when the player allowed to sleep. + public static final int sleepEndTime = dayLength / 8; // This value determines when the player "wakes up" in the morning. + public static final int sleepStartTime = dayLength / 2 + dayLength / 8; // This value determines when the player allowed to sleep. //public static int noon = 32400; // This value determines when the sky switches from getting lighter to getting darker. public static int gameTime = 0; // This stores the total time (number of ticks) you've been playing your @@ -56,10 +57,10 @@ private Updater() {} public static int screenshot = 0; // Counter for screenshot queries. public enum Time { - Morning (0), - Day (dayLength/4), - Evening (dayLength/2), - Night (dayLength/4*3); + Morning(0), + Day(dayLength / 4), + Evening(dayLength / 2), + Night(dayLength / 4 * 3); public int tickTime; @@ -92,10 +93,10 @@ static void updateFullscreen() { public static void tick() { // Quick Level change: move the player for -1, or 1 levels - if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-S").isClicked() ) { + if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-S").isClicked()) { Game.setDisplay(new LevelTransitionDisplay(-1)); - } else if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-W").isClicked() ){ + } else if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-W").isClicked()) { Game.setDisplay(new LevelTransitionDisplay(1)); } @@ -151,7 +152,7 @@ public static void tick() { } // Auto-save tick; marks when to do autosave. - if(!paused) + if (!paused) asTick++; if (asTick > astime) { if ((boolean) Settings.get("autosave") && !gameOver && player.health > 0) { @@ -163,7 +164,7 @@ public static void tick() { } // Increment tickCount if the game is not paused - if (!paused) setTime(tickCount+1); + if (!paused) setTime(tickCount + 1); // SCORE MODE ONLY @@ -239,7 +240,7 @@ public static void tick() { if (input.getMappedKey("F3-T-3").isClicked()) changeTimeOfDay(Time.Evening); if (input.getMappedKey("F3-T-4").isClicked()) changeTimeOfDay(Time.Night); - String prevMode = (String)Settings.get("mode"); + String prevMode = (String) Settings.get("mode"); if (input.getMappedKey("F3-F4-2").isClicked()) { Settings.set("mode", "minicraft.settings.mode.creative"); Logging.WORLDNAMED.trace("Game mode changed from {} into {}.", prevMode, "minicraft.settings.mode.creative"); @@ -264,12 +265,12 @@ public static void tick() { } if (input.getMappedKey("F3-S-equals").isClicked()) { if (gamespeed < 1) gamespeed *= 2; - else if (normSpeed*gamespeed < 2000) gamespeed++; + else if (normSpeed * gamespeed < 2000) gamespeed++; Logging.WORLDNAMED.trace("Tick speed increased from {} into {}.", prevSpeed, gamespeed); } if (input.getMappedKey("F3-S-minus").isClicked()) { if (gamespeed > 1) gamespeed--; - else if (normSpeed*gamespeed > 5) gamespeed /= 2; + else if (normSpeed * gamespeed > 5) gamespeed /= 2; Logging.WORLDNAMED.trace("Tick speed decreased from {} into {}.", prevSpeed, gamespeed); } @@ -278,13 +279,14 @@ public static void tick() { if (input.getMappedKey("F3-M-0").isClicked()) player.moveSpeed = 1; if (input.getMappedKey("F3-M-equals").isClicked()) player.moveSpeed++; - if (input.getMappedKey("F3-M-minus").isClicked() && player.moveSpeed > 1) player.moveSpeed--; // -= 0.5D; + if (input.getMappedKey("F3-M-minus").isClicked() && player.moveSpeed > 1) + player.moveSpeed--; // -= 0.5D; if (input.getMappedKey("F3-u").isClicked()) { - levels[currentLevel].setTile(player.x>>4, player.y>>4, Tiles.get("Stairs Up")); + levels[currentLevel].setTile(player.x >> 4, player.y >> 4, Tiles.get("Stairs Up")); } if (input.getMappedKey("F3-d").isClicked()) { - levels[currentLevel].setTile(player.x>>4, player.y>>4, Tiles.get("Stairs Down")); + levels[currentLevel].setTile(player.x >> 4, player.y >> 4, Tiles.get("Stairs Down")); } } // End debug only cond. } // End "menu-null" conditional @@ -311,6 +313,7 @@ public static void setTime(int ticks) { public static void changeTimeOfDay(Time t) { setTime(t.tickTime); } + // This one works too. public static void changeTimeOfDay(int t) { Time[] times = Time.values(); @@ -325,10 +328,13 @@ public static Time getTime() { return times[time]; } - /** This adds a notification to all player games. */ + /** + * This adds a notification to all player games. + */ public static void notifyAll(String msg) { notifyAll(msg, 0); } + public static void notifyAll(String msg, int notetick) { msg = Localization.getLocalized(msg); notifications.add(msg); diff --git a/src/client/java/minicraft/core/World.java b/src/client/java/minicraft/core/World.java index 4e5a2aa8d..6aeb52452 100644 --- a/src/client/java/minicraft/core/World.java +++ b/src/client/java/minicraft/core/World.java @@ -22,7 +22,8 @@ import java.util.Random; public class World extends Game { - private World() {} + private World() { + } public static final int[] idxToDepth = {-3, -2, -1, 0, 1, -4}; /// This is to map the level depths to each level's index in Game's levels array. This must ALWAYS be the same length as the levels array, of course. public static final int minLevelDepth, maxLevelDepth; @@ -44,7 +45,7 @@ private World() {} static { int min, max; min = max = idxToDepth[0]; - for (int depth: idxToDepth) { + for (int depth : idxToDepth) { if (depth < min) min = depth; if (depth > max) @@ -54,7 +55,9 @@ private World() {} maxLevelDepth = max; } - /** This is for a contained way to find the index in the levels array of a level, based on it's depth. This is also helpful because add a new level in the future could change this. */ + /** + * This is for a contained way to find the index in the levels array of a level, based on it's depth. This is also helpful because add a new level in the future could change this. + */ public static int lvlIdx(int depth) { if (depth > maxLevelDepth) return lvlIdx(minLevelDepth); if (depth < minLevelDepth) return lvlIdx(maxLevelDepth); @@ -65,8 +68,13 @@ public static int lvlIdx(int depth) { } - /** This method is used when respawning, and by initWorld to reset the vars. It does not generate any new terrain. */ - public static void resetGame() { resetGame(true); } + /** + * This method is used when respawning, and by initWorld to reset the vars. It does not generate any new terrain. + */ + public static void resetGame() { + resetGame(true); + } + public static void resetGame(boolean keepPlayer) { Logging.WORLD.debug("Resetting..."); playerDeadTime = 0; @@ -91,7 +99,8 @@ public static void resetGame(boolean keepPlayer) { } } - /** This method is used to create a brand new world, or to load an existing one from a file. + /** + * This method is used to create a brand new world, or to load an existing one from a file. * For the loading screen updates to work, it it assumed that *this* is called by a thread *other* than the one rendering the current *menu*. **/ public static void initWorld() { // This is a full reset; everything. @@ -135,7 +144,7 @@ public static void resetGame(boolean keepPlayer) { Logging.WORLD.trace("Generating level " + i + "..."); LoadingDisplay.setMessage(Level.getDepthString(i)); - levels[lvlIdx(i)] = new Level(worldSize, worldSize, random.nextLong(), i, levels[lvlIdx(i+1)], !WorldSelectDisplay.hasLoadedWorld()); + levels[lvlIdx(i)] = new Level(worldSize, worldSize, random.nextLong(), i, levels[lvlIdx(i + 1)], !WorldSelectDisplay.hasLoadedWorld()); LoadingDisplay.progress(loadingInc); } @@ -159,20 +168,32 @@ public static void resetGame(boolean keepPlayer) { Logging.WORLD.trace("World initialized."); } - public static long getWorldSeed() { return seed; } - public static void setWorldSeed(long seed) { World.seed = seed; } + public static long getWorldSeed() { + return seed; + } + + public static void setWorldSeed(long seed) { + World.seed = seed; + } + + /** + * This method is called when you interact with stairs, this will give you the transition effect. While changeLevel(int) just changes the level. + */ + public static void scheduleLevelChange(int dir) { + scheduleLevelChange(dir, null); + } - /** This method is called when you interact with stairs, this will give you the transition effect. While changeLevel(int) just changes the level. */ - public static void scheduleLevelChange(int dir) { scheduleLevelChange(dir, null); } public static void scheduleLevelChange(int dir, @Nullable Action changeAction) { onChangeAction = changeAction; pendingLevelChange = dir; } - /** This method changes the level that the player is currently on. + /** + * This method changes the level that the player is currently on. * It takes 1 integer variable, which is used to tell the game which direction to go. * For example, 'changeLevel(1)' will make you go up a level, - while 'changeLevel(-1)' will make you go down a level. */ + * while 'changeLevel(-1)' will make you go down a level. + */ public static void changeLevel(int dir) { if (onChangeAction != null) { onChangeAction.act(); @@ -182,7 +203,7 @@ public static void changeLevel(int dir) { levels[currentLevel].remove(player); // Removes the player from the current level. int nextLevel = currentLevel + dir; - if (nextLevel <= -1) nextLevel = levels.length-1; // Fix accidental level underflow + if (nextLevel <= -1) nextLevel = levels.length - 1; // Fix accidental level underflow if (nextLevel >= levels.length) nextLevel = 0; // Fix accidental level overflow Logging.WORLD.trace("Setting level from {} to {}", currentLevel, nextLevel); currentLevel = nextLevel; @@ -206,6 +227,11 @@ public static void onWorldExits() { lastWorldExitTime = System.currentTimeMillis(); } - public static long getLastWorldExitTime() { return lastWorldExitTime; } - public static long getLastWorldEnterTime() { return lastWorldEnterTime; } + public static long getLastWorldExitTime() { + return lastWorldExitTime; + } + + public static long getLastWorldEnterTime() { + return lastWorldEnterTime; + } } diff --git a/src/client/java/minicraft/core/io/ClipboardHandler.java b/src/client/java/minicraft/core/io/ClipboardHandler.java index 0fa75b5fc..1b3b537cf 100644 --- a/src/client/java/minicraft/core/io/ClipboardHandler.java +++ b/src/client/java/minicraft/core/io/ClipboardHandler.java @@ -13,36 +13,38 @@ public final class ClipboardHandler implements ClipboardOwner { - @Override - public void lostOwnership(Clipboard clipboard, Transferable contents) { } + @Override + public void lostOwnership(Clipboard clipboard, Transferable contents) { + } /** * Give the system clipboard data. */ - public void setClipboardContents(String string) { - StringSelection stringSelection = new StringSelection(string); - Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); - clipboard.setContents(stringSelection, this); - } + public void setClipboardContents(String string) { + StringSelection stringSelection = new StringSelection(string); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(stringSelection, this); + } /** * Get the string from the system clipboard data. + * * @return A string with the contents. */ public String getClipboardContents() { - Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); - Transferable contents = clipboard.getContents(null); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + Transferable contents = clipboard.getContents(null); - String result = ""; + String result = ""; - if ((contents != null) && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) { - try { - result = (String) contents.getTransferData(DataFlavor.stringFlavor); - } catch (UnsupportedFlavorException | IOException ex) { + if ((contents != null) && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) { + try { + result = (String) contents.getTransferData(DataFlavor.stringFlavor); + } catch (UnsupportedFlavorException | IOException ex) { CrashHandler.errorHandle(ex); - } - } + } + } - return result; - } + return result; + } } diff --git a/src/client/java/minicraft/core/io/FileHandler.java b/src/client/java/minicraft/core/io/FileHandler.java index a831c3160..cdde3472c 100644 --- a/src/client/java/minicraft/core/io/FileHandler.java +++ b/src/client/java/minicraft/core/io/FileHandler.java @@ -26,7 +26,8 @@ import java.util.stream.Stream; public class FileHandler extends Game { - private FileHandler() {} + private FileHandler() { + } public static final int REPLACE_EXISTING = 0; public static final int RENAME_COPY = 1; @@ -99,11 +100,11 @@ public static void determineGameDir(@Nullable String saveDir) { } public static String getSystemGameDir() { - return systemGameDir; + return systemGameDir; } public static String getLocalGameDir() { - return localGameDir; + return localGameDir; } private static void deleteFolder(File top) { @@ -133,7 +134,7 @@ else if (ifExisting == RENAME_COPY) { newFilename = newFilename.substring(0, newFilename.lastIndexOf(".")); do { newFilename += "(Old)"; - } while(new File(newFilename).exists()); + } while (new File(newFilename).exists()); newFilename += Save.extension; } } @@ -146,12 +147,15 @@ else if (ifExisting == RENAME_COPY) { } return FileVisitResult.CONTINUE; } + public FileVisitResult preVisitDirectory(Path p, BasicFileAttributes bfa) { return FileVisitResult.CONTINUE; } + public FileVisitResult postVisitDirectory(Path p, IOException ex) { return FileVisitResult.CONTINUE; } + public FileVisitResult visitFileFailed(Path p, IOException ex) { return FileVisitResult.CONTINUE; } @@ -179,7 +183,7 @@ public static ArrayList listAssets() { ArrayList names = new ArrayList<>(); try (Stream paths = Files.walk(path)) { Path finalPath = path; - paths.forEach(p -> names.add(finalPath.getParent().relativize(p).toString().replace('\\', '/')+ + paths.forEach(p -> names.add(finalPath.getParent().relativize(p).toString().replace('\\', '/') + (p.toFile().isDirectory() ? "/" : ""))); return names; } catch (IOException e) { @@ -203,7 +207,7 @@ private static ArrayList listResourcesUsingIDE() { Path folderPath = Paths.get(fUrl.toURI()); Files.walk(folderPath) - .forEach(p -> { + .forEach(p -> { names.add(folderPath.relativize(p).toString().replace('\\', '/') + (p.toFile().isDirectory() ? "/" : "")); }); diff --git a/src/client/java/minicraft/core/io/InputHandler.java b/src/client/java/minicraft/core/io/InputHandler.java index d7037ced3..f45a7e180 100644 --- a/src/client/java/minicraft/core/io/InputHandler.java +++ b/src/client/java/minicraft/core/io/InputHandler.java @@ -24,30 +24,29 @@ public class InputHandler implements KeyListener { /** - This class handles key presses; this also implements MouseListener... but I have no idea why. - It's not used in any way. Ever. As far as I know. Anyway, here are a few tips about this class: - - -This class must instantiated to be used; and it's pretty much always called "input" in the code. - - -The keys are stored in two arrays, one for physical keyboard keys(called "keyboard"), and one for "keys" you make-up (called "keymap") to represent different actions ("virtual keys", you could say). - - -All the Keys in the keyboard array are generated automatically as you ask for them in the code (if they don't already exist), so there's no need to define anything in the keyboard array here. - --Note: this shouldn't matter, but keys that are not asked for or defined as values here in keymap will be ignored when it comes to key presses. - - -All the "virtual keys" in keymap "map" to a Key object in the keyboard array; that is to say, - keymap contains a HashMap of string keys, to string values. The keys are the names of the actions, - and the values are the names of the keyboard keys you physically press to do them. - - -To get whether a key is pressed or not, use input.getKey("key"), where "key" is the name of the key, either physical or virtual. If virtual, all it does is then fetch the corrosponding key from keyboard anyway; but it allows one to change the controls while still making the same key requests in the code. - - -If you want to have multiple possibilities at once when it comes to which key to press to do something, you can! just put a "|" between the mappings. For example, say you wanted both "wasd" and arrow key controls to work, at the same time. How you do this is in the construstor below, where it says "keymap.put(" UP, DOWN, LEFT, and RIGHT. - - -This class supports modifier keys as inputs. To specify a "compound" key (one using modifiders), write "MOD1-MOD2-KEY", that is, "SHIFT-ALT-D" or "ALT-F", with a "-" between the keys. ALWAYS put the actual trigger key last, after all modifiers (the modifiers are: shift, ctrl, and alt). - - --All the magic happens in the getKey() method: If the String keyname input has hyphens("-"), then it's a compound key, and it splits it up between the hyphens. Then, it compares which modifiers are currently being pressed, and which are being requested. Then, a Key object is created, which if the modifiers match, reflects the non-modifier key's "down" and "clicked" values; otherwise they're both false. - --If a key with no hyph is requested, it skips most of that and just gives you the Key, generating it if needed. - - */ + * This class handles key presses; this also implements MouseListener... but I have no idea why. + * It's not used in any way. Ever. As far as I know. Anyway, here are a few tips about this class: + *

+ * -This class must instantiated to be used; and it's pretty much always called "input" in the code. + *

+ * -The keys are stored in two arrays, one for physical keyboard keys(called "keyboard"), and one for "keys" you make-up (called "keymap") to represent different actions ("virtual keys", you could say). + *

+ * -All the Keys in the keyboard array are generated automatically as you ask for them in the code (if they don't already exist), so there's no need to define anything in the keyboard array here. + * --Note: this shouldn't matter, but keys that are not asked for or defined as values here in keymap will be ignored when it comes to key presses. + *

+ * -All the "virtual keys" in keymap "map" to a Key object in the keyboard array; that is to say, + * keymap contains a HashMap of string keys, to string values. The keys are the names of the actions, + * and the values are the names of the keyboard keys you physically press to do them. + *

+ * -To get whether a key is pressed or not, use input.getKey("key"), where "key" is the name of the key, either physical or virtual. If virtual, all it does is then fetch the corrosponding key from keyboard anyway; but it allows one to change the controls while still making the same key requests in the code. + *

+ * -If you want to have multiple possibilities at once when it comes to which key to press to do something, you can! just put a "|" between the mappings. For example, say you wanted both "wasd" and arrow key controls to work, at the same time. How you do this is in the construstor below, where it says "keymap.put(" UP, DOWN, LEFT, and RIGHT. + *

+ * -This class supports modifier keys as inputs. To specify a "compound" key (one using modifiders), write "MOD1-MOD2-KEY", that is, "SHIFT-ALT-D" or "ALT-F", with a "-" between the keys. ALWAYS put the actual trigger key last, after all modifiers (the modifiers are: shift, ctrl, and alt). + *

+ * --All the magic happens in the getKey() method: If the String keyname input has hyphens("-"), then it's a compound key, and it splits it up between the hyphens. Then, it compares which modifiers are currently being pressed, and which are being requested. Then, a Key object is created, which if the modifiers match, reflects the non-modifier key's "down" and "clicked" values; otherwise they're both false. + * --If a key with no hyph is requested, it skips most of that and just gives you the Key, generating it if needed. + */ public String keyToChange = null; // This is used when listening to change key bindings. private String keyChanged = null; // This is used when listening to change key bindings. private boolean overwrite = false; @@ -64,20 +63,22 @@ public String getChangedKey() { } private static HashMap keyNames = new HashMap<>(); + static { Field[] keyEventFields = KeyEvent.class.getFields(); ArrayList keyConstants = new ArrayList<>(); - for (Field field: keyEventFields) { + for (Field field : keyEventFields) { if (field.getName().contains("VK_") && (field.getType().getName().equals(int.class.getName()))) keyConstants.add(field); } - for (Field keyConst: keyConstants) { + for (Field keyConst : keyConstants) { String name = keyConst.getName(); name = name.substring(3); // Removes the "VK_" try { - keyNames.put(((Integer)keyConst.get(0)), name); - } catch(IllegalAccessException ignored) {} + keyNames.put(((Integer) keyConst.get(0)), name); + } catch (IllegalAccessException ignored) { + } } // For compatibility becuase I'm lazy. :P @@ -117,6 +118,7 @@ public InputHandler() { Logging.CONTROLLER.debug("No Controllers Detected, moving on."); } } + public InputHandler(Component inputSource) { this(); inputSource.addKeyListener(this); // Add key listener to game @@ -166,6 +168,7 @@ private void initKeyMap() { // The button mapping should not be modifiable. private final HashMap buttonMap = new HashMap<>(); + private void initButtonMap() { buttonMap.put("MOVE-UP", ControllerButton.DPAD_UP); buttonMap.put("MOVE-DOWN", ControllerButton.DPAD_DOWN); @@ -198,13 +201,15 @@ public void resetKeyBindings() { initKeyMap(); } - /** Processes each key one by one, in keyboard. */ + /** + * Processes each key one by one, in keyboard. + */ public void tick() { lastKeyTyped = keyTypedBuffer; keyTypedBuffer = ""; inputMask = null; synchronized ("lock") { - for (PhysicalKey key: keyboard.values()) + for (PhysicalKey key : keyboard.values()) key.tick(); // Call tick() for each key. } @@ -216,7 +221,8 @@ public void tick() { controllerButtonBooleanMapJust.put(btn, controllerIndex.isButtonJustPressed(btn)); } catch (ControllerUnpluggedException e) { controllerButtonBooleanMapJust.put(btn, false); - } try { + } + try { controllerButtonBooleanMap.put(btn, controllerIndex.isButtonPressed(btn)); } catch (ControllerUnpluggedException e) { controllerButtonBooleanMap.put(btn, false); @@ -250,7 +256,10 @@ private static class PhysicalKey extends Key { protected boolean stayDown; - public PhysicalKey() { this(false); } + public PhysicalKey() { + this(false); + } + public PhysicalKey(boolean stayDown) { this.stayDown = stayDown; } @@ -265,17 +274,21 @@ public boolean isClicked() { return clicked; } - /** toggles the key down or not down. */ + /** + * toggles the key down or not down. + */ public void toggle(boolean pressed) { down = pressed; // Set down to the passed in value; the if statement is probably unnecessary... if (pressed && !sticky) presses++; // Add to the number of total presses. } - /** Processes the key presses. */ + /** + * Processes the key presses. + */ public void tick() { if (absorbs < presses) { // If there are more key presses to process... absorbs++; // Process them! - if(presses - absorbs > 3) absorbs = presses - 3; + if (presses - absorbs > 3) absorbs = presses - 3; clicked = true; // Make clicked true, since key presses are still being processed. } else { // All key presses so far for this key have been processed. if (!sticky) sticky = presses > 3; @@ -357,9 +370,11 @@ public void maskInput(@Nullable Predicate filter) { inputMask = inputMask == null ? filter : inputMask.and(filter); } - /** This is used to stop all of the actions when the game is out of focus. */ + /** + * This is used to stop all of the actions when the game is out of focus. + */ public void releaseAll() { - for (PhysicalKey key: keyboard.values()) { + for (PhysicalKey key : keyboard.values()) { key.release(); } } @@ -370,7 +385,9 @@ public void setKey(String keymapKey, String keyboardKey) { keymap.put(keymapKey, keyboardKey); } - /** Simply returns the mapped value of key in keymap. */ + /** + * Simply returns the mapped value of key in keymap. + */ public String getMapping(String actionKey) { actionKey = actionKey.toUpperCase(); if (lastInputActivityListener.lastButtonActivityTimestamp > lastInputActivityListener.lastKeyActivityTimestamp) { @@ -386,7 +403,8 @@ public String getMapping(String actionKey) { /** * Returning the corresponding mapping depends on the device last acted. - * @param keyMap The keyboard mapping. + * + * @param keyMap The keyboard mapping. * @param buttonMap The controller mapping * @return The selected mapping. */ @@ -399,6 +417,7 @@ public String selectMapping(String keyMap, String buttonMap) { /** * Getting the last input device type. + * * @return The input device type: 0 for keyboard, 1 for controller. */ public int getLastInputType() { @@ -421,7 +440,7 @@ public Key getMappedKey(String keyText) { if (keyText.contains("|")) { /// Multiple key possibilities exist for this action; so, combine the results of each one! ArrayList keys = new ArrayList<>(); - for (String keyposs: keyText.split("\\|")) { // String.split() uses regex, and "|" is a special character, so it must be escaped; but the backslash must be passed in, so it needs escaping. + for (String keyposs : keyText.split("\\|")) { // String.split() uses regex, and "|" is a special character, so it must be escaped; but the backslash must be passed in, so it needs escaping. // It really does combine using "or": keys.add(getMappedKey(keyposs)); } @@ -440,6 +459,7 @@ public Key getMappedKey(String keyText) { //if(key.clicked && Game.debug) System.out.println("Processed key: " + keytext + " is clicked; tickNum=" + ticks); return new CompoundedKey(keys); // Return the Key object. } + // Physical keys only private Key getKey(String keytext) { // If the passed-in key is blank, or null, then return null. @@ -450,7 +470,7 @@ private Key getKey(String keytext) { if (keytext.contains("|")) { /// Multiple key possibilities exist for this action; so, combine the results of each one! ArrayList keys = new ArrayList<>(); - for (String keyposs: keytext.split("\\|")) { // String.split() uses regex, and "|" is a special character, so it must be escaped; but the backslash must be passed in, so it needs escaping. + for (String keyposs : keytext.split("\\|")) { // String.split() uses regex, and "|" is a special character, so it must be escaped; but the backslash must be passed in, so it needs escaping. // It really does combine using "or": keys.add(getKey(keyposs)); } @@ -532,8 +552,8 @@ private void toggle(int keycode, boolean pressed) { //System.out.println("Interpreted key press: " + keytext); //System.out.println("Toggling " + keytext + " key (keycode " + keycode + ") to "+pressed+"."); - if( pressed && keyToChange != null && !isMod(keytext) ) { - keymap.put(keyToChange, ( overwrite ? "" : keymap.get(keyToChange) + "|" ) + getCurModifiers() + keytext); + if (pressed && keyToChange != null && !isMod(keytext)) { + keymap.put(keyToChange, (overwrite ? "" : keymap.get(keyToChange) + "|") + getCurModifiers() + keytext); keyChanged = keyToChange; keyToChange = null; return; @@ -581,15 +601,17 @@ private static boolean isMod(String keyname) { private String getCurModifiers() { return (getKey("ctrl").isDown() ? "CTRL-" : "") + - (getKey("alt").isDown() ? "ALT-" : "") + - (getKey("shift").isDown() ? "SHIFT-" : ""); + (getKey("alt").isDown() ? "ALT-" : "") + + (getKey("shift").isDown() ? "SHIFT-" : ""); } - /** Used by Save.java, to save user key preferences. */ + /** + * Used by Save.java, to save user key preferences. + */ public String[] getKeyPrefs() { ArrayList keystore = new ArrayList<>(); // Make a list for keys - for (String keyname: keymap.keySet()) // Go though each mapping + for (String keyname : keymap.keySet()) // Go though each mapping keystore.add(keyname + ";" + keymap.get(keyname)); // Add the mapping values as one string, seperated by a semicolon. return keystore.toArray(new String[0]); // Return the array of encoded key preferences. @@ -607,19 +629,26 @@ public void addKeyBinding(String actionKey) { } /// Event methods, many to satisfy interface requirements... - public void keyPressed(KeyEvent ke) { toggle(ke.getExtendedKeyCode(), true); } - public void keyReleased(KeyEvent ke) { toggle(ke.getExtendedKeyCode(), false); } + public void keyPressed(KeyEvent ke) { + toggle(ke.getExtendedKeyCode(), true); + } + + public void keyReleased(KeyEvent ke) { + toggle(ke.getExtendedKeyCode(), false); + } + public void keyTyped(KeyEvent ke) { // Stores the last character typed keyTypedBuffer = String.valueOf(ke.getKeyChar()); } private static final String control = "\\p{Print}"; // Should match only printable characters. + public String addKeyTyped(String typing, @Nullable String pattern) { if (lastKeyTyped.length() > 0) { String letter = lastKeyTyped; lastKeyTyped = ""; - if ( letter.matches(control) && (pattern == null || letter.matches(pattern)) || letter.equals("\b") ) + if (letter.matches(control) && (pattern == null || letter.matches(pattern)) || letter.equals("\b")) typing += letter; } @@ -688,7 +717,7 @@ public boolean inputDown(String mapping) { * vibration (maybe the controller doesn't support left/right vibration, maybe it was unplugged in the * middle of trying, etc...) * - * @param leftMagnitude The speed for the left motor to vibrate (this should be between 0 and 1) + * @param leftMagnitude The speed for the left motor to vibrate (this should be between 0 and 1) * @param rightMagnitude The speed for the right motor to vibrate (this should be between 0 and 1) * @return Whether or not the controller was able to be vibrated (i.e. if haptics are supported) or controller not connected. */ @@ -714,6 +743,7 @@ public boolean leftTriggerPressed() { return false; } } + public boolean rightTriggerPressed() { try { if (rightTriggerCooldown == 0 && controllerIndex.getAxisState(ControllerAxis.TRIGGERRIGHT) > 0.5) { diff --git a/src/client/java/minicraft/core/io/Localization.java b/src/client/java/minicraft/core/io/Localization.java index 019aa243a..3d74cff79 100644 --- a/src/client/java/minicraft/core/io/Localization.java +++ b/src/client/java/minicraft/core/io/Localization.java @@ -27,7 +27,8 @@ public class Localization { /** * Get the provided key's localization for the currently selected language. - * @param key The key to localize. + * + * @param key The key to localize. * @param arguments The additional arguments to format the localized string. * @return A localized string. */ @@ -39,12 +40,14 @@ public static String getLocalized(String key, Object... arguments) { try { Double.parseDouble(key); return key; // This is a number; don't try to localize it - } catch(NumberFormatException ignored) {} + } catch (NumberFormatException ignored) { + } String localString = localization.get(key); if (localString == null) { - if (!knownUnlocalizedStrings.containsKey(selectedLocale)) knownUnlocalizedStrings.put(selectedLocale, new HashSet<>()); + if (!knownUnlocalizedStrings.containsKey(selectedLocale)) + knownUnlocalizedStrings.put(selectedLocale, new HashSet<>()); if (!knownUnlocalizedStrings.get(selectedLocale).contains(key)) { Logger.tag("LOC").trace(unlocalizedStringTracing ? new Throwable("Tracing") : null, "{}: '{}' is unlocalized.", selectedLocale.toLanguageTag(), key); knownUnlocalizedStrings.get(selectedLocale).add(key); @@ -60,12 +63,16 @@ public static String getLocalized(String key, Object... arguments) { /** * Gets the currently selected locale. + * * @return A locale object. */ - public static Locale getSelectedLocale() { return selectedLocale; } + public static Locale getSelectedLocale() { + return selectedLocale; + } /** * Get the currently selected locale, but as a full name without the country code. + * * @return A string with the name of the language. */ @NotNull @@ -75,20 +82,27 @@ public static LocaleInformation getSelectedLanguage() { /** * Gets a list of all the known locales. + * * @return A list of locales. */ @NotNull - public static LocaleInformation[] getLocales() { return localeInfo.values().toArray(new LocaleInformation[0]); } + public static LocaleInformation[] getLocales() { + return localeInfo.values().toArray(new LocaleInformation[0]); + } /** * Changes the selected language and loads it. * If the provided language doesn't exist, it loads the default locale. + * * @param newLanguage The language-country code of the language to load. */ public static void changeLanguage(@NotNull String newLanguage) { changeLanguage(Locale.forLanguageTag(newLanguage)); } - /** @see #changeLanguage(String) */ + + /** + * @see #changeLanguage(String) + */ public static void changeLanguage(@NotNull Locale newLanguage) { selectedLocale = newLanguage; loadLanguage(); diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index ce0c92622..792a5639e 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -43,29 +43,39 @@ public final class Settings { /** * Returns the value of the specified option. + * * @param option The setting to get. * @return The value of the setting */ - public static Object get(String option) { return options.get(option.toLowerCase()).getValue(); } + public static Object get(String option) { + return options.get(option.toLowerCase()).getValue(); + } /** * Returns the index of the value in the list of values for the specified option. + * * @param option The setting to get. * @return The index of the setting. */ - public static int getIdx(String option) { return options.get(option.toLowerCase()).getSelection(); } + public static int getIdx(String option) { + return options.get(option.toLowerCase()).getSelection(); + } /** * Return the ArrayEntry object associated with the given option name. + * * @param option The setting to get. * @return The ArrayEntry. */ - public static ArrayEntry getEntry(String option) { return options.get(option.toLowerCase()); } + public static ArrayEntry getEntry(String option) { + return options.get(option.toLowerCase()); + } /** * Sets the value of the given option name, to the given value, provided it is a valid value for that option. + * * @param option The setting to edit. - * @param value The value to change to. + * @param value The value to change to. */ public static void set(String option, Object value) { options.get(option.toLowerCase()).setValue(value); @@ -73,8 +83,9 @@ public static void set(String option, Object value) { /** * Sets the index of the value of the given option, provided it is a valid index. + * * @param option The setting to edit. - * @param idx Index to select. + * @param idx Index to select. */ public static void setIdx(String option, int idx) { options.get(option.toLowerCase()).setSelection(idx); @@ -83,6 +94,7 @@ public static void setIdx(String option, int idx) { /** * Gets the refresh rate of the default monitor. * Safely handles headless environments (if that were to happen for some reason). + * * @return The refresh rate if successful. 60 if not. */ private static int getDefaultRefreshRate() { diff --git a/src/client/java/minicraft/core/io/Sound.java b/src/client/java/minicraft/core/io/Sound.java index fd547a7a3..09d9cc032 100644 --- a/src/client/java/minicraft/core/io/Sound.java +++ b/src/client/java/minicraft/core/io/Sound.java @@ -36,7 +36,7 @@ public static void loadSound(String key, InputStream in, String pack) { DataLine.Info info = new DataLine.Info(Clip.class, AudioSystem.getAudioFileFormat(in).getFormat()); if (!AudioSystem.isLineSupported(info)) { - Logging.RESOURCEHANDLER_SOUND.error("ERROR: Audio format of file \"{}\" in pack \"\" is not supported: {}", key, pack, AudioSystem.getAudioFileFormat(in)); + Logging.RESOURCEHANDLER_SOUND.error("ERROR: Audio format of file \"{}\" in pack \"\" is not supported: {}", key, pack, AudioSystem.getAudioFileFormat(in)); Logging.RESOURCEHANDLER_SOUND.error("Supported audio formats:"); Logging.RESOURCEHANDLER_SOUND.error("-source:"); @@ -51,13 +51,11 @@ public static void loadSound(String key, InputStream in, String pack) { } } Logging.RESOURCEHANDLER_SOUND.error("-target:"); - for (int i = 0; i < tinfo.length; i++) - { - if (tinfo[i] instanceof DataLine.Info) - { + for (int i = 0; i < tinfo.length; i++) { + if (tinfo[i] instanceof DataLine.Info) { DataLine.Info dataLineInfo = (DataLine.Info) tinfo[i]; AudioFormat[] supportedFormats = dataLineInfo.getFormats(); - for (AudioFormat af: supportedFormats) + for (AudioFormat af : supportedFormats) Logging.RESOURCEHANDLER_SOUND.error(af); } } @@ -65,7 +63,7 @@ public static void loadSound(String key, InputStream in, String pack) { return; } - Clip clip = (Clip)AudioSystem.getLine(info); + Clip clip = (Clip) AudioSystem.getLine(info); clip.open(AudioSystem.getAudioInputStream(in)); clip.addLineListener(e -> { @@ -83,26 +81,32 @@ public static void loadSound(String key, InputStream in, String pack) { } } - /** Recommend {@link #play(String)} and {@link #loop(String, boolean)}. */ + /** + * Recommend {@link #play(String)} and {@link #loop(String, boolean)}. + */ @Nullable public static Sound getSound(String key) { return sounds.get(key); } - /** This method does safe check for {@link #play()}. */ + /** + * This method does safe check for {@link #play()}. + */ public static void play(String key) { Sound sound = sounds.get(key); if (sound != null) sound.play(); } - /** This method does safe check for {@link #loop(boolean)}. */ + /** + * This method does safe check for {@link #loop(boolean)}. + */ public static void loop(String key, boolean start) { Sound sound = sounds.get(key); if (sound != null) sound.loop(start); } public void play() { - if (!(boolean)Settings.get("sound") || clip == null) return; + if (!(boolean) Settings.get("sound") || clip == null) return; if (clip.isRunning() || clip.isActive()) clip.stop(); @@ -111,7 +115,7 @@ public void play() { } public void loop(boolean start) { - if (!(boolean)Settings.get("sound") || clip == null) return; + if (!(boolean) Settings.get("sound") || clip == null) return; if (start) clip.loop(Clip.LOOP_CONTINUOUSLY); diff --git a/src/client/java/minicraft/entity/Arrow.java b/src/client/java/minicraft/entity/Arrow.java index c5220d4a9..19cb2a13b 100644 --- a/src/client/java/minicraft/entity/Arrow.java +++ b/src/client/java/minicraft/entity/Arrow.java @@ -23,8 +23,9 @@ public class Arrow extends Entity implements ClientTickable { public Arrow(Mob owner, Direction dir, int dmg) { this(owner, owner.x, owner.y, dir, dmg); } + public Arrow(Mob owner, int x, int y, Direction dir, int dmg) { - super(Math.abs(dir.getX())+1, Math.abs(dir.getY())+1); + super(Math.abs(dir.getX()) + 1, Math.abs(dir.getY()) + 1); this.owner = owner; this.x = x; this.y = y; @@ -34,9 +35,9 @@ public Arrow(Mob owner, int x, int y, Direction dir, int dmg) { col = Color.get(-1, 111, 222, 430); int xt = 0; - if(dir == Direction.LEFT) xt = 1; - if(dir == Direction.UP) xt = 2; - if(dir == Direction.DOWN) xt = 3; + if (dir == Direction.LEFT) xt = 1; + if (dir == Direction.UP) xt = 2; + if (dir == Direction.DOWN) xt = 3; sprite.setSpritePos(xt, 0); if (damage > 3) speed = 8; @@ -46,10 +47,11 @@ public Arrow(Mob owner, int x, int y, Direction dir, int dmg) { /** * Generates information about the arrow. + * * @return string representation of owner, xdir, ydir and damage. */ public String getData() { - return owner.eid + ":" + dir.ordinal() + ":"+damage; + return owner.eid + ":" + dir.ordinal() + ":" + damage; } @Override @@ -75,8 +77,8 @@ public void tick() { } if (!level.getTile(x / 16, y / 16).mayPass(level, x / 16, y / 16, this) - && !level.getTile(x / 16, y / 16).connectsToFluid - && level.getTile(x / 16, y / 16).id != 16) { + && !level.getTile(x / 16, y / 16).connectsToFluid + && level.getTile(x / 16, y / 16).id != 16) { this.remove(); try { sprite.destroy(); diff --git a/src/client/java/minicraft/entity/ClientTickable.java b/src/client/java/minicraft/entity/ClientTickable.java index 81cc73998..55c4325d8 100644 --- a/src/client/java/minicraft/entity/ClientTickable.java +++ b/src/client/java/minicraft/entity/ClientTickable.java @@ -1,9 +1,9 @@ package minicraft.entity; public interface ClientTickable extends Tickable { - + default void clientTick() { tick(); } - + } diff --git a/src/client/java/minicraft/entity/Direction.java b/src/client/java/minicraft/entity/Direction.java index 68c93f079..291be85f9 100644 --- a/src/client/java/minicraft/entity/Direction.java +++ b/src/client/java/minicraft/entity/Direction.java @@ -13,11 +13,17 @@ public enum Direction { public static final Direction[] values = Direction.values(); - public int getX() { return x; } - public int getY() { return y; } + public int getX() { + return x; + } + + public int getY() { + return y; + } public static Direction getDirection(int xd, int yd) { - if (xd == 0 && yd == 0) return Direction.NONE; // The attack was from the same entity, probably; or at least the exact same space. + if (xd == 0 && yd == 0) + return Direction.NONE; // The attack was from the same entity, probably; or at least the exact same space. if (Math.abs(xd) > Math.abs(yd)) { // The x distance is more prominent than the y distance @@ -34,7 +40,10 @@ public static Direction getDirection(int xd, int yd) { } public static Direction getDirection(int dir) { - return values[dir+1]; + return values[dir + 1]; + } + + public int getDir() { + return ordinal() - 1; } - public int getDir() { return ordinal()-1; } } diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index 81d245aae..6dc8089da 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -49,6 +49,7 @@ public abstract class Entity implements Tickable { * Assings null/none values to the instace variables. * The exception is removed which is set to true, and * lastUpdate which is set to System.nanoTime(). + * * @param xr X radius of entity. * @param yr Y radius of entity. */ @@ -70,48 +71,84 @@ public Entity(int xr, int yr) { // Add color to this later, in color update /** * Returns true if the entity is removed from the level, otherwise false. + * * @return removed */ - public boolean isRemoved() { return removed/* || level == null*/; } + public boolean isRemoved() { + return removed/* || level == null*/; + } /** * Returns the level which this entity belongs in. + * * @return level */ - public Level getLevel() { return level; } + public Level getLevel() { + return level; + } - /** Returns a Rectangle instance using the defined bounds of the entity. */ - protected Rectangle getBounds() { return new Rectangle(x, y, xr * 2, yr * 2, Rectangle.CENTER_DIMS); } + /** + * Returns a Rectangle instance using the defined bounds of the entity. + */ + protected Rectangle getBounds() { + return new Rectangle(x, y, xr * 2, yr * 2, Rectangle.CENTER_DIMS); + } - /** Returns true if this entity is found in the rectangle specified by given two coordinates. */ - public boolean isTouching(Rectangle area) { return area.intersects(getBounds()); } + /** + * Returns true if this entity is found in the rectangle specified by given two coordinates. + */ + public boolean isTouching(Rectangle area) { + return area.intersects(getBounds()); + } - /** Returns if this entity stops other solid entities from moving. */ - public boolean isSolid() { return true; } // Most entities are solid + /** + * Returns if this entity stops other solid entities from moving. + */ + public boolean isSolid() { + return true; + } // Most entities are solid + + /** + * Determines if the given entity should prevent this entity from moving. + */ + public boolean blocks(Entity e) { + return isSolid() && e.isSolid(); + } + + public boolean canSwim() { + return false; + } // Determines if the entity can swim (extended in sub-classes) - /** Determines if the given entity should prevent this entity from moving. */ - public boolean blocks(Entity e) { return isSolid() && e.isSolid(); } + public boolean canWool() { + return false; + } // This, strangely enough, determines if the entity can walk on wool; among some other things..? - public boolean canSwim() { return false; } // Determines if the entity can swim (extended in sub-classes) - public boolean canWool() { return false; } // This, strangely enough, determines if the entity can walk on wool; among some other things..? public boolean canBurn() { return true; } // Determines if the entity can burn. + public boolean canBeAffectedByLava() { return true; } // Determines if the entity can burn in lava. + public int burningDuration = 0; - public int getLightRadius() { return 0; } // Used for lanterns... and player? that might be about it, though, so idk if I want to put it here. + public int getLightRadius() { + return 0; + } // Used for lanterns... and player? that might be about it, though, so idk if I want to put it here. - /** If this entity is touched by another entity (extended by sub-classes) */ - protected void touchedBy(Entity entity) {} + /** + * If this entity is touched by another entity (extended by sub-classes) + */ + protected void touchedBy(Entity entity) { + } /** * Interacts with the entity this method is called on - * @param player The player attacking - * @param item The item the player attacked with + * + * @param player The player attacking + * @param item The item the player attacked with * @param attackDir The direction to interact * @return If the interaction was successful */ @@ -119,7 +156,9 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) return false; } - /** Moves an entity horizontally and vertically. Returns whether entity was unimpeded in it's movement. */ + /** + * Moves an entity horizontally and vertically. Returns whether entity was unimpeded in it's movement. + */ public boolean move(int xd, int yd) { if (Updater.saving || (xd == 0 && yd == 0)) return true; // Pretend that it kept moving @@ -134,6 +173,7 @@ public boolean move(int xd, int yd) { /** * Moves the entity a long only on X axis without "teleporting". * Will throw exception otherwise. + * * @param d Displacement relative to the axis. * @return true if the move was successful, false if not. */ @@ -167,6 +207,7 @@ protected boolean moveX(int d) { /** * Moves the entity a long only on X axis without "teleporting". * Will throw exception otherwise. + * * @param d Displacement relative to the axis. * @return true if the move was successful, false if not. */ @@ -199,16 +240,17 @@ protected boolean moveY(int d) { /** * Moves the entity by checking entity hit boxes being interacted with the given possible length of straight path. - * @param sgn One-dimensional direction of displacement - * @param hitBoxFront The front boundary of hit box - * @param maxFront Maximum position can be reached with front hit box (firstly checked by tile hot box) - * @param xMove The value of the willing x movement - * @param yMove The value of the willing y movement - * @param incrementMove The movement call when the movement is possible - * @param hitBoxLeft The left boundary of hit box - * @param hitBoxRight The right boundary of hit box - * @param bumpingHandler The consumer handling bumping into a new tile; - * the first parameter takes the front tile position and second one takes the horizontal position + * + * @param sgn One-dimensional direction of displacement + * @param hitBoxFront The front boundary of hit box + * @param maxFront Maximum position can be reached with front hit box (firstly checked by tile hot box) + * @param xMove The value of the willing x movement + * @param yMove The value of the willing y movement + * @param incrementMove The movement call when the movement is possible + * @param hitBoxLeft The left boundary of hit box + * @param hitBoxRight The right boundary of hit box + * @param bumpingHandler The consumer handling bumping into a new tile; + * the first parameter takes the front tile position and second one takes the horizontal position * @param steppingHandler The consumer handling stepping on a new tile; * the first parameter takes the front tile position and second one takes the horizontal position * @return {@code true} if the movement is successful, {@code false} otherwise. @@ -261,13 +303,22 @@ protected boolean moveByEntityHitBoxChecks(int sgn, int hitBoxFront, int maxFron return successful; } - /** Checks if the entity is able to naturally be despawned in general conditions. Handles (despawns) if true. */ - public void handleDespawn() {} + /** + * Checks if the entity is able to naturally be despawned in general conditions. Handles (despawns) if true. + */ + public void handleDespawn() { + } - /** This exists as a way to signify that the entity has been removed through player action and/or world action; basically, it's actually gone, not just removed from a level because it's out of range or something. Calls to this method are used to, say, drop items. */ - public void die() { remove(); } + /** + * This exists as a way to signify that the entity has been removed through player action and/or world action; basically, it's actually gone, not just removed from a level because it's out of range or something. Calls to this method are used to, say, drop items. + */ + public void die() { + remove(); + } - /** Removes the entity from the level. */ + /** + * Removes the entity from the level. + */ public void remove() { if (removed && !(this instanceof ItemEntity)) // Apparently this happens fairly often with item entities. Logging.ENTITY.debug("Note: remove() called on removed entity: " + this); @@ -280,7 +331,9 @@ public void remove() { level.remove(this); } - /** This should ONLY be called by the Level class. To properly remove an entity from a level, use level.remove(entity) */ + /** + * This should ONLY be called by the Level class. To properly remove an entity from a level, use level.remove(entity) + */ public void remove(Level level) { if (level != this.level) { Logging.ENTITY.debug("Tried to remove entity " + this + " from level it is not in: " + level + "; in level " + this.level); @@ -290,7 +343,9 @@ public void remove(Level level) { } } - /** This should ONLY be called by the Level class. To properly add an entity to a level, use level.add(entity) */ + /** + * This should ONLY be called by the Level class. To properly add an entity to a level, use level.add(entity) + */ public void setLevel(Level level, int x, int y) { if (level == null) { Logging.ENTITY.debug("Tried to set level of entity " + this + " to a null level; Should use remove(level)"); @@ -308,7 +363,8 @@ public void setLevel(Level level, int x, int y) { public boolean isWithin(int tileRadius, Entity other) { if (level == null || other.getLevel() == null) return false; - if (level.depth != other.getLevel().depth) return false; // Obviously, if they are on different levels, they can't be next to each other. + if (level.depth != other.getLevel().depth) + return false; // Obviously, if they are on different levels, they can't be next to each other. double distance = Math.abs(Math.hypot(x - other.x, y - other.y)); // Calculate the distance between the two entities, in entity coordinates. @@ -317,6 +373,7 @@ public boolean isWithin(int tileRadius, Entity other) { /** * Returns the closest player to this entity. + * * @return the closest player. */ protected Player getClosestPlayer() { @@ -326,6 +383,7 @@ protected Player getClosestPlayer() { /** * Returns the closes player to this entity. * If this is called on a player it can return itself. + * * @param returnSelf determines if the method can return itself. * @return The closest player to this entity. */ @@ -338,7 +396,10 @@ protected Player getClosestPlayer(boolean returnSelf) { return level.getClosestPlayer(x, y); } - public String toString() { return getClass().getSimpleName() + getDataPrints(); } + public String toString() { + return getClass().getSimpleName() + getDataPrints(); + } + protected List getDataPrints() { List prints = new ArrayList<>(); prints.add("eid=" + eid); @@ -351,5 +412,7 @@ public final boolean equals(Object other) { } @Override - public final int hashCode() { return eid; } + public final int hashCode() { + return eid; + } } diff --git a/src/client/java/minicraft/entity/FireSpark.java b/src/client/java/minicraft/entity/FireSpark.java index 06dd9daf3..9f07662d3 100644 --- a/src/client/java/minicraft/entity/FireSpark.java +++ b/src/client/java/minicraft/entity/FireSpark.java @@ -20,9 +20,10 @@ public class FireSpark extends Entity { /** * Creates a new spark. Owner is the Obsidian Knight which is spawning this spark. + * * @param owner The Obsidian Knight spawning the spark. - * @param xa X velocity. - * @param ya Y velocity. + * @param xa X velocity. + * @param ya Y velocity. */ public FireSpark(ObsidianKnight owner, double xa, double ya) { super(0, 0); @@ -59,7 +60,8 @@ public void tick() { yy += ya; boolean stopped = true; //noinspection RedundantIfStatement - if (moveX(((int) xx) - x0)) stopped = false; // This kind of difference is handled due to errors by flooring. + if (moveX(((int) xx) - x0)) + stopped = false; // This kind of difference is handled due to errors by flooring. if (moveY(((int) yy) - y0)) stopped = false; if (stopped) { this.stopped = true; @@ -74,7 +76,9 @@ public void tick() { } } - /** Can this entity block you? Nope. */ + /** + * Can this entity block you? Nope. + */ public boolean isSolid() { return false; } @@ -102,6 +106,7 @@ public void render(Screen screen) { /** * Returns the owners id as a string. + * * @return the owners id as a string. */ public String getData() { diff --git a/src/client/java/minicraft/entity/ItemEntity.java b/src/client/java/minicraft/entity/ItemEntity.java index 6c7e09083..be94bd7ef 100644 --- a/src/client/java/minicraft/entity/ItemEntity.java +++ b/src/client/java/minicraft/entity/ItemEntity.java @@ -20,9 +20,10 @@ public class ItemEntity extends Entity implements ClientTickable { /** * Creates an item entity of the item item at position (x,y) with size 2*2. + * * @param item Item to add as item entity - * @param x position on map - * @param y position on map + * @param x position on map + * @param y position on map */ public ItemEntity(Item item, int x, int y) { super(2, 2); @@ -45,15 +46,16 @@ public ItemEntity(Item item, int x, int y) { /** * Creates an item entity of the item item at position (x,y) with size 2*2. - * @param item Item to add as item entity. - * @param x position on map - * @param y position on map - * @param zz z position? + * + * @param item Item to add as item entity. + * @param x position on map + * @param y position on map + * @param zz z position? * @param lifetime lifetime (in ticks) of the entity. - * @param time starting time (in ticks) of the entity. - * @param xa x velocity - * @param ya y velocity - * @param za z velocity? + * @param time starting time (in ticks) of the entity. + * @param xa x velocity + * @param ya y velocity + * @param za z velocity? */ public ItemEntity(Item item, int x, int y, double zz, int lifetime, int time, double xa, double ya, double za) { this(item, x, y); @@ -67,10 +69,11 @@ public ItemEntity(Item item, int x, int y, double zz, int lifetime, int time, do /** * Returns a string representation of the itementity + * * @return string representation of this entity */ public String getData() { - return String.join(":", (new String[] {item.getData(), zz + "", lifeTime+"", time + "", xa + "", ya + "", za + ""})); + return String.join(":", (new String[]{item.getData(), zz + "", lifeTime + "", time + "", xa + "", ya + "", za + ""})); } @Override @@ -128,18 +131,18 @@ public void render(Screen screen) { if (time / 6 % 2 == 0) return; } - screen.render(x-4, y - 4, item.sprite.getSprite(), 0, false, Color.get(0, 31)); // Item shadow + screen.render(x - 4, y - 4, item.sprite.getSprite(), 0, false, Color.get(0, 31)); // Item shadow screen.render(x - 4, y - 4 - (int) zz, item.sprite); // Item } @Override protected void touchedBy(Entity entity) { - if(!(entity instanceof Player)) return; // For the time being, we only care when a player touches an item. + if (!(entity instanceof Player)) return; // For the time being, we only care when a player touches an item. if (time > 30) { // Conditional prevents this from being collected immediately. if (!pickedUp) {// Don't register if we are online and a player touches it; the client will register that. pickedUp = true; - ((Player)entity).pickupItem(this); + ((Player) entity).pickupItem(this); pickedUp = isRemoved(); } } diff --git a/src/client/java/minicraft/entity/ItemHolder.java b/src/client/java/minicraft/entity/ItemHolder.java index 6e374cfb7..6d6b3191d 100644 --- a/src/client/java/minicraft/entity/ItemHolder.java +++ b/src/client/java/minicraft/entity/ItemHolder.java @@ -3,7 +3,7 @@ import minicraft.item.Inventory; public interface ItemHolder { - + Inventory getInventory(); - + } diff --git a/src/client/java/minicraft/entity/Spark.java b/src/client/java/minicraft/entity/Spark.java index 4ce29a876..f937abe67 100644 --- a/src/client/java/minicraft/entity/Spark.java +++ b/src/client/java/minicraft/entity/Spark.java @@ -19,9 +19,10 @@ public class Spark extends Entity { /** * Creates a new spark. Owner is the AirWizard which is spawning this spark. + * * @param owner The AirWizard spawning the spark. - * @param xa X velocity. - * @param ya Y velocity. + * @param xa X velocity. + * @param ya Y velocity. */ public Spark(AirWizard owner, double xa, double ya) { super(0, 0); @@ -50,12 +51,14 @@ public void tick() { y = (int) yy; Player player = getClosestPlayer(); - if (player.isWithin(0,this)) { - player.hurt(owner,1); + if (player.isWithin(0, this)) { + player.hurt(owner, 1); } } - /** Can this entity block you? Nope. */ + /** + * Can this entity block you? Nope. + */ public boolean isSolid() { return false; } @@ -72,7 +75,6 @@ public void render(Screen screen) { } - randmirror = random.nextInt(4); } @@ -83,6 +85,7 @@ public void render(Screen screen) { /** * Returns the owners id as a string. + * * @return the owners id as a string. */ public String getData() { diff --git a/src/client/java/minicraft/entity/Tickable.java b/src/client/java/minicraft/entity/Tickable.java index c39c8f4d8..1ab3e4e42 100644 --- a/src/client/java/minicraft/entity/Tickable.java +++ b/src/client/java/minicraft/entity/Tickable.java @@ -2,7 +2,9 @@ public interface Tickable { - /** Called every frame before Render() is called. Most game functionality in the game is based on this method.*/ + /** + * Called every frame before Render() is called. Most game functionality in the game is based on this method. + */ void tick(); } diff --git a/src/client/java/minicraft/entity/furniture/Bed.java b/src/client/java/minicraft/entity/furniture/Bed.java index 41f57fd99..f9515c00a 100644 --- a/src/client/java/minicraft/entity/furniture/Bed.java +++ b/src/client/java/minicraft/entity/furniture/Bed.java @@ -22,7 +22,9 @@ public Bed() { super("Bed", new LinkedSprite(SpriteType.Entity, "bed"), new LinkedSprite(SpriteType.Item, "bed"), 3, 2); } - /** Called when the player attempts to get in bed. */ + /** + * Called when the player attempts to get in bed. + */ public boolean use(Player player) { if (checkCanSleep(player)) { // If it is late enough in the day to sleep... @@ -44,7 +46,7 @@ public static boolean checkCanSleep(Player player) { if (!(Updater.tickCount >= Updater.sleepStartTime || Updater.tickCount < Updater.sleepEndTime && Updater.pastDay1)) { // It is too early to sleep; display how much time is remaining. - int sec = (int)Math.ceil((Updater.sleepStartTime - Updater.tickCount)*1.0 / Updater.normSpeed); // gets the seconds until sleeping is allowed. // normSpeed is in tiks/sec. + int sec = (int) Math.ceil((Updater.sleepStartTime - Updater.tickCount) * 1.0 / Updater.normSpeed); // gets the seconds until sleeping is allowed. // normSpeed is in tiks/sec. String note = Localization.getLocalized("minicraft.notification.cannot_sleep", sec / 60, sec % 60); Game.notifications.add(note); // Add the notification displaying the time remaining in minutes and seconds. @@ -54,9 +56,14 @@ public static boolean checkCanSleep(Player player) { return true; } - public static boolean sleeping() { return playersAwake == 0; } + public static boolean sleeping() { + return playersAwake == 0; + } + + public static boolean inBed(Player player) { + return sleepingPlayers.containsKey(player); + } - public static boolean inBed(Player player) { return sleepingPlayers.containsKey(player); } public static Level getBedLevel(Player player) { Bed bed = sleepingPlayers.get(player); if (bed == null) @@ -69,7 +76,9 @@ public static void removePlayer(Player player) { sleepingPlayers.remove(player); } - public static void removePlayers() { sleepingPlayers.clear(); } + public static void removePlayers() { + sleepingPlayers.clear(); + } // Client should not call this. public static void restorePlayer(Player player) { @@ -83,9 +92,10 @@ public static void restorePlayer(Player player) { playersAwake = 1; } } + // Client should not call this. public static void restorePlayers() { - for (Player p: sleepingPlayers.keySet()) { + for (Player p : sleepingPlayers.keySet()) { Bed bed = sleepingPlayers.get(p); bed.getLevel().add(p); } diff --git a/src/client/java/minicraft/entity/furniture/Chest.java b/src/client/java/minicraft/entity/furniture/Chest.java index 71944b462..395d78dcf 100644 --- a/src/client/java/minicraft/entity/furniture/Chest.java +++ b/src/client/java/minicraft/entity/furniture/Chest.java @@ -20,11 +20,17 @@ public class Chest extends Furniture implements ItemHolder { private Inventory inventory; // Inventory of the chest - public Chest() { this("Chest"); } + public Chest() { + this("Chest"); + } + + public Chest(String name) { + this(name, new LinkedSprite(SpriteType.Item, "chest")); + } - public Chest(String name) { this(name, new LinkedSprite(SpriteType.Item, "chest")); } /** * Creates a chest with a custom name. + * * @param name Name of chest. */ public Chest(String name, LinkedSprite itemSprite) { @@ -33,7 +39,9 @@ public Chest(String name, LinkedSprite itemSprite) { inventory = new Inventory(); // Initialize the inventory. } - /** This is what occurs when the player uses the "Menu" command near this */ + /** + * This is what occurs when the player uses the "Menu" command near this + */ public boolean use(Player player) { Game.setDisplay(new ContainerDisplay(player, this)); return true; diff --git a/src/client/java/minicraft/entity/furniture/Crafter.java b/src/client/java/minicraft/entity/furniture/Crafter.java index 27f40ee23..49fab3dd5 100644 --- a/src/client/java/minicraft/entity/furniture/Crafter.java +++ b/src/client/java/minicraft/entity/furniture/Crafter.java @@ -14,12 +14,12 @@ public class Crafter extends Furniture { public enum Type { - Workbench (new LinkedSprite(SpriteType.Entity, "workbench"), new LinkedSprite(SpriteType.Item, "workbench"), 3, 2, Recipes.workbenchRecipes), - Oven (new LinkedSprite(SpriteType.Entity, "oven"), new LinkedSprite(SpriteType.Item, "oven"), 3, 2, Recipes.ovenRecipes), - Furnace (new LinkedSprite(SpriteType.Entity, "furnace"), new LinkedSprite(SpriteType.Item, "furnace"), 3, 2, Recipes.furnaceRecipes), - Anvil (new LinkedSprite(SpriteType.Entity, "anvil"), new LinkedSprite(SpriteType.Item, "anvil"), 3, 2, Recipes.anvilRecipes), - Enchanter (new LinkedSprite(SpriteType.Entity, "enchanter"), new LinkedSprite(SpriteType.Item, "enchanter"), 7, 2, Recipes.enchantRecipes), - Loom (new LinkedSprite(SpriteType.Entity, "loom"), new LinkedSprite(SpriteType.Item, "loom"), 7, 2, Recipes.loomRecipes); + Workbench(new LinkedSprite(SpriteType.Entity, "workbench"), new LinkedSprite(SpriteType.Item, "workbench"), 3, 2, Recipes.workbenchRecipes), + Oven(new LinkedSprite(SpriteType.Entity, "oven"), new LinkedSprite(SpriteType.Item, "oven"), 3, 2, Recipes.ovenRecipes), + Furnace(new LinkedSprite(SpriteType.Entity, "furnace"), new LinkedSprite(SpriteType.Item, "furnace"), 3, 2, Recipes.furnaceRecipes), + Anvil(new LinkedSprite(SpriteType.Entity, "anvil"), new LinkedSprite(SpriteType.Item, "anvil"), 3, 2, Recipes.anvilRecipes), + Enchanter(new LinkedSprite(SpriteType.Entity, "enchanter"), new LinkedSprite(SpriteType.Item, "enchanter"), 7, 2, Recipes.enchantRecipes), + Loom(new LinkedSprite(SpriteType.Entity, "loom"), new LinkedSprite(SpriteType.Item, "loom"), 7, 2, Recipes.loomRecipes); public ArrayList recipes; protected LinkedSprite sprite; @@ -35,12 +35,14 @@ public enum Type { Crafter.names.add(this.name()); } } + public static ArrayList names = new ArrayList<>(); public Crafter.Type type; /** * Creates a crafter of a given type. + * * @param type What type of crafter this is. */ public Crafter(Crafter.Type type) { @@ -59,5 +61,7 @@ public boolean use(Player player) { } @Override - public String toString() { return type.name()+getDataPrints(); } + public String toString() { + return type.name() + getDataPrints(); + } } diff --git a/src/client/java/minicraft/entity/furniture/DeathChest.java b/src/client/java/minicraft/entity/furniture/DeathChest.java index 3e7741dd4..d9528da25 100644 --- a/src/client/java/minicraft/entity/furniture/DeathChest.java +++ b/src/client/java/minicraft/entity/furniture/DeathChest.java @@ -22,7 +22,9 @@ public class DeathChest extends Chest { public int time; // Time passed (used for death chest despawn) private int redtick = 0; //This is used to determine the shade of red when the chest is about to expire. private boolean reverse; // What direction the red shade (redtick) is changing. - private Inventory inventory = new Inventory() {{ unlimited = true; }}; // Implement the inventory locally instead. + private Inventory inventory = new Inventory() {{ + unlimited = true; + }}; // Implement the inventory locally instead. /** * Creates a custom chest with the name Death Chest @@ -33,11 +35,11 @@ public DeathChest() { /// Set the expiration time based on the world difficulty. if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) { - time = 300*Updater.normSpeed; + time = 300 * Updater.normSpeed; } else if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) { - time = 120*Updater.normSpeed; + time = 120 * Updater.normSpeed; } else if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) { - time = 30*Updater.normSpeed; + time = 30 * Updater.normSpeed; } } @@ -86,20 +88,23 @@ public void tick() { public void render(Screen screen) { super.render(screen); String timeString = (time / Updater.normSpeed) + "S"; - Font.draw(timeString, screen, x - Font.textWidth(timeString)/2, y - Font.textHeight() - getBounds().getHeight()/2, Color.WHITE); + Font.draw(timeString, screen, x - Font.textWidth(timeString) / 2, y - Font.textHeight() - getBounds().getHeight() / 2, Color.WHITE); } - public boolean use(Player player) { return false; } // can't open it, just walk into it. + public boolean use(Player player) { + return false; + } // can't open it, just walk into it. - public void take(Player player) {} // can't grab a death chest. + public void take(Player player) { + } // can't grab a death chest. @Override public void touchedBy(Entity other) { - if(other instanceof Player) { - Inventory playerInv = ((Player)other).getInventory(); + if (other instanceof Player) { + Inventory playerInv = ((Player) other).getInventory(); for (Item i : inventory.getItems()) { int total = 1; - if (i instanceof StackableItem) total = ((StackableItem)i).count; + if (i instanceof StackableItem) total = ((StackableItem) i).count; int returned = playerInv.add(i); if (returned < total) { diff --git a/src/client/java/minicraft/entity/furniture/DungeonChest.java b/src/client/java/minicraft/entity/furniture/DungeonChest.java index a7aaf9ddf..6647745c5 100644 --- a/src/client/java/minicraft/entity/furniture/DungeonChest.java +++ b/src/client/java/minicraft/entity/furniture/DungeonChest.java @@ -27,6 +27,7 @@ public class DungeonChest extends Chest { /** * Creates a custom chest with the name Dungeon Chest. + * * @param populateInv Populate the inventory of the DungeonChest using the loot table system. */ public DungeonChest(boolean populateInv) { @@ -52,9 +53,9 @@ public boolean use(Player player) { boolean activeKey = player.activeItem != null && player.activeItem.equals(Items.get("Key")); boolean invKey = player.getInventory().count(Items.get("key")) > 0; - if(activeKey || invKey) { // If the player has a key... + if (activeKey || invKey) { // If the player has a key... if (activeKey) { // Remove activeItem - StackableItem key = (StackableItem)player.activeItem; + StackableItem key = (StackableItem) player.activeItem; key.count--; } else { // Remove from inv player.getInventory().removeItem(Items.get("key")); @@ -76,8 +77,7 @@ public boolean use(Player player) { } return false; // the chest is locked, and the player has no key. - } - else return super.use(player); // the chest was already unlocked. + } else return super.use(player); // the chest was already unlocked. } /** @@ -108,13 +108,13 @@ public void setLocked(boolean locked) { */ @Override protected void touchedBy(Entity entity) { - if(!isLocked) // can only be pushed if unlocked. + if (!isLocked) // can only be pushed if unlocked. super.touchedBy(entity); } @Override public boolean interact(Player player, @Nullable Item item, Direction attackDir) { - if(!isLocked) + if (!isLocked) return super.interact(player, item, attackDir); return false; } diff --git a/src/client/java/minicraft/entity/furniture/Furniture.java b/src/client/java/minicraft/entity/furniture/Furniture.java index 148a8098a..0a339c345 100644 --- a/src/client/java/minicraft/entity/furniture/Furniture.java +++ b/src/client/java/minicraft/entity/furniture/Furniture.java @@ -12,7 +12,9 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -/** Many furniture classes are very similar; they might not even need to be there at all... */ +/** + * Many furniture classes are very similar; they might not even need to be there at all... + */ public class Furniture extends Entity { @@ -25,7 +27,8 @@ public class Furniture extends Entity { /** * Constructor for the furniture entity. * Size will be set to 3. - * @param name Name of the furniture. + * + * @param name Name of the furniture. * @param sprite Furniture sprite. */ public Furniture(String name, LinkedSprite sprite, LinkedSprite itemSprite) { @@ -35,10 +38,11 @@ public Furniture(String name, LinkedSprite sprite, LinkedSprite itemSprite) { /** * Constructor for the furniture entity. * Radius is only used for collision detection. - * @param name Name of the furniture. + * + * @param name Name of the furniture. * @param sprite Furniture sprite. - * @param xr Horizontal radius. - * @param yr Vertical radius. + * @param xr Horizontal radius. + * @param yr Vertical radius. */ public Furniture(String name, LinkedSprite sprite, LinkedSprite itemSprite, int xr, int yr) { // All of these are 2x2 on the spritesheet; radius is for collisions only. @@ -67,11 +71,19 @@ public void tick() { else multiPushTime = 0; } - /** Draws the furniture on the screen. */ - public void render(Screen screen) { screen.render(x-8, y-8, sprite); } + /** + * Draws the furniture on the screen. + */ + public void render(Screen screen) { + screen.render(x - 8, y - 8, sprite); + } - /** Called when the player presses the MENU key in front of this. */ - public boolean use(Player player) { return false; } + /** + * Called when the player presses the MENU key in front of this. + */ + public boolean use(Player player) { + return false; + } @Override public boolean blocks(Entity e) { @@ -86,23 +98,25 @@ protected void touchedBy(Entity entity) { /** * Used in PowerGloveItem.java to let the user pick up furniture. + * * @param player The player picking up the furniture. */ @Override public boolean interact(Player player, @Nullable Item item, Direction attackDir) { if (item instanceof PowerGloveItem) { Sound.play("monsterhurt"); - remove(); - if (player.activeItem != null && !(player.activeItem instanceof PowerGloveItem)) - player.getLevel().dropItem(player.x, player.y, player.activeItem); // Put whatever item the player is holding into their inventory - player.activeItem = new FurnitureItem(this); // Make this the player's current item. - return true; + remove(); + if (player.activeItem != null && !(player.activeItem instanceof PowerGloveItem)) + player.getLevel().dropItem(player.x, player.y, player.activeItem); // Put whatever item the player is holding into their inventory + player.activeItem = new FurnitureItem(this); // Make this the player's current item. + return true; } return false; } /** * Tries to let the player push this furniture. + * * @param player The player doing the pushing. */ public void tryPush(Player player) { @@ -113,5 +127,7 @@ public void tryPush(Player player) { } @Override - public boolean canWool() { return true; } + public boolean canWool() { + return true; + } } diff --git a/src/client/java/minicraft/entity/furniture/KnightStatue.java b/src/client/java/minicraft/entity/furniture/KnightStatue.java index 566b0ed13..e2a6f5219 100644 --- a/src/client/java/minicraft/entity/furniture/KnightStatue.java +++ b/src/client/java/minicraft/entity/furniture/KnightStatue.java @@ -43,13 +43,16 @@ public boolean interact(Player player, Item heldItem, Direction attackDir) { } @Override - public void tryPush(Player player) {} // Nothing happens. + public void tryPush(Player player) { + } // Nothing happens. @Override - public @NotNull Furniture copy(){ + public @NotNull Furniture copy() { return new KnightStatue(bossHealth); } - public int getBossHealth() { return bossHealth; } + public int getBossHealth() { + return bossHealth; + } } diff --git a/src/client/java/minicraft/entity/furniture/Lantern.java b/src/client/java/minicraft/entity/furniture/Lantern.java index 857108724..b63f0aa36 100644 --- a/src/client/java/minicraft/entity/furniture/Lantern.java +++ b/src/client/java/minicraft/entity/furniture/Lantern.java @@ -6,9 +6,9 @@ public class Lantern extends Furniture { public enum Type { - NORM ("Lantern", 9, 0), - IRON ("Iron Lantern", 12, 2), - GOLD ("Gold Lantern", 15, 4); + NORM("Lantern", 9, 0), + IRON("Iron Lantern", 12, 2), + GOLD("Gold Lantern", 15, 4); protected int light, offset; protected String title; @@ -24,6 +24,7 @@ public enum Type { /** * Creates a lantern of a given type. + * * @param type Type of lantern. */ public Lantern(Lantern.Type type) { diff --git a/src/client/java/minicraft/entity/furniture/Spawner.java b/src/client/java/minicraft/entity/furniture/Spawner.java index 6a9eb9059..f2f916901 100644 --- a/src/client/java/minicraft/entity/furniture/Spawner.java +++ b/src/client/java/minicraft/entity/furniture/Spawner.java @@ -38,7 +38,7 @@ public class Spawner extends Furniture { private final Random rnd = new Random(); - private static final int ACTIVE_RADIUS = 8*16; + private static final int ACTIVE_RADIUS = 8 * 16; private static final int minSpawnInterval = 200, maxSpawnInterval = 500; private static final int minMobSpawnChance = 10; // 1 in minMobSpawnChance chance of calling trySpawn every interval. @@ -48,6 +48,7 @@ public class Spawner extends Furniture { /** * Initializes the spawners variables to the corresponding values from the mob. + * * @param m The mob which this spawner will spawn. */ private void initMob(MobAi m) { @@ -55,7 +56,7 @@ private void initMob(MobAi m) { sprite.setColor(col = mob.col); if (m instanceof EnemyMob) { - lvl = ((EnemyMob)mob).lvl; + lvl = ((EnemyMob) mob).lvl; maxMobLevel = mob.getMaxLevel(); } else { lvl = 1; @@ -69,19 +70,20 @@ private void initMob(MobAi m) { /** * Creates a new spawner for the mob m. + * * @param m Mob which will be spawned. */ public Spawner(MobAi m) { - super(getClassName(m.getClass()) + " Spawner", new LinkedSprite(SpriteType.Entity, "spawner"), m instanceof Cow ? new LinkedSprite(SpriteType.Item, "cow_spawner"): - m instanceof Pig ? new LinkedSprite(SpriteType.Item, "pig_spawner"): - m instanceof Sheep ? new LinkedSprite(SpriteType.Item, "sheep_spawner"): - m instanceof Slime ? new LinkedSprite(SpriteType.Item, "slime_spawner"): - m instanceof Zombie ? new LinkedSprite(SpriteType.Item, "zombie_spawner"): - m instanceof Creeper ? new LinkedSprite(SpriteType.Item, "creeper_spawner"): - m instanceof Skeleton ? new LinkedSprite(SpriteType.Item, "skeleton_spawner"): - m instanceof Snake ? new LinkedSprite(SpriteType.Item, "snake_spawner"): - m instanceof Knight ? new LinkedSprite(SpriteType.Item, "knight_spawner"): - new LinkedSprite(SpriteType.Item, "air_wizard_spawner"), 7, 2); + super(getClassName(m.getClass()) + " Spawner", new LinkedSprite(SpriteType.Entity, "spawner"), m instanceof Cow ? new LinkedSprite(SpriteType.Item, "cow_spawner") : + m instanceof Pig ? new LinkedSprite(SpriteType.Item, "pig_spawner") : + m instanceof Sheep ? new LinkedSprite(SpriteType.Item, "sheep_spawner") : + m instanceof Slime ? new LinkedSprite(SpriteType.Item, "slime_spawner") : + m instanceof Zombie ? new LinkedSprite(SpriteType.Item, "zombie_spawner") : + m instanceof Creeper ? new LinkedSprite(SpriteType.Item, "creeper_spawner") : + m instanceof Skeleton ? new LinkedSprite(SpriteType.Item, "skeleton_spawner") : + m instanceof Snake ? new LinkedSprite(SpriteType.Item, "snake_spawner") : + m instanceof Knight ? new LinkedSprite(SpriteType.Item, "knight_spawner") : + new LinkedSprite(SpriteType.Item, "air_wizard_spawner"), 7, 2); health = 100; initMob(m); resetSpawnInterval(); @@ -89,12 +91,13 @@ public Spawner(MobAi m) { /** * Returns the classname of a class. + * * @param c The class. * @return String representation of the classname. */ private static String getClassName(Class c) { String fullName = c.getCanonicalName(); - return fullName.substring(fullName.lastIndexOf(".")+1); + return fullName.substring(fullName.lastIndexOf(".") + 1); } @Override @@ -152,11 +155,11 @@ private void trySpawn() { Point pos = new Point(x >> 4, y >> 4); Point[] areaPositions = level.getAreaTilePositions(pos.x, pos.y, 1); ArrayList validPositions = new ArrayList<>(); - for (Point p: areaPositions) - if (!( !level.getTile(p.x, p.y).mayPass(level, p.x, p.y, newmob) || mob instanceof EnemyMob && level.getTile(p.x, p.y).getLightRadius(level, p.x, p.y) > 0 )) + for (Point p : areaPositions) + if (!(!level.getTile(p.x, p.y).mayPass(level, p.x, p.y, newmob) || mob instanceof EnemyMob && level.getTile(p.x, p.y).getLightRadius(level, p.x, p.y) > 0)) validPositions.add(p); - if(validPositions.size() == 0) return; // Cannot spawn mob. + if (validPositions.size() == 0) return; // Cannot spawn mob. Point spawnPos = validPositions.get(random.nextInt(validPositions.size())); @@ -166,16 +169,16 @@ private void trySpawn() { level.add(newmob); Sound.play("monsterhurt"); for (int i = 0; i < 6; i++) { - int randX = rnd.nextInt(16); - int randY = rnd.nextInt(12); - level.add(new FireParticle(x - 8 + randX, y - 6 + randY)); + int randX = rnd.nextInt(16); + int randY = rnd.nextInt(12); + level.add(new FireParticle(x - 8 + randX, y - 6 + randY)); } } @Override public boolean interact(Player player, Item item, Direction attackDir) { if (item instanceof ToolItem) { - ToolItem tool = (ToolItem)item; + ToolItem tool = (ToolItem) item; Sound.play("monsterhurt"); @@ -222,7 +225,7 @@ public boolean use(Player player) { lvl++; if (lvl > maxMobLevel) lvl = 1; try { - EnemyMob newmob = (EnemyMob)mob.getClass().getConstructor(int.class).newInstance(lvl); + EnemyMob newmob = (EnemyMob) mob.getClass().getConstructor(int.class).newInstance(lvl); initMob(newmob); } catch (Exception ex) { ex.printStackTrace(); @@ -234,5 +237,7 @@ public boolean use(Player player) { } @Override - public @NotNull Furniture copy() { return new Spawner(mob); } + public @NotNull Furniture copy() { + return new Spawner(mob); + } } diff --git a/src/client/java/minicraft/entity/furniture/Tnt.java b/src/client/java/minicraft/entity/furniture/Tnt.java index 9b659d2c0..4bea171ca 100644 --- a/src/client/java/minicraft/entity/furniture/Tnt.java +++ b/src/client/java/minicraft/entity/furniture/Tnt.java @@ -32,7 +32,7 @@ public class Tnt extends Furniture implements ActionListener { private Timer explodeTimer; private Level levelSave; - private final String[] explosionBlacklist = new String[]{ "hard rock", "obsidian wall", "stairs up", "stairs down" }; + private final String[] explosionBlacklist = new String[]{"hard rock", "obsidian wall", "stairs up", "stairs down"}; /** * Creates a new tnt furniture. @@ -56,21 +56,21 @@ public void tick() { // Blow up List entitiesInRange = level.getEntitiesInRect(new Rectangle(x, y, BLAST_RADIUS * 2, BLAST_RADIUS * 2, Rectangle.CENTER_DIMS)); - for (Entity e: entitiesInRange) { - float dist = (float) Math.hypot(e.x - x, e.y - y); - int dmg = (int) (BLAST_DAMAGE * (1 - (dist / BLAST_RADIUS))) + 1; - if (e instanceof Mob && dmg > 0) - ((Mob)e).onExploded(this, dmg); - - // Ignite other bombs in range. - if (e instanceof Tnt) { - Tnt tnt = (Tnt) e; - if (!tnt.fuseLit) { - tnt.fuseLit = true; - Sound.play("fuse"); - tnt.ftik = FUSE_TIME * 2 / 3; - } - } + for (Entity e : entitiesInRange) { + float dist = (float) Math.hypot(e.x - x, e.y - y); + int dmg = (int) (BLAST_DAMAGE * (1 - (dist / BLAST_RADIUS))) + 1; + if (e instanceof Mob && dmg > 0) + ((Mob) e).onExploded(this, dmg); + + // Ignite other bombs in range. + if (e instanceof Tnt) { + Tnt tnt = (Tnt) e; + if (!tnt.fuseLit) { + tnt.fuseLit = true; + Sound.play("fuse"); + tnt.ftik = FUSE_TIME * 2 / 3; + } + } } int xt = x >> 4; @@ -100,7 +100,7 @@ public void tick() { @Override public void render(Screen screen) { if (fuseLit) { - int colFctr = 100 * ((ftik%15)/5) + 200; + int colFctr = 100 * ((ftik % 15) / 5) + 200; col = Color.get(-1, colFctr, colFctr + 100, 555); } super.render(screen); diff --git a/src/client/java/minicraft/entity/mob/AirWizard.java b/src/client/java/minicraft/entity/mob/AirWizard.java index 42920abe7..976f295a5 100644 --- a/src/client/java/minicraft/entity/mob/AirWizard.java +++ b/src/client/java/minicraft/entity/mob/AirWizard.java @@ -16,7 +16,7 @@ import minicraft.screen.AchievementsDisplay; public class AirWizard extends EnemyMob { - private static final LinkedSprite[][][] sprites = new LinkedSprite[][][] { + private static final LinkedSprite[][][] sprites = new LinkedSprite[][][]{ Mob.compileMobSpriteAnimations(0, 0, "air_wizard"), Mob.compileMobSpriteAnimations(0, 2, "air_wizard") }; @@ -32,7 +32,9 @@ public class AirWizard extends EnemyMob { /** * This is used by the spawner to spawn air wizards. {@code lvl} is unused. */ - public AirWizard(int lvl) { this(); } + public AirWizard(int lvl) { + this(); + } /** * Constructor for the AirWizard. @@ -85,7 +87,7 @@ public void tick() { if (player != null && randomWalkTime == 0) { // If there is a player around, and the walking is not random int xd = player.x - x; // The horizontal distance between the player and the air wizard. int yd = player.y - y; // The vertical distance between the player and the air wizard. - if (xd * xd + yd * yd < 16*16 * 2*2) { + if (xd * xd + yd * yd < 16 * 16 * 2 * 2) { /// Move away from the player if less than 2 blocks away this.xmov = 0; // Accelerations @@ -96,12 +98,12 @@ public void tick() { if (xd > 0) this.xmov = -1; if (yd < 0) this.ymov = +1; if (yd > 0) this.ymov = -1; - } else if (xd * xd + yd * yd > 16*16 * 15*15) {// 15 squares away + } else if (xd * xd + yd * yd > 16 * 16 * 15 * 15) {// 15 squares away /// Drags the airwizard to the player, maintaining relative position. double hypot = Math.sqrt(xd * xd + yd * yd); - int newxd = (int)(xd * Math.sqrt(16*16 * 15*15) / hypot); - int newyd = (int)(yd * Math.sqrt(16*16 * 15*15) / hypot); + int newxd = (int) (xd * Math.sqrt(16 * 16 * 15 * 15) / hypot); + int newyd = (int) (yd * Math.sqrt(16 * 16 * 15 * 15) / hypot); x = player.x - newxd; y = player.y - newyd; } @@ -136,30 +138,31 @@ public void render(Screen screen) { if (percent < 16) { textcol = Color.get(1, 204, 0, 0); textcol2 = Color.get(1, 51, 0, 0); - } - else if (percent < 51) { + } else if (percent < 51) { textcol = Color.get(1, 204, 204, 9); textcol2 = Color.get(1, 51, 51, 0); } int textwidth = Font.textWidth(h); - Font.draw(h, screen, (x - textwidth/2) + 1, y - 17, textcol2); - Font.draw(h, screen, (x - textwidth/2), y - 18, textcol); + Font.draw(h, screen, (x - textwidth / 2) + 1, y - 17, textcol2); + Font.draw(h, screen, (x - textwidth / 2), y - 18, textcol); } @Override protected void touchedBy(Entity entity) { if (entity instanceof Player) { // If the entity is the Player, then deal them 1 damage points. - ((Player)entity).hurt(this, 1); + ((Player) entity).hurt(this, 1); } } - /** What happens when the air wizard dies */ + /** + * What happens when the air wizard dies + */ @Override public void die() { Player[] players = level.getPlayers(); if (players.length > 0) { // If the player is still here - for (Player p: players) { + for (Player p : players) { p.addScore(100000); // Give the player 100K points. dropItem(5, 10, Items.get("cloud ore")); // Drop cloud ore to guarantee respawn. } @@ -187,5 +190,7 @@ public void die() { } @Override - public int getMaxLevel() { return 2; } + public int getMaxLevel() { + return 2; + } } diff --git a/src/client/java/minicraft/entity/mob/Cow.java b/src/client/java/minicraft/entity/mob/Cow.java index a3baf9f4b..4275db4d7 100644 --- a/src/client/java/minicraft/entity/mob/Cow.java +++ b/src/client/java/minicraft/entity/mob/Cow.java @@ -19,9 +19,18 @@ public Cow() { public void die() { int min = 0, max = 0; - if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) {min = 1; max = 3;} - if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) {min = 1; max = 2;} - if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) {min = 0; max = 1;} + if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) { + min = 1; + max = 3; + } + if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) { + min = 1; + max = 2; + } + if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) { + min = 0; + max = 1; + } dropItem(min, max, Items.get("leather"), Items.get("raw beef")); diff --git a/src/client/java/minicraft/entity/mob/Creeper.java b/src/client/java/minicraft/entity/mob/Creeper.java index acaa6810d..d1d132c15 100644 --- a/src/client/java/minicraft/entity/mob/Creeper.java +++ b/src/client/java/minicraft/entity/mob/Creeper.java @@ -16,11 +16,11 @@ import java.util.List; public class Creeper extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { - new LinkedSprite[][] {Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "creeper")}, - new LinkedSprite[][] {Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "creeper")}, - new LinkedSprite[][] {Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "creeper")}, - new LinkedSprite[][] {Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "creeper")} + private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ + new LinkedSprite[][]{Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "creeper")}, + new LinkedSprite[][]{Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "creeper")}, + new LinkedSprite[][]{Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "creeper")}, + new LinkedSprite[][]{Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "creeper")} }; private static final int MAX_FUSE_TIME = 60; @@ -30,7 +30,7 @@ public class Creeper extends EnemyMob { private int fuseTime = 0; private boolean fuseLit = false; - private final String[] explosionBlacklist = new String[] { "hard rock", "obsidian wall", "raw obsidian"}; + private final String[] explosionBlacklist = new String[]{"hard rock", "obsidian wall", "raw obsidian"}; public Creeper(int lvl) { super(lvl, sprites, 10, 50); @@ -48,7 +48,8 @@ public boolean move(int xd, int yd) { public void tick() { super.tick(); - if (Game.isMode("minicraft.settings.mode.creative")) return; // Creeper should not explode if player is in creative mode + if (Game.isMode("minicraft.settings.mode.creative")) + return; // Creeper should not explode if player is in creative mode if (fuseTime > 0) { fuseTime--; // Fuse getting shorter... diff --git a/src/client/java/minicraft/entity/mob/EnemyMob.java b/src/client/java/minicraft/entity/mob/EnemyMob.java index 9a950b533..6d4a5fc19 100644 --- a/src/client/java/minicraft/entity/mob/EnemyMob.java +++ b/src/client/java/minicraft/entity/mob/EnemyMob.java @@ -22,25 +22,26 @@ public void handleDespawn() { if (level.depth == 0 && Updater.tickCount >= Updater.dayLength / 4 && Updater.tickCount <= Updater.dayLength / 2) if (isWithinLight()) // If it is now morning and on the surface, the mob despawns when it is within light. super.handleDespawn(); - else if (!isWithinLight()) // Otherwise, it despawns when it is not within light. - super.handleDespawn(); + else if (!isWithinLight()) // Otherwise, it despawns when it is not within light. + super.handleDespawn(); } /** * Constructor for a hostile (enemy) mob. The level determines what the mob does. sprites contains all the graphics and animations for the mob. * lvlcols is the different color the mob has depending on its level. isFactor determines if the mob's health should be affected by the level and * the difficulty. - * @param lvl The mob's level. + * + * @param lvl The mob's level. * @param lvlSprites The mob's sprites (ordered by level, then direction, then animation frame). - * @param health How much health the mob has. - * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty + * @param health How much health the mob has. + * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty * @param detectDist The distance where the mob will detect the player and start moving towards him/her. - * @param lifetime How many ticks this mob will live. - * @param rwTime How long the mob will walk in a random direction. (random walk duration) - * @param rwChance The chance of this mob will walk in a random direction (random walk chance) + * @param lifetime How many ticks this mob will live. + * @param rwTime How long the mob will walk in a random direction. (random walk duration) + * @param rwChance The chance of this mob will walk in a random direction (random walk chance) */ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFactor, int detectDist, int lifetime, int rwTime, int rwChance) { - super(lvlSprites[0], isFactor ? (lvl == 0 ? 1 : lvl * lvl) * health * ((Double)(Math.pow(2, Settings.getIdx("diff")))).intValue() : health, lifetime, rwTime, rwChance); + super(lvlSprites[0], isFactor ? (lvl == 0 ? 1 : lvl * lvl) * health * ((Double) (Math.pow(2, Settings.getIdx("diff")))).intValue() : health, lifetime, rwTime, rwChance); this.lvl = lvl == 0 ? 1 : lvl; this.lvlSprites = java.util.Arrays.copyOf(lvlSprites, lvlSprites.length); this.detectDist = detectDist; @@ -49,13 +50,14 @@ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFa /** * Constructor for a hostile (enemy) mob. * Lifetime will be set to 60 * Game.normSpeed. - * @param lvl The mob's level. + * + * @param lvl The mob's level. * @param lvlSprites The mob's sprites (ordered by level, then direction, then animation frame). - * @param health How much health the mob has. - * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty + * @param health How much health the mob has. + * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty * @param detectDist The distance where the mob will detect the player and start moving towards him/her. - * @param rwTime How long the mob will walk in a random direction. (random walk duration) - * @param rwChance The chance of this mob will walk in a random direction (random walk chance) + * @param rwTime How long the mob will walk in a random direction. (random walk duration) + * @param rwChance The chance of this mob will walk in a random direction (random walk chance) */ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFactor, int detectDist, int rwTime, int rwChance) { this(lvl, lvlSprites, health, isFactor, detectDist, 60 * Updater.normSpeed, rwTime, rwChance); @@ -67,9 +69,9 @@ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFa * rwTime=60, * rwChance=200. * - * @param lvl The mob's level. + * @param lvl The mob's level. * @param lvlSprites The mob's sprites (ordered by level, then direction, then animation frame). - * @param health How much health the mob has. + * @param health How much health the mob has. * @param detectDist The distance where the mob will detect the player and start moving towards him/her. */ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, int detectDist) { @@ -95,7 +97,7 @@ public void tick() { if (yd > sig0) this.ymov = +1; } else { // If the enemy was following the player, but has now lost it, it stops moving. - // *That would be nice, but I'll just make it move randomly instead. + // *That would be nice, but I'll just make it move randomly instead. randomizeWalkDir(false); } } @@ -111,8 +113,8 @@ public void render(Screen screen) { protected void touchedBy(Entity entity) { // If an entity (like the player) touches the enemy mob super.touchedBy(entity); // Hurts the player, damage is based on lvl. - if(entity instanceof Player) { - ((Player)entity).hurt(this, lvl * (Settings.get("diff").equals("minicraft.settings.difficulty.hard") ? 2 : 1)); + if (entity instanceof Player) { + ((Player) entity).hurt(this, lvl * (Settings.get("diff").equals("minicraft.settings.difficulty.hard") ? 2 : 1)); } } @@ -122,15 +124,16 @@ public void die() { /** * Determines if the mob can spawn at the giving position in the given map. + * * @param level The level which the mob wants to spawn in. - * @param x X map spawn coordinate. - * @param y Y map spawn coordinate. + * @param x X map spawn coordinate. + * @param y Y map spawn coordinate. * @return true if the mob can spawn here, false if not. */ public static boolean checkStartPos(Level level, int x, int y) { // Find a place to spawn the mob int r = (level.depth == -4 ? (Game.isMode("minicraft.settings.mode.score") ? 22 : 15) : 13); - if(!MobAi.checkStartPos(level, x, y, 60, r)) + if (!MobAi.checkStartPos(level, x, y, 60, r)) return false; x = x >> 4; diff --git a/src/client/java/minicraft/entity/mob/Knight.java b/src/client/java/minicraft/entity/mob/Knight.java index 91b74df0f..24183cb98 100644 --- a/src/client/java/minicraft/entity/mob/Knight.java +++ b/src/client/java/minicraft/entity/mob/Knight.java @@ -5,7 +5,7 @@ import minicraft.item.Items; public class Knight extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { + private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ Mob.compileMobSpriteAnimations(0, 0, "knight"), Mob.compileMobSpriteAnimations(0, 2, "knight"), Mob.compileMobSpriteAnimations(0, 4, "knight"), @@ -14,6 +14,7 @@ public class Knight extends EnemyMob { /** * Creates a knight of a given level. + * * @param lvl The knights level. */ public Knight(int lvl) { @@ -27,7 +28,7 @@ public void die() { dropItem(0, 2, Items.get("shard") ); - if(random.nextInt(24/lvl/(Settings.getIdx("diff")+1)) == 0) + if (random.nextInt(24 / lvl / (Settings.getIdx("diff") + 1)) == 0) dropItem(1, 1, Items.get("key")); super.die(); diff --git a/src/client/java/minicraft/entity/mob/Mob.java b/src/client/java/minicraft/entity/mob/Mob.java index 5484c6c15..e96679663 100644 --- a/src/client/java/minicraft/entity/mob/Mob.java +++ b/src/client/java/minicraft/entity/mob/Mob.java @@ -32,8 +32,9 @@ public abstract class Mob extends Entity { /** * Default constructor for a mob. * Default x radius is 4, and y radius is 3. + * * @param sprites All of this mob's sprites. - * @param health The mob's max health. + * @param health The mob's max health. */ public Mob(LinkedSprite[][] sprites, int health) { super(4, 3); @@ -79,19 +80,22 @@ public void tick() { /// The code below checks the direction of the knockback, moves the Mob accordingly, and brings the knockback closer to 0. int xd = 0, yd = 0; if (xKnockback != 0) { - xd = (int)Math.ceil(xKnockback/2); - xKnockback -= xKnockback/Math.abs(xKnockback); + xd = (int) Math.ceil(xKnockback / 2); + xKnockback -= xKnockback / Math.abs(xKnockback); } if (yKnockback != 0) { - yd = (int)Math.ceil(yKnockback/2); - yKnockback -= yKnockback/Math.abs(yKnockback); + yd = (int) Math.ceil(yKnockback / 2); + yKnockback -= yKnockback / Math.abs(yKnockback); } move(xd, yd, false); } @Override - public boolean move(int xd, int yd) { return move(xd, yd, true); } // Move the mob, overrides from Entity + public boolean move(int xd, int yd) { + return move(xd, yd, true); + } // Move the mob, overrides from Entity + private boolean move(int xd, int yd, boolean changeDir) { // Knockback shouldn't change mob direction if (level == null) return false; // Stopped b/c there's no level to move in! @@ -117,9 +121,9 @@ private boolean move(int xd, int yd, boolean changeDir) { // Knockback shouldn't // This part makes it so you can't move in a direction that you are currently being knocked back from. if (xKnockback != 0) - xd = Math.copySign(xd, xKnockback)*-1 != xd ? xd : 0; // If xKnockback and xd have different signs, do nothing, otherwise, set xd to 0. + xd = Math.copySign(xd, xKnockback) * -1 != xd ? xd : 0; // If xKnockback and xd have different signs, do nothing, otherwise, set xd to 0. if (yKnockback != 0) - yd = Math.copySign(yd, yKnockback)*-1 != yd ? yd : 0; // Same as above. + yd = Math.copySign(yd, yKnockback) * -1 != yd ? yd : 0; // Same as above. moved = super.move(xd, yd); // Call the move method from Entity } @@ -127,22 +131,30 @@ private boolean move(int xd, int yd, boolean changeDir) { // Knockback shouldn't return moved; } - /** The mob immediately despawns if the distance of the closest player is greater than the return value of this. */ + /** + * The mob immediately despawns if the distance of the closest player is greater than the return value of this. + */ protected int getDespawnDistance() { return 1280; } - /** The mob randomly despawns if the distance of the closest player is greater than the return value of this. */ + /** + * The mob randomly despawns if the distance of the closest player is greater than the return value of this. + */ protected int getNoDespawnDistance() { return 640; } - /** @see #handleDespawn() */ + /** + * @see #handleDespawn() + */ protected boolean removeWhenFarAway(@SuppressWarnings("unused") double distance) { return true; } - /** This is an easy way to make a list of sprites that are all part of the same "Sprite", so they have similar parameters, but they're just at different locations on the spreadsheet. */ + /** + * This is an easy way to make a list of sprites that are all part of the same "Sprite", so they have similar parameters, but they're just at different locations on the spreadsheet. + */ public static LinkedSprite[] compileSpriteList(int sheetX, int sheetY, int width, int height, int mirror, int number, String key) { LinkedSprite[] sprites = new LinkedSprite[number]; for (int i = 0; i < sprites.length; i++) @@ -190,15 +202,17 @@ private boolean isWooling() { // supposed to walk at half speed on wool /** * Checks if this Mob is currently on a light tile; if so, the mob sprite is brightened. + * * @return true if the mob is on a light tile, false if not. */ public boolean isLight() { if (level == null) return false; - return level.isLight(x>>4, y>>4); + return level.isLight(x >> 4, y >> 4); } /** * Checks if the mob is swimming (standing on a liquid tile). + * * @return true if the mob is swimming, false if not. */ public boolean isSwimming() { @@ -209,37 +223,42 @@ public boolean isSwimming() { /** * Do damage to the mob this method is called on. - * @param tile The tile that hurt the player - * @param x The x position of the mob - * @param y The x position of the mob + * + * @param tile The tile that hurt the player + * @param x The x position of the mob + * @param y The x position of the mob * @param damage The amount of damage to hurt the mob with */ public void hurt(Tile tile, int x, int y, int damage) { // Hurt the mob, when the source of damage is a tile Direction attackDir = Direction.getDirection(dir.getDir() ^ 1); // Set attackDir to our own direction, inverted. XORing it with 1 flips the rightmost bit in the variable, this effectively adds one when even, and subtracts one when odd. - if (!(tile == Tiles.get("lava") && this instanceof Player && ((Player)this).potioneffects.containsKey(PotionType.Lava))) + if (!(tile == Tiles.get("lava") && this instanceof Player && ((Player) this).potioneffects.containsKey(PotionType.Lava))) doHurt(damage, tile.mayPass(level, x, y, this) ? Direction.NONE : attackDir); // Call the method that actually performs damage, and set it to no particular direction } /** * Do damage to the mob this method is called on. - * @param mob The mob that hurt this mob + * + * @param mob The mob that hurt this mob * @param damage The amount of damage to hurt the mob with */ - public void hurt(Mob mob, int damage) { hurt(mob, damage, getAttackDir(mob, this)); } + public void hurt(Mob mob, int damage) { + hurt(mob, damage, getAttackDir(mob, this)); + } /** * Do damage to the mob this method is called on. - * @param mob The mob that hurt this mob - * @param damage The amount of damage to hurt the mob with + * + * @param mob The mob that hurt this mob + * @param damage The amount of damage to hurt the mob with * @param attackDir The direction this mob was attacked from */ public void hurt(Mob mob, int damage, Direction attackDir) { // Hurt the mob, when the source is another mob - if (mob instanceof Player && Game.isMode("minicraft.settings.mode.creative") && mob != this) doHurt(health, attackDir); // Kill the mob instantly + if (mob instanceof Player && Game.isMode("minicraft.settings.mode.creative") && mob != this) + doHurt(health, attackDir); // Kill the mob instantly else doHurt(damage, attackDir); // Call the method that actually performs damage, and use our provided attackDir } /** - * * @param sec duration in seconds */ public void burn(int sec) { @@ -248,30 +267,36 @@ public void burn(int sec) { /** * Executed when a TNT bomb explodes near this mob. + * * @param tnt The TNT exploding. * @param dmg The amount of damage the explosion does. */ - public void onExploded(Tnt tnt, int dmg) { doHurt(dmg, getAttackDir(tnt, this)); } + public void onExploded(Tnt tnt, int dmg) { + doHurt(dmg, getAttackDir(tnt, this)); + } /** * Hurt the mob, based on only damage and a direction * This is overridden in Player.java - * @param damage The amount of damage to hurt the mob with + * + * @param damage The amount of damage to hurt the mob with * @param attackDir The direction this mob was attacked from */ protected void doHurt(int damage, Direction attackDir) { - if (isRemoved() || hurtTime > 0) return; // If the mob has been hurt recently and hasn't cooled down, don't continue + if (isRemoved() || hurtTime > 0) + return; // If the mob has been hurt recently and hasn't cooled down, don't continue health -= damage; // Actually change the health // Add the knockback in the correct direction - xKnockback = attackDir.getX()*6; - yKnockback = attackDir.getY()*6; + xKnockback = attackDir.getX() * 6; + yKnockback = attackDir.getY() * 6; hurtTime = 10; // Set a delay before we can be hurt again } /** * Restores health to this mob. + * * @param heal How much health is restored. */ public void heal(int heal) { // Restore health on the mob @@ -279,7 +304,8 @@ public void heal(int heal) { // Restore health on the mob level.add(new TextParticle("" + heal, x, y, Color.GREEN)); // Add a text particle in our level at our position, that is green and displays the amount healed health += heal; // Actually add the amount to heal to our current health - if (health > (Player.baseHealth + Player.extraHealth)) health = (Player.baseHealth + Player.extraHealth); // If our health has exceeded our maximum, lower it back down to said maximum + if (health > (Player.baseHealth + Player.extraHealth)) + health = (Player.baseHealth + Player.extraHealth); // If our health has exceeded our maximum, lower it back down to said maximum } protected static Direction getAttackDir(Entity attacker, Entity hurt) { @@ -288,6 +314,7 @@ protected static Direction getAttackDir(Entity attacker, Entity hurt) { /** * This checks how the {@code attacker} can damage this mob. + * * @param attacker The attacker entity. * @return The calculated damage. */ diff --git a/src/client/java/minicraft/entity/mob/MobAi.java b/src/client/java/minicraft/entity/mob/MobAi.java index 61df74259..2652fedf7 100644 --- a/src/client/java/minicraft/entity/mob/MobAi.java +++ b/src/client/java/minicraft/entity/mob/MobAi.java @@ -2,7 +2,6 @@ import minicraft.core.io.Sound; import minicraft.entity.Direction; -import minicraft.entity.Entity; import minicraft.entity.furniture.Lantern; import minicraft.entity.particle.TextParticle; import minicraft.gfx.Color; @@ -26,11 +25,12 @@ public abstract class MobAi extends Mob { /** * Constructor for a mob with an ai. - * @param sprites All of this mob's sprites. + * + * @param sprites All of this mob's sprites. * @param maxHealth Maximum health of the mob. - * @param lifetime How many ticks this mob can live before its removed. - * @param rwTime How long the mob will walk in a random direction. (random walk duration) - * @param rwChance The chance of this mob will walk in a random direction (random walk chance) + * @param lifetime How many ticks this mob can live before its removed. + * @param rwTime How long the mob will walk in a random direction. (random walk duration) + * @param rwChance The chance of this mob will walk in a random direction (random walk chance) */ protected MobAi(LinkedSprite[][] sprites, int maxHealth, int lifetime, int rwTime, int rwChance) { super(sprites, maxHealth); @@ -62,18 +62,20 @@ public void handleDespawn() { /** * Checking whether the mob is within any light. From tiles or from lanterns. + * * @return {@code true} if the mob is within any light. */ protected boolean isWithinLight() { return Arrays.stream(level.getEntityArray()).anyMatch(e -> e instanceof Lantern && isWithin(e.getLightRadius(), e)) || !level.getMatchingTiles((tile, x, y) -> { - int xx = Math.abs(this.x - x), yy = Math.abs(this.y - y), l = tile.getLightRadius(level, x, y); - return xx * xx + yy * yy <= l * l; + int xx = Math.abs(this.x - x), yy = Math.abs(this.y - y), l = tile.getLightRadius(level, x, y); + return xx * xx + yy * yy <= l * l; }).isEmpty(); } /** * Checks if the mob should sleep this tick. + * * @return true if mob should sleep, false if not. */ protected boolean skipTick() { @@ -98,7 +100,7 @@ public void tick() { if (getLevel() != null) { boolean foundPlayer = false; - for (Player p: level.getPlayers()) { + for (Player p : level.getPlayers()) { if (p.isWithin(8, this) && p.potioneffects.containsKey(PotionType.Time)) { foundPlayer = true; break; @@ -143,7 +145,8 @@ public boolean move(int xd, int yd) { @Override public void doHurt(int damage, Direction attackDir) { - if (isRemoved() || hurtTime > 0) return; // If the mob has been hurt recently and hasn't cooled down, don't continue + if (isRemoved() || hurtTime > 0) + return; // If the mob has been hurt recently and hasn't cooled down, don't continue Player player = getClosestPlayer(); if (player != null) { // If there is a player in the level @@ -167,8 +170,9 @@ public boolean canWool() { /** * Sets the mob to walk in a random direction for a given amount of time. + * * @param byChance true if the mob should always get a new direction to walk, false if - * there should be a chance that the mob moves. + * there should be a chance that the mob moves. */ public void randomizeWalkDir(boolean byChance) { // Boolean specifies if this method, from where it's called, is called every tick, or after a random chance. if (!byChance && random.nextInt(randomWalkChance) != 0) return; @@ -182,24 +186,26 @@ public void randomizeWalkDir(boolean byChance) { // Boolean specifies if this me /** * Adds some items to the level. + * * @param mincount Least amount of items to add. * @param maxcount Most amount of items to add. - * @param items Which items should be added. + * @param items Which items should be added. */ protected void dropItem(int mincount, int maxcount, Item... items) { - int count = random.nextInt(maxcount-mincount+1) + mincount; + int count = random.nextInt(maxcount - mincount + 1) + mincount; for (int i = 0; i < count; i++) - level.dropItem(x, y, items); + level.dropItem(x, y, items); } /** * Determines if a friendly mob can spawn here. - * @param level The level the mob is trying to spawn in. - * @param x X map coordinate of spawn. - * @param y Y map coordinate of spawn. + * + * @param level The level the mob is trying to spawn in. + * @param x X map coordinate of spawn. + * @param y Y map coordinate of spawn. * @param playerDist Max distance from the player the mob can be spawned in. * @param soloRadius How far out can there not already be any entities. - * This is multiplied by the monster density of the level + * This is multiplied by the monster density of the level * @return true if the mob can spawn, false if not. */ protected static boolean checkStartPos(Level level, int x, int y, int playerDist, int soloRadius) { @@ -221,13 +227,17 @@ protected static boolean checkStartPos(Level level, int x, int y, int playerDist /** * Returns the maximum level of this mob. + * * @return max level of the mob. */ public abstract int getMaxLevel(); - protected void die(int points) { die(points, 0); } + protected void die(int points) { + die(points, 0); + } + protected void die(int points, int multAdd) { - for (Player p: level.getPlayers()) { + for (Player p : level.getPlayers()) { p.addScore(points); // Add score for mob death if (multAdd != 0) p.addMultiplier(multAdd); diff --git a/src/client/java/minicraft/entity/mob/ObsidianKnight.java b/src/client/java/minicraft/entity/mob/ObsidianKnight.java index 8ee4bcf89..16c5b1338 100644 --- a/src/client/java/minicraft/entity/mob/ObsidianKnight.java +++ b/src/client/java/minicraft/entity/mob/ObsidianKnight.java @@ -19,13 +19,13 @@ import org.jetbrains.annotations.Range; public class ObsidianKnight extends EnemyMob { - private static final SpriteLinker.LinkedSprite[][][] armored = new SpriteLinker.LinkedSprite[][][] { + private static final SpriteLinker.LinkedSprite[][][] armored = new SpriteLinker.LinkedSprite[][][]{ Mob.compileMobSpriteAnimations(0, 0, "obsidian_knight_armored"), Mob.compileMobSpriteAnimations(0, 2, "obsidian_knight_armored"), Mob.compileMobSpriteAnimations(0, 4, "obsidian_knight_armored"), Mob.compileMobSpriteAnimations(0, 6, "obsidian_knight_armored") }; - private static final SpriteLinker.LinkedSprite[][][] broken = new SpriteLinker.LinkedSprite[][][] { + private static final SpriteLinker.LinkedSprite[][][] broken = new SpriteLinker.LinkedSprite[][][]{ Mob.compileMobSpriteAnimations(0, 0, "obsidian_knight_broken"), Mob.compileMobSpriteAnimations(0, 2, "obsidian_knight_broken"), Mob.compileMobSpriteAnimations(0, 4, "obsidian_knight_broken"), @@ -42,7 +42,9 @@ public class ObsidianKnight extends EnemyMob { private int attackPhaseCooldown = 0; // Cooldown between attacks private AttackPhase attackPhase = AttackPhase.Attacking; - private enum AttackPhase { Attacking, Dashing, Walking; } // Using fire sparks in attacking. + + private enum AttackPhase {Attacking, Dashing, Walking;} // Using fire sparks in attacking. + private static final AttackPhase[] ATTACK_PHASES = AttackPhase.values(); private int dashTime = 0; @@ -217,33 +219,34 @@ public void render(Screen screen) { if (percent < 16) { textcol = Color.get(1, 204, 0, 0); textcol2 = Color.get(1, 51, 0, 0); - } - else if (percent < 51) { + } else if (percent < 51) { textcol = Color.get(1, 204, 204, 9); textcol2 = Color.get(1, 51, 51, 0); } int textwidth = Font.textWidth(h); - Font.draw(h, screen, (x - textwidth/2) + 1, y - 17, textcol2); - Font.draw(h, screen, (x - textwidth/2), y - 18, textcol); + Font.draw(h, screen, (x - textwidth / 2) + 1, y - 17, textcol2); + Font.draw(h, screen, (x - textwidth / 2), y - 18, textcol); } @Override protected void touchedBy(Entity entity) { if (entity instanceof Player) { // If the entity is the Player, then deal them 2 damage points. - ((Player)entity).hurt(this, 2); + ((Player) entity).hurt(this, 2); if (attackPhase == AttackPhase.Dashing) { dashTime = Math.max(dashTime - 10, 0); } } } - /** What happens when the obsidian knight dies */ + /** + * What happens when the obsidian knight dies + */ @Override public void die() { Player[] players = level.getPlayers(); if (players.length > 0) { // If the player is still here - for (Player p: players) { + for (Player p : players) { p.addScore(300000); // Give the player 300K points. dropItem(15, 25, Items.get("shard")); dropItem(1, 1, Items.get("Obsidian Heart")); // Drop it's precious item. diff --git a/src/client/java/minicraft/entity/mob/PassiveMob.java b/src/client/java/minicraft/entity/mob/PassiveMob.java index 0a563787d..a53295a26 100644 --- a/src/client/java/minicraft/entity/mob/PassiveMob.java +++ b/src/client/java/minicraft/entity/mob/PassiveMob.java @@ -15,6 +15,7 @@ public class PassiveMob extends MobAi { /** * Constructor for a non-hostile (passive) mob. * healthFactor = 3. + * * @param sprites The mob's sprites. */ public PassiveMob(LinkedSprite[][] sprites) { @@ -23,12 +24,13 @@ public PassiveMob(LinkedSprite[][] sprites) { /** * Constructor for a non-hostile (passive) mob. - * @param sprites The mob's sprites. + * + * @param sprites The mob's sprites. * @param healthFactor Determines the mobs health. Will be multiplied by the difficulty - * and then added with 5. + * and then added with 5. */ public PassiveMob(LinkedSprite[][] sprites, int healthFactor) { - super(sprites, 5 + healthFactor * Settings.getIdx("diff"), 5*60*Updater.normSpeed, 45, 40); + super(sprites, 5 + healthFactor * Settings.getIdx("diff"), 5 * 60 * Updater.normSpeed, 45, 40); } @Override @@ -60,9 +62,10 @@ public void die() { /** * Checks a given position in a given level to see if the mob can spawn there. * Passive mobs can only spawn on grass or flower tiles. + * * @param level The level which the mob wants to spawn in. - * @param x X map spawn coordinate. - * @param y Y map spawn coordinate. + * @param x X map spawn coordinate. + * @param y Y map spawn coordinate. * @return true if the mob can spawn here, false if not. */ public static boolean checkStartPos(Level level, int x, int y) { diff --git a/src/client/java/minicraft/entity/mob/Pig.java b/src/client/java/minicraft/entity/mob/Pig.java index 1cc2ee567..8881d7391 100644 --- a/src/client/java/minicraft/entity/mob/Pig.java +++ b/src/client/java/minicraft/entity/mob/Pig.java @@ -16,9 +16,18 @@ public Pig() { public void die() { int min = 0, max = 0; - if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) {min = 1; max = 3;} - if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) {min = 1; max = 2;} - if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) {min = 0; max = 2;} + if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) { + min = 1; + max = 3; + } + if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) { + min = 1; + max = 2; + } + if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) { + min = 0; + max = 2; + } dropItem(min, max, Items.get("raw pork")); diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index f5b168199..b9a74e976 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -103,7 +103,8 @@ public class Player extends Mob implements ItemHolder, ClientTickable { public int hunger, stamina, armor; // The current stats public int armorDamageBuffer; - @Nullable public ArmorItem curArmor; // The color/type of armor to be displayed. + @Nullable + public ArmorItem curArmor; // The color/type of armor to be displayed. private int staminaRecharge; // The ticks before charging a bolt of the player's stamina private static final int maxStaminaRecharge = 10; // Cutoff value for staminaRecharge @@ -214,7 +215,9 @@ public void updateInv(String items) { updateSprites(); } - public int getMultiplier() { return Game.isMode("minicraft.settings.mode.score") ? multiplier : 1; } + public int getMultiplier() { + return Game.isMode("minicraft.settings.mode.score") ? multiplier : 1; + } void resetMultiplier() { multiplier = 1; @@ -223,7 +226,7 @@ void resetMultiplier() { public void addMultiplier(int value) { if (!Game.isMode("minicraft.settings.mode.score")) return; - multiplier = Math.min(MAX_MULTIPLIER, multiplier+value); + multiplier = Math.min(MAX_MULTIPLIER, multiplier + value); multipliertime = Math.max(multipliertime, mtm - 5); } @@ -234,15 +237,22 @@ public void tickMultiplier() { } } - public int getScore() { return score; } - public void setScore(int score) { this.score = score; } + public int getScore() { + return score; + } + + public void setScore(int score) { + this.score = score; + } + public void addScore(int points) { score += points * getMultiplier(); } /** * Adds a new potion effect to the player. - * @param type Type of potion. + * + * @param type Type of potion. * @param duration How long the effect lasts. */ public void addPotionEffect(PotionType type, int duration) { @@ -251,6 +261,7 @@ public void addPotionEffect(PotionType type, int duration) { /** * Adds a potion effect to the player. + * * @param type Type of effect. */ public void addPotionEffect(PotionType type) { @@ -259,9 +270,12 @@ public void addPotionEffect(PotionType type) { /** * Returns all the potion effects currently affecting the player. + * * @return all potion effects on the player. */ - public HashMap getPotionEffects() { return potioneffects; } + public HashMap getPotionEffects() { + return potioneffects; + } @Override public void tick() { @@ -285,10 +299,11 @@ public void tick() { } if (potioneffects.size() > 0 && !Bed.inBed(this)) { - for (PotionType potionType: potioneffects.keySet().toArray(new PotionType[0])) { + for (PotionType potionType : potioneffects.keySet().toArray(new PotionType[0])) { if (potioneffects.get(potionType) <= 1) // If time is zero (going to be set to 0 in a moment)... PotionItem.applyPotion(this, potionType, false); // Automatically removes this potion effect. - else potioneffects.put(potionType, potioneffects.get(potionType) - 1); // Otherwise, replace it with one less. + else + potioneffects.put(potionType, potioneffects.get(potionType) - 1); // Otherwise, replace it with one less. } } @@ -333,7 +348,8 @@ public void tick() { } onStairDelay = 10; // Resets the delay, if on a stairs tile, but the delay is greater than 0. In other words, this prevents you from ever activating a level change on a stair tile, UNTIL you get off the tile for 10+ ticks. - } else if (onStairDelay > 0) onStairDelay--; // Decrements stairDelay if it's > 0, but not on stair tile... does the player get removed from the tile beforehand, or something? + } else if (onStairDelay > 0) + onStairDelay--; // Decrements stairDelay if it's > 0, but not on stair tile... does the player get removed from the tile beforehand, or something? if (onTile == Tiles.get("Infinite Fall") && !Game.isMode("minicraft.settings.mode.creative")) { if (onFallDelay <= 0) { @@ -360,7 +376,8 @@ public void tick() { if (staminaRechargeDelay == 0) { staminaRecharge++; // Ticks since last recharge, accounting for the time potion effect. - if (isSwimming() && !potioneffects.containsKey(PotionType.Swim)) staminaRecharge = 0; // Don't recharge stamina while swimming. + if (isSwimming() && !potioneffects.containsKey(PotionType.Swim)) + staminaRecharge = 0; // Don't recharge stamina while swimming. // Recharge a bolt for each multiple of maxStaminaRecharge. while (staminaRecharge > maxStaminaRecharge) { @@ -374,14 +391,14 @@ public void tick() { if (hunger < 0) hunger = 0; // Error correction if (stamina < maxStamina) { - stamHungerTicks-=diffIdx; // Affect hunger if not at full stamina; this is 2 levels away from a hunger "burger". - if( stamina == 0) stamHungerTicks-=diffIdx; // Double effect if no stamina at all. + stamHungerTicks -= diffIdx; // Affect hunger if not at full stamina; this is 2 levels away from a hunger "burger". + if (stamina == 0) stamHungerTicks -= diffIdx; // Double effect if no stamina at all. } // This if statement encapsulates the hunger system - if(!Bed.inBed(this)) { + if (!Bed.inBed(this)) { if (hungerChargeDelay > 0) { // If the hunger is recharging health... - stamHungerTicks -= 2+diffIdx; // Penalize the hunger + stamHungerTicks -= 2 + diffIdx; // Penalize the hunger if (hunger == 0) stamHungerTicks -= diffIdx; // Further penalty if at full hunger } @@ -404,14 +421,13 @@ public void tick() { } /// System that heals you depending on your hunger - if (health < (baseHealth + extraHealth) && hunger > maxHunger/2) { + if (health < (baseHealth + extraHealth) && hunger > maxHunger / 2) { hungerChargeDelay++; - if (hungerChargeDelay > 20*Math.pow(maxHunger-hunger+2, 2)) { + if (hungerChargeDelay > 20 * Math.pow(maxHunger - hunger + 2, 2)) { health++; hungerChargeDelay = 0; } - } - else hungerChargeDelay = 0; + } else hungerChargeDelay = 0; if (hungerStarveDelay == 0) { hungerStarveDelay = 120; @@ -479,10 +495,10 @@ public void tick() { if (activeItem != null && (input.inputPressed("drop-one") || input.inputPressed("drop-stack"))) { Item drop = activeItem.copy(); - if (input.inputPressed("drop-one") && drop instanceof StackableItem && ((StackableItem)drop).count > 1) { + if (input.inputPressed("drop-one") && drop instanceof StackableItem && ((StackableItem) drop).count > 1) { // Drop one from stack - ((StackableItem)activeItem).count--; - ((StackableItem)drop).count = 1; + ((StackableItem) activeItem).count--; + ((StackableItem) drop).count = 1; } else { activeItem = null; // Remove it from the "inventory" if (isFishing) { @@ -504,7 +520,7 @@ public void tick() { if (input.inputPressed("menu") && activeItem != null) { int returned = inventory.add(0, activeItem); if (activeItem instanceof StackableItem) { - StackableItem stackable = (StackableItem)activeItem; + StackableItem stackable = (StackableItem) activeItem; if (stackable.count > 0) { getLevel().dropItem(x, y, stackable.copy()); } @@ -557,7 +573,7 @@ public void tick() { if (attackTime > 0) { attackTime--; - if(attackTime == 0) attackItem = null; // null the attackItem once we are done attacking. + if (attackTime == 0) attackItem = null; // null the attackItem once we are done attacking. } } } @@ -571,7 +587,7 @@ public void resolveHeldItem() { if (prevItem != null) { // and you had a previous item that we should care about... int returned = inventory.add(0, prevItem); // Then add that previous item to your inventory so it isn't lost. if (prevItem instanceof StackableItem) { - if (((StackableItem)prevItem).count > 0) { + if (((StackableItem) prevItem).count > 0) { getLevel().dropItem(x, y, prevItem.copy()); } } else if (returned == 0) { @@ -632,7 +648,7 @@ protected void attack() { if (!Game.isMode("minicraft.settings.mode.creative")) tool.dur--; - AchievementsDisplay.setAchievement("minicraft.achievement.bow",true); + AchievementsDisplay.setAchievement("minicraft.achievement.bow", true); return; } @@ -663,7 +679,7 @@ protected void attack() { done = true; // Returns true if the target tile successfully interacts with the item. - } else if (tile.interact(level, t.x, t.y, this, activeItem, attackDir)){ + } else if (tile.interact(level, t.x, t.y, this, activeItem, attackDir)) { done = true; } } @@ -695,7 +711,7 @@ protected void attack() { } if (used && activeItem instanceof ToolItem) - ((ToolItem)activeItem).payDurability(); + ((ToolItem) activeItem).payDurability(); } } @@ -706,10 +722,10 @@ private Rectangle getInteractionBox(int range) { int paraClose = 4, paraFar = range; int perpClose = 0, perpFar = 8; - int xClose = x + dir.getX()*paraClose + dir.getY()*perpClose; - int yClose = y + dir.getY()*paraClose + dir.getX()*perpClose; - int xFar = x + dir.getX()*paraFar + dir.getY()*perpFar; - int yFar = y + dir.getY()*paraFar + dir.getX()*perpFar; + int xClose = x + dir.getX() * paraClose + dir.getY() * perpClose; + int yClose = y + dir.getY() * paraClose + dir.getX() * perpClose; + int xFar = x + dir.getX() * paraFar + dir.getY() * perpFar; + int yFar = y + dir.getY() * paraFar + dir.getX() * perpFar; return new Rectangle(Math.min(xClose, xFar), Math.min(yClose, yFar), Math.max(xClose, xFar), Math.max(yClose, yFar), Rectangle.CORNERS); } @@ -717,8 +733,8 @@ private Rectangle getInteractionBox(int range) { private Point getInteractionTile() { int x = this.x, y = this.y - 2; - x += dir.getX()*INTERACT_DIST; - y += dir.getY()*INTERACT_DIST; + x += dir.getX() * INTERACT_DIST; + y += dir.getY() * INTERACT_DIST; return new Point(x >> 4, y >> 4); } @@ -741,7 +757,7 @@ private void goFishing() { } if (data != null) { // If you've caught something - for (String line: data) { + for (String line : data) { // Check all the entries in the data // The number is a percent, if one fails, it moves down the list @@ -760,7 +776,7 @@ private void goFishing() { Game.notifications.add(itemData.substring(1)); } else { if (Items.get(itemData).equals(Items.get("Raw Fish"))) { - AchievementsDisplay.setAchievement("minicraft.achievement.fish",true); + AchievementsDisplay.setAchievement("minicraft.achievement.fish", true); } level.dropItem(x, y, Items.get(itemData)); caught = true; @@ -778,27 +794,37 @@ private void goFishing() { fishingTicks = maxFishingTicks; // If you didn't catch anything, try again in 120 ticks } - private boolean use() { return use(getInteractionBox(INTERACT_DIST)); } + private boolean use() { + return use(getInteractionBox(INTERACT_DIST)); + } - /** called by other use method; this serves as a buffer in case there is no entity in front of the player. */ + /** + * called by other use method; this serves as a buffer in case there is no entity in front of the player. + */ private boolean use(Rectangle area) { List entities = level.getEntitiesInRect(area); // Gets the entities within the 4 points for (Entity e : entities) { - if (e instanceof Furniture && ((Furniture) e).use(this)) return true; // If the entity is not the player, then call it's use method, and return the result. Only some furniture classes use this. + if (e instanceof Furniture && ((Furniture) e).use(this)) + return true; // If the entity is not the player, then call it's use method, and return the result. Only some furniture classes use this. } return false; } - /** same, but for interaction. */ + /** + * same, but for interaction. + */ private boolean interact(Rectangle area) { List entities = level.getEntitiesInRect(area); for (Entity e : entities) { - if (e != this && e.interact(this, activeItem, attackDir)) return true; // This is the ONLY place that the Entity.interact method is actually called. + if (e != this && e.interact(this, activeItem, attackDir)) + return true; // This is the ONLY place that the Entity.interact method is actually called. } return false; } - /** same, but for attacking. */ + /** + * same, but for attacking. + */ private boolean hurt(Rectangle area) { List entities = level.getEntitiesInRect(area); int maxDmg = 0; @@ -816,13 +842,14 @@ private boolean hurt(Rectangle area) { /** * Calculates how much damage the player will do. + * * @param e Entity being attacked. * @return How much damage the player does. */ private int getAttackDamage(Entity e) { int dmg = random.nextInt(2) + 1; if (activeItem != null && activeItem instanceof ToolItem) { - dmg += ((ToolItem)activeItem).getAttackDamageBonus(e); // Sword/Axe are more effective at dealing damage. + dmg += ((ToolItem) activeItem).getAttackDamageBonus(e); // Sword/Axe are more effective at dealing damage. } return dmg; } @@ -851,23 +878,23 @@ public void render(Screen screen) { if (level.getTile(x / 16, y / 16) == Tiles.get("water")) { // animation effect - if (tickTime / 8 % 2 == 0) { - screen.render(xo + 0, yo + 3, 5, 0, 0, hudSheet.getSheet()); // Render the water graphic - screen.render(xo + 8, yo + 3, 5, 0, 1, hudSheet.getSheet()); // Render the mirrored water graphic to the right. - } else { + if (tickTime / 8 % 2 == 0) { + screen.render(xo + 0, yo + 3, 5, 0, 0, hudSheet.getSheet()); // Render the water graphic + screen.render(xo + 8, yo + 3, 5, 0, 1, hudSheet.getSheet()); // Render the mirrored water graphic to the right. + } else { screen.render(xo + 0, yo + 3, 5, 1, 0, hudSheet.getSheet()); screen.render(xo + 8, yo + 3, 5, 1, 1, hudSheet.getSheet()); - } + } } else if (level.getTile(x / 16, y / 16) == Tiles.get("lava")) { - if (tickTime / 8 % 2 == 0) { + if (tickTime / 8 % 2 == 0) { screen.render(xo + 0, yo + 3, 6, 0, 1, hudSheet.getSheet()); // Render the lava graphic screen.render(xo + 8, yo + 3, 6, 0, 0, hudSheet.getSheet()); // Render the mirrored lava graphic to the right. - } else { + } else { screen.render(xo + 0, yo + 3, 6, 1, 1, hudSheet.getSheet()); screen.render(xo + 8, yo + 3, 6, 1, 0, hudSheet.getSheet()); - } + } } } @@ -966,20 +993,22 @@ public void render(Screen screen) { if (activeItem instanceof FurnitureItem) { Furniture furniture = ((FurnitureItem) activeItem).furniture; furniture.x = x; - furniture.y = yo-4; + furniture.y = yo - 4; furniture.render(screen); } } - /** What happens when the player interacts with a itemEntity */ + /** + * What happens when the player interacts with a itemEntity + */ public void pickupItem(ItemEntity itemEntity) { int picked = 0; int total = 1; - if (itemEntity.item instanceof StackableItem && ((StackableItem)itemEntity.item).stacksWith(activeItem)) { // Picked up item equals the one in your hand - ((StackableItem)activeItem).count += ((StackableItem)itemEntity.item).count; - picked = ((StackableItem)itemEntity.item).count; + if (itemEntity.item instanceof StackableItem && ((StackableItem) itemEntity.item).stacksWith(activeItem)) { // Picked up item equals the one in your hand + ((StackableItem) activeItem).count += ((StackableItem) itemEntity.item).count; + picked = ((StackableItem) itemEntity.item).count; } else { - if (itemEntity.item instanceof StackableItem) total = ((StackableItem)itemEntity.item).count; + if (itemEntity.item instanceof StackableItem) total = ((StackableItem) itemEntity.item).count; picked = inventory.add(itemEntity.item); // Add item to inventory } @@ -992,14 +1021,19 @@ public void pickupItem(ItemEntity itemEntity) { } // The player can swim. - public boolean canSwim() { return true; } + public boolean canSwim() { + return true; + } // Can walk on wool tiles..? quickly..? - public boolean canWool() { return true; } + public boolean canWool() { + return true; + } /** * Finds a starting position for the player. - * @param level Level which the player wants to start in. + * + * @param level Level which the player wants to start in. * @param spawnSeed Spawn seed. */ public void findStartPos(Level level, long spawnSeed) { @@ -1009,9 +1043,13 @@ public void findStartPos(Level level, long spawnSeed) { /** * Finds the starting position for the player in a level. + * * @param level The level. */ - public void findStartPos(Level level) { findStartPos(level, true); } + public void findStartPos(Level level) { + findStartPos(level, true); + } + public void findStartPos(Level level, boolean setSpawn) { Point spawnPos; @@ -1025,13 +1063,13 @@ public void findStartPos(Level level, boolean setSpawn) { // There are no tiles in the entire map which the player is allowed to stand on. Not likely. if (spawnTilePositions.size() == 0) { - spawnPos = new Point(random.nextInt(level.w/4)+level.w*3/8, random.nextInt(level.h/4)+level.h*3/8); + spawnPos = new Point(random.nextInt(level.w / 4) + level.w * 3 / 8, random.nextInt(level.h / 4) + level.h * 3 / 8); level.setTile(spawnPos.x, spawnPos.y, Tiles.get("grass")); } else { // Gets random valid spawn tile position. spawnPos = spawnTilePositions.get(random.nextInt(spawnTilePositions.size())); } - if(setSpawn) { + if (setSpawn) { // Used to save (tile) coordinates of spawn point outside this method. spawnx = spawnPos.x; spawny = spawnPos.y; @@ -1044,6 +1082,7 @@ public void findStartPos(Level level, boolean setSpawn) { /** * Finds a location where the player can respawn in a given level. + * * @param level The level. */ public void respawn(Level level) { @@ -1058,11 +1097,13 @@ public void respawn(Level level) { /** * Uses an amount of stamina to do an action. + * * @param cost How much stamina the action requires. * @return true if the player had enough stamina, false if not. */ public boolean payStamina(int cost) { - if (potioneffects.containsKey(PotionType.Energy)) return true; // If the player has the potion effect for infinite stamina, return true (without subtracting cost). + if (potioneffects.containsKey(PotionType.Energy)) + return true; // If the player has the potion effect for infinite stamina, return true (without subtracting cost). else if (stamina <= 0) return false; // If the player doesn't have enough stamina, then return false; failure. if (cost < 0) cost = 0; // Error correction @@ -1079,13 +1120,16 @@ public int getLightRadius() { if (activeItem != null && activeItem instanceof FurnitureItem) { // If player is holding furniture int rr = ((FurnitureItem) activeItem).furniture.getLightRadius(); // Gets furniture light radius - if (rr > r) r = rr; // Brings player light up to furniture light, if less, since the furnture is not yet part of the level and so doesn't emit light even if it should. + if (rr > r) + r = rr; // Brings player light up to furniture light, if less, since the furnture is not yet part of the level and so doesn't emit light even if it should. } return r; // Return light radius } - /** What happens when the player dies */ + /** + * What happens when the player dies + */ @Override public void die() { Analytics.SinglePlayerDeath.ping(); @@ -1113,15 +1157,20 @@ public void onExploded(Tnt tnt, int dmg) { payStamina(dmg * 2); } - /** Hurt the player. - * @param damage How much damage to do to player. + /** + * Hurt the player. + * + * @param damage How much damage to do to player. * @param attackDir What direction to attack. */ - public void hurt(int damage, Direction attackDir) { doHurt(damage, attackDir); } + public void hurt(int damage, Direction attackDir) { + doHurt(damage, attackDir); + } @Override protected void doHurt(int damage, Direction attackDir) { - if (Game.isMode("minicraft.settings.mode.creative") || hurtTime > 0 || Bed.inBed(this)) return; // Can't get hurt in creative, hurt cooldown, or while someone is in bed + if (Game.isMode("minicraft.settings.mode.creative") || hurtTime > 0 || Bed.inBed(this)) + return; // Can't get hurt in creative, hurt cooldown, or while someone is in bed int healthDam = 0, armorDam = 0; if (this == Game.player) { @@ -1131,8 +1180,8 @@ protected void doHurt(int damage, Direction attackDir) { armorDamageBuffer += damage; armorDam += damage; - while (armorDamageBuffer >= curArmor.level+1) { - armorDamageBuffer -= curArmor.level+1; + while (armorDamageBuffer >= curArmor.level + 1) { + armorDamageBuffer -= curArmor.level + 1; healthDam++; } } @@ -1161,11 +1210,13 @@ protected void doHurt(int damage, Direction attackDir) { /** * Hurt the player directly. Don't use the armor as a shield. - * @param damage Amount of damage to do to player + * + * @param damage Amount of damage to do to player * @param attackDir The direction of attack. */ private void directHurt(int damage, Direction attackDir) { - if (Game.isMode("minicraft.settings.mode.creative") || hurtTime > 0 || Bed.inBed(this)) return; // Can't get hurt in creative, hurt cooldown, or while someone is in bed + if (Game.isMode("minicraft.settings.mode.creative") || hurtTime > 0 || Bed.inBed(this)) + return; // Can't get hurt in creative, hurt cooldown, or while someone is in bed int healthDam = 0; if (this == Game.player) { @@ -1192,7 +1243,9 @@ public Inventory getInventory() { return inventory; } - public String getDebugHunger() { return hungerStamCnt + "_" + stamHungerTicks; } + public String getDebugHunger() { + return hungerStamCnt + "_" + stamHungerTicks; + } /** * Trying to add item(s) to the player inventory. @@ -1202,7 +1255,7 @@ public void tryAddToInvOrDrop(@Nullable Item item) { if (item != null) { int returned = inventory.add(0, item); if (item instanceof StackableItem) { - if (((StackableItem)item).count > 0) { + if (((StackableItem) item).count > 0) { getLevel().dropItem(x, y, item); } } else if (returned == 0) { diff --git a/src/client/java/minicraft/entity/mob/Sheep.java b/src/client/java/minicraft/entity/mob/Sheep.java index 5aefa8709..f8c1dc583 100644 --- a/src/client/java/minicraft/entity/mob/Sheep.java +++ b/src/client/java/minicraft/entity/mob/Sheep.java @@ -67,9 +67,18 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) public void die() { int min = 0, max = 0; - if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) {min = 1; max = 3;} - if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) {min = 1; max = 2;} - if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) {min = 0; max = 2;} + if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) { + min = 1; + max = 3; + } + if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) { + min = 1; + max = 2; + } + if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) { + min = 0; + max = 2; + } if (!cut) dropItem(min, max, Items.get("wool")); dropItem(min, max, Items.get("Raw Beef")); diff --git a/src/client/java/minicraft/entity/mob/Skeleton.java b/src/client/java/minicraft/entity/mob/Skeleton.java index 09fc27c56..8714aca2c 100644 --- a/src/client/java/minicraft/entity/mob/Skeleton.java +++ b/src/client/java/minicraft/entity/mob/Skeleton.java @@ -7,7 +7,7 @@ import minicraft.item.Items; public class Skeleton extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { + private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ Mob.compileMobSpriteAnimations(0, 0, "skeleton"), Mob.compileMobSpriteAnimations(0, 2, "skeleton"), Mob.compileMobSpriteAnimations(0, 4, "skeleton"), @@ -19,6 +19,7 @@ public class Skeleton extends EnemyMob { /** * Creates a skeleton of a given level. + * * @param lvl The skeleton's level. */ public Skeleton(int lvl) { diff --git a/src/client/java/minicraft/entity/mob/Slime.java b/src/client/java/minicraft/entity/mob/Slime.java index e6a416ba2..b1b1de77d 100644 --- a/src/client/java/minicraft/entity/mob/Slime.java +++ b/src/client/java/minicraft/entity/mob/Slime.java @@ -8,17 +8,18 @@ import minicraft.item.Items; public class Slime extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { - new LinkedSprite[][] {Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "slime")}, - new LinkedSprite[][] {Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "slime")}, - new LinkedSprite[][] {Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "slime")}, - new LinkedSprite[][] {Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "slime")} + private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ + new LinkedSprite[][]{Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "slime")}, + new LinkedSprite[][]{Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "slime")}, + new LinkedSprite[][]{Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "slime")}, + new LinkedSprite[][]{Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "slime")} }; private int jumpTime = 0; // jumpTimer, also acts as a rest timer before the next jump /** * Creates a slime of the given level. + * * @param lvl Slime's level. */ public Slime(int lvl) { @@ -60,8 +61,7 @@ public void render(Screen screen) { if (jumpTime > 0) { walkDist = 8; // Set to jumping sprite. y -= 4; // Raise up a bit. - } - else walkDist = 0; // Set to ground sprite. + } else walkDist = 0; // Set to ground sprite. dir = Direction.DOWN; diff --git a/src/client/java/minicraft/entity/mob/Snake.java b/src/client/java/minicraft/entity/mob/Snake.java index fdcc43eaa..c22c62a70 100644 --- a/src/client/java/minicraft/entity/mob/Snake.java +++ b/src/client/java/minicraft/entity/mob/Snake.java @@ -6,7 +6,7 @@ import minicraft.item.Items; public class Snake extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { + private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ Mob.compileMobSpriteAnimations(0, 0, "snake"), Mob.compileMobSpriteAnimations(0, 2, "snake"), Mob.compileMobSpriteAnimations(0, 4, "snake"), @@ -21,7 +21,7 @@ public Snake(int lvl) { protected void touchedBy(Entity entity) { if (entity instanceof Player) { int damage = lvl + Settings.getIdx("diff"); - ((Player)entity).hurt(this, damage); + ((Player) entity).hurt(this, damage); } } diff --git a/src/client/java/minicraft/entity/mob/Zombie.java b/src/client/java/minicraft/entity/mob/Zombie.java index 987b26072..02ba06ade 100644 --- a/src/client/java/minicraft/entity/mob/Zombie.java +++ b/src/client/java/minicraft/entity/mob/Zombie.java @@ -5,7 +5,7 @@ import minicraft.item.Items; public class Zombie extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { + private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ Mob.compileMobSpriteAnimations(0, 0, "zombie"), Mob.compileMobSpriteAnimations(0, 2, "zombie"), Mob.compileMobSpriteAnimations(0, 4, "zombie"), @@ -14,6 +14,7 @@ public class Zombie extends EnemyMob { /** * Creates a zombie of the given level. + * * @param lvl Zombie's level. */ public Zombie(int lvl) { @@ -33,9 +34,9 @@ public void die() { int rand = random.nextInt(3); if (rand == 0) { level.dropItem(x, y, Items.get("green clothes")); - } else if(rand == 1) { + } else if (rand == 1) { level.dropItem(x, y, Items.get("red clothes")); - } else if(rand == 2) { + } else if (rand == 2) { level.dropItem(x, y, Items.get("blue clothes")); } } diff --git a/src/client/java/minicraft/entity/particle/Particle.java b/src/client/java/minicraft/entity/particle/Particle.java index 5480f4876..9088d4214 100644 --- a/src/client/java/minicraft/entity/particle/Particle.java +++ b/src/client/java/minicraft/entity/particle/Particle.java @@ -16,11 +16,12 @@ public class Particle extends Entity implements ClientTickable { /** * Creates an particle entity at the given position. The particle has a x and y radius = 1. - * @param x X map coordinate - * @param y Y map coorindate - * @param xr x radius of the particle + * + * @param x X map coordinate + * @param y Y map coorindate + * @param xr x radius of the particle * @param lifetime How many game ticks the particle lives before its removed - * @param sprite The particle's sprite + * @param sprite The particle's sprite */ public Particle(int x, int y, int xr, int lifetime, LinkedSprite sprite) { // Make a particle at the given coordinates @@ -31,6 +32,7 @@ public Particle(int x, int y, int xr, int lifetime, LinkedSprite sprite) { this.sprite = sprite; time = 0; } + public Particle(int x, int y, int lifetime, LinkedSprite sprite) { this(x, y, 1, lifetime, sprite); } @@ -49,8 +51,12 @@ public void tick() { } @Override - public void render(Screen screen) { screen.render(x, y, sprite); } + public void render(Screen screen) { + screen.render(x, y, sprite); + } @Override - public boolean isSolid() { return false; } + public boolean isSolid() { + return false; + } } diff --git a/src/client/java/minicraft/entity/particle/SandParticle.java b/src/client/java/minicraft/entity/particle/SandParticle.java index ea268e113..e2a8a7df8 100644 --- a/src/client/java/minicraft/entity/particle/SandParticle.java +++ b/src/client/java/minicraft/entity/particle/SandParticle.java @@ -8,6 +8,7 @@ public class SandParticle extends Particle { /** * Creating a sand particle. + * * @param x X map position * @param y Y map position */ diff --git a/src/client/java/minicraft/entity/particle/TextParticle.java b/src/client/java/minicraft/entity/particle/TextParticle.java index d4d9a8892..964d02588 100644 --- a/src/client/java/minicraft/entity/particle/TextParticle.java +++ b/src/client/java/minicraft/entity/particle/TextParticle.java @@ -8,26 +8,26 @@ public class TextParticle extends Particle { private String msg; // Message of the text particle private double xa, ya, za; // x, y, z acceleration private double xx, yy, zz; // x, y, z coordinates - + private FontStyle style; - + /** * Creates a text particle which shows a message on the screen. - * + * * @param msg Message to display - * @param x X map position - * @param y Y map position + * @param x X map position + * @param y Y map position * @param col Text color */ public TextParticle(String msg, int x, int y, int col) { super(x, y, msg.length(), 60, null); - + style = new FontStyle(col).setShadowType(Color.BLACK, false); this.msg = msg; xx = x; // Assigns x pos yy = y; // Assigns y pos zz = 2; // Assigns z pos to be 2 - + // Assigns x,y,z acceleration: xa = random.nextGaussian() * 0.3; ya = random.nextGaussian() * 0.2; @@ -37,13 +37,13 @@ public TextParticle(String msg, int x, int y, int col) { @Override public void tick() { super.tick(); - + // Move the particle according to the acceleration xx += xa; yy += ya; zz += za; if (zz < 0) { - + // If z pos if less than 0, alter accelerations... zz = 0; za *= -0.5; @@ -55,14 +55,15 @@ public void tick() { x = (int) xx; y = (int) yy; } - + @Override public void render(Screen screen) { - style.setXPos(x - msg.length() * 4).setYPos(y - (int)zz).draw(msg, screen); + style.setXPos(x - msg.length() * 4).setYPos(y - (int) zz).draw(msg, screen); } - + /** * Returns the message and color divied by the character :. + * * @return string representation of the particle */ public String getData() { diff --git a/src/client/java/minicraft/gfx/Color.java b/src/client/java/minicraft/gfx/Color.java index cdc1e757d..b71ed651a 100644 --- a/src/client/java/minicraft/gfx/Color.java +++ b/src/client/java/minicraft/gfx/Color.java @@ -51,22 +51,25 @@ public class Color { public static final String MAGENTA_CODE = Color.toStringCode(Color.MAGENTA); public static final String CYAN_CODE = Color.toStringCode(Color.CYAN); - /** This returns a minicraftrgb. - * a should be between 0-1, r,g,and b should be 0-255 */ + /** + * This returns a minicraftrgb. + * a should be between 0-1, r,g,and b should be 0-255 + */ public static int get(int a, int r, int g, int b) { return (a << 24) + (r << 16) + (g << 8) + (b); } + public static int get(int a, int copy) { return get(a, copy, copy, copy); } public static String toStringCode(int color) { - return new String(new char[] { - Color.COLOR_CHAR, - (char) ((color >> 24) & 0xFF), // Alpha - (char) ((color >> 16) & 0xFF), // Red - (char) ((color >> 8) & 0xFF), // Blue - (char) (color & 0xFF) // Green + return new String(new char[]{ + Color.COLOR_CHAR, + (char) ((color >> 24) & 0xFF), // Alpha + (char) ((color >> 16) & 0xFF), // Red + (char) ((color >> 8) & 0xFF), // Blue + (char) (color & 0xFF) // Green }); } @@ -91,7 +94,9 @@ public static int rgb(int red, int green, int blue) { // rgbInt array -> rgbRead return red / 50 * 100 + green / 50 * 10 + blue / 50; // This is: rgbReadable } - /** This method darkens or lightens a color by the specified amount. */ + /** + * This method darkens or lightens a color by the specified amount. + */ public static int tint(int color, int amount, boolean isSpriteCol) { if (isSpriteCol) { int[] rgbBytes = separateEncodedSprite(color); // This just separates the four 8-bit sprite colors; they are still in base-6 added form. @@ -103,19 +108,25 @@ public static int tint(int color, int amount, boolean isSpriteCol) { return tint(color, amount); // This is: rgbByte } } + private static int tint(int rgbByte, int amount) { if (rgbByte == 255) return 255; // See description of bit shifting above; it will hold the 255 value, not -1 int[] rgb = decodeRGB(rgbByte); // This returns the rgb values as 0-5 numbers. for (int i = 0; i < rgb.length; i++) - rgb[i] = limit(rgb[i]+amount, 0, 5); + rgb[i] = limit(rgb[i] + amount, 0, 5); return rgb[0] * 36 + rgb[1] * 6 + rgb[2]; // This is: rgbByte } - /** seperates a 4-part sprite color (rgb4Sprite) into it's original 4 component colors (which are each rgbBytes) */ + /** + * seperates a 4-part sprite color (rgb4Sprite) into it's original 4 component colors (which are each rgbBytes) + */ /// Reverse of Color.get(a, b, c, d). - public static int[] separateEncodedSprite(int rgb4Sprite) { return separateEncodedSprite(rgb4Sprite, false); } + public static int[] separateEncodedSprite(int rgb4Sprite) { + return separateEncodedSprite(rgb4Sprite, false); + } + public static int[] separateEncodedSprite(int rgb4Sprite, boolean convertToReadable) { // The numbers are stored, most to least shifted, as d, c, b, a. @@ -124,7 +135,7 @@ public static int[] separateEncodedSprite(int rgb4Sprite, boolean convertToReada int c = (rgb4Sprite & 0x00_00_FF_00) >> 8; int d = (rgb4Sprite & 0x00_00_00_FF); - if(convertToReadable) { + if (convertToReadable) { // They become rgbReadable a = unGet(a); b = unGet(b); @@ -132,20 +143,22 @@ public static int[] separateEncodedSprite(int rgb4Sprite, boolean convertToReada d = unGet(d); } // Else, they are rgbByte - return new int[] {a, b, c, d}; + return new int[]{a, b, c, d}; } - /** This turns a 216 scale rgb int into a 0-5 scale "concatenated" rgb int. (aka rgbByte -> r/g/b Readables) */ + /** + * This turns a 216 scale rgb int into a 0-5 scale "concatenated" rgb int. (aka rgbByte -> r/g/b Readables) + */ public static int[] decodeRGB(int rgbByte) { int r = (rgbByte / 36) % 6; int g = (rgbByte / 6) % 6; int b = rgbByte % 6; - return new int[] {r, g, b}; + return new int[]{r, g, b}; } public static int unGet(int rgbByte) { // rgbByte -> rgbReadable int[] cols = decodeRGB(rgbByte); - return cols[0]*100 + cols[1]*10 + cols[2]; + return cols[0] * 100 + cols[1] * 10 + cols[2]; } /// This turns a 25-bit minicraft color into a 24-bit rgb color. @@ -160,7 +173,7 @@ protected static int tintColor(int rgbInt, int amount) { int[] comps = decodeRGBColor(rgbInt); for (int i = 0; i < comps.length; i++) - comps[i] = limit(comps[i]+amount, 0, 255); + comps[i] = limit(comps[i] + amount, 0, 255); return comps[0] << 16 | comps[1] << 8 | comps[2]; } @@ -170,7 +183,7 @@ protected static int[] decodeRGBColor(int rgbInt) { int g = (rgbInt & 0x00_FF_00) >> 8; int b = (rgbInt & 0x00_00_FF); - return new int[] {r, g, b}; + return new int[]{r, g, b}; } /// This is for color testing. diff --git a/src/client/java/minicraft/gfx/Dimension.java b/src/client/java/minicraft/gfx/Dimension.java index 8b13c9f1b..374876ebc 100644 --- a/src/client/java/minicraft/gfx/Dimension.java +++ b/src/client/java/minicraft/gfx/Dimension.java @@ -1,21 +1,24 @@ package minicraft.gfx; public class Dimension { - + public int width, height; - - public Dimension() { this(0, 0); } + + public Dimension() { + this(0, 0); + } + public Dimension(int width, int height) { this.width = width; this.height = height; } - + public Dimension(Dimension model) { width = model.width; height = model.height; } - + public String toString() { - return width+"x"+height; + return width + "x" + height; } } diff --git a/src/client/java/minicraft/gfx/Ellipsis.java b/src/client/java/minicraft/gfx/Ellipsis.java index a26fbe971..5d6d9d456 100644 --- a/src/client/java/minicraft/gfx/Ellipsis.java +++ b/src/client/java/minicraft/gfx/Ellipsis.java @@ -5,30 +5,41 @@ import minicraft.gfx.Ellipsis.DotUpdater.TimeUpdater; public abstract class Ellipsis { - + private final DotUpdater updateMethod; - + protected Ellipsis(DotUpdater updateMethod, int intervalCount) { this.updateMethod = updateMethod; updateMethod.setIntervalCount(intervalCount); } - + public String updateAndGet() { updateMethod.update(); return get(); } + protected abstract String get(); - protected void nextInterval(int interval) {} - - protected int getInterval() { return updateMethod.getInterval(); } - protected int getIntervalCount() { return updateMethod.getIntervalCount(); } - + + protected void nextInterval(int interval) { + } + + protected int getInterval() { + return updateMethod.getInterval(); + } + + protected int getIntervalCount() { + return updateMethod.getIntervalCount(); + } + public static class SequentialEllipsis extends Ellipsis { - public SequentialEllipsis() { this(new CallUpdater(Updater.normSpeed*2/3)); } + public SequentialEllipsis() { + this(new CallUpdater(Updater.normSpeed * 2 / 3)); + } + public SequentialEllipsis(DotUpdater updater) { super(updater, 3); } - + @Override public String get() { StringBuilder dots = new StringBuilder(); @@ -39,70 +50,82 @@ public String get() { else dots.append(" "); } - + return dots.toString(); } } - + public static class SmoothEllipsis extends Ellipsis { - + private static final String dotString = " "; - + private final char[] dots = dotString.toCharArray(); - - public SmoothEllipsis() { this(new TimeUpdater()); } + + public SmoothEllipsis() { + this(new TimeUpdater()); + } + public SmoothEllipsis(DotUpdater updater) { - super(updater, dotString.length()*2); + super(updater, dotString.length() * 2); updater.setEllipsis(this); } - + @Override - public String get() { return new String(dots); } - + public String get() { + return new String(dots); + } + @Override protected void nextInterval(int interval) { int epos = interval % dots.length; - char set = interval < getIntervalCount()/2 ? '.' : ' '; + char set = interval < getIntervalCount() / 2 ? '.' : ' '; dots[epos] = set; } } - - + + public static abstract class DotUpdater { private final int countPerCycle; private int intervalCount; private int curInterval; private int countPerInterval; private int counter; - + private Ellipsis ellipsis = null; - + private boolean started = false; - + protected DotUpdater(int countPerCycle) { this.countPerCycle = countPerCycle; } - - void setEllipsis(Ellipsis ellipsis) { this.ellipsis = ellipsis; } - + + void setEllipsis(Ellipsis ellipsis) { + this.ellipsis = ellipsis; + } + // Called by Ellipsis classes, passing their value. void setIntervalCount(int numIntervals) { intervalCount = numIntervals; - countPerInterval = Math.max(1, Math.round(countPerCycle / (float)intervalCount)); + countPerInterval = Math.max(1, Math.round(countPerCycle / (float) intervalCount)); + } + + public int getInterval() { + return curInterval; + } + + public int getIntervalCount() { + return intervalCount; } - - public int getInterval() { return curInterval; } - public int getIntervalCount() { return intervalCount; } - + private void incInterval(int amt) { if (ellipsis != null) - for (int i = curInterval+1; i <= curInterval+amt; i++) - ellipsis.nextInterval(i%intervalCount); - + for (int i = curInterval + 1; i <= curInterval + amt; i++) + ellipsis.nextInterval(i % intervalCount); + curInterval += amt; curInterval %= intervalCount; } - + protected void incCounter(int amt) { counter += amt; int intervals = counter / countPerInterval; @@ -111,24 +134,33 @@ protected void incCounter(int amt) { counter -= intervals * countPerInterval; } } - - void start() { started = true; } + + void start() { + started = true; + } + void update() { if (!started) start(); } - + public static class TickUpdater extends DotUpdater { private int lastTick; - - public TickUpdater() { this(Updater.normSpeed); } + + public TickUpdater() { + this(Updater.normSpeed); + } + public TickUpdater(int ticksPerCycle) { super(ticksPerCycle); } - + @Override - void start() { super.start(); lastTick = Updater.tickCount; } - + void start() { + super.start(); + lastTick = Updater.tickCount; + } + @Override void update() { super.update(); @@ -138,18 +170,24 @@ void update() { incCounter(ticksPassed); } } - + public static class TimeUpdater extends DotUpdater { private long lastTime; - - public TimeUpdater() { this(750); } + + public TimeUpdater() { + this(750); + } + public TimeUpdater(int millisPerCycle) { super(millisPerCycle); } - + @Override - void start() { super.start(); lastTime = System.nanoTime(); } - + void start() { + super.start(); + lastTime = System.nanoTime(); + } + @Override void update() { super.update(); @@ -159,15 +197,18 @@ void update() { incCounter(diffMillis); } } - + public static class CallUpdater extends DotUpdater { - + public CallUpdater(int callsPerCycle) { super(callsPerCycle); } - + @Override - void update() { super.update(); incCounter(1); } + void update() { + super.update(); + incCounter(1); + } } } } diff --git a/src/client/java/minicraft/gfx/Font.java b/src/client/java/minicraft/gfx/Font.java index d9e108623..dc8eb1766 100644 --- a/src/client/java/minicraft/gfx/Font.java +++ b/src/client/java/minicraft/gfx/Font.java @@ -10,27 +10,31 @@ public class Font { // These are all the characters that will be translated to the screen. (The spaces are important) private static final String chars = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"+ - "6789.,!?'\"-+=/\\%()<>:;^@ÁÉÍÓÚÑ¿¡"+ - "ÃÊÇÔÕĞÇÜİÖŞÆØÅŰŐ[]#|{}_АБВГДЕЁЖЗ"+ - "ИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯÀÂÄÈÎÌÏÒ"+ - "ÙÛÝ*«»£$&€§ªºabcdefghijklmnopqrs"+ - "tuvwxyzáàãâäéèêëíìîïóòõôöúùûüçñý"+ - "ÿабвгдеёжзийклмнопрстуфхцчшщъыьэ"+ + "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345" + + "6789.,!?'\"-+=/\\%()<>:;^@ÁÉÍÓÚÑ¿¡" + + "ÃÊÇÔÕĞÇÜİÖŞÆØÅŰŐ[]#|{}_АБВГДЕЁЖЗ" + + "ИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯÀÂÄÈÎÌÏÒ" + + "ÙÛÝ*«»£$&€§ªºabcdefghijklmnopqrs" + + "tuvwxyzáàãâäéèêëíìîïóòõôöúùûüçñý" + + "ÿабвгдеёжзийклмнопрстуфхцчшщъыьэ" + "юяışő"; /* The order of the letters in the chars string is represented in the order that they appear in the sprite-sheet. */ - public static void draw(String msg, Screen screen, int x, int y) { draw(msg, screen, x, y, -1); } + public static void draw(String msg, Screen screen, int x, int y) { + draw(msg, screen, x, y, -1); + } - /** Draws the message to the x & y coordinates on the screen. */ + /** + * Draws the message to the x & y coordinates on the screen. + */ public static void draw(String msg, Screen screen, int x, int y, int whiteTint) { for (int i = 0; i < msg.length(); i++) { // Loops through all the characters that you typed int ix = chars.indexOf(msg.charAt(i)); // The current letter in the message loop if (ix >= 0) { // If that character's position is larger than or equal to 0, then render the character on the screen. - screen.render(x + i * textWidth(msg.substring(i, i+1)), y, ix % 32, ix / 32, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "font"), whiteTint); + screen.render(x + i * textWidth(msg.substring(i, i + 1)), y, ix % 32, ix / 32, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "font"), whiteTint); } } } @@ -64,11 +68,13 @@ public static void drawColor(String message, Screen screen, int x, int y) { } } - public static void drawBackground(String msg, Screen screen, int x, int y) { drawBackground(msg, screen, x, y, -1); } + public static void drawBackground(String msg, Screen screen, int x, int y) { + drawBackground(msg, screen, x, y, -1); + } public static void drawBackground(String msg, Screen screen, int x, int y, int whiteTint) { for (int i = 0; i < msg.length(); i++) { // Renders the black boxes under the text - screen.render(x + i * textWidth(msg.substring(i, i+1)), y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); + screen.render(x + i * textWidth(msg.substring(i, i + 1)), y, 5, 2, 0, Renderer.spriteLinker.getSheet(SpriteType.Gui, "hud")); } // Renders the text @@ -101,7 +107,10 @@ public static void drawCentered(String msg, Screen screen, int y, int color) { /// note: the y centering values in the FontStyle object will be used as a paragraph y centering value instead. - public static void drawParagraph(String para, Screen screen, FontStyle style, int lineSpacing) { drawParagraph(para, screen, Screen.w, Screen.h, style, lineSpacing); } + public static void drawParagraph(String para, Screen screen, FontStyle style, int lineSpacing) { + drawParagraph(para, screen, Screen.w, Screen.h, style, lineSpacing); + } + public static void drawParagraph(String para, Screen screen, int w, int h, FontStyle style, int lineSpacing) { drawParagraph(screen, style, lineSpacing, getLines(para, w, h, lineSpacing)); } @@ -110,12 +119,16 @@ public static void drawParagraph(String para, Screen screen, int w, int h, FontS public static void drawParagraph(List lines, Screen screen, FontStyle style, int lineSpacing) { drawParagraph(screen, style, lineSpacing, lines.toArray(new String[0])); } + public static void drawParagraph(Screen screen, FontStyle style, int lineSpacing, String... lines) { - for(int i = 0; i < lines.length; i++) + for (int i = 0; i < lines.length; i++) style.drawParagraphLine(lines, i, lineSpacing, screen); } - public static String[] getLines(String para, int w, int h, int lineSpacing) { return getLines(para, w, h, lineSpacing, false); } + public static String[] getLines(String para, int w, int h, int lineSpacing) { + return getLines(para, w, h, lineSpacing, false); + } + public static String[] getLines(String para, int w, int h, int lineSpacing, boolean keepEmptyRemainder) { ArrayList lines = new ArrayList<>(); @@ -124,21 +137,21 @@ public static String[] getLines(String para, int w, int h, int lineSpacing, bool // then I reset the para String at the index, and do it again until para is an empty string. int height = textHeight(); - while(para.length() > 0) { // continues to loop as long as there are more characters to parse. + while (para.length() > 0) { // continues to loop as long as there are more characters to parse. int splitIndex = getLine(para, w); // determine how many letters can be fit on to this line. lines.add(para.substring(0, splitIndex)); // add the specified number of characters. - if(splitIndex < para.length() && para.substring(splitIndex, splitIndex+1).matches("[ \n]")) + if (splitIndex < para.length() && para.substring(splitIndex, splitIndex + 1).matches("[ \n]")) splitIndex++; // if there are more characters to do, and the next character is a space or newline, skip it (because the getLine() method will always break before newlines, and will usually otherwise break before spaces. para = para.substring(splitIndex); // remove the characters that have now been added on to the line height += lineSpacing + textHeight(); // move y pos down a line - if(height > h) + if (height > h) break; // If we've run out of space to draw lines, then there's no point in parsing more characters, so we should break out of the loop. } - if(para.length() > 0 || keepEmptyRemainder) + if (para.length() > 0 || keepEmptyRemainder) lines.add(para); // add remainder, but don't add empty lines unintentionally. return lines.toArray(new String[0]); @@ -147,7 +160,7 @@ public static String[] getLines(String para, int w, int h, int lineSpacing, bool // this returns the position index at which the given string should be split so that the first part is the longest line possible. // note, the index returned is exclusive; it should not be included in the line. private static int getLine(String text, int maxWidth) { - if(maxWidth <= 0) return 0; // just to pass the monkey test. :P + if (maxWidth <= 0) return 0; // just to pass the monkey test. :P text = text.replaceAll(" ?\n ?", " \n "); @@ -155,22 +168,22 @@ private static int getLine(String text, int maxWidth) { int curWidth = textWidth(words[0]); - if(curWidth > maxWidth) { + if (curWidth > maxWidth) { // we can't even fit the first word on to the line, even by itself. So we'll have to fit what we can. int i; - for(i = 1; i < words[0].length(); i++) // find how many characters do fit - if(textWidth(words[0].substring(0, i+1)) > maxWidth) + for (i = 1; i < words[0].length(); i++) // find how many characters do fit + if (textWidth(words[0].substring(0, i + 1)) > maxWidth) break; return i; // stop here and return, because we know we can't fit more so we can ignore all that's below } int i; - for(i = 1; i < words.length; i++) { - if(words[i].equals("\n")) break; + for (i = 1; i < words.length; i++) { + if (words[i].equals("\n")) break; - curWidth += textWidth(" "+words[i]); - if(curWidth > maxWidth) + curWidth += textWidth(" " + words[i]); + if (curWidth > maxWidth) break; } // i now contains the number of words that fit on the line. diff --git a/src/client/java/minicraft/gfx/FontStyle.java b/src/client/java/minicraft/gfx/FontStyle.java index 5b70e4c1d..3435770a2 100644 --- a/src/client/java/minicraft/gfx/FontStyle.java +++ b/src/client/java/minicraft/gfx/FontStyle.java @@ -8,13 +8,13 @@ public class FontStyle { /// this specifies the x and y offsets for each binary value in the "shadow location byte", and is what causes each value to progress in a circle. - private static int[] shadowPosMap = { 0, 1, 1, 1, 0, -1, -1, -1, - -1, -1, 0, 1, 1, 1, 0, -1}; + private static int[] shadowPosMap = {0, 1, 1, 1, 0, -1, -1, -1, + -1, -1, 0, 1, 1, 1, 0, -1}; /** - The shadowing technique uses binary strings to specify where to outline a string of text. It was going to be a straight byte, since there are 8 positions, but since it's going to be a string anyway, I decided to make it accept a string. - Each position is specified fairly simply: it goes clockwise, starting from the top. Then it goes top right, right, bottom right, bottom, etc. up to top left. It's kind of like a compass, with a position for N, NE, E, etc. - For an example, for the default shadow, the string is "00010000". though, becuase of the way it's designed, the trailing zeros may be dropped, so it could just be "0001". This doesn't quite read like binary, but it doesn't have to, so whatever. :P - */ + * The shadowing technique uses binary strings to specify where to outline a string of text. It was going to be a straight byte, since there are 8 positions, but since it's going to be a string anyway, I decided to make it accept a string. + * Each position is specified fairly simply: it goes clockwise, starting from the top. Then it goes top right, right, bottom right, bottom, etc. up to top left. It's kind of like a compass, with a position for N, NE, E, etc. + * For an example, for the default shadow, the string is "00010000". though, becuase of the way it's designed, the trailing zeros may be dropped, so it could just be "0001". This doesn't quite read like binary, but it doesn't have to, so whatever. :P + */ private int mainColor; @@ -29,12 +29,15 @@ public class FontStyle { private Rectangle paraBounds; private int padX = 0, padY = 0; - public FontStyle() { this(Color.WHITE); } + public FontStyle() { + this(Color.WHITE); + } + public FontStyle(int mainColor) { this.mainColor = mainColor; shadowColor = Color.get(-1, -1); shadowType = ""; - anchor = new Point(Screen.w/2, Screen.h/2); + anchor = new Point(Screen.w / 2, Screen.h / 2); /// By default, the styling is set so as to center the text in the middle of the screen, with no shadow. } @@ -81,14 +84,14 @@ public void configureForParagraph(String[] para, int spacing) { // In a paragraph, it could be the left side, or right, or top... it depends. // Either way, the draw method needs to use a different position. - Dimension size = new Dimension(Font.textWidth(para), para.length*(Font.textHeight()+spacing)); + Dimension size = new Dimension(Font.textWidth(para), para.length * (Font.textHeight() + spacing)); paraBounds = relTextPos.positionRect(size, anchor, new Rectangle()); } public void setupParagraphLine(String[] para, int line, int spacing) { if (para == null || line < 0 || line >= para.length) { Logger.tag("FontStyle").error("FontStyle.java: " + - (para == null ? "paragraph is null" : "index "+line+" is invalid") + "; can't draw line."); + (para == null ? "paragraph is null" : "index " + line + " is invalid") + "; can't draw line."); return; } @@ -96,8 +99,8 @@ public void setupParagraphLine(String[] para, int line, int spacing) { configureForParagraph(para, spacing); Rectangle textArea = new Rectangle(paraBounds); - textArea.setSize(textArea.getWidth(), Font.textHeight()+spacing, RelPos.TOP_LEFT); - textArea.translate(0, line*textArea.getHeight()); + textArea.setSize(textArea.getWidth(), Font.textHeight() + spacing, RelPos.TOP_LEFT); + textArea.translate(0, line * textArea.getHeight()); anchor = textArea.getPosition(relTextPos.getOpposite()); // For the relpos to put the rect in the correct pos, the anchor should be fetched using to opposite relpos. @@ -114,14 +117,21 @@ public void drawParagraphLine(String[] para, int line, int spacing, Screen scree /* -- All the font modifier methods are below. They all return the current FontStyle instance for chaining. -- */ - /** Sets the color of the text itself. */ + /** + * Sets the color of the text itself. + */ public FontStyle setColor(int col) { mainColor = col; return this; } - /** sets the x position of the text anchor. This causes the text to be left-justified, if alignment is reset. */ - public FontStyle setXPos(int pos) { return setXPos(pos, true); } + /** + * sets the x position of the text anchor. This causes the text to be left-justified, if alignment is reset. + */ + public FontStyle setXPos(int pos) { + return setXPos(pos, true); + } + public FontStyle setXPos(int pos, boolean resetAlignment) { anchor.x = pos; if (resetAlignment) { @@ -130,8 +140,14 @@ public FontStyle setXPos(int pos, boolean resetAlignment) { } return this; } - /** sets the y position of the text anchor. This sets the y pos to be the top of the block, if alignment is reset. */ - public FontStyle setYPos(int pos) { return setYPos(pos, true); } + + /** + * sets the y position of the text anchor. This sets the y pos to be the top of the block, if alignment is reset. + */ + public FontStyle setYPos(int pos) { + return setYPos(pos, true); + } + public FontStyle setYPos(int pos, boolean resetAlignment) { anchor.y = pos; if (resetAlignment) { @@ -146,33 +162,46 @@ public FontStyle setAnchor(int x, int y) { return this; } - /** Sets the position of the text box relative to the anchor. */ - public FontStyle setRelTextPos(RelPos relPos) { return setRelTextPos(relPos, true); } + /** + * Sets the position of the text box relative to the anchor. + */ + public FontStyle setRelTextPos(RelPos relPos) { + return setRelTextPos(relPos, true); + } + public FontStyle setRelTextPos(RelPos relPos, boolean setBoth) { this.relTextPos = relPos; if (setBoth) relLinePos = relTextPos.getOpposite(); return this; } - /** Sets the position of a paragraph of text relative to the anchor. */ + /** + * Sets the position of a paragraph of text relative to the anchor. + */ public FontStyle setRelLinePos(RelPos relPos) { relLinePos = relPos; return this; } - /** This enables text shadowing, and sets the shadow color and type. It is a convenience method that offers a preset for text outlines, and a single shadow in a standard direction. */ + /** + * This enables text shadowing, and sets the shadow color and type. It is a convenience method that offers a preset for text outlines, and a single shadow in a standard direction. + */ public FontStyle setShadowType(int color, boolean full) { String type = full ? "10101010" : "00010000"; setShadowType(color, type); return this; } - /** This is what acutally sets the values described above. It also allows custom shadows. */ + /** + * This is what acutally sets the values described above. It also allows custom shadows. + */ public FontStyle setShadowType(int color, String type) { shadowColor = color; shadowType = type; return this; } - public int getColor() { return mainColor; } + public int getColor() { + return mainColor; + } } diff --git a/src/client/java/minicraft/gfx/Insets.java b/src/client/java/minicraft/gfx/Insets.java index 3728f22ec..1e156e691 100644 --- a/src/client/java/minicraft/gfx/Insets.java +++ b/src/client/java/minicraft/gfx/Insets.java @@ -1,40 +1,49 @@ package minicraft.gfx; public class Insets { - + public int left, top, right, bottom; - - public Insets() { this(0); } - public Insets(int dist) { this(dist, dist, dist, dist); } + + public Insets() { + this(0); + } + + public Insets(int dist) { + this(dist, dist, dist, dist); + } + public Insets(int left, int top, int right, int bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } - + public Rectangle addTo(Rectangle r) { - return new Rectangle(r.getLeft()-left, r.getTop()-top, r.getRight()+right, r.getBottom()+bottom, Rectangle.CORNERS); + return new Rectangle(r.getLeft() - left, r.getTop() - top, r.getRight() + right, r.getBottom() + bottom, Rectangle.CORNERS); } + public Rectangle subtractFrom(Rectangle r) { - return new Rectangle(r.getLeft()+left, r.getTop()+top, r.getRight()-right, r.getBottom()-bottom, Rectangle.CORNERS); + return new Rectangle(r.getLeft() + left, r.getTop() + top, r.getRight() - right, r.getBottom() - bottom, Rectangle.CORNERS); } - + public Dimension addTo(Dimension d) { return new Dimension(d.width + left + right, d.height + top + bottom); } + public Dimension subtractFrom(Dimension d) { return new Dimension(d.width - left - right, d.height - top - bottom); } - + public Insets addInsets(Insets s) { - return new Insets(left+s.left, top+s.top, right+s.right, bottom+s.bottom); + return new Insets(left + s.left, top + s.top, right + s.right, bottom + s.bottom); } + public Insets subtractInsets(Insets s) { - return new Insets(left-s.left, top-s.top, right-s.right, bottom-s.bottom); + return new Insets(left - s.left, top - s.top, right - s.right, bottom - s.bottom); } - + public String toString() { - return super.toString()+"[left=" + left + ",top=" + top + ",right=" + right + ",bottom=" + bottom + "]"; + return super.toString() + "[left=" + left + ",top=" + top + ",right=" + right + ",bottom=" + bottom + "]"; } } diff --git a/src/client/java/minicraft/gfx/MinicraftImage.java b/src/client/java/minicraft/gfx/MinicraftImage.java index 9ef850960..45651abc8 100644 --- a/src/client/java/minicraft/gfx/MinicraftImage.java +++ b/src/client/java/minicraft/gfx/MinicraftImage.java @@ -11,7 +11,9 @@ * As BufferedImage is heavy. Our current rendering system still depends on this array. */ public class MinicraftImage { - /** Each sprite tile size. */ + /** + * Each sprite tile size. + */ public static final int boxWidth = 8; public final int width, height; // Width and height of the sprite sheet @@ -19,19 +21,22 @@ public class MinicraftImage { /** * Default with maximum size of image. + * * @param image The image to be added. * @throws IOException if I/O exception occurs. */ public MinicraftImage(BufferedImage image) throws IOException { - this(image, image.getWidth(), image.getHeight()); + this(image, image.getWidth(), image.getHeight()); } + /** * Custom size. - * @param image The image to be added. - * @param width The width of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. + * + * @param image The image to be added. + * @param width The width of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. * @param height The height of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. * @throws IOException - */ + */ public MinicraftImage(BufferedImage image, int width, int height) throws IOException { if (width % 8 != 0) CrashHandler.errorHandle(new IllegalArgumentException("Invalid width of SpriteSheet."), new CrashHandler.ErrorInfo( diff --git a/src/client/java/minicraft/gfx/Point.java b/src/client/java/minicraft/gfx/Point.java index b1c756bec..feea0c624 100644 --- a/src/client/java/minicraft/gfx/Point.java +++ b/src/client/java/minicraft/gfx/Point.java @@ -1,36 +1,41 @@ package minicraft.gfx; public class Point { - + public int x, y; - - public Point() { this(0, 0); } + + public Point() { + this(0, 0); + } + public Point(int x, int y) { this.x = x; this.y = y; } - + public Point(Point model) { x = model.x; y = model.y; } - + public void translate(int xoff, int yoff) { x += xoff; y += yoff; } - + public String toString() { - return "("+x+","+y+")"; + return "(" + x + "," + y + ")"; } - + @Override public boolean equals(Object other) { if (!(other instanceof Point)) return false; Point o = (Point) other; return x == o.x && y == o.y; } - + @Override - public int hashCode() { return x * 71 + y; } + public int hashCode() { + return x * 71 + y; + } } diff --git a/src/client/java/minicraft/gfx/Rectangle.java b/src/client/java/minicraft/gfx/Rectangle.java index e1c7b38b5..3aeeb0d4d 100644 --- a/src/client/java/minicraft/gfx/Rectangle.java +++ b/src/client/java/minicraft/gfx/Rectangle.java @@ -3,25 +3,27 @@ import minicraft.screen.RelPos; public class Rectangle { - + public static final int CORNER_DIMS = 0; public static final int CORNERS = 1; public static final int CENTER_DIMS = 2; - + private int x, y, w, h; - - public Rectangle() {} // 0 all. + + public Rectangle() { + } // 0 all. + public Rectangle(int x, int y, int x1, int y1, int type) { - if(type < 0 || type > 2) type = 0; - + if (type < 0 || type > 2) type = 0; + if (type != CENTER_DIMS) { // x and y are the coords of the top left corner. this.x = x; this.y = y; } else { // x and y are the coords of the center. - this.x = x - x1/2; - this.y = y - y1/2; + this.x = x - x1 / 2; + this.y = y - y1 / 2; } - + if (type != CORNERS) { // x1 and y1 are the width and height. this.w = x1; this.h = y1; @@ -30,63 +32,95 @@ public Rectangle(int x, int y, int x1, int y1, int type) { this.h = y1 - y; } } - - public Rectangle(Point p, Dimension d) { this(false, p, d); } + + public Rectangle(Point p, Dimension d) { + this(false, p, d); + } + public Rectangle(boolean isCenter, Point p, Dimension d) { this(p.x, p.y, d.width, d.height, isCenter ? CENTER_DIMS : CORNER_DIMS); } - + public Rectangle(Rectangle model) { x = model.x; y = model.y; w = model.w; h = model.h; } - - public int getLeft() { return x; } - public int getRight() { return x + w; } - public int getTop() { return y; } - public int getBottom() { return y + h; } - - public int getWidth() { return w; } - public int getHeight() { return h; } - - public Point getCenter() { return new Point(x + w/2, y + h/2); } - public Dimension getSize() { return new Dimension(w, h); } - + + public int getLeft() { + return x; + } + + public int getRight() { + return x + w; + } + + public int getTop() { + return y; + } + + public int getBottom() { + return y + h; + } + + public int getWidth() { + return w; + } + + public int getHeight() { + return h; + } + + public Point getCenter() { + return new Point(x + w / 2, y + h / 2); + } + + public Dimension getSize() { + return new Dimension(w, h); + } + public Point getPosition(RelPos relPos) { Point p = new Point(x, y); - p.x += relPos.xIndex * w/2; - p.y += relPos.yIndex * h/2; + p.x += relPos.xIndex * w / 2; + p.y += relPos.yIndex * h / 2; return p; } - + public boolean intersects(Rectangle other) { - return !( getLeft() > other.getRight() // Left side is past the other right side - || other.getLeft() > getRight() // Other left side is past the right side - || getBottom() < other.getTop() // Other top is below the bottom - || other.getBottom() < getTop() // Top is below the other bottom + return !(getLeft() > other.getRight() // Left side is past the other right side + || other.getLeft() > getRight() // Other left side is past the right side + || getBottom() < other.getTop() // Other top is below the bottom + || other.getBottom() < getTop() // Top is below the other bottom ); } - - public void setPosition(Point p, RelPos relPos) { setPosition(p.x, p.y, relPos); } + + public void setPosition(Point p, RelPos relPos) { + setPosition(p.x, p.y, relPos); + } + public void setPosition(int x, int y, RelPos relPos) { - this.x = x - relPos.xIndex*w/2; - this.y = y - relPos.yIndex*h/2; + this.x = x - relPos.xIndex * w / 2; + this.y = y - relPos.yIndex * h / 2; } - + public void translate(int xoff, int yoff) { x += xoff; y += yoff; } - - public void setSize(Dimension d, RelPos anchor) { setSize(d.width, d.height, anchor); } + + public void setSize(Dimension d, RelPos anchor) { + setSize(d.width, d.height, anchor); + } + public void setSize(int width, int height, RelPos anchor) { Point p = getPosition(anchor); this.w = width; this.h = height; setPosition(p, anchor); } - - public String toString() { return super.toString()+"[center=" + getCenter() + "; size=" + getSize() + "]"; } + + public String toString() { + return super.toString() + "[center=" + getCenter() + "; size=" + getSize() + "]"; + } } diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index 8491cd62b..43b679ccc 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -11,7 +11,7 @@ public class Screen { public static final int w = Renderer.WIDTH; // Width of the screen public static final int h = Renderer.HEIGHT; // Height of the screen - public static final Point center = new Point(w/2, h/2); + public static final Point center = new Point(w / 2, h / 2); private static final int MAXDARK = 128; @@ -35,23 +35,45 @@ public Screen() { pixels = new int[Screen.w * Screen.h]; // Makes new integer array for all the pixels on the screen. } - /** Clears all the colors on the screen */ + /** + * Clears all the colors on the screen + */ public void clear(int color) { // Turns each pixel into a single color (clearing the screen!) Arrays.fill(pixels, color); } - public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet) { render(xp, yp, xt, yt, bits, sheet, -1); } - public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint) { render(xp, yp, xt, yt, bits, sheet, whiteTint, false); } - /** This method takes care of assigning the correct spritesheet to assign to the sheet variable **/ - public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint, boolean fullbright) { + public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet) { + render(xp, yp, xt, yt, bits, sheet, -1); + } + + public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint) { + render(xp, yp, xt, yt, bits, sheet, whiteTint, false); + } + + /** + * This method takes care of assigning the correct spritesheet to assign to the sheet variable + **/ + public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint, boolean fullbright) { render(xp, yp, xt, yt, bits, sheet, whiteTint, fullbright, 0); - } + } + + public void render(int xp, int yp, LinkedSprite sprite) { + render(xp, yp, sprite.getSprite()); + } + + public void render(int xp, int yp, Sprite sprite) { + render(xp, yp, sprite, false); + } + + public void render(int xp, int yp, Sprite sprite, boolean fullbright) { + render(xp, yp, sprite, 0, fullbright, 0); + } + + public void render(int xp, int yp, Sprite sprite, int mirror, boolean fullbright) { + render(xp, yp, sprite, mirror, fullbright, 0); + } - public void render(int xp, int yp, LinkedSprite sprite) { render(xp, yp, sprite.getSprite()); } - public void render(int xp, int yp, Sprite sprite) { render(xp, yp, sprite, false); } - public void render(int xp, int yp, Sprite sprite, boolean fullbright) { render(xp, yp, sprite, 0, fullbright, 0); } - public void render(int xp, int yp, Sprite sprite, int mirror, boolean fullbright) { render(xp, yp, sprite, mirror, fullbright, 0); } public void render(int xp, int yp, Sprite sprite, int mirror, boolean fullbright, int color) { for (int r = 0; r < sprite.spritePixels.length; r++) { for (int c = 0; c < sprite.spritePixels[r].length; c++) { @@ -61,16 +83,30 @@ public void render(int xp, int yp, Sprite sprite, int mirror, boolean fullbright } } - public void render(int xp, int yp, Sprite.Px pixel) { render(xp, yp, pixel, -1); } - public void render(int xp, int yp, Sprite.Px pixel, int whiteTint) { render(xp, yp, pixel, 0, whiteTint); } - public void render(int xp, int yp, Sprite.Px pixel, int mirror, int whiteTint) { render(xp, yp, pixel, mirror, whiteTint, false); } - public void render(int xp, int yp, Sprite.Px pixel, int mirror, int whiteTint, boolean fullbright) { render(xp, yp, pixel, mirror, whiteTint, fullbright, 0); } + public void render(int xp, int yp, Sprite.Px pixel) { + render(xp, yp, pixel, -1); + } + + public void render(int xp, int yp, Sprite.Px pixel, int whiteTint) { + render(xp, yp, pixel, 0, whiteTint); + } + + public void render(int xp, int yp, Sprite.Px pixel, int mirror, int whiteTint) { + render(xp, yp, pixel, mirror, whiteTint, false); + } + + public void render(int xp, int yp, Sprite.Px pixel, int mirror, int whiteTint, boolean fullbright) { + render(xp, yp, pixel, mirror, whiteTint, fullbright, 0); + } + public void render(int xp, int yp, Sprite.Px pixel, int mirror, int whiteTint, boolean fullbright, int color) { render(xp, yp, pixel.x, pixel.y, pixel.mirror ^ mirror, pixel.sheet, whiteTint, fullbright, color); } - /** Renders an object from the sprite sheet based on screen coordinates, tile (SpriteSheet location), colors, and bits (for mirroring). I believe that xp and yp refer to the desired position of the upper-left-most pixel. */ - public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint, boolean fullbright, int color) { + /** + * Renders an object from the sprite sheet based on screen coordinates, tile (SpriteSheet location), colors, and bits (for mirroring). I believe that xp and yp refer to the desired position of the upper-left-most pixel. + */ + public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage sheet, int whiteTint, boolean fullbright, int color) { if (sheet == null) return; // Verifying that sheet is not null. // xp and yp are originally in level coordinates, but offset turns them to screen coordinates. @@ -131,7 +167,9 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee } } - /** Sets the offset of the screen */ + /** + * Sets the offset of the screen + */ public void setOffset(int xOffset, int yOffset) { // This is called in few places, one of which is level.renderBackground, right before all the tiles are rendered. The offset is determined by the Game class (this only place renderBackground is called), by using the screen's width and the player's position in the level. // In other words, the offset is a conversion factor from level coordinates to screen coordinates. It makes a certain coord in the level the upper left corner of the screen, when subtracted from the tile coord. @@ -147,55 +185,64 @@ public void setOffset(int xOffset, int yOffset) { In the end, "every other every row", will need, for example in column 1, 15 light to be lit, then 0 light to be lit, then 12 light to be lit, then 3 light to be lit. So, the pixels of lower light levels will generally be lit every other pixel, while the brighter ones appear more often. The reason for the variance in values is to provide EVERY number between 0 and 15, so that all possible light levels (below 16) are represented fittingly with their own pattern of lit and not lit. 16 is the minimum pixel lighness required to ensure that the pixel will always remain lit. */ - private static final int[] dither = new int[] { + private static final int[] dither = new int[]{ 0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5 }; - /** Overlays the screen with pixels */ - public void overlay(Screen screen2, int currentLevel, int xa, int ya) { + /** + * Overlays the screen with pixels + */ + public void overlay(Screen screen2, int currentLevel, int xa, int ya) { double tintFactor = 0; if (currentLevel >= 3 && currentLevel < 5) { int transTime = Updater.dayLength / 4; double relTime = (Updater.tickCount % transTime) * 1.0 / transTime; switch (Updater.getTime()) { - case Morning: tintFactor = Updater.pastDay1 ? (1-relTime) * MAXDARK : 0; break; - case Day: tintFactor = 0; break; - case Evening: tintFactor = relTime * MAXDARK; break; - case Night: tintFactor = MAXDARK; break; + case Morning: + tintFactor = Updater.pastDay1 ? (1 - relTime) * MAXDARK : 0; + break; + case Day: + tintFactor = 0; + break; + case Evening: + tintFactor = relTime * MAXDARK; + break; + case Night: + tintFactor = MAXDARK; + break; } if (currentLevel > 3) tintFactor -= (tintFactor < 10 ? tintFactor : 10); tintFactor *= -1; // All previous operations were assuming this was a darkening factor. - } - else if(currentLevel >= 5) + } else if (currentLevel >= 5) tintFactor = -MAXDARK; int[] oPixels = screen2.pixels; // The Integer array of pixels to overlay the screen with. int i = 0; // Current pixel on the screen for (int y = 0; y < h; y++) { // loop through height of screen - for (int x = 0; x < w; x++) { // loop through width of screen + for (int x = 0; x < w; x++) { // loop through width of screen if (oPixels[i] / 10 <= dither[((x + xa) & 3) + ((y + ya) & 3) * 4]) { - /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... + /// The above if statement is simply comparing the light level stored in oPixels with the minimum light level stored in dither. if it is determined that the oPixels[i] is less than the minimum requirements, the pixel is considered "dark", and the below is executed... if (currentLevel < 3) { // if in caves... - /// in the caves, not being lit means being pitch black. + /// in the caves, not being lit means being pitch black. pixels[i] = 0; - } else { + } else { /// Outside the caves, not being lit simply means being darker. - pixels[i] = Color.tintColor(pixels[i], (int)tintFactor); // darkens the color one shade. - } - } + pixels[i] = Color.tintColor(pixels[i], (int) tintFactor); // darkens the color one shade. + } + } // Increase the tinting of all colors by 20. pixels[i] = Color.tintColor(pixels[i], 20); - i++; // Moves to the next pixel. - } - } - } + i++; // Moves to the next pixel. + } + } + } public void renderLight(int x, int y, int r) { // Applies offsets: @@ -224,7 +271,8 @@ public void renderLight(int x, int y, int r) { // If the distance from the center (x,y) is less or equal to the radius... int br = 255 - dist * 255 / (r * r); // area where light will be rendered. // r*r is becuase dist is still x*x+y*y, of pythag theorem. // br = brightness... literally. from 0 to 255. - if (pixels[xx + yy * w] < br) pixels[xx + yy * w] = br; // Pixel cannot be smaller than br; in other words, the pixel color (brightness) cannot be less than br. + if (pixels[xx + yy * w] < br) + pixels[xx + yy * w] = br; // Pixel cannot be smaller than br; in other words, the pixel color (brightness) cannot be less than br. } } } diff --git a/src/client/java/minicraft/gfx/Sprite.java b/src/client/java/minicraft/gfx/Sprite.java index c913a82f3..e5484cf88 100644 --- a/src/client/java/minicraft/gfx/Sprite.java +++ b/src/client/java/minicraft/gfx/Sprite.java @@ -1,15 +1,17 @@ package minicraft.gfx; -/** This class represents a group of pixels on their sprite sheet(s). */ +/** + * This class represents a group of pixels on their sprite sheet(s). + */ public class Sprite { /** - This class needs to store a list of similar segments that make up a sprite, just once for everything. There's usually four groups, but the components are: - -spritesheet location (x, y) - -mirror type - - That's it! - The screen's render method only draws one 8x8 pixel of the spritesheet at a time, so the "sprite size" will be determined by how many repetitions of the above group there are. - */ + * This class needs to store a list of similar segments that make up a sprite, just once for everything. There's usually four groups, but the components are: + * -spritesheet location (x, y) + * -mirror type + *

+ * That's it! + * The screen's render method only draws one 8x8 pixel of the spritesheet at a time, so the "sprite size" will be determined by how many repetitions of the above group there are. + */ public Px[][] spritePixels; public int color = -1; @@ -21,15 +23,17 @@ public Sprite(Px[][] pixels) { public String toString() { StringBuilder out = new StringBuilder(getClass().getName().replace("minicraft.gfx.", "") + "; pixels:"); - for (Px[] row: spritePixels) - for (Px pixel: row) + for (Px[] row : spritePixels) + for (Px pixel : row) out.append("\n").append(pixel.toString()); out.append("\n"); return out.toString(); } - /** This class represents a pixel on the sprite sheet. */ + /** + * This class represents a pixel on the sprite sheet. + */ public static class Px { protected int x, y, mirror; protected MinicraftImage sheet; diff --git a/src/client/java/minicraft/gfx/SpriteAnimation.java b/src/client/java/minicraft/gfx/SpriteAnimation.java index 3b5782676..caeea0fdc 100644 --- a/src/client/java/minicraft/gfx/SpriteAnimation.java +++ b/src/client/java/minicraft/gfx/SpriteAnimation.java @@ -17,7 +17,9 @@ import java.util.HashMap; import java.util.function.BiFunction; -/** This is not applicable for mob sprite animations. Only for generic sprite animations. */ +/** + * This is not applicable for mob sprite animations. Only for generic sprite animations. + */ public class SpriteAnimation implements Destroyable { private static final ArrayList spriteAnimations = new ArrayList<>(); private static final HashMap metas = new HashMap<>(); @@ -34,7 +36,9 @@ public static SpriteMeta getMetadata(String key) { return metas.get(key); } - /** Refreshing all currently registered animations. */ + /** + * Refreshing all currently registered animations. + */ public static void refreshAnimations() { spriteAnimations.forEach(a -> a.refreshAnimation(metas.get(a.key))); } @@ -59,15 +63,20 @@ public static void refreshAnimations() { /** * Constructing animations with the provided key. The meta is given by default. + * * @param type The sprite category. - * @param key The sprite resource key. + * @param key The sprite resource key. */ - public SpriteAnimation(SpriteType type, String key) { this(metas.get(key), type, key); } + public SpriteAnimation(SpriteType type, String key) { + this(metas.get(key), type, key); + } + /** * Constructing animations with the provided metadata and key. It should already be validated. + * * @param meta The metadata of the sprite sheet. * @param type The sprite category. - * @param key The sprite resource key. + * @param key The sprite resource key. */ public SpriteAnimation(SpriteMeta meta, SpriteType type, String key) { this.type = type; @@ -79,6 +88,7 @@ public SpriteAnimation(SpriteMeta meta, SpriteType type, String key) { /** * Setting the tile class of this animation used for tile connector rendering. + * * @param connectChecker The tile connection checker. * @return The instance itself. */ @@ -89,6 +99,7 @@ public SpriteAnimation setConnectChecker(BiFunction conn /** * Setting if the singleton sprite is used for other tile connective rendering. + * * @param connective If used for connective rendering. * @return The instance itself. */ @@ -99,6 +110,7 @@ public SpriteAnimation setSingletonWithConnective(boolean connective) { /** * Setting the color of all animation frames. + * * @param color The color of sprite. * @return The instance itself. */ @@ -112,6 +124,7 @@ public SpriteAnimation setColor(int color) { /** * Setting the color of the specific animation frame. + * * @param frame The specific frame. * @param color The color of sprite. * @return The instance itself. @@ -126,6 +139,7 @@ public SpriteAnimation setColor(int frame, int color) { /** * Setting the mirror of all animation frames. + * * @param mirror The mirror of sprite/ * @return The instance itself. */ @@ -139,7 +153,8 @@ public SpriteAnimation setMirror(int mirror) { /** * Setting the mirror of the specific animation frame. - * @param frame The specific frame. + * + * @param frame The specific frame. * @param mirror The mirror of sprite. * @return The instance itself. */ @@ -153,6 +168,7 @@ public SpriteAnimation setMirror(int frame, int mirror) { /** * Setting the sprite sheet mirror of all frames. + * * @param mirror The mirror of sprite sheet. * @return The instance itself. */ @@ -163,6 +179,7 @@ public SpriteAnimation setSpriteMirror(int mirror) { /** * Getting the current frame of animation. + * * @return The current frame sprite. */ public LinkedSprite getCurrentFrame() { @@ -171,6 +188,7 @@ public LinkedSprite getCurrentFrame() { /** * Getting the specific frame of animation. + * * @param frame The specific frame. * @return The frame sprite. */ @@ -180,10 +198,11 @@ public LinkedSprite getFrame(int frame) { /** * Rendering the animation on the screen. + * * @param screen The screen instance. - * @param level The level for rendering. - * @param x The x coordinate level tile. - * @param y The y coordinate level tile. + * @param level The level for rendering. + * @param x The x coordinate level tile. + * @param y The y coordinate level tile. */ public void render(Screen screen, Level level, int x, int y) { // If border and the tile class is set. @@ -266,14 +285,16 @@ public void render(Screen screen, Level level, int x, int y) { } } - /** Refreshing the animation data for this instance. */ + /** + * Refreshing the animation data for this instance. + */ public void refreshAnimation(SpriteMeta metadata) { frame = 0; frametick = 0; this.metadata = metadata; MinicraftImage sheet = Renderer.spriteLinker.getSheet(type, key); if (sheet == null) { - animations = new LinkedSprite[] {SpriteLinker.missingTexture(type)}; + animations = new LinkedSprite[]{SpriteLinker.missingTexture(type)}; border = null; corner = null; return; @@ -301,7 +322,7 @@ public void refreshAnimation(SpriteMeta metadata) { if (metadata.border != null) border = new LinkedSprite(type, metadata.border); if (metadata.corner != null) corner = new LinkedSprite(type, metadata.corner); } else { - animations = new LinkedSprite[] {new LinkedSprite(type, key).setSpriteSize(width, width)}; + animations = new LinkedSprite[]{new LinkedSprite(type, key).setSpriteSize(width, width)}; border = null; corner = null; } diff --git a/src/client/java/minicraft/gfx/SpriteLinker.java b/src/client/java/minicraft/gfx/SpriteLinker.java index cd987ac6f..12b1909fe 100644 --- a/src/client/java/minicraft/gfx/SpriteLinker.java +++ b/src/client/java/minicraft/gfx/SpriteLinker.java @@ -10,14 +10,20 @@ import java.util.HashMap; public class SpriteLinker { - /** Buffering SpriteSheet for caching. */ + /** + * Buffering SpriteSheet for caching. + */ private final HashMap entitySheets = new HashMap<>(), - guiSheets = new HashMap<>(), itemSheets = new HashMap<>(), tileSheets = new HashMap<>(); + guiSheets = new HashMap<>(), itemSheets = new HashMap<>(), tileSheets = new HashMap<>(); - /** Storing all exist in-used LinkedSprite. */ + /** + * Storing all exist in-used LinkedSprite. + */ private final ArrayList linkedSheets = new ArrayList<>(); - /** Clearing all Sprite buffers for the upcoming resource pack application. */ + /** + * Clearing all Sprite buffers for the upcoming resource pack application. + */ public void resetSprites() { entitySheets.clear(); guiSheets.clear(); @@ -28,37 +34,53 @@ public void resetSprites() { /** * The safe size check which will be required for the higher resolution sprites must be used * before this method invoked. But in new rendering engine. - * @param t The sheet type. - * @param key The sheet key. + * + * @param t The sheet type. + * @param key The sheet key. * @param spriteSheet The sheet. */ public void setSprite(SpriteType t, String key, MinicraftImage spriteSheet) { switch (t) { - case Entity: entitySheets.put(key, spriteSheet); break; - case Gui: guiSheets.put(key, spriteSheet); break; - case Item: itemSheets.put(key, spriteSheet); break; - case Tile: tileSheets.put(key, spriteSheet); break; + case Entity: + entitySheets.put(key, spriteSheet); + break; + case Gui: + guiSheets.put(key, spriteSheet); + break; + case Item: + itemSheets.put(key, spriteSheet); + break; + case Tile: + tileSheets.put(key, spriteSheet); + break; } } /** * Getting the sprite sheet with the category and key. - * @param t The sprite category + * + * @param t The sprite category * @param key The resource key. * @return The sprite sheet. null if not found. */ public MinicraftImage getSheet(SpriteType t, String key) { switch (t) { - case Entity: return entitySheets.get(key); - case Gui: return guiSheets.get(key); - case Item: return itemSheets.get(key); - case Tile: return tileSheets.get(key); + case Entity: + return entitySheets.get(key); + case Gui: + return guiSheets.get(key); + case Item: + return itemSheets.get(key); + case Tile: + return tileSheets.get(key); } return null; } - /** Cleaing all skin sheets in entity sheets. */ + /** + * Cleaing all skin sheets in entity sheets. + */ public void clearSkins() { for (String k : new ArrayList<>(entitySheets.keySet())) { if (k.startsWith("skin.")) entitySheets.remove(k); @@ -67,7 +89,8 @@ public void clearSkins() { /** * Setting the skin in entity sheet. - * @param key The key of the sheet. + * + * @param key The key of the sheet. * @param spriteSheet The sheet to be added. */ public void setSkin(String key, MinicraftImage spriteSheet) { @@ -76,72 +99,105 @@ public void setSkin(String key, MinicraftImage spriteSheet) { /** * Getting the missing texture texture with the specific sprite type. + * * @param type The sprite category. * @return The missing texture or null if invalid sprite type. */ public static LinkedSprite missingTexture(SpriteType type) { switch (type) { - case Entity: return new LinkedSprite(SpriteType.Entity, "missing_entity"); - case Item: return new LinkedSprite(SpriteType.Item, "missing_item"); - case Tile: return new LinkedSprite(SpriteType.Tile, "missing_tile"); - default: return null; + case Entity: + return new LinkedSprite(SpriteType.Entity, "missing_entity"); + case Item: + return new LinkedSprite(SpriteType.Item, "missing_item"); + case Tile: + return new LinkedSprite(SpriteType.Tile, "missing_tile"); + default: + return null; } } /** * Getting the sheet of missing texture with the specific sprite type. + * * @param type The sprite category. * @return Ths missing texture sprite sheet or null if invalid sprite type. */ public MinicraftImage missingSheet(SpriteType type) { switch (type) { // The sheets should be found. - case Entity: return entitySheets.get("missing_entity"); - case Item: return itemSheets.get("missing_item"); - case Tile: return tileSheets.get("missing_tile"); - default: return null; + case Entity: + return entitySheets.get("missing_entity"); + case Item: + return itemSheets.get("missing_item"); + case Tile: + return tileSheets.get("missing_tile"); + default: + return null; } } - /** Updating all existing LinkedSheet for resource pack application. */ + /** + * Updating all existing LinkedSheet for resource pack application. + */ public void updateLinkedSheets() { Logging.SPRITE.debug("Updating all LinkedSprite."); linkedSheets.forEach(s -> s.reload()); } - /** The metadata of the sprite sheet. */ + /** + * The metadata of the sprite sheet. + */ public static class SpriteMeta { - /** The sprite animation configuration. */ + /** + * The sprite animation configuration. + */ public int frames = 1, // Minimum with 1. - frametime = 0; // 0 if no animation. - /** The sprite connector configuration. */ + frametime = 0; // 0 if no animation. + /** + * The sprite connector configuration. + */ public String border = null, corner = null; } - /** The sprite categories in the image resources. TODO Removed for the new save system */ + /** + * The sprite categories in the image resources. TODO Removed for the new save system + */ public static enum SpriteType { Item, Gui, Tile, Entity; // Only for resource packs; Skin is not applied. } /** * Linking the LinkedSprite into specific sheet map. This should only be used by {@link LinkedSprite}. + * * @param sheet The sprite to be linked. - * @param type The sprite type to be linked. + * @param type The sprite type to be linked. */ public void linkSpriteSheet(LinkedSprite sheet, SpriteType type) { // Because of the private access. switch (type) { - case Entity: sheet.linkedMap = Renderer.spriteLinker.entitySheets; break; - case Gui: sheet.linkedMap = Renderer.spriteLinker.guiSheets; break; - case Item: sheet.linkedMap = Renderer.spriteLinker.itemSheets; break; - case Tile: sheet.linkedMap = Renderer.spriteLinker.tileSheets; break; + case Entity: + sheet.linkedMap = Renderer.spriteLinker.entitySheets; + break; + case Gui: + sheet.linkedMap = Renderer.spriteLinker.guiSheets; + break; + case Item: + sheet.linkedMap = Renderer.spriteLinker.itemSheets; + break; + case Tile: + sheet.linkedMap = Renderer.spriteLinker.tileSheets; + break; } } - /** A sprite collector with resource collector. */ + /** + * A sprite collector with resource collector. + */ public static class LinkedSprite implements Destroyable { private final String key; // The resource key. - /** The sprite configuration. */ + /** + * The sprite configuration. + */ private int x, y, w, h, color = -1, mirror = 0, flip = 0; // Sprite data. @@ -153,7 +209,8 @@ public static class LinkedSprite implements Destroyable { /** * Create new LinkedSprite for the specific category and resource key. - * @param t The category of the sprite. + * + * @param t The category of the sprite. * @param key The resource key of the sprite. */ public LinkedSprite(SpriteType t, String key) { @@ -165,6 +222,7 @@ public LinkedSprite(SpriteType t, String key) { /** * Getting the sprite sheet of the linked sprite. + * * @return The current linked sprite. */ public MinicraftImage getSheet() { @@ -173,6 +231,7 @@ public MinicraftImage getSheet() { /** * Setting the sprite size. + * * @param w The sprite width. * @param h The sprite height * @return The instance itself. @@ -183,8 +242,10 @@ public LinkedSprite setSpriteSize(int w, int h) { reloaded = false; // Reload this. return this; } + /** * Setting the sprite position. + * * @param x The x position of the sprite. * @param y The y position of the sprite. * @return The instance itself. @@ -195,8 +256,10 @@ public LinkedSprite setSpritePos(int x, int y) { reloaded = false; // Reload this. return this; } + /** * Setting the sprite position and size. + * * @param x The x position of the sprite. * @param y The y position of the sprite. * @param w The sprite width. @@ -209,8 +272,10 @@ public LinkedSprite setSpriteDim(int x, int y, int w, int h) { reloaded = false; // Reload this. return this; } + /** * Setting the white tint. + * * @param color The color of the white tint. * @return The instance itself. */ @@ -219,8 +284,10 @@ public LinkedSprite setColor(int color) { reloaded = false; // Reload this. return this; } + /** * Setting the mirror of the sprite. + * * @param mirror The mirror of the sprite. * @return The instance itself. */ @@ -229,8 +296,10 @@ public LinkedSprite setMirror(int mirror) { reloaded = false; // Reload this. return this; } + /** * Setting the flip of the sprite sheet. + * * @param flip The mirror of the sprite sheet. * @return The instance itself. */ @@ -242,6 +311,7 @@ public LinkedSprite setFlip(int flip) { /** * Getting the sprite with the configuration. + * * @return The generated sprite. */ public Sprite getSprite() { @@ -252,9 +322,16 @@ public Sprite getSprite() { return sprite; } - /** Requiring the sprite to be reloaded when the next time generated. */ - public void reload() { reloaded = false; } - /** Reloading the sprite with the configuration. */ + /** + * Requiring the sprite to be reloaded when the next time generated. + */ + public void reload() { + reloaded = false; + } + + /** + * Reloading the sprite with the configuration. + */ private void reloadSprite() { MinicraftImage sheet = linkedMap.get(key); if (sheet != null) { @@ -267,8 +344,8 @@ private void reloadSprite() { for (int r = 0; r < h; r++) { for (int c = 0; c < w; c++) { // The offsets are there to determine the pixel that will be there: the one in order, or on the opposite side. - int xOffset = flipX ? w-1 - c : c; - int yOffset = flipY ? h-1 - r : r; + int xOffset = flipX ? w - 1 - c : c; + int yOffset = flipY ? h - 1 - r : r; pixels[r][c] = new Sprite.Px(x + xOffset, y + yOffset, mirror, sheet); } } @@ -283,13 +360,18 @@ private void reloadSprite() { reloaded = true; } - /** Unlink this LinkedSprite from SpriteLinker. */ + /** + * Unlink this LinkedSprite from SpriteLinker. + */ @Override public void destroy() throws DestroyFailedException { Renderer.spriteLinker.linkedSheets.remove(this); // Unlink this instance. destoryed = true; } - /** If this LinkedSprite is unlinked from SpriteLinker. */ + + /** + * If this LinkedSprite is unlinked from SpriteLinker. + */ @Override public boolean isDestroyed() { return destoryed; diff --git a/src/client/java/minicraft/item/ArmorItem.java b/src/client/java/minicraft/item/ArmorItem.java index 430fc3b85..80304ef3f 100644 --- a/src/client/java/minicraft/item/ArmorItem.java +++ b/src/client/java/minicraft/item/ArmorItem.java @@ -28,7 +28,10 @@ protected static ArrayList getAllInstances() { private final int staminaCost; public final int level; - private ArmorItem(String name, LinkedSprite sprite, float health, int level) { this(name, sprite, 1, health, level); } + private ArmorItem(String name, LinkedSprite sprite, float health, int level) { + this(name, sprite, 1, health, level); + } + private ArmorItem(String name, LinkedSprite sprite, int count, float health, int level) { super(name, sprite, count); this.armor = health; @@ -48,7 +51,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public boolean interactsWithWorld() { return false; } + public boolean interactsWithWorld() { + return false; + } public @NotNull ArmorItem copy() { return new ArmorItem(getName(), sprite, count, armor, level); diff --git a/src/client/java/minicraft/item/BookItem.java b/src/client/java/minicraft/item/BookItem.java index f5f1c911c..73867b703 100644 --- a/src/client/java/minicraft/item/BookItem.java +++ b/src/client/java/minicraft/item/BookItem.java @@ -30,7 +30,10 @@ public static interface BookContent { protected BookContent book; // TODO this is not saved yet; it could be, for editable books. private final boolean hasTitlePage; - private BookItem(String title, LinkedSprite sprite, BookContent book) { this(title, sprite, book, false); } + private BookItem(String title, LinkedSprite sprite, BookContent book) { + this(title, sprite, book, false); + } + private BookItem(String title, LinkedSprite sprite, BookContent book, boolean hasTitlePage) { super(title, sprite); this.book = book; @@ -43,7 +46,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public boolean interactsWithWorld() { return false; } + public boolean interactsWithWorld() { + return false; + } public @NotNull BookItem copy() { return new BookItem(getName(), sprite, book, hasTitlePage); diff --git a/src/client/java/minicraft/item/BucketItem.java b/src/client/java/minicraft/item/BucketItem.java index 81e8ad6f1..244c4bf40 100644 --- a/src/client/java/minicraft/item/BucketItem.java +++ b/src/client/java/minicraft/item/BucketItem.java @@ -15,9 +15,9 @@ public class BucketItem extends StackableItem { public enum Fill { - Empty (Tiles.get("hole"), 2), - Water (Tiles.get("water"), 0), - Lava (Tiles.get("lava"), 1); + Empty(Tiles.get("hole"), 2), + Water(Tiles.get("water"), 0), + Lava(Tiles.get("lava"), 1); public Tile contained; public int offset; @@ -31,14 +31,14 @@ public enum Fill { protected static ArrayList getAllInstances() { ArrayList items = new ArrayList<>(); - for (Fill fill: Fill.values()) + for (Fill fill : Fill.values()) items.add(new BucketItem(fill)); return items; } private static Fill getFilling(Tile tile) { - for (Fill fill: Fill.values()) + for (Fill fill : Fill.values()) if (fill.contained.id == tile.id) return fill; @@ -47,7 +47,10 @@ private static Fill getFilling(Tile tile) { private Fill filling; - private BucketItem(Fill fill) { this(fill, 1); } + private BucketItem(Fill fill) { + this(fill, 1); + } + private BucketItem(Fill fill, int count) { super(fill.toString() + " Bucket", new LinkedSprite(SpriteType.Item, fill == Fill.Empty ? "bucket" : fill == Fill.Lava ? "lava_bucket" : "water_bucket"), count); @@ -61,11 +64,13 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, if (filling != Fill.Empty) { if (fill == Fill.Empty) { level.setTile(xt, yt, filling.contained); - if (!Game.isMode("minicraft.settings.mode.creative")) player.activeItem = editBucket(player, Fill.Empty); + if (!Game.isMode("minicraft.settings.mode.creative")) + player.activeItem = editBucket(player, Fill.Empty); return true; } else if (fill == Fill.Lava && filling == Fill.Water) { level.setTile(xt, yt, Tiles.get("Obsidian")); - if (!Game.isMode("minicraft.settings.mode.creative")) player.activeItem = editBucket(player, Fill.Empty); + if (!Game.isMode("minicraft.settings.mode.creative")) + player.activeItem = editBucket(player, Fill.Empty); return true; } } else { // This is an empty bucket @@ -77,7 +82,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, return false; } - /** This method exists due to the fact that buckets are stackable, but only one should be changed at one time. */ + /** + * This method exists due to the fact that buckets are stackable, but only one should be changed at one time. + */ private BucketItem editBucket(Player player, Fill newFill) { if (count == 0) return null; // This honestly should never happen... if (count == 1) return new BucketItem(newFill); @@ -91,11 +98,13 @@ private BucketItem editBucket(Player player, Fill newFill) { } public boolean equals(Item other) { - return super.equals(other) && filling == ((BucketItem)other).filling; + return super.equals(other) && filling == ((BucketItem) other).filling; } @Override - public int hashCode() { return super.hashCode() + filling.offset * 31; } + public int hashCode() { + return super.hashCode() + filling.offset * 31; + } public @NotNull BucketItem copy() { return new BucketItem(filling, count); diff --git a/src/client/java/minicraft/item/ClothingItem.java b/src/client/java/minicraft/item/ClothingItem.java index 6340ded44..49711a92a 100644 --- a/src/client/java/minicraft/item/ClothingItem.java +++ b/src/client/java/minicraft/item/ClothingItem.java @@ -19,20 +19,23 @@ protected static ArrayList getAllInstances() { items.add(new ClothingItem("Red Clothes", new LinkedSprite(SpriteType.Item, "red_clothes"), Color.get(1, 204, 0, 0))); items.add(new ClothingItem("Blue Clothes", new LinkedSprite(SpriteType.Item, "blue_clothes"), Color.get(1, 0, 0, 204))); - items.add(new ClothingItem("Green Clothes", new LinkedSprite(SpriteType.Item, "green_clothes"), Color.get(1, 0, 204, 0))); - items.add(new ClothingItem("Yellow Clothes", new LinkedSprite(SpriteType.Item, "yellow_clothes"), Color.get(1, 204, 204, 0))); - items.add(new ClothingItem("Black Clothes", new LinkedSprite(SpriteType.Item, "black_clothes"), Color.get(1, 51))); - items.add(new ClothingItem("Orange Clothes", new LinkedSprite(SpriteType.Item, "orange_clothes"), Color.get(1, 255, 102, 0))); - items.add(new ClothingItem("Purple Clothes", new LinkedSprite(SpriteType.Item, "purple_clothes"), Color.get(1, 102, 0, 153))); - items.add(new ClothingItem("Cyan Clothes", new LinkedSprite(SpriteType.Item, "cyan_clothes"), Color.get(1, 0, 102, 153))); - items.add(new ClothingItem("Reg Clothes", new LinkedSprite(SpriteType.Item, "reg_clothes"), Color.get(1, 51, 51, 0))); + items.add(new ClothingItem("Green Clothes", new LinkedSprite(SpriteType.Item, "green_clothes"), Color.get(1, 0, 204, 0))); + items.add(new ClothingItem("Yellow Clothes", new LinkedSprite(SpriteType.Item, "yellow_clothes"), Color.get(1, 204, 204, 0))); + items.add(new ClothingItem("Black Clothes", new LinkedSprite(SpriteType.Item, "black_clothes"), Color.get(1, 51))); + items.add(new ClothingItem("Orange Clothes", new LinkedSprite(SpriteType.Item, "orange_clothes"), Color.get(1, 255, 102, 0))); + items.add(new ClothingItem("Purple Clothes", new LinkedSprite(SpriteType.Item, "purple_clothes"), Color.get(1, 102, 0, 153))); + items.add(new ClothingItem("Cyan Clothes", new LinkedSprite(SpriteType.Item, "cyan_clothes"), Color.get(1, 0, 102, 153))); + items.add(new ClothingItem("Reg Clothes", new LinkedSprite(SpriteType.Item, "reg_clothes"), Color.get(1, 51, 51, 0))); return items; } private int playerCol; - private ClothingItem(String name, LinkedSprite sprite, int pcol) { this(name, 1, sprite, pcol); } + private ClothingItem(String name, LinkedSprite sprite, int pcol) { + this(name, 1, sprite, pcol); + } + private ClothingItem(String name, int count, LinkedSprite sprite, int pcol) { super(name, sprite, count); playerCol = pcol; @@ -58,7 +61,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public boolean interactsWithWorld() { return false; } + public boolean interactsWithWorld() { + return false; + } public @NotNull ClothingItem copy() { return new ClothingItem(getName(), count, sprite, playerCol); diff --git a/src/client/java/minicraft/item/FishingData.java b/src/client/java/minicraft/item/FishingData.java index 4f74224c7..2d0928c33 100644 --- a/src/client/java/minicraft/item/FishingData.java +++ b/src/client/java/minicraft/item/FishingData.java @@ -8,22 +8,22 @@ public class FishingData { - public static final List fishData = getData("fish"); + public static final List fishData = getData("fish"); - public static final List toolData = getData("tool"); + public static final List toolData = getData("tool"); - public static final List junkData = getData("junk"); + public static final List junkData = getData("junk"); - public static final List rareData = getData("rare"); + public static final List rareData = getData("rare"); - public static List getData(String name) { - List data; - try { - data = Load.loadFile("/resources/data/fishing/" + name + "_loot.txt"); - } catch (IOException e) { - e.printStackTrace(); - data = new ArrayList<>(); - } - return data; - } + public static List getData(String name) { + List data; + try { + data = Load.loadFile("/resources/data/fishing/" + name + "_loot.txt"); + } catch (IOException e) { + e.printStackTrace(); + data = new ArrayList<>(); + } + return data; + } } diff --git a/src/client/java/minicraft/item/FishingRodItem.java b/src/client/java/minicraft/item/FishingRodItem.java index 5a8fade64..7aed8ec8c 100644 --- a/src/client/java/minicraft/item/FishingRodItem.java +++ b/src/client/java/minicraft/item/FishingRodItem.java @@ -15,75 +15,78 @@ public class FishingRodItem extends Item { - protected static ArrayList getAllInstances() { - ArrayList items = new ArrayList<>(); - - for (int i = 0; i < 4; i++) { - items.add(new FishingRodItem(i)); - } - - return items; - } - private int uses = 0; // The more uses, the higher the chance of breaking - public int level; // The higher the level the lower the chance of breaking - - private Random random = new Random(); - - /* These numbers are a bit confusing, so here's an explanation - * If you want to know the percent chance of a category (let's say tool, which is third) - * You have to subtract 1 + the "tool" number from the number before it (for the first number subtract from 100)*/ - private static final int[][] LEVEL_CHANCES = { - {44, 14, 9, 4}, // They're in the order "fish", "junk", "tools", "rare" - {24, 14, 9, 4}, // Iron has very high chance of fish - {59, 49, 9, 4}, // Gold has very high chance of tools - {79, 69, 59, 4} // Gem has very high chance of rare items - }; - - private static final String[] LEVEL_NAMES = { - "Wood", - "Iron", - "Gold", - "Gem" - }; - - public FishingRodItem(int level) { - super(LEVEL_NAMES[level] + " Fishing Rod", new LinkedSprite(SpriteType.Item, + protected static ArrayList getAllInstances() { + ArrayList items = new ArrayList<>(); + + for (int i = 0; i < 4; i++) { + items.add(new FishingRodItem(i)); + } + + return items; + } + + private int uses = 0; // The more uses, the higher the chance of breaking + public int level; // The higher the level the lower the chance of breaking + + private Random random = new Random(); + + /* These numbers are a bit confusing, so here's an explanation + * If you want to know the percent chance of a category (let's say tool, which is third) + * You have to subtract 1 + the "tool" number from the number before it (for the first number subtract from 100)*/ + private static final int[][] LEVEL_CHANCES = { + {44, 14, 9, 4}, // They're in the order "fish", "junk", "tools", "rare" + {24, 14, 9, 4}, // Iron has very high chance of fish + {59, 49, 9, 4}, // Gold has very high chance of tools + {79, 69, 59, 4} // Gem has very high chance of rare items + }; + + private static final String[] LEVEL_NAMES = { + "Wood", + "Iron", + "Gold", + "Gem" + }; + + public FishingRodItem(int level) { + super(LEVEL_NAMES[level] + " Fishing Rod", new LinkedSprite(SpriteType.Item, LEVEL_NAMES[level].toLowerCase().replace("wood", "wooden") + "_fishing_rod")); - this.level = level; - } - - public static int getChance(int idx, int level) { - return LEVEL_CHANCES[level][idx]; - } - - @Override - public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (tile == Tiles.get("water") && !player.isSwimming()) { // Make sure not to use it if swimming - uses++; - player.isFishing = true; - player.fishingLevel = this.level; - return true; - } - - return false; - } - - @Override - public boolean canAttack() { return false; } - - @Override - public boolean isDepleted() { - if (random.nextInt(100) > 120 - uses + level * 6) { // Breaking is random, the lower the level, and the more times you use it, the higher the chance - Game.notifications.add("Your Fishing rod broke."); - return true; - } - return false; - } - - @Override - public @NotNull Item copy() { - FishingRodItem item = new FishingRodItem(this.level); - item.uses = this.uses; - return item; - } + this.level = level; + } + + public static int getChance(int idx, int level) { + return LEVEL_CHANCES[level][idx]; + } + + @Override + public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { + if (tile == Tiles.get("water") && !player.isSwimming()) { // Make sure not to use it if swimming + uses++; + player.isFishing = true; + player.fishingLevel = this.level; + return true; + } + + return false; + } + + @Override + public boolean canAttack() { + return false; + } + + @Override + public boolean isDepleted() { + if (random.nextInt(100) > 120 - uses + level * 6) { // Breaking is random, the lower the level, and the more times you use it, the higher the chance + Game.notifications.add("Your Fishing rod broke."); + return true; + } + return false; + } + + @Override + public @NotNull Item copy() { + FishingRodItem item = new FishingRodItem(this.level); + item.uses = this.uses; + return item; + } } diff --git a/src/client/java/minicraft/item/FoodItem.java b/src/client/java/minicraft/item/FoodItem.java index d3d02d7aa..1be9c9e81 100644 --- a/src/client/java/minicraft/item/FoodItem.java +++ b/src/client/java/minicraft/item/FoodItem.java @@ -32,13 +32,18 @@ protected static ArrayList getAllInstances() { private final int feed; // The amount of hunger the food "satisfies" you by. private static final int staminaCost = 2; // The amount of stamina it costs to consume the food. - private FoodItem(String name, LinkedSprite sprite, int feed) { this(name, sprite, 1, feed); } + private FoodItem(String name, LinkedSprite sprite, int feed) { + this(name, sprite, 1, feed); + } + private FoodItem(String name, LinkedSprite sprite, int count, int feed) { super(name, sprite, count); this.feed = feed; } - /** What happens when the player uses the item on a tile */ + /** + * What happens when the player uses the item on a tile + */ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { boolean success = false; if (count > 0 && player.hunger < Player.maxHunger && player.payStamina(staminaCost)) { // If the player has hunger to fill, and stamina to pay... @@ -50,7 +55,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public boolean interactsWithWorld() { return false; } + public boolean interactsWithWorld() { + return false; + } public @NotNull FoodItem copy() { return new FoodItem(getName(), sprite, count, feed); diff --git a/src/client/java/minicraft/item/FurnitureItem.java b/src/client/java/minicraft/item/FurnitureItem.java index b65ad2920..278c99cd3 100644 --- a/src/client/java/minicraft/item/FurnitureItem.java +++ b/src/client/java/minicraft/item/FurnitureItem.java @@ -48,12 +48,12 @@ protected static ArrayList getAllInstances() { items.add(new FurnitureItem(new DungeonChest(false, true))); // Add the various types of crafting furniture - for (Crafter.Type type: Crafter.Type.values()) { + for (Crafter.Type type : Crafter.Type.values()) { items.add(new FurnitureItem(new Crafter(type))); } // Add the various lanterns - for (Lantern.Type type: Lantern.Type.values()) { - items.add(new FurnitureItem(new Lantern(type))); + for (Lantern.Type type : Lantern.Type.values()) { + items.add(new FurnitureItem(new Lantern(type))); } items.add(new FurnitureItem(new Tnt())); @@ -72,12 +72,16 @@ public FurnitureItem(Furniture furniture) { placed = false; } - /** Determines if you can attack enemies with furniture (you can't) */ + /** + * Determines if you can attack enemies with furniture (you can't) + */ public boolean canAttack() { return false; } - /** What happens when you press the "Attack" key with the furniture in your hands */ + /** + * What happens when you press the "Attack" key with the furniture in your hands + */ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { if (tile.mayPass(level, xt, yt, furniture)) { // If the furniture can go on the tile Sound.play("craft"); diff --git a/src/client/java/minicraft/item/HeartItem.java b/src/client/java/minicraft/item/HeartItem.java index 320fec1ed..a8297c178 100644 --- a/src/client/java/minicraft/item/HeartItem.java +++ b/src/client/java/minicraft/item/HeartItem.java @@ -22,14 +22,19 @@ protected static ArrayList getAllInstances() { private int health; // The amount of health to increase by. private int staminaCost; // The amount of stamina it costs to consume. - private HeartItem(String name, SpriteLinker.LinkedSprite sprite, int health) { this(name, sprite, 1, health); } + private HeartItem(String name, SpriteLinker.LinkedSprite sprite, int health) { + this(name, sprite, 1, health); + } + private HeartItem(String name, SpriteLinker.LinkedSprite sprite, int count, int health) { super(name, sprite, count); this.health = health; staminaCost = 7; } - /** What happens when the player uses the item on a tile */ + /** + * What happens when the player uses the item on a tile + */ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { boolean success = false; @@ -37,8 +42,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Player.extraHealth += health; // Permanent increase of health by health variable (Basically 5) player.health += health; // Adds health to the player when used. (Almost like absorbing the item's power first time) success = true; - } - else { + } else { Updater.notifyAll("Health increase is at max!"); // When at max, health cannot be increased more and doesn't consume item return false; } @@ -47,7 +51,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public boolean interactsWithWorld() { return false; } + public boolean interactsWithWorld() { + return false; + } public HeartItem clone() { return new HeartItem(getName(), sprite, count, health); diff --git a/src/client/java/minicraft/item/Inventory.java b/src/client/java/minicraft/item/Inventory.java index 106d6b26c..c0ca6b756 100644 --- a/src/client/java/minicraft/item/Inventory.java +++ b/src/client/java/minicraft/item/Inventory.java @@ -21,27 +21,44 @@ public int getMaxSlots() { /** * Returns all the items which are in this inventory. + * * @return ArrayList containing all the items in the inventory. */ - public List getItems() { return new ArrayList<>(items); } - public void clearInv() { items.clear(); } - public int invSize() { return items.size(); } + public List getItems() { + return new ArrayList<>(items); + } + + public void clearInv() { + items.clear(); + } + + public int invSize() { + return items.size(); + } /** * Get one item in this inventory. + * * @param idx The index of the item in the inventory's item array. * @return The specified item. */ - public Item get(int idx) { return items.get(idx); } + public Item get(int idx) { + return items.get(idx); + } /** * Remove an item in this inventory. + * * @param idx The index of the item in the inventory's item array. * @return The removed item. */ - public Item remove(int idx) { return items.remove(idx); } + public Item remove(int idx) { + return items.remove(idx); + } - /** Adds an item to the inventory */ + /** + * Adds an item to the inventory + */ public int add(@Nullable Item item) { if (item != null) return add(items.size(), item); // Adds the item to the end of the inventory list @@ -50,8 +67,9 @@ public int add(@Nullable Item item) { /** * Adds several copies of the same item to the end of the inventory. + * * @param item Item to be added. - * @param num Amount of items to add. + * @param num Amount of items to add. */ public int add(Item item, int num) { int total = 0; @@ -62,6 +80,7 @@ public int add(Item item, int num) { /** * Adds an item to a specific spot in the inventory. + * * @param slot Index to place item at. * @param item Item to be added. * @return The number of items added. @@ -103,7 +122,7 @@ public int add(int slot, Item item) { if (!unlimited) { if (items.size() < maxItem) { - int c = (int) Math.ceil(toTake.count/100.0); + int c = (int) Math.ceil(toTake.count / 100.0); for (int i = 0; i < c; i++) { StackableItem adding = toTake.copy(); adding.count = i + 1 == c && toTake.count % 100 > 0 ? toTake.count % 100 : 100; @@ -135,7 +154,9 @@ public int add(int slot, Item item) { } } - /** Removes items from your inventory; looks for stacks, and removes from each until reached count. returns amount removed. */ + /** + * Removes items from your inventory; looks for stacks, and removes from each until reached count. returns amount removed. + */ private int removeFromStack(StackableItem given, int count) { int removed = 0; // To keep track of amount removed. for (int i = 0; i < items.size(); i++) { @@ -143,7 +164,7 @@ private int removeFromStack(StackableItem given, int count) { StackableItem curItem = (StackableItem) items.get(i); if (!curItem.stacksWith(given)) continue; // Can't do equals, becuase that includes the stack size. // equals; and current item is stackable. - int amountRemoving = Math.min(count-removed, curItem.count); // This is the number of items that are being removed from the stack this run-through. + int amountRemoving = Math.min(count - removed, curItem.count); // This is the number of items that are being removed from the stack this run-through. curItem.count -= amountRemoving; if (curItem.count == 0) { // Remove the item from the inventory if its stack is empty. remove(i); @@ -152,13 +173,14 @@ private int removeFromStack(StackableItem given, int count) { removed += amountRemoving; if (removed == count) break; if (removed > count) { // Just in case... - Logging.INVENTORY.info("SCREW UP while removing items from stack: " + (removed-count) + " too many."); + Logging.INVENTORY.info("SCREW UP while removing items from stack: " + (removed - count) + " too many."); break; } // If not all have been removed, look for another stack. } - if (removed < count) Logging.INVENTORY.info("Inventory: could not remove all items; " + (count-removed) + " left."); + if (removed < count) + Logging.INVENTORY.info("Inventory: could not remove all items; " + (count - removed) + " left."); return removed; } @@ -168,19 +190,20 @@ private int removeFromStack(StackableItem given, int count) { public void removeItem(Item i) { //if (Game.debug) System.out.println("original item: " + i); if (i instanceof StackableItem) - removeItems(i.copy(), ((StackableItem)i).count); + removeItems(i.copy(), ((StackableItem) i).count); else removeItems(i.copy(), 1); } /** * Removes items from this inventory. Note, if passed a stackable item, this will only remove a max of count from the stack. + * * @param given Item to remove. * @param count Max amount of the item to remove. */ public void removeItems(Item given, int count) { if (given instanceof StackableItem) - count -= removeFromStack((StackableItem)given, count); + count -= removeFromStack((StackableItem) given, count); else { for (int i = 0; i < items.size(); i++) { Item curItem = items.get(i); @@ -193,10 +216,12 @@ public void removeItems(Item given, int count) { } if (count > 0) - Logging.INVENTORY.warn("Could not remove " + count + " " + given + (count>1?"s":"") + " from inventory"); + Logging.INVENTORY.warn("Could not remove " + count + " " + given + (count > 1 ? "s" : "") + " from inventory"); } - /** Returns the how many of an item you have in the inventory. */ + /** + * Returns the how many of an item you have in the inventory. + */ public int count(Item given) { if (given == null) return 0; // null requests get no items. :) @@ -216,11 +241,12 @@ else if (curItem.equals(given)) /** * Generates a string representation of all the items in the inventory which can be sent * over the network. + * * @return String representation of all the items in the inventory. */ public String getItemData() { StringBuilder itemdata = new StringBuilder(); - for (Item i: items) + for (Item i : items) itemdata.append(i.getData()).append(":"); if (itemdata.length() > 0) @@ -231,6 +257,7 @@ public String getItemData() { /** * Replaces all the items in the inventory with the items in the string. + * * @param items String representation of an inventory. */ public void updateInv(String items) { @@ -238,17 +265,18 @@ public void updateInv(String items) { if (items.length() == 0) return; // There are no items to add. - for (String item: items.split(":")) // This still generates a 1-item array when "items" is blank... [""]. + for (String item : items.split(":")) // This still generates a 1-item array when "items" is blank... [""]. add(Items.get(item)); } /** * Tries to add an item to the inventory. - * @param chance Chance for the item to be added. - * @param item Item to be added. - * @param num How many of the item. + * + * @param chance Chance for the item to be added. + * @param item Item to be added. + * @param num How many of the item. * @param allOrNothing if true, either all items will be added or none, if false its possible to add - * between 0-num items. + * between 0-num items. */ public void tryAdd(int chance, Item item, int num, boolean allOrNothing) { if (!allOrNothing || random.nextInt(chance) == 0) @@ -256,23 +284,29 @@ public void tryAdd(int chance, Item item, int num, boolean allOrNothing) { if (allOrNothing || random.nextInt(chance) == 0) add(item.copy()); } + public void tryAdd(int chance, @Nullable Item item, int num) { if (item == null) return; if (item instanceof StackableItem) { - ((StackableItem)item).count *= num; + ((StackableItem) item).count *= num; tryAdd(chance, item, 1, true); } else tryAdd(chance, item, num, false); } - public void tryAdd(int chance, @Nullable Item item) { tryAdd(chance, item, 1); } + + public void tryAdd(int chance, @Nullable Item item) { + tryAdd(chance, item, 1); + } + public void tryAdd(int chance, ToolType type, int lvl) { tryAdd(chance, new ToolItem(type, lvl)); } /** * Tries to add an Furniture to the inventory. + * * @param chance Chance for the item to be added. - * @param type Type of furniture to add. + * @param type Type of furniture to add. */ public void tryAdd(int chance, Furniture type) { tryAdd(chance, new FurnitureItem(type)); diff --git a/src/client/java/minicraft/item/Item.java b/src/client/java/minicraft/item/Item.java index a7fed6f38..2761d3b2c 100644 --- a/src/client/java/minicraft/item/Item.java +++ b/src/client/java/minicraft/item/Item.java @@ -25,42 +25,57 @@ protected Item(String name) { sprite = SpriteLinker.missingTexture(SpriteType.Item); this.name = name; } + protected Item(String name, LinkedSprite sprite) { this.name = name; this.sprite = sprite; } - /** Renders an item on the HUD */ + /** + * Renders an item on the HUD + */ public void renderHUD(Screen screen, int x, int y, int fontColor) { String dispName = getDisplayName(); screen.render(x, y, sprite); Font.drawBackground(dispName, screen, x + 8, y, fontColor); } - /** Determines what happens when the player interacts with a tile */ + /** + * Determines what happens when the player interacts with a tile + */ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { return false; } - /** Returning true causes this item to be removed from the player's active item slot */ + /** + * Returning true causes this item to be removed from the player's active item slot + */ public boolean isDepleted() { return false; } - /** Returns if the item can attack mobs or not */ + /** + * Returns if the item can attack mobs or not + */ public boolean canAttack() { return false; } - /** Sees if an item equals another item */ + /** + * Sees if an item equals another item + */ public boolean equals(Item item) { return item != null && item.getClass().equals(getClass()) && item.name.equals(name); } @Override - public int hashCode() { return name.hashCode(); } + public int hashCode() { + return name.hashCode(); + } - /** This returns a copy of this item, in all necessary detail. */ + /** + * This returns a copy of this item, in all necessary detail. + */ @NotNull public abstract Item copy(); @@ -69,22 +84,30 @@ public String toString() { return name + "-Item"; } - /** Gets the necessary data to send over a connection. This data should always be directly input-able into Items.get() to create a valid item with the given properties. */ + /** + * Gets the necessary data to send over a connection. This data should always be directly input-able into Items.get() to create a valid item with the given properties. + */ public String getData() { return name; } - /** Gets the description used for display item information. */ + /** + * Gets the description used for display item information. + */ public String getDescription() { return getName(); } - public final String getName() { return name; } + public final String getName() { + return name; + } // Returns the String that should be used to display this item in a menu or list. public String getDisplayName() { return " " + Localization.getLocalized(getName()); } - public boolean interactsWithWorld() { return true; } + public boolean interactsWithWorld() { + return true; + } } diff --git a/src/client/java/minicraft/item/Items.java b/src/client/java/minicraft/item/Items.java index ce9bbee5b..9612527f4 100644 --- a/src/client/java/minicraft/item/Items.java +++ b/src/client/java/minicraft/item/Items.java @@ -12,19 +12,20 @@ public class Items { // ...well, that used to be true... /** - Ok, so here's the actual big idea: - - This class is meant to define all the different kinds of items in minicraft. Item(Type).java might be what maps the different item sprites in the spritesheet to a name, but it doesn't really define anything final. This class has all the items you could possibly have, and every form of them, more or less. - - If you want to access one of those items, you do it through this class, by calling get("item name"); casing does not matter. + * Ok, so here's the actual big idea: + *

+ * This class is meant to define all the different kinds of items in minicraft. Item(Type).java might be what maps the different item sprites in the spritesheet to a name, but it doesn't really define anything final. This class has all the items you could possibly have, and every form of them, more or less. + *

+ * If you want to access one of those items, you do it through this class, by calling get("item name"); casing does not matter. */ private static final ArrayList items = new ArrayList<>(); private static void add(Item i) { items.add(i); } + private static void addAll(ArrayList items) { - for (Item i: items) add(i); + for (Item i : items) add(i); } static { @@ -50,13 +51,16 @@ public static ArrayList getAll() { return new ArrayList<>(items); } - /** fetches an item from the list given its name. */ + /** + * fetches an item from the list given its name. + */ @NotNull public static Item get(String name) { Item i = get(name, false); if (i == null) return new UnknownItem("NULL"); // Technically shouldn't ever happen return i; } + @Nullable public static Item get(String name, boolean allowNull) { name = name.toUpperCase(); @@ -66,16 +70,15 @@ public static Item get(String name, boolean allowNull) { if (name.contains("_")) { hadUnderscore = true; try { - data = Integer.parseInt(name.substring(name.indexOf("_")+1)); + data = Integer.parseInt(name.substring(name.indexOf("_") + 1)); } catch (Exception ex) { ex.printStackTrace(); } name = name.substring(0, name.indexOf("_")); - } - else if (name.contains(";")) { + } else if (name.contains(";")) { hadUnderscore = true; try { - data = Integer.parseInt(name.substring(name.indexOf(";")+1)); + data = Integer.parseInt(name.substring(name.indexOf(";") + 1)); } catch (Exception ex) { ex.printStackTrace(); } @@ -94,7 +97,7 @@ public static Item get(String name, boolean allowNull) { return new UnknownItem("BLANK"); Item i = null; - for (Item cur: items) { + for (Item cur : items) { if (cur.getName().equalsIgnoreCase(name)) { i = cur; break; @@ -104,9 +107,9 @@ public static Item get(String name, boolean allowNull) { if (i != null) { i = i.copy(); if (i instanceof StackableItem) - ((StackableItem)i).count = data; + ((StackableItem) i).count = data; if (i instanceof ToolItem && hadUnderscore) - ((ToolItem)i).dur = data; + ((ToolItem) i).dur = data; if (i instanceof WateringCanItem) ((WateringCanItem) i).content = data; return i; diff --git a/src/client/java/minicraft/item/PotionItem.java b/src/client/java/minicraft/item/PotionItem.java index c0ef3396d..55ca3775e 100644 --- a/src/client/java/minicraft/item/PotionItem.java +++ b/src/client/java/minicraft/item/PotionItem.java @@ -17,7 +17,7 @@ public class PotionItem extends StackableItem { protected static ArrayList getAllInstances() { ArrayList items = new ArrayList<>(); - for(PotionType type: PotionType.values()) + for (PotionType type : PotionType.values()) items.add(new PotionItem(type)); return items; @@ -25,7 +25,10 @@ protected static ArrayList getAllInstances() { public PotionType type; - private PotionItem(PotionType type) { this(type, 1); } + private PotionItem(PotionType type) { + this(type, 1); + } + private PotionItem(PotionType type, int count) { super(type.name, new LinkedSprite(SpriteType.Item, "potion").setColor(type.dispColor), count); this.type = type; @@ -34,7 +37,7 @@ private PotionItem(PotionType type, int count) { // The return value is used to determine if the potion was used, which means being discarded. public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { if (type.equals(PotionType.Lava)) { - AchievementsDisplay.setAchievement("minicraft.achievement.lava",true); + AchievementsDisplay.setAchievement("minicraft.achievement.lava", true); } return interactOn(applyPotion(player, type, true), player); } @@ -51,6 +54,7 @@ public static boolean applyPotion(Player player, PotionType type, int time) { if (result && time > 0) player.addPotionEffect(type, time); // Overrides time return result; } + /// Main apply potion method public static boolean applyPotion(Player player, PotionType type, boolean addEffect) { if (player.getPotionEffects().containsKey(type) != addEffect) { // If hasEffect, and is disabling, or doesn't have effect, and is enabling... @@ -66,14 +70,18 @@ public static boolean applyPotion(Player player, PotionType type, boolean addEff @Override public boolean equals(Item other) { - return super.equals(other) && ((PotionItem)other).type == type; + return super.equals(other) && ((PotionItem) other).type == type; } @Override - public int hashCode() { return super.hashCode() + type.name.hashCode(); } + public int hashCode() { + return super.hashCode() + type.name.hashCode(); + } @Override - public boolean interactsWithWorld() { return false; } + public boolean interactsWithWorld() { + return false; + } public @NotNull PotionItem copy() { return new PotionItem(type, count); diff --git a/src/client/java/minicraft/item/PotionType.java b/src/client/java/minicraft/item/PotionType.java index 51bad8ba3..67714a2be 100644 --- a/src/client/java/minicraft/item/PotionType.java +++ b/src/client/java/minicraft/item/PotionType.java @@ -7,33 +7,33 @@ import minicraft.level.Level; public enum PotionType { - Awkward (Color.get(1, 41, 51, 255), 0), + Awkward(Color.get(1, 41, 51, 255), 0), - Speed (Color.get(1, 105, 209, 105), 4200) { + Speed(Color.get(1, 105, 209, 105), 4200) { public boolean toggleEffect(Player player, boolean addEffect) { - player.moveSpeed += (double)( addEffect ? 1 : (player.moveSpeed > 1 ? -1 : 0) ); + player.moveSpeed += (double) (addEffect ? 1 : (player.moveSpeed > 1 ? -1 : 0)); return true; } }, - Light (Color.get(1, 183, 183, 91), 6000), - Swim (Color.get(1, 51, 51, 255), 4800), - Energy (Color.get(1, 237, 110, 78), 8400), - Regen (Color.get(1, 219, 70, 189), 1800), + Light(Color.get(1, 183, 183, 91), 6000), + Swim(Color.get(1, 51, 51, 255), 4800), + Energy(Color.get(1, 237, 110, 78), 8400), + Regen(Color.get(1, 219, 70, 189), 1800), - Health (Color.get(1, 194, 56, 84), 0) { + Health(Color.get(1, 194, 56, 84), 0) { public boolean toggleEffect(Player player, boolean addEffect) { if (addEffect) player.heal(5); return true; } }, - Time (Color.get(1, 163), 1800), - Lava (Color.get(1, 199, 58, 58), 7200), - Shield (Color.get(1, 84, 84, 204), 5400), - Haste (Color.get(1, 201, 71, 201), 4800), + Time(Color.get(1, 163), 1800), + Lava(Color.get(1, 199, 58, 58), 7200), + Shield(Color.get(1, 84, 84, 204), 5400), + Haste(Color.get(1, 201, 71, 201), 4800), - Escape (Color.get(1, 222, 162, 162), 0) { + Escape(Color.get(1, 222, 162, 162), 0) { public boolean toggleEffect(Player player, boolean addEffect) { if (addEffect) { int playerDepth = player.getLevel().depth; diff --git a/src/client/java/minicraft/item/Recipe.java b/src/client/java/minicraft/item/Recipe.java index 9ab4f1dd5..630191c51 100644 --- a/src/client/java/minicraft/item/Recipe.java +++ b/src/client/java/minicraft/item/Recipe.java @@ -41,19 +41,31 @@ public Recipe(String createdItem, String... reqItems) { public Item getProduct() { return Items.get(product); } - public Map getCosts() { return new HashMap<>(costs); } - public int getAmount() { return amount; } - public boolean getCanCraft() { return canCraft; } + public Map getCosts() { + return new HashMap<>(costs); + } + + public int getAmount() { + return amount; + } + + public boolean getCanCraft() { + return canCraft; + } + public boolean checkCanCraft(Player player) { canCraft = getCanCraft(player); return canCraft; } - /** Checks if the player can craft the recipe */ + + /** + * Checks if the player can craft the recipe + */ private boolean getCanCraft(Player player) { if (Game.isMode("minicraft.settings.mode.creative")) return true; - for (String cost: costs.keySet().toArray(new String[0])) { // Cycles through the costs list + for (String cost : costs.keySet().toArray(new String[0])) { // Cycles through the costs list /// This method ONLY WORKS if costs does not contain two elements such that inventory.count will count an item it contains as matching more than once. if (player.getInventory().count(Items.get(cost)) < costs.get(cost)) { return false; @@ -69,7 +81,7 @@ public boolean craft(Player player) { if (!Game.isMode("minicraft.settings.mode.creative")) { // Remove the cost items from the inventory. - for (String cost: costs.keySet().toArray(new String[0])) { + for (String cost : costs.keySet().toArray(new String[0])) { player.getInventory().removeItems(Items.get(cost), costs.get(cost)); } } diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 534561380..1c28699d2 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -1,140 +1,140 @@ -package minicraft.item; - -import java.util.ArrayList; - -public class Recipes { - - public static final ArrayList anvilRecipes = new ArrayList<>(); - public static final ArrayList ovenRecipes = new ArrayList<>(); - public static final ArrayList furnaceRecipes = new ArrayList<>(); - public static final ArrayList workbenchRecipes = new ArrayList<>(); - public static final ArrayList enchantRecipes = new ArrayList<>(); - public static final ArrayList craftRecipes = new ArrayList<>(); - public static final ArrayList loomRecipes = new ArrayList<>(); - - static { - craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); - craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - craftRecipes.add(new Recipe("plank_2", "Wood_1")); - craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); - - workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); - workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); - workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); - workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); - workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); - workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); - workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); - workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); - workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); - workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); - workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); - workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); - workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); - workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); - workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); - workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); - workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); - workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); - workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); - workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); - workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); - workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); - workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); - - workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); - workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); - workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); - workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); - - workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); - workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); - - loomRecipes.add(new Recipe("String_2", "Wool_1")); - loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); - loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); - loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); - loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); - loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); - loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); - - loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); - loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); - loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); - loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); - loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); - loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); - loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); - loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); - - loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); - - anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); - anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); - anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); - anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); - anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); - anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); - anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); - anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); - anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); - anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); - anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); - anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); - anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); - anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); - - furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); - furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); - - ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); - ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); - ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); - ovenRecipes.add(new Recipe("bread_1", "wheat_4")); - ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); - - enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); - enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); - enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); - enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); - enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); - enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); - enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); - enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); - enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); - enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); - enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); - enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); - enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); - enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); - } -} +package minicraft.item; + +import java.util.ArrayList; + +public class Recipes { + + public static final ArrayList anvilRecipes = new ArrayList<>(); + public static final ArrayList ovenRecipes = new ArrayList<>(); + public static final ArrayList furnaceRecipes = new ArrayList<>(); + public static final ArrayList workbenchRecipes = new ArrayList<>(); + public static final ArrayList enchantRecipes = new ArrayList<>(); + public static final ArrayList craftRecipes = new ArrayList<>(); + public static final ArrayList loomRecipes = new ArrayList<>(); + + static { + craftRecipes.add(new Recipe("Workbench_1", "Wood_10")); + craftRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + craftRecipes.add(new Recipe("plank_2", "Wood_1")); + craftRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + craftRecipes.add(new Recipe("Wood Door_1", "plank_5")); + + workbenchRecipes.add(new Recipe("Workbench_1", "Wood_10")); + workbenchRecipes.add(new Recipe("Torch_2", "Wood_1", "coal_1")); + workbenchRecipes.add(new Recipe("plank_2", "Wood_1")); + workbenchRecipes.add(new Recipe("Plank Wall_1", "plank_3")); + workbenchRecipes.add(new Recipe("Wood Door_1", "plank_5")); + workbenchRecipes.add(new Recipe("Lantern_1", "Wood_8", "slime_4", "glass_3")); + workbenchRecipes.add(new Recipe("Stone Brick_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Ornate Stone_1", "Stone_2")); + workbenchRecipes.add(new Recipe("Stone Wall_1", "Stone Brick_3")); + workbenchRecipes.add(new Recipe("Stone Door_1", "Stone Brick_5")); + workbenchRecipes.add(new Recipe("Obsidian Brick_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Ornate Obsidian_1", "Raw Obsidian_2")); + workbenchRecipes.add(new Recipe("Obsidian Wall_1", "Obsidian Brick_3")); + workbenchRecipes.add(new Recipe("Obsidian Door_1", "Obsidian Brick_5")); + workbenchRecipes.add(new Recipe("Oven_1", "Stone_15")); + workbenchRecipes.add(new Recipe("Furnace_1", "Stone_20")); + workbenchRecipes.add(new Recipe("Enchanter_1", "Wood_5", "String_2", "Lapis_10")); + workbenchRecipes.add(new Recipe("Chest_1", "Wood_20")); + workbenchRecipes.add(new Recipe("Anvil_1", "iron_5")); + workbenchRecipes.add(new Recipe("Tnt_1", "Gunpowder_10", "Sand_8")); + workbenchRecipes.add(new Recipe("Loom_1", "Wood_10", "Wool_5")); + workbenchRecipes.add(new Recipe("Wood Fishing Rod_1", "Wood_10", "String_3")); + workbenchRecipes.add(new Recipe("Iron Fishing Rod_1", "Iron_10", "String_3")); + workbenchRecipes.add(new Recipe("Gold Fishing Rod_1", "Gold_10", "String_3")); + workbenchRecipes.add(new Recipe("Gem Fishing Rod_1", "Gem_10", "String_3")); + + workbenchRecipes.add(new Recipe("Wood Sword_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Axe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Hoe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Pickaxe_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Shovel_1", "Wood_5")); + workbenchRecipes.add(new Recipe("Wood Bow_1", "Wood_5", "string_2")); + workbenchRecipes.add(new Recipe("Rock Sword_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Axe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Hoe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Pickaxe_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Shovel_1", "Wood_5", "Stone_5")); + workbenchRecipes.add(new Recipe("Rock Bow_1", "Wood_5", "Stone_5", "string_2")); + + workbenchRecipes.add(new Recipe("arrow_3", "Wood_2", "Stone_2")); + workbenchRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + workbenchRecipes.add(new Recipe("Snake Armor_1", "scale_15")); + + loomRecipes.add(new Recipe("String_2", "Wool_1")); + loomRecipes.add(new Recipe("red wool_1", "Wool_1", "rose_1")); + loomRecipes.add(new Recipe("blue wool_1", "Wool_1", "Lapis_1")); + loomRecipes.add(new Recipe("green wool_1", "Wool_1", "Cactus_1")); + loomRecipes.add(new Recipe("yellow wool_1", "Wool_1", "Flower_1")); + loomRecipes.add(new Recipe("black wool_1", "Wool_1", "coal_1")); + loomRecipes.add(new Recipe("Bed_1", "Wood_5", "Wool_3")); + + loomRecipes.add(new Recipe("blue clothes_1", "cloth_5", "Lapis_1")); + loomRecipes.add(new Recipe("green clothes_1", "cloth_5", "Cactus_1")); + loomRecipes.add(new Recipe("yellow clothes_1", "cloth_5", "Flower_1")); + loomRecipes.add(new Recipe("black clothes_1", "cloth_5", "coal_1")); + loomRecipes.add(new Recipe("orange clothes_1", "cloth_5", "rose_1", "Flower_1")); + loomRecipes.add(new Recipe("purple clothes_1", "cloth_5", "Lapis_1", "rose_1")); + loomRecipes.add(new Recipe("cyan clothes_1", "cloth_5", "Lapis_1", "Cactus_1")); + loomRecipes.add(new Recipe("reg clothes_1", "cloth_5")); + + loomRecipes.add(new Recipe("Leather Armor_1", "leather_10")); + + anvilRecipes.add(new Recipe("Iron Armor_1", "iron_10")); + anvilRecipes.add(new Recipe("Gold Armor_1", "gold_10")); + anvilRecipes.add(new Recipe("Gem Armor_1", "gem_65")); + anvilRecipes.add(new Recipe("Empty Bucket_1", "iron_5")); + anvilRecipes.add(new Recipe("Iron Lantern_1", "iron_8", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Gold Lantern_1", "gold_10", "slime_5", "glass_4")); + anvilRecipes.add(new Recipe("Iron Sword_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Claymore_1", "Iron Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Iron Axe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Hoe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Pickaxe_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Shovel_1", "Wood_5", "iron_5")); + anvilRecipes.add(new Recipe("Iron Bow_1", "Wood_5", "iron_5", "string_2")); + anvilRecipes.add(new Recipe("Gold Sword_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Claymore_1", "Gold Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gold Axe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Hoe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Pickaxe_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Shovel_1", "Wood_5", "gold_5")); + anvilRecipes.add(new Recipe("Gold Bow_1", "Wood_5", "gold_5", "string_2")); + anvilRecipes.add(new Recipe("Gem Sword_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Claymore_1", "Gem Sword_1", "shard_15")); + anvilRecipes.add(new Recipe("Gem Axe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Hoe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Pickaxe_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Shovel_1", "Wood_5", "gem_50")); + anvilRecipes.add(new Recipe("Gem Bow_1", "Wood_5", "gem_50", "string_2")); + anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); + anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); + + furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); + furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); + + ovenRecipes.add(new Recipe("cooked pork_1", "raw pork_1", "coal_1")); + ovenRecipes.add(new Recipe("steak_1", "raw beef_1", "coal_1")); + ovenRecipes.add(new Recipe("cooked fish_1", "raw fish_1", "coal_1")); + ovenRecipes.add(new Recipe("bread_1", "wheat_4")); + ovenRecipes.add(new Recipe("Baked Potato_1", "Potato_1")); + + enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); + enchantRecipes.add(new Recipe("awkward potion_1", "glass bottle_1", "Lapis_3")); + enchantRecipes.add(new Recipe("speed potion_1", "awkward potion_1", "Cactus_5")); + enchantRecipes.add(new Recipe("light potion_1", "awkward potion_1", "slime_5")); + enchantRecipes.add(new Recipe("swim potion_1", "awkward potion_1", "raw fish_5")); + enchantRecipes.add(new Recipe("haste potion_1", "awkward potion_1", "Wood_5", "Stone_5")); + enchantRecipes.add(new Recipe("lava potion_1", "awkward potion_1", "Lava Bucket_1")); + enchantRecipes.add(new Recipe("energy potion_1", "awkward potion_1", "gem_25")); + enchantRecipes.add(new Recipe("regen potion_1", "awkward potion_1", "Gold Apple_1")); + enchantRecipes.add(new Recipe("Health Potion_1", "awkward potion_1", "GunPowder_2", "Leather Armor_1")); + enchantRecipes.add(new Recipe("Escape Potion_1", "awkward potion_1", "GunPowder_3", "Lapis_7")); + enchantRecipes.add(new Recipe("Totem of Air_1", "gold_10", "gem_10", "Lapis_5", "Cloud Ore_5")); + enchantRecipes.add(new Recipe("Obsidian Poppet_1", "gold_10", "gem_10", "Lapis_5", "Shard_15")); + enchantRecipes.add(new Recipe("Arcane Fertilizer_3", "Lapis_6", "Bone_2")); + } +} diff --git a/src/client/java/minicraft/item/StackableItem.java b/src/client/java/minicraft/item/StackableItem.java index 73b0634e5..b66dfac8b 100644 --- a/src/client/java/minicraft/item/StackableItem.java +++ b/src/client/java/minicraft/item/StackableItem.java @@ -52,12 +52,15 @@ protected StackableItem(String name, LinkedSprite sprite) { super(name, sprite); count = 1; } + protected StackableItem(String name, LinkedSprite sprite, int count) { this(name, sprite); this.count = count; } - public boolean stacksWith(Item other) { return other instanceof StackableItem && other.getName().equals(getName()); } + public boolean stacksWith(Item other) { + return other instanceof StackableItem && other.getName().equals(getName()); + } // This is used by (most) subclasses, to standardize the count decrement behavior. This is not the normal interactOn method. protected boolean interactOn(boolean subClassSuccess) { @@ -66,7 +69,9 @@ protected boolean interactOn(boolean subClassSuccess) { return subClassSuccess; } - /** Called to determine if this item should be removed from an inventory. */ + /** + * Called to determine if this item should be removed from an inventory. + */ @Override public boolean isDepleted() { return count <= 0; @@ -79,7 +84,7 @@ public boolean isDepleted() { @Override public String toString() { - return super.toString() + "-Stack_Size:"+count; + return super.toString() + "-Stack_Size:" + count; } public String getData() { diff --git a/src/client/java/minicraft/item/SummonItem.java b/src/client/java/minicraft/item/SummonItem.java index 15c0d286e..bf0d73df0 100644 --- a/src/client/java/minicraft/item/SummonItem.java +++ b/src/client/java/minicraft/item/SummonItem.java @@ -31,13 +31,18 @@ protected static ArrayList getAllInstances() { private final String mob; - private SummonItem(String name, LinkedSprite sprite, String mob) { this(name, sprite, 1, mob); } + private SummonItem(String name, LinkedSprite sprite, String mob) { + this(name, sprite, 1, mob); + } + private SummonItem(String name, LinkedSprite sprite, int count, String mob) { super(name, sprite, count); this.mob = mob; } - /** What happens when the player uses the item on a tile */ + /** + * What happens when the player uses the item on a tile + */ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { boolean success = false; @@ -54,8 +59,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Logger.tag("SummonItem").debug("Summoned new Air Wizard"); success = true; } - } - else { + } else { Game.notifications.add(Localization.getLocalized("minicraft.notification.boss_limit")); } } else { @@ -67,7 +71,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, // Check if we are on the right level and tile if (level.depth == -4) { // If the player nears the center. - if (new Rectangle(level.w/2-3, level.h/2-3, 7, 7).contains(player.x >> 4, player.y >> 4)) { + if (new Rectangle(level.w / 2 - 3, level.h / 2 - 3, 7, 7).contains(player.x >> 4, player.y >> 4)) { if (!ObsidianKnight.active) { boolean exists = false; for (Entity e : level.getEntityArray()) { @@ -80,7 +84,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, if (!exists) { // Prevent unintended behaviors // Pay stamina if (player.payStamina(2)) { - level.add(new KnightStatue(5000), level.w/2, level.h/2, true); + level.add(new KnightStatue(5000), level.w / 2, level.h / 2, true); Logger.tag("SummonItem").debug("Summoned new Knight Statue"); success = true; } @@ -106,7 +110,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } @Override - public boolean interactsWithWorld() { return false; } + public boolean interactsWithWorld() { + return false; + } public @NotNull SummonItem copy() { return new SummonItem(getName(), sprite, count, mob); diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index dad79ffee..2c6a39862 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -42,7 +42,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Door"), "Stone Bricks")); items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), new TileModel("Raw Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Obsidian"), "hole", "water", "cloud", "lava")); - items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Ornate Obsidian"),"hole", "water", "cloud", "lava")); + items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Ornate Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Wall", new LinkedSprite(SpriteType.Item, "obsidian_wall"), new TileModel("Obsidian Wall"), "Obsidian")); items.add(new TileItem("Obsidian Door", new LinkedSprite(SpriteType.Item, "obsidian_door"), new TileModel("Obsidian Door"), "Obsidian")); @@ -85,15 +85,17 @@ protected static ArrayList getAllInstances() { protected TileItem(String name, LinkedSprite sprite, TileModel model, String... validTiles) { this(name, sprite, 1, model, Arrays.asList(validTiles)); } + protected TileItem(String name, LinkedSprite sprite, int count, TileModel model, String... validTiles) { this(name, sprite, count, model, Arrays.asList(validTiles)); } + protected TileItem(String name, LinkedSprite sprite, int count, @Nullable TileModel model, List validTiles) { super(name, sprite, count); this.model = model; this.validTiles = new ArrayList<>(); - for (String tile: validTiles) - this.validTiles.add(tile.toUpperCase()); + for (String tile : validTiles) + this.validTiles.add(tile.toUpperCase()); } public static class TileModel { @@ -108,7 +110,10 @@ interface TileDataGetter { int getTileData(Tile model, Tile target, Level level, int xt, int yt, Player player, Direction attackDir); } - public TileModel(String tile) { this(tile, DEFAULT_DATA); } + public TileModel(String tile) { + this(tile, DEFAULT_DATA); + } + public TileModel(String tile, TileDataGetter data) { this.tile = tile.toUpperCase(); this.data = data; @@ -145,11 +150,9 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, String note = ""; if (model.tile.contains("WALL")) { note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); - } - else if (model.tile.contains("DOOR")) { + } else if (model.tile.contains("DOOR")) { note = Localization.getLocalized("minicraft.notification.invalid_placement", Tiles.getName(validTiles.get(0))); - } - else if ((model.tile.contains("BRICK") || model.tile.contains("PLANK") || model.tile.equals("STONE") || model.tile.contains("ORNATE"))) { + } else if ((model.tile.contains("BRICK") || model.tile.contains("PLANK") || model.tile.equals("STONE") || model.tile.contains("ORNATE"))) { note = Localization.getLocalized("minicraft.notification.dig_hole"); } @@ -163,11 +166,13 @@ else if ((model.tile.contains("BRICK") || model.tile.contains("PLANK") || model. @Override public boolean equals(Item other) { - return super.equals(other) && (model == null || model.equals(((TileItem)other).model)); + return super.equals(other) && (model == null || model.equals(((TileItem) other).model)); } @Override - public int hashCode() { return super.hashCode() + (model == null ? 0xFF123 : model.hashCode()); } + public int hashCode() { + return super.hashCode() + (model == null ? 0xFF123 : model.hashCode()); + } public @NotNull TileItem copy() { return new TileItem(getName(), sprite, count, model, validTiles); diff --git a/src/client/java/minicraft/item/ToolItem.java b/src/client/java/minicraft/item/ToolItem.java index 297760fd1..9a105c3b2 100644 --- a/src/client/java/minicraft/item/ToolItem.java +++ b/src/client/java/minicraft/item/ToolItem.java @@ -42,7 +42,9 @@ private static String getSpriteName(String typeName, String level) { return level + typeName.toLowerCase(); } - /** Tool Item, requires a tool type (ToolType.Sword, ToolType.Axe, ToolType.Hoe, etc) and a level (0 = wood, 2 = iron, 4 = gem, etc) */ + /** + * Tool Item, requires a tool type (ToolType.Sword, ToolType.Axe, ToolType.Hoe, etc) and a level (0 = wood, 2 = iron, 4 = gem, etc) + */ public ToolItem(ToolType type, int level) { super(LEVEL_NAMES[level] + " " + type.name(), new LinkedSprite(SpriteType.Item, getSpriteName(type.toString(), LEVEL_NAMES[level] + "_"))); @@ -60,10 +62,13 @@ public ToolItem(ToolType type) { dur = type.durability; } - /** Gets the name of this tool (and it's type) as a display string. */ + /** + * Gets the name of this tool (and it's type) as a display string. + */ @Override public String getDisplayName() { - if (!type.noLevel) return " " + Localization.getLocalized(LEVEL_NAMES[level]) + " " + Localization.getLocalized(type.toString()); + if (!type.noLevel) + return " " + Localization.getLocalized(LEVEL_NAMES[level]) + " " + Localization.getLocalized(type.toString()); else return " " + Localization.getLocalized(type.toString()); } @@ -71,7 +76,9 @@ public boolean isDepleted() { return dur <= 0 && type.durability > 0; } - /** You can attack mobs with tools. */ + /** + * You can attack mobs with tools. + */ public boolean canAttack() { return type != ToolType.Shears; } @@ -86,7 +93,9 @@ public int getDamage() { return random.nextInt(5) + damage; } - /** Gets the attack damage bonus from an item/tool (sword/axe) */ + /** + * Gets the attack damage bonus from an item/tool (sword/axe) + */ public int getAttackDamageBonus(Entity e) { if (!payDurability()) return 0; @@ -111,7 +120,9 @@ public String getData() { return super.getData() + "_" + dur; } - /** Sees if this item equals another. */ + /** + * Sees if this item equals another. + */ @Override public boolean equals(Item item) { if (item instanceof ToolItem) { @@ -122,7 +133,9 @@ public boolean equals(Item item) { } @Override - public int hashCode() { return type.name().hashCode() + level; } + public int hashCode() { + return type.name().hashCode() + level; + } public @NotNull ToolItem copy() { ToolItem ti; diff --git a/src/client/java/minicraft/item/ToolType.java b/src/client/java/minicraft/item/ToolType.java index 242a82e31..932ec62d7 100644 --- a/src/client/java/minicraft/item/ToolType.java +++ b/src/client/java/minicraft/item/ToolType.java @@ -1,14 +1,14 @@ package minicraft.item; public enum ToolType { - Shovel (0, 34), // If there's a second number, it specifies durability. - Hoe (1, 30), - Sword (2, 52), - Pickaxe (3, 38), - Axe (4, 34), - Bow (5, 30), - Claymore (6, 44), - Shears (0, 42, true); + Shovel(0, 34), // If there's a second number, it specifies durability. + Hoe(1, 30), + Sword(2, 52), + Pickaxe(3, 38), + Axe(4, 34), + Bow(5, 30), + Claymore(6, 44), + Shears(0, 42, true); public final int xPos; // X Position of origin public final int yPos; // Y position of origin @@ -19,8 +19,9 @@ public enum ToolType { * Create a tool with four levels: wood, stone, iron, gold, and gem. * All these levels are added automatically but sprites have to be added manually. * Uses line 14 in the item spritesheet. + * * @param xPos X position of the starting sprite in the spritesheet. - * @param dur Durabiltity of the tool. + * @param dur Durabiltity of the tool. */ ToolType(int xPos, int dur) { this.xPos = xPos; @@ -32,8 +33,9 @@ public enum ToolType { /** * Create a tool without a specified level. * Uses line 13 in the items spritesheet. - * @param xPos X position of the sprite in the spritesheet. - * @param dur Durabiltity of the tool. + * + * @param xPos X position of the sprite in the spritesheet. + * @param dur Durabiltity of the tool. * @param noLevel If the tool has only one level. */ ToolType(int xPos, int dur, boolean noLevel) { diff --git a/src/client/java/minicraft/item/TorchItem.java b/src/client/java/minicraft/item/TorchItem.java index 2eee762eb..ff13c7c63 100644 --- a/src/client/java/minicraft/item/TorchItem.java +++ b/src/client/java/minicraft/item/TorchItem.java @@ -19,9 +19,12 @@ public static ArrayList getAllInstances() { return items; } - private TorchItem() { this(1); } + private TorchItem() { + this(1); + } + private TorchItem(int count) { - super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, null, "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand","path","ornate stone","ornate obsidian"); + super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, null, "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian"); } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { @@ -38,7 +41,9 @@ public boolean equals(Item other) { } @Override - public int hashCode() { return 8931; } + public int hashCode() { + return 8931; + } public @NotNull TorchItem copy() { return new TorchItem(count); diff --git a/src/client/java/minicraft/item/WateringCanItem.java b/src/client/java/minicraft/item/WateringCanItem.java index 7ef7d1dd0..181b34745 100644 --- a/src/client/java/minicraft/item/WateringCanItem.java +++ b/src/client/java/minicraft/item/WateringCanItem.java @@ -15,9 +15,7 @@ import minicraft.level.tile.farming.CropTile; import org.jetbrains.annotations.NotNull; -import java.util.AbstractMap; import java.util.ArrayList; -import java.util.Map; import java.util.Random; public class WateringCanItem extends Item { @@ -31,7 +29,7 @@ protected static ArrayList getAllInstances() { private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_can_filled"); private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); - private static final SpriteLinker.LinkedSprite[] spriteSplash = new SpriteLinker.LinkedSprite[] { + private static final SpriteLinker.LinkedSprite[] spriteSplash = new SpriteLinker.LinkedSprite[]{ new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_0"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_1"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_2"), @@ -75,15 +73,15 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, ((CropTile) tile).fertilize(level, xt, yt, 1); } if (random.nextInt(5) == 0) { - double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double x = (double) xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double) yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); } } else if (tile instanceof DirtTile || tile instanceof GrassTile) { if (tile instanceof GrassTile) { if (random.nextInt(15) == 0) { - double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double x = (double) xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double) yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); } if (random.nextInt(60) == 0) { // Small chance for growing flowers @@ -96,8 +94,8 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, if (tile instanceof DirtTile) { if (t instanceof GrassTile) { // Grass tile exists. if (random.nextInt(5) == 0) { - double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double x = (double) xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double) yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); } if (random.nextInt(10) == 0) @@ -107,8 +105,8 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, } else { // tile instanceof GrassTile if (t instanceof DirtTile) { // Dirt tile exists. if (random.nextInt(5) == 0) { - double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double x = (double) xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double) yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); } if (random.nextInt(15) == 0) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 2b5dfba35..d2fb45869 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -2,7 +2,6 @@ import minicraft.core.Game; import minicraft.core.Updater; -import minicraft.core.World; import minicraft.core.io.Localization; import minicraft.core.io.Settings; import minicraft.entity.Entity; @@ -53,8 +52,14 @@ public class Level { private final Random random; private static final String[] levelNames = {"Sky", "Surface", "Iron", "Gold", "Lava", "Dungeon"}; - public static String getLevelName(int depth) { return levelNames[-1 * depth + 1]; } - public static String getDepthString(int depth) { return Localization.getLocalized("minicraft.displays.loading.message.level", depth < 0 ? "B" + (-depth) : depth); } + + public static String getLevelName(int depth) { + return levelNames[-1 * depth + 1]; + } + + public static String getDepthString(int depth) { + return Localization.getLocalized("minicraft.displays.loading.message.level", depth < 0 ? "B" + (-depth) : depth); + } private static final int MOB_SPAWN_FACTOR = 100; // The chance of a mob actually trying to spawn when trySpawn is called equals: mobCount / maxMobCount * MOB_SPAWN_FACTOR. so, it basically equals the chance, 1/number, of a mob spawning when the mob cap is reached. I hope that makes sense... @@ -83,7 +88,9 @@ public class Level { @SuppressWarnings("Convert2Lambda") private static Comparator spriteSorter = Comparator.comparingInt(new ToIntFunction() { @Override - public int applyAsInt(Entity e) { return e.y; } + public int applyAsInt(Entity e) { + return e.y; + } }); public Entity[] getEntitiesToSave() { @@ -98,7 +105,10 @@ public Entity[] getEntitiesToSave() { // This is a solely a debug method I made, to make printing repetitive stuff easier. // Should be changed to accept prepend and entity, or a tile (as an Object). It will get the coordinates and class name from the object, and will divide coords by 16 if passed an entity. - public void printLevelLoc(String prefix, int x, int y) { printLevelLoc(prefix, x, y, ""); } + public void printLevelLoc(String prefix, int x, int y) { + printLevelLoc(prefix, x, y, ""); + } + public void printLevelLoc(String prefix, int x, int y, String suffix) { String levelName = getLevelName(depth); @@ -111,9 +121,10 @@ public void printTileLocs(Tile t) { if (getTile(x, y).id == t.id) printLevelLoc(t.name, x, y); } + public void printEntityLocs(Class c) { int numfound = 0; - for (Entity entity: getEntityArray()) { + for (Entity entity : getEntityArray()) { if (c.isAssignableFrom(entity.getClass())) { printLevelLoc(entity.toString(), entity.x >> 4, entity.y >> 4); numfound++; @@ -155,12 +166,12 @@ public Level(int w, int h, long seed, int level, Level parentLevel, boolean make double dist = Math.max(xd, yd); dist = dist * dist * dist * dist; dist = dist * dist * dist * dist; - val += 1 - dist*20; + val += 1 - dist * 20; val += 1.5; // Assuming the range of value is from 0 to 2. val *= types.length / 2.0; val += 1; // Incrementing index. // The original val mainly falls in small interval instead of averagely. - val = 1.0/(3 * types.length) * Math.pow(val - 5, 2); // Quadratically bloating the value. + val = 1.0 / (3 * types.length) * Math.pow(val - 5, 2); // Quadratically bloating the value. int idx = (int) Math.round(val - 1); // Decrementing index. treeTypes[x + y * w] = (idx >= types.length || idx < 0) ? TreeTile.TreeType.OAK // Oak by default. : types[idx]; @@ -173,7 +184,7 @@ public Level(int w, int h, long seed, int level, Level parentLevel, boolean make updateMobCap(); - if(!makeWorld) { + if (!makeWorld) { int arrsize = w * h; tiles = new short[arrsize]; data = new short[arrsize]; @@ -207,13 +218,11 @@ public Level(int w, int h, long seed, int level, Level parentLevel, boolean make if (parentLevel.getTile(x, y) == Tiles.get("Stairs Down")) { // If the tile in the level above the current one is a stairs down then... if (level == -4) { /// Make the obsidian wall formation around the stair in the dungeon level Structure.dungeonGate.draw(this, x, y); // Te gate should not intersect with the boss room. - Structure.dungeonBossRoom.draw(this, w/2, h/2); // Generating the boss room at the center. - } - else if (level == 0) { // Surface + Structure.dungeonBossRoom.draw(this, w / 2, h / 2); // Generating the boss room at the center. + } else if (level == 0) { // Surface Logging.WORLD.trace("Setting tiles around " + x + "," + y + " to hard rock"); setAreaTiles(x, y, 1, Tiles.get("Hard Rock"), 0); // surround the sky stairs with hard rock - } - else // Any other level, the up-stairs should have dirt on all sides. + } else // Any other level, the up-stairs should have dirt on all sides. setAreaTiles(x, y, 1, Tiles.get("dirt"), 0); setTile(x, y, Tiles.get("Stairs Up")); // Set a stairs up tile in the same position on the current level @@ -248,7 +257,9 @@ public Level(int w, int h, int level, Level parentLevel, boolean makeWorld) { this(w, h, 0, level, parentLevel, makeWorld); } - /** Level which the world is contained in */ + /** + * Level which the world is contained in + */ public Level(int w, int h, int level, Level parentLevel) { this(w, h, level, parentLevel, true); } @@ -260,17 +271,18 @@ public long getSeed() { public void checkAirWizard() { checkAirWizard(true); } + private void checkAirWizard(boolean check) { if (depth == 1 && !AirWizard.beaten) { // Add the airwizard to the surface boolean found = false; if (check) { - for (Entity e: entitiesToAdd) + for (Entity e : entitiesToAdd) if (e instanceof AirWizard) { found = true; break; } - for (Entity e: entities) + for (Entity e : entities) if (e instanceof AirWizard) { found = true; break; @@ -279,7 +291,7 @@ private void checkAirWizard(boolean check) { if (!found) { AirWizard aw = new AirWizard(); - add(aw, w/2, h/2, true); + add(aw, w / 2, h / 2, true); } } } @@ -287,6 +299,7 @@ private void checkAirWizard(boolean check) { public void checkChestCount() { checkChestCount(true); } + private void checkChestCount(boolean check) { // If the level is the dungeon, and we're not just loading the world... if (depth != -4) return; @@ -294,10 +307,10 @@ private void checkChestCount(boolean check) { int numChests = 0; if (check) { - for (Entity e: entitiesToAdd) + for (Entity e : entitiesToAdd) if (e instanceof DungeonChest) numChests++; - for (Entity e: entities) + for (Entity e : entities) if (e instanceof DungeonChest) numChests++; Logging.WORLDNAMED.debug("Found " + numChests + " chests."); @@ -368,7 +381,8 @@ public void tick(boolean fullTick) { boolean inLevel = entities.contains(entity); if (!inLevel) { - if (Logging.logLevel) printEntityStatus("Adding ", entity, "furniture.DungeonChest", "mob.AirWizard", "mob.Player"); + if (Logging.logLevel) + printEntityStatus("Adding ", entity, "furniture.DungeonChest", "mob.AirWizard", "mob.Player"); synchronized (entityLock) { entities.add(entity); @@ -440,8 +454,8 @@ public double distanceOfClosestPlayer(Entity entity) { public void printEntityStatus(String entityMessage, Entity entity, String... searching) { // "searching" can contain any number of class names I want to print when found. String clazz = entity.getClass().getCanonicalName(); - clazz = clazz.substring(clazz.lastIndexOf(".")+1); - for (String search: searching) { + clazz = clazz.substring(clazz.lastIndexOf(".") + 1); + for (String search : searching) { try { if (Class.forName("minicraft.entity." + search).isAssignableFrom(entity.getClass())) { printLevelLoc(entityMessage + clazz, entity.x >> 4, entity.y >> 4, ": " + entity); @@ -454,16 +468,19 @@ public void printEntityStatus(String entityMessage, Entity entity, String... sea } public void dropItem(int x, int y, int mincount, int maxcount, Item... items) { - dropItem(x, y, mincount+random.nextInt(maxcount - mincount + 1), items); + dropItem(x, y, mincount + random.nextInt(maxcount - mincount + 1), items); } + public void dropItem(int x, int y, int count, Item... items) { for (int i = 0; i < count; i++) dropItem(x, y, items); } + public void dropItem(int x, int y, Item... items) { - for (Item i: items) + for (Item i : items) dropItem(x, y, i); } + public ItemEntity dropItem(int x, int y, Item i) { int ranx, rany; @@ -514,7 +531,7 @@ public void renderLight(Screen screen, int xScroll, int yScroll, int brightness) int r = 8; List entities = getEntitiesInTiles(xo - r, yo - r, w + xo + r, h + yo + r); - for (Entity e: entities) { + for (Entity e : entities) { int lr = e.getLightRadius(); if (lr > 0) screen.renderLight(e.x - 1, e.y - 4, lr * brightness); } @@ -541,9 +558,9 @@ private void sortAndRender(Screen screen, List list) { } public Tile getTile(int x, int y) { - if (x < 0 || y < 0 || x >= w || y >= h /* || (x + y * w) >= tiles.length*/ ) return Tiles.get("connector tile"); + if (x < 0 || y < 0 || x >= w || y >= h /* || (x + y * w) >= tiles.length*/) return Tiles.get("connector tile"); int id = tiles[x + y * w]; - if(id < 0) id += 256; + if (id < 0) id += 256; return Tiles.get(id); } @@ -553,7 +570,7 @@ public void setTile(int x, int y, String tilewithdata) { return; } String name = tilewithdata.substring(0, tilewithdata.indexOf("_")); - int data = Tiles.get(name).getData(tilewithdata.substring(name.length()+1)); + int data = Tiles.get(name).getData(tilewithdata.substring(name.length() + 1)); setTile(x, y, Tiles.get(name), data); } @@ -578,11 +595,18 @@ public void setData(int x, int y, int val) { data[x + y * w] = (short) val; } - public void add(Entity e) { if(e==null) return; add(e, e.x, e.y); } - public void add(Entity entity, int x, int y) { add(entity, x, y, false); } + public void add(Entity e) { + if (e == null) return; + add(e, e.x, e.y); + } + + public void add(Entity entity, int x, int y) { + add(entity, x, y, false); + } + public void add(Entity entity, int x, int y, boolean tileCoords) { - if(entity == null) return; - if(tileCoords) { + if (entity == null) return; + if (tileCoords) { x = x * 16 + 8; y = y * 16 + 8; } @@ -599,7 +623,9 @@ public void remove(Entity e) { entitiesToRemove.add(e); } - /** Natural spawn. */ + /** + * Natural spawn. + */ private void trySpawn() { int spawnSkipChance = (int) (MOB_SPAWN_FACTOR * Math.pow(mobCount, 2) / Math.pow(maxMobCount, 2)); if (spawnSkipChance > 0 && random.nextInt(spawnSkipChance) != 0) @@ -652,7 +678,7 @@ private void trySpawn() { } public void removeAllEnemies() { - for (Entity e: getEntityArray()) { + for (Entity e : getEntityArray()) { if (e instanceof EnemyMob) if (!(e instanceof AirWizard) || Game.isMode("minicraft.settings.mode.creative")) // Don't remove the airwizard bosses! Unless in creative, since you can spawn more. e.remove(); @@ -677,34 +703,42 @@ public Entity[] getEntityArray() { return entityArray; } - public List getEntitiesInTiles(int xt, int yt, int radius) { return getEntitiesInTiles(xt, yt, radius, false); } + public List getEntitiesInTiles(int xt, int yt, int radius) { + return getEntitiesInTiles(xt, yt, radius, false); + } @SafeVarargs - public final List getEntitiesInTiles(int xt, int yt, int radius, boolean includeGiven, Class... entityClasses) { return getEntitiesInTiles(xt-radius, yt-radius, xt+radius, yt+radius, includeGiven, entityClasses); } + public final List getEntitiesInTiles(int xt, int yt, int radius, boolean includeGiven, Class... entityClasses) { + return getEntitiesInTiles(xt - radius, yt - radius, xt + radius, yt + radius, includeGiven, entityClasses); + } /** * Get entities in a certain area on the level. + * * @param xt0 Left * @param yt0 Top * @param xt1 Right * @param yt1 Bottom */ - public List getEntitiesInTiles(int xt0, int yt0, int xt1, int yt1) { return getEntitiesInTiles(xt0, yt0, xt1, yt1, false); } + public List getEntitiesInTiles(int xt0, int yt0, int xt1, int yt1) { + return getEntitiesInTiles(xt0, yt0, xt1, yt1, false); + } /** * Get entities in a certain area on the level, and filter them by class. - * @param xt0 Left - * @param yt0 Top - * @param xt1 Right - * @param yt1 Bottom - * @param includeGiven If we should accept entities that match the provided entityClasses. If false, we ignore the provided entityClasses. + * + * @param xt0 Left + * @param yt0 Top + * @param xt1 Right + * @param yt1 Bottom + * @param includeGiven If we should accept entities that match the provided entityClasses. If false, we ignore the provided entityClasses. * @param entityClasses Entities to accept. * @return A list of entities in the area. */ @SafeVarargs public final List getEntitiesInTiles(int xt0, int yt0, int xt1, int yt1, boolean includeGiven, Class... entityClasses) { List contained = new ArrayList<>(); - for (Entity e: getEntityArray()) { + for (Entity e : getEntityArray()) { int xt = e.x >> 4; int yt = e.y >> 4; @@ -729,12 +763,13 @@ public final List getEntitiesInTiles(int xt0, int yt0, int xt1, int yt1, /** * Check if there is an entity on the specified tile. + * * @param x The x position of the tile. * @param y The y position of the tile * @return True if there is an entity on the tile. */ public final boolean isEntityOnTile(int x, int y) { - for (Entity e: getEntityArray()) { + for (Entity e : getEntityArray()) { int xt = e.x >> 4; int yt = e.y >> 4; @@ -747,7 +782,7 @@ public final boolean isEntityOnTile(int x, int y) { public List getEntitiesInRect(Rectangle area) { List result = new ArrayList<>(); - for (Entity e: getEntityArray()) { + for (Entity e : getEntityArray()) { if (e.isTouching(area)) result.add(e); } @@ -767,7 +802,7 @@ public List getEntitiesInRect(Predicate filter, Rectangle area) /// Finds all entities that are an instance of the given entity. public Entity[] getEntitiesOfClass(Class targetClass) { ArrayList matches = new ArrayList<>(); - for (Entity e: getEntityArray()) { + for (Entity e : getEntityArray()) { if (targetClass.isAssignableFrom(e.getClass())) matches.add(e); } @@ -790,7 +825,7 @@ public Player getClosestPlayer(int x, int y) { for (int i = 1; i < players.length; i++) { int curxd = players[i].x - x; int curyd = players[i].y - y; - if(xd*xd + yd*yd > curxd*curxd + curyd*curyd) { + if (xd * xd + yd * yd > curxd * curxd + curyd * curyd) { closest = players[i]; xd = curxd; yd = curyd; @@ -802,11 +837,12 @@ public Player getClosestPlayer(int x, int y) { /** * Calculates maximum position can be reached by an entity with the front boundary of hit box by tile hit box. - * @param sgn One-dimensional direction of displacement - * @param d Displacement vector - * @param hitBoxLeft The left boundary of hit box - * @param hitBoxRight The right boundary of hit box - * @param hitBoxFront The front boundary of hit box + * + * @param sgn One-dimensional direction of displacement + * @param d Displacement vector + * @param hitBoxLeft The left boundary of hit box + * @param hitBoxRight The right boundary of hit box + * @param hitBoxFront The front boundary of hit box * @param frontTilePassableCheck The check of whether the front boundary of hit box hits the tile hit box; * the first parameter takes the front tile position and second one takes the horizontal position * @return The maximum front position can be reached by tile hit box check @@ -834,31 +870,40 @@ public static int calculateMaxFrontClosestTile(int sgn, int d, int hitBoxLeft, i (sgn > 0 ? Math.min(d, (maxFrontTile << 4) - hitBoxFront + (1 << 4) - 1) : Math.max(d, (maxFrontTile << 4) - hitBoxFront)); } - public Point[] getAreaTilePositions(int x, int y, int r) { return getAreaTilePositions(x, y, r, r); } + public Point[] getAreaTilePositions(int x, int y, int r) { + return getAreaTilePositions(x, y, r, r); + } + public Point[] getAreaTilePositions(int x, int y, int rx, int ry) { ArrayList local = new ArrayList<>(); - for (int yp = y-ry; yp <= y+ry; yp++) - for (int xp = x-rx; xp <= x+rx; xp++) + for (int yp = y - ry; yp <= y + ry; yp++) + for (int xp = x - rx; xp <= x + rx; xp++) if (xp >= 0 && xp < w && yp >= 0 && yp < h) local.add(new Point(xp, yp)); return local.toArray(new Point[0]); } - public Tile[] getAreaTiles(int x, int y, int r) { return getAreaTiles(x, y, r, r); } + public Tile[] getAreaTiles(int x, int y, int r) { + return getAreaTiles(x, y, r, r); + } + public Tile[] getAreaTiles(int x, int y, int rx, int ry) { ArrayList local = new ArrayList<>(); - for (Point p: getAreaTilePositions(x, y, rx, ry)) + for (Point p : getAreaTilePositions(x, y, rx, ry)) local.add(getTile(p.x, p.y)); return local.toArray(new Tile[0]); } - public void setAreaTiles(int xt, int yt, int r, Tile tile, int data) { setAreaTiles(xt, yt, r, tile, data, false); } + public void setAreaTiles(int xt, int yt, int r, Tile tile, int data) { + setAreaTiles(xt, yt, r, tile, data, false); + } + public void setAreaTiles(int xt, int yt, int r, Tile tile, int data, boolean overwriteStairs) { - for(int y = yt - r; y <= yt + r; y++) { + for (int y = yt - r; y <= yt + r; y++) { for (int x = xt - r; x <= xt + r; x++) { - if(overwriteStairs || (!getTile(x, y).name.toLowerCase().contains("stairs"))) + if (overwriteStairs || (!getTile(x, y).name.toLowerCase().contains("stairs"))) setTile(x, y, tile, data); } } @@ -878,15 +923,19 @@ public interface TileCheck { boolean check(Tile t, int x, int y); } - public List getMatchingTiles(Tile search) { return getMatchingTiles((t, x, y) -> t.equals(search)); } + public List getMatchingTiles(Tile search) { + return getMatchingTiles((t, x, y) -> t.equals(search)); + } + public List getMatchingTiles(Tile... search) { return getMatchingTiles((t, x, y) -> { - for (Tile poss: search) + for (Tile poss : search) if (t.equals(poss)) return true; return false; }); } + public List getMatchingTiles(TileCheck condition) { List matches = new ArrayList<>(); for (int y = 0; y < h; y++) @@ -898,7 +947,7 @@ public List getMatchingTiles(TileCheck condition) { } public boolean isLight(int x, int y) { - for (Tile t: getAreaTiles(x, y, 3)) + for (Tile t : getAreaTiles(x, y, 3)) if (t instanceof TorchTile) return true; for (Entity e : getEntitiesInRect(e -> e instanceof Lantern, new Rectangle(x, y, 8, 8, Rectangle.CENTER_DIMS))) { @@ -983,8 +1032,7 @@ private void generateSpawnerStructures() { } } } - } - else { + } else { for (int i = 0; i < 18 * (w / 128); i++) { /// For generating spawner dungeons @@ -1126,9 +1174,9 @@ private void generateDungeonStructures() { */ public void regenerateBossRoom() { if (depth == -4) { - Structure.dungeonBossRoom.draw(tiles, w/2, h/2, w); // Generating the boss room at the center. - for (int x = w/2-4; x < w/2+5; x++) { // Resetting tile data. - for (int y = h/2-4; y < h/2+5; y++) { + Structure.dungeonBossRoom.draw(tiles, w / 2, h / 2, w); // Generating the boss room at the center. + for (int x = w / 2 - 4; x < w / 2 + 5; x++) { // Resetting tile data. + for (int y = h / 2 - 4; y < h / 2 + 5; y++) { setData(x, y, 0); } } diff --git a/src/client/java/minicraft/level/LevelGen.java b/src/client/java/minicraft/level/LevelGen.java index 794e5eec9..579a13147 100644 --- a/src/client/java/minicraft/level/LevelGen.java +++ b/src/client/java/minicraft/level/LevelGen.java @@ -22,7 +22,9 @@ public class LevelGen { private final int w, h; // Width and height of the map private static final int stairRadius = 15; - /** This creates noise to create random values for level generation */ + /** + * This creates noise to create random values for level generation + */ public LevelGen(int w, int h, int featureSize) { this.w = w; this.h = h; @@ -244,7 +246,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map double dist = Math.max(xd, yd); dist = dist * dist * dist * dist; dist = dist * dist * dist * dist; - val += 1 - dist*20; + val += 1 - dist * 20; switch ((String) Settings.get("Type")) { case "minicraft.settings.type.island": @@ -502,7 +504,8 @@ private static short[][] createDungeon(int w, int h) { if (val < -0.05) { map[i] = Tiles.get("Obsidian Wall").id; - }else if(val>=-0.05 && val<-0.03){map[i] = Tiles.get("Lava").id; + } else if (val >= -0.05 && val < -0.03) { + map[i] = Tiles.get("Lava").id; } else { if (random.nextInt(2) == 1) { if (random.nextInt(2) == 1) { @@ -510,8 +513,7 @@ private static short[][] createDungeon(int w, int h) { } else { map[i] = Tiles.get("Raw Obsidian").id; } - } - else { + } else { map[i] = Tiles.get("dirt").id; } } @@ -629,10 +631,10 @@ private static short[][] createUndergroundMap(int w, int h, int depth) { if (depth > 2) { // The level above dungeon. int r = 1; - int xm = w/2; - int ym = h/2; + int xm = w / 2; + int ym = h / 2; int side = 6; // The side of the lock is 5, and pluses margin with 1. - int edgeMargin = w/20; // The distance between the world enge and the lock sides. + int edgeMargin = w / 20; // The distance between the world enge and the lock sides. Rectangle lockRect = new Rectangle(0, 0, side, side, 0); Rectangle bossRoomRect = new Rectangle(xm, ym, 20, 20, Rectangle.CENTER_DIMS); do { // Trying to generate a lock not intersecting to the boss room in the dungeon. @@ -820,8 +822,8 @@ public static void main(String[] args) { } } img.setRGB(0, 0, w, h, pixels, 0, w); - int op = JOptionPane.showOptionDialog(null, null, "Map With Seed "+worldSeed, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, - new ImageIcon(img.getScaledInstance(w * 4, h * 4, Image.SCALE_AREA_AVERAGING)), new String[] {"Next", "0x100", "0xAAFF20"}, "Next"); + int op = JOptionPane.showOptionDialog(null, null, "Map With Seed " + worldSeed, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, + new ImageIcon(img.getScaledInstance(w * 4, h * 4, Image.SCALE_AREA_AVERAGING)), new String[]{"Next", "0x100", "0xAAFF20"}, "Next"); if (op == 1) LevelGen.worldSeed = 0x100; else if (op == 2) LevelGen.worldSeed = 0xAAFF20; else LevelGen.worldSeed++; diff --git a/src/client/java/minicraft/level/Structure.java b/src/client/java/minicraft/level/Structure.java index 8175ece84..a56be98d0 100644 --- a/src/client/java/minicraft/level/Structure.java +++ b/src/client/java/minicraft/level/Structure.java @@ -22,6 +22,7 @@ public Structure() { tiles = new HashSet<>(); furniture = new HashMap<>(); } + public Structure(Structure struct) { this.tiles = struct.tiles; this.furniture = struct.furniture; @@ -30,20 +31,21 @@ public Structure(Structure struct) { public void setTile(int x, int y, Tile tile) { tiles.add(new TilePoint(x, y, tile)); } + public void addFurniture(int x, int y, Furniture furniture) { this.furniture.put(new Point(x, y), furniture); } public void draw(Level level, int xt, int yt) { - for (TilePoint p: tiles) - level.setTile(xt+p.x, yt+p.y, p.t); + for (TilePoint p : tiles) + level.setTile(xt + p.x, yt + p.y, p.t); - for (Point p: furniture.keySet()) - level.add(furniture.get(p).copy(), xt+p.x, yt+p.y, true); + for (Point p : furniture.keySet()) + level.add(furniture.get(p).copy(), xt + p.x, yt + p.y, true); } public void draw(short[] map, int xt, int yt, int mapWidth) { - for (TilePoint p: tiles) + for (TilePoint p : tiles) map[(xt + p.x) + (yt + p.y) * mapWidth] = p.t.id; } @@ -66,7 +68,7 @@ public void setData(String keys, String data) { for (int c = 0; c < dataLines[i].length(); c++) { if (dataLines[i].charAt(c) != '*') { Tile tile = Tiles.get(keyPairs.get(String.valueOf(dataLines[i].charAt(c)))); - this.setTile(-width / 2 + i, - height / 2 + c, tile); + this.setTile(-width / 2 + i, -height / 2 + c, tile); } } } @@ -125,21 +127,21 @@ public int hashCode() { static { dungeonGate = new Structure(); dungeonGate.setData("O:Obsidian,D:Obsidian Door,W:Obsidian Wall", - "WWDWW\n" + - "WOOOW\n" + - "DOOOD\n" + - "WOOOW\n" + - "WWDWW" + "WWDWW\n" + + "WOOOW\n" + + "DOOOD\n" + + "WOOOW\n" + + "WWDWW" ); dungeonGate.addFurniture(-1, -1, new Lantern(Lantern.Type.IRON)); dungeonLock = new Structure(); dungeonLock.setData("O:Obsidian,W:Obsidian Wall", - "WWWWW\n" + - "WOOOW\n" + - "WOOOW\n" + - "WOOOW\n" + - "WWWWW" + "WWWWW\n" + + "WOOOW\n" + + "WOOOW\n" + + "WOOOW\n" + + "WWWWW" ); dungeonBossRoom = new Structure(); dungeonBossRoom.setData("O:Obsidian Boss Floor,D:Obsidian Boss Door,W:Obsidian Boss Wall", @@ -153,7 +155,7 @@ public int hashCode() { "WOOOOOOOW\n" + "WWWWDWWWW" ); - dungeonBossRoom.addFurniture(0,0,new KnightStatue(5000)); + dungeonBossRoom.addFurniture(0, 0, new KnightStatue(5000)); dungeonSpawner = new Structure(); dungeonSpawner.setData("F:Grass,W:Obsidian Wall,O:Ornate Obsidian,D:Obsidian Door", @@ -168,8 +170,8 @@ public int hashCode() { lavaPool = new Structure(); lavaPool.setData("L:Lava", - "LL\n" + - "LL" + "LL\n" + + "LL" ); ornateLavaPool = new Structure(); @@ -204,94 +206,94 @@ public int hashCode() { "WOOOOOW\n" + "WWWDWWW" ); - dungeonChest.addFurniture(0,0, new DungeonChest(true)); + dungeonChest.addFurniture(0, 0, new DungeonChest(true)); mobDungeonCenter = new Structure(); mobDungeonCenter.setData("B:Stone Bricks,W:Stone Wall", - "WWBWW\n" + - "WBBBW\n" + - "BBBBB\n" + - "WBBBW\n" + - "WWBWW" + "WWBWW\n" + + "WBBBW\n" + + "BBBBB\n" + + "WBBBW\n" + + "WWBWW" ); mobDungeonNorth = new Structure(); mobDungeonNorth.setData("B:Stone Bricks,W:Stone Wall", - "WWWWW\n" + - "WBBBB\n" + - "BBBBB\n" + - "WBBBB\n" + - "WWWWW" + "WWWWW\n" + + "WBBBB\n" + + "BBBBB\n" + + "WBBBB\n" + + "WWWWW" ); mobDungeonSouth = new Structure(); mobDungeonSouth.setData("B:Stone Bricks,W:Stone Wall", - "WWWWW\n" + - "BBBBW\n" + - "BBBBB\n" + - "BBBBW\n" + - "WWWWW" + "WWWWW\n" + + "BBBBW\n" + + "BBBBB\n" + + "BBBBW\n" + + "WWWWW" ); mobDungeonEast = new Structure(); mobDungeonEast.setData("B:Stone Bricks,W:Stone Wall", - "WBBBW\n" + - "WBBBW\n" + - "WBBBW\n" + - "WBBBW\n" + - "WWBWW" + "WBBBW\n" + + "WBBBW\n" + + "WBBBW\n" + + "WBBBW\n" + + "WWBWW" ); mobDungeonWest = new Structure(); mobDungeonWest.setData("B:Stone Bricks,W:Stone Wall", - "WWBWW\n" + - "WBBBW\n" + - "WBBBW\n" + - "WBBBW\n" + - "WBBBW" + "WWBWW\n" + + "WBBBW\n" + + "WBBBW\n" + + "WBBBW\n" + + "WBBBW" ); airWizardHouse = new Structure(); airWizardHouse.setData("F:Wood Planks,W:Wood Wall,D:Wood Door", - "WWWWWWW\n" + - "WFFFFFW\n" + - "DFFFFFW\n" + - "WFFFFFW\n" + - "WWWWWWW" + "WWWWWWW\n" + + "WFFFFFW\n" + + "DFFFFFW\n" + + "WFFFFFW\n" + + "WWWWWWW" ); airWizardHouse.addFurniture(-2, 0, new Lantern(Lantern.Type.GOLD)); airWizardHouse.addFurniture(0, 0, new Crafter(Crafter.Type.Enchanter)); villageHouseNormal = new Structure(); villageHouseNormal.setData("F:Wood Planks,W:Wood Wall,D:Wood Door,G:Grass", - "WWWWW\n" + - "WFFFW\n" + - "WFFFD\n" + - "WFFFG\n" + - "WWWWW" + "WWWWW\n" + + "WFFFW\n" + + "WFFFD\n" + + "WFFFG\n" + + "WWWWW" ); villageHouseTwoDoor = new Structure(); villageHouseTwoDoor.setData("F:Wood Planks,W:Wood Wall,D:Wood Door,G:Grass", - "WWWWW\n" + - "WFFFW\n" + - "DFFFW\n" + - "WFFFW\n" + - "WWDWW" + "WWWWW\n" + + "WFFFW\n" + + "DFFFW\n" + + "WFFFW\n" + + "WWDWW" ); villageRuinedOverlay1 = new Structure(); villageRuinedOverlay1.setData("G:Grass,F:Wood Planks", - "**FG*\n" + - "F*GG*\n" + - "*G**F\n" + - "G*G**\n" + - "***G*" + "**FG*\n" + + "F*GG*\n" + + "*G**F\n" + + "G*G**\n" + + "***G*" ); villageRuinedOverlay2 = new Structure(); villageRuinedOverlay2.setData("G:Grass,F:Wood Planks", - "F**G*\n" + - "*****\n" + - "*GG**\n" + - "F**G*\n" + - "*F**G" + "F**G*\n" + + "*****\n" + + "*GG**\n" + + "F**G*\n" + + "*F**G" ); } } diff --git a/src/client/java/minicraft/level/tile/CactusTile.java b/src/client/java/minicraft/level/tile/CactusTile.java index 3fa2c59f7..8dceb499f 100644 --- a/src/client/java/minicraft/level/tile/CactusTile.java +++ b/src/client/java/minicraft/level/tile/CactusTile.java @@ -52,7 +52,7 @@ public void render(Screen screen, Level level, int x, int y) { } public void bumpedInto(Level level, int x, int y, Entity entity) { - if(!(entity instanceof Mob)) return; + if (!(entity instanceof Mob)) return; Mob m = (Mob) entity; if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) { m.hurt(this, x, y, 1); diff --git a/src/client/java/minicraft/level/tile/ConnectTile.java b/src/client/java/minicraft/level/tile/ConnectTile.java index c6db32812..f46f1a197 100644 --- a/src/client/java/minicraft/level/tile/ConnectTile.java +++ b/src/client/java/minicraft/level/tile/ConnectTile.java @@ -9,17 +9,17 @@ // TODO Remove this. // IMPORTANT: This tile should never be used for anything, it only exists to allow tiles right next to the edge of the world to connect to it public class ConnectTile extends Tile { - public ConnectTile() { - super("connector tile", new SpriteAnimation(SpriteType.Tile, "missing_tile")); - } + public ConnectTile() { + super("connector tile", new SpriteAnimation(SpriteType.Tile, "missing_tile")); + } - @Override - public boolean mayPass(Level level, int x, int y, Entity e) { - return false; - } + @Override + public boolean mayPass(Level level, int x, int y, Entity e) { + return false; + } - @Override - public boolean maySpawn() { - return false; - } + @Override + public boolean maySpawn() { + return false; + } } diff --git a/src/client/java/minicraft/level/tile/DecorTile.java b/src/client/java/minicraft/level/tile/DecorTile.java index a40f13f2a..b4266bd94 100644 --- a/src/client/java/minicraft/level/tile/DecorTile.java +++ b/src/client/java/minicraft/level/tile/DecorTile.java @@ -38,9 +38,14 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } Item drop; switch (type) { - case Stone: drop = Items.get("Ornate Stone"); break; - case Obsidian: drop = Items.get("Ornate Obsidian"); break; - default: throw new IllegalStateException("Unexpected value: " + type); + case Stone: + drop = Items.get("Ornate Stone"); + break; + case Obsidian: + drop = Items.get("Ornate Obsidian"); + break; + default: + throw new IllegalStateException("Unexpected value: " + type); } Sound.play("monsterhurt"); level.dropItem(xt * 16 + 8, yt * 16 + 8, drop); diff --git a/src/client/java/minicraft/level/tile/DirtTile.java b/src/client/java/minicraft/level/tile/DirtTile.java index 090f19ff4..2ee791f7f 100644 --- a/src/client/java/minicraft/level/tile/DirtTile.java +++ b/src/client/java/minicraft/level/tile/DirtTile.java @@ -15,7 +15,7 @@ import minicraft.util.AdvancementElement; public class DirtTile extends Tile { - private static SpriteAnimation[] levelSprite = new SpriteAnimation[] { + private static SpriteAnimation[] levelSprite = new SpriteAnimation[]{ new SpriteAnimation(SpriteType.Tile, "dirt"), new SpriteAnimation(SpriteType.Tile, "gray_dirt"), new SpriteAnimation(SpriteType.Tile, "purple_dirt") @@ -28,18 +28,25 @@ protected DirtTile(String name) { protected static int dCol(int depth) { switch (depth) { - case 1: return Color.get(1, 194, 194, 194); // Sky. - case 0: return Color.get(1, 129, 105, 83); // Surface. - case -4: return Color.get(1, 76, 30, 100); // Dungeons. - default: return Color.get(1, 102); // Caves. + case 1: + return Color.get(1, 194, 194, 194); // Sky. + case 0: + return Color.get(1, 129, 105, 83); // Surface. + case -4: + return Color.get(1, 76, 30, 100); // Dungeons. + default: + return Color.get(1, 102); // Caves. } } protected static int dIdx(int depth) { switch (depth) { - case 0: return 0; // Surface - case -4: return 2; // Dungeons - default: return 1; // Caves + case 0: + return 0; // Surface + case -4: + return 2; // Dungeons + default: + return 1; // Caves } } diff --git a/src/client/java/minicraft/level/tile/DoorTile.java b/src/client/java/minicraft/level/tile/DoorTile.java index e01b023cc..dec7bd4c8 100644 --- a/src/client/java/minicraft/level/tile/DoorTile.java +++ b/src/client/java/minicraft/level/tile/DoorTile.java @@ -19,7 +19,10 @@ public class DoorTile extends Tile { private SpriteAnimation closedSprite; private SpriteAnimation openSprite; - protected DoorTile(Material type) { this(type, null); } + protected DoorTile(Material type) { + this(type, null); + } + protected DoorTile(Material type, String name) { super(type.name() + " " + (name == null ? "Door" : name), null); this.type = type; diff --git a/src/client/java/minicraft/level/tile/FloorTile.java b/src/client/java/minicraft/level/tile/FloorTile.java index a3cbd60da..d7190a48f 100644 --- a/src/client/java/minicraft/level/tile/FloorTile.java +++ b/src/client/java/minicraft/level/tile/FloorTile.java @@ -15,15 +15,24 @@ public class FloorTile extends Tile { protected Material type; - protected FloorTile(Material type) { this(type, null); } + protected FloorTile(Material type) { + this(type, null); + } + protected FloorTile(Material type, String name) { - super((type == Material.Wood ? "Wood Planks" : type == Material.Obsidian ? "Obsidian" + (name == null ? "" : " "+name) : type.name() + " " + (name == null ? "Bricks" : name)), null); + super((type == Material.Wood ? "Wood Planks" : type == Material.Obsidian ? "Obsidian" + (name == null ? "" : " " + name) : type.name() + " " + (name == null ? "Bricks" : name)), null); this.type = type; maySpawn = true; switch (type) { - case Wood: sprite = new SpriteAnimation(SpriteType.Tile, "wood_floor"); break; - case Stone: sprite = new SpriteAnimation(SpriteType.Tile, "stone_floor"); break; - case Obsidian: sprite = new SpriteAnimation(SpriteType.Tile, "obsidian_floor"); break; + case Wood: + sprite = new SpriteAnimation(SpriteType.Tile, "wood_floor"); + break; + case Stone: + sprite = new SpriteAnimation(SpriteType.Tile, "stone_floor"); + break; + case Obsidian: + sprite = new SpriteAnimation(SpriteType.Tile, "obsidian_floor"); + break; } } @@ -40,8 +49,12 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } Item drop; switch (type) { - case Wood: drop = Items.get("Plank"); break; - default: drop = Items.get(type.name() + " Brick"); break; + case Wood: + drop = Items.get("Plank"); + break; + default: + drop = Items.get(type.name() + " Brick"); + break; } Sound.play("monsterhurt"); level.dropItem(xt * 16 + 8, yt * 16 + 8, drop); diff --git a/src/client/java/minicraft/level/tile/FlowerTile.java b/src/client/java/minicraft/level/tile/FlowerTile.java index 51be31527..df085249b 100644 --- a/src/client/java/minicraft/level/tile/FlowerTile.java +++ b/src/client/java/minicraft/level/tile/FlowerTile.java @@ -68,8 +68,8 @@ public boolean interact(Level level, int x, int y, Player player, Item item, Dir } public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { - level.dropItem(x *16 + 8, y * 16 + 8, 0, 1, Items.get("Flower")); - level.dropItem(x *16 + 8, y * 16 + 8, 0, 1, Items.get("Rose")); + level.dropItem(x * 16 + 8, y * 16 + 8, 0, 1, Items.get("Flower")); + level.dropItem(x * 16 + 8, y * 16 + 8, 0, 1, Items.get("Rose")); level.setTile(x, y, Tiles.get("Grass")); return true; } diff --git a/src/client/java/minicraft/level/tile/GrassTile.java b/src/client/java/minicraft/level/tile/GrassTile.java index 9c916353e..3012a9daf 100644 --- a/src/client/java/minicraft/level/tile/GrassTile.java +++ b/src/client/java/minicraft/level/tile/GrassTile.java @@ -13,10 +13,6 @@ import minicraft.level.Level; import minicraft.util.AdvancementElement; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.Map; - public class GrassTile extends Tile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) diff --git a/src/client/java/minicraft/level/tile/HardRockTile.java b/src/client/java/minicraft/level/tile/HardRockTile.java index 07c18c4d2..c8d4b2137 100644 --- a/src/client/java/minicraft/level/tile/HardRockTile.java +++ b/src/client/java/minicraft/level/tile/HardRockTile.java @@ -39,7 +39,7 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at } public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if(Game.isMode("minicraft.settings.mode.creative")) + if (Game.isMode("minicraft.settings.mode.creative")) return false; // Go directly to hurt method if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; diff --git a/src/client/java/minicraft/level/tile/InfiniteFallTile.java b/src/client/java/minicraft/level/tile/InfiniteFallTile.java index 19c798890..4b660d852 100644 --- a/src/client/java/minicraft/level/tile/InfiniteFallTile.java +++ b/src/client/java/minicraft/level/tile/InfiniteFallTile.java @@ -12,14 +12,17 @@ public class InfiniteFallTile extends Tile { protected InfiniteFallTile(String name) { - super(name, (SpriteAnimation)null); + super(name, (SpriteAnimation) null); } @Override - public void render(Screen screen, Level level, int x, int y) { } + public void render(Screen screen, Level level, int x, int y) { + } @Override - public boolean tick(Level level, int xt, int yt) { return false; } + public boolean tick(Level level, int xt, int yt) { + return false; + } @Override public boolean mayPass(Level level, int x, int y, Entity e) { diff --git a/src/client/java/minicraft/level/tile/LavaBrickTile.java b/src/client/java/minicraft/level/tile/LavaBrickTile.java index 13508f7db..5400df3ae 100644 --- a/src/client/java/minicraft/level/tile/LavaBrickTile.java +++ b/src/client/java/minicraft/level/tile/LavaBrickTile.java @@ -37,9 +37,11 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } public void bumpedInto(Level level, int x, int y, Entity entity) { - if(entity instanceof Mob) - ((Mob)entity).hurt(this, x, y, 3); + if (entity instanceof Mob) + ((Mob) entity).hurt(this, x, y, 3); } - public boolean mayPass(Level level, int x, int y, Entity e) { return e.canWool(); } + public boolean mayPass(Level level, int x, int y, Entity e) { + return e.canWool(); + } } diff --git a/src/client/java/minicraft/level/tile/MaterialTile.java b/src/client/java/minicraft/level/tile/MaterialTile.java index 53df6a95b..83b8ff3f2 100644 --- a/src/client/java/minicraft/level/tile/MaterialTile.java +++ b/src/client/java/minicraft/level/tile/MaterialTile.java @@ -16,12 +16,16 @@ public class MaterialTile extends Tile { protected Material type; protected MaterialTile(Material type) { - super((type == Material.Stone ? "Stone" : type == Material.Obsidian ? "Raw Obsidian" :type.name()), (SpriteAnimation) null); + super((type == Material.Stone ? "Stone" : type == Material.Obsidian ? "Raw Obsidian" : type.name()), (SpriteAnimation) null); this.type = type; maySpawn = true; switch (type) { - case Stone: sprite = new SpriteAnimation(SpriteType.Tile, "stone"); break; - case Obsidian: sprite = new SpriteAnimation(SpriteType.Tile, "obsidian"); break; + case Stone: + sprite = new SpriteAnimation(SpriteType.Tile, "stone"); + break; + case Obsidian: + sprite = new SpriteAnimation(SpriteType.Tile, "obsidian"); + break; default: } } @@ -39,9 +43,14 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } Item drop; switch (type) { - case Stone: drop = Items.get("Stone"); break; - case Obsidian: drop = Items.get("Raw Obsidian"); break; - default: throw new IllegalStateException("Unexpected value: " + type); + case Stone: + drop = Items.get("Stone"); + break; + case Obsidian: + drop = Items.get("Raw Obsidian"); + break; + default: + throw new IllegalStateException("Unexpected value: " + type); } Sound.play("monsterhurt"); level.dropItem(xt * 16 + 8, yt * 16 + 8, drop); diff --git a/src/client/java/minicraft/level/tile/OreTile.java b/src/client/java/minicraft/level/tile/OreTile.java index 2bfe1506a..23c374a42 100644 --- a/src/client/java/minicraft/level/tile/OreTile.java +++ b/src/client/java/minicraft/level/tile/OreTile.java @@ -25,11 +25,11 @@ public class OreTile extends Tile { private final OreType type; public enum OreType { - Iron (Items.get("Iron Ore"), new SpriteAnimation(SpriteType.Tile, "iron_ore")), - Lapis (Items.get("Lapis"), new SpriteAnimation(SpriteType.Tile, "lapis_ore")), - Gold (Items.get("Gold Ore"), new SpriteAnimation(SpriteType.Tile, "gold_ore")), - Gem (Items.get("Gem"), new SpriteAnimation(SpriteType.Tile, "gem_ore")), - Cloud (Items.get("Cloud Ore"), new SpriteAnimation(SpriteType.Tile, "cloud_ore")); + Iron(Items.get("Iron Ore"), new SpriteAnimation(SpriteType.Tile, "iron_ore")), + Lapis(Items.get("Lapis"), new SpriteAnimation(SpriteType.Tile, "lapis_ore")), + Gold(Items.get("Gold Ore"), new SpriteAnimation(SpriteType.Tile, "gold_ore")), + Gem(Items.get("Gem"), new SpriteAnimation(SpriteType.Tile, "gem_ore")), + Cloud(Items.get("Cloud Ore"), new SpriteAnimation(SpriteType.Tile, "cloud_ore")); private final Item drop; public final SpriteAnimation sheet; @@ -42,11 +42,11 @@ public enum OreType { private Item getOre() { return drop.copy(); } - } + } protected OreTile(OreType o) { super((o == OreTile.OreType.Lapis ? "Lapis" : o == OreType.Cloud ? "Cloud Cactus" : o.name() + " Ore"), o.sheet); - this.type = o; + this.type = o; } public void render(Screen screen, Level level, int x, int y) { @@ -67,7 +67,7 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at } public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if(Game.isMode("minicraft.settings.mode.creative")) + if (Game.isMode("minicraft.settings.mode.creative")) return false; // Go directly to hurt method if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; @@ -85,9 +85,9 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D return false; } - public Item getOre() { - return type.getOre(); - } + public Item getOre() { + return type.getOre(); + } public void hurt(Level level, int x, int y, int dmg) { int damage = level.getData(x, y) + dmg; @@ -110,7 +110,7 @@ public void hurt(Level level, int x, int y, int dmg) { } else { level.setData(x, y, damage); } - if (type.drop.equals(Items.get("gem"))){ + if (type.drop.equals(Items.get("gem"))) { AchievementsDisplay.setAchievement("minicraft.achievement.find_gem", true); } level.dropItem(x * 16 + 8, y * 16 + 8, count, type.getOre()); diff --git a/src/client/java/minicraft/level/tile/PathTile.java b/src/client/java/minicraft/level/tile/PathTile.java index dea91f486..a216813f6 100644 --- a/src/client/java/minicraft/level/tile/PathTile.java +++ b/src/client/java/minicraft/level/tile/PathTile.java @@ -13,30 +13,30 @@ import minicraft.util.AdvancementElement; public class PathTile extends Tile { - private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "path"); + private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "path"); - public PathTile(String name) { - super(name, sprite); - connectsToGrass = true; - maySpawn = true; - } + public PathTile(String name) { + super(name, sprite); + connectsToGrass = true; + maySpawn = true; + } - public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if (item instanceof ToolItem) { - ToolItem tool = (ToolItem) item; - if (tool.type == ToolType.Shovel) { - if (player.payStamina(4 - tool.level) && tool.payDurability()) { + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + if (item instanceof ToolItem) { + ToolItem tool = (ToolItem) item; + if (tool.type == ToolType.Shovel) { + if (player.payStamina(4 - tool.level) && tool.payDurability()) { int data = level.getData(xt, yt); - level.setTile(xt, yt, Tiles.get("Hole")); - Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Dirt")); + level.setTile(xt, yt, Tiles.get("Hole")); + Sound.play("monsterhurt"); + level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Dirt")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); - return true; - } - } - } - return false; - } + return true; + } + } + } + return false; + } } diff --git a/src/client/java/minicraft/level/tile/RockTile.java b/src/client/java/minicraft/level/tile/RockTile.java index b5f7e69b7..ee78ced54 100644 --- a/src/client/java/minicraft/level/tile/RockTile.java +++ b/src/client/java/minicraft/level/tile/RockTile.java @@ -86,7 +86,7 @@ public void hurt(Level level, int x, int y, int dmg) { stone += random.nextInt(3) + 1; int coal = 1; - if(!Settings.get("diff").equals("minicraft.settings.difficulty.hard")) { + if (!Settings.get("diff").equals("minicraft.settings.difficulty.hard")) { coal += 1; } diff --git a/src/client/java/minicraft/level/tile/SandTile.java b/src/client/java/minicraft/level/tile/SandTile.java index 2e2a036f8..07728dcd5 100644 --- a/src/client/java/minicraft/level/tile/SandTile.java +++ b/src/client/java/minicraft/level/tile/SandTile.java @@ -39,20 +39,20 @@ public boolean tick(Level level, int x, int y) { public void steppedOn(Level level, int x, int y, Entity entity) { if (entity instanceof Mob) { if (random.nextInt(3) == 0) { - int spawnX = entity.x - 8 + random.nextInt(5)-2; - int spawnY = entity.y - 8 + random.nextInt(5)-2; + int spawnX = entity.x - 8 + random.nextInt(5) - 2; + int spawnY = entity.y - 8 + random.nextInt(5) - 2; for (Direction dir : Direction.values()) { Tile neighbour = level.getTile(x + dir.getX(), y + dir.getY()); if (neighbour != null) { if (!(neighbour instanceof SandTile)) { // Particles only spawn on sand tiles. if (dir.getX() < 0) // Offsets - if (entity.x%16 < 8) spawnX += 8 - entity.x%16; + if (entity.x % 16 < 8) spawnX += 8 - entity.x % 16; if (dir.getX() > 0) - if (entity.x%16 > 7) spawnX -= entity.x%16 - 8; + if (entity.x % 16 > 7) spawnX -= entity.x % 16 - 8; if (dir.getY() < 0) - if (entity.y%16 < 8) spawnY += 8 - entity.y%16; + if (entity.y % 16 < 8) spawnY += 8 - entity.y % 16; if (dir.getY() > 0) - if (entity.y%16 > 7) spawnY -= entity.y%16 - 8; + if (entity.y % 16 > 7) spawnY -= entity.y % 16 - 8; } } } diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index fe52cf1e1..a13979448 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -55,67 +55,93 @@ protected Tile(String name, SpriteAnimation sprite) { } - /** This method is used by tiles to specify the default "data" they have in a level's data array. - Used for starting health, color/type of tile, etc. */ + /** + * This method is used by tiles to specify the default "data" they have in a level's data array. + * Used for starting health, color/type of tile, etc. + */ // At least, that was the idea at first... public int getDefaultData() { return 0; } - /** Render method, used in sub-classes */ + /** + * Render method, used in sub-classes + */ public void render(Screen screen, Level level, int x, int y) { sprite.render(screen, level, x, y); } - public boolean maySpawn() { return maySpawn; } + public boolean maySpawn() { + return maySpawn; + } - /** Returns if the player can walk on it, overrides in sub-classes */ + /** + * Returns if the player can walk on it, overrides in sub-classes + */ public boolean mayPass(Level level, int x, int y, Entity e) { return true; } - /** Gets the light radius of a tile, Bigger number = bigger circle */ + /** + * Gets the light radius of a tile, Bigger number = bigger circle + */ public int getLightRadius(Level level, int x, int y) { return 0; } /** * Hurt the tile with a specified amount of damage. - * @param level The level this happened on. - * @param x X pos of the tile. - * @param y Y pos of the tile. - * @param source The mob that damaged the tile. - * @param dmg Damage to taken. + * + * @param level The level this happened on. + * @param x X pos of the tile. + * @param y Y pos of the tile. + * @param source The mob that damaged the tile. + * @param dmg Damage to taken. * @param attackDir The direction of the player hitting. * @return If the damage was applied. */ - public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { return false; } + public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { + return false; + } /** * Hurt the tile with a specified amount of damage. + * * @param level The level this happened on. - * @param x X position of the tile. - * @param y Y position of the tile. - * @param dmg The damage taken. + * @param x X position of the tile. + * @param y Y position of the tile. + * @param dmg The damage taken. */ - public void hurt(Level level, int x, int y, int dmg) {} + public void hurt(Level level, int x, int y, int dmg) { + } - /** What happens when you run into the tile (ex: run into a cactus) */ - public void bumpedInto(Level level, int xt, int yt, Entity entity) {} + /** + * What happens when you run into the tile (ex: run into a cactus) + */ + public void bumpedInto(Level level, int xt, int yt, Entity entity) { + } - /** Update method */ - public boolean tick(Level level, int xt, int yt) { return false; } + /** + * Update method + */ + public boolean tick(Level level, int xt, int yt) { + return false; + } - /** What happens when you are inside the tile (ex: lava) */ - public void steppedOn(Level level, int xt, int yt, Entity entity) {} + /** + * What happens when you are inside the tile (ex: lava) + */ + public void steppedOn(Level level, int xt, int yt, Entity entity) { + } /** * Called when you hit an item on a tile (ex: Pickaxe on rock). - * @param level The level the player is on. - * @param xt X position of the player in tile coordinates (32x per tile). - * @param yt Y position of the player in tile coordinates (32px per tile). - * @param player The player who called this method. - * @param item The item the player is currently holding. + * + * @param level The level the player is on. + * @param xt X position of the player in tile coordinates (32x per tile). + * @param yt Y position of the player in tile coordinates (32px per tile). + * @param player The player who called this method. + * @param item The item the player is currently holding. * @param attackDir The direction of the player attacking. * @return Was the operation successful? */ @@ -126,17 +152,22 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D /** * Executed when the tile is exploded. * The call for this method is done just before the tiles are changed to exploded tiles. + * * @param level The level we are on. - * @param xt X position of the tile. - * @param yt Y position of the tile. + * @param xt X position of the tile. + * @param yt Y position of the tile. * @return true if successful. */ public boolean onExplode(Level level, int xt, int yt) { return false; } - /** Sees if the tile connects to a fluid. */ - public boolean connectsToLiquid() { return connectsToFluid; } + /** + * Sees if the tile connects to a fluid. + */ + public boolean connectsToLiquid() { + return connectsToFluid; + } public int getData(String data) { try { @@ -164,7 +195,7 @@ public static String getData(int depth, int x, int y) { int tiledata = curLevel.data[pos]; return lvlidx + ";" + pos + ";" + tileid + ";" + tiledata; - } catch(NullPointerException | IndexOutOfBoundsException ignored) { + } catch (NullPointerException | IndexOutOfBoundsException ignored) { } return ""; @@ -178,5 +209,7 @@ public boolean equals(Object other) { } @Override - public int hashCode() { return name.hashCode(); } + public int hashCode() { + return name.hashCode(); + } } diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index d138b227a..9f9653e3c 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -1,12 +1,12 @@ package minicraft.level.tile; import minicraft.core.CrashHandler; -import minicraft.level.tile.farming.HeavenlyBerriesTile; -import minicraft.level.tile.farming.HellishBerriesTile; -import minicraft.level.tile.farming.TomatoTile; import minicraft.level.tile.farming.CarrotTile; import minicraft.level.tile.farming.FarmTile; +import minicraft.level.tile.farming.HeavenlyBerriesTile; +import minicraft.level.tile.farming.HellishBerriesTile; import minicraft.level.tile.farming.PotatoTile; +import minicraft.level.tile.farming.TomatoTile; import minicraft.level.tile.farming.WheatTile; import minicraft.util.Logging; @@ -24,81 +24,81 @@ public final class Tiles { public static void initTileList() { Logging.TILES.debug("Initializing tile list..."); - tiles.put((short)0, new GrassTile("Grass")); - tiles.put((short)1, new DirtTile("Dirt")); - tiles.put((short)2, new FlowerTile("Flower")); - tiles.put((short)3, new HoleTile("Hole")); - tiles.put((short)4, new StairsTile("Stairs Up", true)); - tiles.put((short)5, new StairsTile("Stairs Down", false)); - tiles.put((short)6, new WaterTile("Water")); + tiles.put((short) 0, new GrassTile("Grass")); + tiles.put((short) 1, new DirtTile("Dirt")); + tiles.put((short) 2, new FlowerTile("Flower")); + tiles.put((short) 3, new HoleTile("Hole")); + tiles.put((short) 4, new StairsTile("Stairs Up", true)); + tiles.put((short) 5, new StairsTile("Stairs Down", false)); + tiles.put((short) 6, new WaterTile("Water")); // This is out of order because of lava buckets - tiles.put((short)17, new LavaTile("Lava")); - - tiles.put((short)7, new RockTile("Rock")); - tiles.put((short)8, new TreeTile("Tree")); - tiles.put((short)9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Tree"))); - tiles.put((short)10, new SandTile("Sand")); - tiles.put((short)11, new CactusTile("Cactus")); - tiles.put((short)12, new SaplingTile("Cactus Sapling", Tiles.get("Sand"), Tiles.get("Cactus"))); - tiles.put((short)13, new OreTile(OreTile.OreType.Iron)); - tiles.put((short)14, new OreTile(OreTile.OreType.Gold)); - tiles.put((short)15, new OreTile(OreTile.OreType.Gem)); - tiles.put((short)16, new OreTile(OreTile.OreType.Lapis)); - tiles.put((short)18, new LavaBrickTile("Lava Brick")); - tiles.put((short)19, new ExplodedTile("Explode")); - tiles.put((short)20, new FarmTile("Farmland")); - tiles.put((short)21, new WheatTile("Wheat")); - tiles.put((short)22, new HardRockTile("Hard Rock")); - tiles.put((short)23, new InfiniteFallTile("Infinite Fall")); - tiles.put((short)24, new CloudTile("Cloud")); - tiles.put((short)25, new OreTile(OreTile.OreType.Cloud)); - tiles.put((short)26, new DoorTile(Tile.Material.Wood)); - tiles.put((short)27, new DoorTile(Tile.Material.Stone)); - tiles.put((short)28, new DoorTile(Tile.Material.Obsidian)); - tiles.put((short)29, new FloorTile(Tile.Material.Wood)); - tiles.put((short)30, new FloorTile(Tile.Material.Stone)); - tiles.put((short)31, new FloorTile(Tile.Material.Obsidian)); - tiles.put((short)32, new WallTile(Tile.Material.Wood)); - tiles.put((short)33, new WallTile(Tile.Material.Stone)); - tiles.put((short)34, new WallTile(Tile.Material.Obsidian)); - tiles.put((short)35, new WoolTile(WoolTile.WoolType.NORMAL)); - tiles.put((short)36, new PathTile("Path")); - tiles.put((short)37, new WoolTile(WoolTile.WoolType.RED)); - tiles.put((short)38, new WoolTile(WoolTile.WoolType.BLUE)); - tiles.put((short)39, new WoolTile(WoolTile.WoolType.GREEN)); - tiles.put((short)40, new WoolTile(WoolTile.WoolType.YELLOW)); - tiles.put((short)41, new WoolTile(WoolTile.WoolType.BLACK)); - tiles.put((short)42, new PotatoTile("Potato")); - tiles.put((short)43, new MaterialTile(Tile.Material.Stone)); - tiles.put((short)44, new MaterialTile(Tile.Material.Obsidian)); - tiles.put((short)45, new DecorTile(Tile.Material.Stone)); - tiles.put((short)46, new DecorTile(Tile.Material.Obsidian)); - tiles.put((short)47, new BossWallTile()); - tiles.put((short)48, new BossFloorTile()); - tiles.put((short)49, new BossDoorTile()); - tiles.put((short)50, new TomatoTile("Tomato")); - tiles.put((short)51, new CarrotTile("Carrot")); - tiles.put((short)52, new HeavenlyBerriesTile("Heavenly Berries")); - tiles.put((short)53, new HellishBerriesTile("Hellish Berries")); + tiles.put((short) 17, new LavaTile("Lava")); + + tiles.put((short) 7, new RockTile("Rock")); + tiles.put((short) 8, new TreeTile("Tree")); + tiles.put((short) 9, new SaplingTile("Tree Sapling", Tiles.get("Grass"), Tiles.get("Tree"))); + tiles.put((short) 10, new SandTile("Sand")); + tiles.put((short) 11, new CactusTile("Cactus")); + tiles.put((short) 12, new SaplingTile("Cactus Sapling", Tiles.get("Sand"), Tiles.get("Cactus"))); + tiles.put((short) 13, new OreTile(OreTile.OreType.Iron)); + tiles.put((short) 14, new OreTile(OreTile.OreType.Gold)); + tiles.put((short) 15, new OreTile(OreTile.OreType.Gem)); + tiles.put((short) 16, new OreTile(OreTile.OreType.Lapis)); + tiles.put((short) 18, new LavaBrickTile("Lava Brick")); + tiles.put((short) 19, new ExplodedTile("Explode")); + tiles.put((short) 20, new FarmTile("Farmland")); + tiles.put((short) 21, new WheatTile("Wheat")); + tiles.put((short) 22, new HardRockTile("Hard Rock")); + tiles.put((short) 23, new InfiniteFallTile("Infinite Fall")); + tiles.put((short) 24, new CloudTile("Cloud")); + tiles.put((short) 25, new OreTile(OreTile.OreType.Cloud)); + tiles.put((short) 26, new DoorTile(Tile.Material.Wood)); + tiles.put((short) 27, new DoorTile(Tile.Material.Stone)); + tiles.put((short) 28, new DoorTile(Tile.Material.Obsidian)); + tiles.put((short) 29, new FloorTile(Tile.Material.Wood)); + tiles.put((short) 30, new FloorTile(Tile.Material.Stone)); + tiles.put((short) 31, new FloorTile(Tile.Material.Obsidian)); + tiles.put((short) 32, new WallTile(Tile.Material.Wood)); + tiles.put((short) 33, new WallTile(Tile.Material.Stone)); + tiles.put((short) 34, new WallTile(Tile.Material.Obsidian)); + tiles.put((short) 35, new WoolTile(WoolTile.WoolType.NORMAL)); + tiles.put((short) 36, new PathTile("Path")); + tiles.put((short) 37, new WoolTile(WoolTile.WoolType.RED)); + tiles.put((short) 38, new WoolTile(WoolTile.WoolType.BLUE)); + tiles.put((short) 39, new WoolTile(WoolTile.WoolType.GREEN)); + tiles.put((short) 40, new WoolTile(WoolTile.WoolType.YELLOW)); + tiles.put((short) 41, new WoolTile(WoolTile.WoolType.BLACK)); + tiles.put((short) 42, new PotatoTile("Potato")); + tiles.put((short) 43, new MaterialTile(Tile.Material.Stone)); + tiles.put((short) 44, new MaterialTile(Tile.Material.Obsidian)); + tiles.put((short) 45, new DecorTile(Tile.Material.Stone)); + tiles.put((short) 46, new DecorTile(Tile.Material.Obsidian)); + tiles.put((short) 47, new BossWallTile()); + tiles.put((short) 48, new BossFloorTile()); + tiles.put((short) 49, new BossDoorTile()); + tiles.put((short) 50, new TomatoTile("Tomato")); + tiles.put((short) 51, new CarrotTile("Carrot")); + tiles.put((short) 52, new HeavenlyBerriesTile("Heavenly Berries")); + tiles.put((short) 53, new HellishBerriesTile("Hellish Berries")); // WARNING: don't use this tile for anything! - tiles.put((short)255, new ConnectTile()); + tiles.put((short) 255, new ConnectTile()); - for(short i = 0; i < 256; i++) { - if(tiles.get(i) == null) continue; - tiles.get(i).id = (short)i; + for (short i = 0; i < 256; i++) { + if (tiles.get(i) == null) continue; + tiles.get(i).id = (short) i; } } static void add(int id, Tile tile) { - tiles.put((short)id, tile); + tiles.put((short) id, tile); Logging.TILES.debug("Adding " + tile.name + " to tile list with id " + id); tile.id = (short) id; } static { - for(int i = 0; i < 32768; i++) + for (int i = 0; i < 32768; i++) oldids.add(null); oldids.set(0, "grass"); @@ -190,6 +190,7 @@ static void add(int id, Tile tile) { } private static int overflowCheck = 0; + public static Tile get(String name) { //System.out.println("Getting from tile list: " + name); @@ -197,7 +198,7 @@ public static Tile get(String name) { overflowCheck++; - if(overflowCheck > 50) { + if (overflowCheck > 50) { CrashHandler.crashHandle(new StackOverflowError("Tiles#get: " + name), new CrashHandler.ErrorInfo("Tile fetching Stacking", CrashHandler.ErrorInfo.ErrorType.SERIOUS, "STACKOVERFLOW prevented in Tiles.get(), on: " + name)); } @@ -207,29 +208,29 @@ public static Tile get(String name) { Tile getting = null; boolean isTorch = false; - if(name.startsWith("TORCH")) { + if (name.startsWith("TORCH")) { isTorch = true; name = name.substring(6); // Cuts off torch prefix. } - if(name.contains("_")) { + if (name.contains("_")) { name = name.substring(0, name.indexOf("_")); } - for(Tile t: tiles.values()) { - if(t == null) continue; - if(t.name.equals(name)) { + for (Tile t : tiles.values()) { + if (t == null) continue; + if (t.name.equals(name)) { getting = t; break; } } - if(getting == null) { + if (getting == null) { Logging.TILES.info("Invalid tile requested: " + name); - getting = tiles.get((short)0); + getting = tiles.get((short) 0); } - if(isTorch) { + if (isTorch) { getting = TorchTile.getTorchTile(getting); } @@ -239,26 +240,24 @@ public static Tile get(String name) { public static Tile get(int id) { //System.out.println("Requesting tile by id: " + id); - if(id < 0) id += 32768; + if (id < 0) id += 32768; - if(tiles.get((short)id) != null) { - return tiles.get((short)id); - } - else if(id >= 32767) { + if (tiles.get((short) id) != null) { + return tiles.get((short) id); + } else if (id >= 32767) { return TorchTile.getTorchTile(get(id - 32767)); - } - else { + } else { Logging.TILES.info("Unknown tile id requested: " + id); - return tiles.get((short)0); + return tiles.get((short) 0); } } public static boolean containsTile(int id) { - return tiles.get((short)id) != null; + return tiles.get((short) id) != null; } public static String getName(String descriptName) { - if(!descriptName.contains("_")) return descriptName; + if (!descriptName.contains("_")) return descriptName; int data; String[] parts = descriptName.split("_"); descriptName = parts[0]; diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index 52353ac45..bb8dbd840 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -18,11 +18,11 @@ public class TorchTile extends Tile { public static TorchTile getTorchTile(Tile onTile) { int id = onTile.id & 0xFFFF; - if(id < 16384) id += 16384; + if (id < 16384) id += 16384; else Logger.tag("TorchTile").info("Tried to place torch on torch tile..."); - if(Tiles.containsTile(id)) - return (TorchTile)Tiles.get(id); + if (Tiles.containsTile(id)) + return (TorchTile) Tiles.get(id); else { TorchTile tile = new TorchTile(onTile); Tiles.add(id, tile); @@ -31,7 +31,7 @@ public static TorchTile getTorchTile(Tile onTile) { } private TorchTile(Tile onType) { - super("Torch "+ onType.name, new SpriteAnimation(SpriteType.Tile, "torch")); + super("Torch " + onType.name, new SpriteAnimation(SpriteType.Tile, "torch")); this.onType = onType; this.connectsToSand = onType.connectsToSand; this.connectsToGrass = onType.connectsToGrass; @@ -48,11 +48,11 @@ public int getLightRadius(Level level, int x, int y) { } public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if(item instanceof PowerGloveItem) { + if (item instanceof PowerGloveItem) { int data = level.getData(xt, yt); level.setTile(xt, yt, this.onType); Sound.play("monsterhurt"); - level.dropItem(xt*16+8, yt*16+8, Items.get("Torch")); + level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Torch")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/TreeTile.java b/src/client/java/minicraft/level/tile/TreeTile.java index c4e5c8f3a..d9e68cf6d 100644 --- a/src/client/java/minicraft/level/tile/TreeTile.java +++ b/src/client/java/minicraft/level/tile/TreeTile.java @@ -21,11 +21,6 @@ import minicraft.screen.AchievementsDisplay; import minicraft.util.AdvancementElement; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Random; - public class TreeTile extends Tile { private static final LinkedSprite oakSprite = new LinkedSprite(SpriteType.Tile, "oak"); private static final LinkedSprite oakSpriteFull = new LinkedSprite(SpriteType.Tile, "oak_full"); @@ -129,7 +124,7 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at @Override public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if(Game.isMode("minicraft.settings.mode.creative")) + if (Game.isMode("minicraft.settings.mode.creative")) return false; // Go directly to hurt method if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; @@ -155,13 +150,13 @@ public void hurt(Level level, int x, int y, int dmg) { int treeHealth = 20; if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = treeHealth; - level.add(new SmashParticle(x*16, y*16)); + level.add(new SmashParticle(x * 16, y * 16)); Sound.play("monsterhurt"); level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); if (damage >= treeHealth) { level.dropItem(x * 16 + 8, y * 16 + 8, 1, 3, Items.get("Wood")); - level.dropItem(x * 16 + 8, y * 16 + 8, 0, 2, Items.get("Acorn")); + level.dropItem(x * 16 + 8, y * 16 + 8, 0, 2, Items.get("Acorn")); level.setTile(x, y, Tiles.get("Grass")); AchievementsDisplay.setAchievement("minicraft.achievement.woodcutter", true); } else { diff --git a/src/client/java/minicraft/level/tile/WallTile.java b/src/client/java/minicraft/level/tile/WallTile.java index df986e62a..48222f1da 100644 --- a/src/client/java/minicraft/level/tile/WallTile.java +++ b/src/client/java/minicraft/level/tile/WallTile.java @@ -30,14 +30,23 @@ public class WallTile extends Tile { private static final String obrickMsg = "minicraft.notification.defeat_air_wizard_first"; protected Material type; - protected WallTile(Material type) { this(type, null); } + protected WallTile(Material type) { + this(type, null); + } + protected WallTile(Material type, String name) { super(type.name() + " " + (name == null ? "Wall" : name), null); this.type = type; switch (type) { - case Wood: sprite = wood; break; - case Stone: sprite = stone; break; - case Obsidian: sprite = obsidian; break; + case Wood: + sprite = wood; + break; + case Stone: + sprite = stone; + break; + case Obsidian: + sprite = obsidian; + break; } } diff --git a/src/client/java/minicraft/level/tile/farming/CarrotTile.java b/src/client/java/minicraft/level/tile/farming/CarrotTile.java index 542fee7d6..de8cfc7b4 100644 --- a/src/client/java/minicraft/level/tile/farming/CarrotTile.java +++ b/src/client/java/minicraft/level/tile/farming/CarrotTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class CarrotTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[] { + private final LinkedSprite[] spritStages = new LinkedSprite[]{ new LinkedSprite(SpriteType.Tile, "carrot_stage0"), new LinkedSprite(SpriteType.Tile, "carrot_stage1"), new LinkedSprite(SpriteType.Tile, "carrot_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/CropTile.java b/src/client/java/minicraft/level/tile/farming/CropTile.java index 89b368dd7..6291fa75b 100644 --- a/src/client/java/minicraft/level/tile/farming/CropTile.java +++ b/src/client/java/minicraft/level/tile/farming/CropTile.java @@ -86,13 +86,13 @@ public boolean tick(Level level, int xt, int yt) { if (downRight) points *= 0.98125; } - if (random.nextInt((int) (100/points) + 1) < (fertilization/30 + 1)) // fertilization >= 0 + if (random.nextInt((int) (100 / points) + 1) < (fertilization / 30 + 1)) // fertilization >= 0 level.setData(xt, yt, data = (data & ~(maxAge << 3)) + ((stage + 1) << 3)); // Incrementing the stage by 1. successful = true; } if (fertilization > 0) { - level.setData(xt, yt, (data & (0b111 + (maxAge << 3))) + ((fertilization - 1) << (3 + (maxAge + 1)/2))); + level.setData(xt, yt, (data & (0b111 + (maxAge << 3))) + ((fertilization - 1) << (3 + (maxAge + 1) / 2))); successful = true; } @@ -107,8 +107,8 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D ((StackableItem) item).count--; Random random = new Random(); for (int i = 0; i < 2; ++i) { - double x = (double)xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; - double y = (double)yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double x = (double) xt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; + double y = (double) yt * 16 + 8 + (random.nextGaussian() * 0.5) * 8; level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); } int fertilization = getFertilization(level.getData(xt, yt)); @@ -130,7 +130,9 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D return super.interact(level, xt, yt, player, item, attackDir); } - /** Default harvest method, used for everything that doesn't really need any special behavior. */ + /** + * Default harvest method, used for everything that doesn't really need any special behavior. + */ protected void harvest(Level level, int x, int y, Entity entity) { int data = level.getData(x, y); int age = (data >> 3) & maxAge; @@ -145,7 +147,7 @@ protected void harvest(Level level, int x, int y, Entity entity) { } if (age == maxAge && entity instanceof Player) { - ((Player)entity).addScore(random.nextInt(5) + 1); + ((Player) entity).addScore(random.nextInt(5) + 1); } // Play sound. @@ -155,7 +157,7 @@ protected void harvest(Level level, int x, int y, Entity entity) { } public int getFertilization(int data) { - return data >> (3 + (maxAge + 1)/2); + return data >> (3 + (maxAge + 1) / 2); } /** @@ -170,6 +172,6 @@ public void fertilize(Level level, int x, int y, int amount) { if (fertilization < 0) fertilization = 0; if (fertilization > 511) fertilization = 511; // The maximum possible value to be reached. // If this value exceeds 511, the final value would be greater than the hard maximum value that short can be. - level.setData(x, y, (data & (0b111 + (maxAge << 3))) + (fertilization << (3 + (maxAge + 1)/2))); + level.setData(x, y, (data & (0b111 + (maxAge << 3))) + (fertilization << (3 + (maxAge + 1) / 2))); } } diff --git a/src/client/java/minicraft/level/tile/farming/FarmTile.java b/src/client/java/minicraft/level/tile/farming/FarmTile.java index c28bef21e..6205714dd 100644 --- a/src/client/java/minicraft/level/tile/farming/FarmTile.java +++ b/src/client/java/minicraft/level/tile/farming/FarmTile.java @@ -2,8 +2,6 @@ import minicraft.core.io.Sound; import minicraft.entity.Direction; -import minicraft.entity.Entity; -import minicraft.entity.ItemEntity; import minicraft.entity.mob.Player; import minicraft.gfx.Screen; import minicraft.gfx.SpriteAnimation; @@ -26,28 +24,29 @@ public class FarmTile extends Tile { public FarmTile(String name) { super(name, sprite); } + protected FarmTile(String name, SpriteAnimation sprite) { super(name, sprite); } - @Override - public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if (item instanceof ToolItem) { - ToolItem tool = (ToolItem) item; - if (tool.type == ToolType.Shovel) { - if (player.payStamina(4 - tool.level) && tool.payDurability()) { + @Override + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { + if (item instanceof ToolItem) { + ToolItem tool = (ToolItem) item; + if (tool.type == ToolType.Shovel) { + if (player.payStamina(4 - tool.level) && tool.payDurability()) { int data = level.getData(xt, yt); - level.setTile(xt, yt, Tiles.get("Dirt")); - Sound.play("monsterhurt"); + level.setTile(xt, yt, Tiles.get("Dirt")); + Sound.play("monsterhurt"); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); - return true; - } - } - } - return false; - } + return true; + } + } + } + return false; + } @Override public boolean tick(Level level, int xt, int yt) { diff --git a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java index c4fc57100..70b7e3fc8 100644 --- a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java @@ -6,7 +6,7 @@ import minicraft.level.tile.Tiles; public class HeavenlyBerriesTile extends CropTile { - private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[] { + private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[]{ new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage0"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage1"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java index 6d4f7bcb5..bbad34091 100644 --- a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java @@ -6,7 +6,7 @@ import minicraft.level.tile.Tiles; public class HellishBerriesTile extends CropTile { - private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[] { + private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[]{ new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage0"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage1"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/PotatoTile.java b/src/client/java/minicraft/level/tile/farming/PotatoTile.java index 9a5c44798..08b757173 100644 --- a/src/client/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/PotatoTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class PotatoTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[] { + private final LinkedSprite[] spritStages = new LinkedSprite[]{ new LinkedSprite(SpriteType.Tile, "potato_stage0"), new LinkedSprite(SpriteType.Tile, "potato_stage1"), new LinkedSprite(SpriteType.Tile, "potato_stage2"), @@ -16,15 +16,15 @@ public class PotatoTile extends CropTile { new LinkedSprite(SpriteType.Tile, "potato_stage5") }; - public PotatoTile(String name) { - super(name, null); - } + public PotatoTile(String name) { + super(name, null); + } - @Override - public void render(Screen screen, Level level, int x, int y) { - int age = (level.getData(x, y) >> 3) & maxAge; - Tiles.get("Farmland").render(screen, level, x, y); + @Override + public void render(Screen screen, Level level, int x, int y) { + int age = (level.getData(x, y) >> 3) & maxAge; + Tiles.get("Farmland").render(screen, level, x, y); int stage = (int) ((float) age / maxAge * 5); screen.render(x * 16, y * 16, spritStages[stage]); - } + } } diff --git a/src/client/java/minicraft/level/tile/farming/TomatoTile.java b/src/client/java/minicraft/level/tile/farming/TomatoTile.java index a8329ae63..1abe88c04 100644 --- a/src/client/java/minicraft/level/tile/farming/TomatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/TomatoTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class TomatoTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[] { + private final LinkedSprite[] spritStages = new LinkedSprite[]{ new LinkedSprite(SpriteType.Tile, "tomato_stage0"), new LinkedSprite(SpriteType.Tile, "tomato_stage1"), new LinkedSprite(SpriteType.Tile, "tomato_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/WheatTile.java b/src/client/java/minicraft/level/tile/farming/WheatTile.java index 39f585bf4..b56d751e3 100644 --- a/src/client/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/client/java/minicraft/level/tile/farming/WheatTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class WheatTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[] { + private final LinkedSprite[] spritStages = new LinkedSprite[]{ new LinkedSprite(SpriteType.Tile, "wheat_stage0"), new LinkedSprite(SpriteType.Tile, "wheat_stage1"), new LinkedSprite(SpriteType.Tile, "wheat_stage2"), diff --git a/src/client/java/minicraft/network/Analytics.java b/src/client/java/minicraft/network/Analytics.java index d922454ef..94222a2a4 100644 --- a/src/client/java/minicraft/network/Analytics.java +++ b/src/client/java/minicraft/network/Analytics.java @@ -50,9 +50,14 @@ public enum Analytics { this.token = token; } - @Nullable public Future> ping() { return ping(1); } - @Nullable public Future> ping(int value) { - final String url = "https://pingdat.io?t="+token+"&v="+value; + @Nullable + public Future> ping() { + return ping(1); + } + + @Nullable + public Future> ping(int value) { + final String url = "https://pingdat.io?t=" + token + "&v=" + value; return Unirest.get(url).asEmptyAsync(new Callback() { @Override diff --git a/src/client/java/minicraft/network/MinicraftProtocol.java b/src/client/java/minicraft/network/MinicraftProtocol.java index 044e86f2f..d5473b788 100644 --- a/src/client/java/minicraft/network/MinicraftProtocol.java +++ b/src/client/java/minicraft/network/MinicraftProtocol.java @@ -5,12 +5,12 @@ import java.util.List; public interface MinicraftProtocol { - + int PORT = 4225; - + enum InputType { INVALID, PING, USERNAMES, LOGIN, GAME, INIT, LOAD, TILES, ENTITIES, TILE, ENTITY, PLAYER, MOVE, ADD, REMOVE, DISCONNECT, SAVE, NOTIFY, INTERACT, PUSH, PICKUP, CHESTIN, CHESTOUT, ADDITEMS, BED, POTION, HURT, DIE, RESPAWN, DROP, STAMINA, SHIRT, STOPFISHING; - + public static final InputType[] values = InputType.values(); public static final List serverOnly = Arrays.asList(INIT, TILES, ENTITIES, ADD, REMOVE, HURT, GAME, ADDITEMS, STAMINA, STOPFISHING); public static final List entityUpdates = Arrays.asList(ENTITY, ADD, REMOVE); diff --git a/src/client/java/minicraft/network/Network.java b/src/client/java/minicraft/network/Network.java index ff181f41c..e179f00e8 100644 --- a/src/client/java/minicraft/network/Network.java +++ b/src/client/java/minicraft/network/Network.java @@ -16,7 +16,8 @@ import java.util.Random; public class Network extends Game { - private Network() {} + private Network() { + } private static final Random random = new Random(); @@ -24,7 +25,9 @@ private Network() {} @Nullable - public static VersionInfo getLatestVersion() { return latestVersion; } + public static VersionInfo getLatestVersion() { + return latestVersion; + } public static void findLatestVersion(Action callback) { new Thread(() -> { @@ -49,9 +52,9 @@ public static void findLatestVersion(Action callback) { @Nullable public static Entity getEntity(int eid) { - for (Level level: levels) { + for (Level level : levels) { if (level == null) continue; - for (Entity e: level.getEntityArray()) + for (Entity e : level.getEntityArray()) if (e.eid == eid) return e; } @@ -77,9 +80,9 @@ public static boolean idIsAvailable(int eid) { if (eid == 0) return false; // This is reserved for the main player... kind of... if (eid < 0) return false; // ID's must be positive numbers. - for (Level level: levels) { + for (Level level : levels) { if (level == null) continue; - for (Entity e: level.getEntityArray()) { + for (Entity e : level.getEntityArray()) { if (e.eid == eid) return false; } diff --git a/src/client/java/minicraft/saveload/LegacyLoad.java b/src/client/java/minicraft/saveload/LegacyLoad.java index 46dcb4f5b..b902c3775 100644 --- a/src/client/java/minicraft/saveload/LegacyLoad.java +++ b/src/client/java/minicraft/saveload/LegacyLoad.java @@ -112,7 +112,8 @@ public void loadFromFile(String filename) { try { br = new BufferedReader(new FileReader(filename)); - String curLine;StringBuilder total = new StringBuilder(); + String curLine; + StringBuilder total = new StringBuilder(); ArrayList curData; while ((curLine = br.readLine()) != null) total.append(curLine); @@ -166,8 +167,8 @@ protected void updateUnlocks(File file) { try { java.io.BufferedWriter writer = new java.io.BufferedWriter(new java.io.FileWriter(path)); - for (String unlock: data) { - writer.write(","+unlock); + for (String unlock : data) { + writer.write("," + unlock); } writer.flush(); writer.close(); @@ -195,8 +196,7 @@ public void loadGame(String filename) { Settings.setIdx("diff", Integer.parseInt(data.get(3))); AirWizard.beaten = Boolean.parseBoolean(data.get(4)); } - } - else { + } else { if (data.size() == 5) { worldVer = new Version("1.9"); Updater.setTime(Integer.parseInt(data.get(0))); @@ -256,7 +256,7 @@ public void loadPlayer(String filename, Player player) { if (data.size() >= 14) { if (worldVer == null) worldVer = new Version("1.9.1-pre1"); player.armorDamageBuffer = Integer.parseInt(data.get(13)); - player.curArmor = (ArmorItem)Items.get(data.get(14)); + player.curArmor = (ArmorItem) Items.get(data.get(14)); } else player.armor = 0; Game.currentLevel = Integer.parseInt(data.get(8)); @@ -276,8 +276,7 @@ public void loadPlayer(String filename, Player player) { mode = Integer.parseInt(modedata.substring(0, modedata.indexOf(";"))); if (mode == 4) Updater.scoreTime = Integer.parseInt(modedata.substring(modedata.indexOf(";") + 1)); - } - else { + } else { mode = Integer.parseInt(modedata); if (mode == 4) Updater.scoreTime = 300; } @@ -287,7 +286,7 @@ public void loadPlayer(String filename, Player player) { boolean hasEffects; int potionIdx = 10; if (oldSave) { - hasEffects = data.size() > 10 && data.get(data.size()-2).contains("PotionEffects["); + hasEffects = data.size() > 10 && data.get(data.size() - 2).contains("PotionEffects["); potionIdx = data.size() - 2; } else hasEffects = !data.get(10).equals("PotionEffects[]"); // Newer save @@ -303,9 +302,9 @@ public void loadPlayer(String filename, Player player) { } } - String colors = data.get(oldSave ? data.size() -1 : 11).replace("[", "").replace("]", ""); + String colors = data.get(oldSave ? data.size() - 1 : 11).replace("[", "").replace("]", ""); String[] color = colors.split(";"); - player.shirtColor = Integer.parseInt(color[0]+color[1]+color[2]); + player.shirtColor = Integer.parseInt(color[0] + color[1] + color[2]); } public void loadInventory(String filename, Inventory inventory) { @@ -330,7 +329,7 @@ public void loadItemToInventory(String item, Inventory inventory) { if (item.contains(";")) { String[] curData = item.split(";"); String itemName = curData[0]; - if(oldSave) itemName = subOldName(itemName); + if (oldSave) itemName = subOldName(itemName); //System.out.println("Item to fetch: " + itemName + "; count=" + curData[1]); Item newItem = Items.get(itemName); @@ -379,23 +378,24 @@ public void loadEntities(String filename, Player player) { int mobLvl = 0; try { if (Class.forName("EnemyMob").isAssignableFrom(Class.forName(entityName))) - mobLvl = Integer.parseInt(info.get(info.size()-2)); - } catch (ClassNotFoundException ignored) {} + mobLvl = Integer.parseInt(info.get(info.size() - 2)); + } catch (ClassNotFoundException ignored) { + } Entity newEntity = getEntity(entityName, player, mobLvl); if (newEntity != null) { // the method never returns null, but... int currentlevel; if (newEntity instanceof Mob) { - Mob mob = (Mob)newEntity; + Mob mob = (Mob) newEntity; mob.health = Integer.parseInt(info.get(2)); - currentlevel = Integer.parseInt(info.get(info.size()-1)); + currentlevel = Integer.parseInt(info.get(info.size() - 1)); World.levels[currentlevel].add(mob, x, y); } else if (newEntity instanceof Chest) { - Chest chest = (Chest)newEntity; + Chest chest = (Chest) newEntity; boolean isDeathChest = chest instanceof DeathChest; boolean isDungeonChest = chest instanceof DungeonChest; - List chestInfo = info.subList(2, info.size()-1); + List chestInfo = info.subList(2, info.size() - 1); int endIdx = chestInfo.size() - (isDeathChest || isDungeonChest ? 1 : 0); for (int idx = 0; idx < endIdx; idx++) { @@ -406,13 +406,13 @@ public void loadEntities(String filename, Player player) { } if (isDeathChest) { - ((DeathChest)chest).time = Integer.parseInt(chestInfo.get(chestInfo.size()-1).replace("tl;", "")); // "tl;" is only for old save support + ((DeathChest) chest).time = Integer.parseInt(chestInfo.get(chestInfo.size() - 1).replace("tl;", "")); // "tl;" is only for old save support } else if (isDungeonChest) { - ((DungeonChest)chest).setLocked(Boolean.parseBoolean(chestInfo.get(chestInfo.size()-1))); + ((DungeonChest) chest).setLocked(Boolean.parseBoolean(chestInfo.get(chestInfo.size() - 1))); } currentlevel = Integer.parseInt(info.get(info.size() - 1)); - World.levels[currentlevel].add(chest instanceof DeathChest ? chest : chest instanceof DungeonChest ? (DungeonChest)chest : chest, x, y); + World.levels[currentlevel].add(chest instanceof DeathChest ? chest : chest instanceof DungeonChest ? (DungeonChest) chest : chest, x, y); } else if (newEntity instanceof Spawner) { MobAi mob = (MobAi) getEntity(info.get(2), player, Integer.parseInt(info.get(3))); currentlevel = Integer.parseInt(info.get(info.size() - 1)); @@ -428,35 +428,61 @@ public void loadEntities(String filename, Player player) { public Entity getEntity(String string, Player player, int mobLevel) { switch (string) { - case "Player": return player; - case "Cow": return new Cow(); - case "Sheep": return new Sheep(); - case "Pig": return new Pig(); - case "Zombie": return new Zombie(mobLevel); - case "Slime": return new Slime(mobLevel); - case "Creeper": return new Creeper(mobLevel); - case "Skeleton": return new Skeleton(mobLevel); - case "Knight": return new Knight(mobLevel); - case "Snake": return new Snake(mobLevel); + case "Player": + return player; + case "Cow": + return new Cow(); + case "Sheep": + return new Sheep(); + case "Pig": + return new Pig(); + case "Zombie": + return new Zombie(mobLevel); + case "Slime": + return new Slime(mobLevel); + case "Creeper": + return new Creeper(mobLevel); + case "Skeleton": + return new Skeleton(mobLevel); + case "Knight": + return new Knight(mobLevel); + case "Snake": + return new Snake(mobLevel); case "AirWizard": if (mobLevel > 1) return null; return new AirWizard(); - case "Spawner": return new Spawner(new Zombie(1)); - case "Workbench": return new Crafter(Crafter.Type.Workbench); - case "Chest": return new Chest(); - case "DeathChest": return new DeathChest(); - case "DungeonChest": return new DungeonChest(false); - case "Anvil": return new Crafter(Crafter.Type.Anvil); - case "Enchanter": return new Crafter(Crafter.Type.Enchanter); - case "Loom": return new Crafter(Crafter.Type.Loom); - case "Furnace": return new Crafter(Crafter.Type.Furnace); - case "Oven": return new Crafter(Crafter.Type.Oven); - case "Bed": return new Bed(); - case "Tnt": return new Tnt(); - case "Lantern": return new Lantern(Lantern.Type.NORM); - case "IronLantern": return new Lantern(Lantern.Type.IRON); - case "GoldLantern": return new Lantern(Lantern.Type.GOLD); - default : Logger.tag("SaveLoad/LegacyLoad").warn("Unknown or outdated entity requested: " + string); + case "Spawner": + return new Spawner(new Zombie(1)); + case "Workbench": + return new Crafter(Crafter.Type.Workbench); + case "Chest": + return new Chest(); + case "DeathChest": + return new DeathChest(); + case "DungeonChest": + return new DungeonChest(false); + case "Anvil": + return new Crafter(Crafter.Type.Anvil); + case "Enchanter": + return new Crafter(Crafter.Type.Enchanter); + case "Loom": + return new Crafter(Crafter.Type.Loom); + case "Furnace": + return new Crafter(Crafter.Type.Furnace); + case "Oven": + return new Crafter(Crafter.Type.Oven); + case "Bed": + return new Bed(); + case "Tnt": + return new Tnt(); + case "Lantern": + return new Lantern(Lantern.Type.NORM); + case "IronLantern": + return new Lantern(Lantern.Type.IRON); + case "GoldLantern": + return new Lantern(Lantern.Type.GOLD); + default: + Logger.tag("SaveLoad/LegacyLoad").warn("Unknown or outdated entity requested: " + string); return null; } } diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 7909495b3..efc17809a 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -105,7 +105,10 @@ public class Load { extradata = new ArrayList<>(); } - public Load(String worldname) { this(worldname, true); } + public Load(String worldname) { + this(worldname, true); + } + public Load(String worldname, boolean loadGame) { loadFromFile(location + "/saves/" + worldname + "/Game" + extension); if (data.get(0).contains(".")) worldVer = new Version(data.get(0)); @@ -121,7 +124,7 @@ public Load(String worldname, boolean loadGame) { else { location += "/saves/" + worldname + "/"; - percentInc = 5 + World.levels.length-1; // For the methods below, and world. + percentInc = 5 + World.levels.length - 1; // For the methods below, and world. percentInc = 100f / percentInc; @@ -191,11 +194,15 @@ public Load(String worldname, boolean loadGame) { } } - public Load() { this(Game.VERSION); } + public Load() { + this(Game.VERSION); + } + public Load(Version worldVersion) { this(false); worldVer = worldVersion; } + public Load(boolean loadConfig) { if (!loadConfig) return; boolean resave = false; @@ -248,7 +255,9 @@ public Load(boolean loadConfig) { } } - public Version getWorldVersion() { return worldVer; } + public Version getWorldVersion() { + return worldVer; + } public static ArrayList loadFile(String filename) throws IOException { ArrayList lines = new ArrayList<>(); @@ -292,7 +301,9 @@ private void loadFromFile(String filename) { LoadingDisplay.progress(percentInc); } - /** Source: Note: This method is copied from MiniMods. */ + /** + * Source: Note: This method is copied from MiniMods. + */ private static ArrayList splitUnwrappedCommas(String input) { ArrayList out = new ArrayList<>(); int lastIdx = 0; @@ -319,17 +330,20 @@ private static ArrayList splitUnwrappedCommas(String input) { } else if (ch == openBracket0) { bracketCounter.push(0); } else if (ch == closeBracket0) { - if (checkDiff.test(0)) throw new RuntimeException(String.format("Invalid closing char %s index %s. Input: \"%s\"", ch, i, input)); + if (checkDiff.test(0)) + throw new RuntimeException(String.format("Invalid closing char %s index %s. Input: \"%s\"", ch, i, input)); bracketCounter.pop(); } else if (ch == openBracket1) { bracketCounter.push(1); } else if (ch == closeBracket1) { - if (checkDiff.test(1)) throw new RuntimeException(String.format("Invalid closing char %s index %s. Input: \"%s\"", ch, i, input)); + if (checkDiff.test(1)) + throw new RuntimeException(String.format("Invalid closing char %s index %s. Input: \"%s\"", ch, i, input)); bracketCounter.pop(); } else if (ch == openBracket2) { bracketCounter.push(2); } else if (ch == closeBracket2) { - if (checkDiff.test(2)) throw new RuntimeException(String.format("Invalid closing char %s index %s. Input: \"%s\"", ch, i, input)); + if (checkDiff.test(2)) + throw new RuntimeException(String.format("Invalid closing char %s index %s. Input: \"%s\"", ch, i, input)); bracketCounter.pop(); } } @@ -429,7 +443,7 @@ private void loadPrefsOld(String filename) { loadFromFile(location + filename + extension); Version prefVer = new Version("2.0.2"); // the default, b/c this doesn't really matter much being specific past this if it's not set below. - if(!data.get(2).contains(";")) // signifies that this file was last written to by a version after 2.0.2. + if (!data.get(2).contains(";")) // signifies that this file was last written to by a version after 2.0.2. prefVer = new Version(data.remove(0)); Settings.set("sound", Boolean.parseBoolean(data.remove(0))); @@ -446,7 +460,7 @@ private void loadPrefsOld(String filename) { subdata = data; } else { MultiplayerDisplay.savedIP = data.remove(0); - if(prefVer.compareTo(new Version("2.0.3-dev3")) > 0) { + if (prefVer.compareTo(new Version("2.0.3-dev3")) > 0) { MultiplayerDisplay.savedUUID = data.remove(0); MultiplayerDisplay.savedUsername = data.remove(0); } @@ -558,7 +572,7 @@ private void loadPrefs(String filename) { private void loadUnlocksOld(String filename) { loadFromFile(location + filename + extension); - for (String unlock: data) { + for (String unlock : data) { unlock = unlock.replace("HOURMODE", "H_ScoreTime").replace("MINUTEMODE", "M_ScoreTime").replace("M_ScoreTime", "_ScoreTime").replace("2H_ScoreTime", "120_ScoreTime"); if (unlock.contains("_ScoreTime")) @@ -585,7 +599,7 @@ private void loadUnlocks(String filename) { } private void loadWorld(String filename) { - for(int l = World.maxLevelDepth; l >= World.minLevelDepth; l--) { + for (int l = World.maxLevelDepth; l >= World.minLevelDepth; l--) { LoadingDisplay.setMessage(Level.getDepthString(l)); int lvlidx = World.lvlIdx(l); loadFromFile(location + filename + lvlidx + extension); @@ -635,7 +649,7 @@ private void loadWorld(String filename) { default: tilename = "Wool"; } - } else if (l == World.minLevelDepth+1 && tilename.equalsIgnoreCase("Lapis") && worldVer.compareTo(new Version("2.0.3-dev6")) < 0) { + } else if (l == World.minLevelDepth + 1 && tilename.equalsIgnoreCase("Lapis") && worldVer.compareTo(new Version("2.0.3-dev6")) < 0) { if (Math.random() < 0.8) // don't replace *all* the lapis tilename = "Gem Ore"; } else if (tilename.equalsIgnoreCase("Cloud Cactus")) { @@ -656,7 +670,7 @@ private void loadWorld(String filename) { } } - Level parent = World.levels[World.lvlIdx(l+1)]; + Level parent = World.levels[World.lvlIdx(l + 1)]; World.levels[lvlidx] = new Level(lvlw, lvlh, seed, l, parent, false); Level curLevel = World.levels[lvlidx]; @@ -667,13 +681,13 @@ private void loadWorld(String filename) { if (parent == null) continue; /// confirm that there are stairs in all the places that should have stairs. - for (minicraft.gfx.Point p: parent.getMatchingTiles(Tiles.get("Stairs Down"))) { + for (minicraft.gfx.Point p : parent.getMatchingTiles(Tiles.get("Stairs Down"))) { if (curLevel.getTile(p.x, p.y) != Tiles.get("Stairs Up")) { curLevel.printLevelLoc("INCONSISTENT STAIRS detected; placing stairsUp", p.x, p.y); curLevel.setTile(p.x, p.y, Tiles.get("Stairs Up")); } } - for (minicraft.gfx.Point p: curLevel.getMatchingTiles(Tiles.get("Stairs Up"))) { + for (minicraft.gfx.Point p : curLevel.getMatchingTiles(Tiles.get("Stairs Up"))) { if (parent.getTile(p.x, p.y) != Tiles.get("Stairs Down")) { parent.printLevelLoc("INCONSISTENT STAIRS detected; placing stairsDown", p.x, p.y); parent.setTile(p.x, p.y, Tiles.get("Stairs Down")); @@ -683,7 +697,7 @@ private void loadWorld(String filename) { LoadingDisplay.setMessage("minicraft.displays.loading.message.quests"); - if (new File(location+"Quests.json").exists()){ + if (new File(location + "Quests.json").exists()) { Logging.SAVELOAD.warn("Quest.json exists and it has been deprecated; renaming..."); try { Files.move(Paths.get(location, "Quests.json"), Paths.get(location, "Quests.json_old"), StandardCopyOption.REPLACE_EXISTING); @@ -693,7 +707,7 @@ private void loadWorld(String filename) { } boolean advancementsLoadSucceeded = false; - if (new File(location+"advancements.json").exists()) { + if (new File(location + "advancements.json").exists()) { try { JSONObject questsObj = new JSONObject(loadFromFile(location + "advancements.json", true)); @SuppressWarnings("unused") @@ -721,6 +735,7 @@ public void loadPlayer(String filename, Player player) { loadFromFile(location + filename + extension); loadPlayer(player, data); } + public void loadPlayer(Player player, List origData) { List data = new ArrayList<>(origData); player.x = Integer.parseInt(data.remove(0)); @@ -735,12 +750,11 @@ public void loadPlayer(Player player, List origData) { player.armor = Integer.parseInt(data.remove(0)); if (worldVer.compareTo(new Version("2.0.5-dev5")) >= 0 || player.armor > 0 || worldVer.compareTo(new Version("2.0.5-dev4")) == 0 && data.size() > 5) { - if(worldVer.compareTo(new Version("2.0.4-dev7")) < 0) { + if (worldVer.compareTo(new Version("2.0.4-dev7")) < 0) { // Reverse order b/c we are taking from the end - player.curArmor = (ArmorItem) Items.get(data.remove(data.size()-1)); - player.armorDamageBuffer = Integer.parseInt(data.remove(data.size()-1)); - } - else { + player.curArmor = (ArmorItem) Items.get(data.remove(data.size() - 1)); + player.armorDamageBuffer = Integer.parseInt(data.remove(data.size() - 1)); + } else { player.armorDamageBuffer = Integer.parseInt(data.remove(0)); player.curArmor = (ArmorItem) Items.get(data.remove(0), true); } @@ -755,8 +769,9 @@ public void loadPlayer(Player player, List origData) { Game.currentLevel = Integer.parseInt(data.remove(0)); Level level = World.levels[Game.currentLevel]; - if (!player.isRemoved()) player.remove(); // Removes the user player from the level, in case they would be added twice. - if(level != null) + if (!player.isRemoved()) + player.remove(); // Removes the user player from the level, in case they would be added twice. + if (level != null) level.add(player); else Logging.SAVELOAD.trace("Game level to add player {} to is null.", player); @@ -794,8 +809,7 @@ public void loadPlayer(Player player, List origData) { for (int i = 0; i < 3; i++) colors[i] = Integer.parseInt(String.valueOf(color.charAt(i))); player.shirtColor = Color.get(1, colors[0] * 51, colors[1] * 51, colors[2] * 51); - } - else + } else player.shirtColor = Integer.parseInt(data.remove(0)); // Just delete the slot reserved for loading legacy skins. @@ -865,6 +879,7 @@ public void loadInventory(String filename, Inventory inventory) { loadFromFile(location + filename + extension); loadInventory(inventory, data); } + public void loadInventory(Inventory inventory, List data) { inventory.clearInv(); @@ -962,7 +977,7 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL int awID = Integer.parseInt(info.get(2)); Entity sparkOwner = Network.getEntity(awID); if (sparkOwner instanceof AirWizard) - newEntity = new Spark((AirWizard)sparkOwner, x, y); + newEntity = new Spark((AirWizard) sparkOwner, x, y); else { Logging.SAVELOAD.error("Failed to load Spark; owner id doesn't point to a correct entity"); return null; @@ -972,22 +987,23 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL if (!Crafter.names.contains(entityName)) { // Entity missing debugging try { Class.forName("minicraft.entity.mob." + entityName); - } catch (ClassNotFoundException ignored) {} + } catch (ClassNotFoundException ignored) { + } } // Check for level of AirWizard - if(entityName.equals("AirWizard")) { + if (entityName.equals("AirWizard")) { mobLvl = Integer.parseInt(stuff[3]); } - newEntity = getEntity(entityName.substring(entityName.lastIndexOf(".")+1), mobLvl); + newEntity = getEntity(entityName.substring(entityName.lastIndexOf(".") + 1), mobLvl); } if (entityName.equals("FireSpark") && !isLocalSave) { int obID = Integer.parseInt(info.get(2)); Entity sparkOwner = Network.getEntity(obID); if (sparkOwner instanceof ObsidianKnight) - newEntity = new FireSpark((ObsidianKnight)sparkOwner, x, y); + newEntity = new FireSpark((ObsidianKnight) sparkOwner, x, y); else { Logging.SAVELOAD.error("Failed to load FireSpark; owner id doesn't point to a correct entity"); return null; @@ -998,7 +1014,7 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL return null; if (newEntity instanceof Mob) { // This is structured the same way as in Save.java. - Mob mob = (Mob)newEntity; + Mob mob = (Mob) newEntity; mob.health = Integer.parseInt(info.get(2)); Class c = null; @@ -1010,7 +1026,7 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL if (EnemyMob.class.isAssignableFrom(c)) { EnemyMob enemyMob = ((EnemyMob) mob); - enemyMob.lvl = Integer.parseInt(info.get(info.size()-2)); + enemyMob.lvl = Integer.parseInt(info.get(info.size() - 2)); if (enemyMob.lvl == 0) { Logging.SAVELOAD.debug("Level 0 mob: " + entityName); @@ -1034,10 +1050,10 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL newEntity = mob; } else if (newEntity instanceof Chest) { - Chest chest = (Chest)newEntity; + Chest chest = (Chest) newEntity; boolean isDeathChest = chest instanceof DeathChest; boolean isDungeonChest = chest instanceof DungeonChest; - List chestInfo = info.subList(2, info.size()-1); + List chestInfo = info.subList(2, info.size() - 1); int endIdx = chestInfo.size() - (isDeathChest || isDungeonChest ? 1 : 0); for (int idx = 0; idx < endIdx; idx++) { @@ -1051,10 +1067,11 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL } if (isDeathChest) { - ((DeathChest)chest).time = Integer.parseInt(chestInfo.get(chestInfo.size()-1)); + ((DeathChest) chest).time = Integer.parseInt(chestInfo.get(chestInfo.size() - 1)); } else if (isDungeonChest) { - ((DungeonChest)chest).setLocked(Boolean.parseBoolean(chestInfo.get(chestInfo.size()-1))); - if (((DungeonChest)chest).isLocked()) World.levels[Integer.parseInt(info.get(info.size()-1))].chestCount++; + ((DungeonChest) chest).setLocked(Boolean.parseBoolean(chestInfo.get(chestInfo.size() - 1))); + if (((DungeonChest) chest).isLocked()) + World.levels[Integer.parseInt(info.get(info.size() - 1))].chestCount++; } newEntity = chest; @@ -1072,7 +1089,7 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL if (!isLocalSave) { if (newEntity instanceof Arrow) { int ownerID = Integer.parseInt(info.get(2)); - Mob m = (Mob)Network.getEntity(ownerID); + Mob m = (Mob) Network.getEntity(ownerID); if (m != null) { Direction dir = Direction.values[Integer.parseInt(info.get(3))]; int dmg = Integer.parseInt(info.get(5)); @@ -1100,7 +1117,7 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL if (newEntity instanceof ItemEntity && eid == -1) Logging.SAVELOAD.warn("Item entity was loaded with no eid"); - int curLevel = Integer.parseInt(info.get(info.size()-1)); + int curLevel = Integer.parseInt(info.get(info.size() - 1)); if (World.levels[curLevel] != null) { World.levels[curLevel].add(newEntity, x, y); } @@ -1111,41 +1128,73 @@ public static Entity loadEntity(String entityData, Version worldVer, boolean isL @Nullable private static Entity getEntity(String string, int mobLevel) { switch (string) { - case "Player": return null; - case "RemotePlayer": return null; - case "Cow": return new Cow(); - case "Sheep": return new Sheep(); - case "Pig": return new Pig(); - case "Zombie": return new Zombie(mobLevel); - case "Slime": return new Slime(mobLevel); - case "Creeper": return new Creeper(mobLevel); - case "Skeleton": return new Skeleton(mobLevel); - case "Knight": return new Knight(mobLevel); - case "Snake": return new Snake(mobLevel); + case "Player": + return null; + case "RemotePlayer": + return null; + case "Cow": + return new Cow(); + case "Sheep": + return new Sheep(); + case "Pig": + return new Pig(); + case "Zombie": + return new Zombie(mobLevel); + case "Slime": + return new Slime(mobLevel); + case "Creeper": + return new Creeper(mobLevel); + case "Skeleton": + return new Skeleton(mobLevel); + case "Knight": + return new Knight(mobLevel); + case "Snake": + return new Snake(mobLevel); case "AirWizard": if (mobLevel > 1) return null; return new AirWizard(); - case "Spawner": return new Spawner(new Zombie(1)); - case "Workbench": return new Crafter(Crafter.Type.Workbench); - case "Chest": return new Chest(); - case "DeathChest": return new DeathChest(); - case "DungeonChest": return new DungeonChest(false); - case "Anvil": return new Crafter(Crafter.Type.Anvil); - case "Enchanter": return new Crafter(Crafter.Type.Enchanter); - case "Loom": return new Crafter(Crafter.Type.Loom); - case "Furnace": return new Crafter(Crafter.Type.Furnace); - case "Oven": return new Crafter(Crafter.Type.Oven); - case "Bed": return new Bed(); - case "Tnt": return new Tnt(); - case "Lantern": return new Lantern(Lantern.Type.NORM); - case "Arrow": return new Arrow(new Skeleton(0), 0, 0, Direction.NONE, 0); - case "ItemEntity": return new ItemEntity(Items.get("unknown"), 0, 0); - case "FireParticle": return new FireParticle(0, 0); - case "SmashParticle": return new SmashParticle(0, 0); - case "TextParticle": return new TextParticle("", 0, 0, 0); - case "KnightStatue": return new KnightStatue(0); - case "ObsidianKnight": return new ObsidianKnight(0); - default : Logging.SAVELOAD.error("LOAD ERROR: Unknown or outdated entity requested: " + string); + case "Spawner": + return new Spawner(new Zombie(1)); + case "Workbench": + return new Crafter(Crafter.Type.Workbench); + case "Chest": + return new Chest(); + case "DeathChest": + return new DeathChest(); + case "DungeonChest": + return new DungeonChest(false); + case "Anvil": + return new Crafter(Crafter.Type.Anvil); + case "Enchanter": + return new Crafter(Crafter.Type.Enchanter); + case "Loom": + return new Crafter(Crafter.Type.Loom); + case "Furnace": + return new Crafter(Crafter.Type.Furnace); + case "Oven": + return new Crafter(Crafter.Type.Oven); + case "Bed": + return new Bed(); + case "Tnt": + return new Tnt(); + case "Lantern": + return new Lantern(Lantern.Type.NORM); + case "Arrow": + return new Arrow(new Skeleton(0), 0, 0, Direction.NONE, 0); + case "ItemEntity": + return new ItemEntity(Items.get("unknown"), 0, 0); + case "FireParticle": + return new FireParticle(0, 0); + case "SmashParticle": + return new SmashParticle(0, 0); + case "TextParticle": + return new TextParticle("", 0, 0, 0); + case "KnightStatue": + return new KnightStatue(0); + case "ObsidianKnight": + return new ObsidianKnight(0); + default: + Logging.SAVELOAD.error("LOAD ERROR: Unknown or outdated entity requested: " + string); return null; } } diff --git a/src/client/java/minicraft/saveload/Save.java b/src/client/java/minicraft/saveload/Save.java index a5096b15e..b9a08424e 100644 --- a/src/client/java/minicraft/saveload/Save.java +++ b/src/client/java/minicraft/saveload/Save.java @@ -65,6 +65,7 @@ public class Save { /** * This is the main save method. Called by all Save() methods. + * * @param worldFolder The folder of where to save */ private Save(File worldFolder) { @@ -93,10 +94,11 @@ private Save(File worldFolder) { /** * This will save world options + * * @param worldname The name of the world. */ public Save(String worldname) { - this(new File(Game.gameDir+"/saves/" + worldname + "/")); + this(new File(Game.gameDir + "/saves/" + worldname + "/")); writeGame("Game"); writeWorld("Level"); @@ -111,9 +113,11 @@ public Save(String worldname) { Updater.saving = false; } - /** This will save the settings in the settings menu. */ + /** + * This will save the settings in the settings menu. + */ public Save() { - this(new File(Game.gameDir+"/")); + this(new File(Game.gameDir + "/")); Logging.SAVELOAD.debug("Writing preferences and unlocks..."); writePrefs(); writeUnlocks(); @@ -121,7 +125,7 @@ public Save() { public Save(Player player, boolean writePlayer) { // This is simply for access to writeToFile. - this(new File(Game.gameDir+"/saves/"+WorldSelectDisplay.getWorldName() + "/")); + this(new File(Game.gameDir + "/saves/" + WorldSelectDisplay.getWorldName() + "/")); if (writePlayer) { writePlayer("Player", player); writeInventory("Inventory", player); @@ -144,7 +148,7 @@ public void writeToFile(String filename, List savedata) { data.clear(); LoadingDisplay.progress(7); - if(LoadingDisplay.getPercentage() > 100) { + if (LoadingDisplay.getPercentage() > 100) { LoadingDisplay.setPercentage(100); } @@ -294,7 +298,7 @@ public static void writePlayer(Player player, List data) { StringBuilder subdata = new StringBuilder("PotionEffects["); - for (java.util.Map.Entry potion: player.potioneffects.entrySet()) + for (java.util.Map.Entry potion : player.potioneffects.entrySet()) subdata.append(potion.getKey()).append(";").append(potion.getValue()).append(":"); if (player.potioneffects.size() > 0) @@ -317,6 +321,7 @@ private void writeInventory(String filename, Player player) { writeInventory(player, data); writeToFile(location + filename + extension, data); } + public static void writeInventory(Player player, List data) { data.clear(); if (player.activeItem != null) { @@ -333,7 +338,7 @@ public static void writeInventory(Player player, List data) { private void writeEntities(String filename) { LoadingDisplay.setMessage("minicraft.displays.loading.message.entities"); for (int l = 0; l < World.levels.length; l++) { - for (Entity e: World.levels[l].getEntitiesToSave()) { + for (Entity e : World.levels[l].getEntitiesToSave()) { String saved = writeEntity(e, true); if (saved.length() > 0) data.add(saved); @@ -345,19 +350,19 @@ private void writeEntities(String filename) { public static String writeEntity(Entity e, boolean isLocalSave) { String name = e.getClass().getName(); - name = name.substring(name.lastIndexOf('.')+1); + name = name.substring(name.lastIndexOf('.') + 1); StringBuilder extradata = new StringBuilder(); // Don't even write ItemEntities or particle effects; Spark... will probably is saved, eventually; it presents an unfair cheat to remove the sparks by reloading the Game. - if (isLocalSave && (e instanceof ItemEntity || e instanceof Arrow || e instanceof Spark || e instanceof FireSpark || e instanceof Particle)) // Write these only when sending a world, not writing it. (RemotePlayers are saved separately, when their info is received.) + if (isLocalSave && (e instanceof ItemEntity || e instanceof Arrow || e instanceof Spark || e instanceof FireSpark || e instanceof Particle)) // Write these only when sending a world, not writing it. (RemotePlayers are saved separately, when their info is received.) return ""; if (!isLocalSave) extradata.append(":").append(e.eid); if (e instanceof Mob) { - Mob m = (Mob)e; + Mob m = (Mob) e; extradata.append(":").append(m.health); if (e instanceof EnemyMob) extradata.append(":").append(((EnemyMob) m).lvl); @@ -366,21 +371,21 @@ else if (e instanceof Sheep) } if (e instanceof Chest) { - Chest chest = (Chest)e; + Chest chest = (Chest) e; - for(int ii = 0; ii < chest.getInventory().invSize(); ii++) { + for (int ii = 0; ii < chest.getInventory().invSize(); ii++) { Item item = chest.getInventory().get(ii); extradata.append(":").append(item.getData()); } - if(chest instanceof DeathChest) extradata.append(":").append(((DeathChest) chest).time); - if(chest instanceof DungeonChest) extradata.append(":").append(((DungeonChest) chest).isLocked()); + if (chest instanceof DeathChest) extradata.append(":").append(((DeathChest) chest).time); + if (chest instanceof DungeonChest) extradata.append(":").append(((DungeonChest) chest).isLocked()); } if (e instanceof Spawner) { - Spawner egg = (Spawner)e; + Spawner egg = (Spawner) e; String mobname = egg.mob.getClass().getName(); - mobname = mobname.substring(mobname.lastIndexOf(".")+1); + mobname = mobname.substring(mobname.lastIndexOf(".") + 1); extradata.append(":").append(mobname).append(":").append(egg.mob instanceof EnemyMob ? ((EnemyMob) egg.mob).lvl : 1); } @@ -389,7 +394,7 @@ else if (e instanceof Sheep) } if (e instanceof Crafter) { - name = ((Crafter)e).type.name(); + name = ((Crafter) e).type.name(); } if (e instanceof KnightStatue) { diff --git a/src/client/java/minicraft/saveload/Version.java b/src/client/java/minicraft/saveload/Version.java index 247a8318c..b388134be 100644 --- a/src/client/java/minicraft/saveload/Version.java +++ b/src/client/java/minicraft/saveload/Version.java @@ -7,7 +7,10 @@ public class Version implements Comparable { private int make, major, minor, dev; private boolean valid = true; - public Version(String version) { this(version, true); } + public Version(String version) { + this(version, true); + } + private Version(String version, boolean printError) { String[] nums = version.split("\\."); try { @@ -39,12 +42,18 @@ private Version(String version, boolean printError) { } } - public boolean isValid() { return valid; } - public static boolean isValid(String version) { return new Version(version, false).isValid(); } + public boolean isValid() { + return valid; + } + + public static boolean isValid(String version) { + return new Version(version, false).isValid(); + } /** * The returned value of this method (-1, 0, or 1) is determined by whether this object is less than, equal to, or greater than the specified object, ov. * (this.compareTo(new Version("1.0.0") < 0 is the same as this < 1.0.0) + * * @param ov The version to compare to. */ public int compareTo(@NotNull Version ov) { @@ -54,9 +63,10 @@ public int compareTo(@NotNull Version ov) { /** * The returned value of this method (-1, 0, or 1) is determined by whether this object is less than, equal to, or greater than the specified object, ov. * (this.compareTo(new Version("1.0.0") < 0 is the same as this < 1.0.0) - * @param ov The version to compare to. + * + * @param ov The version to compare to. * @param ignoreDev If we should ignore dev versions in this comparison. - */ + */ public int compareTo(@NotNull Version ov, boolean ignoreDev) { if (make != ov.make) return Integer.compare(make, ov.make); if (major != ov.major) return Integer.compare(major, ov.major); @@ -73,7 +83,11 @@ public int compareTo(@NotNull Version ov, boolean ignoreDev) { } @Override - public String toString() { return make + "." + major + "." + minor + (dev == 0 ? "" : "-dev" + dev); } + public String toString() { + return make + "." + major + "." + minor + (dev == 0 ? "" : "-dev" + dev); + } - public int[] toArray() { return new int[]{ make, major, minor, dev }; } + public int[] toArray() { + return new int[]{make, major, minor, dev}; + } } diff --git a/src/client/java/minicraft/screen/AchievementsDisplay.java b/src/client/java/minicraft/screen/AchievementsDisplay.java index aceab7e75..c54ce2e29 100644 --- a/src/client/java/minicraft/screen/AchievementsDisplay.java +++ b/src/client/java/minicraft/screen/AchievementsDisplay.java @@ -30,200 +30,204 @@ public class AchievementsDisplay extends Display { - private static final HashMap achievements = new HashMap<>(); - - private static Achievement selectedAchievement; - private static int achievementScore; - - static { - // Get achievements from a json file stored in resources. Relative to project root. - try (InputStream stream = Game.class.getResourceAsStream("/resources/achievements.json")) { - if (stream != null) { - BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); - - // Read lines and combine into a string. - String achievementsJson = reader.lines().collect(Collectors.joining("\n")); - - // Load json. - JSONArray json = new JSONArray(achievementsJson); - for (Object object : json) { - JSONObject obj = (JSONObject) object; - - // Create an achievement with the data. - Achievement a = new Achievement( - Localization.getLocalized(obj.getString("id")), - obj.getString("desc"), - obj.getInt("score") - ); - - achievements.put(obj.getString("id"), a); - } - } else { - Logging.ACHIEVEMENT.error("Could not find achievements json."); - } - } catch (IOException ex) { - Logging.ACHIEVEMENT.error("Could not read achievements from json file."); - ex.printStackTrace(); - } catch (JSONException e) { - Logging.ACHIEVEMENT.error("Achievements json contains invalid json."); - } - } - - public AchievementsDisplay() { - super(true, true, - new Menu.Builder(false, 2, RelPos.CENTER, getAchievemensAsEntries()).setSize(48, 48).createMenu(), - new Menu.Builder(false, 2, RelPos.BOTTOM, new StringEntry("")).setSize(200, 32).setPositioning(new Point(Screen.w / 2, Screen.h / 2 + 32), RelPos.BOTTOM).createMenu()); - } - - @Override - public void init(@Nullable Display parent) { - super.init(parent); - if (achievements.isEmpty()) { - Game.setDisplay(new TitleDisplay()); - Logging.ACHIEVEMENT.error("Could not open achievements menu because no achievements could be found."); - return; - } - - ListEntry curEntry = menus[0].getCurEntry(); - if (curEntry instanceof SelectEntry) { - selectedAchievement = achievements.get(((SelectEntry) curEntry).getText()); - } - } - - @Override - public void onExit() { - // Play confirm sound. - Sound.play("confirm"); - new Save(); - } - - @Override + private static final HashMap achievements = new HashMap<>(); + + private static Achievement selectedAchievement; + private static int achievementScore; + + static { + // Get achievements from a json file stored in resources. Relative to project root. + try (InputStream stream = Game.class.getResourceAsStream("/resources/achievements.json")) { + if (stream != null) { + BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); + + // Read lines and combine into a string. + String achievementsJson = reader.lines().collect(Collectors.joining("\n")); + + // Load json. + JSONArray json = new JSONArray(achievementsJson); + for (Object object : json) { + JSONObject obj = (JSONObject) object; + + // Create an achievement with the data. + Achievement a = new Achievement( + Localization.getLocalized(obj.getString("id")), + obj.getString("desc"), + obj.getInt("score") + ); + + achievements.put(obj.getString("id"), a); + } + } else { + Logging.ACHIEVEMENT.error("Could not find achievements json."); + } + } catch (IOException ex) { + Logging.ACHIEVEMENT.error("Could not read achievements from json file."); + ex.printStackTrace(); + } catch (JSONException e) { + Logging.ACHIEVEMENT.error("Achievements json contains invalid json."); + } + } + + public AchievementsDisplay() { + super(true, true, + new Menu.Builder(false, 2, RelPos.CENTER, getAchievemensAsEntries()).setSize(48, 48).createMenu(), + new Menu.Builder(false, 2, RelPos.BOTTOM, new StringEntry("")).setSize(200, 32).setPositioning(new Point(Screen.w / 2, Screen.h / 2 + 32), RelPos.BOTTOM).createMenu()); + } + + @Override + public void init(@Nullable Display parent) { + super.init(parent); + if (achievements.isEmpty()) { + Game.setDisplay(new TitleDisplay()); + Logging.ACHIEVEMENT.error("Could not open achievements menu because no achievements could be found."); + return; + } + + ListEntry curEntry = menus[0].getCurEntry(); + if (curEntry instanceof SelectEntry) { + selectedAchievement = achievements.get(((SelectEntry) curEntry).getText()); + } + } + + @Override + public void onExit() { + // Play confirm sound. + Sound.play("confirm"); + new Save(); + } + + @Override public void tick(InputHandler input) { super.tick(input); - ListEntry curEntry = menus[0].getCurEntry(); - if (curEntry instanceof SelectEntry) { - selectedAchievement = achievements.get(((SelectEntry) curEntry).getText()); - } - } - - @Override - public void render(Screen screen) { - super.render(screen); - - // Title. - Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements"), screen, 8, Color.WHITE); - - // Achievement score. - Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.score", achievementScore), screen, 32, Color.GRAY); - - if (selectedAchievement != null) { - - // Render Achievement Info. - if (selectedAchievement.getUnlocked()) { - Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.achieved"), screen, 48, Color.GREEN); - } else { - Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.not_achieved"), screen, 48, Color.RED); - } - - // Achievement description. - menus[1].setEntries(StringEntry.useLines(Font.getLines(Localization.getLocalized(selectedAchievement.description), menus[1].getBounds().getSize().width, menus[1].getBounds().getSize().height, 2))); - } - - // Help text. - Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.help", Game.input.getMapping("cursor-down"), Game.input.getMapping("cursor-up")), screen, Screen.h - 8, Color.DARK_GRAY); - } - - /** - * Use this to lock or unlock an achievement. - * @param id Achievement ID. - * @param unlocked Whether this achievement should be locked or unlocked. - * @return True if setting the achievement was successful. - */ - public static boolean setAchievement(String id, boolean unlocked) { - return setAchievement(id, unlocked, true, false); - } - public static boolean setAchievement(boolean allowCreative, String id, boolean unlocked) { return setAchievement(id, unlocked, true, allowCreative); } + ListEntry curEntry = menus[0].getCurEntry(); + if (curEntry instanceof SelectEntry) { + selectedAchievement = achievements.get(((SelectEntry) curEntry).getText()); + } + } + + @Override + public void render(Screen screen) { + super.render(screen); + + // Title. + Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements"), screen, 8, Color.WHITE); + + // Achievement score. + Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.score", achievementScore), screen, 32, Color.GRAY); + + if (selectedAchievement != null) { + + // Render Achievement Info. + if (selectedAchievement.getUnlocked()) { + Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.achieved"), screen, 48, Color.GREEN); + } else { + Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.not_achieved"), screen, 48, Color.RED); + } + + // Achievement description. + menus[1].setEntries(StringEntry.useLines(Font.getLines(Localization.getLocalized(selectedAchievement.description), menus[1].getBounds().getSize().width, menus[1].getBounds().getSize().height, 2))); + } + + // Help text. + Font.drawCentered(Localization.getLocalized("minicraft.displays.achievements.display.help", Game.input.getMapping("cursor-down"), Game.input.getMapping("cursor-up")), screen, Screen.h - 8, Color.DARK_GRAY); + } + + /** + * Use this to lock or unlock an achievement. + * + * @param id Achievement ID. + * @param unlocked Whether this achievement should be locked or unlocked. + * @return True if setting the achievement was successful. + */ + public static boolean setAchievement(String id, boolean unlocked) { + return setAchievement(id, unlocked, true, false); + } + + public static boolean setAchievement(boolean allowCreative, String id, boolean unlocked) { + return setAchievement(id, unlocked, true, allowCreative); + } private static boolean setAchievement(String id, boolean unlocked, boolean save, boolean allowCreative) { - Achievement a = achievements.get(id); + Achievement a = achievements.get(id); // Return if it is in creative mode if (!allowCreative && Game.isMode("minicraft.settings.mode.creative")) return false; - // Return if we didn't find any achievements. - if (a == null) return false; - - if (a.getUnlocked() && unlocked) return false; // Return if it is already unlocked. - if (!a.getUnlocked() && !unlocked) return false; // Return if it is already locked. - - // Make the achievement unlocked in memory. - a.setUnlocked(unlocked); - Logging.ACHIEVEMENT.debug("Updating data of achievement with id: {}.", id); - - // Add or subtract from score - if (unlocked) { - achievementScore += a.score; - - // Tells the player that they got an achievement. - Game.notifications.add(Localization.getLocalized("minicraft.notification.achievement_unlocked", Localization.getLocalized(id))); - } - else - achievementScore -= a.score; - - // Save the new list of achievements stored in memory. - if (save) new Save(); - - return true; - } - - /** - * Gets an array of all the unlocked achievements. - * @return A string array with each unlocked achievement's id in it. - */ - public static String[] getUnlockedAchievements() { - ArrayList strings = new ArrayList<>(); - - for (String id : achievements.keySet()) { - if (achievements.get(id).getUnlocked()) { - strings.add(id); - } - } - - return strings.toArray(new String[0]); - } - - public static List getAchievemensAsEntries() { - List l = new ArrayList<>(); - for (String id : achievements.keySet()) { - // Add entry to list. - l.add(new SelectEntry(id, null, true) - { - /** - * Change the color of the selection. - */ - @Override - public int getColor(boolean isSelected) { - if (achievements.get(id).getUnlocked()) { - return Color.GREEN; - } else { - return Color.WHITE; - } - } - }); - } - - return l; - } - - /** - * Unlocks a list of achievements. - * @param unlockedAchievements An array of all the achievements we want to load, ids. - */ - public static void unlockAchievements(JSONArray unlockedAchievements) { - for (Object id : unlockedAchievements.toList()) { - if (!setAchievement(id.toString(), true, false, false)) { - Logging.ACHIEVEMENT.warn("Could not load unlocked achievement with name {}.", id.toString()); - } - } - } + // Return if we didn't find any achievements. + if (a == null) return false; + + if (a.getUnlocked() && unlocked) return false; // Return if it is already unlocked. + if (!a.getUnlocked() && !unlocked) return false; // Return if it is already locked. + + // Make the achievement unlocked in memory. + a.setUnlocked(unlocked); + Logging.ACHIEVEMENT.debug("Updating data of achievement with id: {}.", id); + + // Add or subtract from score + if (unlocked) { + achievementScore += a.score; + + // Tells the player that they got an achievement. + Game.notifications.add(Localization.getLocalized("minicraft.notification.achievement_unlocked", Localization.getLocalized(id))); + } else + achievementScore -= a.score; + + // Save the new list of achievements stored in memory. + if (save) new Save(); + + return true; + } + + /** + * Gets an array of all the unlocked achievements. + * + * @return A string array with each unlocked achievement's id in it. + */ + public static String[] getUnlockedAchievements() { + ArrayList strings = new ArrayList<>(); + + for (String id : achievements.keySet()) { + if (achievements.get(id).getUnlocked()) { + strings.add(id); + } + } + + return strings.toArray(new String[0]); + } + + public static List getAchievemensAsEntries() { + List l = new ArrayList<>(); + for (String id : achievements.keySet()) { + // Add entry to list. + l.add(new SelectEntry(id, null, true) { + /** + * Change the color of the selection. + */ + @Override + public int getColor(boolean isSelected) { + if (achievements.get(id).getUnlocked()) { + return Color.GREEN; + } else { + return Color.WHITE; + } + } + }); + } + + return l; + } + + /** + * Unlocks a list of achievements. + * + * @param unlockedAchievements An array of all the achievements we want to load, ids. + */ + public static void unlockAchievements(JSONArray unlockedAchievements) { + for (Object id : unlockedAchievements.toList()) { + if (!setAchievement(id.toString(), true, false, false)) { + Logging.ACHIEVEMENT.warn("Could not load unlocked achievement with name {}.", id.toString()); + } + } + } } diff --git a/src/client/java/minicraft/screen/BookDisplay.java b/src/client/java/minicraft/screen/BookDisplay.java index 0b462add1..0810fa1e9 100644 --- a/src/client/java/minicraft/screen/BookDisplay.java +++ b/src/client/java/minicraft/screen/BookDisplay.java @@ -18,7 +18,7 @@ public class BookDisplay extends Display { private static final String defaultBook = "This book has no text."; private static final int spacing = 3; - private static final int minX = 15, maxX = 15+8 * 32, minY = 8*5, maxY = 8*5 + 8*16; + private static final int minX = 15, maxX = 15 + 8 * 32, minY = 8 * 5, maxY = 8 * 5 + 8 * 16; // First array is page and second is line. private String[][] lines; @@ -28,9 +28,12 @@ public class BookDisplay extends Display { private final boolean showPageCount; private final int pageOffset; - public BookDisplay(String book) { this(book, false); } + public BookDisplay(String book) { + this(book, false); + } + public BookDisplay(String book, boolean hasTitle) {// this(book, hasTitle, !hasTitle); } - //public BookDisplay(String book, boolean hasTitle, boolean hideCountIfOnePage) { + //public BookDisplay(String book, boolean hasTitle, boolean hideCountIfOnePage) { page = 0; if (book == null) { @@ -42,11 +45,11 @@ public class BookDisplay extends Display { ArrayList pages = new ArrayList<>(); String[] splitContents = book.split("\0"); - for (String content: splitContents) { + for (String content : splitContents) { String[] remainder = {content}; - while (remainder[remainder.length-1].length() > 0) { - remainder = Font.getLines(remainder[remainder.length-1], maxX-minX, maxY-minY, spacing, true); - pages.add(Arrays.copyOf(remainder, remainder.length-1)); // Removes the last element of remainder, which is the leftover. + while (remainder[remainder.length - 1].length() > 0) { + remainder = Font.getLines(remainder[remainder.length - 1], maxX - minX, maxY - minY, spacing, true); + pages.add(Arrays.copyOf(remainder, remainder.length - 1)); // Removes the last element of remainder, which is the leftover. } } @@ -58,31 +61,32 @@ public class BookDisplay extends Display { Menu.Builder builder = new Menu.Builder(true, spacing, RelPos.CENTER); Menu pageCount = builder // The small rect for the title - .setPositioning(new Point(Screen.w/2, 0), RelPos.BOTTOM) + .setPositioning(new Point(Screen.w / 2, 0), RelPos.BOTTOM) .setEntries(StringEntry.useLines(Color.BLACK, "Page", hasTitle ? "Title" : "1/" + lines.length)) .setSelection(1) .createMenu(); builder - .setPositioning(new Point(Screen.w/2, pageCount.getBounds().getBottom() + spacing), RelPos.BOTTOM) - .setSize(maxX-minX + MinicraftImage.boxWidth*2, maxY-minY + MinicraftImage.boxWidth*2) + .setPositioning(new Point(Screen.w / 2, pageCount.getBounds().getBottom() + spacing), RelPos.BOTTOM) + .setSize(maxX - minX + MinicraftImage.boxWidth * 2, maxY - minY + MinicraftImage.boxWidth * 2) .setShouldRender(false); menus = new Menu[lines.length + pageOffset]; if (showPageCount) menus[0] = pageCount; for (int i = 0; i < lines.length; i++) { - menus[i+pageOffset] = builder.setEntries(StringEntry.useLines(Color.WHITE, lines[i])).createMenu(); + menus[i + pageOffset] = builder.setEntries(StringEntry.useLines(Color.WHITE, lines[i])).createMenu(); } - menus[page+pageOffset].shouldRender = true; + menus[page + pageOffset].shouldRender = true; } private void turnPage(int dir) { if (page + dir >= 0 && page + dir < lines.length) { - menus[page+pageOffset].shouldRender = false; + menus[page + pageOffset].shouldRender = false; page += dir; - if (showPageCount) menus[0].updateSelectedEntry(new StringEntry(page == 0 && hasTitle ? "Title" : (page + 1) + "/" + lines.length, Color.BLACK)); - menus[page+pageOffset].shouldRender = true; + if (showPageCount) + menus[0].updateSelectedEntry(new StringEntry(page == 0 && hasTitle ? "Title" : (page + 1) + "/" + lines.length, Color.BLACK)); + menus[page + pageOffset].shouldRender = true; } } diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 5fc031384..21b71f2b7 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -45,19 +45,22 @@ public ContainerDisplay(Player player, Chest chest) { protected void onSelectionChange(int oldSel, int newSel) { super.onSelectionChange(oldSel, newSel); - if (oldSel == newSel) return; // this also serves as a protection against access to menus[0] when such may not exist. + if (oldSel == newSel) + return; // this also serves as a protection against access to menus[0] when such may not exist. int shift = 0; if (newSel == 0) shift = padding - menus[0].getBounds().getLeft(); if (newSel == 1) shift = (Screen.w - padding) - menus[1].getBounds().getRight(); - for (Menu m: menus) { + for (Menu m : menus) { m.translate(shift, 0); } } - private int getOtherIdx() { return selection ^ 1; } + private int getOtherIdx() { + return selection ^ 1; + } @Override public void render(Screen screen) { @@ -128,23 +131,23 @@ public void tick(InputHandler input) { Item fromItem = from.get(fromSel); - boolean transferAll = input.getMappedKey("shift").isDown() || !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; + boolean transferAll = input.getMappedKey("shift").isDown() || !(fromItem instanceof StackableItem) || ((StackableItem) fromItem).count == 1; Item toItem = fromItem.copy(); if (fromItem instanceof StackableItem) { int move = 1; if (!transferAll) { - ((StackableItem)toItem).count = 1; + ((StackableItem) toItem).count = 1; } else { - move = ((StackableItem)fromItem).count; + move = ((StackableItem) fromItem).count; } int moved = to.add(toSel, toItem); if (moved < move) { - ((StackableItem)fromItem).count -= moved; + ((StackableItem) fromItem).count -= moved; } else if (!transferAll) { - ((StackableItem)fromItem).count--; + ((StackableItem) fromItem).count--; } else { from.remove(fromSel); } diff --git a/src/client/java/minicraft/screen/ControlsDisplay.java b/src/client/java/minicraft/screen/ControlsDisplay.java index 842105ba0..8e028156a 100644 --- a/src/client/java/minicraft/screen/ControlsDisplay.java +++ b/src/client/java/minicraft/screen/ControlsDisplay.java @@ -22,7 +22,7 @@ public class ControlsDisplay extends Display { public ControlsDisplay() { super(true, true, new Menu.Builder(false, 0, RelPos.CENTER) .setSelectable(true) - .setPositioning(new Point(Screen.w/2, 20), RelPos.BOTTOM) + .setPositioning(new Point(Screen.w / 2, 20), RelPos.BOTTOM) .setDisplayLength(17) .createMenu() ); @@ -51,7 +51,7 @@ private void initControllerControls() { } private void switchingControls() { - menus[0].setEntries(displaying == 0? keyControls: controllerControls); + menus[0].setEntries(displaying == 0 ? keyControls : controllerControls); menus[0].setSelection(0); } @@ -60,7 +60,7 @@ public void render(Screen screen) { super.render(screen); Font.drawCentered(Localization.getLocalized("minicraft.displays.controls"), screen, 0, Color.WHITE); - Font.drawCentered(Localization.getLocalized(displaying == 0? "minicraft.displays.controls.display.keyboard": "minicraft.displays.controls.display.controller"), screen, 10, Color.WHITE); + Font.drawCentered(Localization.getLocalized(displaying == 0 ? "minicraft.displays.controls.display.keyboard" : "minicraft.displays.controls.display.controller"), screen, 10, Color.WHITE); if (displaying == 0) { // If displaying keyboard mappings. Font.drawCentered(Localization.getLocalized("minicraft.displays.controls.display.keyboard.desc"), screen, Screen.h - 16, Color.GRAY); diff --git a/src/client/java/minicraft/screen/CraftingDisplay.java b/src/client/java/minicraft/screen/CraftingDisplay.java index 2432335e8..fa92751c4 100644 --- a/src/client/java/minicraft/screen/CraftingDisplay.java +++ b/src/client/java/minicraft/screen/CraftingDisplay.java @@ -36,9 +36,12 @@ public class CraftingDisplay extends Display { private static final HashSet unlockedRecipes = new HashSet<>(); - public CraftingDisplay(List recipes, String title, Player player) { this(recipes, title, player, false); } + public CraftingDisplay(List recipes, String title, Player player) { + this(recipes, title, player, false); + } + public CraftingDisplay(List recipes, String title, Player player, boolean isPersonal) { - for(Recipe recipe: recipes) + for (Recipe recipe : recipes) recipe.checkCanCraft(player); this.player = player; this.title = title; @@ -59,10 +62,10 @@ private void refreshDisplayRecipes() { List recipes = availableRecipes.stream().filter(unlockedRecipes::contains).collect(Collectors.toList()); recipeMenu = new RecipeMenu(recipes, title, player); this.recipes = recipes.toArray(new Recipe[0]); - itemCountMenu.setPositioning(new Point(recipeMenu.getBounds().getRight()+MinicraftImage.boxWidth, recipeMenu.getBounds().getTop()), RelPos.BOTTOM_RIGHT); + itemCountMenu.setPositioning(new Point(recipeMenu.getBounds().getRight() + MinicraftImage.boxWidth, recipeMenu.getBounds().getTop()), RelPos.BOTTOM_RIGHT); costsMenu.setPositioning(new Point(itemCountMenu.createMenu().getBounds().getLeft(), recipeMenu.getBounds().getBottom()), RelPos.TOP_RIGHT); - menus = new Menu[] {recipeMenu, itemCountMenu.createMenu(), costsMenu.createMenu()}; + menus = new Menu[]{recipeMenu, itemCountMenu.createMenu(), costsMenu.createMenu()}; refreshData(); onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); @@ -94,7 +97,7 @@ private ItemListing[] getCurItemCosts() { if (recipes.length == 0) return new ItemListing[0]; Map costMap = recipes[recipeMenu.getSelection()].getCosts(); - for(String itemName: costMap.keySet()) { + for (String itemName : costMap.keySet()) { Item cost = Items.get(itemName); costList.add(new ItemListing(cost, player.getInventory().count(cost) + "/" + costMap.get(itemName))); } @@ -160,12 +163,12 @@ public void tick(InputHandler input) { if (recipes.length == 0) return; Recipe selectedRecipe = recipes[recipeMenu.getSelection()]; if (selectedRecipe.getCanCraft()) { - if (selectedRecipe.getProduct().equals(Items.get("Workbench"))){ - AchievementsDisplay.setAchievement("minicraft.achievement.benchmarking",true); - } else if (selectedRecipe.getProduct().equals(Items.get("Plank"))){ - AchievementsDisplay.setAchievement("minicraft.achievement.planks",true); - } else if (selectedRecipe.getProduct().equals(Items.get("Wood Door"))){ - AchievementsDisplay.setAchievement("minicraft.achievement.doors",true); + if (selectedRecipe.getProduct().equals(Items.get("Workbench"))) { + AchievementsDisplay.setAchievement("minicraft.achievement.benchmarking", true); + } else if (selectedRecipe.getProduct().equals(Items.get("Plank"))) { + AchievementsDisplay.setAchievement("minicraft.achievement.planks", true); + } else if (selectedRecipe.getProduct().equals(Items.get("Wood Door"))) { + AchievementsDisplay.setAchievement("minicraft.achievement.doors", true); } else if (selectedRecipe.getProduct().equals(Items.get("Rock Sword")) || selectedRecipe.getProduct().equals(Items.get("Rock Pickaxe")) || selectedRecipe.getProduct().equals(Items.get("Rock Axe")) || diff --git a/src/client/java/minicraft/screen/Display.java b/src/client/java/minicraft/screen/Display.java index d02ecdc31..88ec10cf0 100644 --- a/src/client/java/minicraft/screen/Display.java +++ b/src/client/java/minicraft/screen/Display.java @@ -16,11 +16,26 @@ public class Display { private final boolean canExit, clearScreen; - public Display() { this(new Menu[0]); } - public Display(Menu... menus) { this(false, true, menus); } - public Display(boolean clearScreen) { this(clearScreen, true, new Menu[0]); } - public Display(boolean clearScreen, Menu... menus) { this(clearScreen, true, menus); } - public Display(boolean clearScreen, boolean canExit) { this(clearScreen, canExit, new Menu[0]); } + public Display() { + this(new Menu[0]); + } + + public Display(Menu... menus) { + this(false, true, menus); + } + + public Display(boolean clearScreen) { + this(clearScreen, true, new Menu[0]); + } + + public Display(boolean clearScreen, Menu... menus) { + this(clearScreen, true, menus); + } + + public Display(boolean clearScreen, boolean canExit) { + this(clearScreen, canExit, new Menu[0]); + } + public Display(boolean clearScreen, boolean canExit, Menu... menus) { this.menus = menus; this.canExit = canExit; @@ -29,7 +44,10 @@ public Display(boolean clearScreen, boolean canExit, Menu... menus) { } private boolean setParent = false; - /** Called during {@link Game#setDisplay} */ + + /** + * Called during {@link Game#setDisplay} + */ public void init(@Nullable Display parent) { if (!setParent) { setParent = true; @@ -37,9 +55,12 @@ public void init(@Nullable Display parent) { } } - public void onExit() {} + public void onExit() { + } - public Display getParent() { return parent; } + public Display getParent() { + return parent; + } public void tick(InputHandler input) { @@ -56,8 +77,8 @@ public void tick(InputHandler input) { int prevSel = selection; String shift = menus[selection].getCurEntry() instanceof ArrayEntry ? "shift-" : ""; - if (input.getMappedKey(shift+"left").isClicked() || input.leftTriggerPressed()) selection--; - if (input.getMappedKey(shift+"right").isClicked() || input.rightTriggerPressed()) selection++; + if (input.getMappedKey(shift + "left").isClicked() || input.leftTriggerPressed()) selection--; + if (input.getMappedKey(shift + "right").isClicked() || input.rightTriggerPressed()) selection++; if (prevSel != selection) { Sound.play("select"); @@ -68,7 +89,7 @@ public void tick(InputHandler input) { selection += delta; if (selection < 0) selection = menus.length - 1; selection = selection % menus.length; - } while(!menus[selection].isSelectable() && selection != prevSel); + } while (!menus[selection].isSelectable() && selection != prevSel); changedSelection = prevSel != selection; } @@ -100,7 +121,7 @@ else if (setParent && parent != null) { do { idx++; idx = idx % menus.length; - if(menus[idx].shouldRender()) + if (menus[idx].shouldRender()) menus[idx].render(screen); } while (idx != selection); } diff --git a/src/client/java/minicraft/screen/EndGameDisplay.java b/src/client/java/minicraft/screen/EndGameDisplay.java index d1edc8972..61105f538 100644 --- a/src/client/java/minicraft/screen/EndGameDisplay.java +++ b/src/client/java/minicraft/screen/EndGameDisplay.java @@ -30,7 +30,7 @@ public class EndGameDisplay extends Display { static { int maxLength = 0; - for (String s: scoredItems) + for (String s : scoredItems) maxLength = Math.max(maxLength, s.length()); } @@ -38,7 +38,7 @@ public EndGameDisplay() { super(false, false); displayTimer = Updater.normSpeed; // wait 3 seconds before rendering the menu. - inputDelay = Updater.normSpeed/2; // wait a half-second after rendering before allowing user input. + inputDelay = Updater.normSpeed / 2; // wait a half-second after rendering before allowing user input. ArrayList entries = new ArrayList<>(); @@ -48,7 +48,7 @@ public EndGameDisplay() { entries.add(new StringEntry("minicraft.displays.end_game.display.bonuses", Color.YELLOW)); finalScore = Game.player.getScore(); - for(String item: scoredItems) + for (String item : scoredItems) addBonus(item); entries.add(new StringEntry(Localization.getLocalized("minicraft.displays.end_game.display.final_score", finalScore))); @@ -58,7 +58,7 @@ public EndGameDisplay() { entries.add(new SelectEntry("minicraft.displays.end_game.exit", () -> Game.setDisplay(new TitleDisplay()))); - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(true, 0, RelPos.LEFT, entries).createMenu() }; } @@ -78,7 +78,7 @@ public void tick(InputHandler input) { @Override public void render(Screen screen) { - if(displayTimer <= 0) + if (displayTimer <= 0) super.render(screen); } diff --git a/src/client/java/minicraft/screen/InfoDisplay.java b/src/client/java/minicraft/screen/InfoDisplay.java index 7e1feb2c3..9d801cd77 100644 --- a/src/client/java/minicraft/screen/InfoDisplay.java +++ b/src/client/java/minicraft/screen/InfoDisplay.java @@ -19,10 +19,10 @@ public InfoDisplay() { "----------------------------", Localization.getLocalized("minicraft.displays.info.display.exit_help", Game.input.getMapping("select"), Game.input.getMapping("exit")) )) - .setTitle("minicraft.displays.info.title") - .setTitlePos(RelPos.TOP_LEFT) - .setPositioning(new Point(MinicraftImage.boxWidth, MinicraftImage.boxWidth), RelPos.BOTTOM_RIGHT) - .createMenu() + .setTitle("minicraft.displays.info.title") + .setTitlePos(RelPos.TOP_LEFT) + .setPositioning(new Point(MinicraftImage.boxWidth, MinicraftImage.boxWidth), RelPos.BOTTOM_RIGHT) + .createMenu() ); } diff --git a/src/client/java/minicraft/screen/InventoryMenu.java b/src/client/java/minicraft/screen/InventoryMenu.java index 21bb8df9f..b924b9879 100644 --- a/src/client/java/minicraft/screen/InventoryMenu.java +++ b/src/client/java/minicraft/screen/InventoryMenu.java @@ -32,17 +32,17 @@ public void tick(InputHandler input) { boolean dropOne = input.inputPressed("drop-one"); - if(getNumOptions() > 0 && (dropOne || input.inputPressed("drop-stack"))) { - ItemEntry entry = ((ItemEntry)getCurEntry()); - if(entry == null) return; + if (getNumOptions() > 0 && (dropOne || input.inputPressed("drop-stack"))) { + ItemEntry entry = ((ItemEntry) getCurEntry()); + if (entry == null) return; Item invItem = entry.getItem(); Item drop = invItem.copy(); if (!creativeInv) { - if (dropOne && drop instanceof StackableItem && ((StackableItem)drop).count > 1) { + if (dropOne && drop instanceof StackableItem && ((StackableItem) drop).count > 1) { // just drop one from the stack - ((StackableItem)drop).count = 1; - ((StackableItem)invItem).count--; + ((StackableItem) drop).count = 1; + ((StackableItem) invItem).count--; } else { // drop the whole item. removeSelectedEntry(); diff --git a/src/client/java/minicraft/screen/ItemListMenu.java b/src/client/java/minicraft/screen/ItemListMenu.java index 6fea47075..2b7c96df9 100644 --- a/src/client/java/minicraft/screen/ItemListMenu.java +++ b/src/client/java/minicraft/screen/ItemListMenu.java @@ -5,7 +5,10 @@ class ItemListMenu extends Menu { - static Builder getBuilder() { return getBuilder(RelPos.LEFT); } + static Builder getBuilder() { + return getBuilder(RelPos.LEFT); + } + static Builder getBuilder(RelPos entryPos) { return new Builder(true, 0, entryPos) .setPositioning(new Point(9, 9), RelPos.BOTTOM_RIGHT) diff --git a/src/client/java/minicraft/screen/KeyInputDisplay.java b/src/client/java/minicraft/screen/KeyInputDisplay.java index 59759f9a8..f3c68612b 100644 --- a/src/client/java/minicraft/screen/KeyInputDisplay.java +++ b/src/client/java/minicraft/screen/KeyInputDisplay.java @@ -48,9 +48,9 @@ public KeyInputDisplay() { super(true); builder = new Menu.Builder(false, 0, RelPos.CENTER, getEntries()) .setTitle("minicraft.displays.key_input.title") - .setPositioning(new Point(Screen.w/2, Screen.h - Font.textHeight()*5), RelPos.TOP); + .setPositioning(new Point(Screen.w / 2, Screen.h - Font.textHeight() * 5), RelPos.TOP); - menus = new Menu[] { + menus = new Menu[]{ builder.createMenu() }; } @@ -103,7 +103,7 @@ public void render(Screen screen) { Localization.getLocalized("minicraft.displays.key_input.display.help.3", Game.input.getMapping("exit")) }; - for(int i = 0; i < lines.length; i++) - Font.drawCentered(lines[i], screen, Screen.h-Font.textHeight()*(4-i), Color.WHITE); + for (int i = 0; i < lines.length; i++) + Font.drawCentered(lines[i], screen, Screen.h - Font.textHeight() * (4 - i), Color.WHITE); } } diff --git a/src/client/java/minicraft/screen/LanguageSettingsDisplay.java b/src/client/java/minicraft/screen/LanguageSettingsDisplay.java index 90e9ec81f..44e06949d 100644 --- a/src/client/java/minicraft/screen/LanguageSettingsDisplay.java +++ b/src/client/java/minicraft/screen/LanguageSettingsDisplay.java @@ -14,7 +14,7 @@ import java.util.Map; public class LanguageSettingsDisplay extends Display { - private Map.Entry ,Integer> getEntries() { + private Map.Entry, Integer> getEntries() { Localization.LocaleInformation[] locales = Localization.getLocales(); ArrayList list = new ArrayList<>(Arrays.asList(locales)); list.sort((a, b) -> { // Debug language is always on top. @@ -44,12 +44,12 @@ public int getColor(boolean isSelected) { public LanguageSettingsDisplay() { super(true); - Map.Entry ,Integer> entries = getEntries(); - menus = new Menu[] { + Map.Entry, Integer> entries = getEntries(); + menus = new Menu[]{ new Menu.Builder(false, 2, RelPos.CENTER, entries.getKey()) .setTitle("minicraft.displays.language_settings.title") .setSelectable(true) - .setPositioning(new Point(Screen.w/2, 10), RelPos.BOTTOM) + .setPositioning(new Point(Screen.w / 2, 10), RelPos.BOTTOM) .setSize(Screen.w, Screen.h - 30) .setSelection(entries.getValue()) .createMenu() diff --git a/src/client/java/minicraft/screen/LevelTransitionDisplay.java b/src/client/java/minicraft/screen/LevelTransitionDisplay.java index 7681c5141..6f8a3a970 100644 --- a/src/client/java/minicraft/screen/LevelTransitionDisplay.java +++ b/src/client/java/minicraft/screen/LevelTransitionDisplay.java @@ -17,24 +17,26 @@ public class LevelTransitionDisplay extends Display { private LinkedSprite hudSheet = new LinkedSprite(SpriteType.Gui, "hud"); public LevelTransitionDisplay(int dir) { - super(false,false); + super(false, false); this.dir = dir; } @Override public void tick(InputHandler input) { time++; // Ticks up 2 times per tick - if (time == DURATION/2) World.changeLevel(dir); // When time equals 30, it will change the level + if (time == DURATION / 2) World.changeLevel(dir); // When time equals 30, it will change the level if (time == DURATION) Game.setDisplay(null); // When time equals 60, it will get out of this menu } public void render(Screen screen) { for (int x = 0; x < 200; x++) { // Loop however many times depending on the width (It's divided by 3 because the pixels are scaled up by 3) for (int y = 0; y < 150; y++) { // Loop however many times depending on the height (It's divided by 3 because the pixels are scaled up by 3) - int dd = (y + x % 2 * 2 + x / 3) - time*2; // Used as part of the positioning. + int dd = (y + x % 2 * 2 + x / 3) - time * 2; // Used as part of the positioning. if (dd < 0 && dd > -30) { - if (dir > 0) screen.render(x * 8, y * 8, 5, 2, 0, hudSheet.getSheet()); // If the direction is upwards then render the squares going up - else screen.render(x * 8, Screen.h - y * 8 - 8, 5, 2, 0, hudSheet.getSheet()); // If the direction is negative, then the squares will go down. + if (dir > 0) + screen.render(x * 8, y * 8, 5, 2, 0, hudSheet.getSheet()); // If the direction is upwards then render the squares going up + else + screen.render(x * 8, Screen.h - y * 8 - 8, 5, 2, 0, hudSheet.getSheet()); // If the direction is negative, then the squares will go down. } } } diff --git a/src/client/java/minicraft/screen/LoadingDisplay.java b/src/client/java/minicraft/screen/LoadingDisplay.java index 62c2e20d6..6315ace84 100644 --- a/src/client/java/minicraft/screen/LoadingDisplay.java +++ b/src/client/java/minicraft/screen/LoadingDisplay.java @@ -70,8 +70,14 @@ public void onExit() { public static void setPercentage(float percent) { percentage = percent; } - public static float getPercentage() { return percentage; } - public static void setMessage(String progressType) { LoadingDisplay.progressType = progressType; } + + public static float getPercentage() { + return percentage; + } + + public static void setMessage(String progressType) { + LoadingDisplay.progressType = progressType; + } public static void progress(float amt) { percentage = Math.min(100, percentage + amt); diff --git a/src/client/java/minicraft/screen/Menu.java b/src/client/java/minicraft/screen/Menu.java index 50701ec62..ca402bc4a 100644 --- a/src/client/java/minicraft/screen/Menu.java +++ b/src/client/java/minicraft/screen/Menu.java @@ -70,7 +70,9 @@ public class Menu { private LinkedSprite hudSheet = new LinkedSprite(SpriteType.Gui, "hud"); - private Menu() {} + private Menu() { + } + protected Menu(Menu m) { entries.addAll(m.entries); spacing = m.spacing; @@ -100,17 +102,17 @@ protected Menu(Menu m) { public void init() { - if(entries.size() == 0) { + if (entries.size() == 0) { selection = 0; dispSelection = 0; offset = 0; return; } - selection = Math.min(selection, entries.size()-1); + selection = Math.min(selection, entries.size() - 1); selection = Math.max(0, selection); - if(!entries.get(selection).isSelectable()) { + if (!entries.get(selection).isSelectable()) { int prevSel = selection; do { selection++; @@ -120,46 +122,76 @@ public void init() { } dispSelection = selection; - dispSelection = Math.min(dispSelection, displayLength-1); + dispSelection = Math.min(dispSelection, displayLength - 1); dispSelection = Math.max(0, dispSelection); doScroll(); } void setSelection(int idx) { - if(idx >= entries.size()) + if (idx >= entries.size()) idx = entries.size() - 1; - if(idx < 0) idx = 0; + if (idx < 0) idx = 0; this.selection = idx; doScroll(); } - int getSelection() { return selection; } - int getDispSelection() { return dispSelection; } - ListEntry[] getEntries() { return entries.toArray(new ListEntry[0]); } + int getSelection() { + return selection; + } + + int getDispSelection() { + return dispSelection; + } + + ListEntry[] getEntries() { + return entries.toArray(new ListEntry[0]); + } + protected void setEntries(ListEntry[] entries) { this.entries.clear(); this.entries.addAll(0, Arrays.asList(entries)); } + protected void setEntries(List entries) { this.entries.clear(); this.entries.addAll(entries); } - @Nullable ListEntry getCurEntry() { return entries.size() == 0 ? null : entries.get(selection); } - int getNumOptions() { return entries.size(); } - Rectangle getBounds() { return new Rectangle(bounds); } - String getTitle() { return title; } + @Nullable ListEntry getCurEntry() { + return entries.size() == 0 ? null : entries.get(selection); + } + + int getNumOptions() { + return entries.size(); + } + + Rectangle getBounds() { + return new Rectangle(bounds); + } + + String getTitle() { + return title; + } - boolean isSelectable() { return selectable; } - boolean shouldRender() { return shouldRender; } + boolean isSelectable() { + return selectable; + } - public boolean isSearcherBarActive() { return searcherBarActive; } + boolean shouldRender() { + return shouldRender; + } - /** @noinspection SameParameterValue*/ + public boolean isSearcherBarActive() { + return searcherBarActive; + } + + /** + * @noinspection SameParameterValue + */ void translate(int xoff, int yoff) { bounds.translate(xoff, yoff); entryBounds.translate(xoff, yoff); @@ -167,7 +199,7 @@ void translate(int xoff, int yoff) { } public void tick(InputHandler input) { - if(!selectable || entries.size() == 0) return; + if (!selectable || entries.size() == 0) return; int prevSel = selection; if (input.inputPressed("cursor-up")) selection--; @@ -238,7 +270,7 @@ public void tick(InputHandler input) { int delta = selection - prevSel; selection = prevSel; - if(delta == 0) { + if (delta == 0) { entries.get(selection).tick(input); // only ticks the entry on a frame where the selection cursor has not moved. return; } else @@ -248,13 +280,13 @@ public void tick(InputHandler input) { selection += delta; if (selection < 0) selection = entries.size() - 1; selection = selection % entries.size(); - } while(!entries.get(selection).isSelectable() && selection != prevSel); + } while (!entries.get(selection).isSelectable() && selection != prevSel); // update offset and selection displayed dispSelection += selection - prevSel; - if(dispSelection < 0) dispSelection = 0; - if(dispSelection >= displayLength) dispSelection = displayLength - 1; + if (dispSelection < 0) dispSelection = 0; + if (dispSelection >= displayLength) dispSelection = displayLength - 1; doScroll(); } @@ -266,20 +298,20 @@ private void doScroll() { int offset = this.offset; // for scrolling up - while((dispSelection < padding || !wrap && offset + displayLength > entries.size()) && (wrap || offset > 0)) { + while ((dispSelection < padding || !wrap && offset + displayLength > entries.size()) && (wrap || offset > 0)) { offset--; dispSelection++; } // for scrolling down - while((displayLength - dispSelection <= padding || !wrap && offset < 0) && (wrap || offset + displayLength < entries.size())) { + while ((displayLength - dispSelection <= padding || !wrap && offset < 0) && (wrap || offset + displayLength < entries.size())) { offset++; dispSelection--; } // only useful when wrap is true - if(offset < 0) offset += entries.size(); - if(offset > 0) offset = offset % entries.size(); + if (offset < 0) offset += entries.size(); + if (offset > 0) offset = offset % entries.size(); this.offset = offset; } @@ -288,15 +320,17 @@ public void render(Screen screen) { renderFrame(screen); // render the title - if(title.length() > 0) { + if (title.length() > 0) { if (drawVertically) { for (int i = 0; i < title.length(); i++) { - if (hasFrame) screen.render(titleLoc.x, titleLoc.y + i * Font.textHeight(), 3, 6, 0, hudSheet.getSheet()); + if (hasFrame) + screen.render(titleLoc.x, titleLoc.y + i * Font.textHeight(), 3, 6, 0, hudSheet.getSheet()); Font.draw(title.substring(i, i + 1), screen, titleLoc.x, titleLoc.y + i * Font.textHeight(), titleColor); } } else { for (int i = 0; i < title.length(); i++) { - if (hasFrame) screen.render(titleLoc.x + i * Font.textWidth(" "), titleLoc.y, 3, 6, 0, hudSheet.getSheet()); + if (hasFrame) + screen.render(titleLoc.x + i * Font.textWidth(" "), titleLoc.y, 3, 6, 0, hudSheet.getSheet()); Font.draw(title.substring(i, i + 1), screen, titleLoc.x + i * Font.textWidth(" "), titleLoc.y, titleColor); } } @@ -325,18 +359,18 @@ public void render(Screen screen) { // render the options int y = entryBounds.getTop(); boolean special = wrap && entries.size() < displayLength; - if(special) { + if (special) { int diff = displayLength - entries.size(); // we have to account for this many entry heights. - int extra = diff*(ListEntry.getHeight() + spacing) / 2; + int extra = diff * (ListEntry.getHeight() + spacing) / 2; y += extra; } - for(int i = offset; i < (wrap ? offset + displayLength : Math.min(offset + displayLength, entries.size())); i++) { - if(special && i-offset >= entries.size()) break; + for (int i = offset; i < (wrap ? offset + displayLength : Math.min(offset + displayLength, entries.size())); i++) { + if (special && i - offset >= entries.size()) break; int idx = i % entries.size(); ListEntry entry = entries.get(idx); - if(!(entry instanceof BlankEntry)) { + if (!(entry instanceof BlankEntry)) { Point pos = entryPos.positionRect(new Dimension(entry.getWidth(), ListEntry.getHeight()), new Rectangle(entryBounds.getLeft(), y, entryBounds.getWidth(), ListEntry.getHeight(), Rectangle.CORNER_DIMS)); boolean selected = idx == selection; if (searcherBarActive && useSearcherBar) { @@ -355,18 +389,21 @@ public void render(Screen screen) { } } - void updateSelectedEntry(ListEntry newEntry) { updateEntry(selection, newEntry); } + void updateSelectedEntry(ListEntry newEntry) { + updateEntry(selection, newEntry); + } + void updateEntry(int idx, ListEntry newEntry) { - if(idx >= 0 && idx < entries.size()) + if (idx >= 0 && idx < entries.size()) entries.set(idx, newEntry); } public void removeSelectedEntry() { entries.remove(selection); - if(selection >= entries.size()) + if (selection >= entries.size()) selection = entries.size() - 1; - if(selection < 0) + if (selection < 0) selection = 0; doScroll(); @@ -377,10 +414,10 @@ public void setColors(Menu model) { } private void renderFrame(Screen screen) { - if(!hasFrame) return; + if (!hasFrame) return; - int bottom = bounds.getBottom()-MinicraftImage.boxWidth; - int right = bounds.getRight()-MinicraftImage.boxWidth; + int bottom = bounds.getBottom() - MinicraftImage.boxWidth; + int right = bounds.getRight() - MinicraftImage.boxWidth; for (int y = bounds.getTop(); y <= bottom; y += MinicraftImage.boxWidth) { // loop through the height of the bounds for (int x = bounds.getLeft(); x <= right; x += MinicraftImage.boxWidth) { // loop through the width of the bounds @@ -388,42 +425,47 @@ private void renderFrame(Screen screen) { boolean xend = x == bounds.getLeft() || x == right; boolean yend = y == bounds.getTop() || y == bottom; int spriteoffset = (xend && yend ? 0 : (yend ? 1 : (xend ? 2 : 3))); // determines which sprite to use - int mirrors = ( x == right ? 1 : 0 ) + ( y == bottom ? 2 : 0 ); // gets mirroring + int mirrors = (x == right ? 1 : 0) + (y == bottom ? 2 : 0); // gets mirroring screen.render(x, y, spriteoffset, 6, mirrors, hudSheet.getSheet()); - if(x < right && x + MinicraftImage.boxWidth > right) + if (x < right && x + MinicraftImage.boxWidth > right) x = right - MinicraftImage.boxWidth; } - if(y < bottom && y + MinicraftImage.boxWidth > bottom) + if (y < bottom && y + MinicraftImage.boxWidth > bottom) y = bottom - MinicraftImage.boxWidth; } } - // This needs to be in the Menu class, to have access to the private constructor and fields. public static class Builder { - private static final Point center = new Point(Screen.w/2, Screen.h/2); + private static final Point center = new Point(Screen.w / 2, Screen.h / 2); private Menu menu; private boolean setSelectable = false; private float padding = 1; - @NotNull private RelPos titlePos = RelPos.TOP; + @NotNull + private RelPos titlePos = RelPos.TOP; private boolean fullTitleColor = false, setTitleColor = false; private int titleCol = Color.YELLOW; - @NotNull private Point anchor = center; - @NotNull private RelPos menuPos = RelPos.CENTER; + @NotNull + private Point anchor = center; + @NotNull + private RelPos menuPos = RelPos.CENTER; private Dimension menuSize = null; private boolean searcherBar; - public Builder(boolean hasFrame, int entrySpacing, RelPos entryPos, ListEntry... entries) { this(hasFrame, entrySpacing, entryPos, Arrays.asList(entries)); } + public Builder(boolean hasFrame, int entrySpacing, RelPos entryPos, ListEntry... entries) { + this(hasFrame, entrySpacing, entryPos, Arrays.asList(entries)); + } + public Builder(boolean hasFrame, int entrySpacing, RelPos entryPos, List entries) { menu = new Menu(); setEntries(entries); @@ -432,7 +474,10 @@ public Builder(boolean hasFrame, int entrySpacing, RelPos entryPos, List entries) { menu.entries.clear(); menu.entries.addAll(entries); @@ -445,8 +490,15 @@ public Builder setPositioning(Point anchor, RelPos menuPos) { return this; } - public Builder setSize(int width, int height) { menuSize = new Dimension(width, height); return this; } - public Builder setMenuSize(Dimension d) { menuSize = d; return this; } // can be used to set the size to null + public Builder setSize(int width, int height) { + menuSize = new Dimension(width, height); + return this; + } + + public Builder setMenuSize(Dimension d) { + menuSize = d; + return this; + } // can be used to set the size to null public Builder setBounds(Rectangle rect) { menuSize = rect.getSize(); @@ -454,20 +506,32 @@ public Builder setBounds(Rectangle rect) { return this; } - public Builder setDisplayLength(int numEntries) { menu.displayLength = numEntries; return this; } + public Builder setDisplayLength(int numEntries) { + menu.displayLength = numEntries; + return this; + } + + public Builder setTitlePos(RelPos rp) { + titlePos = (rp == null ? RelPos.TOP : rp); + return this; + } - public Builder setTitlePos(RelPos rp) { titlePos = (rp == null ? RelPos.TOP : rp); return this; } + public Builder setTitle(String title) { + menu.title = title; + return this; + } - public Builder setTitle(String title) { menu.title = title; return this; } + public Builder setTitle(String title, int color) { + return setTitle(title, color, false); + } - public Builder setTitle(String title, int color) { return setTitle(title, color, false); } public Builder setTitle(String title, int color, boolean fullColor) { menu.title = title; fullTitleColor = fullColor; setTitleColor = true; - if(fullColor) // this means that the color is the full 4 parts, abcd. Otherwise, it is assumed it is only the main component, the one that matters. + if (fullColor) // this means that the color is the full 4 parts, abcd. Otherwise, it is assumed it is only the main component, the one that matters. menu.titleColor = color; else titleCol = color; @@ -475,7 +539,10 @@ public Builder setTitle(String title, int color, boolean fullColor) { return this; } - public Builder setFrame(boolean hasFrame) { menu.hasFrame = hasFrame; return this; } + public Builder setFrame(boolean hasFrame) { + menu.hasFrame = hasFrame; + return this; + } public Builder setScrollPolicies(float padding, boolean wrap) { @@ -484,7 +551,10 @@ public Builder setScrollPolicies(float padding, boolean wrap) { return this; } - public Builder setShouldRender(boolean render) { menu.shouldRender = render; return this; } + public Builder setShouldRender(boolean render) { + menu.shouldRender = render; + return this; + } public Builder setSelectable(boolean selectable) { setSelectable = true; @@ -492,7 +562,11 @@ public Builder setSelectable(boolean selectable) { return this; } - public Builder setSelection(int sel) { menu.selection = sel; return this; } + public Builder setSelection(int sel) { + menu.selection = sel; + return this; + } + public Builder setSelection(int sel, int dispSel) { menu.selection = sel; menu.dispSelection = dispSel; @@ -509,17 +583,18 @@ public Menu createMenu() { // this way, I don't have to reference all the variables to a different var. return copy().createMenu(this); } + private Menu createMenu(Builder b) { - if(b == this) + if (b == this) return copy().createMenu(this); menu.title = Localization.getLocalized(menu.title); // set default selectability - if(!setSelectable) { - for(ListEntry entry: menu.entries) { + if (!setSelectable) { + for (ListEntry entry : menu.entries) { menu.selectable = menu.selectable || entry.isSelectable(); - if(menu.selectable) + if (menu.selectable) break; } } @@ -529,8 +604,8 @@ private Menu createMenu(Builder b) { menu.drawVertically = titlePos == RelPos.LEFT || titlePos == RelPos.RIGHT; Dimension titleDim = menu.drawVertically ? - new Dimension(Font.textHeight()*2, Font.textWidth(menu.title)) : - new Dimension(Font.textWidth(menu.title), Font.textHeight()*2); + new Dimension(Font.textHeight() * 2, Font.textWidth(menu.title)) : + new Dimension(Font.textWidth(menu.title), Font.textHeight() * 2); // find the area used by the title and/or frame, that can't be used by the entries @@ -547,7 +622,7 @@ private Menu createMenu(Builder b) { */ Insets border; - if(menu.hasFrame) + if (menu.hasFrame) border = new Insets(MinicraftImage.boxWidth); // add frame insets else { border = new Insets(); @@ -567,39 +642,38 @@ else if (c.xIndex == 2) // must be center right } } - if(menu.isSelectable()) { + if (menu.isSelectable()) { // add spacing for selection cursors border.left += MinicraftImage.boxWidth * 2; border.right += MinicraftImage.boxWidth * 2; } - if(menu.wrap && menu.displayLength > 0) + if (menu.wrap && menu.displayLength > 0) menu.displayLength = Math.min(menu.displayLength, menu.entries.size()); // I have anchor and menu's relative position to it, and may or may not have size. Dimension entrySize; - if(menuSize == null) { + if (menuSize == null) { int width = titleDim.width; - for(ListEntry entry: menu.entries) { + for (ListEntry entry : menu.entries) { int entryWidth = entry.getWidth(); - if(menu.isSelectable() && !entry.isSelectable()) + if (menu.isSelectable() && !entry.isSelectable()) entryWidth = Math.max(0, entryWidth - MinicraftImage.boxWidth * 4); width = Math.max(width, entryWidth); } - if(menu.displayLength > 0) { // has been set; use to determine entry bounds + if (menu.displayLength > 0) { // has been set; use to determine entry bounds int height = (ListEntry.getHeight() + menu.spacing) * menu.displayLength - menu.spacing; entrySize = new Dimension(width, height); - } - else { + } else { // no set size; just keep going to the edges of the screen int maxHeight; - if(menuPos.yIndex == 0) // anchor is lowest down coordinate (highest y value) + if (menuPos.yIndex == 0) // anchor is lowest down coordinate (highest y value) maxHeight = anchor.y; - else if(menuPos.yIndex == 2) + else if (menuPos.yIndex == 2) maxHeight = Screen.h - anchor.y; else // is centered; take the lowest value of the other two, and double it maxHeight = Math.min(anchor.y, Screen.h - anchor.y) * 2; @@ -614,13 +688,12 @@ else if(menuPos.yIndex == 2) } menuSize = border.addTo(entrySize); - } - else // menuSize was set manually + } else // menuSize was set manually entrySize = border.subtractFrom(menuSize); // set default max display length (needs size first) - if(menu.displayLength <= 0 && menu.entries.size() > 0) + if (menu.displayLength <= 0 && menu.entries.size() > 0) menu.displayLength = (entrySize.height + menu.spacing) / (ListEntry.getHeight() + menu.spacing); // based on the menu centering, and the anchor, determine the upper-left point from which to draw the menu. @@ -630,14 +703,14 @@ else if(menuPos.yIndex == 2) menu.titleLoc = titlePos.positionRect(titleDim, menu.bounds); - if(titlePos.xIndex == 0 && titlePos.yIndex != 1) + if (titlePos.xIndex == 0 && titlePos.yIndex != 1) menu.titleLoc.x += MinicraftImage.boxWidth; - if(titlePos.xIndex == 2 && titlePos.yIndex != 1) + if (titlePos.xIndex == 2 && titlePos.yIndex != 1) menu.titleLoc.x -= MinicraftImage.boxWidth; // set the menu title color - if(menu.title.length() > 0) { - if(fullTitleColor) + if (menu.title.length() > 0) { + if (fullTitleColor) menu.titleColor = titleCol; else { if (!setTitleColor) titleCol = menu.hasFrame ? Color.YELLOW : Color.WHITE; @@ -645,9 +718,9 @@ else if(menuPos.yIndex == 2) } } - if(padding < 0) padding = 0; - if(padding > 1) padding = 1; - menu.padding = (int)Math.floor(padding * menu.displayLength / 2); + if (padding < 0) padding = 0; + if (padding > 1) padding = 1; + menu.padding = (int) Math.floor(padding * menu.displayLength / 2); menu.useSearcherBar = searcherBar; @@ -679,6 +752,6 @@ public Builder copy() { } public String toString() { - return title+"-Menu["+bounds+"]"; + return title + "-Menu[" + bounds + "]"; } } diff --git a/src/client/java/minicraft/screen/MultiplayerDisplay.java b/src/client/java/minicraft/screen/MultiplayerDisplay.java index c130957f8..3a2a1c68c 100644 --- a/src/client/java/minicraft/screen/MultiplayerDisplay.java +++ b/src/client/java/minicraft/screen/MultiplayerDisplay.java @@ -18,12 +18,14 @@ import minicraft.network.Analytics; import minicraft.util.Logging; -/** @deprecated As multiplayer mode removed. This class is not localized. */ +/** + * @deprecated As multiplayer mode removed. This class is not localized. + */ @Deprecated public class MultiplayerDisplay extends Display { private static final String domain = "https://playminicraft.com"; - private static final String apiDomain = domain+"/api"; + private static final String apiDomain = domain + "/api"; public static String savedIP = ""; public static String savedUUID = ""; @@ -48,15 +50,19 @@ private enum State { private State curState; - public MultiplayerDisplay() { this(true); } + public MultiplayerDisplay() { + this(true); + } + public MultiplayerDisplay(boolean pingSite) { - if(savedUUID == null) savedUUID = ""; - if(email == null) email = ""; - if(savedUsername == null) savedUsername = ""; + if (savedUUID == null) savedUUID = ""; + if (email == null) email = ""; + if (savedUsername == null) savedUsername = ""; - if(pingSite) - contactAccountServer(() -> {}); + if (pingSite) + contactAccountServer(() -> { + }); } private void contactAccountServer(Action sitePingCallback) { @@ -65,23 +71,23 @@ private void contactAccountServer(Action sitePingCallback) { Unirest.get(domain).asEmptyAsync(new Callback() { @Override public void completed(HttpResponse response) { - if(response.getStatus() == 200) + if (response.getStatus() == 200) online = true; else System.err.println("Warning: Minicraft site ping returned status code " + response.getStatus()); - if(savedUUID.length() > 0) { + if (savedUUID.length() > 0) { setWaitMessage("attempting log in"); fetchName(savedUUID); } - if(curState == State.ERROR) + if (curState == State.ERROR) return; // at this point, the game is online, and either the player could log in automatically, or has to enter their // email and password. - if(savedUsername.length() == 0 || savedUUID.length() == 0) + if (savedUsername.length() == 0 || savedUUID.length() == 0) curState = State.LOGIN; // the player must log in manually. else { typing = savedIP; @@ -93,8 +99,8 @@ public void completed(HttpResponse response) { @Override public void failed(UnirestException e) { - System.err.println("Website ping failed: "+e.getMessage()); - if(!e.getMessage().equalsIgnoreCase("connection reset by peer")) + System.err.println("Website ping failed: " + e.getMessage()); + if (!e.getMessage().equalsIgnoreCase("connection reset by peer")) e.printStackTrace(); cancelled(); } @@ -102,7 +108,7 @@ public void failed(UnirestException e) { @Override public void cancelled() { System.err.println("Website ping cancelled."); - if(savedUsername.length() == 0 || savedUUID.length() == 0) { + if (savedUsername.length() == 0 || savedUUID.length() == 0) { // couldn't validate username, and can't enter offline mode b/c there is no username setError("could not connect to playminicraft account server, but no login data saved; cannot enter offline mode.", false); return; @@ -117,7 +123,8 @@ public void cancelled() { } @Override - public void tick(InputHandler input) {} + public void tick(InputHandler input) { + } private void fetchName(String uuid) { Analytics.LoginAttempt.ping(); @@ -125,16 +132,16 @@ private void fetchName(String uuid) { HttpResponse response = null; try { - response = Unirest.post(apiDomain+"/fetch-name") - .field("uuid", savedUUID) - .asJson(); + response = Unirest.post(apiDomain + "/fetch-name") + .field("uuid", savedUUID) + .asJson(); } catch (UnirestException e) { e.printStackTrace(); } - if(response != null) { + if (response != null) { kong.unirest.json.JSONObject json = response.getBody().getObject(); - switch(json.getString("status")) { + switch (json.getString("status")) { case "error": setError("problem with saved login data; please exit and login again.", false); savedUUID = ""; @@ -161,9 +168,12 @@ public void setLoadingMessage(String msg) { loadingMessage = msg; } - public void setError(String msg) { setError(msg, true); } + public void setError(String msg) { + setError(msg, true); + } + private void setError(String msg, boolean overrideMenu) { - if(curState == State.ERROR) return; // keep original message + if (curState == State.ERROR) return; // keep original message this.curState = State.ERROR; errorMessage = msg; } @@ -172,31 +182,31 @@ private void setError(String msg, boolean overrideMenu) { public void render(Screen screen) { screen.clear(0); - switch(curState) { + switch (curState) { case ENTERIP: Font.drawCentered("Logged in as: " + savedUsername, screen, 6, Color.get(1, 102, 255, 102)); - if(!online) - Font.drawCentered("Offline mode: local servers only", screen, Screen.h/2 - Font.textHeight()*6, Color.get(1, 153, 153, 255)); + if (!online) + Font.drawCentered("Offline mode: local servers only", screen, Screen.h / 2 - Font.textHeight() * 6, Color.get(1, 153, 153, 255)); - Font.drawCentered("Enter ip address to connect to:", screen, Screen.h/2-Font.textHeight()*2-2, Color.get(1, 255)); - Font.drawCentered(typing, screen, Screen.h/2-Font.textHeight(), Color.get(1, 255, 255, 102)); + Font.drawCentered("Enter ip address to connect to:", screen, Screen.h / 2 - Font.textHeight() * 2 - 2, Color.get(1, 255)); + Font.drawCentered(typing, screen, Screen.h / 2 - Font.textHeight(), Color.get(1, 255, 255, 102)); - Font.drawCentered("Press Shift-Escape to logout", screen, Screen.h-Font.textHeight()*7, Color.get(1, 204)); + Font.drawCentered("Press Shift-Escape to logout", screen, Screen.h - Font.textHeight() * 7, Color.get(1, 204)); break; case LOGIN: String msg = "Enter email:"; - if(!typingEmail) + if (!typingEmail) msg = "Enter password:"; Font.drawCentered(msg, screen, Screen.h / 2 - 6, Color.WHITE); msg = typing; - if(!typingEmail) + if (!typingEmail) //noinspection ReplaceAllDot msg = msg.replaceAll(".", "."); Font.drawCentered(msg, screen, Screen.h / 2 + 6, (inputIsValid ? Color.get(1, 204) : Color.RED)); - if(!inputIsValid) { + if (!inputIsValid) { Font.drawCentered("field is blank", screen, Screen.h / 2 + 20, Color.RED); } @@ -206,7 +216,7 @@ public void render(Screen screen) { break; case WAITING: - Font.drawCentered(waitingMessage+ ellipsis.updateAndGet(), screen, Screen.h/2, Color.WHITE); + Font.drawCentered(waitingMessage + ellipsis.updateAndGet(), screen, Screen.h / 2, Color.WHITE); break; case LOADING: @@ -216,15 +226,15 @@ public void render(Screen screen) { case ERROR: //if(Updater.tickCount % 10 == 0) System.out.println("error message: " + errorMessage); - Font.drawCentered("Could not connect to server:", screen, Screen.h/2-6, Color.RED); - FontStyle style = new FontStyle(Color.get(1, 255, 51, 51)).setYPos(Screen.h/2+6); + Font.drawCentered("Could not connect to server:", screen, Screen.h / 2 - 6, Color.RED); + FontStyle style = new FontStyle(Color.get(1, 255, 51, 51)).setYPos(Screen.h / 2 + 6); Font.drawParagraph(errorMessage, screen, style, 1); //Font.drawCentered(errorMessage, screen, Screen.h/2+6, Color.get(1, 255, 51, 51)); break; } - if(curState == State.ENTERIP || curState == State.ERROR) { - Font.drawCentered("Press "+Game.input.getMapping("exit")+" to return", screen, Screen.h-Font.textHeight()*2, Color.GRAY); + if (curState == State.ENTERIP || curState == State.ERROR) { + Font.drawCentered("Press " + Game.input.getMapping("exit") + " to return", screen, Screen.h - Font.textHeight() * 2, Color.GRAY); } } } diff --git a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java index 82deee31c..d57379621 100644 --- a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java +++ b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java @@ -33,6 +33,7 @@ public OnScreenKeyboardMenu() { /** * This checks if there is any controller connected. If true, create the instance. No otherwise. + * * @return The created menu instance. `null` if there is no controller connected. */ @Nullable @@ -191,7 +192,7 @@ public void tick(InputHandler input) throws OnScreenKeyboardMenuTickActionComple // This is only controllable by controller. if (visible) { - VirtualKey[][] keys = shiftPressed? keysB: keysF; + VirtualKey[][] keys = shiftPressed ? keysB : keysF; if (input.buttonPressed(ControllerButton.A)) { // Select keys[y][x].press(); Sound.play("select"); // Lack of sounds. @@ -245,12 +246,13 @@ public void tick(InputHandler input) throws OnScreenKeyboardMenuTickActionComple public void setVisible(boolean visible) { if (this.visible != visible) { Rectangle rec = getBounds(); - translate(0, visible? -rec.getHeight(): rec.getHeight()); + translate(0, visible ? -rec.getHeight() : rec.getHeight()); this.visible = visible; } keyPressed = 0; } + public boolean isVisible() { return visible; } @@ -281,7 +283,7 @@ public void render(Screen screen) { } final int keyHeight = 14; - VirtualKey[][] keys = shiftPressed? keysB: keysF; + VirtualKey[][] keys = shiftPressed ? keysB : keysF; for (int r = 0; r < keys.length; r++) { final int defaultKeyWidth = 16; int keyWidth = defaultKeyWidth; @@ -299,72 +301,74 @@ else if (key == shiftKey) keyWidth = defaultKeyWidth * 2; else keyWidth = defaultKeyWidth; - int color = keyPressed > 0 && r == this.y && c == this.x? 0x1EFEFF0: 0x1FDFDFD; + int color = keyPressed > 0 && r == this.y && c == this.x ? 0x1EFEFF0 : 0x1FDFDFD; if (key == backspace) { // Rendering the backspace. // Rendering the cross. - colorPixel.accept(x + 1 + keyWidth/2 + (y + keyHeight/2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 + 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 + 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + (y + keyHeight / 2) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 1 + (y + keyHeight / 2 + 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 1 + (y + keyHeight / 2 - 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 1 + (y + keyHeight / 2 - 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 1 + (y + keyHeight / 2 + 1) * Screen.w, color); // Rendering the upper base. - colorPixel.accept(x + 1 + keyWidth/2 - 3 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 2 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 2 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 3 + (y + keyHeight/2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 3 + (y + keyHeight / 2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 2 + (y + keyHeight / 2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 1 + (y + keyHeight / 2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + (y + keyHeight / 2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 1 + (y + keyHeight / 2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 2 + (y + keyHeight / 2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 3 + (y + keyHeight / 2 - 3) * Screen.w, color); // Rendering the lower base. - colorPixel.accept(x + 1 + keyWidth/2 - 3 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 2 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 1 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 1 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 2 + (y + keyHeight/2 + 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 3 + (y + keyHeight/2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 3 + (y + keyHeight / 2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 2 + (y + keyHeight / 2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 1 + (y + keyHeight / 2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + (y + keyHeight / 2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 1 + (y + keyHeight / 2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 2 + (y + keyHeight / 2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 3 + (y + keyHeight / 2 + 3) * Screen.w, color); // Rendering the left angle. - colorPixel.accept(x + 1 + keyWidth/2 - 4 + (y + keyHeight/2 - 2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 5 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 6 + (y + keyHeight/2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 5 + (y + keyHeight/2 + 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 - 4 + (y + keyHeight/2 + 2) * Screen.w, color); - - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 - 3) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 - 2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 - 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 + 1) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 + 2) * Screen.w, color); - colorPixel.accept(x + 1 + keyWidth/2 + 4 + (y + keyHeight/2 + 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 4 + (y + keyHeight / 2 - 2) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 5 + (y + keyHeight / 2 - 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 6 + (y + keyHeight / 2) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 5 + (y + keyHeight / 2 + 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 - 4 + (y + keyHeight / 2 + 2) * Screen.w, color); + + colorPixel.accept(x + 1 + keyWidth / 2 + 4 + (y + keyHeight / 2 - 3) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 4 + (y + keyHeight / 2 - 2) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 4 + (y + keyHeight / 2 - 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 4 + (y + keyHeight / 2) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 4 + (y + keyHeight / 2 + 1) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 4 + (y + keyHeight / 2 + 2) * Screen.w, color); + colorPixel.accept(x + 1 + keyWidth / 2 + 4 + (y + keyHeight / 2 + 3) * Screen.w, color); } else if (key == shiftKey) { // Rendering "SYM". - Font.draw("S", screen, x + keyWidth/2 - 3 - defaultKeyWidth/2, y + keyHeight/2 - 3, color); - Font.draw("Y", screen, x + keyWidth/2 - 3, y + keyHeight/2 - 3, color); - Font.draw("M", screen, x + keyWidth/2 - 3 + defaultKeyWidth/2, y + keyHeight/2 - 3, color); + Font.draw("S", screen, x + keyWidth / 2 - 3 - defaultKeyWidth / 2, y + keyHeight / 2 - 3, color); + Font.draw("Y", screen, x + keyWidth / 2 - 3, y + keyHeight / 2 - 3, color); + Font.draw("M", screen, x + keyWidth / 2 - 3 + defaultKeyWidth / 2, y + keyHeight / 2 - 3, color); } else if (key == spaceBar) { // Rendering "underscore". for (int i = 1; i < 19; i++) { - colorPixel.accept(x + keyWidth/2 + i - 9 + (y + keyHeight/2 + 2) * Screen.w, color); + colorPixel.accept(x + keyWidth / 2 + i - 9 + (y + keyHeight / 2 + 2) * Screen.w, color); } } else - Font.draw(String.valueOf(key.output), screen, x + keyWidth/2 - 3, y + keyHeight/2 - 3, color); + Font.draw(String.valueOf(key.output), screen, x + keyWidth / 2 - 3, y + keyHeight / 2 - 3, color); for (int i = 0; i <= keyHeight; i++) { // Rendering left and right border. colorPixel.accept(x + (y + i) * Screen.w, 0x1BCBCBC); colorPixel.accept(x + keyWidth + (y + i) * Screen.w, 0x1BCBCBC); - } for (int i = 0; i <= keyWidth; i++) { // Rendering top and bottom border. + } + for (int i = 0; i <= keyWidth; i++) { // Rendering top and bottom border. colorPixel.accept(x + i + y * Screen.w, 0x1BCBCBC); colorPixel.accept(x + i + (y + keyHeight) * Screen.w, 0x1BCBCBC); } if (this.x == c && this.y == r) { - color = keyPressed > 0? 0x1EFEFF0: 0x1DFDFE0; + color = keyPressed > 0 ? 0x1EFEFF0 : 0x1DFDFE0; for (int i = 1; i < keyHeight; i++) { // Rendering left and right border. colorPixel.accept(x + 1 + (y + i) * Screen.w, color); colorPixel.accept(x - 1 + keyWidth + (y + i) * Screen.w, color); - } for (int i = 1; i < keyWidth; i++) { // Rendering top and bottom border. + } + for (int i = 1; i < keyWidth; i++) { // Rendering top and bottom border. colorPixel.accept(x + i + (y + 1) * Screen.w, color); colorPixel.accept(x + i + (y - 1 + keyHeight) * Screen.w, color); } @@ -375,6 +379,9 @@ else if (key == shiftKey) } } - public static class OnScreenKeyboardMenuTickActionCompleted extends RuntimeException {} - public static class OnScreenKeyboardMenuBackspaceButtonActed extends RuntimeException {} + public static class OnScreenKeyboardMenuTickActionCompleted extends RuntimeException { + } + + public static class OnScreenKeyboardMenuBackspaceButtonActed extends RuntimeException { + } } diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index 6182bf3e0..696a2ae62 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -7,8 +7,8 @@ public class OptionsMainMenuDisplay extends Display { - public OptionsMainMenuDisplay() { - super(true, new Menu.Builder(false, 6, RelPos.LEFT, + public OptionsMainMenuDisplay() { + super(true, new Menu.Builder(false, 6, RelPos.LEFT, Settings.getEntry("fps"), Settings.getEntry("sound"), Settings.getEntry("showquests"), @@ -20,11 +20,11 @@ public OptionsMainMenuDisplay() { ) .setTitle("minicraft.displays.options_main_menu") .createMenu()); - } + } - @Override - public void onExit() { - new Save(); - Game.MAX_FPS = (int) Settings.get("fps"); - } + @Override + public void onExit() { + new Save(); + Game.MAX_FPS = (int) Settings.get("fps"); + } } diff --git a/src/client/java/minicraft/screen/OptionsWorldDisplay.java b/src/client/java/minicraft/screen/OptionsWorldDisplay.java index 6a71e13d6..a72fbcee7 100644 --- a/src/client/java/minicraft/screen/OptionsWorldDisplay.java +++ b/src/client/java/minicraft/screen/OptionsWorldDisplay.java @@ -34,7 +34,8 @@ public OptionsWorldDisplay() { Game.exitDisplay(); try { Thread.sleep(50); - } catch (InterruptedException ignored) {} + } catch (InterruptedException ignored) { + } Game.exitDisplay(); }); return true; @@ -49,7 +50,7 @@ public OptionsWorldDisplay() { entries.add(4, Settings.getEntry("showquests")); } - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(false, 6, RelPos.LEFT, entries) .setTitle("minicraft.displays.options_world") .createMenu() diff --git a/src/client/java/minicraft/screen/PauseDisplay.java b/src/client/java/minicraft/screen/PauseDisplay.java index 34a158d33..330a54e0a 100644 --- a/src/client/java/minicraft/screen/PauseDisplay.java +++ b/src/client/java/minicraft/screen/PauseDisplay.java @@ -21,10 +21,10 @@ public PauseDisplay() { String selectString = Localization.getLocalized("minicraft.displays.pause.display.help.choose", Game.input.getMapping("select")); ArrayList entries = new ArrayList<>(Arrays.asList( - new BlankEntry(), - new SelectEntry("minicraft.displays.pause.return", () -> Game.setDisplay(null)), - new SelectEntry("minicraft.display.options_display", () -> Game.setDisplay(new OptionsWorldDisplay())), - new SelectEntry("minicraft.displays.achievements", () -> Game.setDisplay(new AchievementsDisplay())) + new BlankEntry(), + new SelectEntry("minicraft.displays.pause.return", () -> Game.setDisplay(null)), + new SelectEntry("minicraft.display.options_display", () -> Game.setDisplay(new OptionsWorldDisplay())), + new SelectEntry("minicraft.displays.achievements", () -> Game.setDisplay(new AchievementsDisplay())) )); if (TutorialDisplayHandler.inQuests()) @@ -56,7 +56,7 @@ public PauseDisplay() { new StringEntry(selectString, Color.GRAY) )); - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(true, 4, RelPos.CENTER, entries) .setTitle("minicraft.displays.pause", Color.YELLOW) .createMenu() diff --git a/src/client/java/minicraft/screen/PlayDisplay.java b/src/client/java/minicraft/screen/PlayDisplay.java index c33e3ac0f..5b554151e 100644 --- a/src/client/java/minicraft/screen/PlayDisplay.java +++ b/src/client/java/minicraft/screen/PlayDisplay.java @@ -6,23 +6,25 @@ import minicraft.screen.entry.SelectEntry; import minicraft.screen.entry.StringEntry; -/** @deprecated This class is not used as this is replaced by an anonymous class in {@link TitleDisplay}. */ +/** + * @deprecated This class is not used as this is replaced by an anonymous class in {@link TitleDisplay}. + */ @Deprecated public class PlayDisplay extends Display { public PlayDisplay() { super(true, true, new Menu.Builder(false, 2, RelPos.CENTER, - new StringEntry("Game Mode", Color.YELLOW), - new BlankEntry(), - new BlankEntry(), - new SelectEntry("Singleplayer", () -> { - if (WorldSelectDisplay.getWorldNames().size() > 0) - Game.setDisplay(new Display(true, new Menu.Builder(false, 2, RelPos.CENTER, - new SelectEntry("Load World", () -> Game.setDisplay(new WorldSelectDisplay())), - new SelectEntry("New World", () -> Game.setDisplay(new WorldGenDisplay())) - ).createMenu())); - else Game.setDisplay(new WorldGenDisplay()); - }), - new SelectEntry("Multiplayer", () -> Game.setDisplay(new MultiplayerDisplay())) + new StringEntry("Game Mode", Color.YELLOW), + new BlankEntry(), + new BlankEntry(), + new SelectEntry("Singleplayer", () -> { + if (WorldSelectDisplay.getWorldNames().size() > 0) + Game.setDisplay(new Display(true, new Menu.Builder(false, 2, RelPos.CENTER, + new SelectEntry("Load World", () -> Game.setDisplay(new WorldSelectDisplay())), + new SelectEntry("New World", () -> Game.setDisplay(new WorldGenDisplay())) + ).createMenu())); + else Game.setDisplay(new WorldGenDisplay()); + }), + new SelectEntry("Multiplayer", () -> Game.setDisplay(new MultiplayerDisplay())) ).createMenu()); } } diff --git a/src/client/java/minicraft/screen/PlayerDeathDisplay.java b/src/client/java/minicraft/screen/PlayerDeathDisplay.java index c464334b2..0761ec87d 100644 --- a/src/client/java/minicraft/screen/PlayerDeathDisplay.java +++ b/src/client/java/minicraft/screen/PlayerDeathDisplay.java @@ -27,7 +27,7 @@ public PlayerDeathDisplay() { new BlankEntry() )); - if(!Game.isMode("minicraft.settings.mode.hardcore")) { + if (!Game.isMode("minicraft.settings.mode.hardcore")) { entries.add(new SelectEntry("minicraft.displays.player_death.respawn", () -> { World.resetGame(); Game.setDisplay(null); diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index 9a89932a2..c5a709854 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -39,7 +39,7 @@ public PlayerInvDisplay(Player player) { .createMenu(); if (creativeMode) { creativeInv = Items.getCreativeModeInventory(); - menus = new Menu[] { + menus = new Menu[]{ menus[0], new InventoryMenu(player, creativeInv, "minicraft.displays.player_inv.container_title.items", RelPos.RIGHT) {{ creativeInv = true; @@ -50,10 +50,10 @@ public PlayerInvDisplay(Player player) { menus[1].translate(menus[0].getBounds().getWidth() + padding, 0); update(); - if(menus[0].getNumOptions() == 0) onSelectionChange(0, 1); + if (menus[0].getNumOptions() == 0) onSelectionChange(0, 1); } else { creativeInv = null; - menus = new Menu[] { menus[0], descriptionMenu }; + menus = new Menu[]{menus[0], descriptionMenu}; } onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); @@ -138,13 +138,13 @@ public void tick(InputHandler input) { if (input.getMappedKey("SHIFT-D").isClicked() || input.buttonPressed(ControllerButton.Y)) { deleteAll = true; } else if (input.getMappedKey("D").isClicked() || input.buttonPressed(ControllerButton.X)) { - deleteAll = !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; + deleteAll = !(fromItem instanceof StackableItem) || ((StackableItem) fromItem).count == 1; } else return; if (deleteAll) { from.remove(fromSel); } else { - ((StackableItem)fromItem).count--; // this is known to be valid. + ((StackableItem) fromItem).count--; // this is known to be valid. } update(); @@ -160,13 +160,13 @@ public void tick(InputHandler input) { boolean transferAll; if (input.inputPressed("attack")) { // If stack limit is available, this can transfer whole stack - transferAll = !(fromItem instanceof StackableItem) || ((StackableItem)fromItem).count == 1; + transferAll = !(fromItem instanceof StackableItem) || ((StackableItem) fromItem).count == 1; } else return; Item toItem = fromItem.copy(); if (!transferAll) { - ((StackableItem)toItem).count = 1; + ((StackableItem) toItem).count = 1; } to.add(toSel, toItem); @@ -208,18 +208,23 @@ protected void onSelectionChange(int oldSel, int newSel) { if (selection == 0) menus[1].shouldRender = false; else menus[1].shouldRender = true; - if(oldSel == newSel) return; // this also serves as a protection against access to menus[0] when such may not exist. + if (oldSel == newSel) + return; // this also serves as a protection against access to menus[0] when such may not exist. int shift = 0; - if(newSel == 0) shift = padding - menus[0].getBounds().getLeft(); - if(newSel == 1) shift = (Screen.w - padding) - menus[1].getBounds().getRight(); + if (newSel == 0) shift = padding - menus[0].getBounds().getLeft(); + if (newSel == 1) shift = (Screen.w - padding) - menus[1].getBounds().getRight(); menus[0].translate(shift, 0); menus[1].translate(shift, 0); - if (newSel == 0) descriptionMenuBuilder.setPositioning(new Point(padding, menus[0].getBounds().getBottom() + 8), RelPos.BOTTOM_RIGHT); - if (newSel == 1) descriptionMenuBuilder.setPositioning(new Point(Screen.w - padding, menus[1].getBounds().getBottom() + 8), RelPos.BOTTOM_LEFT); + if (newSel == 0) + descriptionMenuBuilder.setPositioning(new Point(padding, menus[0].getBounds().getBottom() + 8), RelPos.BOTTOM_RIGHT); + if (newSel == 1) + descriptionMenuBuilder.setPositioning(new Point(Screen.w - padding, menus[1].getBounds().getBottom() + 8), RelPos.BOTTOM_LEFT); } } - private int getOtherIdx() { return (selection+1) % 2; } + private int getOtherIdx() { + return (selection + 1) % 2; + } private void update() { menus[0] = new InventoryMenu((InventoryMenu) menus[0]); diff --git a/src/client/java/minicraft/screen/PopupDisplay.java b/src/client/java/minicraft/screen/PopupDisplay.java index d1597a2bf..028696760 100644 --- a/src/client/java/minicraft/screen/PopupDisplay.java +++ b/src/client/java/minicraft/screen/PopupDisplay.java @@ -12,17 +12,34 @@ import java.util.ArrayList; import java.util.stream.Stream; -/** Light-weighted exitable display with single menu. */ +/** + * Light-weighted exitable display with single menu. + */ public class PopupDisplay extends Display { // Using Color codes for coloring in title and plain text messages. private final ArrayList callbacks; - public PopupDisplay(@Nullable PopupConfig config, String... messages) { this(config, false, messages); } - public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, String... messages) { this(config, clearScreen, true, messages); } - public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, boolean menuFrame, String... messages) { this(config, clearScreen, menuFrame, StringEntry.useLines(messages)); } - public PopupDisplay(@Nullable PopupConfig config, ListEntry... entries) { this(config, false, entries); } - public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, ListEntry... entries) { this(config, clearScreen, true, entries); } + public PopupDisplay(@Nullable PopupConfig config, String... messages) { + this(config, false, messages); + } + + public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, String... messages) { + this(config, clearScreen, true, messages); + } + + public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, boolean menuFrame, String... messages) { + this(config, clearScreen, menuFrame, StringEntry.useLines(messages)); + } + + public PopupDisplay(@Nullable PopupConfig config, ListEntry... entries) { + this(config, false, entries); + } + + public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, ListEntry... entries) { + this(config, clearScreen, true, entries); + } + public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, boolean menuFrame, ListEntry... entries) { super(clearScreen, true); @@ -40,9 +57,9 @@ public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, boolean m if (Stream.of(entries).anyMatch(e -> e instanceof InputEntry)) onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); if (onScreenKeyboardMenu == null) - menus = new Menu[] { builder.createMenu() }; + menus = new Menu[]{builder.createMenu()}; else - menus = new Menu[] { onScreenKeyboardMenu, builder.createMenu() }; + menus = new Menu[]{onScreenKeyboardMenu, builder.createMenu()}; } OnScreenKeyboardMenu onScreenKeyboardMenu; @@ -128,9 +145,10 @@ public static interface ActionCallback { /** * The callback acts when the key clicked. - * @param key The key of the callback trigger. + * + * @param key The key of the callback trigger. * @param callback The callback, when the return value is {@code true}, no more input check - * will be done. It continues if {@code false}. + * will be done. It continues if {@code false}. */ public PopupActionCallback(String key, ActionCallback callback) { this.key = key; diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index 98841a634..c9afba033 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -37,7 +37,9 @@ import java.util.stream.Collectors; public class QuestsDisplay extends Display { - /** Unlocked but uncompleted. */ + /** + * Unlocked but uncompleted. + */ private final static HashSet displayableQuests = new HashSet<>(); // Temp set. Refreshed anytime. private final static HashSet series = new HashSet<>(); @@ -205,12 +207,12 @@ public int getColor(boolean isSelected) { } } - seriesEntries = new SelectEntry[][] { + seriesEntries = new SelectEntry[][]{ unlocked.toArray(new SelectEntry[0]), completed.toArray(new SelectEntry[0]) }; - entrySeries = new QuestSeries[][] { + entrySeries = new QuestSeries[][]{ unlockedSeries.toArray(new QuestSeries[0]), completedSeries.toArray(new QuestSeries[0]) }; @@ -220,7 +222,7 @@ public QuestsDisplay() { super(true, true); reloadEntries(); - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(false, 1, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, Screen.h / 2 - 20), RelPos.CENTER) .setDisplayLength(5) @@ -256,9 +258,9 @@ public SeriesInformationDisplay(QuestSeries series) { super(false, true); ArrayList entries = new ArrayList<>(); - entries.add(series.isCompleted() ? new StringEntry("Status: Completed", Color.GREEN): - series.isUnlocked() ? new StringEntry("Status: Unlocked", Color.WHITE): - new StringEntry("Status: Locked", Color.GRAY) // Locked series would not been shown...? + entries.add(series.isCompleted() ? new StringEntry("Status: Completed", Color.GREEN) : + series.isUnlocked() ? new StringEntry("Status: Unlocked", Color.WHITE) : + new StringEntry("Status: Locked", Color.GRAY) // Locked series would not been shown...? ); entries.add(new StringEntry("Quests completed: " + @@ -271,7 +273,7 @@ public SeriesInformationDisplay(QuestSeries series) { entries.add(new BlankEntry()); entries.add(new SelectEntry("View all quests of this series", () -> Game.setDisplay(new SeriesQuestViewerDisplay(series)))); - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(true, 0, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, 5), RelPos.BOTTOM) .setEntries(new StringEntry(Localization.getLocalized(series.key))) @@ -350,12 +352,12 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee public SeriesQuestViewerDisplay(QuestSeries series) { super(false, true); - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(true, 0, RelPos.CENTER, StringEntry.useLines("minicrat.displays.quests", series.key)) - .setPositioning(new Point(Screen.w/2, 6), RelPos.BOTTOM) + .setPositioning(new Point(Screen.w / 2, 6), RelPos.BOTTOM) .createMenu(), new Menu.Builder(true, 0, RelPos.CENTER) - .setPositioning(new Point(Screen.w/2, 40), RelPos.BOTTOM) + .setPositioning(new Point(Screen.w / 2, 40), RelPos.BOTTOM) .setSize(Screen.w - 16, Screen.h - 60) .createMenu() }; @@ -380,7 +382,7 @@ public SeriesQuestViewerDisplay(QuestSeries series) { }); while (childQuests.size() > 0) { - for (Iterator>> it = childQuests.entrySet().iterator(); it.hasNext();) { + for (Iterator>> it = childQuests.entrySet().iterator(); it.hasNext(); ) { Map.Entry> entry = it.next(); Quest parent = entry.getKey(); ArrayList questRow = questRowsList.stream().filter(quests1 -> quests1.contains(parent)).findAny().orElse(null); @@ -402,11 +404,11 @@ public SeriesQuestViewerDisplay(QuestSeries series) { int height = Font.textHeight(); for (int j = 0; j < questsTree[i].length; j++) { // x-axis int width = Font.textWidth(Localization.getLocalized(questsTree[i][j].key)); - treeDimensions[i][j] = new Rectangle(entryGap, entryGap, entryPadding*2 + width, entryPadding*2 + height, 0); + treeDimensions[i][j] = new Rectangle(entryGap, entryGap, entryPadding * 2 + width, entryPadding * 2 + height, 0); if (j > 0) - treeDimensions[i][j].translate(treeDimensions[i][j-1].getRight() + entryGap, 0); + treeDimensions[i][j].translate(treeDimensions[i][j - 1].getRight() + entryGap, 0); if (i > 0) - treeDimensions[i][j].translate(0, treeDimensions[i-1][0].getBottom() + entryGap*2); + treeDimensions[i][j].translate(0, treeDimensions[i - 1][0].getBottom() + entryGap * 2); } } } else { @@ -415,8 +417,8 @@ public SeriesQuestViewerDisplay(QuestSeries series) { } Rectangle menuBounds = menus[1].getBounds(); - rasterWidth = menuBounds.getWidth() - MinicraftImage.boxWidth*2; - rasterHeight = menuBounds.getHeight() - MinicraftImage.boxWidth*2; + rasterWidth = menuBounds.getWidth() - MinicraftImage.boxWidth * 2; + rasterHeight = menuBounds.getHeight() - MinicraftImage.boxWidth * 2; rasterPixels = new int[rasterWidth * rasterHeight]; rasterX = menuBounds.getLeft() + MinicraftImage.boxWidth; rasterY = menuBounds.getTop() + MinicraftImage.boxWidth; @@ -516,8 +518,8 @@ public void render(Screen screen) { private void renderRaster() { if (questsTree.length == 0) { String text = Localization.getLocalized("minicraft.displays.quests.display.no_quest"); - Font.draw(text, simulatedRasterScreen, xScroll + rasterWidth/2 - Font.textWidth(text)/2, - yScroll + rasterHeight/2 - Font.textHeight()/2, Color.GRAY); + Font.draw(text, simulatedRasterScreen, xScroll + rasterWidth / 2 - Font.textWidth(text) / 2, + yScroll + rasterHeight / 2 - Font.textHeight() / 2, Color.GRAY); return; } @@ -586,6 +588,7 @@ private void renderRaster() { } } } + private void renderRasterPixel(int x, int y, int color) { x -= xScroll; y -= yScroll; @@ -611,9 +614,10 @@ void plotLineLow(int x0, int y0, int x1, int y1, IntPredicate yRange, int color) y = y + yi; D = D + (2 * (dy - dx)); } else - D = D + 2*dy; + D = D + 2 * dy; } } + void plotLineHigh(int x0, int y0, int x1, int y1, IntPredicate yRange, int color) { int dx = x1 - x0; int dy = y1 - y0; @@ -631,9 +635,10 @@ void plotLineHigh(int x0, int y0, int x1, int y1, IntPredicate yRange, int color x = x + xi; D = D + (2 * (dx - dy)); } else - D = D + 2*dx; + D = D + 2 * dx; } } + void plotLine(int x0, int y0, int x1, int y1, IntPredicate yRange, int color) { if (Math.abs(y1 - y0) < Math.abs(x1 - x0)) { if (x0 > x1) @@ -653,7 +658,7 @@ public QuestInformationDisplay(Quest quest) { super(false, true); String state = quest.isCompleted() ? "Completed" : quest.isUnlocked() ? "Unlocked" : "Locked"; int color = quest.isCompleted() ? Color.GREEN : quest.isUnlocked() ? Color.WHITE : Color.GRAY; - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(true, 1, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, 5), RelPos.BOTTOM) .setEntries(new StringEntry(Localization.getLocalized(quest.getSeries().key)), @@ -678,7 +683,10 @@ public static HashSet getDisplayableQuests() { return new HashSet<>(displayableQuests); } - public static void resetGameQuests() { resetGameQuests(true); } + public static void resetGameQuests() { + resetGameQuests(true); + } + private static void resetGameQuests(boolean update) { series.forEach(AdvancementElement::reset); if (update) refreshDisplayableQuests(); @@ -701,7 +709,9 @@ public static void load(JSONObject json) { refreshDisplayableQuests(); } - /** Saving and writing all data into the given JSONObject. */ + /** + * Saving and writing all data into the given JSONObject. + */ public static void save(JSONObject json) { series.forEach(series1 -> { series1.save(json); @@ -733,12 +743,12 @@ public void tick(InputHandler input) { private void updateEntries() { menus[0].setEntries(seriesEntries[selectedEntry]); - String[] entryNames = new String[] { + String[] entryNames = new String[]{ "Unlocked", "Completed" }; for (int i = 0; i < 2; i++) { - menus[i+1].updateEntry(0, new StringEntry(entryNames[i], (i == selectedEntry) ? Color.WHITE : Color.GRAY)); + menus[i + 1].updateEntry(0, new StringEntry(entryNames[i], (i == selectedEntry) ? Color.WHITE : Color.GRAY)); } int select = previousSelection; diff --git a/src/client/java/minicraft/screen/RecipeMenu.java b/src/client/java/minicraft/screen/RecipeMenu.java index 95420f532..8d18e32c3 100644 --- a/src/client/java/minicraft/screen/RecipeMenu.java +++ b/src/client/java/minicraft/screen/RecipeMenu.java @@ -12,10 +12,10 @@ private static RecipeEntry[] getAndSortRecipes(List recipes, Player play recipes.sort((r1, r2) -> { boolean craft1 = r1.checkCanCraft(player); boolean craft2 = r2.checkCanCraft(player); - if(craft1 == craft2) + if (craft1 == craft2) return 0; - if(craft1) return -1; - if(craft2) return 1; + if (craft1) return -1; + if (craft2) return 1; return 0; // should never actually be reached }); diff --git a/src/client/java/minicraft/screen/RelPos.java b/src/client/java/minicraft/screen/RelPos.java index 7c20c86b8..eb1f51021 100644 --- a/src/client/java/minicraft/screen/RelPos.java +++ b/src/client/java/minicraft/screen/RelPos.java @@ -15,7 +15,7 @@ public enum RelPos { // I think this way, the enums will all be constructed before this gets called, so there won't be any mishaps with number of values. static { - for(RelPos rp: RelPos.values()) { + for (RelPos rp : RelPos.values()) { int ord = rp.ordinal(); rp.xIndex = ord % 3; rp.yIndex = ord / 3; @@ -23,20 +23,23 @@ public enum RelPos { } public static RelPos getPos(int xIndex, int yIndex) { - return values()[MyUtils.clamp(xIndex, 0, 2) + MyUtils.clamp(yIndex, 0, 2)*3]; + return values()[MyUtils.clamp(xIndex, 0, 2) + MyUtils.clamp(yIndex, 0, 2) * 3]; } public RelPos getOpposite() { - int nx = -(xIndex-1) + 1; - int ny = -(yIndex-1) + 1; + int nx = -(xIndex - 1) + 1; + int ny = -(yIndex - 1) + 1; return getPos(nx, ny); } - /** positions the given rect around the given anchor. The double size is what aligns it to a point rather than a rect. */ + /** + * positions the given rect around the given anchor. The double size is what aligns it to a point rather than a rect. + */ public Point positionRect(Dimension rectSize, Point anchor) { - Rectangle bounds = new Rectangle(anchor.x, anchor.y, rectSize.width*2, rectSize.height*2, Rectangle.CENTER_DIMS); + Rectangle bounds = new Rectangle(anchor.x, anchor.y, rectSize.width * 2, rectSize.height * 2, Rectangle.CENTER_DIMS); return positionRect(rectSize, bounds); } + // the point is returned as a rectangle with the given dimension and the found location, within the provided dummy rectangle. public Rectangle positionRect(Dimension rectSize, Point anchor, Rectangle dummy) { Point pos = positionRect(rectSize, anchor); @@ -45,13 +48,15 @@ public Rectangle positionRect(Dimension rectSize, Point anchor, Rectangle dummy) return dummy; } - /** positions the given rect to a relative position in the container. */ + /** + * positions the given rect to a relative position in the container. + */ public Point positionRect(Dimension rectSize, Rectangle container) { Point tlcorner = container.getCenter(); // this moves the inner box correctly - tlcorner.x += ((xIndex -1) * container.getWidth() / 2) - (xIndex * rectSize.width / 2); - tlcorner.y += ((yIndex -1) * container.getHeight() / 2) - (yIndex * rectSize.height / 2); + tlcorner.x += ((xIndex - 1) * container.getWidth() / 2) - (xIndex * rectSize.width / 2); + tlcorner.y += ((yIndex - 1) * container.getHeight() / 2) - (yIndex * rectSize.height / 2); return tlcorner; } diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index 039c89330..8e14e0320 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -161,7 +161,9 @@ public class ResourcePackDisplay extends Display { } } - /** Initializing the Display. */ + /** + * Initializing the Display. + */ public ResourcePackDisplay() { super(true, true); initPacks(); @@ -178,7 +180,7 @@ public ResourcePackDisplay() { reloadEntries(); - menus = new Menu[] { + menus = new Menu[]{ builder0.setEntries(entries0) .createMenu(), builder1.setEntries(entries1) @@ -194,7 +196,8 @@ public ResourcePackDisplay() { @Override protected void onSelectionChange(int oldSel, int newSel) { super.onSelectionChange(oldSel, newSel); - if (oldSel == newSel) return; // this also serves as a protection against access to menus[0] when such may not exist. + if (oldSel == newSel) + return; // this also serves as a protection against access to menus[0] when such may not exist. menus[0].translate(-menus[0].getBounds().getLeft(), 0); menus[1].translate(Screen.w - menus[1].getBounds().getRight(), 0); if (newSel == 0) { @@ -206,7 +209,9 @@ protected void onSelectionChange(int oldSel, int newSel) { } } - /** Reloading the entries to refresh the current pack list. */ + /** + * Reloading the entries to refresh the current pack list. + */ private void reloadEntries() { entries0.clear(); // First list: unloaded. for (ResourcePack pack : resourcePacks) { // First list: all available resource packs. @@ -231,10 +236,12 @@ public int getColor(boolean isSelected) { } } - /** Applying the reloaded entries into the display. */ + /** + * Applying the reloaded entries into the display. + */ private void refreshEntries() { reloadEntries(); - Menu[] newMenus = new Menu[] { + Menu[] newMenus = new Menu[]{ builder0.setEntries(entries0) .createMenu(), builder1.setEntries(entries1) @@ -251,7 +258,9 @@ private void refreshEntries() { menus[selection ^ 1].translate(menus[selection].getBounds().getWidth() + padding, 0); } - /** Watching the directory changes. Allowing hot-loading. */ + /** + * Watching the directory changes. Allowing hot-loading. + */ private class WatcherThread extends Thread implements Closeable { private WatchService watcher; private volatile Thread running = this; @@ -281,7 +290,7 @@ public void run() { @SuppressWarnings("unchecked") WatchEvent ev = (WatchEvent) event; - Path filename = ev.context(); + Path filename = ev.context(); try { urls.add(FOLDER_LOCATION.toPath().resolve(filename).toFile().toURI().toURL()); @@ -387,7 +396,8 @@ public void render(Screen screen) { Font.drawCentered(Localization.getLocalized("minicraft.displays.resource_packs.display.title"), screen, 6, Color.WHITE); // Info text at the bottom. - if (Game.input.anyControllerConnected()) Font.drawCentered(Localization.getLocalized("minicraft.displays.resource_packs.display.help.keyboard_needed"), screen, Screen.h - 33, Color.DARK_GRAY); + if (Game.input.anyControllerConnected()) + Font.drawCentered(Localization.getLocalized("minicraft.displays.resource_packs.display.help.keyboard_needed"), screen, Screen.h - 33, Color.DARK_GRAY); Font.drawCentered(Localization.getLocalized("minicraft.displays.resource_packs.display.help.move", Game.input.getMapping("cursor-down"), Game.input.getMapping("cursor-up")), screen, Screen.h - 25, Color.DARK_GRAY); Font.drawCentered(Localization.getLocalized("minicraft.displays.resource_packs.display.help.select", Game.input.getMapping("SELECT")), screen, Screen.h - 17, Color.DARK_GRAY); Font.drawCentered(Localization.getLocalized("minicraft.displays.resource_packs.display.help.position"), screen, Screen.h - 9, Color.DARK_GRAY); @@ -410,11 +420,15 @@ public void render(Screen screen) { } } - /** The object representation of resource pack. */ + /** + * The object representation of resource pack. + */ private static class ResourcePack implements Closeable { private URL packRoot; - /** 0 - before 2.2.0; 1 - 2.2.0-latest */ + /** + * 0 - before 2.2.0; 1 - 2.2.0-latest + */ @SuppressWarnings("unused") private final int packFormat; // The pack format of the pack. private final String name; // The name of the pack. @@ -432,7 +446,9 @@ private ResourcePack(URL packRoot, int packFormat, String name, String desc) { refreshPack(); } - /** This does not include metadata refresh. */ + /** + * This does not include metadata refresh. + */ public void refreshPack() { // Refresh pack logo.png. try { @@ -468,6 +484,7 @@ public void refreshPack() { /** * Open the stream of the zip file. + * * @return {@code true} if the stream has successfully been opened. */ private boolean openStream() { @@ -480,7 +497,9 @@ private boolean openStream() { } } - /** Closing the stream of the zip file if opened. */ + /** + * Closing the stream of the zip file if opened. + */ @Override public void close() throws IOException { if (opened) { @@ -492,6 +511,7 @@ public void close() throws IOException { /** * Getting the stream by the path. + * * @param path The path of the entry. * @return The input stream of the specified entry. * @throws IOException if an I/O error has occurred. @@ -511,18 +531,19 @@ private static interface FilesFilter { // Literally functioned. /** * Getting the subfiles under the specified entry directrory. - * @param path The directory to be listed. + * + * @param path The directory to be listed. * @param filter The filter to be applied. * @return The filtered (if any) subfile and subfolder list. Empty if not or invalid path. */ @NotNull private ArrayList getFiles(String path, FilesFilter filter) { ArrayList paths = new ArrayList<>(); - for (Enumeration e = zipFile.entries(); e.hasMoreElements();) { + for (Enumeration e = zipFile.entries(); e.hasMoreElements(); ) { ZipEntry entry = e.nextElement(); Path parent; if ((parent = Paths.get(entry.getName()).getParent()) != null && parent.equals(Paths.get(path)) && - (filter == null || filter.check(Paths.get(entry.getName()), entry.isDirectory()))) { + (filter == null || filter.check(Paths.get(entry.getName()), entry.isDirectory()))) { paths.add(entry.getName()); } } @@ -533,6 +554,7 @@ private ArrayList getFiles(String path, FilesFilter filter) { /** * Reading the string from the input stream. + * * @param in The input stream to be read. * @return The returned string. */ @@ -543,6 +565,7 @@ public static String readStringFromInputStream(InputStream in) { /** * Loading pack metadata of the pack. + * * @param file The path of the pack. * @return The loaded pack with metadata. */ @@ -564,7 +587,9 @@ public static ResourcePack loadPackMetadata(URL file) { return null; } - /** Intializing the packs from directory and loaded. */ + /** + * Intializing the packs from directory and loaded. + */ public static void initPacks() { // Generate resource packs folder if (FOLDER_LOCATION.mkdirs()) { @@ -573,7 +598,7 @@ public static void initPacks() { ArrayList urls = new ArrayList<>(); // Read and add the .zip file to the resource pack list. Only accept files ending with .zip or directory. - for (File file : Objects.requireNonNull(FOLDER_LOCATION.listFiles((dur, name) -> name.endsWith(".zip")))) { + for (File file : Objects.requireNonNull(FOLDER_LOCATION.listFiles((dur, name) -> name.endsWith(".zip")))) { try { urls.add(file.toPath().toUri().toURL()); } catch (MalformedURLException e) { @@ -600,6 +625,7 @@ public static void initPacks() { /** * Finding the pack by pack's file URL. + * * @param url The url for query. * @return The found resource pack. {@code null} if not found. */ @@ -621,6 +647,7 @@ private static ResourcePack findPackByURL(URL url) { /** * Refreshing the pack list by the urls. + * * @param urls The packs' url to be refreshed. */ private static void refreshResourcePacks(List urls) { @@ -650,13 +677,16 @@ private static void refreshResourcePacks(List urls) { resourcePacks.sort((p1, p2) -> p1.name.compareTo(p2.name)); } - /** Releasing the unloaded packs. */ + /** + * Releasing the unloaded packs. + */ public static void releaseUnloadedPacks() { resourcePacks.clear(); // Releases unloaded packs. } /** * Loading the resource packs when loading preferences. This should only be called by {@link minicraft.saveload.Load}. + * * @param names The names of the packs. */ public static void loadResourcePacks(String[] names) { @@ -677,6 +707,7 @@ public static void loadResourcePacks(String[] names) { /** * Getting the names of the loaded packs. This should only be called by {@link minicraft.saveload.Save}. + * * @return The names of currently loaded packs. */ public static ArrayList getLoadedPacks() { @@ -694,7 +725,9 @@ public static ArrayList getLoadedPacks() { return packs; } - /** Reloading all the resources with the currently packs to be loaded. */ + /** + * Reloading all the resources with the currently packs to be loaded. + */ @SuppressWarnings("unchecked") public static void reloadResources() { loadQuery.clear(); @@ -732,22 +765,32 @@ public static void reloadResources() { /** * Loading the textures of the pack. + * * @param pack The pack to be loaded. * @throws IOException if I/O exception occurs. */ private static void loadTextures(ResourcePack pack) throws IOException { for (String t : pack.getFiles("assets/textures/", null)) { switch (t) { - case "assets/textures/entity/": loadTextures(pack, SpriteType.Entity); break; - case "assets/textures/gui/": loadTextures(pack, SpriteType.Gui); break; - case "assets/textures/item/": loadTextures(pack, SpriteType.Item); break; - case "assets/textures/tile/": loadTextures(pack, SpriteType.Tile); break; + case "assets/textures/entity/": + loadTextures(pack, SpriteType.Entity); + break; + case "assets/textures/gui/": + loadTextures(pack, SpriteType.Gui); + break; + case "assets/textures/item/": + loadTextures(pack, SpriteType.Item); + break; + case "assets/textures/tile/": + loadTextures(pack, SpriteType.Tile); + break; } } } /** * Loading the categories of textures from the pack. + * * @param pack The pack to be loaded. * @param type The category of textures. * @throws IOException if I/O exception occurs. @@ -755,10 +798,18 @@ private static void loadTextures(ResourcePack pack) throws IOException { private static void loadTextures(ResourcePack pack, SpriteType type) throws IOException { String path = "assets/textures/"; switch (type) { - case Entity: path += "entity/"; break; - case Gui: path += "gui/"; break; - case Item: path += "item/"; break; - case Tile: path += "tile/"; break; + case Entity: + path += "entity/"; + break; + case Gui: + path += "gui/"; + break; + case Item: + path += "item/"; + break; + case Tile: + path += "tile/"; + break; } ArrayList pngs = pack.getFiles(path, (p, isDir) -> p.toString().endsWith(".png") && !isDir); @@ -843,6 +894,7 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx /** * Loading localization from the pack. + * * @param pack The pack to be loaded. */ private static void loadLocalization(ResourcePack pack) { @@ -886,18 +938,29 @@ private static void loadLocalization(ResourcePack pack) { /** * Loading the books from the pack. + * * @param pack The pack to be loaded. */ private static void loadBooks(ResourcePack pack) { - for (String path : pack.getFiles("assets/books", (path, isDir) -> path.toString().endsWith(".txt") && !isDir)) { + for (String path : pack.getFiles("assets/books", (path, isDir) -> path.toString().endsWith(".txt") && !isDir)) { try { String book = BookData.loadBook(readStringFromInputStream(pack.getResourceAsStream(path))); switch (path) { - case "assets/books/about.txt": BookData.about = () -> book; break; - case "assets/books/credits.txt": BookData.credits = () -> book; break; - case "assets/books/instructions.txt": BookData.instructions = () -> book; break; - case "assets/books/antidous.txt": BookData.antVenomBook = () -> book; break; - case "assets/books/story_guide.txt": BookData.storylineGuide = () -> book; break; + case "assets/books/about.txt": + BookData.about = () -> book; + break; + case "assets/books/credits.txt": + BookData.credits = () -> book; + break; + case "assets/books/instructions.txt": + BookData.instructions = () -> book; + break; + case "assets/books/antidous.txt": + BookData.antVenomBook = () -> book; + break; + case "assets/books/story_guide.txt": + BookData.storylineGuide = () -> book; + break; } } catch (IOException e) { Logging.RESOURCEHANDLER_LOCALIZATION.debug(e, "Unable to load book: {} in pack : {}", path, pack.name); @@ -907,6 +970,7 @@ private static void loadBooks(ResourcePack pack) { /** * Loading sounds from the pack. + * * @param pack The pack to be loaded. */ private static void loadSounds(ResourcePack pack) { diff --git a/src/client/java/minicraft/screen/SkinDisplay.java b/src/client/java/minicraft/screen/SkinDisplay.java index 40896cd5d..3dbfffab1 100644 --- a/src/client/java/minicraft/screen/SkinDisplay.java +++ b/src/client/java/minicraft/screen/SkinDisplay.java @@ -69,7 +69,7 @@ public SkinDisplay() { new Menu.Builder(false, 2, RelPos.CENTER) .setDisplayLength(8) .setSelectable(true) - .setPositioning(new Point(Screen.w/2, Screen.h*3/5), RelPos.CENTER) + .setPositioning(new Point(Screen.w / 2, Screen.h * 3 / 5), RelPos.CENTER) .createMenu() ); @@ -137,7 +137,9 @@ public static void releaseSkins() { } } - /** Watching the directory changes. Allowing hot-loading. */ + /** + * Watching the directory changes. Allowing hot-loading. + */ private class WatcherThread extends Thread { private WatchService watcher; private volatile Thread running = this; @@ -202,7 +204,8 @@ private synchronized static void refreshSkinFiles(List files) { Logging.RESOURCEHANDLER_SKIN.error("Could not read image at path {}. The file is probably missing or formatted wrong.", skinPath); } catch (SecurityException e) { Logging.RESOURCEHANDLER_SKIN.error("Access to file located at {} was denied. Check if game is given permission.", skinPath); - } else { + } + else { Renderer.spriteLinker.setSkin("skin." + name, null); if (skins.containsKey(name)) for (LinkedSprite[] a : skins.remove(name)) { for (LinkedSprite b : a) { diff --git a/src/client/java/minicraft/screen/TempDisplay.java b/src/client/java/minicraft/screen/TempDisplay.java index 544177f82..acbc82517 100644 --- a/src/client/java/minicraft/screen/TempDisplay.java +++ b/src/client/java/minicraft/screen/TempDisplay.java @@ -4,45 +4,45 @@ import minicraft.util.MyUtils; public class TempDisplay extends Display { - + private int milliDelay; - + public TempDisplay(int milliDelay) { this.milliDelay = milliDelay; } - + public TempDisplay(int milliDelay, Menu... menus) { super(menus); this.milliDelay = milliDelay; } - + public TempDisplay(int milliDelay, boolean clearScreen) { super(clearScreen); this.milliDelay = milliDelay; } - + public TempDisplay(int milliDelay, boolean clearScreen, Menu... menus) { super(clearScreen, menus); this.milliDelay = milliDelay; } - + public TempDisplay(int milliDelay, boolean clearScreen, boolean canExit) { super(clearScreen, canExit); this.milliDelay = milliDelay; } - + public TempDisplay(int milliDelay, boolean clearScreen, boolean canExit, Menu... menus) { super(clearScreen, canExit, menus); this.milliDelay = milliDelay; } - + @Override public void init(Display parent) { super.init(parent); - + new Thread(() -> { MyUtils.sleep(milliDelay); - if(Game.getDisplay() == TempDisplay.this) + if (Game.getDisplay() == TempDisplay.this) Game.exitDisplay(); }).start(); } diff --git a/src/client/java/minicraft/screen/TitleDisplay.java b/src/client/java/minicraft/screen/TitleDisplay.java index 6459e3a91..de083b95f 100644 --- a/src/client/java/minicraft/screen/TitleDisplay.java +++ b/src/client/java/minicraft/screen/TitleDisplay.java @@ -34,32 +34,32 @@ public class TitleDisplay extends Display { public TitleDisplay() { super(true, false, new Menu.Builder(false, 2, RelPos.CENTER, - new StringEntry("minicraft.displays.title.display.checking", Color.BLUE), - new BlankEntry(), - new SelectEntry("minicraft.displays.title.play", () -> { - if (WorldSelectDisplay.getWorldNames().size() > 0) - Game.setDisplay(new Display(true, new Menu.Builder(false, 2, RelPos.CENTER, - new SelectEntry("minicraft.displays.title.play.load_world", () -> Game.setDisplay(new WorldSelectDisplay())), - new SelectEntry("minicraft.displays.title.play.new_world", () -> Game.setDisplay(new WorldGenDisplay())) - ).createMenu())); - else Game.setDisplay(new WorldGenDisplay()); - }), - new SelectEntry("minicraft.display.options_display", () -> Game.setDisplay(new OptionsMainMenuDisplay())), - new SelectEntry("minicraft.displays.skin", () -> Game.setDisplay(new SkinDisplay())), - new SelectEntry("minicraft.displays.achievements", () -> Game.setDisplay(new AchievementsDisplay())), - new SelectEntry("minicraft.displays.title.help", () -> - Game.setDisplay(new Display(true, new Menu.Builder(false, 1, RelPos.CENTER, - new BlankEntry(), - new SelectEntry("minicraft.displays.title.help.instructions", () -> Game.setDisplay(new BookDisplay(BookData.instructions.collect()))), - new SelectEntry("minicraft.displays.title.help.storyline_guide", () -> Game.setDisplay(new BookDisplay(BookData.storylineGuide.collect()))), - new SelectEntry("minicraft.displays.title.help.about", () -> Game.setDisplay(new BookDisplay(BookData.about.collect()))), - new SelectEntry("minicraft.displays.title.help.credits", () -> Game.setDisplay(new BookDisplay(BookData.credits.collect()))) - ).setTitle("minicraft.displays.title.help").createMenu())) - ), - new SelectEntry("minicraft.displays.title.quit", Game::quit) + new StringEntry("minicraft.displays.title.display.checking", Color.BLUE), + new BlankEntry(), + new SelectEntry("minicraft.displays.title.play", () -> { + if (WorldSelectDisplay.getWorldNames().size() > 0) + Game.setDisplay(new Display(true, new Menu.Builder(false, 2, RelPos.CENTER, + new SelectEntry("minicraft.displays.title.play.load_world", () -> Game.setDisplay(new WorldSelectDisplay())), + new SelectEntry("minicraft.displays.title.play.new_world", () -> Game.setDisplay(new WorldGenDisplay())) + ).createMenu())); + else Game.setDisplay(new WorldGenDisplay()); + }), + new SelectEntry("minicraft.display.options_display", () -> Game.setDisplay(new OptionsMainMenuDisplay())), + new SelectEntry("minicraft.displays.skin", () -> Game.setDisplay(new SkinDisplay())), + new SelectEntry("minicraft.displays.achievements", () -> Game.setDisplay(new AchievementsDisplay())), + new SelectEntry("minicraft.displays.title.help", () -> + Game.setDisplay(new Display(true, new Menu.Builder(false, 1, RelPos.CENTER, + new BlankEntry(), + new SelectEntry("minicraft.displays.title.help.instructions", () -> Game.setDisplay(new BookDisplay(BookData.instructions.collect()))), + new SelectEntry("minicraft.displays.title.help.storyline_guide", () -> Game.setDisplay(new BookDisplay(BookData.storylineGuide.collect()))), + new SelectEntry("minicraft.displays.title.help.about", () -> Game.setDisplay(new BookDisplay(BookData.about.collect()))), + new SelectEntry("minicraft.displays.title.help.credits", () -> Game.setDisplay(new BookDisplay(BookData.credits.collect()))) + ).setTitle("minicraft.displays.title.help").createMenu())) + ), + new SelectEntry("minicraft.displays.title.quit", Game::quit) ) - .setPositioning(new Point(Screen.w/2, Screen.h*3/5), RelPos.CENTER) - .createMenu() + .setPositioning(new Point(Screen.w / 2, Screen.h * 3 / 5), RelPos.CENTER) + .createMenu() ); } @@ -81,17 +81,16 @@ public void init(Display parent) { World.levels = new Level[World.levels.length]; - if(Game.player == null) + if (Game.player == null) // Was online, need to reset player World.resetGame(false); } private void checkVersion() { VersionInfo latestVersion = Network.getLatestVersion(); - if(latestVersion == null) { + if (latestVersion == null) { Network.findLatestVersion(this::checkVersion); - } - else { + } else { if (latestVersion.version.compareTo(Game.VERSION, true) > 0) { menus[0].updateEntry(0, new StringEntry(Localization.getLocalized("minicraft.displays.title.display.new_version", latestVersion.releaseName), Color.GREEN)); menus[0].updateEntry(1, new LinkEntry(Color.CYAN, Localization.getLocalized("minicraft.displays.title.select_to_download"), latestVersion.releaseUrl, Localization.getLocalized("minicraft.displays.title.link_to_version", latestVersion.releaseUrl))); @@ -140,7 +139,7 @@ public void render(Screen screen) { /// This isn't as complicated as it looks. It just gets a color based off of count, which oscilates between 0 and 25. int bcol = 5 - count / 5; // This number ends up being between 1 and 5, inclusive. - int splashColor = isblue ? Color.BLUE : isRed ? Color.RED : isGreen ? Color.GREEN : Color.get(1, bcol*51, bcol*51, bcol*25); + int splashColor = isblue ? Color.BLUE : isRed ? Color.RED : isGreen ? Color.GREEN : Color.get(1, bcol * 51, bcol * 51, bcol * 25); Font.drawCentered(splashes[rand], screen, (Screen.h / 2) - 44, splashColor); diff --git a/src/client/java/minicraft/screen/TutorialDisplayHandler.java b/src/client/java/minicraft/screen/TutorialDisplayHandler.java index 7c7ac5f5b..d629e7104 100644 --- a/src/client/java/minicraft/screen/TutorialDisplayHandler.java +++ b/src/client/java/minicraft/screen/TutorialDisplayHandler.java @@ -99,7 +99,9 @@ private void tick() { } } - /** Updating all data by the newly completed element. */ + /** + * Updating all data by the newly completed element. + */ public static void updateCompletedElement(TutorialElement element) { if (!element.isCompleted()) return; if (!(boolean) Settings.get("tutorials")) return; @@ -195,15 +197,17 @@ public static void tick(InputHandler input) { } } - /** Rendering directly on the GUI/HUD. */ + /** + * Rendering directly on the GUI/HUD. + */ public static void render(Screen screen) { if (currentGuide != null) { // Is ongoing. String[] lines = Font.getLines(Localization.getLocalized(currentGuide.display.get()), Screen.w, Screen.h, 0); if (ControlGuide.animation > 0) { int textWidth = Font.textWidth(lines); - int xPadding = Screen.w/2 - (textWidth + 8)/2; - int yPadding = Screen.h/2 - (lines.length * 8 + 8)/2; - int yPad = Screen.h/2 - (lines.length * 8)/2; + int xPadding = Screen.w / 2 - (textWidth + 8) / 2; + int yPadding = Screen.h / 2 - (lines.length * 8 + 8) / 2; + int yPad = Screen.h / 2 - (lines.length * 8) / 2; for (int i = 0; i < lines.length * 8 + 8; i++) { // Background. for (int j = 0; j < textWidth + 8; j++) { screen.pixels[xPadding + j + (yPadding + i) * Screen.w] = @@ -241,9 +245,9 @@ public static void render(Screen screen) { Rectangle bounds = menu.getBounds(); String text = Localization.getLocalized("minicraft.displays.tutorial_display_handler.display.element_examine_help", Game.input.getMapping("expandQuestDisplay")); - String[] lines = Font.getLines(text, Screen.w*2/3, Screen.h, 0); + String[] lines = Font.getLines(text, Screen.w * 2 / 3, Screen.h, 0); for (int i = 0; i < lines.length; i++) - Font.draw(lines[i], screen, bounds.getRight() - Font.textWidth(lines[i]), bounds.getBottom() + 8 * (1+i), Color.GRAY); + Font.draw(lines[i], screen, bounds.getRight() - Font.textWidth(lines[i]), bounds.getBottom() + 8 * (1 + i), Color.GRAY); } } @@ -272,7 +276,9 @@ public static void load(JSONObject json) { if (currentOngoingElement != null) currentOngoingElement.update(); } - /** Saving and writing all data into the given JSONObject. */ + /** + * Saving and writing all data into the given JSONObject. + */ public static void save(JSONObject json) { if (currentOngoingElement != null) json.put("CurrentOngoingTutorial", currentOngoingElement.key); tutorialElements.forEach(element -> element.save(json)); diff --git a/src/client/java/minicraft/screen/WorldGenDisplay.java b/src/client/java/minicraft/screen/WorldGenDisplay.java index 660bccafb..5f62a2cab 100644 --- a/src/client/java/minicraft/screen/WorldGenDisplay.java +++ b/src/client/java/minicraft/screen/WorldGenDisplay.java @@ -25,25 +25,26 @@ public class WorldGenDisplay extends Display { private static final Pattern detailedFilenamePattern; private static final String worldNameRegex; + static { if (FileHandler.OS.contains("windows")) { // Reference: https://stackoverflow.com/a/6804755 worldNameRegex = "[^<>:\"/\\\\|?*\\x00-\\x1F]+"; detailedFilenamePattern = Pattern.compile( - "# Match a valid Windows filename (unspecified file system). \n" + - "^ # Anchor to start of string. \n" + - "(?! # Assert filename is not: CON, PRN, \n" + - " (?: # AUX, NUL, COM1, COM2, COM3, COM4, \n" + - " CON|PRN|AUX|NUL| # COM5, COM6, COM7, COM8, COM9, \n" + - " COM[1-9]|LPT[1-9] # LPT1, LPT2, LPT3, LPT4, LPT5, \n" + - " ) # LPT6, LPT7, LPT8, and LPT9... \n" + - " (?:\\.[^.]*)? # followed by optional extension \n" + - " $ # and end of string \n" + - ") # End negative lookahead assertion. \n" + - "[^<>:\"/\\\\|?*\\x00-\\x1F]* # Zero or more valid filename chars.\n" + - "[^<>:\"/\\\\|?*\\x00-\\x1F\\ .] # Last char is not a space or dot. \n" + - "$ # Anchor to end of string. ", - Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.COMMENTS); + "# Match a valid Windows filename (unspecified file system). \n" + + "^ # Anchor to start of string. \n" + + "(?! # Assert filename is not: CON, PRN, \n" + + " (?: # AUX, NUL, COM1, COM2, COM3, COM4, \n" + + " CON|PRN|AUX|NUL| # COM5, COM6, COM7, COM8, COM9, \n" + + " COM[1-9]|LPT[1-9] # LPT1, LPT2, LPT3, LPT4, LPT5, \n" + + " ) # LPT6, LPT7, LPT8, and LPT9... \n" + + " (?:\\.[^.]*)? # followed by optional extension \n" + + " $ # and end of string \n" + + ") # End negative lookahead assertion. \n" + + "[^<>:\"/\\\\|?*\\x00-\\x1F]* # Zero or more valid filename chars.\n" + + "[^<>:\"/\\\\|?*\\x00-\\x1F\\ .] # Last char is not a space or dot. \n" + + "$ # Anchor to end of string. ", + Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.COMMENTS); } else if (FileHandler.OS.contains("mac")) { worldNameRegex = "[^/:]+"; detailedFilenamePattern = null; @@ -59,7 +60,7 @@ public static OptionalLong getSeed() { String seedStr = worldSeed.getUserInput(); // If there is no input seed, generate random number - if(seedStr.length() == 0) + if (seedStr.length() == 0) return OptionalLong.empty(); // If the seed is only numbers, just use numbers @@ -72,7 +73,7 @@ public static OptionalLong getSeed() { int len = seedStr.length(); for (int i = 0; i < len; i++) { - seed = 31*seed + seedStr.charAt(i); + seed = 31 * seed + seedStr.charAt(i); } return OptionalLong.of(seed); @@ -84,10 +85,10 @@ public static InputEntry makeWorldNameInput(String prompt, List takenNam @Override public boolean isValid() { - if(!super.isValid()) return false; + if (!super.isValid()) return false; String name = getUserInput(); - for(String other: takenNames) - if(other.equalsIgnoreCase(name)) { + for (String other : takenNames) + if (other.equalsIgnoreCase(name)) { if (!name.equals(lastName)) { Logging.WORLD.debug("Duplicated or existed world name \"{}\".", name); lastName = name; @@ -97,7 +98,7 @@ public boolean isValid() { } try { // Checking if the folder name is valid; - Paths.get(Game.gameDir+"/saves/"+name+"/"); + Paths.get(Game.gameDir + "/saves/" + name + "/"); } catch (InvalidPathException e) { if (!name.equals(lastName)) { Logging.WORLD.debug("Invalid world name (InvalidPathException) \"{}\": {}", name, e.getMessage()); @@ -129,8 +130,8 @@ public String getUserInput() { @Override public void render(Screen screen, int x, int y, boolean isSelected) { - super.render(screen, isGen? - (getUserInput().length() > 11? x - (getUserInput().length()-11) * 8: x): + super.render(screen, isGen ? + (getUserInput().length() > 11 ? x - (getUserInput().length() - 11) * 8 : x) : x, y, isSelected); } }; @@ -153,8 +154,8 @@ public int getColor(boolean isSelected) { HashSet controls = new HashSet<>(); controls.addAll(Arrays.asList(Game.input.getMapping("cursor-up").split("/"))); controls.addAll(Arrays.asList(Game.input.getMapping("cursor-down").split("/"))); - for (String key: controls) { - if(key.matches("^\\w$")) { + for (String key : controls) { + if (key.matches("^\\w$")) { nameHelp.setVisible(true); break; } @@ -162,7 +163,9 @@ public int getColor(boolean isSelected) { worldSeed = new InputEntry("minicraft.displays.world_gen.world_seed", "[-!\"#%/()=+,a-zA-Z0-9]+", 20) { @Override - public boolean isValid() { return true; } + public boolean isValid() { + return true; + } }; Menu mainMenu = @@ -173,7 +176,7 @@ public int getColor(boolean isSelected) { Settings.getEntry("scoretime"), new SelectEntry("minicraft.displays.world_gen.create_world", () -> { - if(!nameField.isValid()) return; + if (!nameField.isValid()) return; WorldSelectDisplay.setWorldName(nameField.getUserInput(), false); Game.setDisplay(new LoadingDisplay()); }) { @@ -197,9 +200,9 @@ public void render(Screen screen, int x, int y, boolean isSelected) { onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); if (onScreenKeyboardMenu == null) - menus = new Menu[] { mainMenu }; + menus = new Menu[]{mainMenu}; else - menus = new Menu[] { onScreenKeyboardMenu, mainMenu }; + menus = new Menu[]{onScreenKeyboardMenu, mainMenu}; } OnScreenKeyboardMenu onScreenKeyboardMenu; diff --git a/src/client/java/minicraft/screen/WorldSelectDisplay.java b/src/client/java/minicraft/screen/WorldSelectDisplay.java index 5b0b4255a..320ef1320 100644 --- a/src/client/java/minicraft/screen/WorldSelectDisplay.java +++ b/src/client/java/minicraft/screen/WorldSelectDisplay.java @@ -68,7 +68,7 @@ private void updateEntries() { }, false); } - menus = new Menu[] { + menus = new Menu[]{ new Menu.Builder(false, 0, RelPos.CENTER, entries) .setDisplayLength(5) .setScrollPolicies(1, true) @@ -230,7 +230,7 @@ public void render(Screen screen) { col = Color.RED; Font.drawCentered(Localization.getLocalized("minicraft.displays.world_select.display.world_too_new"), screen, Font.textHeight() * 5, col); } - Font.drawCentered(Localization.getLocalized("minicraft.displays.world_select.display.world_version", (version.compareTo(new Version("1.9.2")) <= 0 ? "~" : "") + version), screen, Font.textHeight() * 7/2, col); + Font.drawCentered(Localization.getLocalized("minicraft.displays.world_select.display.world_version", (version.compareTo(new Version("1.9.2")) <= 0 ? "~" : "") + version), screen, Font.textHeight() * 7 / 2, col); } Font.drawCentered(Localization.getLocalized("minicraft.displays.world_select.display.help.0", Game.input.getMapping("select")), screen, Screen.h - 60, Color.GRAY); @@ -287,13 +287,20 @@ public static void updateWorlds() { } } - public static String getWorldName() { return worldName; } + public static String getWorldName() { + return worldName; + } + public static void setWorldName(String world, boolean loaded) { worldName = world; loadedWorld = loaded; } - public static boolean hasLoadedWorld() { return loadedWorld; } + public static boolean hasLoadedWorld() { + return loadedWorld; + } - public static ArrayList getWorldNames() { return worldNames; } + public static ArrayList getWorldNames() { + return worldNames; + } } diff --git a/src/client/java/minicraft/screen/entry/ArrayEntry.java b/src/client/java/minicraft/screen/entry/ArrayEntry.java index 98431cf5f..1c540869a 100644 --- a/src/client/java/minicraft/screen/entry/ArrayEntry.java +++ b/src/client/java/minicraft/screen/entry/ArrayEntry.java @@ -20,10 +20,14 @@ public class ArrayEntry extends ListEntry { private ChangeListener changeAction; @SafeVarargs - public ArrayEntry(String label, T... options) { this(label, true, true, options); } + public ArrayEntry(String label, T... options) { + this(label, true, true, options); + } @SafeVarargs - public ArrayEntry(String label, boolean wrap, T... options) { this(label, wrap, true, options); } + public ArrayEntry(String label, boolean wrap, T... options) { + this(label, wrap, true, options); + } @SafeVarargs public ArrayEntry(String label, boolean wrap, boolean localize, T... options) { @@ -49,15 +53,25 @@ public void setValue(Object value) { setSelection(getIndex(value)); // if it is -1, setSelection simply won't set the value. } - protected String getLabel() { return label; } - protected String getLocalizationOption(T option) { return option.toString(); } + protected String getLabel() { + return label; + } + + protected String getLocalizationOption(T option) { + return option.toString(); + } + + public int getSelection() { + return selection; + } - public int getSelection() { return selection; } - public T getValue() { return options[selection]; } + public T getValue() { + return options[selection]; + } public boolean valueIs(Object value) { if (value instanceof String && options instanceof String[]) - return ((String)value).equalsIgnoreCase((String)getValue()); + return ((String) value).equalsIgnoreCase((String) getValue()); else return getValue().equals(value); } @@ -65,7 +79,7 @@ public boolean valueIs(Object value) { private int getIndex(Object value) { boolean areStrings = value instanceof String && options instanceof String[]; for (int i = 0; i < options.length; i++) { - if (areStrings && ((String)value).equalsIgnoreCase((String)options[i]) || options[i].equals(value)) { + if (areStrings && ((String) value).equalsIgnoreCase((String) options[i]) || options[i].equals(value)) { return i; } } @@ -85,7 +99,7 @@ public void setValueVisibility(Object value, boolean visible) { public boolean getValueVisibility(Object value) { int idx = getIndex(value); - if(idx < 0) return false; + if (idx < 0) return false; return optionVis[idx]; } @@ -103,7 +117,7 @@ public void tick(InputHandler input) { if (input.inputPressed("cursor-right")) selection++; } - if(prevSel != selection) { + if (prevSel != selection) { Sound.play("select"); moveSelection(selection - prevSel); } @@ -116,14 +130,14 @@ private void moveSelection(int dir) { do { selection += dir; - if(wrap) { + if (wrap) { selection = selection % options.length; - if(selection < 0) selection = options.length - 1; + if (selection < 0) selection = options.length - 1; } else { - selection = Math.min(selection, options.length-1); + selection = Math.min(selection, options.length - 1); selection = Math.max(0, selection); } - } while(!optionVis[selection] && selection != prevSel); + } while (!optionVis[selection] && selection != prevSel); setSelection(selection); } @@ -145,7 +159,7 @@ public String toString() { public void setChangeAction(ChangeListener l) { this.changeAction = l; - if(l != null) + if (l != null) l.onChange(getValue()); } } diff --git a/src/client/java/minicraft/screen/entry/BlankEntry.java b/src/client/java/minicraft/screen/entry/BlankEntry.java index 9f42b58ef..fcad07afc 100644 --- a/src/client/java/minicraft/screen/entry/BlankEntry.java +++ b/src/client/java/minicraft/screen/entry/BlankEntry.java @@ -11,10 +11,12 @@ public BlankEntry() { } @Override - public void tick(InputHandler input) {} + public void tick(InputHandler input) { + } @Override - public void render(Screen screen, int x, int y, boolean isSelected) {} + public void render(Screen screen, int x, int y, boolean isSelected) { + } @Override public int getWidth() { @@ -22,5 +24,7 @@ public int getWidth() { } @Override - public String toString() { return " "; } + public String toString() { + return " "; + } } diff --git a/src/client/java/minicraft/screen/entry/BooleanEntry.java b/src/client/java/minicraft/screen/entry/BooleanEntry.java index 0829bcd4a..a58a9bfe7 100644 --- a/src/client/java/minicraft/screen/entry/BooleanEntry.java +++ b/src/client/java/minicraft/screen/entry/BooleanEntry.java @@ -5,7 +5,7 @@ public class BooleanEntry extends ArrayEntry { public BooleanEntry(String label, boolean initial) { - super(label, true, new Boolean[] {true, false}); + super(label, true, new Boolean[]{true, false}); setSelection(initial ? 0 : 1); } diff --git a/src/client/java/minicraft/screen/entry/InputEntry.java b/src/client/java/minicraft/screen/entry/InputEntry.java index df32e3ba8..5dceb61e4 100644 --- a/src/client/java/minicraft/screen/entry/InputEntry.java +++ b/src/client/java/minicraft/screen/entry/InputEntry.java @@ -22,9 +22,11 @@ public class InputEntry extends ListEntry { public InputEntry(String prompt) { this(prompt, null, 0); } + public InputEntry(String prompt, String regex, int maxLen) { this(prompt, regex, maxLen, ""); } + public InputEntry(String prompt, String regex, int maxLen, String initValue) { this.prompt = prompt; this.regex = regex; @@ -56,7 +58,9 @@ public void tick(InputHandler input) { } } - public String getUserInput() { return userInput; } + public String getUserInput() { + return userInput; + } public String toString() { return Localization.getLocalized(prompt) + (prompt.length() == 0 ? "" : ": ") + userInput; diff --git a/src/client/java/minicraft/screen/entry/ItemEntry.java b/src/client/java/minicraft/screen/entry/ItemEntry.java index 4da6d2a48..cfc17d1c3 100644 --- a/src/client/java/minicraft/screen/entry/ItemEntry.java +++ b/src/client/java/minicraft/screen/entry/ItemEntry.java @@ -17,12 +17,17 @@ public static ItemEntry[] useItems(List items) { private Item item; - public ItemEntry(Item i) { this.item = i; } + public ItemEntry(Item i) { + this.item = i; + } - public Item getItem() { return item; } + public Item getItem() { + return item; + } @Override - public void tick(InputHandler input) {} + public void tick(InputHandler input) { + } @Override public void render(Screen screen, int x, int y, boolean isSelected) { diff --git a/src/client/java/minicraft/screen/entry/ItemListing.java b/src/client/java/minicraft/screen/entry/ItemListing.java index c123f849c..9150366c1 100644 --- a/src/client/java/minicraft/screen/entry/ItemListing.java +++ b/src/client/java/minicraft/screen/entry/ItemListing.java @@ -3,17 +3,19 @@ import minicraft.item.Item; public class ItemListing extends ItemEntry { - + private String info; - + public ItemListing(Item i, String text) { super(i); setSelectable(false); this.info = text; } - - public void setText(String text) { info = text; } - + + public void setText(String text) { + info = text; + } + @Override public String toString() { return " " + info; diff --git a/src/client/java/minicraft/screen/entry/KeyInputEntry.java b/src/client/java/minicraft/screen/entry/KeyInputEntry.java index a21bb8049..2d362fe88 100644 --- a/src/client/java/minicraft/screen/entry/KeyInputEntry.java +++ b/src/client/java/minicraft/screen/entry/KeyInputEntry.java @@ -23,7 +23,7 @@ private void setMapping(String mapping, Set duplicated) { this.mapping = mapping; StringBuilder buffer = new StringBuilder(); - for (int spaces = 0; spaces < Screen.w/Font.textWidth(" ") - action.length() - mapping.length(); spaces++) + for (int spaces = 0; spaces < Screen.w / Font.textWidth(" ") - action.length() - mapping.length(); spaces++) buffer.append(" "); String newMapping = ""; diff --git a/src/client/java/minicraft/screen/entry/LinkEntry.java b/src/client/java/minicraft/screen/entry/LinkEntry.java index 574bc6422..ab994555f 100644 --- a/src/client/java/minicraft/screen/entry/LinkEntry.java +++ b/src/client/java/minicraft/screen/entry/LinkEntry.java @@ -25,11 +25,22 @@ public class LinkEntry extends SelectEntry { // note that if the failMsg should be localized, such must be done before passing them as parameters, for this class will not do it since, by default, the failMsg contains a url. - public LinkEntry(int color, String urlText) { this(color, urlText, urlText, false); } - public LinkEntry(int color, String text, String url) { this(color, text, url, true); } - public LinkEntry(int color, String text, String url, String failMsg) { this(color, text, url, failMsg, true); } + public LinkEntry(int color, String urlText) { + this(color, urlText, urlText, false); + } + + public LinkEntry(int color, String text, String url) { + this(color, text, url, true); + } + + public LinkEntry(int color, String text, String url, String failMsg) { + this(color, text, url, failMsg, true); + } + + public LinkEntry(int color, String text, String url, boolean localize) { + this(color, text, url, Localization.getLocalized("Go to") + ": " + url, localize); + } - public LinkEntry(int color, String text, String url, boolean localize) { this(color, text, url, Localization.getLocalized("Go to") + ": " + url, localize); } public LinkEntry(int color, String text, String url, String failMsg, boolean localize) { super(text, () -> { if (!checkedDesktop) { @@ -40,7 +51,7 @@ public LinkEntry(int color, String text, String url, String failMsg, boolean loc } } - if(canBrowse) { + if (canBrowse) { // try to open the download link directly from the browser. try { URI uri = URI.create(url); @@ -63,5 +74,7 @@ public LinkEntry(int color, String text, String url, String failMsg, boolean loc } @Override - public int getColor(boolean isSelected) { return color; } + public int getColor(boolean isSelected) { + return color; + } } diff --git a/src/client/java/minicraft/screen/entry/ListEntry.java b/src/client/java/minicraft/screen/entry/ListEntry.java index d1b65c4bd..e5913083d 100644 --- a/src/client/java/minicraft/screen/entry/ListEntry.java +++ b/src/client/java/minicraft/screen/entry/ListEntry.java @@ -14,6 +14,7 @@ public abstract class ListEntry { /** * Ticks the entry. Used to handle input from the InputHandler + * * @param input InputHandler used to get player input. */ public abstract void tick(InputHandler input); @@ -36,9 +37,10 @@ public void render(Screen screen, int x, int y, boolean isSelected, String conta /** * Renders the entry to the given screen. * Coordinate origin is in the top left corner of the entry space. - * @param screen Screen to render the entry to - * @param x X coordinate - * @param y Y coordinate + * + * @param screen Screen to render the entry to + * @param x X coordinate + * @param y Y coordinate * @param isSelected true if the entry is selected, false otherwise */ public void render(Screen screen, int x, int y, boolean isSelected) { @@ -53,13 +55,17 @@ public void render(Screen screen, int x, int y, boolean isSelected) { /** * Returns the current color depending on if the entry is selected. + * * @param isSelected true if the entry is selected, false otherwise * @return the current entry color */ - public int getColor(boolean isSelected) { return isSelected ? COL_SLCT : COL_UNSLCT; } + public int getColor(boolean isSelected) { + return isSelected ? COL_SLCT : COL_UNSLCT; + } /** * Calculates the width of the entry. + * * @return the entry's width */ public int getWidth() { @@ -68,6 +74,7 @@ public int getWidth() { /** * Calculates the height of the entry. + * * @return the entry's height */ public static int getHeight() { @@ -76,27 +83,39 @@ public static int getHeight() { /** * Determines if this entry can be selected. + * * @return true if it is visible and can be selected, false otherwise. */ - public final boolean isSelectable() { return selectable && visible; } + public final boolean isSelectable() { + return selectable && visible; + } /** * Returns whether the entry is visible or not. + * * @return true if the entry is visible, false otherwise */ - public final boolean isVisible() { return visible; } + public final boolean isVisible() { + return visible; + } /** * Changes if the entry can be selected or not. + * * @param selectable true if the entry can be selected, false if not */ - public final void setSelectable(boolean selectable) { this.selectable = selectable; } + public final void setSelectable(boolean selectable) { + this.selectable = selectable; + } /** * Changes if the entry is visible or not. + * * @param visible true if the entry should be visible, false if not */ - public final void setVisible(boolean visible) { this.visible = visible; } + public final void setVisible(boolean visible) { + this.visible = visible; + } @Override public abstract String toString(); diff --git a/src/client/java/minicraft/screen/entry/RangeEntry.java b/src/client/java/minicraft/screen/entry/RangeEntry.java index d6356ca9c..a4a8c5311 100644 --- a/src/client/java/minicraft/screen/entry/RangeEntry.java +++ b/src/client/java/minicraft/screen/entry/RangeEntry.java @@ -1,31 +1,31 @@ package minicraft.screen.entry; public class RangeEntry extends ArrayEntry { - + private static Integer[] getIntegerArray(int min, int max) { Integer[] ints = new Integer[max - min + 1]; - + for (int i = 0; i < ints.length; i++) - ints[i] = min+i; - + ints[i] = min + i; + return ints; } - + private int min, max; - + public RangeEntry(String label, int min, int max, int initial) { super(label, false, getIntegerArray(min, max)); - + this.min = min; this.max = max; - + setValue(initial); } - + @Override public void setValue(Object o) { if (!(o instanceof Integer)) return; - - setSelection(((Integer)o)-min); + + setSelection(((Integer) o) - min); } } diff --git a/src/client/java/minicraft/screen/entry/RecipeEntry.java b/src/client/java/minicraft/screen/entry/RecipeEntry.java index 85faa2d46..41fe3fc75 100644 --- a/src/client/java/minicraft/screen/entry/RecipeEntry.java +++ b/src/client/java/minicraft/screen/entry/RecipeEntry.java @@ -24,7 +24,8 @@ public RecipeEntry(Recipe r) { } @Override - public void tick(InputHandler input) {} + public void tick(InputHandler input) { + } @Override public void render(Screen screen, int x, int y, boolean isSelected) { diff --git a/src/client/java/minicraft/screen/entry/SelectEntry.java b/src/client/java/minicraft/screen/entry/SelectEntry.java index c558a0d9e..ede9c2ad2 100644 --- a/src/client/java/minicraft/screen/entry/SelectEntry.java +++ b/src/client/java/minicraft/screen/entry/SelectEntry.java @@ -16,10 +16,14 @@ public class SelectEntry extends ListEntry { * Creates a new entry which acts as a button. * Can do an action when it is selected. * Localizes the provided string. - * @param text Text displayed on this entry + * + * @param text Text displayed on this entry * @param onSelect Action which happens when the entry is selected */ - public SelectEntry(String text, Action onSelect) { this(text, onSelect, true); } + public SelectEntry(String text, Action onSelect) { + this(text, onSelect, true); + } + public SelectEntry(String text, Action onSelect, boolean localize) { this.onSelect = onSelect; this.text = text; @@ -28,11 +32,16 @@ public SelectEntry(String text, Action onSelect, boolean localize) { /** * Changes the text of the entry. + * * @param text new text */ - void setText(String text) { this.text = text; } + void setText(String text) { + this.text = text; + } - public String getText() { return text; } + public String getText() { + return text; + } @Override public void tick(InputHandler input) { @@ -43,8 +52,12 @@ public void tick(InputHandler input) { } @Override - public int getWidth() { return Font.textWidth(toString()); } + public int getWidth() { + return Font.textWidth(toString()); + } @Override - public String toString() { return localize ? Localization.getLocalized(text) : text; } + public String toString() { + return localize ? Localization.getLocalized(text) : text; + } } diff --git a/src/client/java/minicraft/screen/entry/StringEntry.java b/src/client/java/minicraft/screen/entry/StringEntry.java index de22241aa..fd2cf1de5 100644 --- a/src/client/java/minicraft/screen/entry/StringEntry.java +++ b/src/client/java/minicraft/screen/entry/StringEntry.java @@ -23,11 +23,16 @@ public class StringEntry extends ListEntry { public static StringEntry[] useLines(String... lines) { return useLines(DEFAULT_COLOR, lines); } - public static StringEntry[] useLines(int color, String... lines) { return useLines(color, true, lines); } + + public static StringEntry[] useLines(int color, String... lines) { + return useLines(color, true, lines); + } + public static StringEntry[] useLines(int color, boolean localize, String... lines) { ArrayList lns = new ArrayList<>(); for (String l : lines) { - for (String ll : Font.getLines(localize? Localization.getLocalized(l): l, Screen.w-20, Screen.h*2, 0)) lns.add(ll); + for (String ll : Font.getLines(localize ? Localization.getLocalized(l) : l, Screen.w - 20, Screen.h * 2, 0)) + lns.add(ll); } StringEntry[] entries = new StringEntry[lns.size()]; for (int i = 0; i < lns.size(); i++) @@ -39,8 +44,15 @@ public static StringEntry[] useLines(int color, boolean localize, String... line public StringEntry(String text) { this(text, DEFAULT_COLOR); } - public StringEntry(String text, boolean localize) { this(text, DEFAULT_COLOR, localize); } // This might be false as the text might have been localized already. - public StringEntry(String text, int color) { this(text, color, true); } // This should be always true with the new localization IDs. + + public StringEntry(String text, boolean localize) { + this(text, DEFAULT_COLOR, localize); + } // This might be false as the text might have been localized already. + + public StringEntry(String text, int color) { + this(text, color, true); + } // This should be always true with the new localization IDs. + public StringEntry(String text, int color, boolean localize) { setSelectable(false); this.text = text; @@ -53,11 +65,16 @@ public void setText(String text) { } @Override - public void tick(InputHandler input) {} + public void tick(InputHandler input) { + } @Override - public int getColor(boolean isSelected) { return color; } + public int getColor(boolean isSelected) { + return color; + } @Override - public String toString() { return localize? Localization.getLocalized(text): text; } + public String toString() { + return localize ? Localization.getLocalized(text) : text; + } } diff --git a/src/client/java/minicraft/util/AdvancementElement.java b/src/client/java/minicraft/util/AdvancementElement.java index a0c25c5d5..faa784026 100644 --- a/src/client/java/minicraft/util/AdvancementElement.java +++ b/src/client/java/minicraft/util/AdvancementElement.java @@ -32,7 +32,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -/** World-wide. */ +/** + * World-wide. + */ public class AdvancementElement { private static final HashSet recipeUnlockingElements; @@ -100,7 +102,7 @@ public static void loadAdvancementElement(Collection element ElementRewards rewards = loadRewards(json.optJSONObject("rewards")); elements.add(new AdvancementElement(criterionName, - displayable ? json.getString("description"): null, criteria, + displayable ? json.getString("description") : null, criteria, rewards, requirements, unlockingCriteria, unlockingRequirements)); } @@ -144,7 +146,9 @@ public static void loadRecipeUnlockingElements(JSONObject json) { } } - /** Saving and writing all data into the given JSONObject. */ + /** + * Saving and writing all data into the given JSONObject. + */ public static void saveRecipeUnlockingElements(JSONObject json) { recipeUnlockingElements.forEach(element -> element.save(json)); } @@ -204,7 +208,8 @@ public boolean isCompleted() { /** * Marking the criterion as completed if it has not already been completed. - * @param inLoad If this is {@code false}, triggers the status updater. + * + * @param inLoad If this is {@code false}, triggers the status updater. * @param completionTime The completion time. Using the current datetime if this is {@code null}. */ public void markAsCompleted(boolean inLoad, @Nullable LocalDateTime completionTime) { @@ -230,8 +235,13 @@ public ElementRewards(ArrayList items, ArrayList recipes) { this.recipes = recipes; } - public ArrayList getItems() { return new ArrayList<>(items); } - public ArrayList getRecipe() { return new ArrayList<>(recipes); } + public ArrayList getItems() { + return new ArrayList<>(items); + } + + public ArrayList getRecipe() { + return new ArrayList<>(recipes); + } } @SuppressWarnings("unused") @@ -266,8 +276,10 @@ protected void registerCriteria() { }); } - /** Warning: This method should be used carefully as this could impact - * the gaming experience deeply on the progress. */ + /** + * Warning: This method should be used carefully as this could impact + * the gaming experience deeply on the progress. + */ public void deregisterCriteria() { criteria.values().forEach(criterion -> { criterion.trigger.registeredCriteria.remove(criterion); @@ -282,7 +294,9 @@ public boolean isUnlocked() { return unlocked; } - /** Is unlocked but not completed. */ + /** + * Is unlocked but not completed. + */ public boolean isDisplayableAtStatus() { return unlocked && !completed; } @@ -290,9 +304,11 @@ public boolean isDisplayableAtStatus() { public int getNumCriteriaCompleted() { return (int) criteria.values().stream().filter(ElementCriterion::isCompleted).count(); } + public int getTotalNumCriteria() { return criteria.size(); } + public boolean shouldAllCriteriaBeCompleted() { return requirements.isEmpty(); } @@ -314,7 +330,9 @@ protected boolean checkIsCompleted() { })); } - /** Updating and refreshing by the data in this element. */ + /** + * Updating and refreshing by the data in this element. + */ public void update() { registerUnlockingCriteria(); @@ -349,7 +367,10 @@ protected void sendRewards() { } } - public void reset() { reset(true); } + public void reset() { + reset(true); + } + protected void reset(boolean update) { completed = false; unlocked = false; @@ -357,7 +378,9 @@ protected void reset(boolean update) { if (update) update(); } - /** Loading from a JSONObject of an element. */ + /** + * Loading from a JSONObject of an element. + */ public void load(JSONObject json) { reset(false); completed = json.optBoolean("done"); @@ -385,7 +408,9 @@ public void load(JSONObject json) { update(); } - /** Saving and writing data to the root JSONObject */ + /** + * Saving and writing data to the root JSONObject + */ public void save(JSONObject json) { JSONObject elementJson = new JSONObject(); JSONObject criteriaJson = new JSONObject(); @@ -417,7 +442,7 @@ public static abstract class AdvancementTrigger { private static final Set pendingCompletedCriteria = ConcurrentHashMap.newKeySet(); public static void tick() { - for (Iterator it = pendingCompletedCriteria.iterator(); it.hasNext();) { + for (Iterator it = pendingCompletedCriteria.iterator(); it.hasNext(); ) { ElementCriterion criterion = it.next(); criterion.markAsCompleted(false, null); it.remove(); // Action done. @@ -453,18 +478,24 @@ public void register(ElementCriterion criterion) { registeredCriteria.add(criterion); } - /** This should be called by another thread if method {@link #singleThreadNeeded()} is not + /** + * This should be called by another thread if method {@link #singleThreadNeeded()} is not * implemented to return true. If false, this should use {@link #pendingCompletedCriteria} * to mark completed criteria instead of calling it directly as this method should be called - * by the global game tick updater to ensure the synchronization. */ + * by the global game tick updater to ensure the synchronization. + */ protected abstract void trigger0(AdvancementTriggerConditionHandler.AdvancementTriggerConditions conditions); - /** @return {@code true} if this trigger implementation requires single thread as the global game tick updater. */ + /** + * @return {@code true} if this trigger implementation requires single thread as the global game tick updater. + */ protected boolean singleThreadNeeded() { return true; } - /** Triggering and checking passes by another thread. */ + /** + * Triggering and checking passes by another thread. + */ public void trigger(AdvancementTriggerConditionHandler.AdvancementTriggerConditions conditions) { if (!singleThreadNeeded()) executorService.submit(() -> trigger0(conditions)); else trigger0(conditions); @@ -477,20 +508,26 @@ public AdvancementElement.AdvancementTrigger.AdvancementTriggerConditionHandler } public abstract static class AdvancementTriggerConditionHandler { - protected AdvancementTriggerConditionHandler() {} + protected AdvancementTriggerConditionHandler() { + } @NotNull public abstract AdvancementCriterionConditions createCriterionConditions(JSONObject json) throws JSONException; - /** A condition carrier for the corresponding trigger. */ - public abstract static class AdvancementTriggerConditions {} + /** + * A condition carrier for the corresponding trigger. + */ + public abstract static class AdvancementTriggerConditions { + } public abstract static class AdvancementCriterionConditions { - protected AdvancementCriterionConditions() {} + protected AdvancementCriterionConditions() { + } public static class Rangeable> { public final @Nullable T min; public final @Nullable T max; + public Rangeable(@Nullable T min, @Nullable T max) { this.min = min; this.max = max; @@ -514,8 +551,8 @@ private boolean inRange(T value) { public String toString() { return isAbsent(this) ? "" : min == null ? "max: " + max : - max == null ? "min: " + min : - String.format("min: %s;max: %s", min, max); + max == null ? "min: " + min : + String.format("min: %s;max: %s", min, max); } } @@ -523,6 +560,7 @@ public static class ItemConditions { private final HashSet items = new HashSet<>(); private final @Nullable Rangeable count; private final @Nullable Rangeable durability; + private ItemConditions(Set items, @Nullable Rangeable count, @Nullable Rangeable durability) { this.items.addAll(items); this.count = count; @@ -576,7 +614,9 @@ private boolean matches(Item item) { } } - /** Tile location. */ + /** + * Tile location. + */ public static class LocationConditions { private final HashSet tiles = new HashSet<>(); private final @Nullable Integer level; @@ -609,12 +649,14 @@ private static LocationConditions getFromJson(JSONObject json) { try { data = tileJson.getInt("data"); - } catch (JSONException ignored) {} + } catch (JSONException ignored) { + } } try { level = json.getInt("level"); - } catch (JSONException ignored) {} + } catch (JSONException ignored) { + } JSONObject positionJson = json.optJSONObject("position"); if (json.has("x")) try { @@ -664,16 +706,19 @@ protected ImpossibleTrigger() { } @Override - public void register(ElementCriterion criterion) {} // No action. + public void register(ElementCriterion criterion) { + } // No action. @Override - protected void trigger0(AdvancementTriggerConditionHandler.AdvancementTriggerConditions conditions) {} // No action. + protected void trigger0(AdvancementTriggerConditionHandler.AdvancementTriggerConditions conditions) { + } // No action. public static class ImpossibleTriggerConditionHandler extends AdvancementTriggerConditionHandler { @Override public @NotNull AdvancementElement.AdvancementTrigger.AdvancementTriggerConditionHandler.AdvancementCriterionConditions createCriterionConditions(JSONObject json) { - return new AdvancementCriterionConditions() {}; // Empty. + return new AdvancementCriterionConditions() { + }; // Empty. } } } @@ -718,7 +763,9 @@ protected void trigger0(AdvancementTriggerConditionHandler.AdvancementTriggerCon } } - /** Modified from {@link #test(List, List)}. */ + /** + * Modified from {@link #test(List, List)}. + */ private static boolean isConditionalMatched(ArrayList items, HashSet itemConditions) { Set> combinations = new HashSet<>(); @@ -751,7 +798,9 @@ private static boolean isConditionalMatched(ArrayList items, } } - /** Used by {@link #allMatch(Collection, Collection, HashMap)} for conditional check for each element. */ + /** + * Used by {@link #allMatch(Collection, Collection, HashMap)} for conditional check for each element. + */ private static boolean isMatched(Item item, InventoryChangedTriggerConditionHandler.InventoryChangedCriterionConditions.ItemConditions itemConditions, @Nullable String selectedItem) { if (!itemConditions.matches(item)) @@ -759,7 +808,9 @@ private static boolean isMatched(Item item, InventoryChangedTriggerConditionHand return selectedItem == null || item.getName().equalsIgnoreCase(selectedItem); } - /** Modified from {@link #containsAll(List, List)}. */ + /** + * Modified from {@link #containsAll(List, List)}. + */ private static boolean allMatch(Collection source, Collection target, HashMap selectedItems) { for (Item e : source) { @@ -772,7 +823,9 @@ private static boolean allMatch(Collection source, Collection boolean test(List list, List> matcher) { List> combinations = new ArrayList<>(); @@ -784,7 +837,9 @@ private static boolean test(List list, List> matcher) { return false; } - /** Original archive of array elements matching. */ + /** + * Original archive of array elements matching. + */ private static boolean containsAll(List source, List target) { for (T e : source) { target.remove(e); @@ -884,6 +939,7 @@ public static class InventoryChangedCriterionConditions extends AdvancementCrite private final @Nullable Rangeable slotsEmpty; private final @Nullable Rangeable slotsFull; private final @Nullable Rangeable slotsOccupied; + private InventoryChangedCriterionConditions(Set items, @Nullable Rangeable slotsEmpty, @Nullable Rangeable slotsFull, @Nullable Rangeable slotsOccupied) { this.items.addAll(items); @@ -940,7 +996,8 @@ public static class PlacedTileTriggerConditionHandler extends AdvancementTrigger Integer data = null; try { data = json.getInt("data"); - } catch (JSONException ignored) {} + } catch (JSONException ignored) { + } return new PlacedTileCriterionConditions(tile, item, location, data); } diff --git a/src/client/java/minicraft/util/Logging.java b/src/client/java/minicraft/util/Logging.java index 0296d48ee..903acaaeb 100644 --- a/src/client/java/minicraft/util/Logging.java +++ b/src/client/java/minicraft/util/Logging.java @@ -6,7 +6,9 @@ public final class Logging { public static boolean logTime = false; public static boolean logThread = false; - /** Applied only when debug mode is enabled */ + /** + * Applied only when debug mode is enabled + */ public static boolean logTrace = false; public static boolean logLevel = false; public static boolean fileLogFull = false; @@ -34,6 +36,8 @@ public final class Logging { public static final TaggedLogger CONTROLLER = Logger.tag("Controller"); public static final TaggedLogger PLAYER = Logger.tag("Player"); - /** This is defined dynamically. */ + /** + * This is defined dynamically. + */ public static TaggedLogger WORLDNAMED = Logger.tag(null); } diff --git a/src/client/java/minicraft/util/MyUtils.java b/src/client/java/minicraft/util/MyUtils.java index d6416da27..6a0f78614 100644 --- a/src/client/java/minicraft/util/MyUtils.java +++ b/src/client/java/minicraft/util/MyUtils.java @@ -2,7 +2,8 @@ public final class MyUtils { - private MyUtils() {} + private MyUtils() { + } public static int clamp(int val, int min, int max) { if (val > max) return max; @@ -10,7 +11,10 @@ public static int clamp(int val, int min, int max) { return val; } - public static int randInt(int max) { return randInt(0, max); } + public static int randInt(int max) { + return randInt(0, max); + } + public static int randInt(int min, int max) { return (int) (Math.random() * (max - min + 1)) + min; } @@ -23,7 +27,7 @@ public static String plural(int num, String word) { public static void sleep(int millis) { try { Thread.sleep(millis); - } catch(InterruptedException ignored) { + } catch (InterruptedException ignored) { } } diff --git a/src/client/java/minicraft/util/Quest.java b/src/client/java/minicraft/util/Quest.java index 3ab17214a..fb81d669e 100644 --- a/src/client/java/minicraft/util/Quest.java +++ b/src/client/java/minicraft/util/Quest.java @@ -20,7 +20,10 @@ public Quest(String key, String description, Map crite this.parent = parent; } - public QuestSeries getSeries() { return series; } + public QuestSeries getSeries() { + return series; + } + public @Nullable Quest getParent() { if (parent != null && series != null) { return series.quests.get(parent); @@ -61,7 +64,9 @@ public QuestSeries(String key, String description, Map q.series = this); } - public HashMap getSeriesQuests() { return new HashMap<>(quests); } + public HashMap getSeriesQuests() { + return new HashMap<>(quests); + } @Override protected boolean checkIsCompleted() { diff --git a/src/client/java/minicraft/util/TinylogLoggingConfiguration.java b/src/client/java/minicraft/util/TinylogLoggingConfiguration.java index 2d6af6ea9..174bff62f 100644 --- a/src/client/java/minicraft/util/TinylogLoggingConfiguration.java +++ b/src/client/java/minicraft/util/TinylogLoggingConfiguration.java @@ -40,7 +40,10 @@ public static class TagList { private Set tags = null; private final boolean all; - public TagList(boolean all) { this.all = all; } + public TagList(boolean all) { + this.all = all; + } + public TagList(Set tags) { this.tags = tags; all = false; @@ -119,12 +122,14 @@ public Set computeLevelsFromMinimum(Level minimum) { return levels; } - /** Generate all possible instances of console writer (writer1) with the configuration. */ + /** + * Generate all possible instances of console writer (writer1) with the configuration. + */ public HashMap generateConsoleWriters() { HashMap map = new HashMap<>(); - for (final boolean i : new boolean[] { false, true}) { - for (final boolean j : new boolean[] { false, true}) { - for (final boolean k : new boolean[] { false, true}) { + for (final boolean i : new boolean[]{false, true}) { + for (final boolean j : new boolean[]{false, true}) { + for (final boolean k : new boolean[]{false, true}) { map.putAll(createConsoleWriter(i, j, k)); } } @@ -132,7 +137,10 @@ public HashMap generateConsoleWriters() { return map; } - /** Generate a console writer with the configuration. */ + + /** + * Generate a console writer with the configuration. + */ public Map createConsoleWriter(boolean logTime, boolean logThread, boolean logTrace) { HashMap properties = new HashMap<>(); String ID = String.format("writer1%s%s%s", logTime ? "T" : "F", logThread ? "T" : "F", logTrace ? "T" : "F"); @@ -148,33 +156,24 @@ public Map createConsoleWriter(boolean logTime, boo return Collections.singletonMap(new ConsoleWriter(properties), new WriterConfig(ID, computeLevelsFromMinimum(level), new TagList(true))); } - /** + /** * Creates a new log entry. * - * @param stackTraceElement - * Optional stack trace element of caller - * @param tag - * Tag name if issued from a tagged logger - * @param level - * Severity level - * @param exception - * Caught exception or throwable to log - * @param formatter - * Formatter for text message - * @param obj - * Message to log - * @param arguments - * Arguments for message - * @param required - * The required log entry value array slice of the tag index of the used tag - * @param contextProvider - * The context provider + * @param stackTraceElement Optional stack trace element of caller + * @param tag Tag name if issued from a tagged logger + * @param level Severity level + * @param exception Caught exception or throwable to log + * @param formatter Formatter for text message + * @param obj Message to log + * @param arguments Arguments for message + * @param required The required log entry value array slice of the tag index of the used tag + * @param contextProvider The context provider * @return Filled log entry */ public static LogEntry createLogEntry(final StackTraceElement stackTraceElement, final String tag, - final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, - final Object[] arguments, final Collection required, - final TinylogContextProvider contextProvider) { + final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, + final Object[] arguments, final Collection required, + final TinylogContextProvider contextProvider) { Timestamp timestamp = RuntimeProvider.createTimestamp(); Thread thread = required.contains(LogEntryValue.THREAD) ? Thread.currentThread() : null; diff --git a/src/client/java/minicraft/util/TinylogLoggingProvider.java b/src/client/java/minicraft/util/TinylogLoggingProvider.java index cd465be0e..f076f8aab 100644 --- a/src/client/java/minicraft/util/TinylogLoggingProvider.java +++ b/src/client/java/minicraft/util/TinylogLoggingProvider.java @@ -24,7 +24,9 @@ import java.util.HashMap; import java.util.function.Consumer; -/** Originally copied from {@link org.tinylog.core.TinylogLoggingProvider} */ +/** + * Originally copied from {@link org.tinylog.core.TinylogLoggingProvider} + */ public class TinylogLoggingProvider implements LoggingProvider { private final TinylogContextProvider context; @@ -39,7 +41,9 @@ public class TinylogLoggingProvider implements LoggingProvider { private ConsoleWriter currentConsoleWriter; private FileWriter currentFileWriter; - /** */ + /** + * + */ public TinylogLoggingProvider() { TinylogLoggingConfiguration config = new TinylogLoggingConfiguration(); context = new TinylogContextProvider(); @@ -73,7 +77,7 @@ public TinylogLoggingProvider() { ctr.setAccessible(true); writingThread = ctr.newInstance(writers.keySet()); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException - | NoSuchMethodException | SecurityException | ClassNotFoundException e) { + | NoSuchMethodException | SecurityException | ClassNotFoundException e) { throw new RuntimeException(e); } @@ -90,7 +94,9 @@ public TinylogLoggingProvider() { } } - /** Applying the configuration in {@link Logging} */ + /** + * Applying the configuration in {@link Logging} + */ public void init() { currentConsoleWriter = consoleWriters.get(String.format("writer1%s%s%s", Logging.logTime ? "T" : "F", Logging.logThread ? "T" : "F", Logging.logTrace ? "T" : "F")); currentFileWriter = fileWriters.get("writer2" + (Logging.fileLogFull ? "Full" : "")); @@ -118,7 +124,7 @@ public boolean isEnabled(final int depth, final String tag, final Level level) { @Override public void log(final int depth, final String tag, final Level level, final Throwable exception, final MessageFormatter formatter, - final Object obj, final Object... arguments) { + final Object obj, final Object... arguments) { StackTraceElement stackTraceElement; if (fullStackTraceRequired.get(currentConsoleWriter) || tag.equals("LOC")) { stackTraceElement = RuntimeProvider.getCallerStackTraceElement(depth + 1); @@ -135,7 +141,7 @@ public void log(final int depth, final String tag, final Level level, final Thro @Override public void log(final String loggerClassName, final String tag, final Level level, final Throwable exception, - final MessageFormatter formatter, final Object obj, final Object... arguments) { + final MessageFormatter formatter, final Object obj, final Object... arguments) { StackTraceElement stackTraceElement; if (fullStackTraceRequired.get(currentConsoleWriter) || tag.equals("LOC")) { stackTraceElement = RuntimeProvider.getCallerStackTraceElement(loggerClassName); @@ -170,11 +176,11 @@ public void shutdown() throws InterruptedException { * Outputs a log entry to all passed writers. */ private void output(final StackTraceElement stackTraceElement, final String tag, - final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, - final Object[] arguments) { + final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, + final Object[] arguments) { LogEntry logEntry = TinylogLoggingConfiguration.createLogEntry(stackTraceElement, tag, level, exception, formatter, - obj, arguments, requiredLogEntryValues, context); + obj, arguments, requiredLogEntryValues, context); Consumer addToThread = writer -> { WriterConfig cfg = writers.get(writer); diff --git a/src/client/java/minicraft/util/TutorialElement.java b/src/client/java/minicraft/util/TutorialElement.java index 9c60f5790..a21558cff 100644 --- a/src/client/java/minicraft/util/TutorialElement.java +++ b/src/client/java/minicraft/util/TutorialElement.java @@ -11,7 +11,9 @@ public TutorialElement(String key, String description, Map(), new HashMap<>(), new HashSet<>()); } - /** Updating and refreshing by the data in this element. */ + /** + * Updating and refreshing by the data in this element. + */ public void update() { super.update(); TutorialDisplayHandler.updateCompletedElement(this); diff --git a/src/client/java/minicraft/util/Vector2.java b/src/client/java/minicraft/util/Vector2.java index 04598c2d8..703c67352 100644 --- a/src/client/java/minicraft/util/Vector2.java +++ b/src/client/java/minicraft/util/Vector2.java @@ -10,15 +10,15 @@ public Vector2(double x, double y) { public Vector2 normalized() { double max = Math.max(x, y); - return new Vector2(x/max, y/max); + return new Vector2(x / max, y / max); } public static Vector2 normalize(Vector2 vec) { double max = Math.max(vec.x, vec.y); - return new Vector2(vec.x/max, vec.y/max); + return new Vector2(vec.x / max, vec.y / max); } public static double distance(double x, double y) { - return Math.sqrt(x*x + y*y); + return Math.sqrt(x * x + y * y); } } diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 335f7e8c2..871290c16 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -21,7 +21,9 @@ ], "rewards": { "recipes": { - "Workbench_1": ["Wood_10"] + "Workbench_1": [ + "Wood_10" + ] } } }, @@ -60,7 +62,10 @@ ], "rewards": { "recipes": { - "Torch_2": ["Wood_1", "coal_1"] + "Torch_2": [ + "Wood_1", + "coal_1" + ] } } }, @@ -86,7 +91,9 @@ ], "rewards": { "recipes": { - "plank_2": ["Wood_1"] + "plank_2": [ + "Wood_1" + ] } } }, @@ -112,7 +119,9 @@ ], "rewards": { "recipes": { - "Plank Wall_1": ["plank_3"] + "Plank Wall_1": [ + "plank_3" + ] } } }, @@ -138,7 +147,9 @@ ], "rewards": { "recipes": { - "Wood Door_1": ["plank_5"] + "Wood Door_1": [ + "plank_5" + ] } } }, @@ -190,7 +201,11 @@ ], "rewards": { "recipes": { - "Lantern_1": ["Wood_8", "slime_4", "glass_3"] + "Lantern_1": [ + "Wood_8", + "slime_4", + "glass_3" + ] } } }, @@ -216,7 +231,9 @@ ], "rewards": { "recipes": { - "Stone Brick_1": ["Stone_2"] + "Stone Brick_1": [ + "Stone_2" + ] } } }, @@ -242,7 +259,9 @@ ], "rewards": { "recipes": { - "Stone Brick_1": ["Stone_2"] + "Stone Brick_1": [ + "Stone_2" + ] } } }, @@ -268,7 +287,9 @@ ], "rewards": { "recipes": { - "Stone Wall_1": ["Stone Brick_3"] + "Stone Wall_1": [ + "Stone Brick_3" + ] } } }, @@ -294,7 +315,9 @@ ], "rewards": { "recipes": { - "Stone Door_1": ["Stone Brick_5"] + "Stone Door_1": [ + "Stone Brick_5" + ] } } }, @@ -320,7 +343,9 @@ ], "rewards": { "recipes": { - "Obsidian Brick_1": ["Raw Obsidian_2"] + "Obsidian Brick_1": [ + "Raw Obsidian_2" + ] } } }, @@ -346,7 +371,9 @@ ], "rewards": { "recipes": { - "Ornate Obsidian_1": ["Raw Obsidian_2"] + "Ornate Obsidian_1": [ + "Raw Obsidian_2" + ] } } }, @@ -372,7 +399,9 @@ ], "rewards": { "recipes": { - "Obsidian Wall_1": ["Obsidian Brick_3"] + "Obsidian Wall_1": [ + "Obsidian Brick_3" + ] } } }, @@ -398,7 +427,9 @@ ], "rewards": { "recipes": { - "Obsidian Door_1": ["Obsidian Brick_5"] + "Obsidian Door_1": [ + "Obsidian Brick_5" + ] } } }, @@ -424,7 +455,9 @@ ], "rewards": { "recipes": { - "Oven_1": ["Stone_15"] + "Oven_1": [ + "Stone_15" + ] } } }, @@ -450,7 +483,9 @@ ], "rewards": { "recipes": { - "Furnace_1": ["Stone_20"] + "Furnace_1": [ + "Stone_20" + ] } } }, @@ -502,7 +537,11 @@ ], "rewards": { "recipes": { - "Enchanter_1": ["Wood_5", "String_2", "Lapis_10"] + "Enchanter_1": [ + "Wood_5", + "String_2", + "Lapis_10" + ] } } }, @@ -528,7 +567,9 @@ ], "rewards": { "recipes": { - "Chest_1": ["Wood_20"] + "Chest_1": [ + "Wood_20" + ] } } }, @@ -554,7 +595,9 @@ ], "rewards": { "recipes": { - "Anvil_1": ["iron_5"] + "Anvil_1": [ + "iron_5" + ] } } }, @@ -593,7 +636,10 @@ ], "rewards": { "recipes": { - "Tnt_1": ["Gunpowder_10", "Sand_8"] + "Tnt_1": [ + "Gunpowder_10", + "Sand_8" + ] } } }, @@ -632,7 +678,10 @@ ], "rewards": { "recipes": { - "Loom_1": ["Wood_10", "Wool_5"] + "Loom_1": [ + "Wood_10", + "Wool_5" + ] } } }, @@ -671,7 +720,10 @@ ], "rewards": { "recipes": { - "Wood Fishing Rod_1": ["Wood_10", "String_3"] + "Wood Fishing Rod_1": [ + "Wood_10", + "String_3" + ] } } }, @@ -710,7 +762,10 @@ ], "rewards": { "recipes": { - "Iron Fishing Rod_1": ["Iron_10", "String_3"] + "Iron Fishing Rod_1": [ + "Iron_10", + "String_3" + ] } } }, @@ -749,7 +804,10 @@ ], "rewards": { "recipes": { - "Gold Fishing Rod_1": ["Gold_10", "String_3"] + "Gold Fishing Rod_1": [ + "Gold_10", + "String_3" + ] } } }, @@ -788,7 +846,10 @@ ], "rewards": { "recipes": { - "Gem Fishing Rod_1": ["Gem_10", "String_3"] + "Gem Fishing Rod_1": [ + "Gem_10", + "String_3" + ] } } }, @@ -814,7 +875,9 @@ ], "rewards": { "recipes": { - "Wood Sword_1": ["Wood_5"] + "Wood Sword_1": [ + "Wood_5" + ] } } }, @@ -840,7 +903,9 @@ ], "rewards": { "recipes": { - "Wood Axe_1": ["Wood_5"] + "Wood Axe_1": [ + "Wood_5" + ] } } }, @@ -866,7 +931,9 @@ ], "rewards": { "recipes": { - "Wood Hoe_1": ["Wood_5"] + "Wood Hoe_1": [ + "Wood_5" + ] } } }, @@ -892,7 +959,9 @@ ], "rewards": { "recipes": { - "Wood Pickaxe_1": ["Wood_5"] + "Wood Pickaxe_1": [ + "Wood_5" + ] } } }, @@ -918,7 +987,9 @@ ], "rewards": { "recipes": { - "Wood Shovel_1": ["Wood_5"] + "Wood Shovel_1": [ + "Wood_5" + ] } } }, @@ -957,7 +1028,10 @@ ], "rewards": { "recipes": { - "Wood Bow_1": ["Wood_5", "string_2"] + "Wood Bow_1": [ + "Wood_5", + "string_2" + ] } } }, @@ -996,7 +1070,10 @@ ], "rewards": { "recipes": { - "Rock Sword_1": ["Wood_5", "Stone_5"] + "Rock Sword_1": [ + "Wood_5", + "Stone_5" + ] } } }, @@ -1035,7 +1112,10 @@ ], "rewards": { "recipes": { - "Rock Sword_1": ["Wood_5", "Stone_5"] + "Rock Sword_1": [ + "Wood_5", + "Stone_5" + ] } } }, @@ -1074,7 +1154,10 @@ ], "rewards": { "recipes": { - "Rock Axe_1": ["Wood_5", "Stone_5"] + "Rock Axe_1": [ + "Wood_5", + "Stone_5" + ] } } }, @@ -1113,7 +1196,10 @@ ], "rewards": { "recipes": { - "Rock Pickaxe_1": ["Wood_5", "Stone_5"] + "Rock Pickaxe_1": [ + "Wood_5", + "Stone_5" + ] } } }, @@ -1152,7 +1238,10 @@ ], "rewards": { "recipes": { - "Rock Shovel_1": ["Wood_5", "Stone_5"] + "Rock Shovel_1": [ + "Wood_5", + "Stone_5" + ] } } }, @@ -1204,7 +1293,11 @@ ], "rewards": { "recipes": { - "Rock Bow_1": ["Wood_5", "Stone_5", "string_2"] + "Rock Bow_1": [ + "Wood_5", + "Stone_5", + "string_2" + ] } } }, @@ -1243,7 +1336,10 @@ ], "rewards": { "recipes": { - "arrow_3": ["Wood_2", "Stone_2"] + "arrow_3": [ + "Wood_2", + "Stone_2" + ] } } }, @@ -1269,7 +1365,9 @@ ], "rewards": { "recipes": { - "Leather Armor_1": ["leather_10"] + "Leather Armor_1": [ + "leather_10" + ] } } }, @@ -1295,7 +1393,9 @@ ], "rewards": { "recipes": { - "Snake Armor_1": ["scale_15"] + "Snake Armor_1": [ + "scale_15" + ] } } }, @@ -1321,7 +1421,9 @@ ], "rewards": { "recipes": { - "String_2": ["Wool_1"] + "String_2": [ + "Wool_1" + ] } } }, @@ -1360,7 +1462,10 @@ ], "rewards": { "recipes": { - "red wool_1": ["Wool_1", "rose_1"] + "red wool_1": [ + "Wool_1", + "rose_1" + ] } } }, @@ -1399,7 +1504,10 @@ ], "rewards": { "recipes": { - "blue wool_1": ["Wool_1", "Lapis_1"] + "blue wool_1": [ + "Wool_1", + "Lapis_1" + ] } } }, @@ -1438,7 +1546,10 @@ ], "rewards": { "recipes": { - "green wool_1": ["Wool_1", "Cactus_1"] + "green wool_1": [ + "Wool_1", + "Cactus_1" + ] } } }, @@ -1477,7 +1588,10 @@ ], "rewards": { "recipes": { - "yellow wool_1": ["Wool_1", "Flower_1"] + "yellow wool_1": [ + "Wool_1", + "Flower_1" + ] } } }, @@ -1516,7 +1630,10 @@ ], "rewards": { "recipes": { - "black wool_1": ["Wool_1", "coal_1"] + "black wool_1": [ + "Wool_1", + "coal_1" + ] } } }, @@ -1555,7 +1672,10 @@ ], "rewards": { "recipes": { - "Bed_1": ["Wood_5", "Wool_3"] + "Bed_1": [ + "Wood_5", + "Wool_3" + ] } } }, @@ -1594,7 +1714,10 @@ ], "rewards": { "recipes": { - "blue clothes_1": ["cloth_5", "Lapis_1"] + "blue clothes_1": [ + "cloth_5", + "Lapis_1" + ] } } }, @@ -1633,7 +1756,10 @@ ], "rewards": { "recipes": { - "green clothes_1": ["cloth_5", "Cactus_1"] + "green clothes_1": [ + "cloth_5", + "Cactus_1" + ] } } }, @@ -1672,7 +1798,10 @@ ], "rewards": { "recipes": { - "yellow clothes_1": ["cloth_5", "Flower_1"] + "yellow clothes_1": [ + "cloth_5", + "Flower_1" + ] } } }, @@ -1711,7 +1840,10 @@ ], "rewards": { "recipes": { - "black clothes_1": ["cloth_5", "coal_1"] + "black clothes_1": [ + "cloth_5", + "coal_1" + ] } } }, @@ -1763,7 +1895,11 @@ ], "rewards": { "recipes": { - "orange clothes_1": ["cloth_5", "rose_1", "Flower_1"] + "orange clothes_1": [ + "cloth_5", + "rose_1", + "Flower_1" + ] } } }, @@ -1815,7 +1951,11 @@ ], "rewards": { "recipes": { - "purple clothes_1": ["cloth_5", "Lapis_1", "rose_1"] + "purple clothes_1": [ + "cloth_5", + "Lapis_1", + "rose_1" + ] } } }, @@ -1867,7 +2007,11 @@ ], "rewards": { "recipes": { - "cyan clothes_1": ["cloth_5", "Lapis_1", "Cactus_1"] + "cyan clothes_1": [ + "cloth_5", + "Lapis_1", + "Cactus_1" + ] } } }, @@ -1893,7 +2037,9 @@ ], "rewards": { "recipes": { - "reg clothes_1": ["cloth_5"] + "reg clothes_1": [ + "cloth_5" + ] } } }, @@ -1919,7 +2065,9 @@ ], "rewards": { "recipes": { - "Iron Armor_1": ["iron_10"] + "Iron Armor_1": [ + "iron_10" + ] } } }, @@ -1945,7 +2093,9 @@ ], "rewards": { "recipes": { - "Gold Armor_1": ["gold_10"] + "Gold Armor_1": [ + "gold_10" + ] } } }, @@ -1971,7 +2121,9 @@ ], "rewards": { "recipes": { - "Gem Armor_1": ["gem_65"] + "Gem Armor_1": [ + "gem_65" + ] } } }, @@ -1997,7 +2149,9 @@ ], "rewards": { "recipes": { - "Empty Bucket_1": ["iron_5"] + "Empty Bucket_1": [ + "iron_5" + ] } } }, @@ -2049,7 +2203,11 @@ ], "rewards": { "recipes": { - "Iron Lantern_1": ["iron_8", "slime_5", "glass_4"] + "Iron Lantern_1": [ + "iron_8", + "slime_5", + "glass_4" + ] } } }, @@ -2101,7 +2259,11 @@ ], "rewards": { "recipes": { - "Gold Lantern_1": ["gold_10", "slime_5", "glass_4"] + "Gold Lantern_1": [ + "gold_10", + "slime_5", + "glass_4" + ] } } }, @@ -2140,7 +2302,10 @@ ], "rewards": { "recipes": { - "Iron Sword_1": ["Wood_5", "iron_5"] + "Iron Sword_1": [ + "Wood_5", + "iron_5" + ] } } }, @@ -2179,7 +2344,10 @@ ], "rewards": { "recipes": { - "Iron Claymore_1": ["Iron Sword_1", "shard_15"] + "Iron Claymore_1": [ + "Iron Sword_1", + "shard_15" + ] } } }, @@ -2218,7 +2386,10 @@ ], "rewards": { "recipes": { - "Iron Axe_1": ["Wood_5", "iron_5"] + "Iron Axe_1": [ + "Wood_5", + "iron_5" + ] } } }, @@ -2257,7 +2428,10 @@ ], "rewards": { "recipes": { - "Iron Hoe_1": ["Wood_5", "iron_5"] + "Iron Hoe_1": [ + "Wood_5", + "iron_5" + ] } } }, @@ -2296,7 +2470,10 @@ ], "rewards": { "recipes": { - "Iron Pickaxe_1": ["Wood_5", "iron_5"] + "Iron Pickaxe_1": [ + "Wood_5", + "iron_5" + ] } } }, @@ -2335,7 +2512,10 @@ ], "rewards": { "recipes": { - "Iron Shovel_1": ["Wood_5", "iron_5"] + "Iron Shovel_1": [ + "Wood_5", + "iron_5" + ] } } }, @@ -2387,7 +2567,11 @@ ], "rewards": { "recipes": { - "Iron Bow_1": ["Wood_5", "iron_5", "string_2"] + "Iron Bow_1": [ + "Wood_5", + "iron_5", + "string_2" + ] } } }, @@ -2426,7 +2610,10 @@ ], "rewards": { "recipes": { - "Gold Sword_1": ["Wood_5", "gold_5"] + "Gold Sword_1": [ + "Wood_5", + "gold_5" + ] } } }, @@ -2465,7 +2652,10 @@ ], "rewards": { "recipes": { - "Gold Claymore_1": ["Gold Sword_1", "shard_15"] + "Gold Claymore_1": [ + "Gold Sword_1", + "shard_15" + ] } } }, @@ -2504,7 +2694,10 @@ ], "rewards": { "recipes": { - "Gold Axe_1": ["Wood_5", "gold_5"] + "Gold Axe_1": [ + "Wood_5", + "gold_5" + ] } } }, @@ -2543,7 +2736,10 @@ ], "rewards": { "recipes": { - "Gold Hoe_1": ["Wood_5", "gold_5"] + "Gold Hoe_1": [ + "Wood_5", + "gold_5" + ] } } }, @@ -2582,7 +2778,10 @@ ], "rewards": { "recipes": { - "Gold Pickaxe_1": ["Wood_5", "gold_5"] + "Gold Pickaxe_1": [ + "Wood_5", + "gold_5" + ] } } }, @@ -2621,7 +2820,10 @@ ], "rewards": { "recipes": { - "Gold Shovel_1": ["Wood_5", "gold_5"] + "Gold Shovel_1": [ + "Wood_5", + "gold_5" + ] } } }, @@ -2673,7 +2875,11 @@ ], "rewards": { "recipes": { - "Gold Bow_1": ["Wood_5", "gold_5", "string_2"] + "Gold Bow_1": [ + "Wood_5", + "gold_5", + "string_2" + ] } } }, @@ -2712,7 +2918,10 @@ ], "rewards": { "recipes": { - "Gem Sword_1": ["Wood_5", "gem_50"] + "Gem Sword_1": [ + "Wood_5", + "gem_50" + ] } } }, @@ -2751,7 +2960,10 @@ ], "rewards": { "recipes": { - "Gem Claymore_1": ["Gem Sword_1", "shard_15"] + "Gem Claymore_1": [ + "Gem Sword_1", + "shard_15" + ] } } }, @@ -2790,7 +3002,10 @@ ], "rewards": { "recipes": { - "Gem Axe_1": ["Wood_5", "gem_50"] + "Gem Axe_1": [ + "Wood_5", + "gem_50" + ] } } }, @@ -2829,7 +3044,10 @@ ], "rewards": { "recipes": { - "Gem Hoe_1": ["Wood_5", "gem_50"] + "Gem Hoe_1": [ + "Wood_5", + "gem_50" + ] } } }, @@ -2868,7 +3086,10 @@ ], "rewards": { "recipes": { - "Gem Pickaxe_1": ["Wood_5", "gem_50"] + "Gem Pickaxe_1": [ + "Wood_5", + "gem_50" + ] } } }, @@ -2907,7 +3128,10 @@ ], "rewards": { "recipes": { - "Gem Shovel_1": ["Wood_5", "gem_50"] + "Gem Shovel_1": [ + "Wood_5", + "gem_50" + ] } } }, @@ -2959,7 +3183,11 @@ ], "rewards": { "recipes": { - "Gem Bow_1": ["Wood_5", "gem_50", "string_2"] + "Gem Bow_1": [ + "Wood_5", + "gem_50", + "string_2" + ] } } }, @@ -2985,7 +3213,9 @@ ], "rewards": { "recipes": { - "Shears_1": ["Iron_4"] + "Shears_1": [ + "Iron_4" + ] } } }, @@ -3024,7 +3254,10 @@ ], "rewards": { "recipes": { - "iron_1": ["iron Ore_4", "coal_1"] + "iron_1": [ + "iron Ore_4", + "coal_1" + ] } } }, @@ -3063,7 +3296,10 @@ ], "rewards": { "recipes": { - "gold_1": ["gold Ore_4", "coal_1"] + "gold_1": [ + "gold Ore_4", + "coal_1" + ] } } }, @@ -3102,7 +3338,10 @@ ], "rewards": { "recipes": { - "glass_1": ["sand_4", "coal_1"] + "glass_1": [ + "sand_4", + "coal_1" + ] } } }, @@ -3128,7 +3367,9 @@ ], "rewards": { "recipes": { - "glass bottle_1": ["glass_3"] + "glass bottle_1": [ + "glass_3" + ] } } }, @@ -3167,7 +3408,10 @@ ], "rewards": { "recipes": { - "cooked pork_1": ["raw pork_1", "coal_1"] + "cooked pork_1": [ + "raw pork_1", + "coal_1" + ] } } }, @@ -3206,7 +3450,10 @@ ], "rewards": { "recipes": { - "steak_1": ["raw beef_1", "coal_1"] + "steak_1": [ + "raw beef_1", + "coal_1" + ] } } }, @@ -3245,7 +3492,10 @@ ], "rewards": { "recipes": { - "cooked fish_1": ["raw fish_1", "coal_1"] + "cooked fish_1": [ + "raw fish_1", + "coal_1" + ] } } }, @@ -3271,7 +3521,9 @@ ], "rewards": { "recipes": { - "bread_1": ["wheat_4"] + "bread_1": [ + "wheat_4" + ] } } }, @@ -3297,7 +3549,9 @@ ], "rewards": { "recipes": { - "Baked Potato_1": ["Potato_1"] + "Baked Potato_1": [ + "Potato_1" + ] } } }, @@ -3336,7 +3590,10 @@ ], "rewards": { "recipes": { - "Gold Apple_1": ["apple_1", "gold_8"] + "Gold Apple_1": [ + "apple_1", + "gold_8" + ] } } }, @@ -3375,7 +3632,10 @@ ], "rewards": { "recipes": { - "awkward potion_1": ["glass bottle_1", "Lapis_3"] + "awkward potion_1": [ + "glass bottle_1", + "Lapis_3" + ] } } }, @@ -3414,7 +3674,10 @@ ], "rewards": { "recipes": { - "speed potion_1": ["awkward potion_1", "Cactus_5"] + "speed potion_1": [ + "awkward potion_1", + "Cactus_5" + ] } } }, @@ -3453,7 +3716,10 @@ ], "rewards": { "recipes": { - "light potion_1": ["awkward potion_1", "slime_5"] + "light potion_1": [ + "awkward potion_1", + "slime_5" + ] } } }, @@ -3492,7 +3758,10 @@ ], "rewards": { "recipes": { - "swim potion_1": ["awkward potion_1", "raw fish_5"] + "swim potion_1": [ + "awkward potion_1", + "raw fish_5" + ] } } }, @@ -3544,7 +3813,11 @@ ], "rewards": { "recipes": { - "haste potion_1": ["awkward potion_1", "Wood_5", "Stone_5"] + "haste potion_1": [ + "awkward potion_1", + "Wood_5", + "Stone_5" + ] } } }, @@ -3583,7 +3856,10 @@ ], "rewards": { "recipes": { - "lava potion_1": ["awkward potion_1", "Lava Bucket_1"] + "lava potion_1": [ + "awkward potion_1", + "Lava Bucket_1" + ] } } }, @@ -3622,7 +3898,10 @@ ], "rewards": { "recipes": { - "energy potion_1": ["awkward potion_1", "gem_25"] + "energy potion_1": [ + "awkward potion_1", + "gem_25" + ] } } }, @@ -3661,7 +3940,10 @@ ], "rewards": { "recipes": { - "regen potion_1": ["awkward potion_1", "Gold Apple_1"] + "regen potion_1": [ + "awkward potion_1", + "Gold Apple_1" + ] } } }, @@ -3713,7 +3995,11 @@ ], "rewards": { "recipes": { - "Health potion_1": ["awkward potion_1", "GunPowder_2", "Leather Armor_1"] + "Health potion_1": [ + "awkward potion_1", + "GunPowder_2", + "Leather Armor_1" + ] } } }, @@ -3765,7 +4051,11 @@ ], "rewards": { "recipes": { - "Escape potion_1": ["awkward potion_1", "GunPowder_3", "Lapis_7"] + "Escape potion_1": [ + "awkward potion_1", + "GunPowder_3", + "Lapis_7" + ] } } }, @@ -3830,7 +4120,12 @@ ], "rewards": { "recipes": { - "Totem of Air_1": ["gold_10", "gem_10", "Lapis_5","Cloud Ore_5"] + "Totem of Air_1": [ + "gold_10", + "gem_10", + "Lapis_5", + "Cloud Ore_5" + ] } } } diff --git a/src/client/resources/tinylog.properties b/src/client/resources/tinylog.properties index 0db23bc41..f303f6b62 100644 --- a/src/client/resources/tinylog.properties +++ b/src/client/resources/tinylog.properties @@ -1,33 +1,27 @@ # suppress inspection "UnusedProperty" for whole file # If there is any modification in this file, # minicraft.util.TinylogLoggingProvider and/or minicraft.util.TinylogLoggingConfiguration might also need to be modified. - # Note: # "@" in writer.tag is not implemented as an extra parameter here. - -provider = minicraft.util.TinylogLoggingProvider -writingthread = true # This is always true. - +provider=minicraft.util.TinylogLoggingProvider +writingthread=true # This is always true. # Logging to console # All console writers are generated directly by minicraft.util.TinylogLoggingConfiguration. - # Log file -writer2 = file -writer2.level = trace -writer2.file = logs/log.txt -writer2.charset = UTF-8 -writer2.format = {date: HH:mm:ss.SSS} [{tag}] {level}: {message} - -writer2Full = file -writer2Full.level = trace -writer2Full.file = logs/log.txt -writer2Full.charset = UTF-8 -writer2Full.format = {date: yyyy-MM-dd HH:mm:ss.SSSSSSSSS} [{thread-id}/{thread}] [{tag}] {level}: {message} - +writer2=file +writer2.level=trace +writer2.file=logs/log.txt +writer2.charset=UTF-8 +writer2.format={date: HH:mm:ss.SSS} [{tag}] {level}: {message} +writer2Full=file +writer2Full.level=trace +writer2Full.file=logs/log.txt +writer2Full.charset=UTF-8 +writer2Full.format={date: yyyy-MM-dd HH:mm:ss.SSSSSSSSS} [{thread-id}/{thread}] [{tag}] {level}: {message} # Localization message file -writer3 = file -writer3.level = trace -writer3.file = logs/unlocalized.txt -writer3.charset = UTF-8 -writer3.format = [{file}#L{line}] [{class}#{method}]: {message-only} -writer3.tag = LOC +writer3=file +writer3.level=trace +writer3.file=logs/unlocalized.txt +writer3.charset=UTF-8 +writer3.format=[{file}#L{line}] [{class}#{method}]: {message-only} +writer3.tag=LOC From 0226f002dc4514742f8563875b4a88bc735c158e Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 31 Dec 2023 01:55:49 +0800 Subject: [PATCH 135/261] Reduce light radius check for mob despawning --- .../java/minicraft/entity/mob/MobAi.java | 20 ++++++++++++++----- src/client/java/minicraft/level/Level.java | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/MobAi.java b/src/client/java/minicraft/entity/mob/MobAi.java index 2652fedf7..813192735 100644 --- a/src/client/java/minicraft/entity/mob/MobAi.java +++ b/src/client/java/minicraft/entity/mob/MobAi.java @@ -2,15 +2,19 @@ import minicraft.core.io.Sound; import minicraft.entity.Direction; +import minicraft.entity.Entity; import minicraft.entity.furniture.Lantern; import minicraft.entity.particle.TextParticle; import minicraft.gfx.Color; +import minicraft.gfx.Point; import minicraft.gfx.Rectangle; import minicraft.gfx.Screen; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.item.Item; import minicraft.item.PotionType; import minicraft.level.Level; +import minicraft.level.tile.Tile; +import minicraft.level.tile.TorchTile; import java.util.Arrays; @@ -66,11 +70,17 @@ public void handleDespawn() { * @return {@code true} if the mob is within any light. */ protected boolean isWithinLight() { - return Arrays.stream(level.getEntityArray()).anyMatch(e -> e instanceof Lantern && isWithin(e.getLightRadius(), e)) - || !level.getMatchingTiles((tile, x, y) -> { - int xx = Math.abs(this.x - x), yy = Math.abs(this.y - y), l = tile.getLightRadius(level, x, y); - return xx * xx + yy * yy <= l * l; - }).isEmpty(); + for (Entity e : level.getEntitiesInRect(e -> e instanceof Lantern, new Rectangle(x, y, 8, 8, Rectangle.CENTER_DIMS))) + if (e instanceof Lantern && isWithin(e.getLightRadius(), e)) + return true; + for (Point p : level.getAreaTilePositions(x, y, 5)) { + Tile t = level.getTile(p.x, p.y); + int xx = Math.abs(x - p.x), yy = Math.abs(y - p.y), l = t.getLightRadius(level, p.x, p.y); + if (xx * xx + yy * yy <= l * l) + return true; + } + + return false; } /** diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index d2fb45869..b681f3ec4 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -951,7 +951,8 @@ public boolean isLight(int x, int y) { if (t instanceof TorchTile) return true; for (Entity e : getEntitiesInRect(e -> e instanceof Lantern, new Rectangle(x, y, 8, 8, Rectangle.CENTER_DIMS))) { - if (Math.hypot((e.x >> 4) - x, (e.y >> 4) - y) < e.getLightRadius() - 1) + int xx = (e.x >> 4) - x, yy = (e.y >> 4) - y, rr = e.getLightRadius() - 1; + if (xx * xx + yy * yy < rr * rr) return true; } From b1f24a1d44852dcba2c1bcefc039631d6927df33 Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Sat, 30 Dec 2023 20:34:05 +0000 Subject: [PATCH 136/261] Fix steppedOn and bumpedOn having switched x and y The lambda accepts horTile (X-axis) and front (Y-axis). However, in the moveByEntityHitBoxChecks calls the names are switched. So horTile is being used in the Y-axis and front in the X-axis. --- src/client/java/minicraft/entity/Entity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index 6dc8089da..f3fa677da 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -200,8 +200,8 @@ protected boolean moveX(int d) { return false; // No movement can be made. } return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x + sgn, () -> y, () -> x += sgn, hitBoxLeft, hitBoxRight, - (front, horTile) -> level.getTile(front, horTile).bumpedInto(level, front, horTile, this), - (front, horTile) -> level.getTile(front, horTile).steppedOn(level, front, horTile, this)); + (horTile, front) -> level.getTile(front, horTile).bumpedInto(level, front, horTile, this), + (horTile, front) -> level.getTile(front, horTile).steppedOn(level, front, horTile, this)); } /** @@ -234,8 +234,8 @@ protected boolean moveY(int d) { return false; // No movement can be made. } return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x, () -> y + sgn, () -> y += sgn, hitBoxLeft, hitBoxRight, - (front, horTile) -> level.getTile(horTile, front).bumpedInto(level, horTile, front, this), - (front, horTile) -> level.getTile(horTile, front).steppedOn(level, horTile, front, this)); + (horTile, front) -> level.getTile(horTile, front).bumpedInto(level, horTile, front, this), + (horTile, front) -> level.getTile(horTile, front).steppedOn(level, horTile, front, this)); } /** From aafdf473abcf00fe5f6e6fc8e511b01478c00958 Mon Sep 17 00:00:00 2001 From: KalmeMarq <55203647+KalmeMarq@users.noreply.github.com> Date: Sat, 30 Dec 2023 20:42:47 +0000 Subject: [PATCH 137/261] proper fix --- src/client/java/minicraft/entity/Entity.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index f3fa677da..c1ac4b46e 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -200,8 +200,8 @@ protected boolean moveX(int d) { return false; // No movement can be made. } return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x + sgn, () -> y, () -> x += sgn, hitBoxLeft, hitBoxRight, - (horTile, front) -> level.getTile(front, horTile).bumpedInto(level, front, horTile, this), - (horTile, front) -> level.getTile(front, horTile).steppedOn(level, front, horTile, this)); + (front, horTile) -> level.getTile(front, horTile).bumpedInto(level, front, horTile, this), + (front, horTile) -> level.getTile(front, horTile).steppedOn(level, front, horTile, this)); } /** @@ -234,8 +234,8 @@ protected boolean moveY(int d) { return false; // No movement can be made. } return moveByEntityHitBoxChecks(sgn, hitBoxFront, maxFront, () -> x, () -> y + sgn, () -> y += sgn, hitBoxLeft, hitBoxRight, - (horTile, front) -> level.getTile(horTile, front).bumpedInto(level, horTile, front, this), - (horTile, front) -> level.getTile(horTile, front).steppedOn(level, horTile, front, this)); + (front, horTile) -> level.getTile(horTile, front).bumpedInto(level, horTile, front, this), + (front, horTile) -> level.getTile(horTile, front).steppedOn(level, horTile, front, this)); } /** @@ -270,7 +270,7 @@ protected boolean moveByEntityHitBoxChecks(int sgn, int hitBoxFront, int maxFron if (newFrontTile != frontTile) { // New tile touched int hitBoxRightTile = hitBoxRight >> 4; for (int horTile = hitBoxLeft >> 4; horTile <= hitBoxRightTile; horTile++) { - bumpingHandler.accept(horTile, newFrontTile); + bumpingHandler.accept(newFrontTile, horTile); } frontTile = newFrontTile; handleSteppedOn = true; @@ -294,7 +294,7 @@ protected boolean moveByEntityHitBoxChecks(int sgn, int hitBoxFront, int maxFron if (handleSteppedOn) { // When the movement to a new tile successes int hitBoxRightTile = hitBoxRight >> 4; for (int horTile = hitBoxLeft >> 4; horTile <= hitBoxRightTile; horTile++) { - steppingHandler.accept(horTile, frontTile); // Calls the steppedOn() method in a tile's class. (used for tiles like sand (footprints) or lava (burning)) + steppingHandler.accept(frontTile, horTile); // Calls the steppedOn() method in a tile's class. (used for tiles like sand (footprints) or lava (burning)) } } successful = true; From 88f2b2566da8fea19149657d67ae12843155e745 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 4 Jan 2024 13:52:06 +0800 Subject: [PATCH 138/261] Resolve NPEs with Entity#getClosestPlayer() This (or potential) NullPointerException is thrown with missing null handles. --- src/client/java/minicraft/entity/Entity.java | 2 ++ src/client/java/minicraft/entity/Spark.java | 2 +- src/client/java/minicraft/entity/mob/ObsidianKnight.java | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index 6dc8089da..861908abc 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -376,6 +376,7 @@ public boolean isWithin(int tileRadius, Entity other) { * * @return the closest player. */ + @Nullable protected Player getClosestPlayer() { return getClosestPlayer(true); } @@ -387,6 +388,7 @@ protected Player getClosestPlayer() { * @param returnSelf determines if the method can return itself. * @return The closest player to this entity. */ + @Nullable protected Player getClosestPlayer(boolean returnSelf) { if (this instanceof Player && returnSelf) return (Player) this; diff --git a/src/client/java/minicraft/entity/Spark.java b/src/client/java/minicraft/entity/Spark.java index f937abe67..10e25065f 100644 --- a/src/client/java/minicraft/entity/Spark.java +++ b/src/client/java/minicraft/entity/Spark.java @@ -51,7 +51,7 @@ public void tick() { y = (int) yy; Player player = getClosestPlayer(); - if (player.isWithin(0, this)) { + if (player != null && player.isWithin(0, this)) { player.hurt(owner, 1); } } diff --git a/src/client/java/minicraft/entity/mob/ObsidianKnight.java b/src/client/java/minicraft/entity/mob/ObsidianKnight.java index 16c5b1338..9c28558eb 100644 --- a/src/client/java/minicraft/entity/mob/ObsidianKnight.java +++ b/src/client/java/minicraft/entity/mob/ObsidianKnight.java @@ -74,11 +74,13 @@ public ObsidianKnight(int health) { @Override public void tick() { super.tick(); - if (getClosestPlayer().isRemoved()) { + Player player = getClosestPlayer(); + if (player == null || player.isRemoved()) { active = false; KnightStatue ks = new KnightStatue(health); level.add(ks, x, y, false); this.remove(); + return; } // Achieve phase 2 @@ -101,7 +103,6 @@ public void tick() { } if (attackPhase == AttackPhase.Attacking) { - Player player = getClosestPlayer(); if (attackDelay > 0) { xmov = ymov = 0; int dir = (attackDelay - 35) / 4 % 4; // The direction of attack. From 777fe6a102436a371a8541ea03831e40dab8d39e Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:22:19 -0500 Subject: [PATCH 139/261] Update autobuild.yml --- .github/workflows/autobuild.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 9bff81a7e..980b96146 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -12,6 +12,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + - name: Change version name in build + run: | + sed -i -r "s/(?<=project\.version \= ')([\d\.]+)(?:-\w+)?(?=')/\1-dev%s/" build.gradle - uses: actions/setup-java@v3 with: distribution: temurin From f88d46b065703228f28255ded6733cb5ee06c0cc Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:39:42 -0500 Subject: [PATCH 140/261] Update autobuild.yml --- .github/workflows/autobuild.yml | 53 +++++++++++++++++---------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 980b96146..4a1cd3953 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,36 +1,37 @@ name: Nightly build on: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * *' workflow_dispatch: - + jobs: gradle: strategy: matrix: - os: [ ubuntu-latest ] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Change version name in build - run: | - sed -i -r "s/(?<=project\.version \= ')([\d\.]+)(?:-\w+)?(?=')/\1-dev%s/" build.gradle - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 8 - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 - - - name: Execute Gradle build - run: ./gradlew build - - - uses: actions/upload-artifact@v3.1.2 - with: - name: "Nightly release" - path: | - LICENSE - ChangeLog.md - build/libs/**.jar - if-no-files-found: error + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.4.2 + + - name: Execute Gradle build + run: ./gradlew build + + - uses: "dciborow/action-github-releases@v1.0.1" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Pre-release 2.2.0-dev%s (Nightly)" + generate_release_notes: true + files: | + LICENSE + ChangeLog.md + build/libs/**.jar + From 5eddaa461cac8db6cc40edc02b88fe2f1f8c5b8b Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:53:05 -0500 Subject: [PATCH 141/261] Update autobuild.yml --- .github/workflows/autobuild.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 4a1cd3953..a9a7b69ab 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -16,6 +16,11 @@ jobs: with: distribution: temurin java-version: 8 + + - name: Increment Version + env: + VERSION_s: 4+GITHUB_RUN_NUMBER + VERSION_f: "2.2.0-dev$VERSION_s" - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 @@ -26,9 +31,9 @@ jobs: - uses: "dciborow/action-github-releases@v1.0.1" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" + automatic_release_tag: "$VERSION_f" prerelease: true - title: "Pre-release 2.2.0-dev%s (Nightly)" + title: "Version 2.2.0, Pre-release $VERSION_s (Nightly)" generate_release_notes: true files: | LICENSE From cbdcf9f9fb5811d7695e928bc1754c7a7fa05895 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 6 Jan 2024 18:32:54 +0800 Subject: [PATCH 142/261] Update README.md Update information changed from POEditor to Lokalise. --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 8404efba3..c21b22bf8 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,7 @@ computer. ## Localization -This project is running with an external localization platform called POEditor. You can contribute localization by -clicking the image below! - -[![Minicraft+ POEditor Stats](https://minicraft-plus-poeditor-stats.vercel.app/api/card)](https://minicraft-plus-poeditor-stats.vercel.app) +This project is running with an external localization platform called Lokalise. You can contribute localization [here](https://app.lokalise.com/public/42925017655336d50b3007.03067253/)! ## How to build/run in development From 3e003fbd55076ea2f3a96614acc446e51b94af99 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 7 Jan 2024 02:47:23 +0800 Subject: [PATCH 143/261] Reformat codes Mainly spacing and JavaDoc line breaks --- .../java/minicraft/core/CrashHandler.java | 1 - .../java/minicraft/core/Initializer.java | 3 +- src/client/java/minicraft/core/World.java | 2 +- .../minicraft/core/io/ClipboardHandler.java | 1 - .../java/minicraft/core/io/FileHandler.java | 1 - .../java/minicraft/core/io/InputHandler.java | 7 +--- .../java/minicraft/core/io/Localization.java | 7 +--- .../java/minicraft/core/io/Settings.java | 10 +---- src/client/java/minicraft/entity/Arrow.java | 1 - src/client/java/minicraft/entity/Entity.java | 39 +++++++------------ .../java/minicraft/entity/FireSpark.java | 6 +-- .../java/minicraft/entity/ItemEntity.java | 25 ++++++------ src/client/java/minicraft/entity/Spark.java | 6 +-- .../minicraft/entity/furniture/Chest.java | 3 +- .../minicraft/entity/furniture/Crafter.java | 1 - .../entity/furniture/DungeonChest.java | 1 - .../minicraft/entity/furniture/Furniture.java | 12 ++---- .../minicraft/entity/furniture/Lantern.java | 1 - .../minicraft/entity/furniture/Spawner.java | 3 -- .../java/minicraft/entity/furniture/Tnt.java | 2 +- .../java/minicraft/entity/mob/AirWizard.java | 2 +- .../java/minicraft/entity/mob/Creeper.java | 12 +++--- .../java/minicraft/entity/mob/EnemyMob.java | 34 +++++++--------- .../java/minicraft/entity/mob/Knight.java | 3 +- src/client/java/minicraft/entity/mob/Mob.java | 26 ++++--------- .../java/minicraft/entity/mob/MobAi.java | 30 +++++--------- .../minicraft/entity/mob/ObsidianKnight.java | 4 +- .../java/minicraft/entity/mob/PassiveMob.java | 11 ++---- .../java/minicraft/entity/mob/Player.java | 26 ++++--------- .../java/minicraft/entity/mob/Skeleton.java | 7 ++-- .../java/minicraft/entity/mob/Slime.java | 11 +++--- .../java/minicraft/entity/mob/Snake.java | 2 +- .../java/minicraft/entity/mob/Zombie.java | 3 +- .../entity/particle/BurnParticle.java | 1 - .../entity/particle/FireParticle.java | 1 - .../minicraft/entity/particle/Particle.java | 9 ++--- .../entity/particle/SandParticle.java | 1 - .../entity/particle/SmashParticle.java | 1 - .../entity/particle/TextParticle.java | 6 +-- src/client/java/minicraft/gfx/Color.java | 8 ++-- src/client/java/minicraft/gfx/FontStyle.java | 4 +- .../java/minicraft/gfx/MinicraftImage.java | 6 +-- src/client/java/minicraft/gfx/Screen.java | 2 +- .../java/minicraft/gfx/SpriteAnimation.java | 28 ++++--------- .../java/minicraft/gfx/SpriteLinker.java | 27 +++---------- .../java/minicraft/item/FishingRodItem.java | 8 ++-- src/client/java/minicraft/item/Inventory.java | 22 +++-------- src/client/java/minicraft/item/ToolItem.java | 2 +- src/client/java/minicraft/item/ToolType.java | 8 ++-- .../java/minicraft/item/WateringCanItem.java | 2 +- src/client/java/minicraft/level/Level.java | 30 +++++++------- src/client/java/minicraft/level/LevelGen.java | 10 ++--- .../java/minicraft/level/tile/DirtTile.java | 2 +- .../java/minicraft/level/tile/Tile.java | 34 +++++++--------- .../java/minicraft/level/tile/WoolTile.java | 1 - .../level/tile/farming/CarrotTile.java | 2 +- .../tile/farming/HeavenlyBerriesTile.java | 2 +- .../tile/farming/HellishBerriesTile.java | 2 +- .../level/tile/farming/PotatoTile.java | 2 +- .../level/tile/farming/TomatoTile.java | 2 +- .../level/tile/farming/WheatTile.java | 2 +- src/client/java/minicraft/saveload/Save.java | 2 - .../java/minicraft/saveload/Version.java | 6 +-- .../minicraft/screen/AchievementsDisplay.java | 5 +-- .../java/minicraft/screen/BookDisplay.java | 2 +- .../minicraft/screen/ContainerDisplay.java | 2 +- .../minicraft/screen/CraftingDisplay.java | 4 +- .../java/minicraft/screen/EndGameDisplay.java | 2 +- .../minicraft/screen/KeyInputDisplay.java | 2 +- .../screen/LanguageSettingsDisplay.java | 2 +- .../screen/OnScreenKeyboardMenu.java | 1 - .../minicraft/screen/OptionsWorldDisplay.java | 2 +- .../java/minicraft/screen/PauseDisplay.java | 2 +- .../minicraft/screen/PlayerDeathDisplay.java | 2 +- .../minicraft/screen/PlayerInvDisplay.java | 6 +-- .../java/minicraft/screen/PopupDisplay.java | 9 ++--- .../java/minicraft/screen/QuestsDisplay.java | 14 +++---- .../minicraft/screen/ResourcePackDisplay.java | 20 ++-------- .../minicraft/screen/WorldGenDisplay.java | 4 +- .../minicraft/screen/WorldSelectDisplay.java | 2 +- .../minicraft/screen/entry/BooleanEntry.java | 2 +- .../minicraft/screen/entry/ListEntry.java | 15 ++----- .../minicraft/screen/entry/SelectEntry.java | 4 +- .../minicraft/util/AdvancementElement.java | 21 +++++----- src/client/java/minicraft/util/Quest.java | 10 ++--- .../util/TinylogLoggingConfiguration.java | 29 +++++++------- .../util/TinylogLoggingProvider.java | 11 +++--- 87 files changed, 264 insertions(+), 445 deletions(-) diff --git a/src/client/java/minicraft/core/CrashHandler.java b/src/client/java/minicraft/core/CrashHandler.java index ddeb5b206..6da80acaa 100644 --- a/src/client/java/minicraft/core/CrashHandler.java +++ b/src/client/java/minicraft/core/CrashHandler.java @@ -120,7 +120,6 @@ public static void errorHandle(Throwable throwable, ErrorInfo info) { /** * This handles application crashing errors by giving notification to the user clearly.
* The user can ignore the error, continue handling the error or exit the program (only in serious errors or error reports). - * * @param handling The handling function of the error. */ public static void errorHandle(Throwable throwable, ErrorInfo info, @Nullable Action handling) { diff --git a/src/client/java/minicraft/core/Initializer.java b/src/client/java/minicraft/core/Initializer.java index fa0149844..55c955fb0 100644 --- a/src/client/java/minicraft/core/Initializer.java +++ b/src/client/java/minicraft/core/Initializer.java @@ -199,9 +199,8 @@ static void launchWindow() { /** * Provides a String representation of the provided Throwable's stack trace * that is extracted via PrintStream. - * * @param throwable Throwable/Exception from which stack trace is to be - * extracted. + * extracted. * @return String with provided Throwable's stack trace. */ public static String getExceptionTrace(final Throwable throwable) { diff --git a/src/client/java/minicraft/core/World.java b/src/client/java/minicraft/core/World.java index 6aeb52452..cea2bd503 100644 --- a/src/client/java/minicraft/core/World.java +++ b/src/client/java/minicraft/core/World.java @@ -25,7 +25,7 @@ public class World extends Game { private World() { } - public static final int[] idxToDepth = {-3, -2, -1, 0, 1, -4}; /// This is to map the level depths to each level's index in Game's levels array. This must ALWAYS be the same length as the levels array, of course. + public static final int[] idxToDepth = { -3, -2, -1, 0, 1, -4 }; /// This is to map the level depths to each level's index in Game's levels array. This must ALWAYS be the same length as the levels array, of course. public static final int minLevelDepth, maxLevelDepth; static int worldSize = 128; // The size of the world diff --git a/src/client/java/minicraft/core/io/ClipboardHandler.java b/src/client/java/minicraft/core/io/ClipboardHandler.java index 1b3b537cf..1eb898945 100644 --- a/src/client/java/minicraft/core/io/ClipboardHandler.java +++ b/src/client/java/minicraft/core/io/ClipboardHandler.java @@ -28,7 +28,6 @@ public void setClipboardContents(String string) { /** * Get the string from the system clipboard data. - * * @return A string with the contents. */ public String getClipboardContents() { diff --git a/src/client/java/minicraft/core/io/FileHandler.java b/src/client/java/minicraft/core/io/FileHandler.java index cdde3472c..b87cb9bbf 100644 --- a/src/client/java/minicraft/core/io/FileHandler.java +++ b/src/client/java/minicraft/core/io/FileHandler.java @@ -58,7 +58,6 @@ private FileHandler() { * If saveDir is not null, use it as the game directory. Otherwise use the default path. *

* If the default path is used, check if old default path exists and if so move it to the new path. - * * @param saveDir Value from --savedir argument. Null if it was not set. */ public static void determineGameDir(@Nullable String saveDir) { diff --git a/src/client/java/minicraft/core/io/InputHandler.java b/src/client/java/minicraft/core/io/InputHandler.java index f45a7e180..424dd6c0d 100644 --- a/src/client/java/minicraft/core/io/InputHandler.java +++ b/src/client/java/minicraft/core/io/InputHandler.java @@ -403,8 +403,7 @@ public String getMapping(String actionKey) { /** * Returning the corresponding mapping depends on the device last acted. - * - * @param keyMap The keyboard mapping. + * @param keyMap The keyboard mapping. * @param buttonMap The controller mapping * @return The selected mapping. */ @@ -417,7 +416,6 @@ public String selectMapping(String keyMap, String buttonMap) { /** * Getting the last input device type. - * * @return The input device type: 0 for keyboard, 1 for controller. */ public int getLastInputType() { @@ -716,8 +714,7 @@ public boolean inputDown(String mapping) { * This will return false if the controller doesn't support vibration or if SDL was unable to start * vibration (maybe the controller doesn't support left/right vibration, maybe it was unplugged in the * middle of trying, etc...) - * - * @param leftMagnitude The speed for the left motor to vibrate (this should be between 0 and 1) + * @param leftMagnitude The speed for the left motor to vibrate (this should be between 0 and 1) * @param rightMagnitude The speed for the right motor to vibrate (this should be between 0 and 1) * @return Whether or not the controller was able to be vibrated (i.e. if haptics are supported) or controller not connected. */ diff --git a/src/client/java/minicraft/core/io/Localization.java b/src/client/java/minicraft/core/io/Localization.java index 3d74cff79..737d8712a 100644 --- a/src/client/java/minicraft/core/io/Localization.java +++ b/src/client/java/minicraft/core/io/Localization.java @@ -27,8 +27,7 @@ public class Localization { /** * Get the provided key's localization for the currently selected language. - * - * @param key The key to localize. + * @param key The key to localize. * @param arguments The additional arguments to format the localized string. * @return A localized string. */ @@ -63,7 +62,6 @@ public static String getLocalized(String key, Object... arguments) { /** * Gets the currently selected locale. - * * @return A locale object. */ public static Locale getSelectedLocale() { @@ -72,7 +70,6 @@ public static Locale getSelectedLocale() { /** * Get the currently selected locale, but as a full name without the country code. - * * @return A string with the name of the language. */ @NotNull @@ -82,7 +79,6 @@ public static LocaleInformation getSelectedLanguage() { /** * Gets a list of all the known locales. - * * @return A list of locales. */ @NotNull @@ -93,7 +89,6 @@ public static LocaleInformation[] getLocales() { /** * Changes the selected language and loads it. * If the provided language doesn't exist, it loads the default locale. - * * @param newLanguage The language-country code of the language to load. */ public static void changeLanguage(@NotNull String newLanguage) { diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index 792a5639e..fe689e0c9 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -43,7 +43,6 @@ public final class Settings { /** * Returns the value of the specified option. - * * @param option The setting to get. * @return The value of the setting */ @@ -53,7 +52,6 @@ public static Object get(String option) { /** * Returns the index of the value in the list of values for the specified option. - * * @param option The setting to get. * @return The index of the setting. */ @@ -63,7 +61,6 @@ public static int getIdx(String option) { /** * Return the ArrayEntry object associated with the given option name. - * * @param option The setting to get. * @return The ArrayEntry. */ @@ -73,9 +70,8 @@ public static ArrayEntry getEntry(String option) { /** * Sets the value of the given option name, to the given value, provided it is a valid value for that option. - * * @param option The setting to edit. - * @param value The value to change to. + * @param value The value to change to. */ public static void set(String option, Object value) { options.get(option.toLowerCase()).setValue(value); @@ -83,9 +79,8 @@ public static void set(String option, Object value) { /** * Sets the index of the value of the given option, provided it is a valid index. - * * @param option The setting to edit. - * @param idx Index to select. + * @param idx Index to select. */ public static void setIdx(String option, int idx) { options.get(option.toLowerCase()).setSelection(idx); @@ -94,7 +89,6 @@ public static void setIdx(String option, int idx) { /** * Gets the refresh rate of the default monitor. * Safely handles headless environments (if that were to happen for some reason). - * * @return The refresh rate if successful. 60 if not. */ private static int getDefaultRefreshRate() { diff --git a/src/client/java/minicraft/entity/Arrow.java b/src/client/java/minicraft/entity/Arrow.java index 19cb2a13b..8f1d82b2a 100644 --- a/src/client/java/minicraft/entity/Arrow.java +++ b/src/client/java/minicraft/entity/Arrow.java @@ -47,7 +47,6 @@ public Arrow(Mob owner, int x, int y, Direction dir, int dmg) { /** * Generates information about the arrow. - * * @return string representation of owner, xdir, ydir and damage. */ public String getData() { diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index 861908abc..ea0d197d8 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -49,7 +49,6 @@ public abstract class Entity implements Tickable { * Assings null/none values to the instace variables. * The exception is removed which is set to true, and * lastUpdate which is set to System.nanoTime(). - * * @param xr X radius of entity. * @param yr Y radius of entity. */ @@ -71,7 +70,6 @@ public Entity(int xr, int yr) { // Add color to this later, in color update /** * Returns true if the entity is removed from the level, otherwise false. - * * @return removed */ public boolean isRemoved() { @@ -80,7 +78,6 @@ public boolean isRemoved() { /** * Returns the level which this entity belongs in. - * * @return level */ public Level getLevel() { @@ -146,9 +143,8 @@ protected void touchedBy(Entity entity) { /** * Interacts with the entity this method is called on - * - * @param player The player attacking - * @param item The item the player attacked with + * @param player The player attacking + * @param item The item the player attacked with * @param attackDir The direction to interact * @return If the interaction was successful */ @@ -173,7 +169,6 @@ public boolean move(int xd, int yd) { /** * Moves the entity a long only on X axis without "teleporting". * Will throw exception otherwise. - * * @param d Displacement relative to the axis. * @return true if the move was successful, false if not. */ @@ -207,7 +202,6 @@ protected boolean moveX(int d) { /** * Moves the entity a long only on X axis without "teleporting". * Will throw exception otherwise. - * * @param d Displacement relative to the axis. * @return true if the move was successful, false if not. */ @@ -240,25 +234,24 @@ protected boolean moveY(int d) { /** * Moves the entity by checking entity hit boxes being interacted with the given possible length of straight path. - * - * @param sgn One-dimensional direction of displacement - * @param hitBoxFront The front boundary of hit box - * @param maxFront Maximum position can be reached with front hit box (firstly checked by tile hot box) - * @param xMove The value of the willing x movement - * @param yMove The value of the willing y movement - * @param incrementMove The movement call when the movement is possible - * @param hitBoxLeft The left boundary of hit box - * @param hitBoxRight The right boundary of hit box - * @param bumpingHandler The consumer handling bumping into a new tile; - * the first parameter takes the front tile position and second one takes the horizontal position + * @param sgn One-dimensional direction of displacement + * @param hitBoxFront The front boundary of hit box + * @param maxFront Maximum position can be reached with front hit box (firstly checked by tile hot box) + * @param xMove The value of the willing x movement + * @param yMove The value of the willing y movement + * @param incrementMove The movement call when the movement is possible + * @param hitBoxLeft The left boundary of hit box + * @param hitBoxRight The right boundary of hit box + * @param bumpingHandler The consumer handling bumping into a new tile; + * the first parameter takes the front tile position and second one takes the horizontal position * @param steppingHandler The consumer handling stepping on a new tile; - * the first parameter takes the front tile position and second one takes the horizontal position + * the first parameter takes the front tile position and second one takes the horizontal position * @return {@code true} if the movement is successful, {@code false} otherwise. * @see Level#calculateMaxFrontClosestTile(int, int, int, int, int, BiPredicate) */ protected boolean moveByEntityHitBoxChecks(int sgn, int hitBoxFront, int maxFront, IntSupplier xMove, - IntSupplier yMove, Action incrementMove, int hitBoxLeft, int hitBoxRight, - BiConsumer bumpingHandler, BiConsumer steppingHandler) { + IntSupplier yMove, Action incrementMove, int hitBoxLeft, int hitBoxRight, + BiConsumer bumpingHandler, BiConsumer steppingHandler) { boolean successful = false; // These lists are named as if the entity has already moved-- it hasn't, though. @@ -373,7 +366,6 @@ public boolean isWithin(int tileRadius, Entity other) { /** * Returns the closest player to this entity. - * * @return the closest player. */ @Nullable @@ -384,7 +376,6 @@ protected Player getClosestPlayer() { /** * Returns the closes player to this entity. * If this is called on a player it can return itself. - * * @param returnSelf determines if the method can return itself. * @return The closest player to this entity. */ diff --git a/src/client/java/minicraft/entity/FireSpark.java b/src/client/java/minicraft/entity/FireSpark.java index 9f07662d3..6a67764de 100644 --- a/src/client/java/minicraft/entity/FireSpark.java +++ b/src/client/java/minicraft/entity/FireSpark.java @@ -20,10 +20,9 @@ public class FireSpark extends Entity { /** * Creates a new spark. Owner is the Obsidian Knight which is spawning this spark. - * * @param owner The Obsidian Knight spawning the spark. - * @param xa X velocity. - * @param ya Y velocity. + * @param xa X velocity. + * @param ya Y velocity. */ public FireSpark(ObsidianKnight owner, double xa, double ya) { super(0, 0); @@ -106,7 +105,6 @@ public void render(Screen screen) { /** * Returns the owners id as a string. - * * @return the owners id as a string. */ public String getData() { diff --git a/src/client/java/minicraft/entity/ItemEntity.java b/src/client/java/minicraft/entity/ItemEntity.java index be94bd7ef..f12622bf1 100644 --- a/src/client/java/minicraft/entity/ItemEntity.java +++ b/src/client/java/minicraft/entity/ItemEntity.java @@ -20,10 +20,9 @@ public class ItemEntity extends Entity implements ClientTickable { /** * Creates an item entity of the item item at position (x,y) with size 2*2. - * * @param item Item to add as item entity - * @param x position on map - * @param y position on map + * @param x position on map + * @param y position on map */ public ItemEntity(Item item, int x, int y) { super(2, 2); @@ -46,16 +45,15 @@ public ItemEntity(Item item, int x, int y) { /** * Creates an item entity of the item item at position (x,y) with size 2*2. - * - * @param item Item to add as item entity. - * @param x position on map - * @param y position on map - * @param zz z position? + * @param item Item to add as item entity. + * @param x position on map + * @param y position on map + * @param zz z position? * @param lifetime lifetime (in ticks) of the entity. - * @param time starting time (in ticks) of the entity. - * @param xa x velocity - * @param ya y velocity - * @param za z velocity? + * @param time starting time (in ticks) of the entity. + * @param xa x velocity + * @param ya y velocity + * @param za z velocity? */ public ItemEntity(Item item, int x, int y, double zz, int lifetime, int time, double xa, double ya, double za) { this(item, x, y); @@ -69,11 +67,10 @@ public ItemEntity(Item item, int x, int y, double zz, int lifetime, int time, do /** * Returns a string representation of the itementity - * * @return string representation of this entity */ public String getData() { - return String.join(":", (new String[]{item.getData(), zz + "", lifeTime + "", time + "", xa + "", ya + "", za + ""})); + return String.join(":", (new String[] { item.getData(), zz + "", lifeTime + "", time + "", xa + "", ya + "", za + "" })); } @Override diff --git a/src/client/java/minicraft/entity/Spark.java b/src/client/java/minicraft/entity/Spark.java index 10e25065f..049d45d88 100644 --- a/src/client/java/minicraft/entity/Spark.java +++ b/src/client/java/minicraft/entity/Spark.java @@ -19,10 +19,9 @@ public class Spark extends Entity { /** * Creates a new spark. Owner is the AirWizard which is spawning this spark. - * * @param owner The AirWizard spawning the spark. - * @param xa X velocity. - * @param ya Y velocity. + * @param xa X velocity. + * @param ya Y velocity. */ public Spark(AirWizard owner, double xa, double ya) { super(0, 0); @@ -85,7 +84,6 @@ public void render(Screen screen) { /** * Returns the owners id as a string. - * * @return the owners id as a string. */ public String getData() { diff --git a/src/client/java/minicraft/entity/furniture/Chest.java b/src/client/java/minicraft/entity/furniture/Chest.java index 395d78dcf..6919a1851 100644 --- a/src/client/java/minicraft/entity/furniture/Chest.java +++ b/src/client/java/minicraft/entity/furniture/Chest.java @@ -30,7 +30,6 @@ public Chest(String name) { /** * Creates a chest with a custom name. - * * @param name Name of chest. */ public Chest(String name, LinkedSprite itemSprite) { @@ -49,7 +48,7 @@ public boolean use(Player player) { public void populateInvRandom(String lootTable, int depth) { try { - String[] lines = Load.loadFile("/resources/data/chestloot/" + lootTable + ".txt").toArray(new String[]{}); + String[] lines = Load.loadFile("/resources/data/chestloot/" + lootTable + ".txt").toArray(new String[] {}); for (String line : lines) { //System.out.println(line); diff --git a/src/client/java/minicraft/entity/furniture/Crafter.java b/src/client/java/minicraft/entity/furniture/Crafter.java index 49fab3dd5..9326b41b7 100644 --- a/src/client/java/minicraft/entity/furniture/Crafter.java +++ b/src/client/java/minicraft/entity/furniture/Crafter.java @@ -42,7 +42,6 @@ public enum Type { /** * Creates a crafter of a given type. - * * @param type What type of crafter this is. */ public Crafter(Crafter.Type type) { diff --git a/src/client/java/minicraft/entity/furniture/DungeonChest.java b/src/client/java/minicraft/entity/furniture/DungeonChest.java index 6647745c5..8c69f96d3 100644 --- a/src/client/java/minicraft/entity/furniture/DungeonChest.java +++ b/src/client/java/minicraft/entity/furniture/DungeonChest.java @@ -27,7 +27,6 @@ public class DungeonChest extends Chest { /** * Creates a custom chest with the name Dungeon Chest. - * * @param populateInv Populate the inventory of the DungeonChest using the loot table system. */ public DungeonChest(boolean populateInv) { diff --git a/src/client/java/minicraft/entity/furniture/Furniture.java b/src/client/java/minicraft/entity/furniture/Furniture.java index 0a339c345..2f0cc22a8 100644 --- a/src/client/java/minicraft/entity/furniture/Furniture.java +++ b/src/client/java/minicraft/entity/furniture/Furniture.java @@ -27,8 +27,7 @@ public class Furniture extends Entity { /** * Constructor for the furniture entity. * Size will be set to 3. - * - * @param name Name of the furniture. + * @param name Name of the furniture. * @param sprite Furniture sprite. */ public Furniture(String name, LinkedSprite sprite, LinkedSprite itemSprite) { @@ -38,11 +37,10 @@ public Furniture(String name, LinkedSprite sprite, LinkedSprite itemSprite) { /** * Constructor for the furniture entity. * Radius is only used for collision detection. - * - * @param name Name of the furniture. + * @param name Name of the furniture. * @param sprite Furniture sprite. - * @param xr Horizontal radius. - * @param yr Vertical radius. + * @param xr Horizontal radius. + * @param yr Vertical radius. */ public Furniture(String name, LinkedSprite sprite, LinkedSprite itemSprite, int xr, int yr) { // All of these are 2x2 on the spritesheet; radius is for collisions only. @@ -98,7 +96,6 @@ protected void touchedBy(Entity entity) { /** * Used in PowerGloveItem.java to let the user pick up furniture. - * * @param player The player picking up the furniture. */ @Override @@ -116,7 +113,6 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) /** * Tries to let the player push this furniture. - * * @param player The player doing the pushing. */ public void tryPush(Player player) { diff --git a/src/client/java/minicraft/entity/furniture/Lantern.java b/src/client/java/minicraft/entity/furniture/Lantern.java index b63f0aa36..664a63e5a 100644 --- a/src/client/java/minicraft/entity/furniture/Lantern.java +++ b/src/client/java/minicraft/entity/furniture/Lantern.java @@ -24,7 +24,6 @@ public enum Type { /** * Creates a lantern of a given type. - * * @param type Type of lantern. */ public Lantern(Lantern.Type type) { diff --git a/src/client/java/minicraft/entity/furniture/Spawner.java b/src/client/java/minicraft/entity/furniture/Spawner.java index f2f916901..b8ff39b03 100644 --- a/src/client/java/minicraft/entity/furniture/Spawner.java +++ b/src/client/java/minicraft/entity/furniture/Spawner.java @@ -48,7 +48,6 @@ public class Spawner extends Furniture { /** * Initializes the spawners variables to the corresponding values from the mob. - * * @param m The mob which this spawner will spawn. */ private void initMob(MobAi m) { @@ -70,7 +69,6 @@ private void initMob(MobAi m) { /** * Creates a new spawner for the mob m. - * * @param m Mob which will be spawned. */ public Spawner(MobAi m) { @@ -91,7 +89,6 @@ public Spawner(MobAi m) { /** * Returns the classname of a class. - * * @param c The class. * @return String representation of the classname. */ diff --git a/src/client/java/minicraft/entity/furniture/Tnt.java b/src/client/java/minicraft/entity/furniture/Tnt.java index 4bea171ca..bdd723e38 100644 --- a/src/client/java/minicraft/entity/furniture/Tnt.java +++ b/src/client/java/minicraft/entity/furniture/Tnt.java @@ -32,7 +32,7 @@ public class Tnt extends Furniture implements ActionListener { private Timer explodeTimer; private Level levelSave; - private final String[] explosionBlacklist = new String[]{"hard rock", "obsidian wall", "stairs up", "stairs down"}; + private final String[] explosionBlacklist = new String[] { "hard rock", "obsidian wall", "stairs up", "stairs down" }; /** * Creates a new tnt furniture. diff --git a/src/client/java/minicraft/entity/mob/AirWizard.java b/src/client/java/minicraft/entity/mob/AirWizard.java index 976f295a5..796693ba6 100644 --- a/src/client/java/minicraft/entity/mob/AirWizard.java +++ b/src/client/java/minicraft/entity/mob/AirWizard.java @@ -16,7 +16,7 @@ import minicraft.screen.AchievementsDisplay; public class AirWizard extends EnemyMob { - private static final LinkedSprite[][][] sprites = new LinkedSprite[][][]{ + private static final LinkedSprite[][][] sprites = new LinkedSprite[][][] { Mob.compileMobSpriteAnimations(0, 0, "air_wizard"), Mob.compileMobSpriteAnimations(0, 2, "air_wizard") }; diff --git a/src/client/java/minicraft/entity/mob/Creeper.java b/src/client/java/minicraft/entity/mob/Creeper.java index d1d132c15..4b9d7138c 100644 --- a/src/client/java/minicraft/entity/mob/Creeper.java +++ b/src/client/java/minicraft/entity/mob/Creeper.java @@ -16,11 +16,11 @@ import java.util.List; public class Creeper extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ - new LinkedSprite[][]{Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "creeper")}, - new LinkedSprite[][]{Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "creeper")}, - new LinkedSprite[][]{Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "creeper")}, - new LinkedSprite[][]{Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "creeper")} + private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { + new LinkedSprite[][] { Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "creeper") }, + new LinkedSprite[][] { Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "creeper") }, + new LinkedSprite[][] { Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "creeper") }, + new LinkedSprite[][] { Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "creeper") } }; private static final int MAX_FUSE_TIME = 60; @@ -30,7 +30,7 @@ public class Creeper extends EnemyMob { private int fuseTime = 0; private boolean fuseLit = false; - private final String[] explosionBlacklist = new String[]{"hard rock", "obsidian wall", "raw obsidian"}; + private final String[] explosionBlacklist = new String[] { "hard rock", "obsidian wall", "raw obsidian" }; public Creeper(int lvl) { super(lvl, sprites, 10, 50); diff --git a/src/client/java/minicraft/entity/mob/EnemyMob.java b/src/client/java/minicraft/entity/mob/EnemyMob.java index 6d4a5fc19..0788005ec 100644 --- a/src/client/java/minicraft/entity/mob/EnemyMob.java +++ b/src/client/java/minicraft/entity/mob/EnemyMob.java @@ -30,15 +30,14 @@ else if (!isWithinLight()) // Otherwise, it despawns when it is not within light * Constructor for a hostile (enemy) mob. The level determines what the mob does. sprites contains all the graphics and animations for the mob. * lvlcols is the different color the mob has depending on its level. isFactor determines if the mob's health should be affected by the level and * the difficulty. - * - * @param lvl The mob's level. + * @param lvl The mob's level. * @param lvlSprites The mob's sprites (ordered by level, then direction, then animation frame). - * @param health How much health the mob has. - * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty + * @param health How much health the mob has. + * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty * @param detectDist The distance where the mob will detect the player and start moving towards him/her. - * @param lifetime How many ticks this mob will live. - * @param rwTime How long the mob will walk in a random direction. (random walk duration) - * @param rwChance The chance of this mob will walk in a random direction (random walk chance) + * @param lifetime How many ticks this mob will live. + * @param rwTime How long the mob will walk in a random direction. (random walk duration) + * @param rwChance The chance of this mob will walk in a random direction (random walk chance) */ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFactor, int detectDist, int lifetime, int rwTime, int rwChance) { super(lvlSprites[0], isFactor ? (lvl == 0 ? 1 : lvl * lvl) * health * ((Double) (Math.pow(2, Settings.getIdx("diff")))).intValue() : health, lifetime, rwTime, rwChance); @@ -50,14 +49,13 @@ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFa /** * Constructor for a hostile (enemy) mob. * Lifetime will be set to 60 * Game.normSpeed. - * - * @param lvl The mob's level. + * @param lvl The mob's level. * @param lvlSprites The mob's sprites (ordered by level, then direction, then animation frame). - * @param health How much health the mob has. - * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty + * @param health How much health the mob has. + * @param isFactor false if maxHealth=health, true if maxHealth=health*level*level*difficulty * @param detectDist The distance where the mob will detect the player and start moving towards him/her. - * @param rwTime How long the mob will walk in a random direction. (random walk duration) - * @param rwChance The chance of this mob will walk in a random direction (random walk chance) + * @param rwTime How long the mob will walk in a random direction. (random walk duration) + * @param rwChance The chance of this mob will walk in a random direction (random walk chance) */ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFactor, int detectDist, int rwTime, int rwChance) { this(lvl, lvlSprites, health, isFactor, detectDist, 60 * Updater.normSpeed, rwTime, rwChance); @@ -68,10 +66,9 @@ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, boolean isFa * isFactor=true, * rwTime=60, * rwChance=200. - * - * @param lvl The mob's level. + * @param lvl The mob's level. * @param lvlSprites The mob's sprites (ordered by level, then direction, then animation frame). - * @param health How much health the mob has. + * @param health How much health the mob has. * @param detectDist The distance where the mob will detect the player and start moving towards him/her. */ public EnemyMob(int lvl, LinkedSprite[][][] lvlSprites, int health, int detectDist) { @@ -124,10 +121,9 @@ public void die() { /** * Determines if the mob can spawn at the giving position in the given map. - * * @param level The level which the mob wants to spawn in. - * @param x X map spawn coordinate. - * @param y Y map spawn coordinate. + * @param x X map spawn coordinate. + * @param y Y map spawn coordinate. * @return true if the mob can spawn here, false if not. */ public static boolean checkStartPos(Level level, int x, int y) { // Find a place to spawn the mob diff --git a/src/client/java/minicraft/entity/mob/Knight.java b/src/client/java/minicraft/entity/mob/Knight.java index 24183cb98..d42a2089e 100644 --- a/src/client/java/minicraft/entity/mob/Knight.java +++ b/src/client/java/minicraft/entity/mob/Knight.java @@ -5,7 +5,7 @@ import minicraft.item.Items; public class Knight extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ + private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { Mob.compileMobSpriteAnimations(0, 0, "knight"), Mob.compileMobSpriteAnimations(0, 2, "knight"), Mob.compileMobSpriteAnimations(0, 4, "knight"), @@ -14,7 +14,6 @@ public class Knight extends EnemyMob { /** * Creates a knight of a given level. - * * @param lvl The knights level. */ public Knight(int lvl) { diff --git a/src/client/java/minicraft/entity/mob/Mob.java b/src/client/java/minicraft/entity/mob/Mob.java index e96679663..468749c2b 100644 --- a/src/client/java/minicraft/entity/mob/Mob.java +++ b/src/client/java/minicraft/entity/mob/Mob.java @@ -32,9 +32,8 @@ public abstract class Mob extends Entity { /** * Default constructor for a mob. * Default x radius is 4, and y radius is 3. - * * @param sprites All of this mob's sprites. - * @param health The mob's max health. + * @param health The mob's max health. */ public Mob(LinkedSprite[][] sprites, int health) { super(4, 3); @@ -202,7 +201,6 @@ private boolean isWooling() { // supposed to walk at half speed on wool /** * Checks if this Mob is currently on a light tile; if so, the mob sprite is brightened. - * * @return true if the mob is on a light tile, false if not. */ public boolean isLight() { @@ -212,7 +210,6 @@ public boolean isLight() { /** * Checks if the mob is swimming (standing on a liquid tile). - * * @return true if the mob is swimming, false if not. */ public boolean isSwimming() { @@ -223,10 +220,9 @@ public boolean isSwimming() { /** * Do damage to the mob this method is called on. - * - * @param tile The tile that hurt the player - * @param x The x position of the mob - * @param y The x position of the mob + * @param tile The tile that hurt the player + * @param x The x position of the mob + * @param y The x position of the mob * @param damage The amount of damage to hurt the mob with */ public void hurt(Tile tile, int x, int y, int damage) { // Hurt the mob, when the source of damage is a tile @@ -237,8 +233,7 @@ public void hurt(Tile tile, int x, int y, int damage) { // Hurt the mob, when th /** * Do damage to the mob this method is called on. - * - * @param mob The mob that hurt this mob + * @param mob The mob that hurt this mob * @param damage The amount of damage to hurt the mob with */ public void hurt(Mob mob, int damage) { @@ -247,9 +242,8 @@ public void hurt(Mob mob, int damage) { /** * Do damage to the mob this method is called on. - * - * @param mob The mob that hurt this mob - * @param damage The amount of damage to hurt the mob with + * @param mob The mob that hurt this mob + * @param damage The amount of damage to hurt the mob with * @param attackDir The direction this mob was attacked from */ public void hurt(Mob mob, int damage, Direction attackDir) { // Hurt the mob, when the source is another mob @@ -267,7 +261,6 @@ public void burn(int sec) { /** * Executed when a TNT bomb explodes near this mob. - * * @param tnt The TNT exploding. * @param dmg The amount of damage the explosion does. */ @@ -278,8 +271,7 @@ public void onExploded(Tnt tnt, int dmg) { /** * Hurt the mob, based on only damage and a direction * This is overridden in Player.java - * - * @param damage The amount of damage to hurt the mob with + * @param damage The amount of damage to hurt the mob with * @param attackDir The direction this mob was attacked from */ protected void doHurt(int damage, Direction attackDir) { @@ -296,7 +288,6 @@ protected void doHurt(int damage, Direction attackDir) { /** * Restores health to this mob. - * * @param heal How much health is restored. */ public void heal(int heal) { // Restore health on the mob @@ -314,7 +305,6 @@ protected static Direction getAttackDir(Entity attacker, Entity hurt) { /** * This checks how the {@code attacker} can damage this mob. - * * @param attacker The attacker entity. * @return The calculated damage. */ diff --git a/src/client/java/minicraft/entity/mob/MobAi.java b/src/client/java/minicraft/entity/mob/MobAi.java index 813192735..ec2f149be 100644 --- a/src/client/java/minicraft/entity/mob/MobAi.java +++ b/src/client/java/minicraft/entity/mob/MobAi.java @@ -14,9 +14,6 @@ import minicraft.item.PotionType; import minicraft.level.Level; import minicraft.level.tile.Tile; -import minicraft.level.tile.TorchTile; - -import java.util.Arrays; public abstract class MobAi extends Mob { @@ -29,12 +26,11 @@ public abstract class MobAi extends Mob { /** * Constructor for a mob with an ai. - * - * @param sprites All of this mob's sprites. + * @param sprites All of this mob's sprites. * @param maxHealth Maximum health of the mob. - * @param lifetime How many ticks this mob can live before its removed. - * @param rwTime How long the mob will walk in a random direction. (random walk duration) - * @param rwChance The chance of this mob will walk in a random direction (random walk chance) + * @param lifetime How many ticks this mob can live before its removed. + * @param rwTime How long the mob will walk in a random direction. (random walk duration) + * @param rwChance The chance of this mob will walk in a random direction (random walk chance) */ protected MobAi(LinkedSprite[][] sprites, int maxHealth, int lifetime, int rwTime, int rwChance) { super(sprites, maxHealth); @@ -66,7 +62,6 @@ public void handleDespawn() { /** * Checking whether the mob is within any light. From tiles or from lanterns. - * * @return {@code true} if the mob is within any light. */ protected boolean isWithinLight() { @@ -85,7 +80,6 @@ protected boolean isWithinLight() { /** * Checks if the mob should sleep this tick. - * * @return true if mob should sleep, false if not. */ protected boolean skipTick() { @@ -180,9 +174,8 @@ public boolean canWool() { /** * Sets the mob to walk in a random direction for a given amount of time. - * * @param byChance true if the mob should always get a new direction to walk, false if - * there should be a chance that the mob moves. + * there should be a chance that the mob moves. */ public void randomizeWalkDir(boolean byChance) { // Boolean specifies if this method, from where it's called, is called every tick, or after a random chance. if (!byChance && random.nextInt(randomWalkChance) != 0) return; @@ -196,10 +189,9 @@ public void randomizeWalkDir(boolean byChance) { // Boolean specifies if this me /** * Adds some items to the level. - * * @param mincount Least amount of items to add. * @param maxcount Most amount of items to add. - * @param items Which items should be added. + * @param items Which items should be added. */ protected void dropItem(int mincount, int maxcount, Item... items) { int count = random.nextInt(maxcount - mincount + 1) + mincount; @@ -209,13 +201,12 @@ protected void dropItem(int mincount, int maxcount, Item... items) { /** * Determines if a friendly mob can spawn here. - * - * @param level The level the mob is trying to spawn in. - * @param x X map coordinate of spawn. - * @param y Y map coordinate of spawn. + * @param level The level the mob is trying to spawn in. + * @param x X map coordinate of spawn. + * @param y Y map coordinate of spawn. * @param playerDist Max distance from the player the mob can be spawned in. * @param soloRadius How far out can there not already be any entities. - * This is multiplied by the monster density of the level + * This is multiplied by the monster density of the level * @return true if the mob can spawn, false if not. */ protected static boolean checkStartPos(Level level, int x, int y, int playerDist, int soloRadius) { @@ -237,7 +228,6 @@ protected static boolean checkStartPos(Level level, int x, int y, int playerDist /** * Returns the maximum level of this mob. - * * @return max level of the mob. */ public abstract int getMaxLevel(); diff --git a/src/client/java/minicraft/entity/mob/ObsidianKnight.java b/src/client/java/minicraft/entity/mob/ObsidianKnight.java index 9c28558eb..5d874e1a5 100644 --- a/src/client/java/minicraft/entity/mob/ObsidianKnight.java +++ b/src/client/java/minicraft/entity/mob/ObsidianKnight.java @@ -19,13 +19,13 @@ import org.jetbrains.annotations.Range; public class ObsidianKnight extends EnemyMob { - private static final SpriteLinker.LinkedSprite[][][] armored = new SpriteLinker.LinkedSprite[][][]{ + private static final SpriteLinker.LinkedSprite[][][] armored = new SpriteLinker.LinkedSprite[][][] { Mob.compileMobSpriteAnimations(0, 0, "obsidian_knight_armored"), Mob.compileMobSpriteAnimations(0, 2, "obsidian_knight_armored"), Mob.compileMobSpriteAnimations(0, 4, "obsidian_knight_armored"), Mob.compileMobSpriteAnimations(0, 6, "obsidian_knight_armored") }; - private static final SpriteLinker.LinkedSprite[][][] broken = new SpriteLinker.LinkedSprite[][][]{ + private static final SpriteLinker.LinkedSprite[][][] broken = new SpriteLinker.LinkedSprite[][][] { Mob.compileMobSpriteAnimations(0, 0, "obsidian_knight_broken"), Mob.compileMobSpriteAnimations(0, 2, "obsidian_knight_broken"), Mob.compileMobSpriteAnimations(0, 4, "obsidian_knight_broken"), diff --git a/src/client/java/minicraft/entity/mob/PassiveMob.java b/src/client/java/minicraft/entity/mob/PassiveMob.java index a53295a26..294d14fbf 100644 --- a/src/client/java/minicraft/entity/mob/PassiveMob.java +++ b/src/client/java/minicraft/entity/mob/PassiveMob.java @@ -15,7 +15,6 @@ public class PassiveMob extends MobAi { /** * Constructor for a non-hostile (passive) mob. * healthFactor = 3. - * * @param sprites The mob's sprites. */ public PassiveMob(LinkedSprite[][] sprites) { @@ -24,10 +23,9 @@ public PassiveMob(LinkedSprite[][] sprites) { /** * Constructor for a non-hostile (passive) mob. - * - * @param sprites The mob's sprites. + * @param sprites The mob's sprites. * @param healthFactor Determines the mobs health. Will be multiplied by the difficulty - * and then added with 5. + * and then added with 5. */ public PassiveMob(LinkedSprite[][] sprites, int healthFactor) { super(sprites, 5 + healthFactor * Settings.getIdx("diff"), 5 * 60 * Updater.normSpeed, 45, 40); @@ -62,10 +60,9 @@ public void die() { /** * Checks a given position in a given level to see if the mob can spawn there. * Passive mobs can only spawn on grass or flower tiles. - * * @param level The level which the mob wants to spawn in. - * @param x X map spawn coordinate. - * @param y Y map spawn coordinate. + * @param x X map spawn coordinate. + * @param y Y map spawn coordinate. * @return true if the mob can spawn here, false if not. */ public static boolean checkStartPos(Level level, int x, int y) { diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index b9a74e976..ec59c5570 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -112,10 +112,10 @@ public class Player extends Mob implements ItemHolder, ClientTickable { private int hungerStamCnt, stamHungerTicks; // Tiers of hunger penalties before losing a burger. private static final int maxHungerTicks = 400; // The cutoff value for stamHungerTicks - private static final int[] maxHungerStams = {10, 7, 5}; // TungerStamCnt required to lose a burger. - private static final int[] hungerTickCount = {120, 30, 10}; // Ticks before decrementing stamHungerTicks. - private static final int[] hungerStepCount = {8, 3, 1}; // Steps before decrementing stamHungerTicks. - private static final int[] minStarveHealth = {5, 3, 0}; // Min hearts required for hunger to hurt you. + private static final int[] maxHungerStams = { 10, 7, 5 }; // TungerStamCnt required to lose a burger. + private static final int[] hungerTickCount = { 120, 30, 10 }; // Ticks before decrementing stamHungerTicks. + private static final int[] hungerStepCount = { 8, 3, 1 }; // Steps before decrementing stamHungerTicks. + private static final int[] minStarveHealth = { 5, 3, 0 }; // Min hearts required for hunger to hurt you. private int stepCount; // Used to penalize hunger for movement. private int hungerChargeDelay; // The delay between each time the hunger bar increases your health private int hungerStarveDelay; // The delay between each time the hunger bar decreases your health @@ -251,8 +251,7 @@ public void addScore(int points) { /** * Adds a new potion effect to the player. - * - * @param type Type of potion. + * @param type Type of potion. * @param duration How long the effect lasts. */ public void addPotionEffect(PotionType type, int duration) { @@ -261,7 +260,6 @@ public void addPotionEffect(PotionType type, int duration) { /** * Adds a potion effect to the player. - * * @param type Type of effect. */ public void addPotionEffect(PotionType type) { @@ -270,7 +268,6 @@ public void addPotionEffect(PotionType type) { /** * Returns all the potion effects currently affecting the player. - * * @return all potion effects on the player. */ public HashMap getPotionEffects() { @@ -842,7 +839,6 @@ private boolean hurt(Rectangle area) { /** * Calculates how much damage the player will do. - * * @param e Entity being attacked. * @return How much damage the player does. */ @@ -1032,8 +1028,7 @@ public boolean canWool() { /** * Finds a starting position for the player. - * - * @param level Level which the player wants to start in. + * @param level Level which the player wants to start in. * @param spawnSeed Spawn seed. */ public void findStartPos(Level level, long spawnSeed) { @@ -1043,7 +1038,6 @@ public void findStartPos(Level level, long spawnSeed) { /** * Finds the starting position for the player in a level. - * * @param level The level. */ public void findStartPos(Level level) { @@ -1082,7 +1076,6 @@ public void findStartPos(Level level, boolean setSpawn) { /** * Finds a location where the player can respawn in a given level. - * * @param level The level. */ public void respawn(Level level) { @@ -1097,7 +1090,6 @@ public void respawn(Level level) { /** * Uses an amount of stamina to do an action. - * * @param cost How much stamina the action requires. * @return true if the player had enough stamina, false if not. */ @@ -1159,8 +1151,7 @@ public void onExploded(Tnt tnt, int dmg) { /** * Hurt the player. - * - * @param damage How much damage to do to player. + * @param damage How much damage to do to player. * @param attackDir What direction to attack. */ public void hurt(int damage, Direction attackDir) { @@ -1210,8 +1201,7 @@ protected void doHurt(int damage, Direction attackDir) { /** * Hurt the player directly. Don't use the armor as a shield. - * - * @param damage Amount of damage to do to player + * @param damage Amount of damage to do to player * @param attackDir The direction of attack. */ private void directHurt(int damage, Direction attackDir) { diff --git a/src/client/java/minicraft/entity/mob/Skeleton.java b/src/client/java/minicraft/entity/mob/Skeleton.java index 8714aca2c..fdf78ac5c 100644 --- a/src/client/java/minicraft/entity/mob/Skeleton.java +++ b/src/client/java/minicraft/entity/mob/Skeleton.java @@ -7,7 +7,7 @@ import minicraft.item.Items; public class Skeleton extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ + private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { Mob.compileMobSpriteAnimations(0, 0, "skeleton"), Mob.compileMobSpriteAnimations(0, 2, "skeleton"), Mob.compileMobSpriteAnimations(0, 4, "skeleton"), @@ -19,7 +19,6 @@ public class Skeleton extends EnemyMob { /** * Creates a skeleton of a given level. - * * @param lvl The skeleton's level. */ public Skeleton(int lvl) { @@ -51,8 +50,8 @@ public void tick() { } public void die() { - int[] diffrands = {20, 20, 30}; - int[] diffvals = {13, 18, 28}; + int[] diffrands = { 20, 20, 30 }; + int[] diffvals = { 13, 18, 28 }; int diff = Settings.getIdx("diff"); int count = random.nextInt(3 - diff) + 1; diff --git a/src/client/java/minicraft/entity/mob/Slime.java b/src/client/java/minicraft/entity/mob/Slime.java index b1b1de77d..e8294c2c6 100644 --- a/src/client/java/minicraft/entity/mob/Slime.java +++ b/src/client/java/minicraft/entity/mob/Slime.java @@ -8,18 +8,17 @@ import minicraft.item.Items; public class Slime extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ - new LinkedSprite[][]{Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "slime")}, - new LinkedSprite[][]{Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "slime")}, - new LinkedSprite[][]{Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "slime")}, - new LinkedSprite[][]{Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "slime")} + private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { + new LinkedSprite[][] { Mob.compileSpriteList(0, 0, 2, 2, 0, 2, "slime") }, + new LinkedSprite[][] { Mob.compileSpriteList(0, 2, 2, 2, 0, 2, "slime") }, + new LinkedSprite[][] { Mob.compileSpriteList(0, 4, 2, 2, 0, 2, "slime") }, + new LinkedSprite[][] { Mob.compileSpriteList(0, 6, 2, 2, 0, 2, "slime") } }; private int jumpTime = 0; // jumpTimer, also acts as a rest timer before the next jump /** * Creates a slime of the given level. - * * @param lvl Slime's level. */ public Slime(int lvl) { diff --git a/src/client/java/minicraft/entity/mob/Snake.java b/src/client/java/minicraft/entity/mob/Snake.java index c22c62a70..81c66b340 100644 --- a/src/client/java/minicraft/entity/mob/Snake.java +++ b/src/client/java/minicraft/entity/mob/Snake.java @@ -6,7 +6,7 @@ import minicraft.item.Items; public class Snake extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ + private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { Mob.compileMobSpriteAnimations(0, 0, "snake"), Mob.compileMobSpriteAnimations(0, 2, "snake"), Mob.compileMobSpriteAnimations(0, 4, "snake"), diff --git a/src/client/java/minicraft/entity/mob/Zombie.java b/src/client/java/minicraft/entity/mob/Zombie.java index 02ba06ade..5885203a0 100644 --- a/src/client/java/minicraft/entity/mob/Zombie.java +++ b/src/client/java/minicraft/entity/mob/Zombie.java @@ -5,7 +5,7 @@ import minicraft.item.Items; public class Zombie extends EnemyMob { - private static LinkedSprite[][][] sprites = new LinkedSprite[][][]{ + private static LinkedSprite[][][] sprites = new LinkedSprite[][][] { Mob.compileMobSpriteAnimations(0, 0, "zombie"), Mob.compileMobSpriteAnimations(0, 2, "zombie"), Mob.compileMobSpriteAnimations(0, 4, "zombie"), @@ -14,7 +14,6 @@ public class Zombie extends EnemyMob { /** * Creates a zombie of the given level. - * * @param lvl Zombie's level. */ public Zombie(int lvl) { diff --git a/src/client/java/minicraft/entity/particle/BurnParticle.java b/src/client/java/minicraft/entity/particle/BurnParticle.java index 53f0db4b1..0ef444d80 100644 --- a/src/client/java/minicraft/entity/particle/BurnParticle.java +++ b/src/client/java/minicraft/entity/particle/BurnParticle.java @@ -11,7 +11,6 @@ public class BurnParticle extends Particle { /** * Creates a new particle at the given position. It has a lifetime of 30 ticks * and a fire looking sprite. - * * @param x X map position * @param y Y map position */ diff --git a/src/client/java/minicraft/entity/particle/FireParticle.java b/src/client/java/minicraft/entity/particle/FireParticle.java index cfb3aadb2..900019d8f 100644 --- a/src/client/java/minicraft/entity/particle/FireParticle.java +++ b/src/client/java/minicraft/entity/particle/FireParticle.java @@ -9,7 +9,6 @@ public class FireParticle extends Particle { /** * Creates a new particle at the given position. It has a lifetime of 30 ticks * and a fire looking sprite. - * * @param x X map position * @param y Y map position */ diff --git a/src/client/java/minicraft/entity/particle/Particle.java b/src/client/java/minicraft/entity/particle/Particle.java index 9088d4214..04e0382ec 100644 --- a/src/client/java/minicraft/entity/particle/Particle.java +++ b/src/client/java/minicraft/entity/particle/Particle.java @@ -16,12 +16,11 @@ public class Particle extends Entity implements ClientTickable { /** * Creates an particle entity at the given position. The particle has a x and y radius = 1. - * - * @param x X map coordinate - * @param y Y map coorindate - * @param xr x radius of the particle + * @param x X map coordinate + * @param y Y map coorindate + * @param xr x radius of the particle * @param lifetime How many game ticks the particle lives before its removed - * @param sprite The particle's sprite + * @param sprite The particle's sprite */ public Particle(int x, int y, int xr, int lifetime, LinkedSprite sprite) { // Make a particle at the given coordinates diff --git a/src/client/java/minicraft/entity/particle/SandParticle.java b/src/client/java/minicraft/entity/particle/SandParticle.java index e2a8a7df8..ea268e113 100644 --- a/src/client/java/minicraft/entity/particle/SandParticle.java +++ b/src/client/java/minicraft/entity/particle/SandParticle.java @@ -8,7 +8,6 @@ public class SandParticle extends Particle { /** * Creating a sand particle. - * * @param x X map position * @param y Y map position */ diff --git a/src/client/java/minicraft/entity/particle/SmashParticle.java b/src/client/java/minicraft/entity/particle/SmashParticle.java index 3873604c2..c5063c1ec 100644 --- a/src/client/java/minicraft/entity/particle/SmashParticle.java +++ b/src/client/java/minicraft/entity/particle/SmashParticle.java @@ -7,7 +7,6 @@ public class SmashParticle extends Particle { /** * Creates a smash particle at the given position. Has a lifetime of 10 ticks. * Will also play a monsterhurt sound when created. - * * @param x X map position * @param y Y map position */ diff --git a/src/client/java/minicraft/entity/particle/TextParticle.java b/src/client/java/minicraft/entity/particle/TextParticle.java index 964d02588..504317e40 100644 --- a/src/client/java/minicraft/entity/particle/TextParticle.java +++ b/src/client/java/minicraft/entity/particle/TextParticle.java @@ -13,10 +13,9 @@ public class TextParticle extends Particle { /** * Creates a text particle which shows a message on the screen. - * * @param msg Message to display - * @param x X map position - * @param y Y map position + * @param x X map position + * @param y Y map position * @param col Text color */ public TextParticle(String msg, int x, int y, int col) { @@ -63,7 +62,6 @@ public void render(Screen screen) { /** * Returns the message and color divied by the character :. - * * @return string representation of the particle */ public String getData() { diff --git a/src/client/java/minicraft/gfx/Color.java b/src/client/java/minicraft/gfx/Color.java index b71ed651a..a80167497 100644 --- a/src/client/java/minicraft/gfx/Color.java +++ b/src/client/java/minicraft/gfx/Color.java @@ -64,7 +64,7 @@ public static int get(int a, int copy) { } public static String toStringCode(int color) { - return new String(new char[]{ + return new String(new char[] { Color.COLOR_CHAR, (char) ((color >> 24) & 0xFF), // Alpha (char) ((color >> 16) & 0xFF), // Red @@ -143,7 +143,7 @@ public static int[] separateEncodedSprite(int rgb4Sprite, boolean convertToReada d = unGet(d); } // Else, they are rgbByte - return new int[]{a, b, c, d}; + return new int[] { a, b, c, d }; } /** @@ -153,7 +153,7 @@ public static int[] decodeRGB(int rgbByte) { int r = (rgbByte / 36) % 6; int g = (rgbByte / 6) % 6; int b = rgbByte % 6; - return new int[]{r, g, b}; + return new int[] { r, g, b }; } public static int unGet(int rgbByte) { // rgbByte -> rgbReadable @@ -183,7 +183,7 @@ protected static int[] decodeRGBColor(int rgbInt) { int g = (rgbInt & 0x00_FF_00) >> 8; int b = (rgbInt & 0x00_00_FF); - return new int[]{r, g, b}; + return new int[] { r, g, b }; } /// This is for color testing. diff --git a/src/client/java/minicraft/gfx/FontStyle.java b/src/client/java/minicraft/gfx/FontStyle.java index 3435770a2..81d2c6e75 100644 --- a/src/client/java/minicraft/gfx/FontStyle.java +++ b/src/client/java/minicraft/gfx/FontStyle.java @@ -8,8 +8,8 @@ public class FontStyle { /// this specifies the x and y offsets for each binary value in the "shadow location byte", and is what causes each value to progress in a circle. - private static int[] shadowPosMap = {0, 1, 1, 1, 0, -1, -1, -1, - -1, -1, 0, 1, 1, 1, 0, -1}; + private static int[] shadowPosMap = { 0, 1, 1, 1, 0, -1, -1, -1, + -1, -1, 0, 1, 1, 1, 0, -1 }; /** * The shadowing technique uses binary strings to specify where to outline a string of text. It was going to be a straight byte, since there are 8 positions, but since it's going to be a string anyway, I decided to make it accept a string. * Each position is specified fairly simply: it goes clockwise, starting from the top. Then it goes top right, right, bottom right, bottom, etc. up to top left. It's kind of like a compass, with a position for N, NE, E, etc. diff --git a/src/client/java/minicraft/gfx/MinicraftImage.java b/src/client/java/minicraft/gfx/MinicraftImage.java index 45651abc8..8ed0e6c56 100644 --- a/src/client/java/minicraft/gfx/MinicraftImage.java +++ b/src/client/java/minicraft/gfx/MinicraftImage.java @@ -21,7 +21,6 @@ public class MinicraftImage { /** * Default with maximum size of image. - * * @param image The image to be added. * @throws IOException if I/O exception occurs. */ @@ -31,9 +30,8 @@ public MinicraftImage(BufferedImage image) throws IOException { /** * Custom size. - * - * @param image The image to be added. - * @param width The width of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. + * @param image The image to be added. + * @param width The width of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. * @param height The height of the {@link MinicraftImage} to be applied to the {@link LinkedSprite}. * @throws IOException */ diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index 43b679ccc..4dad1eebf 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -185,7 +185,7 @@ public void setOffset(int xOffset, int yOffset) { In the end, "every other every row", will need, for example in column 1, 15 light to be lit, then 0 light to be lit, then 12 light to be lit, then 3 light to be lit. So, the pixels of lower light levels will generally be lit every other pixel, while the brighter ones appear more often. The reason for the variance in values is to provide EVERY number between 0 and 15, so that all possible light levels (below 16) are represented fittingly with their own pattern of lit and not lit. 16 is the minimum pixel lighness required to ensure that the pixel will always remain lit. */ - private static final int[] dither = new int[]{ + private static final int[] dither = new int[] { 0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, diff --git a/src/client/java/minicraft/gfx/SpriteAnimation.java b/src/client/java/minicraft/gfx/SpriteAnimation.java index caeea0fdc..f7333d2b4 100644 --- a/src/client/java/minicraft/gfx/SpriteAnimation.java +++ b/src/client/java/minicraft/gfx/SpriteAnimation.java @@ -63,9 +63,8 @@ public static void refreshAnimations() { /** * Constructing animations with the provided key. The meta is given by default. - * * @param type The sprite category. - * @param key The sprite resource key. + * @param key The sprite resource key. */ public SpriteAnimation(SpriteType type, String key) { this(metas.get(key), type, key); @@ -73,10 +72,9 @@ public SpriteAnimation(SpriteType type, String key) { /** * Constructing animations with the provided metadata and key. It should already be validated. - * * @param meta The metadata of the sprite sheet. * @param type The sprite category. - * @param key The sprite resource key. + * @param key The sprite resource key. */ public SpriteAnimation(SpriteMeta meta, SpriteType type, String key) { this.type = type; @@ -88,7 +86,6 @@ public SpriteAnimation(SpriteMeta meta, SpriteType type, String key) { /** * Setting the tile class of this animation used for tile connector rendering. - * * @param connectChecker The tile connection checker. * @return The instance itself. */ @@ -99,7 +96,6 @@ public SpriteAnimation setConnectChecker(BiFunction conn /** * Setting if the singleton sprite is used for other tile connective rendering. - * * @param connective If used for connective rendering. * @return The instance itself. */ @@ -110,7 +106,6 @@ public SpriteAnimation setSingletonWithConnective(boolean connective) { /** * Setting the color of all animation frames. - * * @param color The color of sprite. * @return The instance itself. */ @@ -124,7 +119,6 @@ public SpriteAnimation setColor(int color) { /** * Setting the color of the specific animation frame. - * * @param frame The specific frame. * @param color The color of sprite. * @return The instance itself. @@ -139,7 +133,6 @@ public SpriteAnimation setColor(int frame, int color) { /** * Setting the mirror of all animation frames. - * * @param mirror The mirror of sprite/ * @return The instance itself. */ @@ -153,8 +146,7 @@ public SpriteAnimation setMirror(int mirror) { /** * Setting the mirror of the specific animation frame. - * - * @param frame The specific frame. + * @param frame The specific frame. * @param mirror The mirror of sprite. * @return The instance itself. */ @@ -168,7 +160,6 @@ public SpriteAnimation setMirror(int frame, int mirror) { /** * Setting the sprite sheet mirror of all frames. - * * @param mirror The mirror of sprite sheet. * @return The instance itself. */ @@ -179,7 +170,6 @@ public SpriteAnimation setSpriteMirror(int mirror) { /** * Getting the current frame of animation. - * * @return The current frame sprite. */ public LinkedSprite getCurrentFrame() { @@ -188,7 +178,6 @@ public LinkedSprite getCurrentFrame() { /** * Getting the specific frame of animation. - * * @param frame The specific frame. * @return The frame sprite. */ @@ -198,11 +187,10 @@ public LinkedSprite getFrame(int frame) { /** * Rendering the animation on the screen. - * * @param screen The screen instance. - * @param level The level for rendering. - * @param x The x coordinate level tile. - * @param y The y coordinate level tile. + * @param level The level for rendering. + * @param x The x coordinate level tile. + * @param y The y coordinate level tile. */ public void render(Screen screen, Level level, int x, int y) { // If border and the tile class is set. @@ -294,7 +282,7 @@ public void refreshAnimation(SpriteMeta metadata) { this.metadata = metadata; MinicraftImage sheet = Renderer.spriteLinker.getSheet(type, key); if (sheet == null) { - animations = new LinkedSprite[]{SpriteLinker.missingTexture(type)}; + animations = new LinkedSprite[] { SpriteLinker.missingTexture(type) }; border = null; corner = null; return; @@ -322,7 +310,7 @@ public void refreshAnimation(SpriteMeta metadata) { if (metadata.border != null) border = new LinkedSprite(type, metadata.border); if (metadata.corner != null) corner = new LinkedSprite(type, metadata.corner); } else { - animations = new LinkedSprite[]{new LinkedSprite(type, key).setSpriteSize(width, width)}; + animations = new LinkedSprite[] { new LinkedSprite(type, key).setSpriteSize(width, width) }; border = null; corner = null; } diff --git a/src/client/java/minicraft/gfx/SpriteLinker.java b/src/client/java/minicraft/gfx/SpriteLinker.java index 12b1909fe..fd3badbbd 100644 --- a/src/client/java/minicraft/gfx/SpriteLinker.java +++ b/src/client/java/minicraft/gfx/SpriteLinker.java @@ -34,9 +34,8 @@ public void resetSprites() { /** * The safe size check which will be required for the higher resolution sprites must be used * before this method invoked. But in new rendering engine. - * - * @param t The sheet type. - * @param key The sheet key. + * @param t The sheet type. + * @param key The sheet key. * @param spriteSheet The sheet. */ public void setSprite(SpriteType t, String key, MinicraftImage spriteSheet) { @@ -58,8 +57,7 @@ public void setSprite(SpriteType t, String key, MinicraftImage spriteSheet) { /** * Getting the sprite sheet with the category and key. - * - * @param t The sprite category + * @param t The sprite category * @param key The resource key. * @return The sprite sheet. null if not found. */ @@ -89,8 +87,7 @@ public void clearSkins() { /** * Setting the skin in entity sheet. - * - * @param key The key of the sheet. + * @param key The key of the sheet. * @param spriteSheet The sheet to be added. */ public void setSkin(String key, MinicraftImage spriteSheet) { @@ -99,7 +96,6 @@ public void setSkin(String key, MinicraftImage spriteSheet) { /** * Getting the missing texture texture with the specific sprite type. - * * @param type The sprite category. * @return The missing texture or null if invalid sprite type. */ @@ -118,7 +114,6 @@ public static LinkedSprite missingTexture(SpriteType type) { /** * Getting the sheet of missing texture with the specific sprite type. - * * @param type The sprite category. * @return Ths missing texture sprite sheet or null if invalid sprite type. */ @@ -167,9 +162,8 @@ public static enum SpriteType { /** * Linking the LinkedSprite into specific sheet map. This should only be used by {@link LinkedSprite}. - * * @param sheet The sprite to be linked. - * @param type The sprite type to be linked. + * @param type The sprite type to be linked. */ public void linkSpriteSheet(LinkedSprite sheet, SpriteType type) { // Because of the private access. @@ -209,8 +203,7 @@ public static class LinkedSprite implements Destroyable { /** * Create new LinkedSprite for the specific category and resource key. - * - * @param t The category of the sprite. + * @param t The category of the sprite. * @param key The resource key of the sprite. */ public LinkedSprite(SpriteType t, String key) { @@ -222,7 +215,6 @@ public LinkedSprite(SpriteType t, String key) { /** * Getting the sprite sheet of the linked sprite. - * * @return The current linked sprite. */ public MinicraftImage getSheet() { @@ -231,7 +223,6 @@ public MinicraftImage getSheet() { /** * Setting the sprite size. - * * @param w The sprite width. * @param h The sprite height * @return The instance itself. @@ -245,7 +236,6 @@ public LinkedSprite setSpriteSize(int w, int h) { /** * Setting the sprite position. - * * @param x The x position of the sprite. * @param y The y position of the sprite. * @return The instance itself. @@ -259,7 +249,6 @@ public LinkedSprite setSpritePos(int x, int y) { /** * Setting the sprite position and size. - * * @param x The x position of the sprite. * @param y The y position of the sprite. * @param w The sprite width. @@ -275,7 +264,6 @@ public LinkedSprite setSpriteDim(int x, int y, int w, int h) { /** * Setting the white tint. - * * @param color The color of the white tint. * @return The instance itself. */ @@ -287,7 +275,6 @@ public LinkedSprite setColor(int color) { /** * Setting the mirror of the sprite. - * * @param mirror The mirror of the sprite. * @return The instance itself. */ @@ -299,7 +286,6 @@ public LinkedSprite setMirror(int mirror) { /** * Setting the flip of the sprite sheet. - * * @param flip The mirror of the sprite sheet. * @return The instance itself. */ @@ -311,7 +297,6 @@ public LinkedSprite setFlip(int flip) { /** * Getting the sprite with the configuration. - * * @return The generated sprite. */ public Sprite getSprite() { diff --git a/src/client/java/minicraft/item/FishingRodItem.java b/src/client/java/minicraft/item/FishingRodItem.java index 7aed8ec8c..957ed1017 100644 --- a/src/client/java/minicraft/item/FishingRodItem.java +++ b/src/client/java/minicraft/item/FishingRodItem.java @@ -34,10 +34,10 @@ protected static ArrayList getAllInstances() { * If you want to know the percent chance of a category (let's say tool, which is third) * You have to subtract 1 + the "tool" number from the number before it (for the first number subtract from 100)*/ private static final int[][] LEVEL_CHANCES = { - {44, 14, 9, 4}, // They're in the order "fish", "junk", "tools", "rare" - {24, 14, 9, 4}, // Iron has very high chance of fish - {59, 49, 9, 4}, // Gold has very high chance of tools - {79, 69, 59, 4} // Gem has very high chance of rare items + { 44, 14, 9, 4 }, // They're in the order "fish", "junk", "tools", "rare" + { 24, 14, 9, 4 }, // Iron has very high chance of fish + { 59, 49, 9, 4 }, // Gold has very high chance of tools + { 79, 69, 59, 4 } // Gem has very high chance of rare items }; private static final String[] LEVEL_NAMES = { diff --git a/src/client/java/minicraft/item/Inventory.java b/src/client/java/minicraft/item/Inventory.java index c0ca6b756..6df5f74ec 100644 --- a/src/client/java/minicraft/item/Inventory.java +++ b/src/client/java/minicraft/item/Inventory.java @@ -21,7 +21,6 @@ public int getMaxSlots() { /** * Returns all the items which are in this inventory. - * * @return ArrayList containing all the items in the inventory. */ public List getItems() { @@ -38,7 +37,6 @@ public int invSize() { /** * Get one item in this inventory. - * * @param idx The index of the item in the inventory's item array. * @return The specified item. */ @@ -48,7 +46,6 @@ public Item get(int idx) { /** * Remove an item in this inventory. - * * @param idx The index of the item in the inventory's item array. * @return The removed item. */ @@ -67,9 +64,8 @@ public int add(@Nullable Item item) { /** * Adds several copies of the same item to the end of the inventory. - * * @param item Item to be added. - * @param num Amount of items to add. + * @param num Amount of items to add. */ public int add(Item item, int num) { int total = 0; @@ -80,7 +76,6 @@ public int add(Item item, int num) { /** * Adds an item to a specific spot in the inventory. - * * @param slot Index to place item at. * @param item Item to be added. * @return The number of items added. @@ -197,7 +192,6 @@ public void removeItem(Item i) { /** * Removes items from this inventory. Note, if passed a stackable item, this will only remove a max of count from the stack. - * * @param given Item to remove. * @param count Max amount of the item to remove. */ @@ -241,7 +235,6 @@ else if (curItem.equals(given)) /** * Generates a string representation of all the items in the inventory which can be sent * over the network. - * * @return String representation of all the items in the inventory. */ public String getItemData() { @@ -257,7 +250,6 @@ public String getItemData() { /** * Replaces all the items in the inventory with the items in the string. - * * @param items String representation of an inventory. */ public void updateInv(String items) { @@ -271,12 +263,11 @@ public void updateInv(String items) { /** * Tries to add an item to the inventory. - * - * @param chance Chance for the item to be added. - * @param item Item to be added. - * @param num How many of the item. + * @param chance Chance for the item to be added. + * @param item Item to be added. + * @param num How many of the item. * @param allOrNothing if true, either all items will be added or none, if false its possible to add - * between 0-num items. + * between 0-num items. */ public void tryAdd(int chance, Item item, int num, boolean allOrNothing) { if (!allOrNothing || random.nextInt(chance) == 0) @@ -304,9 +295,8 @@ public void tryAdd(int chance, ToolType type, int lvl) { /** * Tries to add an Furniture to the inventory. - * * @param chance Chance for the item to be added. - * @param type Type of furniture to add. + * @param type Type of furniture to add. */ public void tryAdd(int chance, Furniture type) { tryAdd(chance, new FurnitureItem(type)); diff --git a/src/client/java/minicraft/item/ToolItem.java b/src/client/java/minicraft/item/ToolItem.java index 9a105c3b2..6a8c945db 100644 --- a/src/client/java/minicraft/item/ToolItem.java +++ b/src/client/java/minicraft/item/ToolItem.java @@ -30,7 +30,7 @@ protected static ArrayList getAllInstances() { private Random random = new Random(); - public static final String[] LEVEL_NAMES = {"Wood", "Rock", "Iron", "Gold", "Gem"}; // The names of the different levels. A later level means a stronger tool. + public static final String[] LEVEL_NAMES = { "Wood", "Rock", "Iron", "Gold", "Gem" }; // The names of the different levels. A later level means a stronger tool. public ToolType type; // Type of tool (Sword, hoe, axe, pickaxe, shovel) public int level; // Level of said tool diff --git a/src/client/java/minicraft/item/ToolType.java b/src/client/java/minicraft/item/ToolType.java index 932ec62d7..b6e8e1883 100644 --- a/src/client/java/minicraft/item/ToolType.java +++ b/src/client/java/minicraft/item/ToolType.java @@ -19,9 +19,8 @@ public enum ToolType { * Create a tool with four levels: wood, stone, iron, gold, and gem. * All these levels are added automatically but sprites have to be added manually. * Uses line 14 in the item spritesheet. - * * @param xPos X position of the starting sprite in the spritesheet. - * @param dur Durabiltity of the tool. + * @param dur Durabiltity of the tool. */ ToolType(int xPos, int dur) { this.xPos = xPos; @@ -33,9 +32,8 @@ public enum ToolType { /** * Create a tool without a specified level. * Uses line 13 in the items spritesheet. - * - * @param xPos X position of the sprite in the spritesheet. - * @param dur Durabiltity of the tool. + * @param xPos X position of the sprite in the spritesheet. + * @param dur Durabiltity of the tool. * @param noLevel If the tool has only one level. */ ToolType(int xPos, int dur, boolean noLevel) { diff --git a/src/client/java/minicraft/item/WateringCanItem.java b/src/client/java/minicraft/item/WateringCanItem.java index 181b34745..7394f66da 100644 --- a/src/client/java/minicraft/item/WateringCanItem.java +++ b/src/client/java/minicraft/item/WateringCanItem.java @@ -29,7 +29,7 @@ protected static ArrayList getAllInstances() { private static final SpriteLinker.LinkedSprite spriteFilled = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "watering_can_filled"); private static final SpriteLinker.LinkedSprite particleSprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "glint"); - private static final SpriteLinker.LinkedSprite[] spriteSplash = new SpriteLinker.LinkedSprite[]{ + private static final SpriteLinker.LinkedSprite[] spriteSplash = new SpriteLinker.LinkedSprite[] { new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_0"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_1"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Entity, "splash_2"), diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index b681f3ec4..05166c9f9 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -51,7 +51,7 @@ public class Level { private final Random random; - private static final String[] levelNames = {"Sky", "Surface", "Iron", "Gold", "Lava", "Dungeon"}; + private static final String[] levelNames = { "Sky", "Surface", "Iron", "Gold", "Lava", "Dungeon" }; public static String getLevelName(int depth) { return levelNames[-1 * depth + 1]; @@ -714,7 +714,6 @@ public final List getEntitiesInTiles(int xt, int yt, int radius, boolean /** * Get entities in a certain area on the level. - * * @param xt0 Left * @param yt0 Top * @param xt1 Right @@ -726,12 +725,11 @@ public List getEntitiesInTiles(int xt0, int yt0, int xt1, int yt1) { /** * Get entities in a certain area on the level, and filter them by class. - * - * @param xt0 Left - * @param yt0 Top - * @param xt1 Right - * @param yt1 Bottom - * @param includeGiven If we should accept entities that match the provided entityClasses. If false, we ignore the provided entityClasses. + * @param xt0 Left + * @param yt0 Top + * @param xt1 Right + * @param yt1 Bottom + * @param includeGiven If we should accept entities that match the provided entityClasses. If false, we ignore the provided entityClasses. * @param entityClasses Entities to accept. * @return A list of entities in the area. */ @@ -763,7 +761,6 @@ public final List getEntitiesInTiles(int xt0, int yt0, int xt1, int yt1, /** * Check if there is an entity on the specified tile. - * * @param x The x position of the tile. * @param y The y position of the tile * @return True if there is an entity on the tile. @@ -837,18 +834,17 @@ public Player getClosestPlayer(int x, int y) { /** * Calculates maximum position can be reached by an entity with the front boundary of hit box by tile hit box. - * - * @param sgn One-dimensional direction of displacement - * @param d Displacement vector - * @param hitBoxLeft The left boundary of hit box - * @param hitBoxRight The right boundary of hit box - * @param hitBoxFront The front boundary of hit box + * @param sgn One-dimensional direction of displacement + * @param d Displacement vector + * @param hitBoxLeft The left boundary of hit box + * @param hitBoxRight The right boundary of hit box + * @param hitBoxFront The front boundary of hit box * @param frontTilePassableCheck The check of whether the front boundary of hit box hits the tile hit box; - * the first parameter takes the front tile position and second one takes the horizontal position + * the first parameter takes the front tile position and second one takes the horizontal position * @return The maximum front position can be reached by tile hit box check */ public static int calculateMaxFrontClosestTile(int sgn, int d, int hitBoxLeft, int hitBoxRight, int hitBoxFront, - BiPredicate frontTilePassableCheck) { + BiPredicate frontTilePassableCheck) { int hitBoxFront1 = hitBoxFront + d; // After maximum movement int hitBoxLeftTile = hitBoxLeft >> 4; int hitBoxRightTile = hitBoxRight >> 4; diff --git a/src/client/java/minicraft/level/LevelGen.java b/src/client/java/minicraft/level/LevelGen.java index 579a13147..771f127ca 100644 --- a/src/client/java/minicraft/level/LevelGen.java +++ b/src/client/java/minicraft/level/LevelGen.java @@ -477,7 +477,7 @@ private static short[][] createTopMap(int w, int h) { // Create surface map //average /= w*h; //System.out.println(average); - return new short[][]{map, data}; + return new short[][] { map, data }; } private static short[][] createDungeon(int w, int h) { @@ -540,7 +540,7 @@ private static short[][] createDungeon(int w, int h) { } } - return new short[][]{map, data}; + return new short[][] { map, data }; } @@ -676,7 +676,7 @@ private static short[][] createUndergroundMap(int w, int h, int depth) { } } - return new short[][]{map, data}; + return new short[][] { map, data }; } private static short[][] createSkyMap(int w, int h) { @@ -746,7 +746,7 @@ private static short[][] createSkyMap(int w, int h) { if (count >= w / 64) break; } - return new short[][]{map, data}; + return new short[][] { map, data }; } public static void main(String[] args) { @@ -823,7 +823,7 @@ public static void main(String[] args) { } img.setRGB(0, 0, w, h, pixels, 0, w); int op = JOptionPane.showOptionDialog(null, null, "Map With Seed " + worldSeed, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, - new ImageIcon(img.getScaledInstance(w * 4, h * 4, Image.SCALE_AREA_AVERAGING)), new String[]{"Next", "0x100", "0xAAFF20"}, "Next"); + new ImageIcon(img.getScaledInstance(w * 4, h * 4, Image.SCALE_AREA_AVERAGING)), new String[] { "Next", "0x100", "0xAAFF20" }, "Next"); if (op == 1) LevelGen.worldSeed = 0x100; else if (op == 2) LevelGen.worldSeed = 0xAAFF20; else LevelGen.worldSeed++; diff --git a/src/client/java/minicraft/level/tile/DirtTile.java b/src/client/java/minicraft/level/tile/DirtTile.java index 2ee791f7f..95bf00e49 100644 --- a/src/client/java/minicraft/level/tile/DirtTile.java +++ b/src/client/java/minicraft/level/tile/DirtTile.java @@ -15,7 +15,7 @@ import minicraft.util.AdvancementElement; public class DirtTile extends Tile { - private static SpriteAnimation[] levelSprite = new SpriteAnimation[]{ + private static SpriteAnimation[] levelSprite = new SpriteAnimation[] { new SpriteAnimation(SpriteType.Tile, "dirt"), new SpriteAnimation(SpriteType.Tile, "gray_dirt"), new SpriteAnimation(SpriteType.Tile, "purple_dirt") diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index a13979448..3eb01bb6b 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -91,12 +91,11 @@ public int getLightRadius(Level level, int x, int y) { /** * Hurt the tile with a specified amount of damage. - * - * @param level The level this happened on. - * @param x X pos of the tile. - * @param y Y pos of the tile. - * @param source The mob that damaged the tile. - * @param dmg Damage to taken. + * @param level The level this happened on. + * @param x X pos of the tile. + * @param y Y pos of the tile. + * @param source The mob that damaged the tile. + * @param dmg Damage to taken. * @param attackDir The direction of the player hitting. * @return If the damage was applied. */ @@ -106,11 +105,10 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at /** * Hurt the tile with a specified amount of damage. - * * @param level The level this happened on. - * @param x X position of the tile. - * @param y Y position of the tile. - * @param dmg The damage taken. + * @param x X position of the tile. + * @param y Y position of the tile. + * @param dmg The damage taken. */ public void hurt(Level level, int x, int y, int dmg) { } @@ -136,12 +134,11 @@ public void steppedOn(Level level, int xt, int yt, Entity entity) { /** * Called when you hit an item on a tile (ex: Pickaxe on rock). - * - * @param level The level the player is on. - * @param xt X position of the player in tile coordinates (32x per tile). - * @param yt Y position of the player in tile coordinates (32px per tile). - * @param player The player who called this method. - * @param item The item the player is currently holding. + * @param level The level the player is on. + * @param xt X position of the player in tile coordinates (32x per tile). + * @param yt Y position of the player in tile coordinates (32px per tile). + * @param player The player who called this method. + * @param item The item the player is currently holding. * @param attackDir The direction of the player attacking. * @return Was the operation successful? */ @@ -152,10 +149,9 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D /** * Executed when the tile is exploded. * The call for this method is done just before the tiles are changed to exploded tiles. - * * @param level The level we are on. - * @param xt X position of the tile. - * @param yt Y position of the tile. + * @param xt X position of the tile. + * @param yt Y position of the tile. * @return true if successful. */ public boolean onExplode(Level level, int xt, int yt) { diff --git a/src/client/java/minicraft/level/tile/WoolTile.java b/src/client/java/minicraft/level/tile/WoolTile.java index 0de6bc9af..ddcfc98bb 100644 --- a/src/client/java/minicraft/level/tile/WoolTile.java +++ b/src/client/java/minicraft/level/tile/WoolTile.java @@ -55,7 +55,6 @@ public enum WoolType { /** * Create a type of wool. - * * @param sprite The sprite for the type of wool. */ WoolType(String name, SpriteAnimation sprite) { diff --git a/src/client/java/minicraft/level/tile/farming/CarrotTile.java b/src/client/java/minicraft/level/tile/farming/CarrotTile.java index de8cfc7b4..542fee7d6 100644 --- a/src/client/java/minicraft/level/tile/farming/CarrotTile.java +++ b/src/client/java/minicraft/level/tile/farming/CarrotTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class CarrotTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[]{ + private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "carrot_stage0"), new LinkedSprite(SpriteType.Tile, "carrot_stage1"), new LinkedSprite(SpriteType.Tile, "carrot_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java index 70b7e3fc8..c4fc57100 100644 --- a/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HeavenlyBerriesTile.java @@ -6,7 +6,7 @@ import minicraft.level.tile.Tiles; public class HeavenlyBerriesTile extends CropTile { - private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[]{ + private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[] { new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage0"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage1"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "heavenly_berries_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java index bbad34091..6d4f7bcb5 100644 --- a/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java +++ b/src/client/java/minicraft/level/tile/farming/HellishBerriesTile.java @@ -6,7 +6,7 @@ import minicraft.level.tile.Tiles; public class HellishBerriesTile extends CropTile { - private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[]{ + private final SpriteLinker.LinkedSprite[] spritStages = new SpriteLinker.LinkedSprite[] { new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage0"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage1"), new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Tile, "hellish_berries_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/PotatoTile.java b/src/client/java/minicraft/level/tile/farming/PotatoTile.java index 08b757173..505b17860 100644 --- a/src/client/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/PotatoTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class PotatoTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[]{ + private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "potato_stage0"), new LinkedSprite(SpriteType.Tile, "potato_stage1"), new LinkedSprite(SpriteType.Tile, "potato_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/TomatoTile.java b/src/client/java/minicraft/level/tile/farming/TomatoTile.java index 1abe88c04..a8329ae63 100644 --- a/src/client/java/minicraft/level/tile/farming/TomatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/TomatoTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class TomatoTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[]{ + private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "tomato_stage0"), new LinkedSprite(SpriteType.Tile, "tomato_stage1"), new LinkedSprite(SpriteType.Tile, "tomato_stage2"), diff --git a/src/client/java/minicraft/level/tile/farming/WheatTile.java b/src/client/java/minicraft/level/tile/farming/WheatTile.java index b56d751e3..39f585bf4 100644 --- a/src/client/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/client/java/minicraft/level/tile/farming/WheatTile.java @@ -7,7 +7,7 @@ import minicraft.level.tile.Tiles; public class WheatTile extends CropTile { - private final LinkedSprite[] spritStages = new LinkedSprite[]{ + private final LinkedSprite[] spritStages = new LinkedSprite[] { new LinkedSprite(SpriteType.Tile, "wheat_stage0"), new LinkedSprite(SpriteType.Tile, "wheat_stage1"), new LinkedSprite(SpriteType.Tile, "wheat_stage2"), diff --git a/src/client/java/minicraft/saveload/Save.java b/src/client/java/minicraft/saveload/Save.java index b9a08424e..8fbbab5f2 100644 --- a/src/client/java/minicraft/saveload/Save.java +++ b/src/client/java/minicraft/saveload/Save.java @@ -65,7 +65,6 @@ public class Save { /** * This is the main save method. Called by all Save() methods. - * * @param worldFolder The folder of where to save */ private Save(File worldFolder) { @@ -94,7 +93,6 @@ private Save(File worldFolder) { /** * This will save world options - * * @param worldname The name of the world. */ public Save(String worldname) { diff --git a/src/client/java/minicraft/saveload/Version.java b/src/client/java/minicraft/saveload/Version.java index b388134be..4e10f2d8e 100644 --- a/src/client/java/minicraft/saveload/Version.java +++ b/src/client/java/minicraft/saveload/Version.java @@ -53,7 +53,6 @@ public static boolean isValid(String version) { /** * The returned value of this method (-1, 0, or 1) is determined by whether this object is less than, equal to, or greater than the specified object, ov. * (this.compareTo(new Version("1.0.0") < 0 is the same as this < 1.0.0) - * * @param ov The version to compare to. */ public int compareTo(@NotNull Version ov) { @@ -63,8 +62,7 @@ public int compareTo(@NotNull Version ov) { /** * The returned value of this method (-1, 0, or 1) is determined by whether this object is less than, equal to, or greater than the specified object, ov. * (this.compareTo(new Version("1.0.0") < 0 is the same as this < 1.0.0) - * - * @param ov The version to compare to. + * @param ov The version to compare to. * @param ignoreDev If we should ignore dev versions in this comparison. */ public int compareTo(@NotNull Version ov, boolean ignoreDev) { @@ -88,6 +86,6 @@ public String toString() { } public int[] toArray() { - return new int[]{make, major, minor, dev}; + return new int[] { make, major, minor, dev }; } } diff --git a/src/client/java/minicraft/screen/AchievementsDisplay.java b/src/client/java/minicraft/screen/AchievementsDisplay.java index c54ce2e29..6703280f3 100644 --- a/src/client/java/minicraft/screen/AchievementsDisplay.java +++ b/src/client/java/minicraft/screen/AchievementsDisplay.java @@ -136,8 +136,7 @@ public void render(Screen screen) { /** * Use this to lock or unlock an achievement. - * - * @param id Achievement ID. + * @param id Achievement ID. * @param unlocked Whether this achievement should be locked or unlocked. * @return True if setting the achievement was successful. */ @@ -181,7 +180,6 @@ private static boolean setAchievement(String id, boolean unlocked, boolean save, /** * Gets an array of all the unlocked achievements. - * * @return A string array with each unlocked achievement's id in it. */ public static String[] getUnlockedAchievements() { @@ -220,7 +218,6 @@ public int getColor(boolean isSelected) { /** * Unlocks a list of achievements. - * * @param unlockedAchievements An array of all the achievements we want to load, ids. */ public static void unlockAchievements(JSONArray unlockedAchievements) { diff --git a/src/client/java/minicraft/screen/BookDisplay.java b/src/client/java/minicraft/screen/BookDisplay.java index 0810fa1e9..b31dbdf6d 100644 --- a/src/client/java/minicraft/screen/BookDisplay.java +++ b/src/client/java/minicraft/screen/BookDisplay.java @@ -46,7 +46,7 @@ public BookDisplay(String book) { ArrayList pages = new ArrayList<>(); String[] splitContents = book.split("\0"); for (String content : splitContents) { - String[] remainder = {content}; + String[] remainder = { content }; while (remainder[remainder.length - 1].length() > 0) { remainder = Font.getLines(remainder[remainder.length - 1], maxX - minX, maxY - minY, spacing, true); pages.add(Arrays.copyOf(remainder, remainder.length - 1)); // Removes the last element of remainder, which is the leftover. diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 21b71f2b7..04d846b02 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -91,7 +91,7 @@ public void tick(InputHandler input) { try { onScreenKeyboardMenu.tick(input); } catch (OnScreenKeyboardMenu.OnScreenKeyboardMenuTickActionCompleted | - OnScreenKeyboardMenu.OnScreenKeyboardMenuBackspaceButtonActed e) { + OnScreenKeyboardMenu.OnScreenKeyboardMenuBackspaceButtonActed e) { acted = true; } diff --git a/src/client/java/minicraft/screen/CraftingDisplay.java b/src/client/java/minicraft/screen/CraftingDisplay.java index fa92751c4..b6635a8e1 100644 --- a/src/client/java/minicraft/screen/CraftingDisplay.java +++ b/src/client/java/minicraft/screen/CraftingDisplay.java @@ -65,7 +65,7 @@ private void refreshDisplayRecipes() { itemCountMenu.setPositioning(new Point(recipeMenu.getBounds().getRight() + MinicraftImage.boxWidth, recipeMenu.getBounds().getTop()), RelPos.BOTTOM_RIGHT); costsMenu.setPositioning(new Point(itemCountMenu.createMenu().getBounds().getLeft(), recipeMenu.getBounds().getBottom()), RelPos.TOP_RIGHT); - menus = new Menu[]{recipeMenu, itemCountMenu.createMenu(), costsMenu.createMenu()}; + menus = new Menu[] { recipeMenu, itemCountMenu.createMenu(), costsMenu.createMenu() }; refreshData(); onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); @@ -130,7 +130,7 @@ public void tick(InputHandler input) { try { onScreenKeyboardMenu.tick(input); } catch (OnScreenKeyboardMenu.OnScreenKeyboardMenuTickActionCompleted | - OnScreenKeyboardMenu.OnScreenKeyboardMenuBackspaceButtonActed e) { + OnScreenKeyboardMenu.OnScreenKeyboardMenuBackspaceButtonActed e) { acted = true; } diff --git a/src/client/java/minicraft/screen/EndGameDisplay.java b/src/client/java/minicraft/screen/EndGameDisplay.java index 61105f538..79ccf0322 100644 --- a/src/client/java/minicraft/screen/EndGameDisplay.java +++ b/src/client/java/minicraft/screen/EndGameDisplay.java @@ -58,7 +58,7 @@ public EndGameDisplay() { entries.add(new SelectEntry("minicraft.displays.end_game.exit", () -> Game.setDisplay(new TitleDisplay()))); - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(true, 0, RelPos.LEFT, entries).createMenu() }; } diff --git a/src/client/java/minicraft/screen/KeyInputDisplay.java b/src/client/java/minicraft/screen/KeyInputDisplay.java index f3c68612b..cb346bb4e 100644 --- a/src/client/java/minicraft/screen/KeyInputDisplay.java +++ b/src/client/java/minicraft/screen/KeyInputDisplay.java @@ -50,7 +50,7 @@ public KeyInputDisplay() { .setTitle("minicraft.displays.key_input.title") .setPositioning(new Point(Screen.w / 2, Screen.h - Font.textHeight() * 5), RelPos.TOP); - menus = new Menu[]{ + menus = new Menu[] { builder.createMenu() }; } diff --git a/src/client/java/minicraft/screen/LanguageSettingsDisplay.java b/src/client/java/minicraft/screen/LanguageSettingsDisplay.java index 44e06949d..f5696ff68 100644 --- a/src/client/java/minicraft/screen/LanguageSettingsDisplay.java +++ b/src/client/java/minicraft/screen/LanguageSettingsDisplay.java @@ -45,7 +45,7 @@ public int getColor(boolean isSelected) { public LanguageSettingsDisplay() { super(true); Map.Entry, Integer> entries = getEntries(); - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(false, 2, RelPos.CENTER, entries.getKey()) .setTitle("minicraft.displays.language_settings.title") .setSelectable(true) diff --git a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java index d57379621..e1d3458a8 100644 --- a/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java +++ b/src/client/java/minicraft/screen/OnScreenKeyboardMenu.java @@ -33,7 +33,6 @@ public OnScreenKeyboardMenu() { /** * This checks if there is any controller connected. If true, create the instance. No otherwise. - * * @return The created menu instance. `null` if there is no controller connected. */ @Nullable diff --git a/src/client/java/minicraft/screen/OptionsWorldDisplay.java b/src/client/java/minicraft/screen/OptionsWorldDisplay.java index a72fbcee7..d9090f7a5 100644 --- a/src/client/java/minicraft/screen/OptionsWorldDisplay.java +++ b/src/client/java/minicraft/screen/OptionsWorldDisplay.java @@ -50,7 +50,7 @@ public OptionsWorldDisplay() { entries.add(4, Settings.getEntry("showquests")); } - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(false, 6, RelPos.LEFT, entries) .setTitle("minicraft.displays.options_world") .createMenu() diff --git a/src/client/java/minicraft/screen/PauseDisplay.java b/src/client/java/minicraft/screen/PauseDisplay.java index 330a54e0a..7814b1561 100644 --- a/src/client/java/minicraft/screen/PauseDisplay.java +++ b/src/client/java/minicraft/screen/PauseDisplay.java @@ -56,7 +56,7 @@ public PauseDisplay() { new StringEntry(selectString, Color.GRAY) )); - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(true, 4, RelPos.CENTER, entries) .setTitle("minicraft.displays.pause", Color.YELLOW) .createMenu() diff --git a/src/client/java/minicraft/screen/PlayerDeathDisplay.java b/src/client/java/minicraft/screen/PlayerDeathDisplay.java index 0761ec87d..1659592db 100644 --- a/src/client/java/minicraft/screen/PlayerDeathDisplay.java +++ b/src/client/java/minicraft/screen/PlayerDeathDisplay.java @@ -40,7 +40,7 @@ public PlayerDeathDisplay() { })); entries.add(new SelectEntry("minicraft.displays.player_death.quit", () -> Game.setDisplay(new TitleDisplay()))); - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(true, 0, RelPos.LEFT, entries) .setPositioning(new Point(MinicraftImage.boxWidth, MinicraftImage.boxWidth * 3), RelPos.BOTTOM_RIGHT) .setTitle("minicraft.displays.player_death.title") diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index c5a709854..3274828c0 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -39,7 +39,7 @@ public PlayerInvDisplay(Player player) { .createMenu(); if (creativeMode) { creativeInv = Items.getCreativeModeInventory(); - menus = new Menu[]{ + menus = new Menu[] { menus[0], new InventoryMenu(player, creativeInv, "minicraft.displays.player_inv.container_title.items", RelPos.RIGHT) {{ creativeInv = true; @@ -53,7 +53,7 @@ public PlayerInvDisplay(Player player) { if (menus[0].getNumOptions() == 0) onSelectionChange(0, 1); } else { creativeInv = null; - menus = new Menu[]{menus[0], descriptionMenu}; + menus = new Menu[] { menus[0], descriptionMenu }; } onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); @@ -93,7 +93,7 @@ public void tick(InputHandler input) { try { onScreenKeyboardMenu.tick(input); } catch (OnScreenKeyboardMenu.OnScreenKeyboardMenuTickActionCompleted | - OnScreenKeyboardMenu.OnScreenKeyboardMenuBackspaceButtonActed e) { + OnScreenKeyboardMenu.OnScreenKeyboardMenuBackspaceButtonActed e) { acted = true; } diff --git a/src/client/java/minicraft/screen/PopupDisplay.java b/src/client/java/minicraft/screen/PopupDisplay.java index 028696760..8258fc5a2 100644 --- a/src/client/java/minicraft/screen/PopupDisplay.java +++ b/src/client/java/minicraft/screen/PopupDisplay.java @@ -57,9 +57,9 @@ public PopupDisplay(@Nullable PopupConfig config, boolean clearScreen, boolean m if (Stream.of(entries).anyMatch(e -> e instanceof InputEntry)) onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); if (onScreenKeyboardMenu == null) - menus = new Menu[]{builder.createMenu()}; + menus = new Menu[] { builder.createMenu() }; else - menus = new Menu[]{onScreenKeyboardMenu, builder.createMenu()}; + menus = new Menu[] { onScreenKeyboardMenu, builder.createMenu() }; } OnScreenKeyboardMenu onScreenKeyboardMenu; @@ -145,10 +145,9 @@ public static interface ActionCallback { /** * The callback acts when the key clicked. - * - * @param key The key of the callback trigger. + * @param key The key of the callback trigger. * @param callback The callback, when the return value is {@code true}, no more input check - * will be done. It continues if {@code false}. + * will be done. It continues if {@code false}. */ public PopupActionCallback(String key, ActionCallback callback) { this.key = key; diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index c9afba033..ff3677e62 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -207,12 +207,12 @@ public int getColor(boolean isSelected) { } } - seriesEntries = new SelectEntry[][]{ + seriesEntries = new SelectEntry[][] { unlocked.toArray(new SelectEntry[0]), completed.toArray(new SelectEntry[0]) }; - entrySeries = new QuestSeries[][]{ + entrySeries = new QuestSeries[][] { unlockedSeries.toArray(new QuestSeries[0]), completedSeries.toArray(new QuestSeries[0]) }; @@ -222,7 +222,7 @@ public QuestsDisplay() { super(true, true); reloadEntries(); - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(false, 1, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, Screen.h / 2 - 20), RelPos.CENTER) .setDisplayLength(5) @@ -273,7 +273,7 @@ public SeriesInformationDisplay(QuestSeries series) { entries.add(new BlankEntry()); entries.add(new SelectEntry("View all quests of this series", () -> Game.setDisplay(new SeriesQuestViewerDisplay(series)))); - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(true, 0, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, 5), RelPos.BOTTOM) .setEntries(new StringEntry(Localization.getLocalized(series.key))) @@ -352,7 +352,7 @@ public void render(int xp, int yp, int xt, int yt, int bits, MinicraftImage shee public SeriesQuestViewerDisplay(QuestSeries series) { super(false, true); - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(true, 0, RelPos.CENTER, StringEntry.useLines("minicrat.displays.quests", series.key)) .setPositioning(new Point(Screen.w / 2, 6), RelPos.BOTTOM) .createMenu(), @@ -658,7 +658,7 @@ public QuestInformationDisplay(Quest quest) { super(false, true); String state = quest.isCompleted() ? "Completed" : quest.isUnlocked() ? "Unlocked" : "Locked"; int color = quest.isCompleted() ? Color.GREEN : quest.isUnlocked() ? Color.WHITE : Color.GRAY; - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(true, 1, RelPos.CENTER) .setPositioning(new Point(Screen.w / 2, 5), RelPos.BOTTOM) .setEntries(new StringEntry(Localization.getLocalized(quest.getSeries().key)), @@ -743,7 +743,7 @@ public void tick(InputHandler input) { private void updateEntries() { menus[0].setEntries(seriesEntries[selectedEntry]); - String[] entryNames = new String[]{ + String[] entryNames = new String[] { "Unlocked", "Completed" }; diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index 8e14e0320..412f0ecbf 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -180,7 +180,7 @@ public ResourcePackDisplay() { reloadEntries(); - menus = new Menu[]{ + menus = new Menu[] { builder0.setEntries(entries0) .createMenu(), builder1.setEntries(entries1) @@ -241,7 +241,7 @@ public int getColor(boolean isSelected) { */ private void refreshEntries() { reloadEntries(); - Menu[] newMenus = new Menu[]{ + Menu[] newMenus = new Menu[] { builder0.setEntries(entries0) .createMenu(), builder1.setEntries(entries1) @@ -484,7 +484,6 @@ public void refreshPack() { /** * Open the stream of the zip file. - * * @return {@code true} if the stream has successfully been opened. */ private boolean openStream() { @@ -511,7 +510,6 @@ public void close() throws IOException { /** * Getting the stream by the path. - * * @param path The path of the entry. * @return The input stream of the specified entry. * @throws IOException if an I/O error has occurred. @@ -531,8 +529,7 @@ private static interface FilesFilter { // Literally functioned. /** * Getting the subfiles under the specified entry directrory. - * - * @param path The directory to be listed. + * @param path The directory to be listed. * @param filter The filter to be applied. * @return The filtered (if any) subfile and subfolder list. Empty if not or invalid path. */ @@ -554,7 +551,6 @@ private ArrayList getFiles(String path, FilesFilter filter) { /** * Reading the string from the input stream. - * * @param in The input stream to be read. * @return The returned string. */ @@ -565,7 +561,6 @@ public static String readStringFromInputStream(InputStream in) { /** * Loading pack metadata of the pack. - * * @param file The path of the pack. * @return The loaded pack with metadata. */ @@ -625,7 +620,6 @@ public static void initPacks() { /** * Finding the pack by pack's file URL. - * * @param url The url for query. * @return The found resource pack. {@code null} if not found. */ @@ -647,7 +641,6 @@ private static ResourcePack findPackByURL(URL url) { /** * Refreshing the pack list by the urls. - * * @param urls The packs' url to be refreshed. */ private static void refreshResourcePacks(List urls) { @@ -686,7 +679,6 @@ public static void releaseUnloadedPacks() { /** * Loading the resource packs when loading preferences. This should only be called by {@link minicraft.saveload.Load}. - * * @param names The names of the packs. */ public static void loadResourcePacks(String[] names) { @@ -707,7 +699,6 @@ public static void loadResourcePacks(String[] names) { /** * Getting the names of the loaded packs. This should only be called by {@link minicraft.saveload.Save}. - * * @return The names of currently loaded packs. */ public static ArrayList getLoadedPacks() { @@ -765,7 +756,6 @@ public static void reloadResources() { /** * Loading the textures of the pack. - * * @param pack The pack to be loaded. * @throws IOException if I/O exception occurs. */ @@ -790,7 +780,6 @@ private static void loadTextures(ResourcePack pack) throws IOException { /** * Loading the categories of textures from the pack. - * * @param pack The pack to be loaded. * @param type The category of textures. * @throws IOException if I/O exception occurs. @@ -894,7 +883,6 @@ private static void loadTextures(ResourcePack pack, SpriteType type) throws IOEx /** * Loading localization from the pack. - * * @param pack The pack to be loaded. */ private static void loadLocalization(ResourcePack pack) { @@ -938,7 +926,6 @@ private static void loadLocalization(ResourcePack pack) { /** * Loading the books from the pack. - * * @param pack The pack to be loaded. */ private static void loadBooks(ResourcePack pack) { @@ -970,7 +957,6 @@ private static void loadBooks(ResourcePack pack) { /** * Loading sounds from the pack. - * * @param pack The pack to be loaded. */ private static void loadSounds(ResourcePack pack) { diff --git a/src/client/java/minicraft/screen/WorldGenDisplay.java b/src/client/java/minicraft/screen/WorldGenDisplay.java index 5f62a2cab..63ca2735f 100644 --- a/src/client/java/minicraft/screen/WorldGenDisplay.java +++ b/src/client/java/minicraft/screen/WorldGenDisplay.java @@ -200,9 +200,9 @@ public void render(Screen screen, int x, int y, boolean isSelected) { onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); if (onScreenKeyboardMenu == null) - menus = new Menu[]{mainMenu}; + menus = new Menu[] { mainMenu }; else - menus = new Menu[]{onScreenKeyboardMenu, mainMenu}; + menus = new Menu[] { onScreenKeyboardMenu, mainMenu }; } OnScreenKeyboardMenu onScreenKeyboardMenu; diff --git a/src/client/java/minicraft/screen/WorldSelectDisplay.java b/src/client/java/minicraft/screen/WorldSelectDisplay.java index 320ef1320..83286a4f8 100644 --- a/src/client/java/minicraft/screen/WorldSelectDisplay.java +++ b/src/client/java/minicraft/screen/WorldSelectDisplay.java @@ -68,7 +68,7 @@ private void updateEntries() { }, false); } - menus = new Menu[]{ + menus = new Menu[] { new Menu.Builder(false, 0, RelPos.CENTER, entries) .setDisplayLength(5) .setScrollPolicies(1, true) diff --git a/src/client/java/minicraft/screen/entry/BooleanEntry.java b/src/client/java/minicraft/screen/entry/BooleanEntry.java index a58a9bfe7..ecafe488c 100644 --- a/src/client/java/minicraft/screen/entry/BooleanEntry.java +++ b/src/client/java/minicraft/screen/entry/BooleanEntry.java @@ -5,7 +5,7 @@ public class BooleanEntry extends ArrayEntry { public BooleanEntry(String label, boolean initial) { - super(label, true, new Boolean[]{true, false}); + super(label, true, new Boolean[] { true, false }); setSelection(initial ? 0 : 1); } diff --git a/src/client/java/minicraft/screen/entry/ListEntry.java b/src/client/java/minicraft/screen/entry/ListEntry.java index e5913083d..6b00e17a8 100644 --- a/src/client/java/minicraft/screen/entry/ListEntry.java +++ b/src/client/java/minicraft/screen/entry/ListEntry.java @@ -14,7 +14,6 @@ public abstract class ListEntry { /** * Ticks the entry. Used to handle input from the InputHandler - * * @param input InputHandler used to get player input. */ public abstract void tick(InputHandler input); @@ -37,10 +36,9 @@ public void render(Screen screen, int x, int y, boolean isSelected, String conta /** * Renders the entry to the given screen. * Coordinate origin is in the top left corner of the entry space. - * - * @param screen Screen to render the entry to - * @param x X coordinate - * @param y Y coordinate + * @param screen Screen to render the entry to + * @param x X coordinate + * @param y Y coordinate * @param isSelected true if the entry is selected, false otherwise */ public void render(Screen screen, int x, int y, boolean isSelected) { @@ -55,7 +53,6 @@ public void render(Screen screen, int x, int y, boolean isSelected) { /** * Returns the current color depending on if the entry is selected. - * * @param isSelected true if the entry is selected, false otherwise * @return the current entry color */ @@ -65,7 +62,6 @@ public int getColor(boolean isSelected) { /** * Calculates the width of the entry. - * * @return the entry's width */ public int getWidth() { @@ -74,7 +70,6 @@ public int getWidth() { /** * Calculates the height of the entry. - * * @return the entry's height */ public static int getHeight() { @@ -83,7 +78,6 @@ public static int getHeight() { /** * Determines if this entry can be selected. - * * @return true if it is visible and can be selected, false otherwise. */ public final boolean isSelectable() { @@ -92,7 +86,6 @@ public final boolean isSelectable() { /** * Returns whether the entry is visible or not. - * * @return true if the entry is visible, false otherwise */ public final boolean isVisible() { @@ -101,7 +94,6 @@ public final boolean isVisible() { /** * Changes if the entry can be selected or not. - * * @param selectable true if the entry can be selected, false if not */ public final void setSelectable(boolean selectable) { @@ -110,7 +102,6 @@ public final void setSelectable(boolean selectable) { /** * Changes if the entry is visible or not. - * * @param visible true if the entry should be visible, false if not */ public final void setVisible(boolean visible) { diff --git a/src/client/java/minicraft/screen/entry/SelectEntry.java b/src/client/java/minicraft/screen/entry/SelectEntry.java index ede9c2ad2..071efc9fa 100644 --- a/src/client/java/minicraft/screen/entry/SelectEntry.java +++ b/src/client/java/minicraft/screen/entry/SelectEntry.java @@ -16,8 +16,7 @@ public class SelectEntry extends ListEntry { * Creates a new entry which acts as a button. * Can do an action when it is selected. * Localizes the provided string. - * - * @param text Text displayed on this entry + * @param text Text displayed on this entry * @param onSelect Action which happens when the entry is selected */ public SelectEntry(String text, Action onSelect) { @@ -32,7 +31,6 @@ public SelectEntry(String text, Action onSelect, boolean localize) { /** * Changes the text of the entry. - * * @param text new text */ void setText(String text) { diff --git a/src/client/java/minicraft/util/AdvancementElement.java b/src/client/java/minicraft/util/AdvancementElement.java index faa784026..5006577fc 100644 --- a/src/client/java/minicraft/util/AdvancementElement.java +++ b/src/client/java/minicraft/util/AdvancementElement.java @@ -166,9 +166,9 @@ public static void saveRecipeUnlockingElements(JSONObject json) { protected boolean unlocked = false; public AdvancementElement(String key, String description, Map criteria, - @Nullable ElementRewards rewards, @NotNull Set> requirements, - @NotNull Map unlockingCriteria, - @NotNull Set> unlockingRequirements) { + @Nullable ElementRewards rewards, @NotNull Set> requirements, + @NotNull Map unlockingCriteria, + @NotNull Set> unlockingRequirements) { this.key = key; this.description = description; this.criteria.putAll(criteria); @@ -208,8 +208,7 @@ public boolean isCompleted() { /** * Marking the criterion as completed if it has not already been completed. - * - * @param inLoad If this is {@code false}, triggers the status updater. + * @param inLoad If this is {@code false}, triggers the status updater. * @param completionTime The completion time. Using the current datetime if this is {@code null}. */ public void markAsCompleted(boolean inLoad, @Nullable LocalDateTime completionTime) { @@ -625,7 +624,7 @@ public static class LocationConditions { private final @Nullable Rangeable y; private LocationConditions(Set tiles, @Nullable Integer level, @Nullable Integer data, - @Nullable Rangeable x, @Nullable Rangeable y) { + @Nullable Rangeable x, @Nullable Rangeable y) { this.tiles.addAll(tiles); this.level = level; this.data = data; @@ -767,7 +766,7 @@ protected void trigger0(AdvancementTriggerConditionHandler.AdvancementTriggerCon * Modified from {@link #test(List, List)}. */ private static boolean isConditionalMatched(ArrayList items, - HashSet itemConditions) { + HashSet itemConditions) { Set> combinations = new HashSet<>(); List> combinationsOutput = new ArrayList<>(); List conditionsList = new ArrayList<>(); @@ -802,7 +801,7 @@ private static boolean isConditionalMatched(ArrayList items, * Used by {@link #allMatch(Collection, Collection, HashMap)} for conditional check for each element. */ private static boolean isMatched(Item item, InventoryChangedTriggerConditionHandler.InventoryChangedCriterionConditions.ItemConditions itemConditions, - @Nullable String selectedItem) { + @Nullable String selectedItem) { if (!itemConditions.matches(item)) return false; return selectedItem == null || item.getName().equalsIgnoreCase(selectedItem); @@ -812,7 +811,7 @@ private static boolean isMatched(Item item, InventoryChangedTriggerConditionHand * Modified from {@link #containsAll(List, List)}. */ private static boolean allMatch(Collection source, Collection target, - HashMap selectedItems) { + HashMap selectedItems) { for (Item e : source) { target.removeIf(conditions1 -> isMatched(e, conditions1, selectedItems.get(conditions1))); if (target.isEmpty()) { @@ -941,7 +940,7 @@ public static class InventoryChangedCriterionConditions extends AdvancementCrite private final @Nullable Rangeable slotsOccupied; private InventoryChangedCriterionConditions(Set items, @Nullable Rangeable slotsEmpty, - @Nullable Rangeable slotsFull, @Nullable Rangeable slotsOccupied) { + @Nullable Rangeable slotsFull, @Nullable Rangeable slotsOccupied) { this.items.addAll(items); this.slotsEmpty = slotsEmpty; this.slotsFull = slotsFull; @@ -1026,7 +1025,7 @@ public static class PlacedTileCriterionConditions extends AdvancementCriterionCo private final @Nullable Integer data; private PlacedTileCriterionConditions(@Nullable String tile, @Nullable ItemConditions item, - @Nullable LocationConditions location, @Nullable Integer data) { + @Nullable LocationConditions location, @Nullable Integer data) { this.tile = tile; this.item = item; this.location = location; diff --git a/src/client/java/minicraft/util/Quest.java b/src/client/java/minicraft/util/Quest.java index fb81d669e..aadf4fd73 100644 --- a/src/client/java/minicraft/util/Quest.java +++ b/src/client/java/minicraft/util/Quest.java @@ -14,8 +14,8 @@ public class Quest extends AdvancementElement { private final @Nullable String parent; public Quest(String key, String description, Map criteria, @Nullable AdvancementElement.ElementRewards rewards, - @NotNull Set> requirements, @Nullable String parent, - @NotNull HashMap unlockingCriteria, @NotNull Set> unlockingRequirements) { + @NotNull Set> requirements, @Nullable String parent, + @NotNull HashMap unlockingCriteria, @NotNull Set> unlockingRequirements) { super(key, description, criteria, rewards, requirements, unlockingCriteria, unlockingRequirements); this.parent = parent; } @@ -56,9 +56,9 @@ public static class QuestSeries extends AdvancementElement { private final HashMap quests = new HashMap<>(); public QuestSeries(String key, String description, Map criteria, - @Nullable AdvancementElement.ElementRewards rewards, @NotNull Set> requirements, - @NotNull Map quests, @NotNull HashMap unlockingCriteria, - @NotNull Set> unlockingRequirements) { + @Nullable AdvancementElement.ElementRewards rewards, @NotNull Set> requirements, + @NotNull Map quests, @NotNull HashMap unlockingCriteria, + @NotNull Set> unlockingRequirements) { super(key, description, criteria, rewards, requirements, unlockingCriteria, unlockingRequirements); this.quests.putAll(quests); quests.values().forEach(q -> q.series = this); diff --git a/src/client/java/minicraft/util/TinylogLoggingConfiguration.java b/src/client/java/minicraft/util/TinylogLoggingConfiguration.java index 174bff62f..506f55057 100644 --- a/src/client/java/minicraft/util/TinylogLoggingConfiguration.java +++ b/src/client/java/minicraft/util/TinylogLoggingConfiguration.java @@ -127,9 +127,9 @@ public Set computeLevelsFromMinimum(Level minimum) { */ public HashMap generateConsoleWriters() { HashMap map = new HashMap<>(); - for (final boolean i : new boolean[]{false, true}) { - for (final boolean j : new boolean[]{false, true}) { - for (final boolean k : new boolean[]{false, true}) { + for (final boolean i : new boolean[] { false, true }) { + for (final boolean j : new boolean[] { false, true }) { + for (final boolean k : new boolean[] { false, true }) { map.putAll(createConsoleWriter(i, j, k)); } } @@ -158,22 +158,21 @@ public Map createConsoleWriter(boolean logTime, boo /** * Creates a new log entry. - * * @param stackTraceElement Optional stack trace element of caller - * @param tag Tag name if issued from a tagged logger - * @param level Severity level - * @param exception Caught exception or throwable to log - * @param formatter Formatter for text message - * @param obj Message to log - * @param arguments Arguments for message - * @param required The required log entry value array slice of the tag index of the used tag - * @param contextProvider The context provider + * @param tag Tag name if issued from a tagged logger + * @param level Severity level + * @param exception Caught exception or throwable to log + * @param formatter Formatter for text message + * @param obj Message to log + * @param arguments Arguments for message + * @param required The required log entry value array slice of the tag index of the used tag + * @param contextProvider The context provider * @return Filled log entry */ public static LogEntry createLogEntry(final StackTraceElement stackTraceElement, final String tag, - final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, - final Object[] arguments, final Collection required, - final TinylogContextProvider contextProvider) { + final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, + final Object[] arguments, final Collection required, + final TinylogContextProvider contextProvider) { Timestamp timestamp = RuntimeProvider.createTimestamp(); Thread thread = required.contains(LogEntryValue.THREAD) ? Thread.currentThread() : null; diff --git a/src/client/java/minicraft/util/TinylogLoggingProvider.java b/src/client/java/minicraft/util/TinylogLoggingProvider.java index f076f8aab..b7bafbb6c 100644 --- a/src/client/java/minicraft/util/TinylogLoggingProvider.java +++ b/src/client/java/minicraft/util/TinylogLoggingProvider.java @@ -77,7 +77,7 @@ public TinylogLoggingProvider() { ctr.setAccessible(true); writingThread = ctr.newInstance(writers.keySet()); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException - | NoSuchMethodException | SecurityException | ClassNotFoundException e) { + | NoSuchMethodException | SecurityException | ClassNotFoundException e) { throw new RuntimeException(e); } @@ -124,7 +124,7 @@ public boolean isEnabled(final int depth, final String tag, final Level level) { @Override public void log(final int depth, final String tag, final Level level, final Throwable exception, final MessageFormatter formatter, - final Object obj, final Object... arguments) { + final Object obj, final Object... arguments) { StackTraceElement stackTraceElement; if (fullStackTraceRequired.get(currentConsoleWriter) || tag.equals("LOC")) { stackTraceElement = RuntimeProvider.getCallerStackTraceElement(depth + 1); @@ -141,7 +141,7 @@ public void log(final int depth, final String tag, final Level level, final Thro @Override public void log(final String loggerClassName, final String tag, final Level level, final Throwable exception, - final MessageFormatter formatter, final Object obj, final Object... arguments) { + final MessageFormatter formatter, final Object obj, final Object... arguments) { StackTraceElement stackTraceElement; if (fullStackTraceRequired.get(currentConsoleWriter) || tag.equals("LOC")) { stackTraceElement = RuntimeProvider.getCallerStackTraceElement(loggerClassName); @@ -176,8 +176,8 @@ public void shutdown() throws InterruptedException { * Outputs a log entry to all passed writers. */ private void output(final StackTraceElement stackTraceElement, final String tag, - final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, - final Object[] arguments) { + final Level level, final Throwable exception, final MessageFormatter formatter, final Object obj, + final Object[] arguments) { LogEntry logEntry = TinylogLoggingConfiguration.createLogEntry(stackTraceElement, tag, level, exception, formatter, obj, arguments, requiredLogEntryValues, context); @@ -196,7 +196,6 @@ private void output(final StackTraceElement stackTraceElement, final String tag, /** * Gets all writers of the provider. - * * @return All writers */ public Collection getWriters() { From bde1c255278522f16e9db995341d0352649a4286 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 7 Jan 2024 03:05:34 +0800 Subject: [PATCH 144/261] Add some to .editorconfig and add indents to JavaDoc --- .editorconfig | 21 +++++++++++++++++++ .../java/minicraft/core/Initializer.java | 2 +- src/client/java/minicraft/entity/Entity.java | 4 ++-- .../java/minicraft/entity/mob/MobAi.java | 4 ++-- .../java/minicraft/entity/mob/PassiveMob.java | 2 +- src/client/java/minicraft/item/Inventory.java | 2 +- src/client/java/minicraft/level/Level.java | 2 +- .../java/minicraft/screen/PopupDisplay.java | 2 +- 8 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.editorconfig b/.editorconfig index 642cf1e89..efb66b976 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,14 +8,35 @@ charset = utf-8 [**.java] indent_style = tab indent_size = tab +ij_smart_tabs = true tab_width = 4 ij_java_imports_layout = *, |, javax.**, |, java.**, |, $* ij_java_packages_to_use_import_on_demand = unset ij_java_class_count_to_use_import_on_demand = 99999999 ij_java_names_count_to_use_import_on_demand = 99999999 ij_java_use_single_class_imports = true +ij_java_use_fq_class_names = true ij_java_insert_inner_class_imports = false ij_java_layout_static_imports_separately = true +ij_java_space_before_array_initializer_left_brace = true +ij_java_block_comment_add_space = true +ij_java_line_comment_add_space = true +ij_java_space_after_closing_angle_bracket_in_type_argument = true +ij_java_space_before_annotation_array_initializer_left_brace = true +ij_java_spaces_within_array_initializer_braces = true +ij_java_spaces_within_braces = true +ij_java_doc_add_blank_line_after_description = false +ij_java_doc_keep_empty_lines = true +ij_java_doc_indent_on_continuation = true +ij_java_doc_do_not_wrap_if_one_line = true +ij_java_keep_simple_blocks_in_one_line = true +ij_java_keep_simple_classes_in_one_line = true +ij_java_keep_simple_lambdas_in_one_line = true +ij_java_keep_simple_methods_in_one_line = true +ij_java_method_annotation_wrap = normal +ij_java_field_annotation_wrap = normal +ij_java_do_not_wrap_after_single_annotation = true +ij_java_do_not_wrap_after_single_annotation_in_parameter = true [**.json] indent_style = space diff --git a/src/client/java/minicraft/core/Initializer.java b/src/client/java/minicraft/core/Initializer.java index 55c955fb0..db5c8a7cd 100644 --- a/src/client/java/minicraft/core/Initializer.java +++ b/src/client/java/minicraft/core/Initializer.java @@ -200,7 +200,7 @@ static void launchWindow() { * Provides a String representation of the provided Throwable's stack trace * that is extracted via PrintStream. * @param throwable Throwable/Exception from which stack trace is to be - * extracted. + * extracted. * @return String with provided Throwable's stack trace. */ public static String getExceptionTrace(final Throwable throwable) { diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index ea0d197d8..60be198c0 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -243,9 +243,9 @@ protected boolean moveY(int d) { * @param hitBoxLeft The left boundary of hit box * @param hitBoxRight The right boundary of hit box * @param bumpingHandler The consumer handling bumping into a new tile; - * the first parameter takes the front tile position and second one takes the horizontal position + * the first parameter takes the front tile position and second one takes the horizontal position * @param steppingHandler The consumer handling stepping on a new tile; - * the first parameter takes the front tile position and second one takes the horizontal position + * the first parameter takes the front tile position and second one takes the horizontal position * @return {@code true} if the movement is successful, {@code false} otherwise. * @see Level#calculateMaxFrontClosestTile(int, int, int, int, int, BiPredicate) */ diff --git a/src/client/java/minicraft/entity/mob/MobAi.java b/src/client/java/minicraft/entity/mob/MobAi.java index ec2f149be..00c2df1eb 100644 --- a/src/client/java/minicraft/entity/mob/MobAi.java +++ b/src/client/java/minicraft/entity/mob/MobAi.java @@ -175,7 +175,7 @@ public boolean canWool() { /** * Sets the mob to walk in a random direction for a given amount of time. * @param byChance true if the mob should always get a new direction to walk, false if - * there should be a chance that the mob moves. + * there should be a chance that the mob moves. */ public void randomizeWalkDir(boolean byChance) { // Boolean specifies if this method, from where it's called, is called every tick, or after a random chance. if (!byChance && random.nextInt(randomWalkChance) != 0) return; @@ -206,7 +206,7 @@ protected void dropItem(int mincount, int maxcount, Item... items) { * @param y Y map coordinate of spawn. * @param playerDist Max distance from the player the mob can be spawned in. * @param soloRadius How far out can there not already be any entities. - * This is multiplied by the monster density of the level + * This is multiplied by the monster density of the level * @return true if the mob can spawn, false if not. */ protected static boolean checkStartPos(Level level, int x, int y, int playerDist, int soloRadius) { diff --git a/src/client/java/minicraft/entity/mob/PassiveMob.java b/src/client/java/minicraft/entity/mob/PassiveMob.java index 294d14fbf..e6ec7f6cb 100644 --- a/src/client/java/minicraft/entity/mob/PassiveMob.java +++ b/src/client/java/minicraft/entity/mob/PassiveMob.java @@ -25,7 +25,7 @@ public PassiveMob(LinkedSprite[][] sprites) { * Constructor for a non-hostile (passive) mob. * @param sprites The mob's sprites. * @param healthFactor Determines the mobs health. Will be multiplied by the difficulty - * and then added with 5. + * and then added with 5. */ public PassiveMob(LinkedSprite[][] sprites, int healthFactor) { super(sprites, 5 + healthFactor * Settings.getIdx("diff"), 5 * 60 * Updater.normSpeed, 45, 40); diff --git a/src/client/java/minicraft/item/Inventory.java b/src/client/java/minicraft/item/Inventory.java index 6df5f74ec..4ad9f2914 100644 --- a/src/client/java/minicraft/item/Inventory.java +++ b/src/client/java/minicraft/item/Inventory.java @@ -267,7 +267,7 @@ public void updateInv(String items) { * @param item Item to be added. * @param num How many of the item. * @param allOrNothing if true, either all items will be added or none, if false its possible to add - * between 0-num items. + * between 0-num items. */ public void tryAdd(int chance, Item item, int num, boolean allOrNothing) { if (!allOrNothing || random.nextInt(chance) == 0) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 05166c9f9..e797c38bd 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -840,7 +840,7 @@ public Player getClosestPlayer(int x, int y) { * @param hitBoxRight The right boundary of hit box * @param hitBoxFront The front boundary of hit box * @param frontTilePassableCheck The check of whether the front boundary of hit box hits the tile hit box; - * the first parameter takes the front tile position and second one takes the horizontal position + * the first parameter takes the front tile position and second one takes the horizontal position * @return The maximum front position can be reached by tile hit box check */ public static int calculateMaxFrontClosestTile(int sgn, int d, int hitBoxLeft, int hitBoxRight, int hitBoxFront, diff --git a/src/client/java/minicraft/screen/PopupDisplay.java b/src/client/java/minicraft/screen/PopupDisplay.java index 8258fc5a2..c156ca94f 100644 --- a/src/client/java/minicraft/screen/PopupDisplay.java +++ b/src/client/java/minicraft/screen/PopupDisplay.java @@ -147,7 +147,7 @@ public static interface ActionCallback { * The callback acts when the key clicked. * @param key The key of the callback trigger. * @param callback The callback, when the return value is {@code true}, no more input check - * will be done. It continues if {@code false}. + * will be done. It continues if {@code false}. */ public PopupActionCallback(String key, ActionCallback callback) { this.key = key; From 81f0a8517b9cb233ee20a7eb127d5a7fc79dae68 Mon Sep 17 00:00:00 2001 From: GreenEye Date: Sun, 7 Jan 2024 03:17:08 -0300 Subject: [PATCH 145/261] Fixed Tnt interaction Previously, when a player tried to pick up the placed Tnt to put it in their inventory, they could not do so and it would activate accidentally, this because we did not handle that case within the appropriate method The player can now collect TNT again as long as it has not been previously activated --- .../java/minicraft/entity/furniture/Tnt.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/entity/furniture/Tnt.java b/src/client/java/minicraft/entity/furniture/Tnt.java index 4bea171ca..a5df0b389 100644 --- a/src/client/java/minicraft/entity/furniture/Tnt.java +++ b/src/client/java/minicraft/entity/furniture/Tnt.java @@ -125,10 +125,16 @@ public void actionPerformed(ActionEvent e) { @Override public boolean interact(Player player, Item heldItem, Direction attackDir) { - if (!fuseLit) { - fuseLit = true; - Sound.play("fuse"); - return true; + if (player.activeItem instanceof PowerGloveItem) { + if (!fuseLit) { + return super.interact(player, item, attackDir); + } + } else { + if (!fuseLit) { + fuseLit = true; + Sound.play("fuse"); + return true; + } } return false; From 023fe94278d6d7391e45ab6d7e0c4dd03bced848 Mon Sep 17 00:00:00 2001 From: GreenEye Date: Sun, 7 Jan 2024 03:28:02 -0300 Subject: [PATCH 146/261] Small correction ... --- src/client/java/minicraft/entity/furniture/Tnt.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/java/minicraft/entity/furniture/Tnt.java b/src/client/java/minicraft/entity/furniture/Tnt.java index a5df0b389..d273a19ff 100644 --- a/src/client/java/minicraft/entity/furniture/Tnt.java +++ b/src/client/java/minicraft/entity/furniture/Tnt.java @@ -125,9 +125,9 @@ public void actionPerformed(ActionEvent e) { @Override public boolean interact(Player player, Item heldItem, Direction attackDir) { - if (player.activeItem instanceof PowerGloveItem) { + if (heldItem instanceof PowerGloveItem) { if (!fuseLit) { - return super.interact(player, item, attackDir); + return super.interact(player, heldItem, attackDir); } } else { if (!fuseLit) { From f7bde51423de1cf5bd1c740601246ec18d51fa97 Mon Sep 17 00:00:00 2001 From: GreenEye Date: Sun, 7 Jan 2024 03:31:19 -0300 Subject: [PATCH 147/261] Corrected import --- src/client/java/minicraft/entity/furniture/Tnt.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/java/minicraft/entity/furniture/Tnt.java b/src/client/java/minicraft/entity/furniture/Tnt.java index d273a19ff..7aad75093 100644 --- a/src/client/java/minicraft/entity/furniture/Tnt.java +++ b/src/client/java/minicraft/entity/furniture/Tnt.java @@ -11,6 +11,7 @@ import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.item.Item; +import minicraft.item.PowerGloveItem; import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; From 03ec826625525de77da06ec045df9be1f948e83a Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:03:11 -0500 Subject: [PATCH 148/261] Nightly Builds Revamp --- .github/workflows/autobuild.yml | 66 +++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index a9a7b69ab..081717ef9 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,7 +1,8 @@ name: Nightly build on: - schedule: - - cron: '0 0 * * *' + pull_request: + types: + - closed workflow_dispatch: jobs: @@ -9,34 +10,77 @@ jobs: strategy: matrix: os: [ubuntu-latest] + if: github.event.pull_request.merged == true runs-on: ${{ matrix.os }} + permissions: + contents: write steps: - uses: actions/checkout@v3 + with: + token: ${{ secrets.LITOROMTOKEN }} + - name: Update ingame version + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "${{ vars.VERSION }}-dev${{ vars.VERSION_old }}" + replace: "${{ vars.VERSION }}-dev${{ vars.VERSION_s }}" + include: "src/client/java/minicraft/core/Game.java" + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Increment Version" + token: ${{ secrets.LITOROMTOKEN }} + repository: ${{ secrets.GITHUB_REPOSITORY }} + branch: ${{ github.ref }} + - name: Update gradle version + uses: jacobtomlinson/gha-find-replace@v3 + with: + find: "version = \"${{ vars.VERSION }}-dev${{ vars.VERSION_old }}\"" + replace: "version = \"${{ vars.VERSION }}-dev${{ vars.VERSION_s }}\"" + include: "build.gradle" + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Increment Version" + token: ${{ secrets.LITOROMTOKEN }} + repository: ${{ secrets.GITHUB_REPOSITORY }} + branch: ${{ github.ref }} + - uses: actions/setup-java@v3 with: distribution: temurin java-version: 8 - - name: Increment Version - env: - VERSION_s: 4+GITHUB_RUN_NUMBER - VERSION_f: "2.2.0-dev$VERSION_s" + - name: Increment old version number + uses: action-pack/increment@v2 + with: + name: 'VERSION_old' + token: ${{ secrets.LITOROMTOKEN }} + repository: ${{ secrets.GITHUB_REPOSITORY }} + owner: 'MinicraftPlus' + + - name: Increment new version number + uses: action-pack/increment@v2 + with: + name: 'VERSION_s' + token: ${{ secrets.LITOROMTOKEN }} + repository: ${{ secrets.GITHUB_REPOSITORY }} + owner: 'MinicraftPlus' - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - + - name: Execute Gradle build run: ./gradlew build - + - uses: "dciborow/action-github-releases@v1.0.1" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "$VERSION_f" + automatic_release_tag: "v${{ vars.VERSION }}-dev${{ vars.VERSION_s }}" prerelease: true - title: "Version 2.2.0, Pre-release $VERSION_s (Nightly)" + title: "Version ${{ vars.VERSION }}, Pre-release ${{ vars.VERSION_s }} (Nightly)" generate_release_notes: true files: | LICENSE ChangeLog.md build/libs/**.jar - + From fba265a2265f2910f087c506720e61eb3cc41a0c Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:16:53 -0500 Subject: [PATCH 149/261] Fix GitHub security risk --- .github/workflows/autobuild.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 081717ef9..635815304 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,8 +1,7 @@ name: Nightly build on: - pull_request: - types: - - closed + schedule: + - cron: '0 0 * * *' workflow_dispatch: jobs: @@ -10,7 +9,6 @@ jobs: strategy: matrix: os: [ubuntu-latest] - if: github.event.pull_request.merged == true runs-on: ${{ matrix.os }} permissions: contents: write From 9ab46c586824bd527e5b0a4aac2611dc880b64fc Mon Sep 17 00:00:00 2001 From: Litorom Date: Mon, 8 Jan 2024 19:17:52 +0000 Subject: [PATCH 150/261] Increment Version --- src/client/java/minicraft/core/Game.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 226af77d5..8a6b3078d 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev4"); + public static final Version VERSION = new Version("2.2.0-dev5"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From 645587fc452547d8c5718b0785891d05e791c46f Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Mon, 8 Jan 2024 14:36:01 -0500 Subject: [PATCH 151/261] Combine Push Event --- .github/workflows/autobuild.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 635815304..f7662bdb5 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -22,13 +22,6 @@ jobs: find: "${{ vars.VERSION }}-dev${{ vars.VERSION_old }}" replace: "${{ vars.VERSION }}-dev${{ vars.VERSION_s }}" include: "src/client/java/minicraft/core/Game.java" - - name: Push changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "Increment Version" - token: ${{ secrets.LITOROMTOKEN }} - repository: ${{ secrets.GITHUB_REPOSITORY }} - branch: ${{ github.ref }} - name: Update gradle version uses: jacobtomlinson/gha-find-replace@v3 with: From f1c3226aa897d418bc6a2af1f2c246d42000bfba Mon Sep 17 00:00:00 2001 From: Litorom Date: Mon, 8 Jan 2024 19:36:38 +0000 Subject: [PATCH 152/261] Increment Version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f8e2d2271..8c9761c5b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev4" + version = "2.2.0-dev5" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' From ab72e37ad3340e6896cbfe53444c9267d14f4c12 Mon Sep 17 00:00:00 2001 From: Litorom Date: Tue, 9 Jan 2024 01:05:07 +0000 Subject: [PATCH 153/261] Increment Version --- build.gradle | 2 +- src/client/java/minicraft/core/Game.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8c9761c5b..8033cff4b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev5" + version = "2.2.0-dev6" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 8a6b3078d..449b5ad96 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev5"); + public static final Version VERSION = new Version("2.2.0-dev6"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From 285133bc585c7c3f9586b71e2dfe32a490b828a0 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 9 Jan 2024 23:16:17 +0800 Subject: [PATCH 154/261] Update README.md Localization section Rename link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c21b22bf8..bc73b7e0e 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ computer. ## Localization -This project is running with an external localization platform called Lokalise. You can contribute localization [here](https://app.lokalise.com/public/42925017655336d50b3007.03067253/)! +This project is running with an external localization platform called Lokalise. You can now [head over Lokalise to contribute localization](https://app.lokalise.com/public/42925017655336d50b3007.03067253/)! ## How to build/run in development From 800c9aae074b39ad1501a10b1ebb8d83e83eaf5e Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 10 Jan 2024 00:35:58 +0800 Subject: [PATCH 155/261] Update autobuild.yml --- .github/workflows/autobuild.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index f7662bdb5..9a4484b76 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,11 +1,34 @@ name: Nightly build on: + pull_request: + types: [closed] + branches: ["main"] schedule: - cron: '0 0 * * *' workflow_dispatch: jobs: + conditions: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checking conditions + run: | + needed=true + + out=$( gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/${{ github.repository }}/actions/workflows/${{ github.workflow }}/runs \ + -F "created=>$( date -d '-1 day' '+%Y-%m-%d' )T00:00:00+00:00" ) + $out | jq -c ".workflow_runs.[] | .status" | while read object; do + if [ "$object" = "completed" ] || [ "$object" = "success" ] || [ "$object" = "in_progress" ] || + [ "$object" = "queued" ] || [ "$object" = "requested" ] || [ "$object" = "waiting" ] || [ "$object" = "pending" ]; then + needed=false; fi + done + if needed; then gradle: + needs: conditions strategy: matrix: os: [ubuntu-latest] From bdc0ef0d7e9b424dc0c3f21514b4c3ecce21a141 Mon Sep 17 00:00:00 2001 From: Litorom Date: Wed, 10 Jan 2024 01:04:55 +0000 Subject: [PATCH 156/261] Increment Version --- build.gradle | 2 +- src/client/java/minicraft/core/Game.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8033cff4b..d158221e8 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev6" + version = "2.2.0-dev7" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 449b5ad96..a5d609c3b 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev6"); + public static final Version VERSION = new Version("2.2.0-dev7"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From c0b3d31dfc6e6f87773486b791c114c83dcbb361 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:03:58 +0800 Subject: [PATCH 157/261] Update autobuild.yml for rate limit --- .github/workflows/autobuild.yml | 52 +++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 9a4484b76..191f2b246 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -4,29 +4,57 @@ on: types: [closed] branches: ["main"] schedule: - - cron: '0 0 * * *' + - cron: '0 0,4,8,12,16,20 * * *' workflow_dispatch: - + jobs: conditions: - if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: Checking conditions run: | needed=true - - out=$( gh api \ + out=$( gh api -XGET \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${{ github.repository }}/actions/workflows/${{ github.workflow }}/runs \ - -F "created=>$( date -d '-1 day' '+%Y-%m-%d' )T00:00:00+00:00" ) - $out | jq -c ".workflow_runs.[] | .status" | while read object; do - if [ "$object" = "completed" ] || [ "$object" = "success" ] || [ "$object" = "in_progress" ] || - [ "$object" = "queued" ] || [ "$object" = "requested" ] || [ "$object" = "waiting" ] || [ "$object" = "pending" ]; then - needed=false; fi - done + repos/${{ github.repository }}/pulls \ + -F state=closed \ + -F base=main \ + -F sort=updated ) + latest= + while read obj; do + if [[ $obj != null ]]; then + latest=$obj + break + fi + done < <( echo $out | jq -c -r ".[] | .merged_at" | tr -d "\r" ) + [[ -z $latest ]] && echo "CONT=false" >> $GITHUB_ENV && exit 0 + out=$( gh api -XGET \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/actions/workflows/autobuild.yml/runs \ + -F created=">=$latest" ) + f="[\"completed\",\"success\",\"in_progress\",\"queued\",\"requested\",\"waiting\",\"pending\"]" + while read obj; do + if $obj; then + needed=false; + break; + fi + done < <( echo $out | jq -c --arg f "$f" ".workflow_runs.[] | .status | IN($f[])" | tr -d "\r" ) if needed; then + echo "CONT=true" >> $GITHUB_ENV + else + echo "CONT=false" >> $GITHUB_ENV + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Abort + if: ${{ ! env.CONT }} + run: | + gh run cancel ${{ github.run_id }} + gh run watch ${{ github.run_id }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} gradle: needs: conditions strategy: From 9cee1b92612e737a635dcf8db1461434bb853548 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:57:17 +0800 Subject: [PATCH 158/261] Update autobuild.yml change rate limit conditions over commit --- .github/workflows/autobuild.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 191f2b246..d8fffc9d0 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -14,21 +14,11 @@ jobs: - name: Checking conditions run: | needed=true - out=$( gh api -XGET \ + out=$( gh api \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - repos/${{ github.repository }}/pulls \ - -F state=closed \ - -F base=main \ - -F sort=updated ) - latest= - while read obj; do - if [[ $obj != null ]]; then - latest=$obj - break - fi - done < <( echo $out | jq -c -r ".[] | .merged_at" | tr -d "\r" ) - [[ -z $latest ]] && echo "CONT=false" >> $GITHUB_ENV && exit 0 + repos/${{ github.repository }}/commits ) + latest=$( echo $out | jq -r "[.[] | select(.committer.login != \"github-actions[bot]\")] | .[0].commit.committer.date" ) out=$( gh api -XGET \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ From ef34105da9d7587e455e7c43afb70e37b2036ef1 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:04:10 -0500 Subject: [PATCH 159/261] Update autobuild.yml --- .github/workflows/autobuild.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index d8fffc9d0..adce3addb 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,8 +1,5 @@ name: Nightly build on: - pull_request: - types: [closed] - branches: ["main"] schedule: - cron: '0 0,4,8,12,16,20 * * *' workflow_dispatch: From ea1406a2ab0c90fb0930835b88fff08f223a78eb Mon Sep 17 00:00:00 2001 From: Litorom Date: Thu, 11 Jan 2024 00:05:03 +0000 Subject: [PATCH 160/261] Increment Version --- build.gradle | 2 +- src/client/java/minicraft/core/Game.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index d158221e8..60657d21c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev7" + version = "2.2.0-dev8" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index a5d609c3b..b99e31fcc 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev7"); + public static final Version VERSION = new Version("2.2.0-dev8"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From ece085fd46ecd4a92a55cc652bf150970dd3c7e5 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:34:57 -0500 Subject: [PATCH 161/261] Backtracking (1/2) --- src/client/java/minicraft/core/Game.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index b99e31fcc..8a6b3078d 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev8"); + public static final Version VERSION = new Version("2.2.0-dev5"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From fbec73e36faf29c5b23b4a2127fa10a404db0c10 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:35:25 -0500 Subject: [PATCH 162/261] Backtracking (2/2) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 60657d21c..8c9761c5b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev8" + version = "2.2.0-dev5" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' From 7a4c8aecb2479146918671908ab170c25bd9999a Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:39:33 -0500 Subject: [PATCH 163/261] Update autobuild.yml --- .github/workflows/autobuild.yml | 42 +-------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index adce3addb..15b45e993 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,49 +1,9 @@ -name: Nightly build +name: AutoRelease & Build on: - schedule: - - cron: '0 0,4,8,12,16,20 * * *' workflow_dispatch: jobs: - conditions: - runs-on: ubuntu-latest - steps: - - name: Checking conditions - run: | - needed=true - out=$( gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - repos/${{ github.repository }}/commits ) - latest=$( echo $out | jq -r "[.[] | select(.committer.login != \"github-actions[bot]\")] | .[0].commit.committer.date" ) - out=$( gh api -XGET \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - repos/${{ github.repository }}/actions/workflows/autobuild.yml/runs \ - -F created=">=$latest" ) - f="[\"completed\",\"success\",\"in_progress\",\"queued\",\"requested\",\"waiting\",\"pending\"]" - while read obj; do - if $obj; then - needed=false; - break; - fi - done < <( echo $out | jq -c --arg f "$f" ".workflow_runs.[] | .status | IN($f[])" | tr -d "\r" ) - if needed; then - echo "CONT=true" >> $GITHUB_ENV - else - echo "CONT=false" >> $GITHUB_ENV - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Abort - if: ${{ ! env.CONT }} - run: | - gh run cancel ${{ github.run_id }} - gh run watch ${{ github.run_id }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} gradle: - needs: conditions strategy: matrix: os: [ubuntu-latest] From b4326610ddfe118702fbb5d9a68dc30fa4f47d24 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:14:05 +0800 Subject: [PATCH 164/261] Temporarily resolve bugs 2 bugs from #551 --- src/client/java/minicraft/entity/mob/AirWizard.java | 2 +- src/client/java/minicraft/level/tile/WaterTile.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/AirWizard.java b/src/client/java/minicraft/entity/mob/AirWizard.java index 976f295a5..be3f0ce67 100644 --- a/src/client/java/minicraft/entity/mob/AirWizard.java +++ b/src/client/java/minicraft/entity/mob/AirWizard.java @@ -22,7 +22,7 @@ public class AirWizard extends EnemyMob { }; public static boolean beaten = false; - public static boolean active = true; + public static boolean active = false; public static AirWizard entity = null; private int attackDelay = 0; diff --git a/src/client/java/minicraft/level/tile/WaterTile.java b/src/client/java/minicraft/level/tile/WaterTile.java index 09577816b..cb90de531 100644 --- a/src/client/java/minicraft/level/tile/WaterTile.java +++ b/src/client/java/minicraft/level/tile/WaterTile.java @@ -27,25 +27,31 @@ public boolean mayPass(Level level, int x, int y, Entity e) { return e.canSwim(); } + private Tile hole = null; + private Tile lava = null; + @Override public boolean tick(Level level, int xt, int yt) { + if (hole == null) hole = Tiles.get("Hole"); + if (lava == null) lava = Tiles.get("Lava"); + int xn = xt; int yn = yt; if (random.nextBoolean()) xn += random.nextInt(2) * 2 - 1; else yn += random.nextInt(2) * 2 - 1; - if (level.getTile(xn, yn) == Tiles.get("Hole")) { + if (level.getTile(xn, yn) == hole) { level.setTile(xn, yn, this); } // These set only the non-diagonally adjacent lava tiles to obsidian for (int x = -1; x < 2; x++) { - if (level.getTile(xt + x, yt) == Tiles.get("Lava")) + if (level.getTile(xt + x, yt) == lava) level.setTile(xt + x, yt, Tiles.get("Raw Obsidian")); } for (int y = -1; y < 2; y++) { - if (level.getTile(xt, yt + y) == Tiles.get("lava")) + if (level.getTile(xt, yt + y) == lava) level.setTile(xt, yt + y, Tiles.get("Raw Obsidian")); } return false; From 45fa5e27c3b7bf6b70069ff943f8a90a4210f546 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:00:28 -0500 Subject: [PATCH 165/261] Updated guide, current maintainer in credits, and corrected things (#617) --- Credits.md | 3 ++- src/client/java/minicraft/screen/ResourcePackDisplay.java | 2 +- src/client/resources/assets/books/credits.txt | 2 +- .../assets/books/{story_guide.txt => game_guide.txt} | 8 ++++---- src/client/resources/assets/books/instructions.txt | 7 +++++-- 5 files changed, 13 insertions(+), 9 deletions(-) rename src/client/resources/assets/books/{story_guide.txt => game_guide.txt} (72%) diff --git a/Credits.md b/Credits.md index 87c04ecf3..d4e3b7333 100644 --- a/Credits.md +++ b/Credits.md @@ -8,10 +8,11 @@ Original game by Markus "Notch" Persson. * Dillyg10 * Chris J * afyber +* Makkkkus ### Current maintainer -* Makkkkus +* Litorom1 ### Code contributions from diff --git a/src/client/java/minicraft/screen/ResourcePackDisplay.java b/src/client/java/minicraft/screen/ResourcePackDisplay.java index 8e14e0320..d978939fe 100644 --- a/src/client/java/minicraft/screen/ResourcePackDisplay.java +++ b/src/client/java/minicraft/screen/ResourcePackDisplay.java @@ -958,7 +958,7 @@ private static void loadBooks(ResourcePack pack) { case "assets/books/antidous.txt": BookData.antVenomBook = () -> book; break; - case "assets/books/story_guide.txt": + case "assets/books/game_guide.txt": BookData.storylineGuide = () -> book; break; } diff --git a/src/client/resources/assets/books/credits.txt b/src/client/resources/assets/books/credits.txt index 0ee238123..ba10cae95 100644 --- a/src/client/resources/assets/books/credits.txt +++ b/src/client/resources/assets/books/credits.txt @@ -1,7 +1,7 @@ Original game by Markus Persson. Project Maintainers: -David.b, Dillyg10, Chris J, afyber, and Makkkkus. +David.b, Dillyg10, Chris J, afyber, Makkkkus, and Litorom1. Special contributors: A.L.I.C.E, Christoffer Holmesland, El-Virus, Litorom1, TheBigEye, PelletsstarPL and Ben Forge. diff --git a/src/client/resources/assets/books/story_guide.txt b/src/client/resources/assets/books/game_guide.txt similarity index 72% rename from src/client/resources/assets/books/story_guide.txt rename to src/client/resources/assets/books/game_guide.txt index 05327e7b4..4378bac31 100644 --- a/src/client/resources/assets/books/story_guide.txt +++ b/src/client/resources/assets/books/game_guide.txt @@ -8,16 +8,16 @@ If you manage to accomplish that, and craft a gem pickaxe, then you can break th When the air wizard is defeated, a message appears on screen, saying the dungeon is opened. That refers to a certain staircase on the third underground level going down, surrounded by purple obsidian bricks and walls. Only after defeating the air wizard can you destroy the obsidian and go down the stairs. The dungeon level you'll find is entirely composed of various obsidian tiles, with occasional small pockets of lava scattered about. There are no ores. -The enemies there are mostly of two types: snakes, and knights. Snakes drop scales, which can be used to craft green snake armor, and knights drop shards, which are needed to craft claymores, upgraded powerful swords. Additionally, there are a variety of rooms through the dungeon: spawn rooms, dungeon gardens, fancy lava pools, and rooms filled with grayed-out chests. These chests are dungeon chests and require keys to open and said keys drop from the enemies of the floor. Within these chests are fancy powerful items to help fight the next boss. +The enemies there are mostly of two types: snakes, and knights. Snakes drop scales, which can be used to craft green snake armor, and knights drop shards, which are needed to craft claymores, upgraded powerful swords. Additionally, there are a variety of rooms through the dungeon: spawner rooms, dungeon gardens, fancy lava pools, and rooms filled with grayed-out chests. These chests are dungeon chests and require keys to open and said keys drop from the enemies of the floor. Within these chests are fancy powerful items to help fight the next boss. There are a certain amount of dungeon chests that you will have to open if you want to survive from the next boss. The amount is dependent on the map size and some random chance. If you press F3 while on the dungeon level, it will display how many locked chests remain. Upon unlocking the final chest out of all the chest on the map, you will receive 5 golden apples. -You will eventually come across a room with a strange curious statue and can walk through its walls. This is the boss room, if you tap the statue inside three times, the obsidian knight will spawn. Soon you will notice the walls are solid and unbreakable until either the boss is defeated or the player dies. This boss has 3 attack patterns and 2 phases: fire spray and normal walk for phase 1 and additionally dash for phase 2. +You will eventually come across a room with a strange curious statue. This is the boss room, if you tap the statue inside three times, the obsidian knight will spawn. Soon you will notice the room's doors are locked solid and unbreakable until either the boss is defeated or the player dies. This boss has 3 attack patterns and 2 phases: fire spray and normal walk for phase 1 and additionally dash for phase 2. -If you came prepared and/or was lucky and manage to defeat the obsidian knight, it will drop a big amount of shards and a new curious item. This item, the obsidian heart, when used will increase your health by 5 per use, with a maximum of 30 in total (4 obsidian hearts are needed). The boss only drops one, so for maximum hp you will need to respawn the boss with an obsidian poppet, which is craftable in the enchanter. +If you came prepared and/or was lucky and manage to defeat the obsidian knight, it will drop a big amount of shards and a new curious item. This item, the obsidian heart, when used will increase your max health by 5 per use, with a maximum of 30 in total (4 obsidian hearts are needed). The boss only drops one, so for maximum hp you will need to respawn the boss with an obsidian poppet, which is craftable in the enchanter. @@@ -Back in the sky world are white ores called cloud ore, which you can mine. You can craft a Totem of Air from such ores, which will respawn the air wizard when used. +Back in the sky world are white ores called cloud ore, which you can mine. You can craft a Totem of Air from such ores, which will respawn the air wizard when used. There is also a house which belonged to the Air Wizard. It contains a free enchanter to craft potions and boss respawn items. And of course, you may continue to play your world as usual afterwards. diff --git a/src/client/resources/assets/books/instructions.txt b/src/client/resources/assets/books/instructions.txt index 0d6472725..188c76632 100644 --- a/src/client/resources/assets/books/instructions.txt +++ b/src/client/resources/assets/books/instructions.txt @@ -1,5 +1,8 @@ With the default controls... -Move your character with arrow keys or WSAD. Press C to attack and X to open the inventory, and to use items. Pickup furniture and torches with V. Select an item in the inventory to equip it. +Move your character with arrow keys or WSAD. Press C to attack and X to open the inventory, and to use items. Pickup furniture and torches with V. Select an item in the inventory to equip it. Q to drop an item or Shift + Q to drop a stack. Escape key for pause menu. -The Goal: Defeat the air wizard! \ No newline at end of file +Similarly on controller move your character or with dpad or left joystick, A button to attack or select, B button to exit menus, X button for inventory, Y button for craft menu, start menu for pause menu or search in a list of items, Left Bumper to pick up furniture, Right Bumper to drop an item or use Right Joystick Button to drop a stack. + +The main Goal: Defeat the air wizard and Obsidian Knight! +Prevail, get stronger, survive! From dc4e3969d667bc05dce6853ac4bf7c87b6ab4379 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 4 Feb 2024 22:23:56 +0800 Subject: [PATCH 166/261] Rename HeartItem#"clone" to "copy" --- src/client/java/minicraft/item/HeartItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/HeartItem.java b/src/client/java/minicraft/item/HeartItem.java index a8297c178..632d5d2b3 100644 --- a/src/client/java/minicraft/item/HeartItem.java +++ b/src/client/java/minicraft/item/HeartItem.java @@ -6,6 +6,7 @@ import minicraft.gfx.SpriteLinker; import minicraft.level.Level; import minicraft.level.tile.Tile; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -55,7 +56,7 @@ public boolean interactsWithWorld() { return false; } - public HeartItem clone() { + public @NotNull HeartItem copy() { return new HeartItem(getName(), sprite, count, health); } } From 42abfbb3e68680997051f9ab8b4fe47e3f3804e0 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 5 Feb 2024 23:14:06 +0800 Subject: [PATCH 167/261] Resolve post-merge errors --- src/client/java/minicraft/item/SignItem.java | 2 +- .../java/minicraft/screen/SignDisplay.java | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client/java/minicraft/item/SignItem.java b/src/client/java/minicraft/item/SignItem.java index 645878bde..f6a88d9e6 100644 --- a/src/client/java/minicraft/item/SignItem.java +++ b/src/client/java/minicraft/item/SignItem.java @@ -24,7 +24,7 @@ public static ArrayList getAllInstances() { private SignItem() { this(1); } private SignItem(int count) { - super("Sign", sprite, count, "", "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); + super("Sign", sprite, count, null, "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java index cb970ba6c..b434c5d09 100644 --- a/src/client/java/minicraft/screen/SignDisplay.java +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -100,17 +100,17 @@ public void tick(InputHandler input) { } insertChars(input.getKeysTyped(null)); - if (input.getKey("PAGE-UP").clicked) { + if (input.getMappedKey("PAGE-UP").isClicked()) { cursorX = rows.get(cursorY = 0).length(); updateCaretAnimation(); - } else if (input.getKey("PAGE-DOWN").clicked) { + } else if (input.getMappedKey("PAGE-DOWN").isClicked()) { cursorX = rows.get(cursorY = rows.size() - 1).length(); updateCaretAnimation(); - } else if (input.getKey("HOME").clicked) { + } else if (input.getMappedKey("HOME").isClicked()) { cursorX = 0; updateCaretAnimation(); - } else if (input.getKey("END").clicked) { + } else if (input.getMappedKey("END").isClicked()) { cursorX = rows.get(cursorY).length(); updateCaretAnimation(); @@ -120,7 +120,7 @@ public void tick(InputHandler input) { } else if (input.inputPressed("CURSOR-UP")) { cursorX = rows.get(cursorY == 0 ? cursorY = rows.size() - 1 : --cursorY).length(); updateCaretAnimation(); - } else if (input.inputPressed("CURSOR-DOWN") || input.getKey("ENTER").clicked) { + } else if (input.inputPressed("CURSOR-DOWN") || input.getMappedKey("ENTER").isClicked()) { cursorX = rows.get(cursorY == rows.size() - 1 ? cursorY = 0 : ++cursorY).length(); updateCaretAnimation(); } else if (input.inputPressed("CURSOR-LEFT")) { @@ -131,15 +131,15 @@ public void tick(InputHandler input) { updateCaretAnimation(); // Clipboard operations - } else if (input.getKey("CTRL-X").clicked) { + } else if (input.getMappedKey("CTRL-X").isClicked()) { cursorX = 0; clipboard.setClipboardContents(rows.get(cursorY).toString()); rows.set(cursorY, new StringBuilder()); updateCaretAnimation(); - } else if (input.getKey("CTRL-C").clicked) { + } else if (input.getMappedKey("CTRL-C").isClicked()) { clipboard.setClipboardContents(rows.get(cursorY).toString()); updateCaretAnimation(); - } else if (input.getKey("CTRL-V").clicked) { + } else if (input.getMappedKey("CTRL-V").isClicked()) { insertChars(clipboard.getClipboardContents()); } } @@ -236,7 +236,7 @@ public void tick(InputHandler input) { boolean acted = false; // Checks if typing action is needed to be handled. boolean mainMethod = false; if (onScreenKeyboardMenu == null || !onScreenKeyboardMenu.isVisible()) { - if (input.inputPressed("exit") || input.getKey("SHIFT-ENTER").clicked) { + if (input.inputPressed("exit") || input.getMappedKey("SHIFT-ENTER").isClicked()) { updateSign(levelDepth, x, y, editor.getLines()); Game.exitDisplay(); return; @@ -254,7 +254,7 @@ public void tick(InputHandler input) { if (acted) editor.tick(input); - if (input.getKey("exit").clicked || input.getKey("SHIFT-ENTER").clicked) { // Should not listen button press + if (input.getMappedKey("exit").isClicked() || input.getMappedKey("SHIFT-ENTER").isClicked()) { // Should not listen button press updateSign(levelDepth, x, y, editor.getLines()); Game.exitDisplay(); return; From 3e961ca13a396d96134afb68f0b48e090788eaa7 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 9 Feb 2024 04:21:53 +0800 Subject: [PATCH 168/261] Add SignTileEntity in place of sign tile bumping --- src/client/java/minicraft/level/Level.java | 1 + .../java/minicraft/level/tile/SignTile.java | 20 ++--------- .../java/minicraft/level/tile/Tile.java | 2 ++ .../level/tile/entity/SignTileEntity.java | 35 +++++++++++++++++++ src/client/java/minicraft/saveload/Load.java | 7 ++++ 5 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 src/client/java/minicraft/level/tile/entity/SignTileEntity.java diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index fbdeae189..bc8e38e6a 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -583,6 +583,7 @@ public void setTile(int x, int y, Tile t, int dataVal) { tiles[x + y * w] = t.id; data[x + y * w] = (short) dataVal; + t.onTileSet(this, x, y); } public int getData(int x, int y) { diff --git a/src/client/java/minicraft/level/tile/SignTile.java b/src/client/java/minicraft/level/tile/SignTile.java index 55858f98f..36f1ae294 100644 --- a/src/client/java/minicraft/level/tile/SignTile.java +++ b/src/client/java/minicraft/level/tile/SignTile.java @@ -12,13 +12,12 @@ import minicraft.gfx.SpriteLinker; import minicraft.item.Item; import minicraft.item.Items; -import minicraft.item.PowerGloveItem; import minicraft.item.ToolItem; import minicraft.item.ToolType; import minicraft.level.Level; +import minicraft.level.tile.entity.SignTileEntity; import minicraft.screen.SignDisplay; import minicraft.screen.SignDisplayMenu; -import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; public class SignTile extends Tile { @@ -81,20 +80,7 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at } @Override - public void steppedOn(Level level, int xt, int yt, Entity entity) { - if (entity instanceof Player) { - if (Renderer.signDisplayMenu == null || Renderer.signDisplayMenu.differsFrom(level.depth, xt, yt)) { - Renderer.signDisplayMenu = new SignDisplayMenu(level, xt, yt); - } - } - } - - @Override - public void steppedOut(Level level, int xt, int yt, Entity entity) { - if (entity instanceof Player) { - if (Renderer.signDisplayMenu != null && Renderer.signDisplayMenu.matches(level.depth, xt, yt)) { - Renderer.signDisplayMenu = null; - } - } + public void onTileSet(Level level, int x, int y) { + level.add(new SignTileEntity(), x, y, true); } } diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index 0efac4f56..dda2fc706 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -75,6 +75,8 @@ public boolean maySpawn() { return maySpawn; } + public void onTileSet(Level level, int x, int y) {} + /** * Returns if the player can walk on it, overrides in sub-classes */ diff --git a/src/client/java/minicraft/level/tile/entity/SignTileEntity.java b/src/client/java/minicraft/level/tile/entity/SignTileEntity.java new file mode 100644 index 000000000..719c7e7e5 --- /dev/null +++ b/src/client/java/minicraft/level/tile/entity/SignTileEntity.java @@ -0,0 +1,35 @@ +package minicraft.level.tile.entity; + +import minicraft.core.Game; +import minicraft.core.Renderer; +import minicraft.entity.Entity; +import minicraft.gfx.Screen; +import minicraft.screen.SignDisplayMenu; + +public class SignTileEntity extends Entity { + public SignTileEntity() { + super(8, 8); + } + + @Override + public void render(Screen screen) {} + + @Override + public boolean isSolid() { + return false; + } + + @Override + public void tick() { + int xt = x >> 4, yt = y >> 4; + if (Game.player.x >> 4 == xt && Game.player.y >> 4 == yt) { + if (Renderer.signDisplayMenu == null || Renderer.signDisplayMenu.differsFrom(level.depth, xt, yt)) { + Renderer.signDisplayMenu = new SignDisplayMenu(level, xt, yt); + } + } else { + if (Renderer.signDisplayMenu != null && Renderer.signDisplayMenu.matches(level.depth, xt, yt)) { + Renderer.signDisplayMenu = null; + } + } + } +} diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index d9e8d034a..5dedd6dbc 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -683,6 +683,13 @@ private void loadWorld(String filename) { curLevel.tiles = tiles; curLevel.data = tdata; + // Tile initialization + for (int x = 0; x < curLevel.w; ++x) { + for (int y = 0; y < curLevel.h; ++y) { + Tiles.get(curLevel.tiles[x + y * curLevel.w]).onTileSet(curLevel, x, y); + } + } + if (Logging.logLevel) curLevel.printTileLocs(Tiles.get("Stairs Down")); if (parent == null) continue; From a892c39a4508a9e99f7ec86b6dab80b7c007ac92 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 10 Feb 2024 07:35:09 +0800 Subject: [PATCH 169/261] Turn WaterTile check stored to instanceof --- src/client/java/minicraft/level/tile/WaterTile.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/client/java/minicraft/level/tile/WaterTile.java b/src/client/java/minicraft/level/tile/WaterTile.java index cb90de531..a0bf4a553 100644 --- a/src/client/java/minicraft/level/tile/WaterTile.java +++ b/src/client/java/minicraft/level/tile/WaterTile.java @@ -27,31 +27,25 @@ public boolean mayPass(Level level, int x, int y, Entity e) { return e.canSwim(); } - private Tile hole = null; - private Tile lava = null; - @Override public boolean tick(Level level, int xt, int yt) { - if (hole == null) hole = Tiles.get("Hole"); - if (lava == null) lava = Tiles.get("Lava"); - int xn = xt; int yn = yt; if (random.nextBoolean()) xn += random.nextInt(2) * 2 - 1; else yn += random.nextInt(2) * 2 - 1; - if (level.getTile(xn, yn) == hole) { + if (level.getTile(xn, yn) instanceof HoleTile) { level.setTile(xn, yn, this); } // These set only the non-diagonally adjacent lava tiles to obsidian for (int x = -1; x < 2; x++) { - if (level.getTile(xt + x, yt) == lava) + if (level.getTile(xt + x, yt) instanceof LavaTile) level.setTile(xt + x, yt, Tiles.get("Raw Obsidian")); } for (int y = -1; y < 2; y++) { - if (level.getTile(xt, yt + y) == lava) + if (level.getTile(xt, yt + y) instanceof LavaTile) level.setTile(xt, yt + y, Tiles.get("Raw Obsidian")); } return false; From 1117b53fa25eec503fe39c2a51aa9add8e8f3d37 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 10 Feb 2024 08:15:24 +0800 Subject: [PATCH 170/261] Add info about system requirements in README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bc73b7e0e..530911039 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,12 @@ version, or older versions. * Support for several languages * and many, many more! +## System Prerequisites + +Our game only supports Windows, MacOS and Linux. Furthermore, newer platform versions are required for controllers. + +For Java, you may check out [system requirements for Java](https://www.java.com/en/download/help/sysreq.html). + ## Current goals and ideas Take a look at the [ideas](ideas/) folder or From acfff7effb0ce66eda28a471d6c75648c3c5041b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 10 Feb 2024 08:15:51 +0800 Subject: [PATCH 171/261] Catch errors in gamepad loading for disablement --- .../java/minicraft/core/io/InputHandler.java | 96 +++++++++++-------- 1 file changed, 57 insertions(+), 39 deletions(-) diff --git a/src/client/java/minicraft/core/io/InputHandler.java b/src/client/java/minicraft/core/io/InputHandler.java index f45a7e180..4ceeb9fec 100644 --- a/src/client/java/minicraft/core/io/InputHandler.java +++ b/src/client/java/minicraft/core/io/InputHandler.java @@ -1,5 +1,6 @@ package minicraft.core.io; +import com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException; import com.studiohartman.jamepad.ControllerAxis; import com.studiohartman.jamepad.ControllerButton; import com.studiohartman.jamepad.ControllerIndex; @@ -51,7 +52,8 @@ public class InputHandler implements KeyListener { private String keyChanged = null; // This is used when listening to change key bindings. private boolean overwrite = false; - private ControllerManager controllerManager = new ControllerManager(); + private final boolean controllersSupported; + private ControllerManager controllerManager; private ControllerIndex controllerIndex; // Please prevent getting button states directly from this object. private HashMap controllerButtonBooleanMapJust = new HashMap<>(); private HashMap controllerButtonBooleanMap = new HashMap<>(); @@ -109,14 +111,22 @@ public InputHandler() { keyboard.put("CTRL", new PhysicalKey(true)); keyboard.put("ALT", new PhysicalKey(true)); - controllerManager.initSDLGamepad(); - controllerIndex = controllerManager.getControllerIndex(0); - controllerManager.update(); + boolean controllerInit = false; try { - Logging.CONTROLLER.debug("Controller Detected: " + controllerManager.getControllerIndex(0).getName()); - } catch (ControllerUnpluggedException e) { - Logging.CONTROLLER.debug("No Controllers Detected, moving on."); + controllerManager = new ControllerManager(); + controllerManager.initSDLGamepad(); + controllerIndex = controllerManager.getControllerIndex(0); + controllerManager.update(); + try { + Logging.CONTROLLER.debug("Controller Detected: " + controllerManager.getControllerIndex(0).getName()); + } catch (ControllerUnpluggedException e) { + Logging.CONTROLLER.debug("No Controllers Detected, moving on."); + } + controllerInit = true; + } catch (IllegalStateException | SharedLibraryLoadRuntimeException | UnsatisfiedLinkError e) { + Logging.CONTROLLER.error(e, "Controllers are not support, being disabled."); } + controllersSupported = controllerInit; } public InputHandler(Component inputSource) { @@ -216,16 +226,18 @@ public void tick() { lastInputActivityListener.tick(); // Also update the controller button state. - for (ControllerButton btn : ControllerButton.values()) { - try { - controllerButtonBooleanMapJust.put(btn, controllerIndex.isButtonJustPressed(btn)); - } catch (ControllerUnpluggedException e) { - controllerButtonBooleanMapJust.put(btn, false); - } - try { - controllerButtonBooleanMap.put(btn, controllerIndex.isButtonPressed(btn)); - } catch (ControllerUnpluggedException e) { - controllerButtonBooleanMap.put(btn, false); + if (controllersSupported) { + for (ControllerButton btn : ControllerButton.values()) { + try { + controllerButtonBooleanMapJust.put(btn, controllerIndex.isButtonJustPressed(btn)); + } catch (ControllerUnpluggedException e) { + controllerButtonBooleanMapJust.put(btn, false); + } + try { + controllerButtonBooleanMap.put(btn, controllerIndex.isButtonPressed(btn)); + } catch (ControllerUnpluggedException e) { + controllerButtonBooleanMap.put(btn, false); + } } } @@ -680,7 +692,7 @@ public String addKeyTyped(String typing, @Nullable String pattern) { } public boolean anyControllerConnected() { - return controllerManager.getNumControllers() > 0; + return controllersSupported && controllerManager.getNumControllers() > 0; } public boolean buttonPressed(ControllerButton button) { @@ -722,38 +734,44 @@ public boolean inputDown(String mapping) { * @return Whether or not the controller was able to be vibrated (i.e. if haptics are supported) or controller not connected. */ public boolean controllerVibration(float leftMagnitude, float rightMagnitude, int duration_ms) { - try { - return controllerIndex.doVibration(leftMagnitude, rightMagnitude, duration_ms); - } catch (ControllerUnpluggedException ignored) { - return false; - } + if (controllersSupported) { + try { + return controllerIndex.doVibration(leftMagnitude, rightMagnitude, duration_ms); + } catch (ControllerUnpluggedException ignored) { + return false; + } + } else return false; } private int leftTriggerCooldown = 0; private int rightTriggerCooldown = 0; public boolean leftTriggerPressed() { - try { - if (leftTriggerCooldown == 0 && controllerIndex.getAxisState(ControllerAxis.TRIGGERLEFT) > 0.5) { - leftTriggerCooldown = 8; - return true; - } else + if (controllersSupported) { + try { + if (leftTriggerCooldown == 0 && controllerIndex.getAxisState(ControllerAxis.TRIGGERLEFT) > 0.5) { + leftTriggerCooldown = 8; + return true; + } else + return false; + } catch (ControllerUnpluggedException e) { return false; - } catch (ControllerUnpluggedException e) { - return false; - } + } + } else return false; } public boolean rightTriggerPressed() { - try { - if (rightTriggerCooldown == 0 && controllerIndex.getAxisState(ControllerAxis.TRIGGERRIGHT) > 0.5) { - rightTriggerCooldown = 8; - return true; - } else + if (controllersSupported) { + try { + if (rightTriggerCooldown == 0 && controllerIndex.getAxisState(ControllerAxis.TRIGGERRIGHT) > 0.5) { + rightTriggerCooldown = 8; + return true; + } else + return false; + } catch (ControllerUnpluggedException e) { return false; - } catch (ControllerUnpluggedException e) { - return false; - } + } + } else return false; } private class LastInputActivityListener { From 7250aee4d2d7d57264cb8b3b6868e37a05556df0 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 10 Feb 2024 12:31:40 +0800 Subject: [PATCH 172/261] Update ChangeLog.md --- ChangeLog.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index bae0c1a36..3bbbf644e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -32,7 +32,6 @@ but some sections are changed to compliant this project. * Added world-wide seed * Added controller support * Added on-screen keyboard -* Added logo splash screen * Added glass bottle and made potions return glass bottles when used * Added dyes (#445) * Added coloured sheep (#445) From ad7e35cf02715976941e6705fd6d46329f43c2fc Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 10 Feb 2024 12:36:23 +0800 Subject: [PATCH 173/261] Update .editorconfig --- .editorconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index efb66b976..5a617d8bf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -33,9 +33,9 @@ ij_java_keep_simple_blocks_in_one_line = true ij_java_keep_simple_classes_in_one_line = true ij_java_keep_simple_lambdas_in_one_line = true ij_java_keep_simple_methods_in_one_line = true -ij_java_method_annotation_wrap = normal -ij_java_field_annotation_wrap = normal -ij_java_do_not_wrap_after_single_annotation = true +ij_java_method_annotation_wrap = on_every_item +ij_java_field_annotation_wrap = on_every_item +ij_java_do_not_wrap_after_single_annotation = false ij_java_do_not_wrap_after_single_annotation_in_parameter = true [**.json] From 75f2e4086732f7be68d7bbbb9ffcc834f8390068 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 11 Feb 2024 02:29:31 +0800 Subject: [PATCH 174/261] Turn sand dust into sand footsteps --- .../entity/particle/SandParticle.java | 6 ++-- .../java/minicraft/level/tile/SandTile.java | 29 ++++++++---------- .../assets/textures/entity/sand_dust.png | Bin 150 -> 0 bytes .../assets/textures/entity/sand_footsteps.png | Bin 0 -> 161 bytes 4 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 src/client/resources/assets/textures/entity/sand_dust.png create mode 100644 src/client/resources/assets/textures/entity/sand_footsteps.png diff --git a/src/client/java/minicraft/entity/particle/SandParticle.java b/src/client/java/minicraft/entity/particle/SandParticle.java index e2a8a7df8..91549f400 100644 --- a/src/client/java/minicraft/entity/particle/SandParticle.java +++ b/src/client/java/minicraft/entity/particle/SandParticle.java @@ -1,11 +1,14 @@ package minicraft.entity.particle; +import minicraft.gfx.SpriteLinker; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; import java.util.Random; public class SandParticle extends Particle { + public static final LinkedSprite sprite = new LinkedSprite(SpriteType.Entity, "sand_footsteps"); + /** * Creating a sand particle. * @@ -13,7 +16,6 @@ public class SandParticle extends Particle { * @param y Y map position */ public SandParticle(int x, int y) { - super(x, y, 180 + new Random().nextInt(71) - 35, new LinkedSprite(SpriteType.Entity, "sand_dust")); - this.sprite.setMirror(random.nextInt(4)); + super(x, y, 180 + new Random().nextInt(81) - 40, sprite); } } diff --git a/src/client/java/minicraft/level/tile/SandTile.java b/src/client/java/minicraft/level/tile/SandTile.java index 07728dcd5..c6f593188 100644 --- a/src/client/java/minicraft/level/tile/SandTile.java +++ b/src/client/java/minicraft/level/tile/SandTile.java @@ -38,23 +38,18 @@ public boolean tick(Level level, int x, int y) { public void steppedOn(Level level, int x, int y, Entity entity) { if (entity instanceof Mob) { - if (random.nextInt(3) == 0) { - int spawnX = entity.x - 8 + random.nextInt(5) - 2; - int spawnY = entity.y - 8 + random.nextInt(5) - 2; - for (Direction dir : Direction.values()) { - Tile neighbour = level.getTile(x + dir.getX(), y + dir.getY()); - if (neighbour != null) { - if (!(neighbour instanceof SandTile)) { // Particles only spawn on sand tiles. - if (dir.getX() < 0) // Offsets - if (entity.x % 16 < 8) spawnX += 8 - entity.x % 16; - if (dir.getX() > 0) - if (entity.x % 16 > 7) spawnX -= entity.x % 16 - 8; - if (dir.getY() < 0) - if (entity.y % 16 < 8) spawnY += 8 - entity.y % 16; - if (dir.getY() > 0) - if (entity.y % 16 > 7) spawnY -= entity.y % 16 - 8; - } - } + if (((Mob) entity).walkDist % 8 == 0) { // Mob animation changes by every 2^3 in walkDist. + int spawnX = entity.x - 4; // Shifting is done to ensure that the center of particle is located + int spawnY = entity.y - 4; // at the center of the mob. + switch (((Mob) entity).dir) { // Shifting along the orthogonal axis of direction. + case NONE: // UNKNOWN + return; + case UP: case DOWN: // y-axis + spawnX += (random.nextInt(2) + 2) * (((((Mob) entity).walkDist) >> 3) % 2 == 0 ? 1 : -1); + break; + case LEFT: case RIGHT: // x-axis + spawnY += (random.nextInt(2) + 2) * (((((Mob) entity).walkDist) >> 3) % 2 == 0 ? 1 : -1); + break; } level.add(new SandParticle(spawnX, spawnY)); diff --git a/src/client/resources/assets/textures/entity/sand_dust.png b/src/client/resources/assets/textures/entity/sand_dust.png deleted file mode 100644 index 557c417f4f5fc81b6fe029e161d8fe0c61fa0b9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL2XYL#}EtuWC_+Ijc;!+{_i}qh0(LilhMRj qLfv6oVM6Y5sRjGZ+qe=E7#N;f3s>$i>z@MD#^CAd=d#Wzp$PzaB`H_{ diff --git a/src/client/resources/assets/textures/entity/sand_footsteps.png b/src/client/resources/assets/textures/entity/sand_footsteps.png new file mode 100644 index 0000000000000000000000000000000000000000..280db1e6b1c58a1a84eb978c60af6d6ec2628698 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en(9F}tF+?Lcd4b-IEt(JQIh=PU9N<`ba8g#5 zO~SSvJ2aXXB-lpuaq2kfRQ%uf5hNeN$iu@>;wj*k-EMIeXaa+$tDnm{r-UW|84E1p literal 0 HcmV?d00001 From f8f73834d22e03cbd702b2aeb5ea57de7dcffa0d Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:54:18 +0800 Subject: [PATCH 175/261] Resolve post-merge error --- src/client/java/minicraft/item/TileItem.java | 2 +- src/client/java/minicraft/item/WateringCanItem.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index 2c6a39862..06b762ef3 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -120,7 +120,7 @@ public TileModel(String tile, TileDataGetter data) { } public static Tile getTile(@Nullable TileModel model) { - return model == null ? Tiles.get(0) : Tiles.get(model.tile); + return model == null ? Tiles.get((short) 0) : Tiles.get(model.tile); } public static int getTileData(@Nullable TileModel model, Tile tile, Tile target, Level level, int xt, int yt, Player player, Direction attackDir) { diff --git a/src/client/java/minicraft/item/WateringCanItem.java b/src/client/java/minicraft/item/WateringCanItem.java index 181b34745..55f89fadc 100644 --- a/src/client/java/minicraft/item/WateringCanItem.java +++ b/src/client/java/minicraft/item/WateringCanItem.java @@ -85,7 +85,7 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, level.add(new Particle((int) x, (int) y, 120 + random.nextInt(21) - 40, particleSprite)); } if (random.nextInt(60) == 0) { // Small chance for growing flowers - level.setTile(xt, yt, Tiles.get(2), random.nextInt(2)); + level.setTile(xt, yt, Tiles.get((short) 2), random.nextInt(2)); } } From d42197d9f3c448b269eb054900d97f6eb194ba72 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:21:39 +0800 Subject: [PATCH 176/261] Resolve torch not loaded error after merge --- src/client/java/minicraft/level/tile/TorchTile.java | 4 ++++ src/client/java/minicraft/saveload/LegacyLoad.java | 12 ++++++++++-- src/client/java/minicraft/saveload/Load.java | 13 +++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index e54ce710c..ebe8c5b22 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -49,6 +49,10 @@ public int getLightRadius(Level level, int x, int y) { return 5; } + public short getOnType() { + return onType.id; + } + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { if (item instanceof PowerGloveItem) { int data = level.getData(xt, yt); diff --git a/src/client/java/minicraft/saveload/LegacyLoad.java b/src/client/java/minicraft/saveload/LegacyLoad.java index b902c3775..3bfc30524 100644 --- a/src/client/java/minicraft/saveload/LegacyLoad.java +++ b/src/client/java/minicraft/saveload/LegacyLoad.java @@ -34,7 +34,9 @@ import minicraft.item.PotionType; import minicraft.item.StackableItem; import minicraft.level.Level; +import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; +import minicraft.level.tile.TorchTile; import minicraft.screen.LoadingDisplay; import minicraft.util.Logging; import org.tinylog.Logger; @@ -231,8 +233,14 @@ public void loadWorld(String filename) { for (int y = 0; y < lvlh - 1; y++) { int tileArrIdx = y + x * lvlw; int tileidx = x + y * lvlw; // The tiles are saved with x outer loop, and y inner loop, meaning that the list reads down, then right one, rather than right, then down one. - tiles[tileArrIdx] = Tiles.get(Tiles.oldids.get(Integer.parseInt(data.get(tileidx + 3)))).id; - tdata[tileArrIdx] = Short.parseShort(extradata.get(tileidx)); + Tile tile = Tiles.get(Tiles.oldids.get(Integer.parseInt(data.get(tileidx + 3)))); + if (tile instanceof TorchTile && tile != TorchTile.DELEGATE) { + tiles[tileArrIdx] = TorchTile.DELEGATE.id; + tdata[tileArrIdx] = ((TorchTile) tile).getOnType(); + } else { + tiles[tileArrIdx] = tile.id; + tdata[tileArrIdx] = Short.parseShort(extradata.get(tileidx)); + } } } diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index efc17809a..bc627dae6 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -48,7 +48,9 @@ import minicraft.item.Recipe; import minicraft.item.StackableItem; import minicraft.level.Level; +import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; +import minicraft.level.tile.TorchTile; import minicraft.network.Network; import minicraft.screen.AchievementsDisplay; import minicraft.screen.CraftingDisplay; @@ -665,8 +667,15 @@ private void loadWorld(String filename) { } } - tiles[tileArrIdx] = Tiles.get(tilename).id; - tdata[tileArrIdx] = Short.parseShort(extradata.get(tileidx)); + + Tile tile = Tiles.get(tilename); + if (tile instanceof TorchTile && tile != TorchTile.DELEGATE) { + tiles[tileArrIdx] = TorchTile.DELEGATE.id; + tdata[tileArrIdx] = ((TorchTile) tile).getOnType(); + } else { + tiles[tileArrIdx] = tile.id; + tdata[tileArrIdx] = Short.parseShort(extradata.get(tileidx)); + } } } From 319811dcd2f9a876344aca1b7c3420e0e356f6ef Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 14 Feb 2024 00:59:27 +0800 Subject: [PATCH 177/261] Handle destination file not having folder --- src/client/java/minicraft/core/io/FileHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/java/minicraft/core/io/FileHandler.java b/src/client/java/minicraft/core/io/FileHandler.java index cdde3472c..a425f6f73 100644 --- a/src/client/java/minicraft/core/io/FileHandler.java +++ b/src/client/java/minicraft/core/io/FileHandler.java @@ -140,6 +140,7 @@ else if (ifExisting == RENAME_COPY) { } Path newFile = new File(newFilename).toPath(); + newFile.getParent().toFile().mkdirs(); try { Files.copy(file, newFile, StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { From a5c016b750d34abb765129ca074037d1732ef77f Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:18:42 -0500 Subject: [PATCH 178/261] Revert Nightly Builds back to original state --- .github/workflows/autobuild.yml | 86 +++++++++------------------------ 1 file changed, 22 insertions(+), 64 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 15b45e993..9bff81a7e 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -1,75 +1,33 @@ -name: AutoRelease & Build +name: Nightly build on: + schedule: + - cron: '0 0 * * *' workflow_dispatch: jobs: gradle: strategy: matrix: - os: [ubuntu-latest] + os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} - permissions: - contents: write steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.LITOROMTOKEN }} - - name: Update ingame version - uses: jacobtomlinson/gha-find-replace@v3 - with: - find: "${{ vars.VERSION }}-dev${{ vars.VERSION_old }}" - replace: "${{ vars.VERSION }}-dev${{ vars.VERSION_s }}" - include: "src/client/java/minicraft/core/Game.java" - - name: Update gradle version - uses: jacobtomlinson/gha-find-replace@v3 - with: - find: "version = \"${{ vars.VERSION }}-dev${{ vars.VERSION_old }}\"" - replace: "version = \"${{ vars.VERSION }}-dev${{ vars.VERSION_s }}\"" - include: "build.gradle" - - name: Push changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "Increment Version" - token: ${{ secrets.LITOROMTOKEN }} - repository: ${{ secrets.GITHUB_REPOSITORY }} - branch: ${{ github.ref }} - - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 8 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 - - name: Increment old version number - uses: action-pack/increment@v2 - with: - name: 'VERSION_old' - token: ${{ secrets.LITOROMTOKEN }} - repository: ${{ secrets.GITHUB_REPOSITORY }} - owner: 'MinicraftPlus' - - - name: Increment new version number - uses: action-pack/increment@v2 - with: - name: 'VERSION_s' - token: ${{ secrets.LITOROMTOKEN }} - repository: ${{ secrets.GITHUB_REPOSITORY }} - owner: 'MinicraftPlus' - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2.4.2 - - - name: Execute Gradle build - run: ./gradlew build + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.4.2 - - uses: "dciborow/action-github-releases@v1.0.1" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "v${{ vars.VERSION }}-dev${{ vars.VERSION_s }}" - prerelease: true - title: "Version ${{ vars.VERSION }}, Pre-release ${{ vars.VERSION_s }} (Nightly)" - generate_release_notes: true - files: | - LICENSE - ChangeLog.md - build/libs/**.jar - + - name: Execute Gradle build + run: ./gradlew build + + - uses: actions/upload-artifact@v3.1.2 + with: + name: "Nightly release" + path: | + LICENSE + ChangeLog.md + build/libs/**.jar + if-no-files-found: error From 0567c2fed13dca2d72eaa20071ea0653e1df6ea7 Mon Sep 17 00:00:00 2001 From: azgoodaz Date: Wed, 14 Feb 2024 00:14:20 -0500 Subject: [PATCH 179/261] Wiki | Update to README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc73b7e0e..555e1a02a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Minicraft+ is an overhaul mod of Minicraft, a game made by Markus "Notch" Persson in the Ludum Dare 22 contest. To learn more about Minicraft take a look at [playminicraft.com](https://www.playminicraft.com), talk to the community at our [Discord](https://discord.me/minicraft), or check out -our [Fandom Wiki](https://minicraft.fandom.com/wiki/Minicraft_Wiki). +our [wiki.gg Wiki](https://minicraft.wiki.gg/wiki/). Check the [releases](https://github.com/minicraftplus/minicraft-plus-revived/releases) page to download the latest version, or older versions. From c8f9459b891eeb6803dbf63c2c2c936d84a5416c Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:40:27 -0500 Subject: [PATCH 180/261] Added Achievements for OBK and Boat, Fixed AW's --- src/client/resources/assets/localization/en-us.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index e10178853..719630da6 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -13,8 +13,10 @@ "minicraft.achievement.doors.desc": "Craft a wood door.", "minicraft.achievement.planks": "Walk the Planks!", "minicraft.achievement.planks.desc": "Craft wood planks.", + "minicraft.achievement.boat": "Boating license", + "minicraft.achievement.boat.desc": "Craft a boat.", "minicraft.achievement.clothes": "Have a colourful day!", - "minicraft.achievement.clothes.desc": "Craft any color of clothes", + "minicraft.achievement.clothes.desc": "Craft any color of clothes.", "minicraft.achievement.demolition": "Demolition Demo", "minicraft.achievement.demolition.desc": "Use TNT.", "minicraft.achievement.survive_darkness": "Afraid of the Dark?", @@ -28,7 +30,9 @@ "minicraft.achievement.obsidian_dungeon": "Of Knights and Men", "minicraft.achievement.obsidian_dungeon.desc": "Reach the obsidian dungeon.", "minicraft.achievement.airwizard": "Defeat... the air?", - "minicraft.achievement.airwizard.desc": "Defeat the first Air Wizard!", + "minicraft.achievement.airwizard.desc": "Defeat the Air Wizard!", + "minicraft.achievement.obsidianknight": "Shattered Burning Heart", + "minicraft.achievement.obsidianknight.desc": "Defeat the Obsidian Knight and obtain its heart!", "minicraft.achievement.skin": "Fashion Show", "minicraft.achievement.skin.desc": "Change your skin.", "minicraft.achievement.plant_seed": "A Seedy Place", From 701b3b7d80ac902f5b6f24418374ce94522f54b6 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 00:51:46 +0800 Subject: [PATCH 181/261] Block player input detects about menus --- .../java/minicraft/entity/mob/Player.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index b9a74e976..59fedf55c 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -517,7 +517,7 @@ public void tick() { attack(); } - if (input.inputPressed("menu") && activeItem != null) { + if ((input.inputPressed("menu") || input.inputPressed("craft")) && activeItem != null) { int returned = inventory.add(0, activeItem); if (activeItem instanceof StackableItem) { StackableItem stackable = (StackableItem) activeItem; @@ -536,14 +536,19 @@ public void tick() { } if (Game.getDisplay() == null) { - if (input.inputPressed("menu") && !use()) // !use() = no furniture in front of the player; this prevents player inventory from opening (will open furniture inventory instead) + if (input.inputPressed("menu") && !use()) { // !use() = no furniture in front of the player; this prevents player inventory from opening (will open furniture inventory instead) Game.setDisplay(new PlayerInvDisplay(this)); - if (input.inputPressed("pause")) + return; + } else if (input.inputPressed("pause")) { Game.setDisplay(new PauseDisplay()); - if (input.inputPressed("craft") && !use()) + return; + } else if (input.inputPressed("craft") && !use()) { Game.setDisplay(new CraftingDisplay(Recipes.craftRecipes, "minicraft.displays.crafting", this, true)); - - if (input.inputDown("info")) Game.setDisplay(new InfoDisplay()); + return; + } else if (input.inputDown("info")) { + Game.setDisplay(new InfoDisplay()); + return; + } if (input.inputDown("quicksave") && !Updater.saving) { Updater.saving = true; From 2395ca64c0eea3e580c80e84105bb81252b27564 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 00:59:17 +0800 Subject: [PATCH 182/261] Change the order of menus input detection --- src/client/java/minicraft/entity/mob/Player.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index 59fedf55c..ccded75c1 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -536,15 +536,15 @@ public void tick() { } if (Game.getDisplay() == null) { - if (input.inputPressed("menu") && !use()) { // !use() = no furniture in front of the player; this prevents player inventory from opening (will open furniture inventory instead) + if (input.inputPressed("craft") && !use()) { + Game.setDisplay(new CraftingDisplay(Recipes.craftRecipes, "minicraft.displays.crafting", this, true)); + return; + } else if (input.inputPressed("menu") && !use()) { // !use() = no furniture in front of the player; this prevents player inventory from opening (will open furniture inventory instead) Game.setDisplay(new PlayerInvDisplay(this)); return; } else if (input.inputPressed("pause")) { Game.setDisplay(new PauseDisplay()); return; - } else if (input.inputPressed("craft") && !use()) { - Game.setDisplay(new CraftingDisplay(Recipes.craftRecipes, "minicraft.displays.crafting", this, true)); - return; } else if (input.inputDown("info")) { Game.setDisplay(new InfoDisplay()); return; From 71ec84e2d18887af82784835b71cb8364343b14a Mon Sep 17 00:00:00 2001 From: Litorom Date: Thu, 15 Feb 2024 12:48:47 -0500 Subject: [PATCH 183/261] Revert the majority of textures --- .../resources/assets/textures/entity/bed.png | Bin 219 -> 190 bytes .../resources/assets/textures/entity/tnt.png | Bin 250 -> 211 bytes .../assets/textures/entity/workbench.png | Bin 266 -> 204 bytes .../resources/assets/textures/item/acorn.png | Bin 189 -> 173 bytes .../assets/textures/item/air_wizard_spawner.png | Bin 164 -> 166 bytes .../assets/textures/item/antidious_book.png | Bin 164 -> 156 bytes .../resources/assets/textures/item/bed.png | Bin 167 -> 142 bytes .../resources/assets/textures/item/book.png | Bin 164 -> 156 bytes .../resources/assets/textures/item/bread.png | Bin 185 -> 174 bytes .../resources/assets/textures/item/cactus.png | Bin 163 -> 163 bytes .../resources/assets/textures/item/chest.png | Bin 156 -> 155 bytes .../assets/textures/item/cloud_ore.png | Bin 150 -> 198 bytes .../assets/textures/item/cow_spawner.png | Bin 161 -> 162 bytes .../assets/textures/item/creeper_spawner.png | Bin 164 -> 166 bytes .../assets/textures/item/dungeon_chest.png | Bin 157 -> 155 bytes .../assets/textures/item/enchanter.png | Bin 155 -> 158 bytes .../assets/textures/item/green_wool.png | Bin 164 -> 155 bytes .../assets/textures/item/gunpowder.png | Bin 156 -> 136 bytes .../assets/textures/item/knight_spawner.png | Bin 164 -> 166 bytes .../assets/textures/item/pig_spawner.png | Bin 162 -> 163 bytes .../assets/textures/item/plank_wall.png | Bin 138 -> 116 bytes .../resources/assets/textures/item/pork.png | Bin 146 -> 144 bytes .../assets/textures/item/sheep_spawner.png | Bin 163 -> 165 bytes .../assets/textures/item/skeleton_spawner.png | Bin 162 -> 163 bytes .../assets/textures/item/slime_spawner.png | Bin 164 -> 166 bytes .../resources/assets/textures/item/snake.png | Bin 162 -> 163 bytes .../assets/textures/item/snake_spawner.png | Bin 161 -> 162 bytes .../resources/assets/textures/item/spawner.png | Bin 164 -> 164 bytes .../assets/textures/item/stone_wall.png | Bin 145 -> 117 bytes .../resources/assets/textures/item/tnt.png | Bin 134 -> 158 bytes .../assets/textures/item/white_flower.png | Bin 147 -> 147 bytes .../assets/textures/item/zombie_spawner.png | Bin 164 -> 166 bytes .../resources/assets/textures/tile/oak.png | Bin 235 -> 263 bytes .../resources/assets/textures/tile/oak_full.png | Bin 202 -> 242 bytes 34 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/entity/bed.png b/src/client/resources/assets/textures/entity/bed.png index ded74f0ca9f822726bbcbc9f00961e8d3fcd7df5..760cb3d21c97e6fc6d195915d787158022a9739d 100644 GIT binary patch delta 149 zcmV;G0BZl+0loo{F@JbTL_t(IPh(`D5HM1xpMmxUs0#@E$K}eKA3iV=bOA*MfHcqE zvVu00000NkvXXu0mjf D>ajWc delta 178 zcmV;j08RhC0owtPF@KdwL_t(IPh(`D5HRA?uPz|)ADjHm49metrxvLkJpxtPy4cK?6XxXQ`@!)qnW#0mT=~UcUzO@w$K_0|;pb*$h&H(*-aC z(47u)HpuzNF#r-n2}ELSM~_yl1`umIiVH|}I?N?-7f{6jd@IQsJ@Bx)0GA@@HS8?(G#2UE!06v=G8ZE!p#U(SBJB4iGvhixS;p)Wrkv1 zU9e_cY@9BDxdLQ6$X0ALx;JsU0A@Qn4KjeXE+8f*FkC=xIwQbHiNx5BO$~K36FIH` Y0JXG<5h?PdB>(^b07*qoM6N<$g3ZoE2><{9 delta 209 zcmV;?051R20r~-uF@Lm4L_t(IPh(`D5HM1xp8;-wtGM`oQViSu@+DX=m;h;(V`BsB zmz9)cc>Mf1oDE_i^I_~qzkV@*456L@q&Od@7OM+DPJ?*|#0CLmJ~A7{fYmo|VmKmH zT^%fjOAf^VYk7Hwf?d178YZ~8!Py`~Kn5U-f!IeMKEw>f-b%}t!3GrT>N0@XFwMwf zFgDg$z-9o<3ot`*8UXSF2!Nc1%m#_!lA~@cP?QeH(G1f=ac%?vYVDs9LU-aQ00000 LNkvXXu0mjfk=s`M diff --git a/src/client/resources/assets/textures/entity/workbench.png b/src/client/resources/assets/textures/entity/workbench.png index 5501c7922aa703a2626719f836c057b2fe6f1852..dcfd7e4661df6a2e3cc26eba7e61fe73228d776c 100644 GIT binary patch delta 187 zcmV;s07UOb%ucP6Ln)LDo!?0W`>pk-YsSOEDQW&y>S2>@{NVG(kZ4qE^K002ovPDHLkV1iXMM6Lh; delta 249 zcmX@Z*u^wKvYwfNfk8u;KNv_c76-XIF|0c$^AgBmNq6*hWMJ6X&;2Kn706c%@Ck9{ z=V1>vS6-cNtt%x|Xdyqj%*RGaSY1FsL4xzlnKM9D7OV%)11av3Aiv=MaKPZ@&-e)_ z%vs<+~XccDgc{ zrA$Iq0Fp#E45SEdLS4G$e;-p*xSB1ePct;lJdUaW-2@Z`Acuv92*A~>Uh{zgpklI0=YbDh)9J0000FVdQ&MBb@0I6LZL;wH) delta 82 zcmZ3+xP)6*yL_t(2Q)6Tx02tBblVxT9&wczDE{>uABx%jh57v`(8SWgIB#IRGXMYp delta 122 zcmV-=0EPdY0i*$tF>_u?L_t(2Q)6U60?D$n|3Tcjj~_F_gy9U3q%}W3Sp4Y6k6;?4 z5UT>1ZjeH-0%YCDR(3!C%fN_F^7`BBj93+bbb=&7rhy4fVNI~>OC_1XHee`#*$Yz$ c(+v^_0PAHf3Gh_L3IG5A07*qoM6N<$f*Y?h`~Uy| diff --git a/src/client/resources/assets/textures/item/bed.png b/src/client/resources/assets/textures/item/bed.png index c8e77fd3741f3a2291194521924faacacccd8a59..1f51b8096973389e12622dd27aa24361deddf7ea 100644 GIT binary patch delta 100 zcmV-q0Gt1(0geHXFM00006*yL_t(2Q)6Tx02tBbPtD2uZuABzgb)eXySJ+|6J) zxB_HJn5iH|U_u?L_t(2Q)6U60;lHW{ReT)QYJCNgy9U31ZjeH-0%YCDR;t@JGce+lG%zq=#Hs+K6C?>T4NP3PZ~^T4n}=(`Hee`#*$Yz$ c(+v^_0BaO5OLeu~a{vGU07*qoM6N<$g6@_waR2}S diff --git a/src/client/resources/assets/textures/item/bread.png b/src/client/resources/assets/textures/item/bread.png index e66b87625962ba3209e477e9e09b24911a9a5b3e..818317c6d47ce0c80942f539a70d8e70b8359be6 100644 GIT binary patch delta 132 zcmV-~0DJ$r0j>d%F@0!BL_t(2Q)6U60^Qy2|6$zH(w&STHkbf`N00Ksk}Fr^)b_25U$U0#TVKgZp z(|7+EV2WOTVPjwfNg@lvw1XsPp5}%q013hrfh0fxBzgMuV@Ad~SwjECd47QfVY)zU ykR*s^G&Pm|pKkgUMHjLw!Ky%tkaZy|004B9G}_8N8vU026~N07>ww@PZBeeCIQm1}Ow9 z5Z4p`ubHQbV%zme*BM@3dI?d0t_UUx5=U_)$Rv;;NGD7qhA+^41pt N002ovPDHLkV1kjtCs_ah delta 107 zcmV-x0F?iu0iywsKV&W2E&m^{JPsEJGhl)s8pH=FfQi8sfF!u(xWNW~ee@MfgA{@l zi0g^}SBg|ZvF+aSdkilxy@V)0R|Jy;iK93YWD-aaq!XqQ!x!kj0sxHfDG8p210(>&@Qqc^yg|jWi=oNRcpum4R5k`6@O1TaS?83{1OVxU9Nqu` diff --git a/src/client/resources/assets/textures/item/cloud_ore.png b/src/client/resources/assets/textures/item/cloud_ore.png index 9046c20d598e17bae3a043d89e7657dc54e6d018..52f6ae4337218981b6f8cd3482f5023092dedf59 100644 GIT binary patch delta 157 zcmV;O0Al}^0mcE4F@JzbL_t(2Q+1EQ2?QYwMHA09HK1O_F2n+~2R$oxVF4DGApvDz z*?<_$`}qmR7-`Ol@Fy^(M737XTHie9d~s2(wP^1R4D!v#IS1bR=LcZ5wN{|s`-41# zQVNI&T5C{B0b`5+9M_j0r~R=CA)r{CK@Y%xV+^U?^%(jV&K4Rk!M;uXC8kqs00000 LNkvXXu0mjfEtx`B delta 108 zcmV-y0F(d50hR%fF=bFmL_t(2Q)6Tx02oP9@bKZo|1b^m^73HKU;-o|EG!I`d;9h+ z+)$7rxB_fe!4+g>W&JNNF9)mX?CfNKvEd3p5+Fq&dfK#UjL2+)z5oEZ_#O#zB@%)F O0000zc;L_t(2Q(ce24Ztu61L4b<83L&jRAPvX$+wjw*`nnY>?0Vr zQ4#T=?QW;62h6HEdS(hbz%)5Y$YEY<*}b>TAE*hyBp?(__F6%aD*z+xC*+*uB?1`s af94AihBZU|c2czf0000qT+L_t(2Q(ce24Ztu61CuXfW(cHCP>CTjCf`IxvPH|w!3QyO zv@)}UXJ$^eC16HG_1#@i0o~*zAptP@27V>rS!=v|*8*x}`2amIU;)g5Nfb?JT|wx7 Z<^@IKH3`NAQQ-gp002ovPDHLkV1lx_EuR1Y diff --git a/src/client/resources/assets/textures/item/creeper_spawner.png b/src/client/resources/assets/textures/item/creeper_spawner.png index 2b2d0ace1c837dc1e370206540b003fa40a6a8b4..3b562a123a67523762db4c6b3db66f473dd2f8f7 100644 GIT binary patch delta 84 zcmZ3&xQuavA!EWsBOQ+(1`8HAg)8D6qzGBHk2>EYkbq{gwCX^F&> o2oZOs*DXI;)-gPbD9LAHsJ&?Bs63D10s|0uy85}Sb4q9e0COc9BLDyZ delta 82 zcmZ3+xP)&+jfjf+s mIGGGQ1*G3`&rmAKXJYW2WXk#e1Iuj&AnF^!L_t(2Q)6U+0zN*Q|1dU;{`BbxBO{0dlJxUiiz2^iQ!tp% zh)YsRs+{53vrdQtbfZCh6a`93tqk|>RfE;R*cb|sO#vw;r~sq^>^q)D9-XHfcQ UDPzVO=*<8Gp00i_>zopr04M?`aR2}S delta 113 zcmV-%0FM8j0h|!F07xOs6yi*PS%cFJL@Pk{GR&(0l3qIr TnrxN!00000NkvXXu0mjf-P9+E diff --git a/src/client/resources/assets/textures/item/green_wool.png b/src/client/resources/assets/textures/item/green_wool.png index 87e0e14355e198bd207e3eadcd9fb11818d85804..63e56b85a1d0edd2a8a3f6f4ab140080a8972a48 100644 GIT binary patch delta 113 zcmV-%0FM8p0h_u?L_t(2Q)6Tx02ql@;CsOLKTPrGJD(X2q#OWi1`{C3H!t3x z7{>mE9jpkfz+sNVe_j<{29P3<1PEN8be-YlrI!!|;(Fr$HS;v#5+DXh5^e=d5wZl# cK7zgg0BR2<2_X$?m;e9(07*qoM6N<$f_FtNk^lez diff --git a/src/client/resources/assets/textures/item/gunpowder.png b/src/client/resources/assets/textures/item/gunpowder.png index 097b7d0340011598c699e2edad72a3361ad8cdc4..f1928a34837f9604826cc9fea0212be70f39b905 100644 GIT binary patch delta 94 zcmV-k0HOb!0f+&RF;_xKL_t(2Q)6Tx02q977B}6*yL_t(2Q-zPg4FFLDM8B?_)uB9fIIBb(yBP`blTFqM^DyZA z1Z|y}AJh>s{YfCIYVl?^Pyt&+?d~Tt3!)a$6p_mjHVx2|8!F)I#P)HS-23~J7gqo; US4mIzxc~qF07*qoM6N<$f}H6u@c;k- diff --git a/src/client/resources/assets/textures/item/knight_spawner.png b/src/client/resources/assets/textures/item/knight_spawner.png index 04effc15a3d809c6e1975140f66a1d0cda73d61d..da017b521bf805d447f9c6bfb386c8a80a10a5e4 100644 GIT binary patch delta 84 zcmZ3&xQuavA!EWsBOQ+(g_DoV`;8;CqKy=0GYB_pGrVNcWMZ74(!;-FVdQ&MBb@0I6LZL;wH) delta 82 zcmZ3+xP)+l=L_t(2Q(ce24Ztu61L4aEtkhvLONQx6jKH^*BiW+m73?Dz zw^0%CpzUs_tOv}hI(lXbI>0nJNyuT|YuUB8%^#=?h=$zc;L_t(2Q(ce24Ztu61CuW!uu_J}EE%RNF#_L4MzTfA%fSaR zbF?zE7thR`Y)in5i0Zq$paQzdNkRf(^bPz`~-{Hd)-MFSPw djgeW-$?(LVXZh8&+OHXaz|+;wWt~$(6972$9QObK delta 95 zcmV-l0HFVLiUE)@Swu-hK~yMHW86Ez<39r)z=*8i_g@BvzyDBGGw$j`nD7g%fDuIn z#p?--wPBf-FS;C7=Xaj)z4*}Q$iB}>fsvq diff --git a/src/client/resources/assets/textures/item/sheep_spawner.png b/src/client/resources/assets/textures/item/sheep_spawner.png index a32a6b56326151df447e4567032a7f0d894b3c2d..d5c66d7f1c56968cfb73519ae61ba978dea9336c 100644 GIT binary patch delta 83 zcmV-Z0IdI`0i^+uF#%tZGAu`oAjze@wIuu}Cu{H{WSm#BlSV!qEa&gYt%w lCI%m&BW=H#mT}yj%~1Ntlr!!6n==eR;OXk;vd$@?2>_NI9qj-B diff --git a/src/client/resources/assets/textures/item/skeleton_spawner.png b/src/client/resources/assets/textures/item/skeleton_spawner.png index 563b2b8b60b610eead293996a29516196dd22d3c..0ce8f83e41646b065a5c80868efcd6d9cc329747 100644 GIT binary patch delta 121 zcmV-<0EYjf0iywsF>+l=L_t(2Q(ce24Ztu61L2pE7^pKa1T%CXM#`_1BiW+m73?Dz zw^0%CpzUs_tOv|>t)uUI3p&6wIZ4Q2R+VL@%^#=?h=$f$mq delta 120 zcmV-;0Ehph0ipqrF>zc;L_t(2Q(ce24Ztu61Cw7yVxY{x5X{hl7%9I-MzTfA%fSaR zbF?zE7thR`Y)imgdsY8DM^FLXhF!~05B_JY(yVnA0WcdI+Fkk`9fk_liXk9_* af93^xVl@fxMbqp60000JjObj7KrksI`%-tA(z|+;wWt~$(69E0}7&`y} diff --git a/src/client/resources/assets/textures/item/snake.png b/src/client/resources/assets/textures/item/snake.png index 5a817045a8688fd1846b21be29280d146c0ffb13..d3ed8c6fcd79c9f55d88393e72cf9f4ae96bbcb9 100644 GIT binary patch delta 121 zcmV-<0EYjf0iywsF>+l=L_t(2Q(ce24Ztu61L4ag8HHs!O_yPmOv1O7BiW+m73?Dz zw^0%CpzUs_tOv}hI(lXbI>0nJNyuTYYuUcH%^#=?h=$zc;L_t(2Q(ce24Ztu61CuY4WE7U^G+l;KG6~;AMzTfA%fSaR zbF?zEgJ)(=wk2RjMD^WWPyyZKBq0GX`UZX_U_EQ>ch>@HWcdI+Fkk`9fk_liXk9_* af93^8A~gx3ZF27b0000zc;L_t(2Q(ccS4!|%717StV2blZ+7j@17 a|1)0$HZ?qT+L_t(2Q(cd-4FE9+1Ctgh3sC?56MfABk!TYc$rk@q4nByP zqm`K*JTr5$Edetks_*WC3g{*$2?>DFH}ER~>se#JyB1I*%LnLz0SjObOrmH)>k2~u ZGcQPjH3<>LY<>U$002ovPDHLkV1gTyD((OP diff --git a/src/client/resources/assets/textures/item/spawner.png b/src/client/resources/assets/textures/item/spawner.png index a43b1899de5f00714fa43c0a9d5133ede455f015..691e5dff216c762778782beef16d7723409a800e 100644 GIT binary patch delta 115 zcmV-(0F3{n0i*$tIBZ>y!3}^g3+gD>>;v`UB!|}2l zxI?l(G&h{7Ke!AfP)&6T3YrZ&20H2lX$Jo6o&#vAc7#Ml5azPelC@Kp7|^oonIDG5 VCWSC;T~z=8002ovPDHLkV1nN^FGm0X delta 115 zcmV-(0F3{n0i*$tIBa8NKmsfb*8f4=KMY41VZv|*NRo}g6)gUXVK-b6SOKymOeahc zTmeV|*#wwXa0M(3+6;dfu7VAKu|aM@QGo1VkYcz3m^(l^Ax1+aL2S4$V2aSa2>{;O VCJF0VgGc}X002ovPDHLkV1h@mD8&E( diff --git a/src/client/resources/assets/textures/item/stone_wall.png b/src/client/resources/assets/textures/item/stone_wall.png index 38e0bcd68182aa8365f2978a03eb5d4762a60d8f..f073d5a55a8e6b468ffbd09006f9bf6bbfc1c4bc 100644 GIT binary patch delta 74 zcmbQpSUSPbMc>oKF+?LcIYog%V&&oo7Zy7IFPzD;jVbcrQt#;jSDHk9W*V{X=VTF$ eh=_P#!pP8eRzPi2R=fZM5O})!xvXV5+B|z3M!~bK;y)O#bE-FI0iFSnF>P2$L_t(2Q)6Tx02qSBEP^F##kBG6kd?1mGs%a|Zx1 WsU$-va0n*=0000CnSUwEiMuO0000p;002ovPDHLkV1lMTC%XUu diff --git a/src/client/resources/assets/textures/item/zombie_spawner.png b/src/client/resources/assets/textures/item/zombie_spawner.png index 88217f842c20208828c16f67ae4606d2e05271df..58c70a67ed48d37c170a007b1d0a6d1829acf990 100644 GIT binary patch delta 84 zcmZ3&xQuavA!EWsBOQ+(1<$iKzHP53uQOJd%^=*Y&G3>%lZkPHN)P{bCN+-DOiLu5 oM2NU6y>9u*vX0?dL`gmqLx7Iy{>;l=ehfh1>FVdQ&MBb@0KuCaegFUf delta 82 zcmZ3+xP)JjObkIxrkn@vcG@!lfv2mV%Q~loCIBR589x93 diff --git a/src/client/resources/assets/textures/tile/oak.png b/src/client/resources/assets/textures/tile/oak.png index 05c9bfd16571c86a3b43235156a19177a146e918..d93017de581ee2073a5351661d26efbb97e12eea 100644 GIT binary patch delta 246 zcmVVNQY>0(Jpa4ZszxxB?Ty1tc3lOmEcTG87aJj4%U0971UT zIRHUw!3Mwr5tKNPU4v{OIvb`IMB_}#lTytX@@Ag`TbgdE#4z*tJ-AP>rbL)5$Q2;X wFmUzC8#o(e2;RH^^A1G@zzo3_^4PL80DvTo$2Q^XNdN!<07*qoM6N<$g7CXvI{*Lx delta 218 zcmZo?dd)aNvYwfNfk8u;KNv_c76-XIF|0c$^AgBmNq6*hWMJ6X&;2Kn704F~@Ck7h zbJ8>_H_AJeSCwGpW32=fj%RxC4M?$-1o;L32LXo7`4nJ@ErzW#^d=b zQhmdK II;Vst0RD|h-v9sr diff --git a/src/client/resources/assets/textures/tile/oak_full.png b/src/client/resources/assets/textures/tile/oak_full.png index 2b0b206e985d612da26ef0207c077f6a53a8f0e8..8dad3ec38f104dff232eed183b1078336a52def8 100644 GIT binary patch delta 226 zcmV<803H9z0rCNm7=H)`0000V^Z#K00004VQb$4nuFf3k00022Nkle^@Q5sCVBk9p!i>lBSEK+1T|8YJLnJPz_8sJ8 zP~c$>E?{`fX4UxHKV4W*&^z;;U?0<$lvy&yj$sS)w&*b=?U;B}{>OovT8S!4ob{~V g%o5oUb0c4XoAC&HaYy2{44{Dwp00i_>zopr0POQT-v9sr From 3095aade93e35f037f37ca332e9ffa817224e497 Mon Sep 17 00:00:00 2001 From: Litorom Date: Thu, 15 Feb 2024 12:48:59 -0500 Subject: [PATCH 184/261] Fixed Stone Door texture --- src/client/java/minicraft/item/TileItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index 2c6a39862..4835c66ce 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -39,7 +39,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Stone Bricks"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Ornate Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Wall"), "Stone Bricks")); - items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Door"), "Stone Bricks")); + items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_door"), new TileModel("Stone Door"), "Stone Bricks")); items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), new TileModel("Raw Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Ornate Obsidian"), "hole", "water", "cloud", "lava")); From 7d67dc7cc4ac9fd11b3fc741a8b91eb1aad54d1f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 03:09:53 +0800 Subject: [PATCH 185/261] Merge TorchItem to TileItem with TileModel --- src/client/java/minicraft/item/Items.java | 1 - src/client/java/minicraft/item/TileItem.java | 5 +- src/client/java/minicraft/item/TorchItem.java | 51 ------------------- 3 files changed, 4 insertions(+), 53 deletions(-) delete mode 100644 src/client/java/minicraft/item/TorchItem.java diff --git a/src/client/java/minicraft/item/Items.java b/src/client/java/minicraft/item/Items.java index 9612527f4..1cd9a1860 100644 --- a/src/client/java/minicraft/item/Items.java +++ b/src/client/java/minicraft/item/Items.java @@ -31,7 +31,6 @@ private static void addAll(ArrayList items) { static { add(new PowerGloveItem()); addAll(FurnitureItem.getAllInstances()); - addAll(TorchItem.getAllInstances()); addAll(BucketItem.getAllInstances()); addAll(BookItem.getAllInstances()); addAll(TileItem.getAllInstances()); diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index 06b762ef3..f700ca3d2 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -69,6 +69,9 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Hellish Berries", new LinkedSprite(SpriteType.Item, "hellish_berries"), new TileModel("hellish berries", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); + String[] solidTiles = { "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian" }; + items.add(new TileItem("Torch", new LinkedSprite(SpriteType.Item, "torch"), new TileModel("Torch", (model1, target, level, xt, yt, player, attackDir) -> target.id), solidTiles)); + // Creative mode available tiles: items.add(new TileItem("Farmland", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("farmland"), "dirt", "grass", "hole")); items.add(new TileItem("hole", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("hole"), "dirt", "grass")); @@ -106,7 +109,7 @@ public static class TileModel { public final TileDataGetter data; @FunctionalInterface - interface TileDataGetter { + public interface TileDataGetter { int getTileData(Tile model, Tile target, Level level, int xt, int yt, Player player, Direction attackDir); } diff --git a/src/client/java/minicraft/item/TorchItem.java b/src/client/java/minicraft/item/TorchItem.java deleted file mode 100644 index 70478ab00..000000000 --- a/src/client/java/minicraft/item/TorchItem.java +++ /dev/null @@ -1,51 +0,0 @@ -package minicraft.item; - -import minicraft.entity.Direction; -import minicraft.entity.mob.Player; -import minicraft.gfx.SpriteLinker.LinkedSprite; -import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.level.Level; -import minicraft.level.tile.Tile; -import minicraft.level.tile.TorchTile; -import org.jetbrains.annotations.NotNull; - -import java.util.ArrayList; - -public class TorchItem extends TileItem { - - public static ArrayList getAllInstances() { - ArrayList items = new ArrayList<>(); - items.add(new TorchItem()); - return items; - } - - private TorchItem() { - this(1); - } - - private TorchItem(int count) { - super("Torch", new LinkedSprite(SpriteType.Item, "torch"), count, null, "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian"); - } - - public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (validTiles.contains(tile.name)) { - level.setTile(xt, yt, TorchTile.DELEGATE, tile.id); - return super.interactOn(true); - } - return super.interactOn(false); - } - - @Override - public boolean equals(Item other) { - return other instanceof TorchItem; - } - - @Override - public int hashCode() { - return 8931; - } - - public @NotNull TorchItem copy() { - return new TorchItem(count); - } -} From 55da6b6b0edc2a277f46b19909dd61d1d38c4e16 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 03:31:27 +0800 Subject: [PATCH 186/261] Make Fense universal on tiles --- src/client/java/minicraft/item/TileItem.java | 10 ++- .../java/minicraft/level/tile/FenceTile.java | 62 +++++-------------- 2 files changed, 21 insertions(+), 51 deletions(-) diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index cf6d4f36c..f7ea4c262 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -32,22 +32,26 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Dirt", new LinkedSprite(SpriteType.Item, "dirt"), new TileModel("dirt"), "hole", "water", "lava")); items.add(new TileItem("Natural Rock", new LinkedSprite(SpriteType.Item, "stone"), new TileModel("rock"), "hole", "dirt", "sand", "grass", "path", "water", "lava")); + String[] solidTiles = { "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", + "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian" }; + TileModel.TileDataGetter placeOverWithID = (model1, target, level, xt, yt, player, attackDir) -> target.id; + items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), new TileModel("Wood Planks"), "hole", "water", "cloud")); items.add(new TileItem("Plank Wall", new LinkedSprite(SpriteType.Item, "plank_wall"), new TileModel("Wood Wall"), "Wood Planks")); items.add(new TileItem("Wood Door", new LinkedSprite(SpriteType.Item, "wood_door"), new TileModel("Wood Door"), "Wood Planks")); - items.add(new TileItem("Wood Fence", new LinkedSprite(SpriteType.Item, "wood_fence"), new TileModel("Wood Fence"), "grass")); + items.add(new TileItem("Wood Fence", new LinkedSprite(SpriteType.Item, "wood_fence"), new TileModel("Wood Fence", placeOverWithID), solidTiles)); items.add(new TileItem("Stone", new LinkedSprite(SpriteType.Item, "stone"), new TileModel("Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Stone Bricks"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Ornate Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Wall"), "Stone Bricks")); items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Door"), "Stone Bricks")); - items.add(new TileItem("Stone Fence", new LinkedSprite(SpriteType.Item, "stone_fence"), new TileModel("Stone Fence"), "Stone Bricks")); + items.add(new TileItem("Stone Fence", new LinkedSprite(SpriteType.Item, "stone_fence"), new TileModel("Stone Fence", placeOverWithID), solidTiles)); items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), new TileModel("Raw Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Obsidian", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Ornate Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Wall", new LinkedSprite(SpriteType.Item, "obsidian_wall"), new TileModel("Obsidian Wall"), "Obsidian")); items.add(new TileItem("Obsidian Door", new LinkedSprite(SpriteType.Item, "obsidian_door"), new TileModel("Obsidian Door"), "Obsidian")); - items.add(new TileItem("Obsidian Fence", new LinkedSprite(SpriteType.Item, "obsidian_fence"), new TileModel("Obsidian Fence"), "Obsidian")); + items.add(new TileItem("Obsidian Fence", new LinkedSprite(SpriteType.Item, "obsidian_fence"), new TileModel("Obsidian Fence", placeOverWithID), solidTiles)); items.add(new TileItem("Wool", new LinkedSprite(SpriteType.Item, "wool"), new TileModel("Wool"), "hole", "water")); items.add(new TileItem("Red Wool", new LinkedSprite(SpriteType.Item, "red_wool"), new TileModel("Red Wool"), "hole", "water")); diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index 231933040..c010c2503 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -28,18 +28,17 @@ public class FenceTile extends Tile { private static final SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_fence"); private static final SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_fence"); - protected Material type; + protected final Material type; - protected SpriteAnimation top, bottom, left, right; + protected final SpriteAnimation top, bottom, left, right; public boolean connectUp = false, connectDown = false, connectLeft = false, connectRight = false; protected FenceTile(Material type) { this(type, null); } protected FenceTile(Material type, String name) { - super(type.name() + " " + (name == null ? "Fence" : name), null); + super(type + " " + (name == null ? "Fence" : name), null); this.type = type; - switch (type) - { + switch (type) { case Wood: sprite = wood; connectsToGrass = true; @@ -51,14 +50,13 @@ protected FenceTile(Material type, String name) { sprite = obsidian; break; } - top = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_top"); - bottom = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_bottom"); - left = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_left"); - right = new SpriteAnimation(SpriteType.Tile, type.name().toLowerCase() + "_fence_right"); + top = new SpriteAnimation(SpriteType.Tile, type.toString().toLowerCase() + "_fence_top"); + bottom = new SpriteAnimation(SpriteType.Tile, type.toString().toLowerCase() + "_fence_bottom"); + left = new SpriteAnimation(SpriteType.Tile, type.toString().toLowerCase() + "_fence_left"); + right = new SpriteAnimation(SpriteType.Tile, type.toString().toLowerCase() + "_fence_right"); } - public void updateConnections(Level level, int x, int y) - { + public void updateConnections(Level level, int x, int y) { connectUp = level.getTile(x, y - 1).name.equals(name); connectDown = level.getTile(x, y + 1).name.equals(name); connectLeft = level.getTile(x - 1, y).name.equals(name); @@ -69,17 +67,9 @@ public boolean mayPass(Level level, int x, int y, Entity e) { return false; } - public void render(Screen screen, Level level, int x, int y) - { - switch (type) - { - case Wood: Tiles.get("Grass").render(screen, level, x, y); break; - case Stone: Tiles.get("Stone Bricks").render(screen, level, x, y); break; - case Obsidian: Tiles.get("Obsidian").render(screen, level, x, y); break; - } - + public void render(Screen screen, Level level, int x, int y) { + Tiles.get(level.getData(x, y)).render(screen, level, x, y); sprite.render(screen, level, x, y); - updateConnections(level, x, y); // up @@ -133,31 +123,11 @@ public void hurt(Level level, int x, int y, int dmg) { level.add(new SmashParticle(x * 16, y * 16)); Sound.play("monsterhurt"); - - level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + level.add(new TextParticle(String.valueOf(dmg), x * 16 + 8, y * 16 + 8, Color.RED)); if (damage >= fenceHealth) { - String itemName = "", tilename = ""; - switch (type) { // Get what tile to set and what item to drop - case Wood: { - itemName = "Wood Fence"; - tilename = "Grass"; - break; - } - case Stone: { - itemName = "Stone Fence"; - tilename = "Stone Bricks"; - break; - } - case Obsidian: { - itemName = "Obsidian Fence"; - tilename = "Obsidian"; - break; - } - } - - level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(itemName)); - level.setTile(x, y, Tiles.get(tilename)); + level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(name)); + level.setTile(x, y, Tiles.get(level.getData(x, y))); } else { level.setData(x, y, damage); } @@ -171,8 +141,4 @@ public boolean tick(Level level, int xt, int yt) { } return false; } - - public String getName(int data) { - return Material.values[data].name() + " Fence"; - } } From ea1441e17e19c9d21668fb4409cd5b334722c660 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 03:33:25 +0800 Subject: [PATCH 187/261] Change Tiles IDs --- src/client/java/minicraft/level/tile/Tiles.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index 982ac8c14..5ca05b19a 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -76,13 +76,13 @@ public static void initTileList() { tiles.put((short) 47, new BossWallTile()); tiles.put((short) 48, new BossFloorTile()); tiles.put((short) 49, new BossDoorTile()); - tiles.put((short) 50, new FenceTile(Tile.Material.Wood)); - tiles.put((short) 51, new FenceTile(Tile.Material.Stone)); - tiles.put((short) 52, new FenceTile(Tile.Material.Obsidian)); - tiles.put((short) 53, new TomatoTile("Tomato")); - tiles.put((short) 54, new CarrotTile("Carrot")); - tiles.put((short) 55, new HeavenlyBerriesTile("Heavenly Berries")); - tiles.put((short) 56, new HellishBerriesTile("Hellish Berries")); + tiles.put((short) 50, new TomatoTile("Tomato")); + tiles.put((short) 51, new CarrotTile("Carrot")); + tiles.put((short) 52, new HeavenlyBerriesTile("Heavenly Berries")); + tiles.put((short) 53, new HellishBerriesTile("Hellish Berries")); + tiles.put((short) 54, new FenceTile(Tile.Material.Wood)); + tiles.put((short) 55, new FenceTile(Tile.Material.Stone)); + tiles.put((short) 56, new FenceTile(Tile.Material.Obsidian)); // WARNING: don't use this tile for anything! tiles.put((short) 255, new ConnectTile()); From 6411067582c68b7dcc21439f64cd554cc6c5b61c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 05:30:50 +0800 Subject: [PATCH 188/261] Remove damage implementation from FenceTile --- .../java/minicraft/level/tile/FenceTile.java | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index c010c2503..2368aa4aa 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -41,7 +41,6 @@ protected FenceTile(Material type, String name) { switch (type) { case Wood: sprite = wood; - connectsToGrass = true; break; case Stone: sprite = stone; @@ -105,7 +104,9 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D if (tool.type == type.getRequiredTool()) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { int data = level.getData(xt, yt); - hurt(level, xt, yt, tool.getDamage()); + Sound.play("monsterhurt"); + level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get(name)); + level.setTile(xt, yt, Tiles.get(level.getData(xt, yt))); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); @@ -115,30 +116,4 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } return false; } - - public void hurt(Level level, int x, int y, int dmg) { - int damage = level.getData(x, y) + dmg; - int fenceHealth = 5; - if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = fenceHealth; - - level.add(new SmashParticle(x * 16, y * 16)); - Sound.play("monsterhurt"); - level.add(new TextParticle(String.valueOf(dmg), x * 16 + 8, y * 16 + 8, Color.RED)); - - if (damage >= fenceHealth) { - level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(name)); - level.setTile(x, y, Tiles.get(level.getData(x, y))); - } else { - level.setData(x, y, damage); - } - } - - public boolean tick(Level level, int xt, int yt) { - int damage = level.getData(xt, yt); - if (damage > 0) { - level.setData(xt, yt, damage - 1); - return true; - } - return false; - } } From 65ae680a4b895fe8631fd4a102fe971ea6735ed6 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:50:36 -0500 Subject: [PATCH 189/261] Revert revert --- .../assets/textures/item/cloud_ore.png | Bin 198 -> 150 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/item/cloud_ore.png b/src/client/resources/assets/textures/item/cloud_ore.png index 52f6ae4337218981b6f8cd3482f5023092dedf59..9046c20d598e17bae3a043d89e7657dc54e6d018 100644 GIT binary patch delta 108 zcmV-y0F(d50hR%fF=bFmL_t(2Q)6Tx02oP9@bKZo|1b^m^73HKU;-o|EG!I`d;9h+ z+)$7rxB_fe!4+g>W&JNNF9)mX?CfNKvEd3p5+Fq&dfK#UjL2+)z5oEZ_#O#zB@%)F O0000 Date: Thu, 15 Feb 2024 17:54:17 -0500 Subject: [PATCH 190/261] Fix pork --- .../resources/assets/textures/item/pork.png | Bin 144 -> 146 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/item/pork.png b/src/client/resources/assets/textures/item/pork.png index f0a2ccbcc6a0e470673a761a0b72938a4fe99888..2151c04b8c8555d09e1f8520063c48cadc861fb6 100644 GIT binary patch delta 71 zcmbQhIEitBA*0VkBUS4SOf&RmJXsvSU*gG)8xjY&E|e-pcZM^12)$!VX;-usICAU* b>#p?--wPBf-FS;C7=Xaj)z4*}Q$iB}>fsvq delta 69 zcmbQlIDv73A*0tsBUQ^COerVb_tzPo*tpT~farqPEs~634gNy!*izaRtp$!8`@p(u ZJ;U=E3Y9r-+W#4Vz|+;wWt~$(69B7^8kYb7 From c2bb36e1a4ed0d0d797859983c4fe5a770846ba5 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 19:17:22 +0800 Subject: [PATCH 191/261] Convert Tile#connectsTo fields to methods --- src/client/java/minicraft/entity/Arrow.java | 2 +- .../java/minicraft/gfx/SpriteAnimation.java | 34 +++++++++++-------- .../minicraft/level/tile/BossWallTile.java | 2 +- .../java/minicraft/level/tile/CactusTile.java | 6 +++- .../java/minicraft/level/tile/CloudTile.java | 2 +- .../minicraft/level/tile/ExplodedTile.java | 14 ++++++-- .../java/minicraft/level/tile/FlowerTile.java | 6 +++- .../java/minicraft/level/tile/GrassTile.java | 8 +++-- .../minicraft/level/tile/HardRockTile.java | 2 +- .../java/minicraft/level/tile/HoleTile.java | 14 ++++++-- .../java/minicraft/level/tile/LavaTile.java | 14 ++++++-- .../java/minicraft/level/tile/PathTile.java | 6 +++- .../java/minicraft/level/tile/RockTile.java | 2 +- .../java/minicraft/level/tile/SandTile.java | 8 +++-- .../minicraft/level/tile/SaplingTile.java | 18 ++++++++-- .../java/minicraft/level/tile/Tile.java | 17 +++++----- .../java/minicraft/level/tile/TorchTile.java | 18 ++++++++-- .../java/minicraft/level/tile/TreeTile.java | 6 +++- .../java/minicraft/level/tile/WallTile.java | 6 ++-- .../java/minicraft/level/tile/WaterTile.java | 8 +++-- 20 files changed, 136 insertions(+), 57 deletions(-) diff --git a/src/client/java/minicraft/entity/Arrow.java b/src/client/java/minicraft/entity/Arrow.java index 19cb2a13b..099339c85 100644 --- a/src/client/java/minicraft/entity/Arrow.java +++ b/src/client/java/minicraft/entity/Arrow.java @@ -77,7 +77,7 @@ public void tick() { } if (!level.getTile(x / 16, y / 16).mayPass(level, x / 16, y / 16, this) - && !level.getTile(x / 16, y / 16).connectsToFluid + && !level.getTile(x / 16, y / 16).connectsToFluid(level, x / 16, y / 16) && level.getTile(x / 16, y / 16).id != 16) { this.remove(); try { diff --git a/src/client/java/minicraft/gfx/SpriteAnimation.java b/src/client/java/minicraft/gfx/SpriteAnimation.java index caeea0fdc..57abe3ea5 100644 --- a/src/client/java/minicraft/gfx/SpriteAnimation.java +++ b/src/client/java/minicraft/gfx/SpriteAnimation.java @@ -15,7 +15,6 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.function.BiFunction; /** * This is not applicable for mob sprite animations. Only for generic sprite animations. @@ -54,7 +53,7 @@ public static void refreshAnimations() { // Border settings. private LinkedSprite border = null; private LinkedSprite corner = null; - private BiFunction connectChecker; + private TileConnectionChecker connectionChecker; private boolean singletonWithConnective = false; // Refreshing only data. @@ -86,14 +85,19 @@ public SpriteAnimation(SpriteMeta meta, SpriteType type, String key) { spriteAnimations.add(this); } + @FunctionalInterface + public interface TileConnectionChecker { + boolean check(Level level, int x, int y, Tile tile, boolean side); + } + /** * Setting the tile class of this animation used for tile connector rendering. * - * @param connectChecker The tile connection checker. + * @param connectionChecker The tile connection checker. * @return The instance itself. */ - public SpriteAnimation setConnectChecker(BiFunction connectChecker) { - this.connectChecker = connectChecker; + public SpriteAnimation setConnectionChecker(TileConnectionChecker connectionChecker) { + this.connectionChecker = connectionChecker; return this; } @@ -206,16 +210,16 @@ public LinkedSprite getFrame(int frame) { */ public void render(Screen screen, Level level, int x, int y) { // If border and the tile class is set. - if (connectChecker != null && (border != null || corner != null)) { - boolean u = connectChecker.apply(level.getTile(x, y - 1), true); - boolean d = connectChecker.apply(level.getTile(x, y + 1), true); - boolean l = connectChecker.apply(level.getTile(x - 1, y), true); - boolean r = connectChecker.apply(level.getTile(x + 1, y), true); - - boolean ul = connectChecker.apply(level.getTile(x - 1, y - 1), false); - boolean dl = connectChecker.apply(level.getTile(x - 1, y + 1), false); - boolean ur = connectChecker.apply(level.getTile(x + 1, y - 1), false); - boolean dr = connectChecker.apply(level.getTile(x + 1, y + 1), false); + if (connectionChecker != null && (border != null || corner != null)) { + boolean u = connectionChecker.check(level, x, y, level.getTile(x, y - 1), true); + boolean d = connectionChecker.check(level, x, y, level.getTile(x, y + 1), true); + boolean l = connectionChecker.check(level, x, y, level.getTile(x - 1, y), true); + boolean r = connectionChecker.check(level, x, y, level.getTile(x + 1, y), true); + + boolean ul = connectionChecker.check(level, x, y, level.getTile(x - 1, y - 1), false); + boolean dl = connectionChecker.check(level, x, y, level.getTile(x - 1, y + 1), false); + boolean ur = connectionChecker.check(level, x, y, level.getTile(x + 1, y - 1), false); + boolean dr = connectionChecker.check(level, x, y, level.getTile(x + 1, y + 1), false); x = x << 4; y = y << 4; diff --git a/src/client/java/minicraft/level/tile/BossWallTile.java b/src/client/java/minicraft/level/tile/BossWallTile.java index 12d1ea05f..54c2d7f82 100644 --- a/src/client/java/minicraft/level/tile/BossWallTile.java +++ b/src/client/java/minicraft/level/tile/BossWallTile.java @@ -14,7 +14,7 @@ public class BossWallTile extends WallTile { private static SpriteAnimation obsidian = new SpriteAnimation(SpriteLinker.SpriteType.Tile, "obsidian_wall") - .setConnectChecker((tile, side) -> tile.getClass() == BossWallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static final String wallMsg = "minicraft.notification.defeat_obsidian_knight_first"; diff --git a/src/client/java/minicraft/level/tile/CactusTile.java b/src/client/java/minicraft/level/tile/CactusTile.java index 8dceb499f..41f42c2c5 100644 --- a/src/client/java/minicraft/level/tile/CactusTile.java +++ b/src/client/java/minicraft/level/tile/CactusTile.java @@ -20,7 +20,11 @@ public class CactusTile extends Tile { protected CactusTile(String name) { super(name, sprite); - connectsToSand = true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; } public boolean mayPass(Level level, int x, int y, Entity e) { diff --git a/src/client/java/minicraft/level/tile/CloudTile.java b/src/client/java/minicraft/level/tile/CloudTile.java index 6503df7c1..f9326ebfe 100644 --- a/src/client/java/minicraft/level/tile/CloudTile.java +++ b/src/client/java/minicraft/level/tile/CloudTile.java @@ -15,7 +15,7 @@ public class CloudTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "cloud") - .setConnectChecker((tile, side) -> tile.getClass() != InfiniteFallTile.class) + .setConnectionChecker((level, x, y, tile, side) -> !(tile instanceof InfiniteFallTile)) .setSingletonWithConnective(true); protected CloudTile(String name) { diff --git a/src/client/java/minicraft/level/tile/ExplodedTile.java b/src/client/java/minicraft/level/tile/ExplodedTile.java index af333f481..b79123d94 100644 --- a/src/client/java/minicraft/level/tile/ExplodedTile.java +++ b/src/client/java/minicraft/level/tile/ExplodedTile.java @@ -8,12 +8,20 @@ /// This class is for tiles WHILE THEY ARE EXPLODING public class ExplodedTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "exploded") - .setConnectChecker((tile, side) -> tile.getClass() == ExplodedTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof ExplodedTile); protected ExplodedTile(String name) { super(name, sprite); - connectsToSand = true; - connectsToFluid = true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; } public boolean mayPass(Level level, int x, int y, Entity e) { diff --git a/src/client/java/minicraft/level/tile/FlowerTile.java b/src/client/java/minicraft/level/tile/FlowerTile.java index df085249b..88a88a41d 100644 --- a/src/client/java/minicraft/level/tile/FlowerTile.java +++ b/src/client/java/minicraft/level/tile/FlowerTile.java @@ -20,10 +20,14 @@ public class FlowerTile extends Tile { protected FlowerTile(String name) { super(name, null); - connectsToGrass = true; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; + } + public boolean tick(Level level, int xt, int yt) { // TODO revise this method. if (random.nextInt(30) != 0) return false; // Skips every 31 tick. diff --git a/src/client/java/minicraft/level/tile/GrassTile.java b/src/client/java/minicraft/level/tile/GrassTile.java index 3012a9daf..05e728760 100644 --- a/src/client/java/minicraft/level/tile/GrassTile.java +++ b/src/client/java/minicraft/level/tile/GrassTile.java @@ -15,15 +15,19 @@ public class GrassTile extends Tile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") - .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) + .setConnectionChecker((level, x, y, tile, side) -> !side || tile.connectsToGrass(level, x, y)) .setSingletonWithConnective(true); protected GrassTile(String name) { super(name, sprite); - connectsToGrass = true; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; + } + public boolean tick(Level level, int xt, int yt) { // TODO revise this method. if (random.nextInt(40) != 0) return false; diff --git a/src/client/java/minicraft/level/tile/HardRockTile.java b/src/client/java/minicraft/level/tile/HardRockTile.java index c8d4b2137..bfc8c37af 100644 --- a/src/client/java/minicraft/level/tile/HardRockTile.java +++ b/src/client/java/minicraft/level/tile/HardRockTile.java @@ -22,7 +22,7 @@ public class HardRockTile extends Tile { // Theoretically the full sprite should never be used, so we can use a placeholder private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "hardrock") - .setConnectChecker((tile, side) -> tile.getClass() == HardRockTile.class) + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof HardRockTile) .setSingletonWithConnective(true); protected HardRockTile(String name) { diff --git a/src/client/java/minicraft/level/tile/HoleTile.java b/src/client/java/minicraft/level/tile/HoleTile.java index c3b89f59c..a55474fd9 100644 --- a/src/client/java/minicraft/level/tile/HoleTile.java +++ b/src/client/java/minicraft/level/tile/HoleTile.java @@ -8,13 +8,21 @@ public class HoleTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "hole") - .setConnectChecker((tile, side) -> tile.connectsToLiquid()) + .setConnectionChecker((level, x, y, tile, side) -> tile.connectsToFluid(level, x, y)) .setSingletonWithConnective(true); protected HoleTile(String name) { super(name, sprite); - connectsToSand = true; - connectsToFluid = true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; } @Override diff --git a/src/client/java/minicraft/level/tile/LavaTile.java b/src/client/java/minicraft/level/tile/LavaTile.java index 6edf5716e..7ab019118 100644 --- a/src/client/java/minicraft/level/tile/LavaTile.java +++ b/src/client/java/minicraft/level/tile/LavaTile.java @@ -8,13 +8,21 @@ public class LavaTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "lava") - .setConnectChecker((tile, side) -> tile.connectsToFluid) + .setConnectionChecker((level, x, y, tile, side) -> tile.connectsToFluid(level, x, y)) .setSingletonWithConnective(true); protected LavaTile(String name) { super(name, sprite); - connectsToSand = true; - connectsToFluid = true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; } @Override diff --git a/src/client/java/minicraft/level/tile/PathTile.java b/src/client/java/minicraft/level/tile/PathTile.java index a216813f6..e05d9bffa 100644 --- a/src/client/java/minicraft/level/tile/PathTile.java +++ b/src/client/java/minicraft/level/tile/PathTile.java @@ -17,10 +17,14 @@ public class PathTile extends Tile { public PathTile(String name) { super(name, sprite); - connectsToGrass = true; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; + } + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; diff --git a/src/client/java/minicraft/level/tile/RockTile.java b/src/client/java/minicraft/level/tile/RockTile.java index ee78ced54..fe1dc6a6b 100644 --- a/src/client/java/minicraft/level/tile/RockTile.java +++ b/src/client/java/minicraft/level/tile/RockTile.java @@ -24,7 +24,7 @@ public class RockTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "rock") - .setConnectChecker((tile, side) -> tile.getClass() == RockTile.class) + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof RockTile) .setSingletonWithConnective(true); private boolean dropCoal = false; diff --git a/src/client/java/minicraft/level/tile/SandTile.java b/src/client/java/minicraft/level/tile/SandTile.java index c6f593188..02d1020d1 100644 --- a/src/client/java/minicraft/level/tile/SandTile.java +++ b/src/client/java/minicraft/level/tile/SandTile.java @@ -18,15 +18,19 @@ public class SandTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "sand") - .setConnectChecker((tile, side) -> !side || tile.connectsToSand) + .setConnectionChecker((level, x, y, tile, side) -> !side || tile.connectsToSand(level, x, y)) .setSingletonWithConnective(true); protected SandTile(String name) { super(name, sprite); - connectsToSand = true; maySpawn = true; } + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; + } + public void render(Screen screen, Level level, int x, int y) { Tiles.get("dirt").render(screen, level, x, y); sprite.render(screen, level, x, y); diff --git a/src/client/java/minicraft/level/tile/SaplingTile.java b/src/client/java/minicraft/level/tile/SaplingTile.java index e3f90849e..c871d2841 100644 --- a/src/client/java/minicraft/level/tile/SaplingTile.java +++ b/src/client/java/minicraft/level/tile/SaplingTile.java @@ -18,12 +18,24 @@ protected SaplingTile(String name, Tile onType, Tile growsTo) { super(name, sprite); this.onType = onType; this.growsTo = growsTo; - connectsToSand = onType.connectsToSand; - connectsToGrass = onType.connectsToGrass; - connectsToFluid = onType.connectsToFluid; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return onType.connectsToGrass(level, x, y); + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return onType.connectsToFluid(level, x, y); + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return onType.connectsToSand(level, x, y); + } + public void render(Screen screen, Level level, int x, int y) { onType.render(screen, level, x, y); sprite.render(screen, level, x, y); diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index 67cfafc0b..66f37e8e9 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -41,9 +41,6 @@ public ToolType getRequiredTool() { public short id; - public boolean connectsToGrass = false; - public boolean connectsToSand = false; - public boolean connectsToFluid = false; public int light = 1; protected boolean maySpawn = false; @@ -162,12 +159,14 @@ public boolean onExplode(Level level, int xt, int yt) { return false; } - /** - * Sees if the tile connects to a fluid. - */ - public boolean connectsToLiquid() { - return connectsToFluid; - } + /** Whether the tile connects to grass tile in appearance. */ + public boolean connectsToGrass(Level level, int x, int y) { return false; } + + /** Whether the tile connects to sand tile in appearance. */ + public boolean connectsToSand(Level level, int x, int y) { return false; } + + /** Whether the tile connects to fluid tile in appearance. */ + public boolean connectsToFluid(Level level, int x, int y) { return false; } /** * @deprecated This should be planned to be removed as this method is not ideally used. diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index ebe8c5b22..7269c6edf 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -35,9 +35,21 @@ public static TorchTile getTorchTile(Tile onTile) { private TorchTile(Tile onType) { super("Torch", new SpriteAnimation(SpriteType.Tile, "torch")); this.onType = onType; - this.connectsToSand = onType.connectsToSand; - this.connectsToGrass = onType.connectsToGrass; - this.connectsToFluid = onType.connectsToFluid; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return onType.connectsToSand(level, x, y); + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return onType.connectsToFluid(level, x, y); + } + + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return onType.connectsToGrass(level, x, y); } public void render(Screen screen, Level level, int x, int y) { diff --git a/src/client/java/minicraft/level/tile/TreeTile.java b/src/client/java/minicraft/level/tile/TreeTile.java index d9e68cf6d..b71ac28a2 100644 --- a/src/client/java/minicraft/level/tile/TreeTile.java +++ b/src/client/java/minicraft/level/tile/TreeTile.java @@ -57,7 +57,11 @@ public enum TreeType { protected TreeTile(String name) { super(name, null); - connectsToGrass = true; + } + + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; } @SuppressWarnings("PointlessArithmeticExpression") diff --git a/src/client/java/minicraft/level/tile/WallTile.java b/src/client/java/minicraft/level/tile/WallTile.java index 48222f1da..0a8f5a576 100644 --- a/src/client/java/minicraft/level/tile/WallTile.java +++ b/src/client/java/minicraft/level/tile/WallTile.java @@ -21,11 +21,11 @@ public class WallTile extends Tile { private static SpriteAnimation wood = new SpriteAnimation(SpriteType.Tile, "wood_wall") - .setConnectChecker((tile, side) -> tile.getClass() == WallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_wall") - .setConnectChecker((tile, side) -> tile.getClass() == WallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_wall") - .setConnectChecker((tile, side) -> tile.getClass() == WallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static final String obrickMsg = "minicraft.notification.defeat_air_wizard_first"; protected Material type; diff --git a/src/client/java/minicraft/level/tile/WaterTile.java b/src/client/java/minicraft/level/tile/WaterTile.java index a0bf4a553..cf99612e0 100644 --- a/src/client/java/minicraft/level/tile/WaterTile.java +++ b/src/client/java/minicraft/level/tile/WaterTile.java @@ -8,12 +8,16 @@ public class WaterTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "water") - .setConnectChecker((tile, side) -> tile.connectsToFluid) + .setConnectionChecker((level, x, y, tile, side) -> tile.connectsToFluid(level, x, y)) .setSingletonWithConnective(true); protected WaterTile(String name) { super(name, sprite); - connectsToFluid = true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; } @Override From d541c6d7ade75471cf49ebcf03abc49f58e9ea62 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 19:56:47 +0800 Subject: [PATCH 192/261] Remove usage of multiple torch tile instances --- src/client/java/minicraft/level/Level.java | 9 +---- .../java/minicraft/level/tile/Tiles.java | 12 +------ .../java/minicraft/level/tile/TorchTile.java | 33 ++++--------------- .../java/minicraft/saveload/LegacyLoad.java | 10 ++---- src/client/java/minicraft/saveload/Load.java | 25 +++++++++----- 5 files changed, 26 insertions(+), 63 deletions(-) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index d6edf722b..661e8f9ee 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -559,14 +559,7 @@ private void sortAndRender(Screen screen, List list) { public Tile getTile(int x, int y) { if (x < 0 || y < 0 || x >= w || y >= h /* || (x + y * w) >= tiles.length*/) return Tiles.get("connector tile"); - short id = tiles[x + y * w]; - Tile tile; - - if ((tile = Tiles.get(id)) == TorchTile.DELEGATE) { - return TorchTile.getTorchTile(Tiles.get((short) getData(x, y))); - } - - return tile; + return Tiles.get(tiles[x + y * w]); } /** diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index b0b49ea65..f643cdd09 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -80,7 +80,7 @@ public static void initTileList() { tiles.put((short) 51, new CarrotTile("Carrot")); tiles.put((short) 52, new HeavenlyBerriesTile("Heavenly Berries")); tiles.put((short) 53, new HellishBerriesTile("Hellish Berries")); - tiles.put((short) 54, TorchTile.DELEGATE); + tiles.put((short) 54, new TorchTile()); // WARNING: don't use this tile for anything! tiles.put((short) 255, new ConnectTile()); @@ -208,12 +208,6 @@ public static Tile get(String name) { Tile getting = null; - boolean isTorch = false; - if (name.startsWith("TORCH") && name.length() > 5) { - isTorch = true; - name = name.substring(6); // Cuts off torch prefix. - } - if (name.contains("_")) { name = name.substring(0, name.indexOf("_")); } @@ -231,10 +225,6 @@ public static Tile get(String name) { getting = tiles.get((short) 0); } - if (isTorch) { - getting = TorchTile.getTorchTile(getting); - } - overflowCheck = 0; return getting; } diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index 7269c6edf..17cb677aa 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -16,44 +16,27 @@ import java.util.HashMap; public class TorchTile extends Tile { - public static final TorchTile DELEGATE = new TorchTile(new ConnectTile()); // ConnectTile is used for placeholder. - - private static final HashMap instances = new HashMap<>(); - - private final Tile onType; - - /** @param onTile The tile identified by tile data. */ - public static TorchTile getTorchTile(Tile onTile) { - if (onTile instanceof TorchTile) return (TorchTile) onTile; - int id = onTile.id & 0xFFFF; - if (instances.containsKey(id)) return instances.get(id); - TorchTile tile = new TorchTile(onTile); - instances.put(id, tile); - return tile; - } - - private TorchTile(Tile onType) { + protected TorchTile() { super("Torch", new SpriteAnimation(SpriteType.Tile, "torch")); - this.onType = onType; } @Override public boolean connectsToSand(Level level, int x, int y) { - return onType.connectsToSand(level, x, y); + return Tiles.get((short) level.getData(x, y)).connectsToSand(level, x, y); } @Override public boolean connectsToFluid(Level level, int x, int y) { - return onType.connectsToFluid(level, x, y); + return Tiles.get((short) level.getData(x, y)).connectsToFluid(level, x, y); } @Override public boolean connectsToGrass(Level level, int x, int y) { - return onType.connectsToGrass(level, x, y); + return Tiles.get((short) level.getData(x, y)).connectsToGrass(level, x, y); } public void render(Screen screen, Level level, int x, int y) { - onType.render(screen, level, x, y); + Tiles.get((short) level.getData(x, y)).render(screen, level, x, y); sprite.render(screen, level, x, y); } @@ -61,14 +44,10 @@ public int getLightRadius(Level level, int x, int y) { return 5; } - public short getOnType() { - return onType.id; - } - public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { if (item instanceof PowerGloveItem) { int data = level.getData(xt, yt); - level.setTile(xt, yt, onType); + level.setTile(xt, yt, Tiles.get((short) data)); Sound.play("monsterhurt"); level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Torch")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( diff --git a/src/client/java/minicraft/saveload/LegacyLoad.java b/src/client/java/minicraft/saveload/LegacyLoad.java index 3bfc30524..44d697da7 100644 --- a/src/client/java/minicraft/saveload/LegacyLoad.java +++ b/src/client/java/minicraft/saveload/LegacyLoad.java @@ -233,14 +233,8 @@ public void loadWorld(String filename) { for (int y = 0; y < lvlh - 1; y++) { int tileArrIdx = y + x * lvlw; int tileidx = x + y * lvlw; // The tiles are saved with x outer loop, and y inner loop, meaning that the list reads down, then right one, rather than right, then down one. - Tile tile = Tiles.get(Tiles.oldids.get(Integer.parseInt(data.get(tileidx + 3)))); - if (tile instanceof TorchTile && tile != TorchTile.DELEGATE) { - tiles[tileArrIdx] = TorchTile.DELEGATE.id; - tdata[tileArrIdx] = ((TorchTile) tile).getOnType(); - } else { - tiles[tileArrIdx] = tile.id; - tdata[tileArrIdx] = Short.parseShort(extradata.get(tileidx)); - } + Load.loadTile(tiles, tdata, tileArrIdx, Tiles.oldids.get(Integer.parseInt(data.get(tileidx + 3))), + extradata.get(tileidx)); } } diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index bc627dae6..818a313c9 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -85,6 +85,8 @@ import java.util.Stack; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Predicate; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Load { @@ -667,15 +669,7 @@ private void loadWorld(String filename) { } } - - Tile tile = Tiles.get(tilename); - if (tile instanceof TorchTile && tile != TorchTile.DELEGATE) { - tiles[tileArrIdx] = TorchTile.DELEGATE.id; - tdata[tileArrIdx] = ((TorchTile) tile).getOnType(); - } else { - tiles[tileArrIdx] = tile.id; - tdata[tileArrIdx] = Short.parseShort(extradata.get(tileidx)); - } + loadTile(tiles, tdata, tileArrIdx, tilename, extradata.get(tileidx)); } } @@ -739,6 +733,19 @@ private void loadWorld(String filename) { } } + private static final Pattern OLD_TORCH_TILE_REGEX = Pattern.compile("TORCH ([\\w ]+)"); + + public static void loadTile(short[] tiles, short[] data, int idx, String tileName, String tileData) { + Matcher matcher; + if ((matcher = OLD_TORCH_TILE_REGEX.matcher(tileName.toUpperCase())).matches()) { + tiles[idx] = 54; // ID of TORCH tile + data[idx] = Tiles.get(matcher.group(1)).id; + } else { + tiles[idx] = Tiles.get(tileName).id; + data[idx] = Short.parseShort(tileData); + } + } + public void loadPlayer(String filename, Player player) { LoadingDisplay.setMessage("Player"); loadFromFile(location + filename + extension); From 85120af94e4506323e4281be83c93c4201618112 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 19:17:22 +0800 Subject: [PATCH 193/261] Convert Tile#connectsTo fields to methods --- src/client/java/minicraft/entity/Arrow.java | 2 +- .../java/minicraft/gfx/SpriteAnimation.java | 34 +++++++++++-------- .../minicraft/level/tile/BossWallTile.java | 2 +- .../java/minicraft/level/tile/CactusTile.java | 6 +++- .../java/minicraft/level/tile/CloudTile.java | 2 +- .../minicraft/level/tile/ExplodedTile.java | 14 ++++++-- .../java/minicraft/level/tile/FlowerTile.java | 6 +++- .../java/minicraft/level/tile/GrassTile.java | 8 +++-- .../minicraft/level/tile/HardRockTile.java | 2 +- .../java/minicraft/level/tile/HoleTile.java | 14 ++++++-- .../java/minicraft/level/tile/LavaTile.java | 14 ++++++-- .../java/minicraft/level/tile/PathTile.java | 6 +++- .../java/minicraft/level/tile/RockTile.java | 2 +- .../java/minicraft/level/tile/SandTile.java | 8 +++-- .../minicraft/level/tile/SaplingTile.java | 18 ++++++++-- .../java/minicraft/level/tile/Tile.java | 17 +++++----- .../java/minicraft/level/tile/TorchTile.java | 18 ++++++++-- .../java/minicraft/level/tile/TreeTile.java | 6 +++- .../java/minicraft/level/tile/WallTile.java | 6 ++-- .../java/minicraft/level/tile/WaterTile.java | 8 +++-- 20 files changed, 136 insertions(+), 57 deletions(-) diff --git a/src/client/java/minicraft/entity/Arrow.java b/src/client/java/minicraft/entity/Arrow.java index 19cb2a13b..099339c85 100644 --- a/src/client/java/minicraft/entity/Arrow.java +++ b/src/client/java/minicraft/entity/Arrow.java @@ -77,7 +77,7 @@ public void tick() { } if (!level.getTile(x / 16, y / 16).mayPass(level, x / 16, y / 16, this) - && !level.getTile(x / 16, y / 16).connectsToFluid + && !level.getTile(x / 16, y / 16).connectsToFluid(level, x / 16, y / 16) && level.getTile(x / 16, y / 16).id != 16) { this.remove(); try { diff --git a/src/client/java/minicraft/gfx/SpriteAnimation.java b/src/client/java/minicraft/gfx/SpriteAnimation.java index caeea0fdc..57abe3ea5 100644 --- a/src/client/java/minicraft/gfx/SpriteAnimation.java +++ b/src/client/java/minicraft/gfx/SpriteAnimation.java @@ -15,7 +15,6 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.function.BiFunction; /** * This is not applicable for mob sprite animations. Only for generic sprite animations. @@ -54,7 +53,7 @@ public static void refreshAnimations() { // Border settings. private LinkedSprite border = null; private LinkedSprite corner = null; - private BiFunction connectChecker; + private TileConnectionChecker connectionChecker; private boolean singletonWithConnective = false; // Refreshing only data. @@ -86,14 +85,19 @@ public SpriteAnimation(SpriteMeta meta, SpriteType type, String key) { spriteAnimations.add(this); } + @FunctionalInterface + public interface TileConnectionChecker { + boolean check(Level level, int x, int y, Tile tile, boolean side); + } + /** * Setting the tile class of this animation used for tile connector rendering. * - * @param connectChecker The tile connection checker. + * @param connectionChecker The tile connection checker. * @return The instance itself. */ - public SpriteAnimation setConnectChecker(BiFunction connectChecker) { - this.connectChecker = connectChecker; + public SpriteAnimation setConnectionChecker(TileConnectionChecker connectionChecker) { + this.connectionChecker = connectionChecker; return this; } @@ -206,16 +210,16 @@ public LinkedSprite getFrame(int frame) { */ public void render(Screen screen, Level level, int x, int y) { // If border and the tile class is set. - if (connectChecker != null && (border != null || corner != null)) { - boolean u = connectChecker.apply(level.getTile(x, y - 1), true); - boolean d = connectChecker.apply(level.getTile(x, y + 1), true); - boolean l = connectChecker.apply(level.getTile(x - 1, y), true); - boolean r = connectChecker.apply(level.getTile(x + 1, y), true); - - boolean ul = connectChecker.apply(level.getTile(x - 1, y - 1), false); - boolean dl = connectChecker.apply(level.getTile(x - 1, y + 1), false); - boolean ur = connectChecker.apply(level.getTile(x + 1, y - 1), false); - boolean dr = connectChecker.apply(level.getTile(x + 1, y + 1), false); + if (connectionChecker != null && (border != null || corner != null)) { + boolean u = connectionChecker.check(level, x, y, level.getTile(x, y - 1), true); + boolean d = connectionChecker.check(level, x, y, level.getTile(x, y + 1), true); + boolean l = connectionChecker.check(level, x, y, level.getTile(x - 1, y), true); + boolean r = connectionChecker.check(level, x, y, level.getTile(x + 1, y), true); + + boolean ul = connectionChecker.check(level, x, y, level.getTile(x - 1, y - 1), false); + boolean dl = connectionChecker.check(level, x, y, level.getTile(x - 1, y + 1), false); + boolean ur = connectionChecker.check(level, x, y, level.getTile(x + 1, y - 1), false); + boolean dr = connectionChecker.check(level, x, y, level.getTile(x + 1, y + 1), false); x = x << 4; y = y << 4; diff --git a/src/client/java/minicraft/level/tile/BossWallTile.java b/src/client/java/minicraft/level/tile/BossWallTile.java index 12d1ea05f..54c2d7f82 100644 --- a/src/client/java/minicraft/level/tile/BossWallTile.java +++ b/src/client/java/minicraft/level/tile/BossWallTile.java @@ -14,7 +14,7 @@ public class BossWallTile extends WallTile { private static SpriteAnimation obsidian = new SpriteAnimation(SpriteLinker.SpriteType.Tile, "obsidian_wall") - .setConnectChecker((tile, side) -> tile.getClass() == BossWallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static final String wallMsg = "minicraft.notification.defeat_obsidian_knight_first"; diff --git a/src/client/java/minicraft/level/tile/CactusTile.java b/src/client/java/minicraft/level/tile/CactusTile.java index 8dceb499f..41f42c2c5 100644 --- a/src/client/java/minicraft/level/tile/CactusTile.java +++ b/src/client/java/minicraft/level/tile/CactusTile.java @@ -20,7 +20,11 @@ public class CactusTile extends Tile { protected CactusTile(String name) { super(name, sprite); - connectsToSand = true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; } public boolean mayPass(Level level, int x, int y, Entity e) { diff --git a/src/client/java/minicraft/level/tile/CloudTile.java b/src/client/java/minicraft/level/tile/CloudTile.java index 6503df7c1..f9326ebfe 100644 --- a/src/client/java/minicraft/level/tile/CloudTile.java +++ b/src/client/java/minicraft/level/tile/CloudTile.java @@ -15,7 +15,7 @@ public class CloudTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "cloud") - .setConnectChecker((tile, side) -> tile.getClass() != InfiniteFallTile.class) + .setConnectionChecker((level, x, y, tile, side) -> !(tile instanceof InfiniteFallTile)) .setSingletonWithConnective(true); protected CloudTile(String name) { diff --git a/src/client/java/minicraft/level/tile/ExplodedTile.java b/src/client/java/minicraft/level/tile/ExplodedTile.java index af333f481..b79123d94 100644 --- a/src/client/java/minicraft/level/tile/ExplodedTile.java +++ b/src/client/java/minicraft/level/tile/ExplodedTile.java @@ -8,12 +8,20 @@ /// This class is for tiles WHILE THEY ARE EXPLODING public class ExplodedTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "exploded") - .setConnectChecker((tile, side) -> tile.getClass() == ExplodedTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof ExplodedTile); protected ExplodedTile(String name) { super(name, sprite); - connectsToSand = true; - connectsToFluid = true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; } public boolean mayPass(Level level, int x, int y, Entity e) { diff --git a/src/client/java/minicraft/level/tile/FlowerTile.java b/src/client/java/minicraft/level/tile/FlowerTile.java index df085249b..88a88a41d 100644 --- a/src/client/java/minicraft/level/tile/FlowerTile.java +++ b/src/client/java/minicraft/level/tile/FlowerTile.java @@ -20,10 +20,14 @@ public class FlowerTile extends Tile { protected FlowerTile(String name) { super(name, null); - connectsToGrass = true; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; + } + public boolean tick(Level level, int xt, int yt) { // TODO revise this method. if (random.nextInt(30) != 0) return false; // Skips every 31 tick. diff --git a/src/client/java/minicraft/level/tile/GrassTile.java b/src/client/java/minicraft/level/tile/GrassTile.java index 3012a9daf..05e728760 100644 --- a/src/client/java/minicraft/level/tile/GrassTile.java +++ b/src/client/java/minicraft/level/tile/GrassTile.java @@ -15,15 +15,19 @@ public class GrassTile extends Tile { private static final SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "grass") - .setConnectChecker((tile, side) -> !side || tile.connectsToGrass) + .setConnectionChecker((level, x, y, tile, side) -> !side || tile.connectsToGrass(level, x, y)) .setSingletonWithConnective(true); protected GrassTile(String name) { super(name, sprite); - connectsToGrass = true; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; + } + public boolean tick(Level level, int xt, int yt) { // TODO revise this method. if (random.nextInt(40) != 0) return false; diff --git a/src/client/java/minicraft/level/tile/HardRockTile.java b/src/client/java/minicraft/level/tile/HardRockTile.java index c8d4b2137..bfc8c37af 100644 --- a/src/client/java/minicraft/level/tile/HardRockTile.java +++ b/src/client/java/minicraft/level/tile/HardRockTile.java @@ -22,7 +22,7 @@ public class HardRockTile extends Tile { // Theoretically the full sprite should never be used, so we can use a placeholder private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "hardrock") - .setConnectChecker((tile, side) -> tile.getClass() == HardRockTile.class) + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof HardRockTile) .setSingletonWithConnective(true); protected HardRockTile(String name) { diff --git a/src/client/java/minicraft/level/tile/HoleTile.java b/src/client/java/minicraft/level/tile/HoleTile.java index c3b89f59c..a55474fd9 100644 --- a/src/client/java/minicraft/level/tile/HoleTile.java +++ b/src/client/java/minicraft/level/tile/HoleTile.java @@ -8,13 +8,21 @@ public class HoleTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "hole") - .setConnectChecker((tile, side) -> tile.connectsToLiquid()) + .setConnectionChecker((level, x, y, tile, side) -> tile.connectsToFluid(level, x, y)) .setSingletonWithConnective(true); protected HoleTile(String name) { super(name, sprite); - connectsToSand = true; - connectsToFluid = true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; } @Override diff --git a/src/client/java/minicraft/level/tile/LavaTile.java b/src/client/java/minicraft/level/tile/LavaTile.java index 6edf5716e..7ab019118 100644 --- a/src/client/java/minicraft/level/tile/LavaTile.java +++ b/src/client/java/minicraft/level/tile/LavaTile.java @@ -8,13 +8,21 @@ public class LavaTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "lava") - .setConnectChecker((tile, side) -> tile.connectsToFluid) + .setConnectionChecker((level, x, y, tile, side) -> tile.connectsToFluid(level, x, y)) .setSingletonWithConnective(true); protected LavaTile(String name) { super(name, sprite); - connectsToSand = true; - connectsToFluid = true; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; } @Override diff --git a/src/client/java/minicraft/level/tile/PathTile.java b/src/client/java/minicraft/level/tile/PathTile.java index a216813f6..e05d9bffa 100644 --- a/src/client/java/minicraft/level/tile/PathTile.java +++ b/src/client/java/minicraft/level/tile/PathTile.java @@ -17,10 +17,14 @@ public class PathTile extends Tile { public PathTile(String name) { super(name, sprite); - connectsToGrass = true; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; + } + public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; diff --git a/src/client/java/minicraft/level/tile/RockTile.java b/src/client/java/minicraft/level/tile/RockTile.java index ee78ced54..fe1dc6a6b 100644 --- a/src/client/java/minicraft/level/tile/RockTile.java +++ b/src/client/java/minicraft/level/tile/RockTile.java @@ -24,7 +24,7 @@ public class RockTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "rock") - .setConnectChecker((tile, side) -> tile.getClass() == RockTile.class) + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof RockTile) .setSingletonWithConnective(true); private boolean dropCoal = false; diff --git a/src/client/java/minicraft/level/tile/SandTile.java b/src/client/java/minicraft/level/tile/SandTile.java index c6f593188..02d1020d1 100644 --- a/src/client/java/minicraft/level/tile/SandTile.java +++ b/src/client/java/minicraft/level/tile/SandTile.java @@ -18,15 +18,19 @@ public class SandTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "sand") - .setConnectChecker((tile, side) -> !side || tile.connectsToSand) + .setConnectionChecker((level, x, y, tile, side) -> !side || tile.connectsToSand(level, x, y)) .setSingletonWithConnective(true); protected SandTile(String name) { super(name, sprite); - connectsToSand = true; maySpawn = true; } + @Override + public boolean connectsToSand(Level level, int x, int y) { + return true; + } + public void render(Screen screen, Level level, int x, int y) { Tiles.get("dirt").render(screen, level, x, y); sprite.render(screen, level, x, y); diff --git a/src/client/java/minicraft/level/tile/SaplingTile.java b/src/client/java/minicraft/level/tile/SaplingTile.java index e3f90849e..c871d2841 100644 --- a/src/client/java/minicraft/level/tile/SaplingTile.java +++ b/src/client/java/minicraft/level/tile/SaplingTile.java @@ -18,12 +18,24 @@ protected SaplingTile(String name, Tile onType, Tile growsTo) { super(name, sprite); this.onType = onType; this.growsTo = growsTo; - connectsToSand = onType.connectsToSand; - connectsToGrass = onType.connectsToGrass; - connectsToFluid = onType.connectsToFluid; maySpawn = true; } + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return onType.connectsToGrass(level, x, y); + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return onType.connectsToFluid(level, x, y); + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return onType.connectsToSand(level, x, y); + } + public void render(Screen screen, Level level, int x, int y) { onType.render(screen, level, x, y); sprite.render(screen, level, x, y); diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index a13979448..8138e4696 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -41,9 +41,6 @@ public ToolType getRequiredTool() { public short id; - public boolean connectsToGrass = false; - public boolean connectsToSand = false; - public boolean connectsToFluid = false; public int light = 1; protected boolean maySpawn = false; @@ -162,12 +159,14 @@ public boolean onExplode(Level level, int xt, int yt) { return false; } - /** - * Sees if the tile connects to a fluid. - */ - public boolean connectsToLiquid() { - return connectsToFluid; - } + /** Whether the tile connects to grass tile in appearance. */ + public boolean connectsToGrass(Level level, int x, int y) { return false; } + + /** Whether the tile connects to sand tile in appearance. */ + public boolean connectsToSand(Level level, int x, int y) { return false; } + + /** Whether the tile connects to fluid tile in appearance. */ + public boolean connectsToFluid(Level level, int x, int y) { return false; } public int getData(String data) { try { diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index bb8dbd840..8db454c54 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -33,9 +33,21 @@ public static TorchTile getTorchTile(Tile onTile) { private TorchTile(Tile onType) { super("Torch " + onType.name, new SpriteAnimation(SpriteType.Tile, "torch")); this.onType = onType; - this.connectsToSand = onType.connectsToSand; - this.connectsToGrass = onType.connectsToGrass; - this.connectsToFluid = onType.connectsToFluid; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return onType.connectsToSand(level, x, y); + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return onType.connectsToFluid(level, x, y); + } + + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return onType.connectsToGrass(level, x, y); } public void render(Screen screen, Level level, int x, int y) { diff --git a/src/client/java/minicraft/level/tile/TreeTile.java b/src/client/java/minicraft/level/tile/TreeTile.java index d9e68cf6d..b71ac28a2 100644 --- a/src/client/java/minicraft/level/tile/TreeTile.java +++ b/src/client/java/minicraft/level/tile/TreeTile.java @@ -57,7 +57,11 @@ public enum TreeType { protected TreeTile(String name) { super(name, null); - connectsToGrass = true; + } + + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return true; } @SuppressWarnings("PointlessArithmeticExpression") diff --git a/src/client/java/minicraft/level/tile/WallTile.java b/src/client/java/minicraft/level/tile/WallTile.java index 48222f1da..0a8f5a576 100644 --- a/src/client/java/minicraft/level/tile/WallTile.java +++ b/src/client/java/minicraft/level/tile/WallTile.java @@ -21,11 +21,11 @@ public class WallTile extends Tile { private static SpriteAnimation wood = new SpriteAnimation(SpriteType.Tile, "wood_wall") - .setConnectChecker((tile, side) -> tile.getClass() == WallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static SpriteAnimation stone = new SpriteAnimation(SpriteType.Tile, "stone_wall") - .setConnectChecker((tile, side) -> tile.getClass() == WallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static SpriteAnimation obsidian = new SpriteAnimation(SpriteType.Tile, "obsidian_wall") - .setConnectChecker((tile, side) -> tile.getClass() == WallTile.class); + .setConnectionChecker((level, x, y, tile, side) -> tile instanceof WallTile); private static final String obrickMsg = "minicraft.notification.defeat_air_wizard_first"; protected Material type; diff --git a/src/client/java/minicraft/level/tile/WaterTile.java b/src/client/java/minicraft/level/tile/WaterTile.java index a0bf4a553..cf99612e0 100644 --- a/src/client/java/minicraft/level/tile/WaterTile.java +++ b/src/client/java/minicraft/level/tile/WaterTile.java @@ -8,12 +8,16 @@ public class WaterTile extends Tile { private static SpriteAnimation sprite = new SpriteAnimation(SpriteType.Tile, "water") - .setConnectChecker((tile, side) -> tile.connectsToFluid) + .setConnectionChecker((level, x, y, tile, side) -> tile.connectsToFluid(level, x, y)) .setSingletonWithConnective(true); protected WaterTile(String name) { super(name, sprite); - connectsToFluid = true; + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return true; } @Override From 0549237cdbd1b08314447b2857660f63fc7732d9 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 20:40:42 +0800 Subject: [PATCH 194/261] Fix updated connect checker position problem --- .../java/minicraft/gfx/SpriteAnimation.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/java/minicraft/gfx/SpriteAnimation.java b/src/client/java/minicraft/gfx/SpriteAnimation.java index 57abe3ea5..b3e75d7e0 100644 --- a/src/client/java/minicraft/gfx/SpriteAnimation.java +++ b/src/client/java/minicraft/gfx/SpriteAnimation.java @@ -211,15 +211,15 @@ public LinkedSprite getFrame(int frame) { public void render(Screen screen, Level level, int x, int y) { // If border and the tile class is set. if (connectionChecker != null && (border != null || corner != null)) { - boolean u = connectionChecker.check(level, x, y, level.getTile(x, y - 1), true); - boolean d = connectionChecker.check(level, x, y, level.getTile(x, y + 1), true); - boolean l = connectionChecker.check(level, x, y, level.getTile(x - 1, y), true); - boolean r = connectionChecker.check(level, x, y, level.getTile(x + 1, y), true); - - boolean ul = connectionChecker.check(level, x, y, level.getTile(x - 1, y - 1), false); - boolean dl = connectionChecker.check(level, x, y, level.getTile(x - 1, y + 1), false); - boolean ur = connectionChecker.check(level, x, y, level.getTile(x + 1, y - 1), false); - boolean dr = connectionChecker.check(level, x, y, level.getTile(x + 1, y + 1), false); + boolean u = connectionChecker.check(level, x, y - 1, level.getTile(x, y - 1), true); + boolean d = connectionChecker.check(level, x, y + 1, level.getTile(x, y + 1), true); + boolean l = connectionChecker.check(level, x - 1, y, level.getTile(x - 1, y), true); + boolean r = connectionChecker.check(level, x + 1, y, level.getTile(x + 1, y), true); + + boolean ul = connectionChecker.check(level, x - 1, y - 1, level.getTile(x - 1, y - 1), false); + boolean dl = connectionChecker.check(level, x - 1, y + 1, level.getTile(x - 1, y + 1), false); + boolean ur = connectionChecker.check(level, x + 1, y - 1, level.getTile(x + 1, y - 1), false); + boolean dr = connectionChecker.check(level, x + 1, y + 1, level.getTile(x + 1, y + 1), false); x = x << 4; y = y << 4; From cb7884ed23dc400d69ecb05f43291c66c56f6776 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 20:40:42 +0800 Subject: [PATCH 195/261] Fix updated connect checker position problem --- .../java/minicraft/gfx/SpriteAnimation.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/java/minicraft/gfx/SpriteAnimation.java b/src/client/java/minicraft/gfx/SpriteAnimation.java index 57abe3ea5..b3e75d7e0 100644 --- a/src/client/java/minicraft/gfx/SpriteAnimation.java +++ b/src/client/java/minicraft/gfx/SpriteAnimation.java @@ -211,15 +211,15 @@ public LinkedSprite getFrame(int frame) { public void render(Screen screen, Level level, int x, int y) { // If border and the tile class is set. if (connectionChecker != null && (border != null || corner != null)) { - boolean u = connectionChecker.check(level, x, y, level.getTile(x, y - 1), true); - boolean d = connectionChecker.check(level, x, y, level.getTile(x, y + 1), true); - boolean l = connectionChecker.check(level, x, y, level.getTile(x - 1, y), true); - boolean r = connectionChecker.check(level, x, y, level.getTile(x + 1, y), true); - - boolean ul = connectionChecker.check(level, x, y, level.getTile(x - 1, y - 1), false); - boolean dl = connectionChecker.check(level, x, y, level.getTile(x - 1, y + 1), false); - boolean ur = connectionChecker.check(level, x, y, level.getTile(x + 1, y - 1), false); - boolean dr = connectionChecker.check(level, x, y, level.getTile(x + 1, y + 1), false); + boolean u = connectionChecker.check(level, x, y - 1, level.getTile(x, y - 1), true); + boolean d = connectionChecker.check(level, x, y + 1, level.getTile(x, y + 1), true); + boolean l = connectionChecker.check(level, x - 1, y, level.getTile(x - 1, y), true); + boolean r = connectionChecker.check(level, x + 1, y, level.getTile(x + 1, y), true); + + boolean ul = connectionChecker.check(level, x - 1, y - 1, level.getTile(x - 1, y - 1), false); + boolean dl = connectionChecker.check(level, x - 1, y + 1, level.getTile(x - 1, y + 1), false); + boolean ur = connectionChecker.check(level, x + 1, y - 1, level.getTile(x + 1, y - 1), false); + boolean dr = connectionChecker.check(level, x + 1, y + 1, level.getTile(x + 1, y + 1), false); x = x << 4; y = y << 4; From 3a80ecedbc03600c5aee75a9f443badc7fc3f6c9 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 16 Feb 2024 20:43:13 +0800 Subject: [PATCH 196/261] Update FenceTile by change from connect checker --- .../java/minicraft/level/tile/FenceTile.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index 2368aa4aa..f937c5837 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -55,11 +55,27 @@ protected FenceTile(Material type, String name) { right = new SpriteAnimation(SpriteType.Tile, type.toString().toLowerCase() + "_fence_right"); } + @Override + public boolean connectsToSand(Level level, int x, int y) { + return Tiles.get((short) level.getData(x, y)).connectsToSand(level, x, y); + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return Tiles.get((short) level.getData(x, y)).connectsToFluid(level, x, y); + } + + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return Tiles.get((short) level.getData(x, y)).connectsToGrass(level, x, y); + } + public void updateConnections(Level level, int x, int y) { - connectUp = level.getTile(x, y - 1).name.equals(name); - connectDown = level.getTile(x, y + 1).name.equals(name); - connectLeft = level.getTile(x - 1, y).name.equals(name); - connectRight = level.getTile(x + 1, y).name.equals(name); + // TODO Tile#updateNeighbourhood + connectUp = level.getTile(x, y - 1) instanceof FenceTile; + connectDown = level.getTile(x, y + 1) instanceof FenceTile; + connectLeft = level.getTile(x - 1, y) instanceof FenceTile; + connectRight = level.getTile(x + 1, y) instanceof FenceTile; } public boolean mayPass(Level level, int x, int y, Entity e) { From 5e3c082313ae8154744d48800a6140f06a1c9e2f Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:02:47 -0500 Subject: [PATCH 197/261] Revert some reverts --- .../resources/assets/textures/item/chest.png | Bin 155 -> 156 bytes .../assets/textures/item/dungeon_chest.png | Bin 155 -> 157 bytes .../assets/textures/item/gunpowder.png | Bin 136 -> 156 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/item/chest.png b/src/client/resources/assets/textures/item/chest.png index 54afe57073740ba1add99970f4a9b13068482a5e..7bc6f56d47bf906f338ae17fa63720b104a04b9a 100644 GIT binary patch delta 81 zcmbQuIEQh9A!FD?BURTz&tE@0jB;*%l3B!XH$y<))zPQN>&@Qqc^yg|jWi=oNRcpum4R5k`6@O1TaS?83{1OVxU9Nqu` delta 80 zcmbQkIGb^TA!F!7BUKm2NmW%<8k45$#U?RyHfC&KDp~AUBf@IHw~3{VDJ9ro&4FiZ k6WBKB7wlwI;S6G7NEI{Q_o`^a76u^jboFyt=akR{08eon2mk;8 diff --git a/src/client/resources/assets/textures/item/dungeon_chest.png b/src/client/resources/assets/textures/item/dungeon_chest.png index cdcf2e39f65f7e40f7d39f642f21448ffa4d1d82..e0505054ab1c4fcf425f3fc6764f7eb16f1fd6ab 100644 GIT binary patch delta 115 zcmV-(0F3{e0i6MmF>F^!L_t(2Q)6U+0zN*Q|1dU;{`BbxBO{0dlJxUiiz2^iQ!tp% zh)YsRs+{53vrdQtbfZCh6a`93tqk|>RfE;R*cb|sO#vw;r~sq^>6*yL_t(2Q-zPg4FFLDM8B?_)uB9fIIBb(yBP`blTFqM^DyZA z1Z|y}AJh>s{YfCIYVl?^Pyt&+?d~Tt3!)a$6p_mjHVx2|8!F)I#P)HS-23~J7gqo; US4mIzxc~qF07*qoM6N<$f}H6u@c;k- delta 94 zcmV-k0HOb!0f+&RF;_xKL_t(2Q)6Tx02q977B} Date: Fri, 16 Feb 2024 12:06:55 -0500 Subject: [PATCH 198/261] Revert flower revert Flower power --- .../assets/textures/item/white_flower.png | Bin 147 -> 147 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/item/white_flower.png b/src/client/resources/assets/textures/item/white_flower.png index cbd25d621ba3db8673ab23ff0621d2fa8744d5c7..b865d1e3af666f8f7369b89d86482b88fdda2428 100644 GIT binary patch delta 91 zcmV-h0Hptu0h0lcKU5z*dh{Q}my?r&ixZ~+rgP=WRIq{J;j_Us$Rw}{1QqPxzaMP3 xva&K*=iR$^!L*~JBg6z4Am~V#Ng$mtO#ll^B?(KC@T>p;002ovPDHLkV1lMTC%XUu delta 91 zcmV-h0Hptu0h0lcKU5DLI`kjJx3jZ@ixZ~+rt{> Date: Sat, 17 Feb 2024 02:06:26 +0800 Subject: [PATCH 199/261] Simplify Inventory#add --- .../entity/furniture/DeathChest.java | 6 +- .../java/minicraft/entity/mob/Player.java | 77 +++++++++---------- .../java/minicraft/item/BucketItem.java | 4 +- src/client/java/minicraft/item/Inventory.java | 68 +++++++--------- src/client/java/minicraft/item/Recipe.java | 2 +- .../java/minicraft/saveload/LegacyLoad.java | 6 +- src/client/java/minicraft/saveload/Load.java | 8 +- .../minicraft/screen/ContainerDisplay.java | 24 +++--- .../java/minicraft/screen/InventoryMenu.java | 17 +++- .../minicraft/screen/PlayerInvDisplay.java | 34 ++++---- 10 files changed, 113 insertions(+), 133 deletions(-) diff --git a/src/client/java/minicraft/entity/furniture/DeathChest.java b/src/client/java/minicraft/entity/furniture/DeathChest.java index d9528da25..c80f3d89a 100644 --- a/src/client/java/minicraft/entity/furniture/DeathChest.java +++ b/src/client/java/minicraft/entity/furniture/DeathChest.java @@ -103,11 +103,7 @@ public void touchedBy(Entity other) { if (other instanceof Player) { Inventory playerInv = ((Player) other).getInventory(); for (Item i : inventory.getItems()) { - int total = 1; - if (i instanceof StackableItem) total = ((StackableItem) i).count; - - int returned = playerInv.add(i); - if (returned < total) { + if (playerInv.add(i) != null) { Game.notifications.add("Your inventory is full!"); return; } diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index b9a74e976..4735058f6 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -167,8 +167,8 @@ public Item remove(int idx) { } @Override - public int add(int slot, Item item) { - int res = super.add(slot, item); + public @Nullable Item add(Item item) { + Item res = super.add(item); triggerTrigger(); return res; } @@ -518,15 +518,7 @@ public void tick() { } if (input.inputPressed("menu") && activeItem != null) { - int returned = inventory.add(0, activeItem); - if (activeItem instanceof StackableItem) { - StackableItem stackable = (StackableItem) activeItem; - if (stackable.count > 0) { - getLevel().dropItem(x, y, stackable.copy()); - } - } else if (returned <= 0) { - getLevel().dropItem(x, y, activeItem); - } + tryAddToInvOrDrop(activeItem); activeItem = null; if (isFishing) { @@ -585,14 +577,7 @@ public void tick() { public void resolveHeldItem() { if (!(activeItem instanceof PowerGloveItem)) { // If you are now holding something other than a power glove... if (prevItem != null) { // and you had a previous item that we should care about... - int returned = inventory.add(0, prevItem); // Then add that previous item to your inventory so it isn't lost. - if (prevItem instanceof StackableItem) { - if (((StackableItem) prevItem).count > 0) { - getLevel().dropItem(x, y, prevItem.copy()); - } - } else if (returned == 0) { - getLevel().dropItem(x, y, prevItem); - } + tryAddToInvOrDrop(prevItem); // Then add that previous item to your inventory so it isn't lost. } // If something other than a power glove is being held, but the previous item is null, then nothing happens; nothing added to inventory, and current item remains as the new one. } else activeItem = prevItem; // Otherwise, if you're holding a power glove, then the held item didn't change, so we can remove the power glove and make it what it was before. @@ -998,24 +983,41 @@ public void render(Screen screen) { } } - /** - * What happens when the player interacts with a itemEntity - */ + /** What happens when the player interacts with a itemEntity */ public void pickupItem(ItemEntity itemEntity) { - int picked = 0; - int total = 1; + boolean successful = false; // If there is any item successfully added to the player + boolean remove = false; // Whether to remove the item entity (when empty) if (itemEntity.item instanceof StackableItem && ((StackableItem) itemEntity.item).stacksWith(activeItem)) { // Picked up item equals the one in your hand - ((StackableItem) activeItem).count += ((StackableItem) itemEntity.item).count; - picked = ((StackableItem) itemEntity.item).count; - } else { - if (itemEntity.item instanceof StackableItem) total = ((StackableItem) itemEntity.item).count; - picked = inventory.add(itemEntity.item); // Add item to inventory + int toAdd = Math.min(((StackableItem) activeItem).count + ((StackableItem) itemEntity.item).count, ((StackableItem) activeItem).maxCount) + - ((StackableItem) activeItem).count; + if (toAdd > 0) { + ((StackableItem) activeItem).count += toAdd; + ((StackableItem) itemEntity.item).count -= toAdd; + successful = true; + } + if (((StackableItem) itemEntity.item).count == 0) { // Empty + remove = true; // Remove the item entity + } } - if (picked == total) { - Sound.play("pickup"); + if (!(itemEntity.item instanceof StackableItem && ((StackableItem) itemEntity.item).count == 0)) { + // Add item to inventory + Item remaining; + if (itemEntity.item instanceof StackableItem) { + int orig = ((StackableItem) itemEntity.item).count; + remaining = inventory.add(itemEntity.item); + if (remaining != null && ((StackableItem) remaining).count != orig) { + successful = true; + } + } else remaining = inventory.add(itemEntity.item); + if (remaining == null) { + successful = remove = true; + } + } - itemEntity.remove(); + if (remove) itemEntity.remove(); + if (successful) { + Sound.play("pickup"); addScore(1); } } @@ -1248,17 +1250,12 @@ public String getDebugHunger() { } /** - * Trying to add item(s) to the player inventory. - * If no more item(s) can be added to the inventory, drop the item(s) near the player. + * Trying to add a stack of item(s) to the top of player inventory. + * If there is/are no more item(s) can be added to the inventory, drop the item(s) near the player. */ public void tryAddToInvOrDrop(@Nullable Item item) { if (item != null) { - int returned = inventory.add(0, item); - if (item instanceof StackableItem) { - if (((StackableItem) item).count > 0) { - getLevel().dropItem(x, y, item); - } - } else if (returned == 0) { + if (inventory.add(item) != null) { getLevel().dropItem(x, y, item); } } diff --git a/src/client/java/minicraft/item/BucketItem.java b/src/client/java/minicraft/item/BucketItem.java index 244c4bf40..608c6e8c2 100644 --- a/src/client/java/minicraft/item/BucketItem.java +++ b/src/client/java/minicraft/item/BucketItem.java @@ -91,9 +91,7 @@ private BucketItem editBucket(Player player, Fill newFill) { // This item object is a stack of buckets. count--; - if (player.getInventory().add(new BucketItem(newFill)) == 0) { - player.getLevel().dropItem(player.x, player.y, new BucketItem(newFill)); - } + player.tryAddToInvOrDrop(new BucketItem(newFill)); return this; } diff --git a/src/client/java/minicraft/item/Inventory.java b/src/client/java/minicraft/item/Inventory.java index c0ca6b756..b62258c99 100644 --- a/src/client/java/minicraft/item/Inventory.java +++ b/src/client/java/minicraft/item/Inventory.java @@ -2,6 +2,7 @@ import minicraft.entity.furniture.Furniture; import minicraft.util.Logging; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; @@ -56,58 +57,47 @@ public Item remove(int idx) { return items.remove(idx); } - /** - * Adds an item to the inventory - */ - public int add(@Nullable Item item) { - if (item != null) - return add(items.size(), item); // Adds the item to the end of the inventory list - return 0; - } - /** * Adds several copies of the same item to the end of the inventory. * * @param item Item to be added. * @param num Amount of items to add. + * @return the remaining item not being added; empty if whole stack of items has been added successfully */ - public int add(Item item, int num) { - int total = 0; - for (int i = 0; i < num; i++) - total += add(item.copy()); - return total; + public List add(@NotNull Item item, int num) { + ArrayList remaining = new ArrayList<>(); + for (int i = 0; i < num; i++) { + Item remain = add(item.copy()); + if (remain != null) remaining.add(remain); + } + return remaining; } /** - * Adds an item to a specific spot in the inventory. - * - * @param slot Index to place item at. + * Adds an item at the end of the inventory. * @param item Item to be added. - * @return The number of items added. + * @return the remaining item not being added; {@code null} if whole stack of items has been added successfully */ - public int add(int slot, Item item) { - + public @Nullable Item add(@Nullable Item item) { + if (item == null) return null; // Do not add to inventory if it is a PowerGlove if (item instanceof PowerGloveItem) { Logging.INVENTORY.warn("Tried to add power glove to inventory. stack trace:", new Exception()); - return 0; + return null; } if (item instanceof StackableItem) { // If the item is a item... StackableItem toTake = (StackableItem) item; // ...convert it into a StackableItem object. - int total = toTake.count; - for (Item value : items) { if (toTake.stacksWith(value)) { StackableItem stack = (StackableItem) value; - if (!unlimited) { if (stack.count < stack.maxCount) { int r = stack.maxCount - stack.count; if (r >= toTake.count) { // Matching implies that the other item is stackable, too. stack.count += toTake.count; - return total; + return null; } else { toTake.count -= r; stack.count += r; @@ -115,42 +105,40 @@ public int add(int slot, Item item) { } } else { stack.count += toTake.count; - return total; + return null; } } } if (!unlimited) { if (items.size() < maxItem) { - int c = (int) Math.ceil(toTake.count / 100.0); - for (int i = 0; i < c; i++) { + while (toTake.count > 0) { + if (items.size() == maxItem) return toTake; StackableItem adding = toTake.copy(); - adding.count = i + 1 == c && toTake.count % 100 > 0 ? toTake.count % 100 : 100; - if (adding.count == 0) break; - if (items.size() == maxItem) return total - toTake.count; + adding.count = Math.min(toTake.count, toTake.maxCount); items.add(adding); // Add the item to the items list toTake.count -= adding.count; } - return total; + return null; } else { - return total - toTake.count; + return toTake; } } else { - items.add(slot, toTake); - return total; + items.add(toTake); + return null; } } if (!unlimited) { if (items.size() < maxItem) { - items.add(slot, item); // Add the item to the items list - return 1; + items.add(item); // Add the item to the items list + return null; } else { - return 0; + return item; } } else { - items.add(slot, item); - return 1; + items.add(item); + return null; } } diff --git a/src/client/java/minicraft/item/Recipe.java b/src/client/java/minicraft/item/Recipe.java index 630191c51..d50cdfe3e 100644 --- a/src/client/java/minicraft/item/Recipe.java +++ b/src/client/java/minicraft/item/Recipe.java @@ -89,7 +89,7 @@ public boolean craft(Player player) { // Rdd the crafted items. for (int i = 0; i < amount; i++) { Item product = getProduct(); - if (player.getInventory().add(product) == 0) + if (player.getInventory().add(product) != null) player.getLevel().dropItem(player.x, player.y, product); } diff --git a/src/client/java/minicraft/saveload/LegacyLoad.java b/src/client/java/minicraft/saveload/LegacyLoad.java index b902c3775..cdd492bcf 100644 --- a/src/client/java/minicraft/saveload/LegacyLoad.java +++ b/src/client/java/minicraft/saveload/LegacyLoad.java @@ -344,11 +344,7 @@ public void loadItemToInventory(String item, Inventory inventory) { } private void loadItem(Inventory inventory, Item item) { - int total = 1; - if (item instanceof StackableItem) total = ((StackableItem) item).count; - int loaded = inventory.add(item); - - if (loaded < total) { + if (inventory.add(item) != null) { deathChest.getInventory().add(item.copy()); } } diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index efc17809a..d5cc2f24c 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -764,7 +764,7 @@ public void loadPlayer(Player player, List origData) { if (worldVer.compareTo(new Version("2.0.4-dev7")) < 0) { int arrowCount = Integer.parseInt(data.remove(0)); if (worldVer.compareTo(new Version("2.0.1-dev1")) < 0) - player.getInventory().add(Items.get("arrow"), arrowCount); + player.getInventory().add(Items.get("arrow"), arrowCount).forEach(deathChest.getInventory()::add); } Game.currentLevel = Integer.parseInt(data.remove(0)); @@ -916,11 +916,7 @@ public void loadInventory(Inventory inventory, List data) { } private void loadItem(Inventory inventory, Item item) { - int total = 1; - if (item instanceof StackableItem) total = ((StackableItem) item).count; - int loaded = inventory.add(item); - - if (loaded < total) { + if (inventory.add(item) != null) { deathChest.getInventory().add(item.copy()); } } diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 21b71f2b7..c10ebd647 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -19,13 +19,10 @@ public class ContainerDisplay extends Display { private Chest chest; public ContainerDisplay(Player player, Chest chest) { - super( - new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT), - new InventoryMenu(chest, chest.getInventory(), chest.name, RelPos.RIGHT) - ); - - //pInv = player.getInventory(); - //cInv = chest.getInventory(); + menus = new Menu[] { + new InventoryMenu(chest, chest.getInventory(), chest.name, RelPos.LEFT, this::update), + new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.RIGHT, this::update) + }; this.player = player; this.chest = chest; @@ -140,12 +137,11 @@ public void tick(InputHandler input) { if (!transferAll) { ((StackableItem) toItem).count = 1; } else { - move = ((StackableItem) fromItem).count; + move = ((StackableItem) toItem).count; } - int moved = to.add(toSel, toItem); - if (moved < move) { - ((StackableItem) fromItem).count -= moved; + if (to.add(toItem) != null) { + ((StackableItem)fromItem).count -= move - ((StackableItem) toItem).count; } else if (!transferAll) { ((StackableItem) fromItem).count--; } else { @@ -153,8 +149,7 @@ public void tick(InputHandler input) { } update(); } else { - int moved = to.add(toSel, toItem); - if (moved == 1) { + if (to.add(toItem) == null) { from.remove(fromSel); update(); } @@ -162,6 +157,9 @@ public void tick(InputHandler input) { } } + /** @deprecated This method is no longer in use by the removal of multiplayer system. + * Also, the game is paused when the display is shown, so it is not possible for the player to pickup items during this period. */ + @Deprecated public void onInvUpdate(ItemHolder holder) { if (holder == player || holder == chest) { update(); diff --git a/src/client/java/minicraft/screen/InventoryMenu.java b/src/client/java/minicraft/screen/InventoryMenu.java index b924b9879..3f1367b2d 100644 --- a/src/client/java/minicraft/screen/InventoryMenu.java +++ b/src/client/java/minicraft/screen/InventoryMenu.java @@ -1,28 +1,37 @@ package minicraft.screen; +import minicraft.core.Action; import minicraft.core.io.InputHandler; import minicraft.entity.Entity; import minicraft.item.Inventory; import minicraft.item.Item; import minicraft.item.StackableItem; import minicraft.screen.entry.ItemEntry; +import org.jetbrains.annotations.Nullable; class InventoryMenu extends ItemListMenu { private final Inventory inv; private final Entity holder; - protected boolean creativeInv = false; + private final boolean creativeInv; + private final @Nullable Action onStackUpdateListener; // The length of the entry shown may change when there is an update to the stack. - InventoryMenu(Entity holder, Inventory inv, String title, RelPos entryPos) { + InventoryMenu(Entity holder, Inventory inv, String title, RelPos entryPos, @Nullable Action onStackUpdateListener) { this(holder, inv, title, entryPos, false, onStackUpdateListener); } + InventoryMenu(Entity holder, Inventory inv, String title, RelPos entryPos, boolean creativeInv) { this(holder, inv, title, entryPos, creativeInv, null); } + InventoryMenu(Entity holder, Inventory inv, String title, RelPos entryPos, boolean creativeInv, @Nullable Action onStackUpdateListener) { super(ItemListMenu.getBuilder(entryPos), ItemEntry.useItems(inv.getItems()), title); this.inv = inv; this.holder = holder; + this.creativeInv = creativeInv; + this.onStackUpdateListener = onStackUpdateListener; } InventoryMenu(InventoryMenu model) { super(ItemListMenu.getBuilder(), ItemEntry.useItems(model.inv.getItems()), model.getTitle()); this.inv = model.inv; this.holder = model.holder; + this.creativeInv = model.creativeInv; + this.onStackUpdateListener = model.onStackUpdateListener; setSelection(model.getSelection()); } @@ -47,6 +56,10 @@ public void tick(InputHandler input) { // drop the whole item. removeSelectedEntry(); } + + if (onStackUpdateListener != null) { + onStackUpdateListener.act(); + } } if (holder.getLevel() != null) { diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index c5a709854..6df045d32 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -14,6 +14,7 @@ import minicraft.item.Items; import minicraft.item.StackableItem; import minicraft.screen.entry.StringEntry; +import minicraft.util.Logging; public class PlayerInvDisplay extends Display { @@ -28,7 +29,7 @@ public class PlayerInvDisplay extends Display { private final Inventory creativeInv; public PlayerInvDisplay(Player player) { - super(new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT)); + InventoryMenu invMenu = new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT, this::update); this.player = player; descriptionMenuBuilder = new Menu.Builder(true, 3, RelPos.TOP_LEFT); creativeMode = Game.isMode("minicraft.settings.mode.creative"); @@ -40,20 +41,18 @@ public PlayerInvDisplay(Player player) { if (creativeMode) { creativeInv = Items.getCreativeModeInventory(); menus = new Menu[]{ - menus[0], - new InventoryMenu(player, creativeInv, "minicraft.displays.player_inv.container_title.items", RelPos.RIGHT) {{ - creativeInv = true; - }}, + invMenu, + new InventoryMenu(player, creativeInv, "minicraft.displays.player_inv.container_title.items", RelPos.RIGHT, true), descriptionMenu }; - menus[1].translate(menus[0].getBounds().getWidth() + padding, 0); + menus[1].translate(invMenu.getBounds().getWidth() + padding, 0); update(); - if (menus[0].getNumOptions() == 0) onSelectionChange(0, 1); + if (invMenu.getNumOptions() == 0) onSelectionChange(0, 1); } else { creativeInv = null; - menus = new Menu[]{menus[0], descriptionMenu}; + menus = new Menu[]{invMenu, descriptionMenu}; } onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); @@ -129,7 +128,6 @@ public void tick(InputHandler input) { } from = player.getInventory(); - to = creativeInv; int fromSel = curMenu.getSelection(); Item fromItem = from.get(fromSel); @@ -159,17 +157,19 @@ public void tick(InputHandler input) { Item fromItem = from.get(fromSel); boolean transferAll; - if (input.inputPressed("attack")) { // If stack limit is available, this can transfer whole stack - transferAll = !(fromItem instanceof StackableItem) || ((StackableItem) fromItem).count == 1; + if (input.getMappedKey("SHIFT-SELECT").isClicked()) { + transferAll = true; + } else if (input.inputPressed("SELECT")) { // If stack limit is available, this can transfer whole stack + transferAll = !(fromItem instanceof StackableItem); } else return; Item toItem = fromItem.copy(); + if (toItem instanceof StackableItem && transferAll) + ((StackableItem) toItem).count = ((StackableItem) toItem).maxCount; - if (!transferAll) { - ((StackableItem) toItem).count = 1; - } + if (to.add(toItem) != null) + Logging.PLAYER.trace("Item {} cannot be added to the player inventory because max slot reached.", toItem); - to.add(toSel, toItem); update(); } @@ -228,9 +228,7 @@ private int getOtherIdx() { private void update() { menus[0] = new InventoryMenu((InventoryMenu) menus[0]); - menus[1] = new InventoryMenu((InventoryMenu) menus[1]) {{ - creativeInv = true; - }}; + menus[1] = new InventoryMenu((InventoryMenu) menus[1]); menus[1].translate(menus[0].getBounds().getWidth() + padding, 0); onSelectionChange(0, selection); itemDescription = getDescription(); From 5d7df9a9f8cf43a29ec045ecfcb03d992c5fadce Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 17 Feb 2024 02:18:37 +0800 Subject: [PATCH 200/261] Remove SHIFT-[S|W] debugging keys --- src/client/java/minicraft/core/Updater.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/client/java/minicraft/core/Updater.java b/src/client/java/minicraft/core/Updater.java index 70dacc202..3db1c7268 100644 --- a/src/client/java/minicraft/core/Updater.java +++ b/src/client/java/minicraft/core/Updater.java @@ -92,14 +92,6 @@ static void updateFullscreen() { // In the end, calls menu.tick() if there's a menu, or level.tick() if no menu. public static void tick() { - // Quick Level change: move the player for -1, or 1 levels - if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-S").isClicked()) { - Game.setDisplay(new LevelTransitionDisplay(-1)); - - } else if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-W").isClicked()) { - Game.setDisplay(new LevelTransitionDisplay(1)); - } - if (input.getMappedKey("FULLSCREEN").isClicked()) { Updater.FULLSCREEN = !Updater.FULLSCREEN; Updater.updateFullscreen(); From 7264effb992e290ee0ec3d3be6073f5b7f608f6d Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 17 Feb 2024 03:13:32 +0800 Subject: [PATCH 201/261] Change iron and gold cost to 3 ores --- src/client/java/minicraft/item/Recipes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/java/minicraft/item/Recipes.java b/src/client/java/minicraft/item/Recipes.java index 1c28699d2..75fdd6f07 100644 --- a/src/client/java/minicraft/item/Recipes.java +++ b/src/client/java/minicraft/item/Recipes.java @@ -111,8 +111,8 @@ public class Recipes { anvilRecipes.add(new Recipe("Shears_1", "Iron_4")); anvilRecipes.add(new Recipe("Watering Can_1", "Iron_3")); - furnaceRecipes.add(new Recipe("iron_1", "iron Ore_4", "coal_1")); - furnaceRecipes.add(new Recipe("gold_1", "gold Ore_4", "coal_1")); + furnaceRecipes.add(new Recipe("iron_1", "iron Ore_3", "coal_1")); + furnaceRecipes.add(new Recipe("gold_1", "gold Ore_3", "coal_1")); furnaceRecipes.add(new Recipe("glass_1", "sand_4", "coal_1")); furnaceRecipes.add(new Recipe("glass bottle_1", "glass_3")); From e3f870e7b8540981e929f5e376f08630681dd50e Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Fri, 16 Feb 2024 22:53:16 +0100 Subject: [PATCH 202/261] change fence textures --- .../assets/textures/item/obsidian_fence.png | Bin 182 -> 195 bytes .../assets/textures/item/stone_fence.png | Bin 171 -> 174 bytes .../assets/textures/item/wood_fence.png | Bin 182 -> 175 bytes .../assets/textures/tile/wood_fence.png | Bin 229 -> 185 bytes .../assets/textures/tile/wood_fence_bottom.png | Bin 212 -> 192 bytes .../assets/textures/tile/wood_fence_left.png | Bin 194 -> 181 bytes .../assets/textures/tile/wood_fence_right.png | Bin 193 -> 195 bytes .../assets/textures/tile/wood_fence_top.png | Bin 159 -> 137 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/item/obsidian_fence.png b/src/client/resources/assets/textures/item/obsidian_fence.png index 9a7a86e5795634c71ed41dca4ea23fa1e9718e84..9a351fedd7f1a049802479df9602861f57dbea2f 100644 GIT binary patch delta 154 zcmV;L0A>HS0mA{1F@JqYL_t&-l~s>B4#Xe~1qX-_93TY^f^FG`bQ4?q+t zpCSS|F8%BoJrFaE^EHk0C3i}O+5`a3W99q*C;%ltlFtB?`s;)t`OLC!oX5(tZ#~c^ z5Upd7*8tHvN_{k?f=)iu+|jyD(I$|5eiNjk5ne5%s5vqB`^AB0AShYVyOFOU_B3Vimc~R0$p`D vW6`{D#y;j+>YTB~l2c^ae?0l%tL6d%F@0!BL_t&-m2Hl(4Ztu61TT^2p=KE7UVO^%Di(`ny)Z_#Qrp|kh{tNFt`d_(wqk?x;#SF*F<^Rs#|21i1BM`90 zvTtGo0Wp4lK2|4lTSeMN?l*SOl+{S6(u!Xbd eMPC!+41IQ&qQ_Ty6XKX2Tkw~!GTI%wk>yVO(1c*CB;sV2_yftANuR9FZL=`eW^q7%+ q325Hop7ex-goe(=3_15$7|PcvKl*Mvv77-2JYCuRT-G@yGywq39YFE` diff --git a/src/client/resources/assets/textures/tile/wood_fence.png b/src/client/resources/assets/textures/tile/wood_fence.png index e714c6788a4725258ca3e25f5b7d54315b69e1fb..2375def5e90a4a033221be3744dc091167835aa2 100644 GIT binary patch delta 157 zcmV;O0Al~;0l5K?B!2;OQb$4nuFf3k0001UNkl-mWEYHd1MtNFeOy2YV9g81j{an1U^s=6baCYciWUI?!80le=J@7-00000 LNkvXXu0mjf+%`p= delta 201 zcmdnV_>^&iN~-K3$OlR&&GZx^prw85kI?cOPyvRD*bT|YHBZF|NWMG_#Ll}IL3$IV?(eTZ z3KDD3Hv6#a!QbEE8YX5AArcC%>L1y3;`gzx`}jq+)%wZKh8ZOc43BOpR~oV^a!y|W;sXZ`G#D=_+||(7*!b|(RP!H8KJEsw z9i!b_jF>wZx0p7}FgPIH@xdU%a~U^~@7>A6Q)1}F&hVgFbb1$$i5SpgzSIcMG+$o^ YEg+i%h(X{|@MI9>>FVdQ&MBb@07h9s{Qv*} diff --git a/src/client/resources/assets/textures/tile/wood_fence_left.png b/src/client/resources/assets/textures/tile/wood_fence_left.png index ca1baee05b26c1bdc2bfec3e0af90f43d588319c..5b5f2cc122994e8afccbf45c2a864ec2dced0864 100644 GIT binary patch delta 153 zcmV;K0A~Nf0kr{;B!2;OQb$4nuFf3k0001QNkl zXp;H$NFN5W41j57U|?WiBF6w2c>n$t0}Ck{61~O$ql=N`0uK)}1`iK2xa|xK45YbW z$Bt7NVkEg>{??a_^S8caL>3#kFd)kXGzkNW5)uOgiC%z#V<1O=GBPln!U#~Z0052} VD^fbBNnrp0002ovPDHLkV1oK%KSuxn delta 165 zcmX@ic#v^|N08JI{cnN#_Ns=&zpd(1s7CyGt3tEC~~aWp{Be`;%;n%qT3|K z6ASsfdAs&HOk%uo;J|ZMhU{{6Hp9bBlYo}+rABzB$@%&+XaPAKKnwzxf+vG0Pgg&e IbxsLQ0Fx>=LjV8( diff --git a/src/client/resources/assets/textures/tile/wood_fence_top.png b/src/client/resources/assets/textures/tile/wood_fence_top.png index 3a5f0267e0c0cbcbbbe2f1a4feea9dd867f5eefc..fb014573113cffda21184cb82ec234a801cee70f 100644 GIT binary patch delta 108 zcmbQw*vU9SC6%!_$lZxy-8q?;3=9m;o-U3d7QM+S2bhHR9{q1@U|>*DF~bl@8N9hs z*wqLGiT|!m?|G3Gxj~YF`Qgslk`sAVq!KPWY*JjDAkxEhiGiV*k@v_(i!Tj8;}|?$ L{an^LB{Ts5pC%}y delta 130 zcmeBVoX>FVdQ&MBb@06~Z;MF0Q* From 597f73f1c828af794c647ca4296519ac8bbea369 Mon Sep 17 00:00:00 2001 From: GameJarne <69422663+GameJarne@users.noreply.github.com> Date: Fri, 16 Feb 2024 23:25:37 +0100 Subject: [PATCH 203/261] revert remove damage implementation --- .../java/minicraft/level/tile/FenceTile.java | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index f937c5837..fe9217a0a 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -120,9 +120,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D if (tool.type == type.getRequiredTool()) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { int data = level.getData(xt, yt); - Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get(name)); - level.setTile(xt, yt, Tiles.get(level.getData(xt, yt))); + hurt(level, xt, yt, tool.getDamage()); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); @@ -132,4 +130,30 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } return false; } + + public void hurt(Level level, int x, int y, int dmg) { + int damage = level.getData(x, y) + dmg; + int fenceHealth = 5; + if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = fenceHealth; + + level.add(new SmashParticle(x * 16, y * 16)); + Sound.play("monsterhurt"); + level.add(new TextParticle(String.valueOf(dmg), x * 16 + 8, y * 16 + 8, Color.RED)); + + if (damage >= fenceHealth) { + level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(name)); + level.setTile(x, y, Tiles.get(level.getData(x, y))); + } else { + level.setData(x, y, damage); + } + } + + public boolean tick(Level level, int xt, int yt) { + int damage = level.getData(xt, yt); + if (damage > 0) { + level.setData(xt, yt, damage - 1); + return true; + } + return false; + } } From b571df38b2f45b86fdf7d3da36f8bdc4694d0bc8 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 17 Feb 2024 12:01:36 +0800 Subject: [PATCH 204/261] Remove revert and implement creative break --- .../java/minicraft/level/tile/FenceTile.java | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index fe9217a0a..b43f3d2c8 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -120,7 +120,9 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D if (tool.type == type.getRequiredTool()) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { int data = level.getData(xt, yt); - hurt(level, xt, yt, tool.getDamage()); + Sound.play("monsterhurt"); + level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get(name)); + level.setTile(xt, yt, Tiles.get(level.getData(xt, yt))); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); @@ -132,28 +134,11 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D } public void hurt(Level level, int x, int y, int dmg) { - int damage = level.getData(x, y) + dmg; - int fenceHealth = 5; - if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = fenceHealth; - - level.add(new SmashParticle(x * 16, y * 16)); - Sound.play("monsterhurt"); - level.add(new TextParticle(String.valueOf(dmg), x * 16 + 8, y * 16 + 8, Color.RED)); - - if (damage >= fenceHealth) { - level.dropItem(x * 16 + 8, y * 16 + 8, 1, 1, Items.get(name)); + if (Game.isMode("minicraft.settings.mode.creative")) { + level.add(new SmashParticle(x * 16, y * 16)); + Sound.play("monsterhurt"); + level.dropItem(x * 16 + 8, y * 16 + 8, Items.get(name)); level.setTile(x, y, Tiles.get(level.getData(x, y))); - } else { - level.setData(x, y, damage); - } - } - - public boolean tick(Level level, int xt, int yt) { - int damage = level.getData(xt, yt); - if (damage > 0) { - level.setData(xt, yt, damage - 1); - return true; - } - return false; + }; } } From 2a326b121b7feb59738d0b26ced29dfb21fc95e3 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Feb 2024 15:00:25 +0800 Subject: [PATCH 205/261] Add content to default book item --- src/client/java/minicraft/item/BookItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/BookItem.java b/src/client/java/minicraft/item/BookItem.java index 73867b703..2a3b8bf4d 100644 --- a/src/client/java/minicraft/item/BookItem.java +++ b/src/client/java/minicraft/item/BookItem.java @@ -1,6 +1,7 @@ package minicraft.item; import minicraft.core.Game; +import minicraft.core.io.Localization; import minicraft.entity.Direction; import minicraft.entity.mob.Player; import minicraft.gfx.SpriteLinker.LinkedSprite; @@ -17,7 +18,7 @@ public class BookItem extends Item { protected static ArrayList getAllInstances() { ArrayList items = new ArrayList(); - items.add(new BookItem("Book", new LinkedSprite(SpriteType.Item, "book"), null)); + items.add(new BookItem("Book", new LinkedSprite(SpriteType.Item, "book"), () -> Localization.getLocalized("minicraft.displays.book.default_book"))); items.add(new BookItem("Antidious", new LinkedSprite(SpriteType.Item, "antidious_book"), () -> BookData.antVenomBook.collect(), true)); return items; } From 1ffa8f64ae1b1bbc2851c3a250c42103668f7cc3 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 25 Feb 2024 22:30:58 +0800 Subject: [PATCH 206/261] Add back SHIFT-[S|W] debugging keys --- src/client/java/minicraft/core/Updater.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/java/minicraft/core/Updater.java b/src/client/java/minicraft/core/Updater.java index 3db1c7268..9e9e92097 100644 --- a/src/client/java/minicraft/core/Updater.java +++ b/src/client/java/minicraft/core/Updater.java @@ -217,6 +217,14 @@ public static void tick() { // For debugging only { + // Quick Level change: move the player for -1, or 1 levels + if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-S").isClicked()) { + Game.setDisplay(new LevelTransitionDisplay(-1)); + + } else if (isMode("minicraft.settings.mode.creative") && input.getMappedKey("SHIFT-W").isClicked()) { + Game.setDisplay(new LevelTransitionDisplay(1)); + } + if (input.getMappedKey("F3-L").isClicked()) { // Print all players on all levels, and their coordinates. Logging.WORLD.info("Printing players on all levels."); From 28f8b3440ff83ec157ea2891dae1788f7b0adc28 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:03:40 +0800 Subject: [PATCH 207/261] Move to check drop-stack first --- src/client/java/minicraft/entity/mob/Player.java | 10 +++++----- src/client/java/minicraft/screen/InventoryMenu.java | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index 4735058f6..fc16414ff 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -495,16 +495,16 @@ public void tick() { if (activeItem != null && (input.inputPressed("drop-one") || input.inputPressed("drop-stack"))) { Item drop = activeItem.copy(); - if (input.inputPressed("drop-one") && drop instanceof StackableItem && ((StackableItem) drop).count > 1) { - // Drop one from stack - ((StackableItem) activeItem).count--; - ((StackableItem) drop).count = 1; - } else { + if (!input.inputPressed("drop-stack") || !(drop instanceof StackableItem) || ((StackableItem) drop).count <= 1) { activeItem = null; // Remove it from the "inventory" if (isFishing) { isFishing = false; fishingTicks = maxFishingTicks; } + } else { + // Drop one from stack + ((StackableItem) activeItem).count--; + ((StackableItem) drop).count = 1; } level.dropItem(x, y, drop); diff --git a/src/client/java/minicraft/screen/InventoryMenu.java b/src/client/java/minicraft/screen/InventoryMenu.java index 3f1367b2d..4c02912be 100644 --- a/src/client/java/minicraft/screen/InventoryMenu.java +++ b/src/client/java/minicraft/screen/InventoryMenu.java @@ -48,13 +48,13 @@ public void tick(InputHandler input) { Item drop = invItem.copy(); if (!creativeInv) { - if (dropOne && drop instanceof StackableItem && ((StackableItem) drop).count > 1) { + if (!dropOne || !(drop instanceof StackableItem) || ((StackableItem) drop).count <= 1) { + // drop the whole item. + removeSelectedEntry(); + } else { // just drop one from the stack ((StackableItem) drop).count = 1; ((StackableItem) invItem).count--; - } else { - // drop the whole item. - removeSelectedEntry(); } if (onStackUpdateListener != null) { From 8dfb3ef1b937638d18e02f13584ad2c03e4522c5 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:20:07 +0800 Subject: [PATCH 208/261] Resolve unresolved AIOOBE on menus in PlayerInv --- src/client/java/minicraft/screen/PlayerInvDisplay.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index 6df045d32..923d8183b 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -29,7 +29,7 @@ public class PlayerInvDisplay extends Display { private final Inventory creativeInv; public PlayerInvDisplay(Player player) { - InventoryMenu invMenu = new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT, this::update); + menus = new Menu[] { new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.LEFT, this::update) }; this.player = player; descriptionMenuBuilder = new Menu.Builder(true, 3, RelPos.TOP_LEFT); creativeMode = Game.isMode("minicraft.settings.mode.creative"); @@ -41,18 +41,18 @@ public PlayerInvDisplay(Player player) { if (creativeMode) { creativeInv = Items.getCreativeModeInventory(); menus = new Menu[]{ - invMenu, + menus[0], new InventoryMenu(player, creativeInv, "minicraft.displays.player_inv.container_title.items", RelPos.RIGHT, true), descriptionMenu }; - menus[1].translate(invMenu.getBounds().getWidth() + padding, 0); + menus[1].translate(menus[0].getBounds().getWidth() + padding, 0); update(); - if (invMenu.getNumOptions() == 0) onSelectionChange(0, 1); + if (menus[0].getNumOptions() == 0) onSelectionChange(0, 1); } else { creativeInv = null; - menus = new Menu[]{invMenu, descriptionMenu}; + menus = new Menu[]{menus[0], descriptionMenu}; } onScreenKeyboardMenu = OnScreenKeyboardMenu.checkAndCreateMenu(); From 7b5e18322cb8bd08f7479ed59b75ba0d743f9b77 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:18:24 +0800 Subject: [PATCH 209/261] Make wooden fence texture shape more consistent --- .../assets/textures/tile/wood_fence_bottom.png | Bin 192 -> 171 bytes .../assets/textures/tile/wood_fence_left.png | Bin 181 -> 159 bytes .../assets/textures/tile/wood_fence_right.png | Bin 195 -> 150 bytes .../assets/textures/tile/wood_fence_top.png | Bin 137 -> 154 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/tile/wood_fence_bottom.png b/src/client/resources/assets/textures/tile/wood_fence_bottom.png index dddda7232e8c43e22bb51bb21c1b7264f5e3b847..72e208983254817360e2b04887db8a54142f17fd 100644 GIT binary patch delta 129 zcmX@WxSDZ-VHHcdqpu?a!^VE@KZ&di3=EtF9+AZi419+{nDKc2iWH!rgQtsQh=qT$ z1gi;K=e**|{AVT1bD-fOaEE-(pG&{1SL_Jbjgxr1>r f8xJ$Hgam`%L2jY delta 151 zcmZ3@cz|(&VSSaSi(`mIZ*qbJ>lW6|dyoDL?>+keaq!_L|II5Kxq5!r|GPH5M@8}g z5Gd#N=Pq!NYvu00YB{hZ5`? Tf1J1g)X(7Q>gTe~DWM4fne8Yt delta 140 zcmbQwxRr5&VST=*i(`mIZ*sx{5tXX$|I1zMgHx99yS5qZt^eQEDC9gt0toKyuXkO? ztiZOX_G4dTBcqVql3gvFGao-pJoeyWqT3|yhzXX~Wpk7~joTPMZ{L@qa+N_upT|ey sKvF|vqCpFzWy8}it=1{G{X`iUW`%1xRfO>;F#v(5s~@Y&I;Vst0G!D-5C8xG diff --git a/src/client/resources/assets/textures/tile/wood_fence_right.png b/src/client/resources/assets/textures/tile/wood_fence_right.png index 4d5bd8933fdeab03e5401be0020b710184044339..0996a466eafebdfd6ce4b80c33b59c7403dc8713 100644 GIT binary patch delta 108 zcmX@iIE`_FVJb_yqpu?a!^VE@KZ&di3=EtF9+AZi419+{nDKc2iWH!rwx^3@h=qT$ z1nU%LHw|AAk1t~X`BM)uda|vV^TvB7xLkZsIL>HYuze|kkp+Ohv9JmlFn@ib(nB>;ia zaR!Ns|NlgpxizJP_8$GexO?IgCVqZnHXz>dmWPLD$M1MG8<*-_yl0#KJ#0 z#WBR9H#y}1lhEFy|BVd{3@R#S7y>DSH#Z8q8i643-?iyIFR~&x xNHQ=#+&NovBCm>6!exg|ii;COdYCRTFcdTL9@%K|rGWtmJYD@<);T3K0RR+$B+dW; From 2fa39bb1cbe911ee0c6b20ddd8279066b7e747bb Mon Sep 17 00:00:00 2001 From: GreenEye Date: Mon, 11 Mar 2024 10:46:03 -0300 Subject: [PATCH 210/261] Update walls textures --- .../assets/textures/tile/obsidian_wall.png | Bin 146 -> 289 bytes .../textures/tile/obsidian_wall_border.png | Bin 263 -> 431 bytes .../assets/textures/tile/stone_wall.png | Bin 146 -> 278 bytes .../assets/textures/tile/stone_wall_border.png | Bin 297 -> 404 bytes .../assets/textures/tile/wood_wall.png | Bin 247 -> 454 bytes .../assets/textures/tile/wood_wall_border.png | Bin 301 -> 500 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/tile/obsidian_wall.png b/src/client/resources/assets/textures/tile/obsidian_wall.png index 4eecbb56ce037b644b37ee9b28186210e79bb1de..97bd8314d14f184ad60f4fef407c5e447ca57b7b 100644 GIT binary patch delta 270 zcmV+p0rCEl0ignr9Df05^w0MI0004VQb$4nuFf3k00004XF*Lt006O%3;baP00009 za7bBm000id000id0mpBsWB>pFwn;=mR47xWlFbdmFbqab5kl&LazelmumO`WEgP@| zT;alvzc1?NSWZGB@g!G@~Bs)ApaLG@><(Y%8ae+ooC10y%W U1iH^h00000Ne4wvM6N<$f*L$)f&c&j delta 125 zcmV-@0D}La0+Ioc9CiR7^Z#K00004VQb$4nuFf3k0000?Nkl4#0pGL`g(JR5(xVmCa59F%ZXhYapTtoQS{y@WKgs1TVe@ zPwN|al?!^{LoYyJ1NgD#KQgt28I}e1<}Ycs+nMQnwQ1O?bbsUTuVDZTCg!60J7{S` z*e*ZBn|WYZWi;;zYLK`LrjNds3khB^z<$H9o-rX@1o8moa{h)E80}x}odhB=&B85Bl0cv7JiV@$ z)C02KGnnklntz=Emo+;N@9Qyr$pAHWZ=*D4JP*7J(B=j^q=C*7jt4rvO+9~k^g05G zKBj*uK)8LarA@%Tb(~Ms$ZHz}n$aeuSUi9X zhs6uAwt&JLT@OYafDFT?kX%dXX905fkrO;HAA($rZWcTaU~FleWtGQ`Xy6j7tM diff --git a/src/client/resources/assets/textures/tile/stone_wall.png b/src/client/resources/assets/textures/tile/stone_wall.png index 576fc30f4268df1792becaef4a0a486294c601fe..9b58dd28807cc6510cd4ce1975c8862a9692de22 100644 GIT binary patch delta 258 zcmV+d0sa1x0hR)g9Df05^w0MI0004VQb$4nuFf3k00004XF*Lt006O%3;baP00009 za7bBm000id000id0mpBsWB>pFt4TybR47xWkueg(APfXaCXb@0;77Fd{D^{vj}f0H zQe-fZXR?K5%i>NFkKX%m2Twe}Hi|344@cP8lY_(RgxNK6h6zBFfhq9oFfgyd;`R=9{3+nv8@c;e+JGkx&Hw-a07*qo IM6N<$g0FgO8UO$Q delta 125 zcmV-@0D}LP0+Ioc9CiR7^Z#K00004VQb$4nuFf3k0000?Nkl^@R5(xVmC3DxFc3fu zN)L2_IMM-4PzP7;E`%O9aB&3)(F9c_dZP?su|voYxBn!};PH4iTNvluJl}{A{uix!!QR!Fb9(`0tt6nwbVb;ISJanjnHbTcu-#-4^FU#st2{!d=I2OpGTS-JgR47x8ld)0)K@5g-XazVH=+Zb)Sg3%#78cqv zmWprSQ^+{_2>1}5*47j@Hdex@r7hSwV~c!yB$GQW{FuGXZhx|Wa#=1(2gfs+Q{n+h z|9n5&Nz+$pch<5U7Q1^vPP$vNjQi^PfGHAH#-q=;;7C-{4Q7)Ei@;!jRRVXnZ<4Ge z^71sXM5fulc#KZK$zIH%3EAW%1Ae8@Kpfb)fTB}vu&Qat{lk0iG*}It_IjLwf&rhs zg}%Y**>;>&seiYG)mZ&W0#mSsBmmf`S24v(6PNLM0;FOimM+W=eJ2R`1~ z=u4xe+E!>aYqnFV*PX)48$$0000cV=NRAQN0CdIJ41kHjY{D=A*${LC&^3cyP?v7`ADcv7?O_z}G&S3z z@L?8#4M6rUhz-&l9Aza9Tiedmr0mx<;0P#Tp zT@0Cz5{Mw%Va`N$39|E%)nG&;Sq8uY5o8)!UO+Yg6rE%TB63pGiAh93R5(xVl{-?yFc5|%4=pn(2sa1}W7ETA=xM0J zOpd@QNC8LS5*TVuKtoT$qon0gaR4*l;uVr&#c^h!;wvnz^?&$xS1a3&hJ$K4doy6S zd%f!H{6LIMo;5O3_l+$tj>MRp-kOXD?Cx!b8z?fX?$04BSQ-;3`q;_I{@lQ9`fjqk z*r?4P?7B^hr@cBp+^VY2P=>9705$R^m~(ye{Jmg2-Z4$i`LJ1$_tQS5=)AzW^ziaw z2$H}SwW2_VmwzRBc1=joq${qQ7{;j-s&x%_%JR`@YO&)M@E=^3^c+&H;;Kn^O0{GO zGJVme;9U9}1=6-ifx=S-xm(MY1?SLs=bBK3?CSDKI&Gi;!HrYD6;;>wZMMRDZs+~o zYgpY3P*$tLTJp!{K?Kw(Frlr`+t5!1$RW_da}5`W$XgG)tIdJAL*o%ohy}aaq(@Wq zAAu0tegr`kA)@uW3i`uU@2R5TqOm#X1ofh;tppd%{{%46pWM|((20(QgNjgogCg&n YFCWil;V%0%9smFU07*qoM6N<$g45jP7ytkO delta 282 zcmV+#0paL_si zT7b3df*2Up1qA*#HQR#Czk1~jiapvoA}Hd7_%O{db#=9eQ7u5Xgph&g@*w>%F%TPW zL3p?(iUiCjq*{P%ILM5ZE3ZR*0I~p^?WDvDESQl)0mA~AC4V5VA^VCLAAt-5S%Mso zSStod5s;07*qoM6N<$g8sI3hX4Qo From 2697504cdba668ffb9e4472db9fe556d9c49247d Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:53:03 +0800 Subject: [PATCH 211/261] Delete obsidian_door_border.png --- .../assets/textures/tile/obsidian_door_border.png | Bin 267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/client/resources/assets/textures/tile/obsidian_door_border.png diff --git a/src/client/resources/assets/textures/tile/obsidian_door_border.png b/src/client/resources/assets/textures/tile/obsidian_door_border.png deleted file mode 100644 index 0fdcbe69ff37a31245d5144687f0c2146b21b7d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|j(WN{hIn`< zUzyzT^Z)zz#cWXwYH6NqZnA;T|8vdh;_0vZdtifeUvINg;e^94(;0P}UL5@XTR^_y z5EsjY=9ViJjWZkH1XKttjAod0U>W0l{f#dVW-*?KULwV}S>mqH6puE|MOT;tx?Ie- zRrwr*p0Myc$}6y+ys(AA_Krqp%B~}fI`)Yw!C9_Ge|05_3LEC=znFjVL~lkwm*e^! z8>YFQc*>z!%2H(WNVmHnbh3f(k`u{i*_TK(oNa$GRm@E#_%2hFc{GDW9`_obU@j-1 PhZsCv{an^LB{Ts5mBwXW From 20365ff7e833f2c8c58ef958905eea7f534aebe2 Mon Sep 17 00:00:00 2001 From: Litorom Date: Mon, 11 Mar 2024 13:36:22 -0400 Subject: [PATCH 212/261] Fixed Conflicts --- src/client/java/minicraft/item/SignItem.java | 5 ++++- .../java/minicraft/level/tile/SignTile.java | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/client/java/minicraft/item/SignItem.java b/src/client/java/minicraft/item/SignItem.java index f6a88d9e6..f2a0ca269 100644 --- a/src/client/java/minicraft/item/SignItem.java +++ b/src/client/java/minicraft/item/SignItem.java @@ -15,6 +15,9 @@ public class SignItem extends TileItem { private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "sign"); + private static final String[] solidTiles = { "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", + "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian" }; + public static ArrayList getAllInstances() { ArrayList items = new ArrayList<>(); @@ -24,7 +27,7 @@ public static ArrayList getAllInstances() { private SignItem() { this(1); } private SignItem(int count) { - super("Sign", sprite, count, null, "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand"); + super("Sign", sprite, count, null, solidTiles); } public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { diff --git a/src/client/java/minicraft/level/tile/SignTile.java b/src/client/java/minicraft/level/tile/SignTile.java index 36f1ae294..3823604ca 100644 --- a/src/client/java/minicraft/level/tile/SignTile.java +++ b/src/client/java/minicraft/level/tile/SignTile.java @@ -42,9 +42,21 @@ public static SignTile getSignTile(Tile onTile) { private SignTile(Tile onType) { super("Sign "+ onType.name, sprite); this.onType = onType; - this.connectsToSand = onType.connectsToSand; - this.connectsToGrass = onType.connectsToGrass; - this.connectsToFluid = onType.connectsToFluid; + } + + @Override + public boolean connectsToSand(Level level, int x, int y) { + return onType.connectsToSand(level, x, y);//Tiles.get((short) level.getData(x, y)).connectsToSand(level, x, y); + } + + @Override + public boolean connectsToFluid(Level level, int x, int y) { + return onType.connectsToFluid(level, x, y);//Tiles.get((short) level.getData(x, y)).connectsToFluid(level, x, y); + } + + @Override + public boolean connectsToGrass(Level level, int x, int y) { + return onType.connectsToGrass(level, x, y);//Tiles.get((short) level.getData(x, y)).connectsToGrass(level, x, y); } public void render(Screen screen, Level level, int x, int y) { From 07f836ba56265428095fd86d9e6eb6b36f68167b Mon Sep 17 00:00:00 2001 From: Litorom Date: Mon, 11 Mar 2024 14:07:51 -0400 Subject: [PATCH 213/261] Increment Version and fixed stone door bug --- build.gradle | 4 ++-- src/client/java/minicraft/core/Game.java | 2 +- src/client/java/minicraft/item/TileItem.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 4e14d5c43..353d19995 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev5" + version = "2.2.0-dev6" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' @@ -107,7 +107,7 @@ publishing { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GITHUB_TOKEN") } - } + } } } diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 8a6b3078d..449b5ad96 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev5"); + public static final Version VERSION = new Version("2.2.0-dev6"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index f7ea4c262..a297bc49d 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -44,7 +44,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Stone Brick", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Stone Bricks"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Ornate Stone", new LinkedSprite(SpriteType.Item, "stone_brick"), new TileModel("Ornate Stone"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Stone Wall", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Wall"), "Stone Bricks")); - items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_wall"), new TileModel("Stone Door"), "Stone Bricks")); + items.add(new TileItem("Stone Door", new LinkedSprite(SpriteType.Item, "stone_door"), new TileModel("Stone Door"), "Stone Bricks")); items.add(new TileItem("Stone Fence", new LinkedSprite(SpriteType.Item, "stone_fence"), new TileModel("Stone Fence", placeOverWithID), solidTiles)); items.add(new TileItem("Raw Obsidian", new LinkedSprite(SpriteType.Item, "obsidian"), new TileModel("Raw Obsidian"), "hole", "water", "cloud", "lava")); items.add(new TileItem("Obsidian Brick", new LinkedSprite(SpriteType.Item, "obsidian_brick"), new TileModel("Obsidian"), "hole", "water", "cloud", "lava")); From 79a22853a1f4e41b5eec8a2c600e1fe7f1987284 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 12 Mar 2024 20:46:19 +0800 Subject: [PATCH 214/261] Resolve post-merge errors --- src/client/java/minicraft/item/TileItem.java | 3 +-- src/client/java/minicraft/level/tile/FenceTile.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index ea83eebeb..5608431ee 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -76,8 +76,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Hellish Berries", new LinkedSprite(SpriteType.Item, "hellish_berries"), new TileModel("hellish berries", TileModel.KEEP_DATA), "farmland")); items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); - String[] solidTiles = { "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian" }; - items.add(new TileItem("Torch", new LinkedSprite(SpriteType.Item, "torch"), new TileModel("Torch", (model1, target, level, xt, yt, player, attackDir) -> target.id), solidTiles)); + items.add(new TileItem("Torch", new LinkedSprite(SpriteType.Item, "torch"), new TileModel("Torch", placeOverWithID), solidTiles)); // Creative mode available tiles: items.add(new TileItem("Farmland", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("farmland"), "dirt", "grass", "hole")); diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index b43f3d2c8..308cfdfb9 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -83,7 +83,7 @@ public boolean mayPass(Level level, int x, int y, Entity e) { } public void render(Screen screen, Level level, int x, int y) { - Tiles.get(level.getData(x, y)).render(screen, level, x, y); + Tiles.get((short) level.getData(x, y)).render(screen, level, x, y); sprite.render(screen, level, x, y); updateConnections(level, x, y); @@ -122,7 +122,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); Sound.play("monsterhurt"); level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get(name)); - level.setTile(xt, yt, Tiles.get(level.getData(xt, yt))); + level.setTile(xt, yt, Tiles.get((short) level.getData(xt, yt))); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); @@ -138,7 +138,7 @@ public void hurt(Level level, int x, int y, int dmg) { level.add(new SmashParticle(x * 16, y * 16)); Sound.play("monsterhurt"); level.dropItem(x * 16 + 8, y * 16 + 8, Items.get(name)); - level.setTile(x, y, Tiles.get(level.getData(x, y))); + level.setTile(x, y, Tiles.get((short) level.getData(x, y))); }; } } From ccb2778cc94008961c13a8fb4596c9b1cde45740 Mon Sep 17 00:00:00 2001 From: SusgUY446 <129160115+SusgUY446@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:09:21 +0100 Subject: [PATCH 215/261] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf93d06fd..8931fce8c 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,8 @@ Because this project uses a build tool called gradle it is very easy to build or 2. Extract the contents of the folder. 3. Open command prompt and enter `cd `, this will open the folder in the command prompt. 4. Type `gradlew run` or `gradlew build` to run or build the program. This might take some time. If on unix, add "./" to - the front. + the front. + If you are using Windows Powershell you need to put ".\" in front of gradlew 1. If you built the project, the jar file is found in `build/libs` 2. If you get an error screaming that you're missing java. You need to [set up](https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html) your From 0ba59b581c57f539a01e54f9cd2aae59c23943b0 Mon Sep 17 00:00:00 2001 From: Zandgall Date: Fri, 15 Mar 2024 11:32:31 -0500 Subject: [PATCH 216/261] Fixed unlocked iron and gold recipes not matching actual recipe --- src/client/resources/resources/recipes.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 69aa5aa8c..e97cf2cc9 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -3333,7 +3333,7 @@ "rewards": { "recipes": { "iron_1": [ - "iron Ore_4", + "iron Ore_3", "coal_1" ] } @@ -3375,7 +3375,7 @@ "rewards": { "recipes": { "gold_1": [ - "gold Ore_4", + "gold Ore_3", "coal_1" ] } From af31a60a91449038169145fcc725a3bbd3de8787 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 16 Mar 2024 19:37:08 +0800 Subject: [PATCH 217/261] Skip changed iron and gold recipes --- src/client/java/minicraft/saveload/Load.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index efc17809a..2c49ea88e 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -828,6 +828,20 @@ public void loadPlayer(Player player, List origData) { costs[j] = costsJson.getString(j); } + // Skipping removed vanilla recipes + if (worldVer.compareTo(new Version("2.2.0-dev6")) <= 0) { + // Iron Ore * 4 + Coal * 1 => Iron * 1 + if (key.equalsIgnoreCase("iron_1") && + costs.length == 2 && costs[0].equalsIgnoreCase("iron Ore_4") && + costs[1].equalsIgnoreCase("coal_1")) + continue; + // Gold Ore * 4 + Coal * 1 => Gold * 1 + if (key.equalsIgnoreCase("gold_1") && + costs.length == 2 && costs[0].equalsIgnoreCase("gold Ore_4") && + costs[1].equalsIgnoreCase("coal_1")) + continue; + } + recipes.add(new Recipe(key, costs)); } From 3bf24718271dae64fa401ee7663c8b97fa4739dd Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 16 Mar 2024 20:01:05 +0800 Subject: [PATCH 218/261] Update recipes.json --- src/client/resources/resources/recipes.json | 5238 +++++-------------- 1 file changed, 1425 insertions(+), 3813 deletions(-) diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 995a0266a..30544adda 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -1,4202 +1,1814 @@ { - "minicraft.advancements.recipes.anvil": { + "minicraft.advancements.recipes.gem_fishing_rod": { + "requirements": [[ + "has_gem", + "has_string" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} + }, + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} } }, - "requirements": [ - [ - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Anvil_1": [ - "Iron_5" - ] - } - } + "rewards": {"recipes": {"Gem Fishing Rod_1": [ + "string_3", + "gem_10" + ]}} }, - "minicraft.advancements.recipes.arrow": { + "minicraft.advancements.recipes.health_potion": { + "requirements": [[ + "has_leather_armor", + "has_gunpowder", + "has_awkward_potion" + ]], "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_leather_armor": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Leather Armor"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gunpowder": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gunpowder"]}]} + }, + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_stone", - "has_wood" - ] - ], - "rewards": { - "recipes": { - "arrow_3": [ - "Stone_2", - "Wood_2" - ] - } - } + "rewards": {"recipes": {"Health Potion_1": [ + "Awkward Potion_1", + "Gunpowder_2", + "Leather Armor_1" + ]}} }, - "minicraft.advancements.recipes.awkward_potion": { + "minicraft.advancements.recipes.green_wool": { + "requirements": [[ + "has_cactus", + "has_wool" + ]], "criteria": { - "has_glass_bottle": { - "conditions": { - "items": [ - { - "items": [ - "Glass Bottle" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cactus": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Cactus"]}]} }, - "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} } }, - "requirements": [ - [ - "has_lapis", - "has_glass_bottle" - ] - ], - "rewards": { - "recipes": { - "Awkward Potion_1": [ - "Lapis_3", - "Glass Bottle_1" - ] - } - } + "rewards": {"recipes": {"Green Wool_1": [ + "Cactus_1", + "Wool_1" + ]}} }, - "minicraft.advancements.recipes.baked_potato": { + "minicraft.advancements.recipes.obsidian_brick": { + "requirements": [["has_raw_obsidian"]], + "criteria": {"has_raw_obsidian": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Raw Obsidian"]}]} + }}, + "rewards": {"recipes": {"Obsidian Brick_1": ["Raw Obsidian_2"]}} + }, + "minicraft.advancements.recipes.plank": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Plank_2": ["Wood_1"]}} + }, + "minicraft.advancements.recipes.leather_armor": { + "requirements": [["has_leather"]], + "criteria": {"has_leather": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Leather"]}]} + }}, + "rewards": {"recipes": {"Leather Armor_1": ["Leather_10"]}} + }, + "minicraft.advancements.recipes.lava_potion": { + "requirements": [[ + "has_awkward_potion", + "has_lava_bucket" + ]], "criteria": { - "has_potato": { - "conditions": { - "items": [ - { - "items": [ - "Potato" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} + }, + "has_lava_bucket": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lava Bucket"]}]} } }, - "requirements": [ - [ - "has_potato" - ] - ], - "rewards": { - "recipes": { - "Baked Potato_1": [ - "Potato_1" - ] - } - } + "rewards": {"recipes": {"Lava Potion_1": [ + "Awkward Potion_1", + "Lava Bucket_1" + ]}} }, - "minicraft.advancements.recipes.bed": { + "minicraft.advancements.recipes.iron_axe": { + "requirements": [[ + "has_wood", + "has_iron" + ]], "criteria": { "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_wool" - ] - ], - "rewards": { - "recipes": { - "Bed_1": [ - "Wood_5", - "Wool_3" - ] - } - } + "rewards": {"recipes": {"Iron Axe_1": [ + "Wood_5", + "Iron_5" + ]}} }, - "minicraft.advancements.recipes.black_clothes": { + "minicraft.advancements.recipes.black_wool": { + "requirements": [[ + "has_coal", + "has_wool" + ]], "criteria": { - "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} + }, + "has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_cloth" - ] - ], - "rewards": { - "recipes": { - "Black Clothes_1": [ - "Coal_1", - "cloth_5" - ] - } - } + "rewards": {"recipes": {"Black Wool_1": [ + "Coal_1", + "Wool_1" + ]}} }, - "minicraft.advancements.recipes.black_wool": { + "minicraft.advancements.recipes.cooked_pork": { + "requirements": [[ + "has_coal", + "has_raw_pork" + ]], "criteria": { "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} }, - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_raw_pork": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Raw Pork"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_wool" - ] - ], - "rewards": { - "recipes": { - "Black Wool_1": [ - "Coal_1", - "Wool_1" - ] - } - } + "rewards": {"recipes": {"Cooked Pork_1": [ + "Coal_1", + "Raw Pork_1" + ]}} }, - "minicraft.advancements.recipes.blue_clothes": { + "minicraft.advancements.recipes.wooden_hoe": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Wood Hoe_1": ["Wood_5"]}} + }, + "minicraft.advancements.recipes.stone_sword": { + "requirements": [[ + "has_stone", + "has_wood" + ]], "criteria": { - "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} }, - "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} } }, - "requirements": [ - [ - "has_lapis", - "has_cloth" - ] - ], - "rewards": { - "recipes": { - "Blue Clothes_1": [ - "Lapis_1", - "cloth_5" - ] - } - } + "rewards": {"recipes": {"Rock Sword_1": [ + "Stone_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.blue_wool": { + "minicraft.advancements.recipes.snake_armor": { + "requirements": [["has_scale"]], + "criteria": {"has_scale": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Scale"]}]} + }}, + "rewards": {"recipes": {"Snake Armor_1": ["Scale_15"]}} + }, + "minicraft.advancements.recipes.shears": { + "requirements": [["has_iron"]], + "criteria": {"has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} + }}, + "rewards": {"recipes": {"Shears_1": ["Iron_4"]}} + }, + "minicraft.advancements.recipes.wood_door": { + "requirements": [["has_plank"]], + "criteria": {"has_plank": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Plank"]}]} + }}, + "rewards": {"recipes": {"Wood Door_1": ["Plank_5"]}} + }, + "minicraft.advancements.recipes.green_clothes": { + "requirements": [[ + "has_cactus", + "has_cloth" + ]], "criteria": { - "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cactus": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Cactus"]}]} }, - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cloth": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} } }, - "requirements": [ - [ - "has_lapis", - "has_wool" - ] - ], - "rewards": { - "recipes": { - "Blue Wool_1": [ - "Lapis_1", - "Wool_1" - ] - } - } + "rewards": {"recipes": {"Green Clothes_1": [ + "Cactus_1", + "cloth_5" + ]}} }, - "minicraft.advancements.recipes.bread": { + "minicraft.advancements.recipes.red_wool": { + "requirements": [[ + "has_rose", + "has_wool" + ]], "criteria": { - "has_wheat": { - "conditions": { - "items": [ - { - "items": [ - "Wheat" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_rose": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Rose"]}]} + }, + "has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} } }, - "requirements": [ - [ - "has_wheat" - ] - ], - "rewards": { - "recipes": { - "Bread_1": [ - "Wheat_4" - ] - } - } + "rewards": {"recipes": {"Red Wool_1": [ + "Rose_1", + "Wool_1" + ]}} }, - "minicraft.advancements.recipes.chest": { + "minicraft.advancements.recipes.stone_bow": { + "requirements": [[ + "has_stone", + "has_wood", + "has_string" + ]], "criteria": { + "has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} + }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} } }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Chest_1": [ - "Wood_20" - ] - } - } + "rewards": {"recipes": {"Rock Bow_1": [ + "string_2", + "Stone_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.cooked_fish": { + "minicraft.advancements.recipes.gem_bow": { + "requirements": [[ + "has_wood", + "has_gem", + "has_string" + ]], "criteria": { - "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_raw_fish": { - "conditions": { - "items": [ - { - "items": [ - "Raw Fish" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} + }, + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_raw_fish" - ] - ], - "rewards": { - "recipes": { - "Cooked Fish_1": [ - "Coal_1", - "Raw Fish_1" - ] - } - } + "rewards": {"recipes": {"Gem Bow_1": [ + "string_2", + "Wood_5", + "gem_50" + ]}} }, - "minicraft.advancements.recipes.cooked_pork": { + "minicraft.advancements.recipes.wooden_axe": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Wood Axe_1": ["Wood_5"]}} + }, + "minicraft.advancements.recipes.stone_brick": { + "requirements": [["has_stone"]], + "criteria": {"has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} + }}, + "rewards": {"recipes": {"Stone Brick_1": ["Stone_2"]}} + }, + "minicraft.advancements.recipes.workbench": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Workbench_1": ["Wood_10"]}} + }, + "minicraft.advancements.recipes.lantern": { + "requirements": [[ + "has_glass", + "has_wood", + "has_slime" + ]], "criteria": { - "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_glass": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["glass"]}]} }, - "has_raw_pork": { - "conditions": { - "items": [ - { - "items": [ - "Raw Pork" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, + "has_slime": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Slime"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_raw_pork" - ] - ], - "rewards": { - "recipes": { - "Cooked Pork_1": [ - "Coal_1", - "Raw Pork_1" - ] - } - } + "rewards": {"recipes": {"Lantern_1": [ + "glass_3", + "Slime_4", + "Wood_8" + ]}} }, - "minicraft.advancements.recipes.cyan_clothes": { + "minicraft.advancements.recipes.gold_armor": { + "requirements": [["has_gold"]], + "criteria": {"has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} + }}, + "rewards": {"recipes": {"Gold Armor_1": ["Gold_10"]}} + }, + "minicraft.advancements.recipes.yellow_clothes": { + "requirements": [[ + "has_cloth", + "has_flower" + ]], "criteria": { - "has_cactus": { - "conditions": { - "items": [ - { - "items": [ - "Cactus" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} }, - "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_flower": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Flower"]}]} } }, - "requirements": [ - [ - "has_cactus", - "has_lapis", - "has_cloth" - ] - ], - "rewards": { - "recipes": { - "Cyan Clothes_1": [ - "Lapis_1", - "cloth_5", - "Cactus_1" - ] - } - } + "rewards": {"recipes": {"Yellow Clothes_1": [ + "Flower_1", + "cloth_5" + ]}} }, - "minicraft.advancements.recipes.empty_bucket": { + "minicraft.advancements.recipes.glass_bottle": { + "requirements": [["has_glass"]], + "criteria": {"has_glass": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["glass"]}]} + }}, + "rewards": {"recipes": {"Glass Bottle_1": ["glass_3"]}} + }, + "minicraft.advancements.recipes.gem_claymore": { + "requirements": [[ + "has_shard", + "has_gem_sword" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_shard": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Shard"]}]} + }, + "has_gem_sword": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gem Sword"]}]} } }, - "requirements": [ - [ - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Empty Bucket_1": [ - "Iron_5" - ] - } - } + "rewards": {"recipes": {"Gem Claymore_1": [ + "Gem Sword_1", + "Shard_15" + ]}} }, - "minicraft.advancements.recipes.enchanter": { + "minicraft.advancements.recipes.wood_fishing_rod": { + "requirements": [[ + "has_wood", + "has_string" + ]], "criteria": { - "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_string", - "has_lapis" - ] - ], - "rewards": { - "recipes": { - "Enchanter_1": [ - "Lapis_10", - "string_2", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Wood Fishing Rod_1": [ + "string_3", + "Wood_10" + ]}} }, - "minicraft.advancements.recipes.energy_potion": { + "minicraft.advancements.recipes.gold_fishing_rod": { + "requirements": [[ + "has_string", + "has_gold" + ]], "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} }, - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_gem", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Energy Potion_1": [ - "Awkward Potion_1", - "gem_25" - ] - } - } + "rewards": {"recipes": {"Gold Fishing Rod_1": [ + "Gold_10", + "string_3" + ]}} }, - "minicraft.advancements.recipes.escape_potion": { + "minicraft.advancements.recipes.purple_clothes": { + "requirements": [[ + "has_rose", + "has_lapis", + "has_cloth" + ]], "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_gunpowder": { - "conditions": { - "items": [ - { - "items": [ - "Gunpowder" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_rose": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Rose"]}]} }, "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} + }, + "has_cloth": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} } }, - "requirements": [ - [ - "has_lapis", - "has_gunpowder", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Escape Potion_1": [ - "Lapis_7", - "Awkward Potion_1", - "Gunpowder_3" - ] - } - } + "rewards": {"recipes": {"Purple Clothes_1": [ + "Lapis_1", + "cloth_5", + "Rose_1" + ]}} }, - "minicraft.advancements.recipes.furnace": { + "minicraft.advancements.recipes.stone_pickaxe": { + "requirements": [[ + "has_stone", + "has_wood" + ]], "criteria": { "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} + }, + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} } }, - "requirements": [ - [ - "has_stone" - ] - ], - "rewards": { - "recipes": { - "Furnace_1": [ - "Stone_20" - ] + "rewards": {"recipes": {"Rock Pickaxe_1": [ + "Stone_5", + "Wood_5" + ]}} + }, + "minicraft.advancements.recipes.blue_clothes": { + "requirements": [[ + "has_lapis", + "has_cloth" + ]], + "criteria": { + "has_lapis": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} + }, + "has_cloth": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} } - } + }, + "rewards": {"recipes": {"Blue Clothes_1": [ + "Lapis_1", + "cloth_5" + ]}} }, - "minicraft.advancements.recipes.gem_armor": { + "minicraft.advancements.recipes.gem_sword": { + "requirements": [[ + "has_wood", + "has_gem" + ]], "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} } }, - "requirements": [ - [ - "has_gem" - ] - ], - "rewards": { - "recipes": { - "Gem Armor_1": [ - "gem_65" - ] - } - } + "rewards": {"recipes": {"Gem Sword_1": [ + "Wood_5", + "gem_50" + ]}} }, - "minicraft.advancements.recipes.gem_axe": { + "minicraft.advancements.recipes.bed": { + "requirements": [[ + "has_wood", + "has_wool" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, + "has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gem" - ] - ], - "rewards": { - "recipes": { - "Gem Axe_1": [ - "Wood_5", - "gem_50" - ] - } - } + "rewards": {"recipes": {"Bed_1": [ + "Wood_5", + "Wool_3" + ]}} }, - "minicraft.advancements.recipes.gem_bow": { + "minicraft.advancements.recipes.swim_potion": { + "requirements": [[ + "has_raw_fish", + "has_awkward_potion" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_raw_fish": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Raw Fish"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gem", - "has_string" - ] - ], - "rewards": { - "recipes": { - "Gem Bow_1": [ - "string_2", - "Wood_5", - "gem_50" - ] - } - } + "rewards": {"recipes": {"Swim Potion_1": [ + "Awkward Potion_1", + "Raw Fish_5" + ]}} }, - "minicraft.advancements.recipes.gem_claymore": { + "minicraft.advancements.recipes.steak": { + "requirements": [[ + "has_coal", + "has_raw_beef" + ]], "criteria": { - "has_gem_sword": { - "conditions": { - "items": [ - { - "items": [ - "Gem Sword" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_coal": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} }, - "has_shard": { - "conditions": { - "items": [ - { - "items": [ - "Shard" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_raw_beef": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Raw Beef"]}]} } }, - "requirements": [ - [ - "has_shard", - "has_gem_sword" - ] - ], - "rewards": { - "recipes": { - "Gem Claymore_1": [ - "Gem Sword_1", - "Shard_15" - ] - } - } + "rewards": {"recipes": {"Steak_1": [ + "Coal_1", + "Raw Beef_1" + ]}} }, - "minicraft.advancements.recipes.gem_fishing_rod": { + "minicraft.advancements.recipes.gem_pickaxe": { + "requirements": [[ + "has_wood", + "has_gem" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} } }, - "requirements": [ - [ - "has_gem", - "has_string" - ] - ], - "rewards": { - "recipes": { - "Gem Fishing Rod_1": [ - "string_3", - "gem_10" - ] - } - } + "rewards": {"recipes": {"Gem Pickaxe_1": [ + "Wood_5", + "gem_50" + ]}} }, - "minicraft.advancements.recipes.gem_hoe": { + "minicraft.advancements.recipes.iron_hoe": { + "requirements": [[ + "has_wood", + "has_iron" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, + "has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gem" - ] - ], - "rewards": { - "recipes": { - "Gem Hoe_1": [ - "Wood_5", - "gem_50" - ] - } - } + "rewards": {"recipes": {"Iron Hoe_1": [ + "Wood_5", + "Iron_5" + ]}} }, - "minicraft.advancements.recipes.gem_pickaxe": { + "minicraft.advancements.recipes.iron_claymore": { + "requirements": [[ + "has_shard", + "has_iron_sword" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_shard": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Shard"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_iron_sword": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron Sword"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gem" - ] - ], - "rewards": { - "recipes": { - "Gem Pickaxe_1": [ - "Wood_5", - "gem_50" - ] - } - } + "rewards": {"recipes": {"Iron Claymore_1": [ + "Iron Sword_1", + "Shard_15" + ]}} }, - "minicraft.advancements.recipes.gem_shovel": { + "minicraft.advancements.recipes.wooden_pickaxe": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Wood Pickaxe_1": ["Wood_5"]}} + }, + "minicraft.advancements.recipes.stone_axe": { + "requirements": [[ + "has_stone", + "has_wood" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gem" - ] - ], - "rewards": { - "recipes": { - "Gem Shovel_1": [ - "Wood_5", - "gem_50" - ] - } - } + "rewards": {"recipes": {"Rock Axe_1": [ + "Stone_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.gem_sword": { + "minicraft.advancements.recipes.orange_clothes": { + "requirements": [[ + "has_rose", + "has_cloth", + "has_flower" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_rose": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Rose"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cloth": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} + }, + "has_flower": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Flower"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gem" - ] - ], - "rewards": { - "recipes": { - "Gem Sword_1": [ - "Wood_5", - "gem_50" - ] - } - } + "rewards": {"recipes": {"Orange Clothes_1": [ + "cloth_5", + "Rose_1", + "Flower_1" + ]}} }, - "minicraft.advancements.recipes.glass": { + "minicraft.advancements.recipes.iron_fishing_rod": { + "requirements": [[ + "has_string", + "has_iron" + ]], "criteria": { - "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} }, - "has_sand": { - "conditions": { - "items": [ - { - "items": [ - "Sand" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_sand" - ] - ], - "rewards": { - "recipes": { - "glass_1": [ - "Coal_1", - "Sand_4" - ] - } - } + "rewards": {"recipes": {"Iron Fishing Rod_1": [ + "string_3", + "Iron_10" + ]}} }, - "minicraft.advancements.recipes.glass_bottle": { + "minicraft.advancements.recipes.iron_pickaxe": { + "requirements": [[ + "has_wood", + "has_iron" + ]], "criteria": { - "has_glass": { - "conditions": { - "items": [ - { - "items": [ - "glass" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, + "has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_glass" - ] - ], - "rewards": { - "recipes": { - "Glass Bottle_1": [ - "glass_3" - ] - } - } + "rewards": {"recipes": {"Iron Pickaxe_1": [ + "Wood_5", + "Iron_5" + ]}} }, - "minicraft.advancements.recipes.gold": { + "minicraft.advancements.recipes.ornate_stone": { + "requirements": [["has_stone"]], + "criteria": {"has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} + }}, + "rewards": {"recipes": {"Ornate Stone_1": ["Stone_2"]}} + }, + "minicraft.advancements.recipes.wooden_bow": { + "requirements": [[ + "has_wood", + "has_string" + ]], "criteria": { - "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_gold_ore": { - "conditions": { - "items": [ - { - "items": [ - "Gold Ore" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_gold_ore" - ] - ], - "rewards": { - "recipes": { - "Gold_1": [ - "Coal_1", - "Gold Ore_4" - ] - } - } + "rewards": {"recipes": {"Wood Bow_1": [ + "string_2", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.gold_armor": { + "minicraft.advancements.recipes.gold_pickaxe": { + "requirements": [[ + "has_wood", + "has_gold" + ]], "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Armor_1": [ - "Gold_10" - ] - } - } + "rewards": {"recipes": {"Gold Pickaxe_1": [ + "Gold_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.gold_axe": { + "minicraft.advancements.recipes.gold": { + "requirements": [[ + "has_coal", + "has_gold_ore" + ]], "criteria": { - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_coal": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gold_ore": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold Ore"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Axe_1": [ - "Gold_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Gold_1": [ + "Coal_1", + "Gold Ore_4" + ]}} }, - "minicraft.advancements.recipes.gold_bow": { + "minicraft.advancements.recipes.cooked_fish": { + "requirements": [[ + "has_coal", + "has_raw_fish" + ]], "criteria": { - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_coal": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_raw_fish": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Raw Fish"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_string", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Bow_1": [ - "Gold_5", - "string_2", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Cooked Fish_1": [ + "Coal_1", + "Raw Fish_1" + ]}} }, - "minicraft.advancements.recipes.gold_claymore": { + "minicraft.advancements.recipes.light_potion": { + "requirements": [[ + "has_slime", + "has_awkward_potion" + ]], "criteria": { - "has_gold_sword": { - "conditions": { - "items": [ - { - "items": [ - "Gold Sword" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_slime": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Slime"]}]} }, - "has_shard": { - "conditions": { - "items": [ - { - "items": [ - "Shard" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_shard", - "has_gold_sword" - ] - ], - "rewards": { - "recipes": { - "Gold Claymore_1": [ - "Shard_15", - "Gold Sword_1" - ] - } - } + "rewards": {"recipes": {"Light Potion_1": [ + "Slime_5", + "Awkward Potion_1" + ]}} }, - "minicraft.advancements.recipes.gold_fishing_rod": { + "minicraft.advancements.recipes.gold_sword": { + "requirements": [[ + "has_wood", + "has_gold" + ]], "criteria": { - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_string", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Fishing Rod_1": [ - "Gold_10", - "string_3" - ] - } - } - }, - "minicraft.advancements.recipes.gold_hoe": { - "criteria": { "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Hoe_1": [ - "Gold_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Gold Sword_1": [ + "Gold_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.gold_lantern": { + "minicraft.advancements.recipes.gold_shovel": { + "requirements": [[ + "has_wood", + "has_gold" + ]], "criteria": { - "has_glass": { - "conditions": { - "items": [ - { - "items": [ - "glass" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_slime": { - "conditions": { - "items": [ - { - "items": [ - "Slime" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_glass", - "has_gold", - "has_slime" - ] - ], - "rewards": { - "recipes": { - "Gold Lantern_1": [ - "glass_4", - "Gold_10", - "Slime_5" - ] - } - } + "rewards": {"recipes": {"Gold Shovel_1": [ + "Gold_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.gold_pickaxe": { + "minicraft.advancements.recipes.stone_shovel": { + "requirements": [[ + "has_stone", + "has_wood" + ]], "criteria": { - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Pickaxe_1": [ - "Gold_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Rock Shovel_1": [ + "Stone_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.gold_shovel": { + "minicraft.advancements.recipes.escape_potion": { + "requirements": [[ + "has_lapis", + "has_gunpowder", + "has_awkward_potion" + ]], "criteria": { - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_lapis": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gunpowder": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gunpowder"]}]} + }, + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Shovel_1": [ - "Gold_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Escape Potion_1": [ + "Lapis_7", + "Awkward Potion_1", + "Gunpowder_3" + ]}} }, - "minicraft.advancements.recipes.gold_sword": { + "minicraft.advancements.recipes.obsidian_wall": { + "requirements": [["has_obsidian_brick"]], + "criteria": {"has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Obsidian Brick"]}]} + }}, + "rewards": {"recipes": {"Obsidian Wall_1": ["Obsidian Brick_3"]}} + }, + "minicraft.advancements.recipes.cyan_clothes": { + "requirements": [[ + "has_cactus", + "has_lapis", + "has_cloth" + ]], "criteria": { - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cactus": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Cactus"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_lapis": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} + }, + "has_cloth": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Sword_1": [ - "Gold_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Cyan Clothes_1": [ + "Lapis_1", + "cloth_5", + "Cactus_1" + ]}} + }, + "minicraft.advancements.recipes.gem_armor": { + "requirements": [["has_gem"]], + "criteria": {"has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} + }}, + "rewards": {"recipes": {"Gem Armor_1": ["gem_65"]}} }, "minicraft.advancements.recipes.golden_apple": { + "requirements": [[ + "has_apple", + "has_gold" + ]], "criteria": { "has_apple": { - "conditions": { - "items": [ - { - "items": [ - "Apple" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Apple"]}]} }, "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_apple", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Gold Apple_1": [ - "Gold_8", - "Apple_1" - ] - } - } + "rewards": {"recipes": {"Gold Apple_1": [ + "Gold_8", + "Apple_1" + ]}} }, - "minicraft.advancements.recipes.green_clothes": { + "minicraft.advancements.recipes.arrow": { + "requirements": [[ + "has_stone", + "has_wood" + ]], "criteria": { - "has_cactus": { - "conditions": { - "items": [ - { - "items": [ - "Cactus" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} }, - "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} } }, - "requirements": [ - [ - "has_cactus", - "has_cloth" - ] - ], - "rewards": { - "recipes": { - "Green Clothes_1": [ - "Cactus_1", - "cloth_5" - ] - } - } + "rewards": {"recipes": {"arrow_3": [ + "Stone_2", + "Wood_2" + ]}} }, - "minicraft.advancements.recipes.green_wool": { + "minicraft.advancements.recipes.stone_wall": { + "requirements": [["has_stone_brick"]], + "criteria": {"has_stone_brick": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone Brick"]}]} + }}, + "rewards": {"recipes": {"Stone Wall_1": ["Stone Brick_3"]}} + }, + "minicraft.advancements.recipes.glass": { + "requirements": [[ + "has_coal", + "has_sand" + ]], "criteria": { - "has_cactus": { - "conditions": { - "items": [ - { - "items": [ - "Cactus" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_coal": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} }, - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_sand": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Sand"]}]} } }, - "requirements": [ - [ - "has_cactus", - "has_wool" - ] - ], - "rewards": { - "recipes": { - "Green Wool_1": [ - "Cactus_1", - "Wool_1" - ] - } - } + "rewards": {"recipes": {"glass_1": [ + "Coal_1", + "Sand_4" + ]}} }, - "minicraft.advancements.recipes.haste_potion": { + "minicraft.advancements.recipes.speed_potion": { + "requirements": [[ + "has_cactus", + "has_awkward_potion" + ]], "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cactus": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Cactus"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_stone", - "has_wood", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Haste Potion_1": [ - "Awkward Potion_1", - "Stone_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Speed Potion_1": [ + "Cactus_5", + "Awkward Potion_1" + ]}} }, - "minicraft.advancements.recipes.health_potion": { + "minicraft.advancements.recipes.gold_bow": { + "requirements": [[ + "has_wood", + "has_string", + "has_gold" + ]], "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_gunpowder": { - "conditions": { - "items": [ - { - "items": [ - "Gunpowder" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} }, - "has_leather_armor": { - "conditions": { - "items": [ - { - "items": [ - "Leather Armor" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_leather_armor", - "has_gunpowder", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Health Potion_1": [ - "Awkward Potion_1", - "Gunpowder_2", - "Leather Armor_1" - ] - } - } + "rewards": {"recipes": {"Gold Bow_1": [ + "Gold_5", + "string_2", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.iron": { + "minicraft.advancements.recipes.gold_lantern": { + "requirements": [[ + "has_glass", + "has_gold", + "has_slime" + ]], "criteria": { - "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_glass": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["glass"]}]} }, - "has_iron_ore": { - "conditions": { - "items": [ - { - "items": [ - "Iron Ore" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} + }, + "has_slime": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Slime"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_iron_ore" - ] - ], - "rewards": { - "recipes": { - "Iron_1": [ - "Coal_1", - "Iron Ore_4" - ] - } - } + "rewards": {"recipes": {"Gold Lantern_1": [ + "glass_4", + "Gold_10", + "Slime_5" + ]}} + }, + "minicraft.advancements.recipes.plank_wall": { + "requirements": [["has_plank"]], + "criteria": {"has_plank": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Plank"]}]} + }}, + "rewards": {"recipes": {"Plank Wall_1": ["Plank_3"]}} }, "minicraft.advancements.recipes.iron_armor": { + "requirements": [["has_iron"]], + "criteria": {"has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} + }}, + "rewards": {"recipes": {"Iron Armor_1": ["Iron_10"]}} + }, + "minicraft.advancements.recipes.iron_shovel": { + "requirements": [[ + "has_wood", + "has_iron" + ]], "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Armor_1": [ - "Iron_10" - ] - } - } + "rewards": {"recipes": {"Iron Shovel_1": [ + "Wood_5", + "Iron_5" + ]}} }, - "minicraft.advancements.recipes.iron_axe": { + "minicraft.advancements.recipes.yellow_wool": { + "requirements": [[ + "has_wool", + "has_flower" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_flower": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Flower"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Axe_1": [ - "Wood_5", - "Iron_5" - ] - } - } + "rewards": {"recipes": {"Yellow Wool_1": [ + "Flower_1", + "Wool_1" + ]}} }, - "minicraft.advancements.recipes.iron_bow": { + "minicraft.advancements.recipes.obsidian_door": { + "requirements": [["has_obsidian_brick"]], + "criteria": {"has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Obsidian Brick"]}]} + }}, + "rewards": {"recipes": {"Obsidian Door_1": ["Obsidian Brick_5"]}} + }, + "minicraft.advancements.recipes.stone_hoe": { + "requirements": [[ + "has_stone", + "has_wood" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_string", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Bow_1": [ - "string_2", - "Iron_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Rock Hoe_1": [ + "Stone_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.iron_claymore": { + "minicraft.advancements.recipes.chest": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Chest_1": ["Wood_20"]}} + }, + "minicraft.advancements.recipes.gem_hoe": { + "requirements": [[ + "has_wood", + "has_gem" + ]], "criteria": { - "has_iron_sword": { - "conditions": { - "items": [ - { - "items": [ - "Iron Sword" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_shard": { - "conditions": { - "items": [ - { - "items": [ - "Shard" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} } }, - "requirements": [ - [ - "has_shard", - "has_iron_sword" - ] - ], - "rewards": { - "recipes": { - "Iron Claymore_1": [ - "Iron Sword_1", - "Shard_15" - ] - } - } + "rewards": {"recipes": {"Gem Hoe_1": [ + "Wood_5", + "gem_50" + ]}} }, - "minicraft.advancements.recipes.iron_fishing_rod": { + "minicraft.advancements.recipes.awkward_potion": { + "requirements": [[ + "has_lapis", + "has_glass_bottle" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_lapis": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_glass_bottle": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Glass Bottle"]}]} } }, - "requirements": [ - [ - "has_string", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Fishing Rod_1": [ - "string_3", - "Iron_10" - ] - } - } + "rewards": {"recipes": {"Awkward Potion_1": [ + "Lapis_3", + "Glass Bottle_1" + ]}} }, - "minicraft.advancements.recipes.iron_hoe": { + "minicraft.advancements.recipes.reg_clothes": { + "requirements": [["has_cloth"]], + "criteria": {"has_cloth": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} + }}, + "rewards": {"recipes": {"Reg Clothes_1": ["cloth_5"]}} + }, + "minicraft.advancements.recipes.totem_of_air": { + "requirements": [[ + "has_gem", + "has_cloud_ore", + "has_lapis", + "has_gold" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cloud_ore": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Cloud Ore"]}]} + }, + "has_lapis": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} + }, + "has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Hoe_1": [ - "Wood_5", - "Iron_5" - ] - } - } + "rewards": {"recipes": {"Totem of Air_1": [ + "Lapis_5", + "Gold_10", + "gem_10", + "Cloud Ore_5" + ]}} }, - "minicraft.advancements.recipes.iron_lantern": { + "minicraft.advancements.recipes.iron_bow": { + "requirements": [[ + "has_wood", + "has_string", + "has_iron" + ]], "criteria": { - "has_glass": { - "conditions": { - "items": [ - { - "items": [ - "glass" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} }, - "has_slime": { - "conditions": { - "items": [ - { - "items": [ - "Slime" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_glass", - "has_slime", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Lantern_1": [ - "glass_4", - "Iron_8", - "Slime_5" - ] - } - } + "rewards": {"recipes": {"Iron Bow_1": [ + "string_2", + "Iron_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.iron_pickaxe": { + "minicraft.advancements.recipes.wooden_shovel": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Wood Shovel_1": ["Wood_5"]}} + }, + "minicraft.advancements.recipes.string": { + "requirements": [["has_wool"]], + "criteria": {"has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} + }}, + "rewards": {"recipes": {"string_2": ["Wool_1"]}} + }, + "minicraft.advancements.recipes.loom": { + "requirements": [[ + "has_wood", + "has_wool" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, + "has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Pickaxe_1": [ - "Wood_5", - "Iron_5" - ] - } - } + "rewards": {"recipes": {"Loom_1": [ + "Wood_10", + "Wool_5" + ]}} }, - "minicraft.advancements.recipes.iron_shovel": { + "minicraft.advancements.recipes.bread": { + "requirements": [["has_wheat"]], + "criteria": {"has_wheat": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wheat"]}]} + }}, + "rewards": {"recipes": {"Bread_1": ["Wheat_4"]}} + }, + "minicraft.advancements.recipes.anvil": { + "requirements": [["has_iron"]], + "criteria": {"has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} + }}, + "rewards": {"recipes": {"Anvil_1": ["Iron_5"]}} + }, + "minicraft.advancements.recipes.torch": { + "requirements": [[ + "has_coal", + "has_wood" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_coal": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Shovel_1": [ - "Wood_5", - "Iron_5" - ] - } - } + "rewards": {"recipes": {"Torch_2": [ + "Coal_1", + "Wood_1" + ]}} }, - "minicraft.advancements.recipes.iron_sword": { + "minicraft.advancements.recipes.gold_axe": { + "requirements": [[ + "has_wood", + "has_gold" + ]], "criteria": { - "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }, + "has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Iron Sword_1": [ - "Wood_5", - "Iron_5" - ] - } - } + "rewards": {"recipes": {"Gold Axe_1": [ + "Gold_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.lantern": { + "minicraft.advancements.recipes.iron_lantern": { + "requirements": [[ + "has_glass", + "has_slime", + "has_iron" + ]], "criteria": { "has_glass": { - "conditions": { - "items": [ - { - "items": [ - "glass" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["glass"]}]} }, "has_slime": { - "conditions": { - "items": [ - { - "items": [ - "Slime" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Slime"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_glass", - "has_wood", - "has_slime" - ] - ], - "rewards": { - "recipes": { - "Lantern_1": [ - "glass_3", - "Slime_4", - "Wood_8" - ] - } - } + "rewards": {"recipes": {"Iron Lantern_1": [ + "glass_4", + "Iron_8", + "Slime_5" + ]}} }, - "minicraft.advancements.recipes.lava_potion": { + "minicraft.advancements.recipes.enchanter": { + "requirements": [[ + "has_wood", + "has_string", + "has_lapis" + ]], "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_lava_bucket": { - "conditions": { - "items": [ - { - "items": [ - "Lava Bucket" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_awkward_potion", - "has_lava_bucket" - ] - ], - "rewards": { - "recipes": { - "Lava Potion_1": [ - "Awkward Potion_1", - "Lava Bucket_1" - ] - } - } - }, - "minicraft.advancements.recipes.leather_armor": { - "criteria": { - "has_leather": { - "conditions": { - "items": [ - { - "items": [ - "Leather" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_string": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["string"]}]} + }, + "has_lapis": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} } }, - "requirements": [ - [ - "has_leather" - ] - ], - "rewards": { - "recipes": { - "Leather Armor_1": [ - "Leather_10" - ] - } - } + "rewards": {"recipes": {"Enchanter_1": [ + "Lapis_10", + "string_2", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.light_potion": { + "minicraft.advancements.recipes.gold_claymore": { + "requirements": [[ + "has_shard", + "has_gold_sword" + ]], "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_shard": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Shard"]}]} }, - "has_slime": { - "conditions": { - "items": [ - { - "items": [ - "Slime" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gold_sword": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold Sword"]}]} } }, - "requirements": [ - [ - "has_slime", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Light Potion_1": [ - "Slime_5", - "Awkward Potion_1" - ] - } - } + "rewards": {"recipes": {"Gold Claymore_1": [ + "Shard_15", + "Gold Sword_1" + ]}} }, - "minicraft.advancements.recipes.loom": { + "minicraft.advancements.recipes.baked_potato": { + "requirements": [["has_potato"]], + "criteria": {"has_potato": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Potato"]}]} + }}, + "rewards": {"recipes": {"Baked Potato_1": ["Potato_1"]}} + }, + "minicraft.advancements.recipes.empty_bucket": { + "requirements": [["has_iron"]], + "criteria": {"has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} + }}, + "rewards": {"recipes": {"Empty Bucket_1": ["Iron_5"]}} + }, + "minicraft.advancements.recipes.gold_hoe": { + "requirements": [[ + "has_wood", + "has_gold" + ]], "criteria": { "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_wool" - ] - ], - "rewards": { - "recipes": { - "Loom_1": [ - "Wood_10", - "Wool_5" - ] - } - } + "rewards": {"recipes": {"Gold Hoe_1": [ + "Gold_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.obsidian_brick": { + "minicraft.advancements.recipes.iron": { + "requirements": [[ + "has_coal", + "has_iron_ore" + ]], "criteria": { - "has_raw_obsidian": { - "conditions": { - "items": [ - { - "items": [ - "Raw Obsidian" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_coal": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} + }, + "has_iron_ore": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron Ore"]}]} } }, - "requirements": [ - [ - "has_raw_obsidian" - ] - ], - "rewards": { - "recipes": { - "Obsidian Brick_1": [ - "Raw Obsidian_2" - ] - } - } + "rewards": {"recipes": {"Iron_1": [ + "Coal_1", + "Iron Ore_4" + ]}} }, - "minicraft.advancements.recipes.obsidian_door": { - "criteria": { - "has_obsidian_brick": { - "conditions": { - "items": [ - { - "items": [ - "Obsidian Brick" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_obsidian_brick" - ] - ], - "rewards": { - "recipes": { - "Obsidian Door_1": [ - "Obsidian Brick_5" - ] - } - } + "minicraft.advancements.recipes.stone_door": { + "requirements": [["has_stone_brick"]], + "criteria": {"has_stone_brick": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone Brick"]}]} + }}, + "rewards": {"recipes": {"Stone Door_1": ["Stone Brick_5"]}} }, "minicraft.advancements.recipes.obsidian_poppet": { + "requirements": [[ + "has_shard", + "has_gem", + "has_lapis", + "has_gold" + ]], "criteria": { - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_shard": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Shard"]}]} }, - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} }, "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} }, - "has_shard": { - "conditions": { - "items": [ - { - "items": [ - "Shard" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_shard", - "has_gem", - "has_lapis", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Obsidian Poppet_1": [ - "Lapis_5", - "Gold_10", - "Shard_15", - "gem_10" - ] - } - } - }, - "minicraft.advancements.recipes.obsidian_wall": { - "criteria": { - "has_obsidian_brick": { - "conditions": { - "items": [ - { - "items": [ - "Obsidian Brick" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_obsidian_brick" - ] - ], - "rewards": { - "recipes": { - "Obsidian Wall_1": [ - "Obsidian Brick_3" - ] - } - } - }, - "minicraft.advancements.recipes.orange_clothes": { - "criteria": { - "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_flower": { - "conditions": { - "items": [ - { - "items": [ - "Flower" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_rose": { - "conditions": { - "items": [ - { - "items": [ - "Rose" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_rose", - "has_cloth", - "has_flower" - ] - ], - "rewards": { - "recipes": { - "Orange Clothes_1": [ - "cloth_5", - "Rose_1", - "Flower_1" - ] - } - } - }, - "minicraft.advancements.recipes.ornate_obsidian": { - "criteria": { - "has_raw_obsidian": { - "conditions": { - "items": [ - { - "items": [ - "Raw Obsidian" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_raw_obsidian" - ] - ], - "rewards": { - "recipes": { - "Ornate Obsidian_1": [ - "Raw Obsidian_2" - ] - } - } - }, - "minicraft.advancements.recipes.ornate_stone": { - "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone" - ] - ], - "rewards": { - "recipes": { - "Ornate Stone_1": [ - "Stone_2" - ] - } - } - }, - "minicraft.advancements.recipes.oven": { - "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gold": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold"]}]} } }, - "requirements": [ - [ - "has_stone" - ] - ], - "rewards": { - "recipes": { - "Oven_1": [ - "Stone_15" - ] - } - } + "rewards": {"recipes": {"Obsidian Poppet_1": [ + "Lapis_5", + "Gold_10", + "Shard_15", + "gem_10" + ]}} }, - "minicraft.advancements.recipes.plank": { + "minicraft.advancements.recipes.gem_axe": { + "requirements": [[ + "has_wood", + "has_gem" + ]], "criteria": { "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Plank_2": [ - "Wood_1" - ] - } - } - }, - "minicraft.advancements.recipes.plank_wall": { - "criteria": { - "has_plank": { - "conditions": { - "items": [ - { - "items": [ - "Plank" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_plank" - ] - ], - "rewards": { - "recipes": { - "Plank Wall_1": [ - "Plank_3" - ] - } - } - }, - "minicraft.advancements.recipes.purple_clothes": { - "criteria": { - "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_rose": { - "conditions": { - "items": [ - { - "items": [ - "Rose" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} } }, - "requirements": [ - [ - "has_rose", - "has_lapis", - "has_cloth" - ] - ], - "rewards": { - "recipes": { - "Purple Clothes_1": [ - "Lapis_1", - "cloth_5", - "Rose_1" - ] - } - } + "rewards": {"recipes": {"Gem Axe_1": [ + "Wood_5", + "gem_50" + ]}} }, - "minicraft.advancements.recipes.red_wool": { + "minicraft.advancements.recipes.tnt": { + "requirements": [[ + "has_sand", + "has_gunpowder" + ]], "criteria": { - "has_rose": { - "conditions": { - "items": [ - { - "items": [ - "Rose" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_sand": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Sand"]}]} }, - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_rose", - "has_wool" - ] - ], - "rewards": { - "recipes": { - "Red Wool_1": [ - "Rose_1", - "Wool_1" - ] - } - } - }, - "minicraft.advancements.recipes.reg_clothes": { - "criteria": { - "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gunpowder": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gunpowder"]}]} } }, - "requirements": [ - [ - "has_cloth" - ] - ], - "rewards": { - "recipes": { - "Reg Clothes_1": [ - "cloth_5" - ] - } - } + "rewards": {"recipes": {"Tnt_1": [ + "Sand_8", + "Gunpowder_10" + ]}} }, - "minicraft.advancements.recipes.regen_potion": { + "minicraft.advancements.recipes.iron_sword": { + "requirements": [[ + "has_wood", + "has_iron" + ]], "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_golden_apple": { - "conditions": { - "items": [ - { - "items": [ - "Gold Apple" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_golden_apple", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Regen Potion_1": [ - "Gold Apple_1", - "Awkward Potion_1" - ] - } - } - }, - "minicraft.advancements.recipes.shears": { - "criteria": { "has_iron": { - "conditions": { - "items": [ - { - "items": [ - "Iron" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} } }, - "requirements": [ - [ - "has_iron" - ] - ], - "rewards": { - "recipes": { - "Shears_1": [ - "Iron_4" - ] - } - } + "rewards": {"recipes": {"Iron Sword_1": [ + "Wood_5", + "Iron_5" + ]}} }, - "minicraft.advancements.recipes.snake_armor": { - "criteria": { - "has_scale": { - "conditions": { - "items": [ - { - "items": [ - "Scale" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_scale" - ] - ], - "rewards": { - "recipes": { - "Snake Armor_1": [ - "Scale_15" - ] - } - } - }, - "minicraft.advancements.recipes.speed_potion": { - "criteria": { - "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_cactus": { - "conditions": { - "items": [ - { - "items": [ - "Cactus" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_cactus", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Speed Potion_1": [ - "Cactus_5", - "Awkward Potion_1" - ] - } - } - }, - "minicraft.advancements.recipes.steak": { - "criteria": { - "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_raw_beef": { - "conditions": { - "items": [ - { - "items": [ - "Raw Beef" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_coal", - "has_raw_beef" - ] - ], - "rewards": { - "recipes": { - "Steak_1": [ - "Coal_1", - "Raw Beef_1" - ] - } - } + "minicraft.advancements.recipes.wooden_sword": { + "requirements": [["has_wood"]], + "criteria": {"has_wood": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} + }}, + "rewards": {"recipes": {"Wood Sword_1": ["Wood_5"]}} }, - "minicraft.advancements.recipes.stone_axe": { - "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone", - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Rock Axe_1": [ - "Stone_5", - "Wood_5" - ] - } - } + "minicraft.advancements.recipes.furnace": { + "requirements": [["has_stone"]], + "criteria": {"has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} + }}, + "rewards": {"recipes": {"Furnace_1": ["Stone_20"]}} }, - "minicraft.advancements.recipes.stone_bow": { + "minicraft.advancements.recipes.gem_shovel": { + "requirements": [[ + "has_wood", + "has_gem" + ]], "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone", - "has_wood", - "has_string" - ] - ], - "rewards": { - "recipes": { - "Rock Bow_1": [ - "string_2", - "Stone_5", - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.stone_brick": { - "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone" - ] - ], - "rewards": { - "recipes": { - "Stone Brick_1": [ - "Stone_2" - ] - } - } - }, - "minicraft.advancements.recipes.stone_door": { - "criteria": { - "has_stone_brick": { - "conditions": { - "items": [ - { - "items": [ - "Stone Brick" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone_brick" - ] - ], - "rewards": { - "recipes": { - "Stone Door_1": [ - "Stone Brick_5" - ] - } - } - }, - "minicraft.advancements.recipes.stone_hoe": { - "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} } }, - "requirements": [ - [ - "has_stone", - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Rock Hoe_1": [ - "Stone_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Gem Shovel_1": [ + "Wood_5", + "gem_50" + ]}} }, - "minicraft.advancements.recipes.stone_pickaxe": { + "minicraft.advancements.recipes.black_clothes": { + "requirements": [[ + "has_coal", + "has_cloth" + ]], "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_coal": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Coal"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_cloth": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["cloth"]}]} } }, - "requirements": [ - [ - "has_stone", - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Rock Pickaxe_1": [ - "Stone_5", - "Wood_5" - ] - } - } + "rewards": {"recipes": {"Black Clothes_1": [ + "Coal_1", + "cloth_5" + ]}} }, - "minicraft.advancements.recipes.stone_shovel": { + "minicraft.advancements.recipes.haste_potion": { + "requirements": [[ + "has_stone", + "has_wood", + "has_awkward_potion" + ]], "criteria": { "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} }, "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone", - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Rock Shovel_1": [ - "Stone_5", - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.stone_sword": { - "criteria": { - "has_stone": { - "conditions": { - "items": [ - { - "items": [ - "Stone" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wood"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone", - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Rock Sword_1": [ - "Stone_5", - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.stone_wall": { - "criteria": { - "has_stone_brick": { - "conditions": { - "items": [ - { - "items": [ - "Stone Brick" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_stone_brick" - ] - ], - "rewards": { - "recipes": { - "Stone Wall_1": [ - "Stone Brick_3" - ] - } - } - }, - "minicraft.advancements.recipes.string": { - "criteria": { - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wool" - ] - ], - "rewards": { - "recipes": { - "string_2": [ - "Wool_1" - ] - } - } - }, - "minicraft.advancements.recipes.swim_potion": { - "criteria": { "has_awkward_potion": { - "conditions": { - "items": [ - { - "items": [ - "Awkward Potion" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_raw_fish": { - "conditions": { - "items": [ - { - "items": [ - "Raw Fish" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_raw_fish", - "has_awkward_potion" - ] - ], - "rewards": { - "recipes": { - "Swim Potion_1": [ - "Awkward Potion_1", - "Raw Fish_5" - ] - } - } - }, - "minicraft.advancements.recipes.tnt": { - "criteria": { - "has_gunpowder": { - "conditions": { - "items": [ - { - "items": [ - "Gunpowder" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_sand": { - "conditions": { - "items": [ - { - "items": [ - "Sand" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_sand", - "has_gunpowder" - ] - ], - "rewards": { - "recipes": { - "Tnt_1": [ - "Sand_8", - "Gunpowder_10" - ] - } - } - }, - "minicraft.advancements.recipes.torch": { - "criteria": { - "has_coal": { - "conditions": { - "items": [ - { - "items": [ - "Coal" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_coal", - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Torch_2": [ - "Coal_1", - "Wood_1" - ] - } - } + "rewards": {"recipes": {"Haste Potion_1": [ + "Awkward Potion_1", + "Stone_5", + "Wood_5" + ]}} }, - "minicraft.advancements.recipes.totem_of_air": { + "minicraft.advancements.recipes.blue_wool": { + "requirements": [[ + "has_lapis", + "has_wool" + ]], "criteria": { - "has_cloud_ore": { - "conditions": { - "items": [ - { - "items": [ - "Cloud Ore" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_gem": { - "conditions": { - "items": [ - { - "items": [ - "gem" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_gold": { - "conditions": { - "items": [ - { - "items": [ - "Gold" - ] - } - ] - }, - "trigger": "inventory_changed" - }, "has_lapis": { - "conditions": { - "items": [ - { - "items": [ - "Lapis" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_gem", - "has_cloud_ore", - "has_lapis", - "has_gold" - ] - ], - "rewards": { - "recipes": { - "Totem of Air_1": [ - "Lapis_5", - "Gold_10", - "gem_10", - "Cloud Ore_5" - ] - } - } - }, - "minicraft.advancements.recipes.wood_door": { - "criteria": { - "has_plank": { - "conditions": { - "items": [ - { - "items": [ - "Plank" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_plank" - ] - ], - "rewards": { - "recipes": { - "Wood Door_1": [ - "Plank_5" - ] - } - } - }, - "minicraft.advancements.recipes.wood_fishing_rod": { - "criteria": { - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_wool": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Wool"]}]} } }, - "requirements": [ - [ - "has_wood", - "has_string" - ] - ], - "rewards": { - "recipes": { - "Wood Fishing Rod_1": [ - "string_3", - "Wood_10" - ] - } - } + "rewards": {"recipes": {"Blue Wool_1": [ + "Lapis_1", + "Wool_1" + ]}} }, - "minicraft.advancements.recipes.wooden_axe": { - "criteria": { - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Wood Axe_1": [ - "Wood_5" - ] - } - } + "minicraft.advancements.recipes.ornate_obsidian": { + "requirements": [["has_raw_obsidian"]], + "criteria": {"has_raw_obsidian": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Raw Obsidian"]}]} + }}, + "rewards": {"recipes": {"Ornate Obsidian_1": ["Raw Obsidian_2"]}} }, - "minicraft.advancements.recipes.wooden_bow": { + "minicraft.advancements.recipes.energy_potion": { + "requirements": [[ + "has_gem", + "has_awkward_potion" + ]], "criteria": { - "has_string": { - "conditions": { - "items": [ - { - "items": [ - "string" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_gem": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["gem"]}]} }, - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wood", - "has_string" - ] - ], - "rewards": { - "recipes": { - "Wood Bow_1": [ - "string_2", - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.wooden_hoe": { - "criteria": { - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Wood Hoe_1": [ - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.wooden_pickaxe": { - "criteria": { - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Wood Pickaxe_1": [ - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.wooden_shovel": { - "criteria": { - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Wood Shovel_1": [ - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.wooden_sword": { - "criteria": { - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Wood Sword_1": [ - "Wood_5" - ] - } - } - }, - "minicraft.advancements.recipes.workbench": { - "criteria": { - "has_wood": { - "conditions": { - "items": [ - { - "items": [ - "Wood" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_wood" - ] - ], - "rewards": { - "recipes": { - "Workbench_1": [ - "Wood_10" - ] - } - } + "rewards": {"recipes": {"Energy Potion_1": [ + "Awkward Potion_1", + "gem_25" + ]}} }, - "minicraft.advancements.recipes.yellow_clothes": { - "criteria": { - "has_cloth": { - "conditions": { - "items": [ - { - "items": [ - "cloth" - ] - } - ] - }, - "trigger": "inventory_changed" - }, - "has_flower": { - "conditions": { - "items": [ - { - "items": [ - "Flower" - ] - } - ] - }, - "trigger": "inventory_changed" - } - }, - "requirements": [ - [ - "has_cloth", - "has_flower" - ] - ], - "rewards": { - "recipes": { - "Yellow Clothes_1": [ - "Flower_1", - "cloth_5" - ] - } - } + "minicraft.advancements.recipes.oven": { + "requirements": [["has_stone"]], + "criteria": {"has_stone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone"]}]} + }}, + "rewards": {"recipes": {"Oven_1": ["Stone_15"]}} }, - "minicraft.advancements.recipes.yellow_wool": { + "minicraft.advancements.recipes.regen_potion": { + "requirements": [[ + "has_golden_apple", + "has_awkward_potion" + ]], "criteria": { - "has_flower": { - "conditions": { - "items": [ - { - "items": [ - "Flower" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_golden_apple": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Gold Apple"]}]} }, - "has_wool": { - "conditions": { - "items": [ - { - "items": [ - "Wool" - ] - } - ] - }, - "trigger": "inventory_changed" + "has_awkward_potion": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Awkward Potion"]}]} } }, - "requirements": [ - [ - "has_wool", - "has_flower" - ] - ], - "rewards": { - "recipes": { - "Yellow Wool_1": [ - "Flower_1", - "Wool_1" - ] - } - } + "rewards": {"recipes": {"Regen Potion_1": [ + "Gold Apple_1", + "Awkward Potion_1" + ]}} } -} +} \ No newline at end of file From 1d5c889014ae4bcdee90f1ae0c793195a9e6bf2e Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 16 Mar 2024 20:31:22 +0800 Subject: [PATCH 219/261] Update recipes.json --- src/client/resources/resources/recipes.json | 196 +++++++++++++------- 1 file changed, 124 insertions(+), 72 deletions(-) diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 2c99b157c..8239abaf9 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -7,16 +7,16 @@ "criteria": { "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} } }, "rewards": {"recipes": {"Gem Fishing Rod_1": [ - "string_3", - "gem_10" + "String_3", + "Gem_10" ]}} }, "minicraft.advancements.recipes.health_potion": { @@ -221,6 +221,14 @@ }}, "rewards": {"recipes": {"Wood Door_1": ["Plank_5"]}} }, + "minicraft.advancements.recipes.stone_fence": { + "requirements": [["has_stone_brick"]], + "criteria": {"has_stone_brick": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Stone Brick"]}]} + }}, + "rewards": {"recipes": {"Stone Fence_1": ["Stone Brick_3"]}} + }, "minicraft.advancements.recipes.green_clothes": { "requirements": [[ "has_cactus", @@ -233,12 +241,12 @@ }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} } }, "rewards": {"recipes": {"Green Clothes_1": [ "Cactus_1", - "cloth_5" + "Cloth_5" ]}} }, "minicraft.advancements.recipes.red_wool": { @@ -278,11 +286,11 @@ }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} } }, "rewards": {"recipes": {"Rock Bow_1": [ - "string_2", + "String_2", "Stone_5", "Wood_5" ]}} @@ -300,17 +308,17 @@ }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} } }, "rewards": {"recipes": {"Gem Bow_1": [ - "string_2", + "String_2", "Wood_5", - "gem_50" + "Gem_50" ]}} }, "minicraft.advancements.recipes.wooden_axe": { @@ -346,7 +354,7 @@ "criteria": { "has_glass": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["glass"]}]} + "conditions": {"items": [{"items": ["Glass"]}]} }, "has_wood": { "trigger": "inventory_changed", @@ -358,7 +366,7 @@ } }, "rewards": {"recipes": {"Lantern_1": [ - "glass_3", + "Glass_3", "Slime_4", "Wood_8" ]}} @@ -379,7 +387,7 @@ "criteria": { "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} }, "has_flower": { "trigger": "inventory_changed", @@ -388,16 +396,16 @@ }, "rewards": {"recipes": {"Yellow Clothes_1": [ "Flower_1", - "cloth_5" + "Cloth_5" ]}} }, "minicraft.advancements.recipes.glass_bottle": { "requirements": [["has_glass"]], "criteria": {"has_glass": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["glass"]}]} + "conditions": {"items": [{"items": ["Glass"]}]} }}, - "rewards": {"recipes": {"Glass Bottle_1": ["glass_3"]}} + "rewards": {"recipes": {"Glass Bottle_1": ["Glass_3"]}} }, "minicraft.advancements.recipes.gem_claymore": { "requirements": [[ @@ -419,6 +427,14 @@ "Shard_15" ]}} }, + "minicraft.advancements.recipes.wood_fence": { + "requirements": [["has_plank"]], + "criteria": {"has_plank": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Plank"]}]} + }}, + "rewards": {"recipes": {"Wood Fence_1": ["Plank_3"]}} + }, "minicraft.advancements.recipes.wood_fishing_rod": { "requirements": [[ "has_wood", @@ -431,11 +447,11 @@ }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} } }, "rewards": {"recipes": {"Wood Fishing Rod_1": [ - "string_3", + "String_3", "Wood_10" ]}} }, @@ -447,7 +463,7 @@ "criteria": { "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} }, "has_gold": { "trigger": "inventory_changed", @@ -456,7 +472,7 @@ }, "rewards": {"recipes": {"Gold Fishing Rod_1": [ "Gold_10", - "string_3" + "String_3" ]}} }, "minicraft.advancements.recipes.purple_clothes": { @@ -476,12 +492,12 @@ }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} } }, "rewards": {"recipes": {"Purple Clothes_1": [ "Lapis_1", - "cloth_5", + "Cloth_5", "Rose_1" ]}} }, @@ -517,14 +533,22 @@ }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} } }, "rewards": {"recipes": {"Blue Clothes_1": [ "Lapis_1", - "cloth_5" + "Cloth_5" ]}} }, + "minicraft.advancements.recipes.watering_can": { + "requirements": [["has_iron"]], + "criteria": {"has_iron": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Iron"]}]} + }}, + "rewards": {"recipes": {"Watering Can_1": ["Iron_3"]}} + }, "minicraft.advancements.recipes.gem_sword": { "requirements": [[ "has_wood", @@ -537,12 +561,12 @@ }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} } }, "rewards": {"recipes": {"Gem Sword_1": [ "Wood_5", - "gem_50" + "Gem_50" ]}} }, "minicraft.advancements.recipes.bed": { @@ -617,14 +641,22 @@ }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} } }, "rewards": {"recipes": {"Gem Pickaxe_1": [ "Wood_5", - "gem_50" + "Gem_50" ]}} }, + "minicraft.advancements.recipes.obsidian_fence": { + "requirements": [["has_obsidian_brick"]], + "criteria": {"has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Obsidian Brick"]}]} + }}, + "rewards": {"recipes": {"Obsidian Fence_1": ["Obsidian Brick_3"]}} + }, "minicraft.advancements.recipes.iron_hoe": { "requirements": [[ "has_wood", @@ -706,7 +738,7 @@ }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} }, "has_flower": { "trigger": "inventory_changed", @@ -714,7 +746,7 @@ } }, "rewards": {"recipes": {"Orange Clothes_1": [ - "cloth_5", + "Cloth_5", "Rose_1", "Flower_1" ]}} @@ -727,7 +759,7 @@ "criteria": { "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} }, "has_iron": { "trigger": "inventory_changed", @@ -735,7 +767,7 @@ } }, "rewards": {"recipes": {"Iron Fishing Rod_1": [ - "string_3", + "String_3", "Iron_10" ]}} }, @@ -759,6 +791,26 @@ "Iron_5" ]}} }, + "minicraft.advancements.recipes.arcane_fertilizer": { + "requirements": [[ + "has_bone", + "has_lapis" + ]], + "criteria": { + "has_bone": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Bone"]}]} + }, + "has_lapis": { + "trigger": "inventory_changed", + "conditions": {"items": [{"items": ["Lapis"]}]} + } + }, + "rewards": {"recipes": {"ARCANE FERTILIZER_3": [ + "Lapis_6", + "Bone_2" + ]}} + }, "minicraft.advancements.recipes.ornate_stone": { "requirements": [["has_stone"]], "criteria": {"has_stone": { @@ -779,11 +831,11 @@ }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} } }, "rewards": {"recipes": {"Wood Bow_1": [ - "string_2", + "String_2", "Wood_5" ]}} }, @@ -824,7 +876,7 @@ }, "rewards": {"recipes": {"Gold_1": [ "Coal_1", - "Gold Ore_4" + "Gold Ore_3" ]}} }, "minicraft.advancements.recipes.cooked_fish": { @@ -978,12 +1030,12 @@ }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} } }, "rewards": {"recipes": {"Cyan Clothes_1": [ "Lapis_1", - "cloth_5", + "Cloth_5", "Cactus_1" ]}} }, @@ -991,9 +1043,9 @@ "requirements": [["has_gem"]], "criteria": {"has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} }}, - "rewards": {"recipes": {"Gem Armor_1": ["gem_65"]}} + "rewards": {"recipes": {"Gem Armor_1": ["Gem_65"]}} }, "minicraft.advancements.recipes.golden_apple": { "requirements": [[ @@ -1030,7 +1082,7 @@ "conditions": {"items": [{"items": ["Wood"]}]} } }, - "rewards": {"recipes": {"arrow_3": [ + "rewards": {"recipes": {"Arrow_3": [ "Stone_2", "Wood_2" ]}} @@ -1058,7 +1110,7 @@ "conditions": {"items": [{"items": ["Sand"]}]} } }, - "rewards": {"recipes": {"glass_1": [ + "rewards": {"recipes": {"Glass_1": [ "Coal_1", "Sand_4" ]}} @@ -1096,7 +1148,7 @@ }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} }, "has_gold": { "trigger": "inventory_changed", @@ -1105,7 +1157,7 @@ }, "rewards": {"recipes": {"Gold Bow_1": [ "Gold_5", - "string_2", + "String_2", "Wood_5" ]}} }, @@ -1118,7 +1170,7 @@ "criteria": { "has_glass": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["glass"]}]} + "conditions": {"items": [{"items": ["Glass"]}]} }, "has_gold": { "trigger": "inventory_changed", @@ -1130,7 +1182,7 @@ } }, "rewards": {"recipes": {"Gold Lantern_1": [ - "glass_4", + "Glass_4", "Gold_10", "Slime_5" ]}} @@ -1239,12 +1291,12 @@ }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} } }, "rewards": {"recipes": {"Gem Hoe_1": [ "Wood_5", - "gem_50" + "Gem_50" ]}} }, "minicraft.advancements.recipes.awkward_potion": { @@ -1271,9 +1323,9 @@ "requirements": [["has_cloth"]], "criteria": {"has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} }}, - "rewards": {"recipes": {"Reg Clothes_1": ["cloth_5"]}} + "rewards": {"recipes": {"Reg Clothes_1": ["Cloth_5"]}} }, "minicraft.advancements.recipes.totem_of_air": { "requirements": [[ @@ -1285,7 +1337,7 @@ "criteria": { "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} }, "has_cloud_ore": { "trigger": "inventory_changed", @@ -1303,7 +1355,7 @@ "rewards": {"recipes": {"Totem of Air_1": [ "Lapis_5", "Gold_10", - "gem_10", + "Gem_10", "Cloud Ore_5" ]}} }, @@ -1320,7 +1372,7 @@ }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} }, "has_iron": { "trigger": "inventory_changed", @@ -1328,7 +1380,7 @@ } }, "rewards": {"recipes": {"Iron Bow_1": [ - "string_2", + "String_2", "Iron_5", "Wood_5" ]}} @@ -1347,7 +1399,7 @@ "trigger": "inventory_changed", "conditions": {"items": [{"items": ["Wool"]}]} }}, - "rewards": {"recipes": {"string_2": ["Wool_1"]}} + "rewards": {"recipes": {"String_2": ["Wool_1"]}} }, "minicraft.advancements.recipes.loom": { "requirements": [[ @@ -1434,7 +1486,7 @@ "criteria": { "has_glass": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["glass"]}]} + "conditions": {"items": [{"items": ["Glass"]}]} }, "has_slime": { "trigger": "inventory_changed", @@ -1446,7 +1498,7 @@ } }, "rewards": {"recipes": {"Iron Lantern_1": [ - "glass_4", + "Glass_4", "Iron_8", "Slime_5" ]}} @@ -1464,7 +1516,7 @@ }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["string"]}]} + "conditions": {"items": [{"items": ["String"]}]} }, "has_lapis": { "trigger": "inventory_changed", @@ -1473,7 +1525,7 @@ }, "rewards": {"recipes": {"Enchanter_1": [ "Lapis_10", - "string_2", + "String_2", "Wood_5" ]}} }, @@ -1550,7 +1602,7 @@ }, "rewards": {"recipes": {"Iron_1": [ "Coal_1", - "Iron Ore_4" + "Iron Ore_3" ]}} }, "minicraft.advancements.recipes.stone_door": { @@ -1575,7 +1627,7 @@ }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} }, "has_lapis": { "trigger": "inventory_changed", @@ -1590,7 +1642,7 @@ "Lapis_5", "Gold_10", "Shard_15", - "gem_10" + "Gem_10" ]}} }, "minicraft.advancements.recipes.gem_axe": { @@ -1605,12 +1657,12 @@ }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} } }, "rewards": {"recipes": {"Gem Axe_1": [ "Wood_5", - "gem_50" + "Gem_50" ]}} }, "minicraft.advancements.recipes.tnt": { @@ -1681,12 +1733,12 @@ }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} } }, "rewards": {"recipes": {"Gem Shovel_1": [ "Wood_5", - "gem_50" + "Gem_50" ]}} }, "minicraft.advancements.recipes.black_clothes": { @@ -1701,12 +1753,12 @@ }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["cloth"]}]} + "conditions": {"items": [{"items": ["Cloth"]}]} } }, "rewards": {"recipes": {"Black Clothes_1": [ "Coal_1", - "cloth_5" + "Cloth_5" ]}} }, "minicraft.advancements.recipes.haste_potion": { @@ -1771,7 +1823,7 @@ "criteria": { "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["gem"]}]} + "conditions": {"items": [{"items": ["Gem"]}]} }, "has_awkward_potion": { "trigger": "inventory_changed", @@ -1780,7 +1832,7 @@ }, "rewards": {"recipes": {"Energy Potion_1": [ "Awkward Potion_1", - "gem_25" + "Gem_25" ]}} }, "minicraft.advancements.recipes.oven": { @@ -1811,4 +1863,4 @@ "Awkward Potion_1" ]}} } -} +} \ No newline at end of file From 7bbc51266bafeb0a1295c64aa5efa1f6521b422b Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 17 Mar 2024 17:23:47 +0800 Subject: [PATCH 220/261] Rewrite Sound playing to use SourceDataLine --- src/client/java/minicraft/core/Updater.java | 3 + src/client/java/minicraft/core/io/Sound.java | 119 +++++++++++++------ 2 files changed, 86 insertions(+), 36 deletions(-) diff --git a/src/client/java/minicraft/core/Updater.java b/src/client/java/minicraft/core/Updater.java index 70dacc202..234a3b78a 100644 --- a/src/client/java/minicraft/core/Updater.java +++ b/src/client/java/minicraft/core/Updater.java @@ -2,6 +2,7 @@ import minicraft.core.io.Localization; import minicraft.core.io.Settings; +import minicraft.core.io.Sound; import minicraft.entity.furniture.Bed; import minicraft.entity.mob.Player; import minicraft.level.Level; @@ -179,6 +180,8 @@ public static void tick() { if (updateNoteTick) notetick++; + Sound.tick(); + // This is the general action statement thing! Regulates menus, mostly. if (!Renderer.canvas.hasFocus()) { input.releaseAll(); diff --git a/src/client/java/minicraft/core/io/Sound.java b/src/client/java/minicraft/core/io/Sound.java index 48b815afc..411b08288 100644 --- a/src/client/java/minicraft/core/io/Sound.java +++ b/src/client/java/minicraft/core/io/Sound.java @@ -6,36 +6,55 @@ import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.DataLine; import javax.sound.sampled.Line; -import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.SourceDataLine; import javax.sound.sampled.UnsupportedAudioFileException; -import java.applet.AudioClip; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Optional; public class Sound { // Creates sounds from their respective files private static final HashMap sounds = new HashMap<>(); private final DataLine.Info info; - private final byte[] raw; + private final short[] raw; private final AudioFormat format; private final long length; + private final int internalBufferSize; + private final SourceDataLine dataLine; + private final LinkedList pointers = new LinkedList<>(); - private Sound(DataLine.Info info, byte[] raw, AudioFormat format, long length) { + private class AudioPointer { + private int offset = 0; + + public Optional getData() { + if (offset == raw.length) return Optional.empty(); + return Optional.of(raw[offset++]); + } + } + + private Sound(DataLine.Info info, short[] raw, AudioFormat format, long length) throws LineUnavailableException { this.info = info; this.raw = raw; this.format = format; this.length = length; + dataLine = AudioSystem.getSourceDataLine(format); + dataLine.open(); +// internalBufferSize = format.getFrameSize() * Math.max(format.getFrameSize() * 32, +// ((int) (format.getFrameRate() / 2)) * format.getFrameSize()); // From SoftMixingSourceDataLine + internalBufferSize = ((int) (format.getFrameRate() / 2)) * format.getFrameSize(); } public static void resetSounds() { @@ -49,7 +68,7 @@ public static void loadSound(String key, InputStream in, String pack) { DataLine.Info info = new DataLine.Info(Clip.class, format); if (!AudioSystem.isLineSupported(info)) { - Logging.RESOURCEHANDLER_SOUND.error("ERROR: Audio format of file \"{}\" in pack \"\" is not supported: {}", key, pack, AudioSystem.getAudioFileFormat(in)); + Logging.RESOURCEHANDLER_SOUND.error("ERROR: Audio format of file \"{}\" in pack \"{}\" is not supported: {}", key, pack, AudioSystem.getAudioFileFormat(in)); Logging.RESOURCEHANDLER_SOUND.error("Supported audio formats:"); Logging.RESOURCEHANDLER_SOUND.error("-source:"); @@ -82,9 +101,29 @@ public static void loadSound(String key, InputStream in, String pack) { while ((length = in.read(buf)) != -1) { out.write(buf, 0, length); } - sounds.put(key, new Sound(info, out.toByteArray(), format, fileFormat.getFrameLength())); + short[] raw0 = new short[out.size()/2]; + ByteBuffer.wrap(out.toByteArray()).order(format.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN) + .asShortBuffer().get(raw0); + short[] raw1; + if (format.getChannels() == 1) { + raw1 = new short[raw0.length * 2]; + for (int i = 0; i < raw0.length; ++i) { + raw1[i * 2] = raw0[i]; + raw1[i * 2 + 1] = raw0[i]; + } + } else if (format.getChannels() != 2) { + Logging.RESOURCEHANDLER_SOUND.error( + "Audio source \"{}\" in pack \"{}\" is neither mono nor stereo, which is not supported.", + key, pack); + return; + } else { + raw1 = raw0; + } - } catch (UnsupportedAudioFileException | IOException e) { + sounds.put(key, new Sound(info, raw1, new AudioFormat(format.getEncoding(), format.getSampleRate(), + format.getSampleSizeInBits(), 2, format.getFrameSize() * 2 / format.getChannels(), format.getFrameRate(), + true, format.properties()), fileFormat.getFrameLength())); + } catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { CrashHandler.errorHandle(e, new CrashHandler.ErrorInfo("Audio Could not Load", CrashHandler.ErrorInfo.ErrorType.REPORT, String.format("Could not load audio: %s in pack: %s", key, pack))); } @@ -114,40 +153,48 @@ public static void loop(String key, int count) { if (sound != null) sound.loop(count); } - @Nullable - private Clip createClip() { - try { - Clip clip = (Clip) AudioSystem.getLine(info); // Creates an audio clip to be played - clip.open(new AudioInputStream(new ByteArrayInputStream(raw), format, length)); - clip.addLineListener(e -> { - if (e.getType() == LineEvent.Type.STOP) { - clip.flush(); - clip.close(); + public static void tick() { + sounds.forEach((k, v) -> v.tick0()); + } + + private void tick0() { + dataLine.start(); + // internalBufferSize - dataLine.available() == used buffer + // Proceed data and then buffer into the data line. + // For 2/16/44100, 2940 bytes would be proceeded per tick. + if (internalBufferSize - dataLine.available() > 4096) return; + int available = Math.min(dataLine.available(), 4096) / 2; // in 16bit (short) + if (available <= 0) return; // Skips tick if buffer is large causing latency + byte[] buf = new byte[available * 2]; + short[] bufShort = new short[available]; + while (available > 0) { + int mixed = 0; + int c = 0; + for (Iterator iterator = pointers.iterator(); iterator.hasNext(); ) { + AudioPointer pointer = iterator.next(); + Optional d = pointer.getData(); + if (!d.isPresent()) iterator.remove(); + else { + mixed += d.get(); + c++; } - }); + } - return clip; - } catch (LineUnavailableException | IOException e) { - Logging.RESOURCEHANDLER_SOUND.error(e, "Unable to create Clip"); - return null; + if (c == 0) break; // No more data to be written + bufShort[bufShort.length - available] = (short) (mixed / c); // Average mixed + available--; } + + ByteBuffer.wrap(buf).asShortBuffer().put(bufShort); + dataLine.write(buf, 0, buf.length); } public void play() { if (!(boolean) Settings.get("sound")) return; - - Clip clip = createClip(); - if (clip != null) { - clip.start(); - } + pointers.add(new AudioPointer()); } - public void loop(int count) { - if (!(boolean) Settings.get("sound")) return; - - Clip clip = createClip(); - if (clip != null) { - clip.loop(count); - } - } + /** @deprecated no longer supported, but reserved for future implementation. */ + @Deprecated + public void loop(int count) {} } From 83f27e839539a10772653075d1d9f388eaceb68d Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 17 Mar 2024 18:31:55 +0800 Subject: [PATCH 221/261] Update value about Sound internalBufferSize --- src/client/java/minicraft/core/io/Sound.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/java/minicraft/core/io/Sound.java b/src/client/java/minicraft/core/io/Sound.java index 411b08288..d550474f7 100644 --- a/src/client/java/minicraft/core/io/Sound.java +++ b/src/client/java/minicraft/core/io/Sound.java @@ -52,8 +52,7 @@ private Sound(DataLine.Info info, short[] raw, AudioFormat format, long length) this.length = length; dataLine = AudioSystem.getSourceDataLine(format); dataLine.open(); -// internalBufferSize = format.getFrameSize() * Math.max(format.getFrameSize() * 32, -// ((int) (format.getFrameRate() / 2)) * format.getFrameSize()); // From SoftMixingSourceDataLine + // Assume DirectAudioDevice is used internalBufferSize = ((int) (format.getFrameRate() / 2)) * format.getFrameSize(); } From 7a3cbf9e214107406d9e523b1b6f33d56c55df19 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 17 Mar 2024 19:45:45 +0800 Subject: [PATCH 222/261] Combine SourceDataLine into just one main pipeline --- src/client/java/minicraft/core/io/Sound.java | 61 +++++++++++--------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/src/client/java/minicraft/core/io/Sound.java b/src/client/java/minicraft/core/io/Sound.java index d550474f7..424b12bba 100644 --- a/src/client/java/minicraft/core/io/Sound.java +++ b/src/client/java/minicraft/core/io/Sound.java @@ -6,6 +6,7 @@ import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.DataLine; @@ -27,14 +28,28 @@ public class Sound { // Creates sounds from their respective files private static final HashMap sounds = new HashMap<>(); + private static final LinkedList pointers = new LinkedList<>(); + private static final AudioFormat STANDARD_FORMAT = + new AudioFormat(44100, 16, 2, true, true); + private static final SourceDataLine dataLine; + private static final int internalBufferSize; + + /* + * Only 2/16/44100 and 1/16/44100 PCM_SIGNED are supported. + */ + + static { + try { + dataLine = AudioSystem.getSourceDataLine(STANDARD_FORMAT); + dataLine.open(); + // Assume DirectAudioDevice is used + internalBufferSize = ((int) (STANDARD_FORMAT.getFrameRate() / 2)) * STANDARD_FORMAT.getFrameSize(); + } catch (LineUnavailableException e) { + throw new RuntimeException(e); + } + } - private final DataLine.Info info; private final short[] raw; - private final AudioFormat format; - private final long length; - private final int internalBufferSize; - private final SourceDataLine dataLine; - private final LinkedList pointers = new LinkedList<>(); private class AudioPointer { private int offset = 0; @@ -45,15 +60,8 @@ public Optional getData() { } } - private Sound(DataLine.Info info, short[] raw, AudioFormat format, long length) throws LineUnavailableException { - this.info = info; + private Sound(short[] raw) { this.raw = raw; - this.format = format; - this.length = length; - dataLine = AudioSystem.getSourceDataLine(format); - dataLine.open(); - // Assume DirectAudioDevice is used - internalBufferSize = ((int) (format.getFrameRate() / 2)) * format.getFrameSize(); } public static void resetSounds() { @@ -62,10 +70,17 @@ public static void resetSounds() { public static void loadSound(String key, InputStream in, String pack) { try { - AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(in); - AudioFormat format = fileFormat.getFormat(); + AudioInputStream ain = AudioSystem.getAudioInputStream(in); + AudioFormat format = ain.getFormat(); DataLine.Info info = new DataLine.Info(Clip.class, format); + if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED || + format.getChannels() > 2 || format.getSampleRate() != 44100 || + format.getSampleSizeInBits() != 16) { + Logging.RESOURCEHANDLER_SOUND.error("Unsupported audio format of file \"{}\" in pack \"{}\": {}", + key, pack, format); + } + if (!AudioSystem.isLineSupported(info)) { Logging.RESOURCEHANDLER_SOUND.error("ERROR: Audio format of file \"{}\" in pack \"{}\" is not supported: {}", key, pack, AudioSystem.getAudioFileFormat(in)); @@ -97,7 +112,7 @@ public static void loadSound(String key, InputStream in, String pack) { ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buf = new byte[8192]; int length; - while ((length = in.read(buf)) != -1) { + while ((length = ain.read(buf)) != -1) { out.write(buf, 0, length); } short[] raw0 = new short[out.size()/2]; @@ -110,7 +125,7 @@ public static void loadSound(String key, InputStream in, String pack) { raw1[i * 2] = raw0[i]; raw1[i * 2 + 1] = raw0[i]; } - } else if (format.getChannels() != 2) { + } else if (format.getChannels() != 2) { // This should not be executed. Logging.RESOURCEHANDLER_SOUND.error( "Audio source \"{}\" in pack \"{}\" is neither mono nor stereo, which is not supported.", key, pack); @@ -119,10 +134,8 @@ public static void loadSound(String key, InputStream in, String pack) { raw1 = raw0; } - sounds.put(key, new Sound(info, raw1, new AudioFormat(format.getEncoding(), format.getSampleRate(), - format.getSampleSizeInBits(), 2, format.getFrameSize() * 2 / format.getChannels(), format.getFrameRate(), - true, format.properties()), fileFormat.getFrameLength())); - } catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { + sounds.put(key, new Sound(raw1)); + } catch (UnsupportedAudioFileException | IOException e) { CrashHandler.errorHandle(e, new CrashHandler.ErrorInfo("Audio Could not Load", CrashHandler.ErrorInfo.ErrorType.REPORT, String.format("Could not load audio: %s in pack: %s", key, pack))); } @@ -153,10 +166,6 @@ public static void loop(String key, int count) { } public static void tick() { - sounds.forEach((k, v) -> v.tick0()); - } - - private void tick0() { dataLine.start(); // internalBufferSize - dataLine.available() == used buffer // Proceed data and then buffer into the data line. From a68652b1b61dd89d95d2d27022846ff55d4cad0c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 18 Mar 2024 23:24:52 +0800 Subject: [PATCH 223/261] Update Sound mixing algorithm --- src/client/java/minicraft/core/io/Sound.java | 34 ++++++++++++++------ 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/client/java/minicraft/core/io/Sound.java b/src/client/java/minicraft/core/io/Sound.java index 424b12bba..68547d338 100644 --- a/src/client/java/minicraft/core/io/Sound.java +++ b/src/client/java/minicraft/core/io/Sound.java @@ -2,9 +2,9 @@ import minicraft.core.CrashHandler; import minicraft.util.Logging; +import minicraft.util.MyUtils; import org.jetbrains.annotations.Nullable; -import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; @@ -31,6 +31,7 @@ public class Sound { private static final LinkedList pointers = new LinkedList<>(); private static final AudioFormat STANDARD_FORMAT = new AudioFormat(44100, 16, 2, true, true); + private static final int MAX_BUFFER_SIZE = 4096; private static final SourceDataLine dataLine; private static final int internalBufferSize; @@ -170,26 +171,41 @@ public static void tick() { // internalBufferSize - dataLine.available() == used buffer // Proceed data and then buffer into the data line. // For 2/16/44100, 2940 bytes would be proceeded per tick. - if (internalBufferSize - dataLine.available() > 4096) return; - int available = Math.min(dataLine.available(), 4096) / 2; // in 16bit (short) + if (internalBufferSize - dataLine.available() > MAX_BUFFER_SIZE) return; + int available = Math.min(dataLine.available(), MAX_BUFFER_SIZE) / 2; // in 16bit (short) if (available <= 0) return; // Skips tick if buffer is large causing latency byte[] buf = new byte[available * 2]; short[] bufShort = new short[available]; while (available > 0) { - int mixed = 0; - int c = 0; + /* Audio Mixing Algorithm + * Reference Algorithm: https://stackoverflow.com/a/25102339 + * And here, converted equations are used: (U_i is an unsigned short value) + * Z = U_i, if n = 1 + * Z = product{U_i} / 32768^{n-1}, if quiet + * Z = 2 * sum{U_i} - product{U_i} / 32768^{n-1} - 65536 * (n-1), otherwise + */ + + boolean quiet = true; + int n = 0; + int sum = 0; + float mul = 1; for (Iterator iterator = pointers.iterator(); iterator.hasNext(); ) { AudioPointer pointer = iterator.next(); Optional d = pointer.getData(); if (!d.isPresent()) iterator.remove(); else { - mixed += d.get(); - c++; + int val = d.get() + 32768; // Turning to unsigned + if (quiet && val >= 32768) quiet = false; + mul *= val; + if (n != 0) mul /= 32768; + sum += val; + n++; } } - if (c == 0) break; // No more data to be written - bufShort[bufShort.length - available] = (short) (mixed / c); // Average mixed + if (n == 0) break; // No more data to be written + bufShort[bufShort.length - available] = (short) (n == 1 ? sum - 32768 : MyUtils.clamp((int) (quiet ? + mul : 2 * sum - mul - 65536 * (n - 1)), 0, 65535) - 32768); // Turning back to signed available--; } From 434531206706692364ff6888257451d50f3a56a2 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 19 Mar 2024 19:50:17 +0800 Subject: [PATCH 224/261] Update Sound mixing algorithm --- src/client/java/minicraft/core/io/Sound.java | 56 ++++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/src/client/java/minicraft/core/io/Sound.java b/src/client/java/minicraft/core/io/Sound.java index 68547d338..6081fa3f3 100644 --- a/src/client/java/minicraft/core/io/Sound.java +++ b/src/client/java/minicraft/core/io/Sound.java @@ -2,7 +2,6 @@ import minicraft.core.CrashHandler; import minicraft.util.Logging; -import minicraft.util.MyUtils; import org.jetbrains.annotations.Nullable; import javax.sound.sampled.AudioFormat; @@ -178,34 +177,59 @@ public static void tick() { short[] bufShort = new short[available]; while (available > 0) { /* Audio Mixing Algorithm - * Reference Algorithm: https://stackoverflow.com/a/25102339 - * And here, converted equations are used: (U_i is an unsigned short value) - * Z = U_i, if n = 1 - * Z = product{U_i} / 32768^{n-1}, if quiet - * Z = 2 * sum{U_i} - product{U_i} / 32768^{n-1} - 65536 * (n-1), otherwise + * Reference Article: https://stackoverflow.com/a/25102339 + * It is pointed out that, non-linear mixing algorithms are not the correct ways to perform mixing, + * but it should be instead handled by (dynamic range) compression. + * For now, C = sum{U_i} / n is not enough, but compression should be applied. + * + * It is noticed that for the quiet sounds, the sounds become quieter when mixed, even overall. + * So, an upward compression is required. We now define a quiet sound to be a signal smaller than + * a one-fourth of the maximum value. + * For each quiet signal, we gain an upward compression factor and finally multiplied altogether to the + * resultant value. And we can get the factor by a non-linear equation: + * F = log2((D-U)/D+1)+1, where F is the factor, D is the one-fourth value, U is the signal value. + * Note that U ∈ [0, D), (D-U)/D ∈ (0, 1], F ∈ (1, 2]. + * But we cannot have this too big, so we make this into F^(1/3), where 2^(1/3) is approximately 1.26. + * This can make sure that the factor would not go great. + * Then, make sure that the factor cannot overflow the value, + * G = sqrt(product{F_i}), + * as a final factor, would then be used. + * + * Finally, if the value really goes close to the maximum value even overflow, like 0.9 of the maximum value, + * we can then apply an ultimate equation: + * H = (J) / (J + 1) * E, + * where H is the value to add with the cut value (0.9 of the maximum), J is the exceeded value and + * E is the certain amount smaller than 0.1 of the maximum, say 0.05 of it here. + * We can get a compressed sound and also limited from the maximum, with 0.95x of the maximum. */ - boolean quiet = true; int n = 0; int sum = 0; - float mul = 1; + double factor = 1; for (Iterator iterator = pointers.iterator(); iterator.hasNext(); ) { AudioPointer pointer = iterator.next(); Optional d = pointer.getData(); if (!d.isPresent()) iterator.remove(); else { - int val = d.get() + 32768; // Turning to unsigned - if (quiet && val >= 32768) quiet = false; - mul *= val; - if (n != 0) mul /= 32768; - sum += val; + int val = d.get(); // Signed + int net = Math.abs(val); // Bounds are halved for absolute of signed value + if (net < 8192) + factor *= Math.pow(Math.log1p((8192 - net) / 8192D) / Math.log(2) + 1, 1D/3); + sum += val + 32768; // Turning to unsigned n++; } } - if (n == 0) break; // No more data to be written - bufShort[bufShort.length - available] = (short) (n == 1 ? sum - 32768 : MyUtils.clamp((int) (quiet ? - mul : 2 * sum - mul - 65536 * (n - 1)), 0, 65535) - 32768); // Turning back to signed + if (n == 0) break; // No more data to be written at the moment + double val = (double) sum / n - 32768; // To signed + val *= Math.sqrt(factor); + double net = Math.abs(val); // Bounds are halved for absolute of signed value + if (net > 32768*.9D) { + val = (32768*.9D + ((net - 32768*.9D) / (net - 32768*.9D + 1) * 32768/10D)) * Math.signum(val); + } + + // val should be between -32768 and 32767 exclusively + bufShort[bufShort.length - available] = (short) val; available--; } From 193773582ebe7201122d0c1a1fc0a7e5722dbe45 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:40:54 -0400 Subject: [PATCH 225/261] Updated wording --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8931fce8c..eb4b80914 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,7 @@ Because this project uses a build tool called gradle it is very easy to build or 2. Extract the contents of the folder. 3. Open command prompt and enter `cd `, this will open the folder in the command prompt. 4. Type `gradlew run` or `gradlew build` to run or build the program. This might take some time. If on unix, add "./" to - the front. - If you are using Windows Powershell you need to put ".\" in front of gradlew + the front. If on Windows using an IDE or Windows Powershell, add ".\" to the front. 1. If you built the project, the jar file is found in `build/libs` 2. If you get an error screaming that you're missing java. You need to [set up](https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html) your From 2ac62eee23afb4fd0af426b9d941e052f9591b67 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 20 Mar 2024 05:03:27 +0800 Subject: [PATCH 226/261] Update ChangeLog.md --- ChangeLog.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3bbbf644e..1236fe666 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -40,6 +40,7 @@ but some sections are changed to compliant this project. * Added a trigger to auto-enable hardware acceleration * Added support for lower-cased letters * Added item description menu +* Added fences ### Changes @@ -62,6 +63,9 @@ but some sections are changed to compliant this project. * Reduced food stamina cost * Made some strings lower-cased * Updated spawning and despawning conditions +* Iron and goal now require 3 ores instead of 4 for crafting +* Renamed `assets/books/story_guide.txt` to `assets/books/game_guide.txt` +* Updated `assets/books/game_guide.txt` and `assets/books/instructions.txt` ### Removals @@ -73,7 +77,10 @@ but some sections are changed to compliant this project. * Fixed rendering positioning problem of color code styled texts * Fixed lights disappearing when out of screen * Fixed animals and items destroying plants -* Fixed various old world loading crashes +* Fixed various old world loading crashes, including migration to the new destination +* Fixed possible crash when Air Wizard is not loaded +* Fixed minor loading bugs to dungeon chests +* Fixed performance issue in WaterTile ticking ## [2.1.3] From bba64db2ad45a4ae1c20ee9bc72ddf756598e3fa Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 20 Mar 2024 05:24:47 +0800 Subject: [PATCH 227/261] Reformat recipes.json --- src/client/resources/resources/recipes.json | 4504 ++++++++++++++----- 1 file changed, 3497 insertions(+), 1007 deletions(-) diff --git a/src/client/resources/resources/recipes.json b/src/client/resources/resources/recipes.json index 8239abaf9..f627cefbe 100644 --- a/src/client/resources/resources/recipes.json +++ b/src/client/resources/resources/recipes.json @@ -1,1866 +1,4356 @@ { "minicraft.advancements.recipes.gem_fishing_rod": { - "requirements": [[ - "has_gem", - "has_string" - ]], + "requirements": [ + [ + "has_gem", + "has_string" + ] + ], "criteria": { "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Fishing Rod_1": [ - "String_3", - "Gem_10" - ]}} + "rewards": { + "recipes": { + "Gem Fishing Rod_1": [ + "String_3", + "Gem_10" + ] + } + } }, "minicraft.advancements.recipes.health_potion": { - "requirements": [[ - "has_leather_armor", - "has_gunpowder", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_leather_armor", + "has_gunpowder", + "has_awkward_potion" + ] + ], "criteria": { "has_leather_armor": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Leather Armor"]}]} + "conditions": { + "items": [ + { + "items": [ + "Leather Armor" + ] + } + ] + } }, "has_gunpowder": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gunpowder"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gunpowder" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Health Potion_1": [ - "Awkward Potion_1", - "Gunpowder_2", - "Leather Armor_1" - ]}} + "rewards": { + "recipes": { + "Health Potion_1": [ + "Awkward Potion_1", + "Gunpowder_2", + "Leather Armor_1" + ] + } + } }, "minicraft.advancements.recipes.green_wool": { - "requirements": [[ - "has_cactus", - "has_wool" - ]], + "requirements": [ + [ + "has_cactus", + "has_wool" + ] + ], "criteria": { "has_cactus": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cactus"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cactus" + ] + } + ] + } }, "has_wool": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } } }, - "rewards": {"recipes": {"Green Wool_1": [ - "Cactus_1", - "Wool_1" - ]}} + "rewards": { + "recipes": { + "Green Wool_1": [ + "Cactus_1", + "Wool_1" + ] + } + } }, "minicraft.advancements.recipes.obsidian_brick": { - "requirements": [["has_raw_obsidian"]], - "criteria": {"has_raw_obsidian": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Raw Obsidian"]}]} - }}, - "rewards": {"recipes": {"Obsidian Brick_1": ["Raw Obsidian_2"]}} + "requirements": [ + [ + "has_raw_obsidian" + ] + ], + "criteria": { + "has_raw_obsidian": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Raw Obsidian" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Obsidian Brick_1": [ + "Raw Obsidian_2" + ] + } + } }, "minicraft.advancements.recipes.plank": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Plank_2": ["Wood_1"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Plank_2": [ + "Wood_1" + ] + } + } }, "minicraft.advancements.recipes.leather_armor": { - "requirements": [["has_leather"]], - "criteria": {"has_leather": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Leather"]}]} - }}, - "rewards": {"recipes": {"Leather Armor_1": ["Leather_10"]}} + "requirements": [ + [ + "has_leather" + ] + ], + "criteria": { + "has_leather": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Leather" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Leather Armor_1": [ + "Leather_10" + ] + } + } }, "minicraft.advancements.recipes.lava_potion": { - "requirements": [[ - "has_awkward_potion", - "has_lava_bucket" - ]], + "requirements": [ + [ + "has_awkward_potion", + "has_lava_bucket" + ] + ], "criteria": { "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } }, "has_lava_bucket": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lava Bucket"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lava Bucket" + ] + } + ] + } } }, - "rewards": {"recipes": {"Lava Potion_1": [ - "Awkward Potion_1", - "Lava Bucket_1" - ]}} + "rewards": { + "recipes": { + "Lava Potion_1": [ + "Awkward Potion_1", + "Lava Bucket_1" + ] + } + } }, "minicraft.advancements.recipes.iron_axe": { - "requirements": [[ - "has_wood", - "has_iron" - ]], + "requirements": [ + [ + "has_wood", + "has_iron" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Axe_1": [ - "Wood_5", - "Iron_5" - ]}} + "rewards": { + "recipes": { + "Iron Axe_1": [ + "Wood_5", + "Iron_5" + ] + } + } }, "minicraft.advancements.recipes.black_wool": { - "requirements": [[ - "has_coal", - "has_wool" - ]], + "requirements": [ + [ + "has_coal", + "has_wool" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_wool": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } } }, - "rewards": {"recipes": {"Black Wool_1": [ - "Coal_1", - "Wool_1" - ]}} + "rewards": { + "recipes": { + "Black Wool_1": [ + "Coal_1", + "Wool_1" + ] + } + } }, "minicraft.advancements.recipes.cooked_pork": { - "requirements": [[ - "has_coal", - "has_raw_pork" - ]], + "requirements": [ + [ + "has_coal", + "has_raw_pork" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_raw_pork": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Raw Pork"]}]} + "conditions": { + "items": [ + { + "items": [ + "Raw Pork" + ] + } + ] + } } }, - "rewards": {"recipes": {"Cooked Pork_1": [ - "Coal_1", - "Raw Pork_1" - ]}} + "rewards": { + "recipes": { + "Cooked Pork_1": [ + "Coal_1", + "Raw Pork_1" + ] + } + } }, "minicraft.advancements.recipes.wooden_hoe": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Wood Hoe_1": ["Wood_5"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Wood Hoe_1": [ + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.stone_sword": { - "requirements": [[ - "has_stone", - "has_wood" - ]], + "requirements": [ + [ + "has_stone", + "has_wood" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } } }, - "rewards": {"recipes": {"Rock Sword_1": [ - "Stone_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Rock Sword_1": [ + "Stone_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.snake_armor": { - "requirements": [["has_scale"]], - "criteria": {"has_scale": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Scale"]}]} - }}, - "rewards": {"recipes": {"Snake Armor_1": ["Scale_15"]}} + "requirements": [ + [ + "has_scale" + ] + ], + "criteria": { + "has_scale": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Scale" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Snake Armor_1": [ + "Scale_15" + ] + } + } }, "minicraft.advancements.recipes.shears": { - "requirements": [["has_iron"]], - "criteria": {"has_iron": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} - }}, - "rewards": {"recipes": {"Shears_1": ["Iron_4"]}} + "requirements": [ + [ + "has_iron" + ] + ], + "criteria": { + "has_iron": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Shears_1": [ + "Iron_4" + ] + } + } }, "minicraft.advancements.recipes.wood_door": { - "requirements": [["has_plank"]], - "criteria": {"has_plank": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Plank"]}]} - }}, - "rewards": {"recipes": {"Wood Door_1": ["Plank_5"]}} + "requirements": [ + [ + "has_plank" + ] + ], + "criteria": { + "has_plank": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Plank" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Wood Door_1": [ + "Plank_5" + ] + } + } }, "minicraft.advancements.recipes.stone_fence": { - "requirements": [["has_stone_brick"]], - "criteria": {"has_stone_brick": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone Brick"]}]} - }}, - "rewards": {"recipes": {"Stone Fence_1": ["Stone Brick_3"]}} + "requirements": [ + [ + "has_stone_brick" + ] + ], + "criteria": { + "has_stone_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Stone Brick" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Stone Fence_1": [ + "Stone Brick_3" + ] + } + } }, "minicraft.advancements.recipes.green_clothes": { - "requirements": [[ - "has_cactus", - "has_cloth" - ]], + "requirements": [ + [ + "has_cactus", + "has_cloth" + ] + ], "criteria": { "has_cactus": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cactus"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cactus" + ] + } + ] + } }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } } }, - "rewards": {"recipes": {"Green Clothes_1": [ - "Cactus_1", - "Cloth_5" - ]}} + "rewards": { + "recipes": { + "Green Clothes_1": [ + "Cactus_1", + "Cloth_5" + ] + } + } }, "minicraft.advancements.recipes.red_wool": { - "requirements": [[ - "has_rose", - "has_wool" - ]], + "requirements": [ + [ + "has_rose", + "has_wool" + ] + ], "criteria": { "has_rose": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Rose"]}]} + "conditions": { + "items": [ + { + "items": [ + "Rose" + ] + } + ] + } }, "has_wool": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } } }, - "rewards": {"recipes": {"Red Wool_1": [ - "Rose_1", - "Wool_1" - ]}} + "rewards": { + "recipes": { + "Red Wool_1": [ + "Rose_1", + "Wool_1" + ] + } + } }, "minicraft.advancements.recipes.stone_bow": { - "requirements": [[ - "has_stone", - "has_wood", - "has_string" - ]], + "requirements": [ + [ + "has_stone", + "has_wood", + "has_string" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } } }, - "rewards": {"recipes": {"Rock Bow_1": [ - "String_2", - "Stone_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Rock Bow_1": [ + "String_2", + "Stone_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.gem_bow": { - "requirements": [[ - "has_wood", - "has_gem", - "has_string" - ]], + "requirements": [ + [ + "has_wood", + "has_gem", + "has_string" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Bow_1": [ - "String_2", - "Wood_5", - "Gem_50" - ]}} + "rewards": { + "recipes": { + "Gem Bow_1": [ + "String_2", + "Wood_5", + "Gem_50" + ] + } + } }, "minicraft.advancements.recipes.wooden_axe": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Wood Axe_1": ["Wood_5"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Wood Axe_1": [ + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.stone_brick": { - "requirements": [["has_stone"]], - "criteria": {"has_stone": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} - }}, - "rewards": {"recipes": {"Stone Brick_1": ["Stone_2"]}} + "requirements": [ + [ + "has_stone" + ] + ], + "criteria": { + "has_stone": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Stone Brick_1": [ + "Stone_2" + ] + } + } }, "minicraft.advancements.recipes.workbench": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Workbench_1": ["Wood_10"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Workbench_1": [ + "Wood_10" + ] + } + } }, "minicraft.advancements.recipes.lantern": { - "requirements": [[ - "has_glass", - "has_wood", - "has_slime" - ]], + "requirements": [ + [ + "has_glass", + "has_wood", + "has_slime" + ] + ], "criteria": { "has_glass": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Glass"]}]} + "conditions": { + "items": [ + { + "items": [ + "Glass" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_slime": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Slime"]}]} + "conditions": { + "items": [ + { + "items": [ + "Slime" + ] + } + ] + } } }, - "rewards": {"recipes": {"Lantern_1": [ - "Glass_3", - "Slime_4", - "Wood_8" - ]}} + "rewards": { + "recipes": { + "Lantern_1": [ + "Glass_3", + "Slime_4", + "Wood_8" + ] + } + } }, "minicraft.advancements.recipes.gold_armor": { - "requirements": [["has_gold"]], - "criteria": {"has_gold": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} - }}, - "rewards": {"recipes": {"Gold Armor_1": ["Gold_10"]}} + "requirements": [ + [ + "has_gold" + ] + ], + "criteria": { + "has_gold": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Gold Armor_1": [ + "Gold_10" + ] + } + } }, "minicraft.advancements.recipes.yellow_clothes": { - "requirements": [[ - "has_cloth", - "has_flower" - ]], + "requirements": [ + [ + "has_cloth", + "has_flower" + ] + ], "criteria": { "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } }, "has_flower": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Flower"]}]} + "conditions": { + "items": [ + { + "items": [ + "Flower" + ] + } + ] + } } }, - "rewards": {"recipes": {"Yellow Clothes_1": [ - "Flower_1", - "Cloth_5" - ]}} + "rewards": { + "recipes": { + "Yellow Clothes_1": [ + "Flower_1", + "Cloth_5" + ] + } + } }, "minicraft.advancements.recipes.glass_bottle": { - "requirements": [["has_glass"]], - "criteria": {"has_glass": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Glass"]}]} - }}, - "rewards": {"recipes": {"Glass Bottle_1": ["Glass_3"]}} + "requirements": [ + [ + "has_glass" + ] + ], + "criteria": { + "has_glass": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Glass" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Glass Bottle_1": [ + "Glass_3" + ] + } + } }, "minicraft.advancements.recipes.gem_claymore": { - "requirements": [[ - "has_shard", - "has_gem_sword" - ]], + "requirements": [ + [ + "has_shard", + "has_gem_sword" + ] + ], "criteria": { "has_shard": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Shard"]}]} + "conditions": { + "items": [ + { + "items": [ + "Shard" + ] + } + ] + } }, "has_gem_sword": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem Sword"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem Sword" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Claymore_1": [ - "Gem Sword_1", - "Shard_15" - ]}} + "rewards": { + "recipes": { + "Gem Claymore_1": [ + "Gem Sword_1", + "Shard_15" + ] + } + } }, "minicraft.advancements.recipes.wood_fence": { - "requirements": [["has_plank"]], - "criteria": {"has_plank": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Plank"]}]} - }}, - "rewards": {"recipes": {"Wood Fence_1": ["Plank_3"]}} + "requirements": [ + [ + "has_plank" + ] + ], + "criteria": { + "has_plank": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Plank" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Wood Fence_1": [ + "Plank_3" + ] + } + } }, "minicraft.advancements.recipes.wood_fishing_rod": { - "requirements": [[ - "has_wood", - "has_string" - ]], + "requirements": [ + [ + "has_wood", + "has_string" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } } }, - "rewards": {"recipes": {"Wood Fishing Rod_1": [ - "String_3", - "Wood_10" - ]}} + "rewards": { + "recipes": { + "Wood Fishing Rod_1": [ + "String_3", + "Wood_10" + ] + } + } }, "minicraft.advancements.recipes.gold_fishing_rod": { - "requirements": [[ - "has_string", - "has_gold" - ]], + "requirements": [ + [ + "has_string", + "has_gold" + ] + ], "criteria": { "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Fishing Rod_1": [ - "Gold_10", - "String_3" - ]}} + "rewards": { + "recipes": { + "Gold Fishing Rod_1": [ + "Gold_10", + "String_3" + ] + } + } }, "minicraft.advancements.recipes.purple_clothes": { - "requirements": [[ - "has_rose", - "has_lapis", - "has_cloth" - ]], + "requirements": [ + [ + "has_rose", + "has_lapis", + "has_cloth" + ] + ], "criteria": { "has_rose": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Rose"]}]} + "conditions": { + "items": [ + { + "items": [ + "Rose" + ] + } + ] + } }, "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } } }, - "rewards": {"recipes": {"Purple Clothes_1": [ - "Lapis_1", - "Cloth_5", - "Rose_1" - ]}} + "rewards": { + "recipes": { + "Purple Clothes_1": [ + "Lapis_1", + "Cloth_5", + "Rose_1" + ] + } + } }, "minicraft.advancements.recipes.stone_pickaxe": { - "requirements": [[ - "has_stone", - "has_wood" - ]], + "requirements": [ + [ + "has_stone", + "has_wood" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } } }, - "rewards": {"recipes": {"Rock Pickaxe_1": [ - "Stone_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Rock Pickaxe_1": [ + "Stone_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.blue_clothes": { - "requirements": [[ - "has_lapis", - "has_cloth" - ]], + "requirements": [ + [ + "has_lapis", + "has_cloth" + ] + ], "criteria": { "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } } }, - "rewards": {"recipes": {"Blue Clothes_1": [ - "Lapis_1", - "Cloth_5" - ]}} + "rewards": { + "recipes": { + "Blue Clothes_1": [ + "Lapis_1", + "Cloth_5" + ] + } + } }, "minicraft.advancements.recipes.watering_can": { - "requirements": [["has_iron"]], - "criteria": {"has_iron": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} - }}, - "rewards": {"recipes": {"Watering Can_1": ["Iron_3"]}} + "requirements": [ + [ + "has_iron" + ] + ], + "criteria": { + "has_iron": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Watering Can_1": [ + "Iron_3" + ] + } + } }, "minicraft.advancements.recipes.gem_sword": { - "requirements": [[ - "has_wood", - "has_gem" - ]], + "requirements": [ + [ + "has_wood", + "has_gem" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Sword_1": [ - "Wood_5", - "Gem_50" - ]}} + "rewards": { + "recipes": { + "Gem Sword_1": [ + "Wood_5", + "Gem_50" + ] + } + } }, "minicraft.advancements.recipes.bed": { - "requirements": [[ - "has_wood", - "has_wool" - ]], + "requirements": [ + [ + "has_wood", + "has_wool" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_wool": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } } }, - "rewards": {"recipes": {"Bed_1": [ - "Wood_5", - "Wool_3" - ]}} + "rewards": { + "recipes": { + "Bed_1": [ + "Wood_5", + "Wool_3" + ] + } + } }, "minicraft.advancements.recipes.swim_potion": { - "requirements": [[ - "has_raw_fish", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_raw_fish", + "has_awkward_potion" + ] + ], "criteria": { "has_raw_fish": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Raw Fish"]}]} + "conditions": { + "items": [ + { + "items": [ + "Raw Fish" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Swim Potion_1": [ - "Awkward Potion_1", - "Raw Fish_5" - ]}} + "rewards": { + "recipes": { + "Swim Potion_1": [ + "Awkward Potion_1", + "Raw Fish_5" + ] + } + } }, "minicraft.advancements.recipes.steak": { - "requirements": [[ - "has_coal", - "has_raw_beef" - ]], + "requirements": [ + [ + "has_coal", + "has_raw_beef" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_raw_beef": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Raw Beef"]}]} + "conditions": { + "items": [ + { + "items": [ + "Raw Beef" + ] + } + ] + } } }, - "rewards": {"recipes": {"Steak_1": [ - "Coal_1", - "Raw Beef_1" - ]}} + "rewards": { + "recipes": { + "Steak_1": [ + "Coal_1", + "Raw Beef_1" + ] + } + } }, "minicraft.advancements.recipes.gem_pickaxe": { - "requirements": [[ - "has_wood", - "has_gem" - ]], + "requirements": [ + [ + "has_wood", + "has_gem" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Pickaxe_1": [ - "Wood_5", - "Gem_50" - ]}} + "rewards": { + "recipes": { + "Gem Pickaxe_1": [ + "Wood_5", + "Gem_50" + ] + } + } }, "minicraft.advancements.recipes.obsidian_fence": { - "requirements": [["has_obsidian_brick"]], - "criteria": {"has_obsidian_brick": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Obsidian Brick"]}]} - }}, - "rewards": {"recipes": {"Obsidian Fence_1": ["Obsidian Brick_3"]}} + "requirements": [ + [ + "has_obsidian_brick" + ] + ], + "criteria": { + "has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Obsidian Brick" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Obsidian Fence_1": [ + "Obsidian Brick_3" + ] + } + } }, "minicraft.advancements.recipes.iron_hoe": { - "requirements": [[ - "has_wood", - "has_iron" - ]], + "requirements": [ + [ + "has_wood", + "has_iron" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Hoe_1": [ - "Wood_5", - "Iron_5" - ]}} + "rewards": { + "recipes": { + "Iron Hoe_1": [ + "Wood_5", + "Iron_5" + ] + } + } }, "minicraft.advancements.recipes.iron_claymore": { - "requirements": [[ - "has_shard", - "has_iron_sword" - ]], + "requirements": [ + [ + "has_shard", + "has_iron_sword" + ] + ], "criteria": { "has_shard": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Shard"]}]} + "conditions": { + "items": [ + { + "items": [ + "Shard" + ] + } + ] + } }, "has_iron_sword": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron Sword"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron Sword" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Claymore_1": [ - "Iron Sword_1", - "Shard_15" - ]}} + "rewards": { + "recipes": { + "Iron Claymore_1": [ + "Iron Sword_1", + "Shard_15" + ] + } + } }, "minicraft.advancements.recipes.wooden_pickaxe": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Wood Pickaxe_1": ["Wood_5"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Wood Pickaxe_1": [ + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.stone_axe": { - "requirements": [[ - "has_stone", - "has_wood" - ]], + "requirements": [ + [ + "has_stone", + "has_wood" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } } }, - "rewards": {"recipes": {"Rock Axe_1": [ - "Stone_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Rock Axe_1": [ + "Stone_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.orange_clothes": { - "requirements": [[ - "has_rose", - "has_cloth", - "has_flower" - ]], + "requirements": [ + [ + "has_rose", + "has_cloth", + "has_flower" + ] + ], "criteria": { "has_rose": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Rose"]}]} + "conditions": { + "items": [ + { + "items": [ + "Rose" + ] + } + ] + } }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } }, "has_flower": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Flower"]}]} + "conditions": { + "items": [ + { + "items": [ + "Flower" + ] + } + ] + } } }, - "rewards": {"recipes": {"Orange Clothes_1": [ - "Cloth_5", - "Rose_1", - "Flower_1" - ]}} + "rewards": { + "recipes": { + "Orange Clothes_1": [ + "Cloth_5", + "Rose_1", + "Flower_1" + ] + } + } }, "minicraft.advancements.recipes.iron_fishing_rod": { - "requirements": [[ - "has_string", - "has_iron" - ]], + "requirements": [ + [ + "has_string", + "has_iron" + ] + ], "criteria": { "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Fishing Rod_1": [ - "String_3", - "Iron_10" - ]}} + "rewards": { + "recipes": { + "Iron Fishing Rod_1": [ + "String_3", + "Iron_10" + ] + } + } }, "minicraft.advancements.recipes.iron_pickaxe": { - "requirements": [[ - "has_wood", - "has_iron" - ]], + "requirements": [ + [ + "has_wood", + "has_iron" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Pickaxe_1": [ - "Wood_5", - "Iron_5" - ]}} + "rewards": { + "recipes": { + "Iron Pickaxe_1": [ + "Wood_5", + "Iron_5" + ] + } + } }, "minicraft.advancements.recipes.arcane_fertilizer": { - "requirements": [[ - "has_bone", - "has_lapis" - ]], + "requirements": [ + [ + "has_bone", + "has_lapis" + ] + ], "criteria": { "has_bone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Bone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Bone" + ] + } + ] + } }, "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } } }, - "rewards": {"recipes": {"ARCANE FERTILIZER_3": [ - "Lapis_6", - "Bone_2" - ]}} + "rewards": { + "recipes": { + "ARCANE FERTILIZER_3": [ + "Lapis_6", + "Bone_2" + ] + } + } }, "minicraft.advancements.recipes.ornate_stone": { - "requirements": [["has_stone"]], - "criteria": {"has_stone": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} - }}, - "rewards": {"recipes": {"Ornate Stone_1": ["Stone_2"]}} + "requirements": [ + [ + "has_stone" + ] + ], + "criteria": { + "has_stone": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Ornate Stone_1": [ + "Stone_2" + ] + } + } }, "minicraft.advancements.recipes.wooden_bow": { - "requirements": [[ - "has_wood", - "has_string" - ]], + "requirements": [ + [ + "has_wood", + "has_string" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } } }, - "rewards": {"recipes": {"Wood Bow_1": [ - "String_2", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Wood Bow_1": [ + "String_2", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.gold_pickaxe": { - "requirements": [[ - "has_wood", - "has_gold" - ]], + "requirements": [ + [ + "has_wood", + "has_gold" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Pickaxe_1": [ - "Gold_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Gold Pickaxe_1": [ + "Gold_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.gold": { - "requirements": [[ - "has_coal", - "has_gold_ore" - ]], + "requirements": [ + [ + "has_coal", + "has_gold_ore" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_gold_ore": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold Ore"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold Ore" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold_1": [ - "Coal_1", - "Gold Ore_3" - ]}} + "rewards": { + "recipes": { + "Gold_1": [ + "Coal_1", + "Gold Ore_3" + ] + } + } }, "minicraft.advancements.recipes.cooked_fish": { - "requirements": [[ - "has_coal", - "has_raw_fish" - ]], + "requirements": [ + [ + "has_coal", + "has_raw_fish" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_raw_fish": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Raw Fish"]}]} + "conditions": { + "items": [ + { + "items": [ + "Raw Fish" + ] + } + ] + } } }, - "rewards": {"recipes": {"Cooked Fish_1": [ - "Coal_1", - "Raw Fish_1" - ]}} + "rewards": { + "recipes": { + "Cooked Fish_1": [ + "Coal_1", + "Raw Fish_1" + ] + } + } }, "minicraft.advancements.recipes.light_potion": { - "requirements": [[ - "has_slime", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_slime", + "has_awkward_potion" + ] + ], "criteria": { "has_slime": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Slime"]}]} + "conditions": { + "items": [ + { + "items": [ + "Slime" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Light Potion_1": [ - "Slime_5", - "Awkward Potion_1" - ]}} + "rewards": { + "recipes": { + "Light Potion_1": [ + "Slime_5", + "Awkward Potion_1" + ] + } + } }, "minicraft.advancements.recipes.gold_sword": { - "requirements": [[ - "has_wood", - "has_gold" - ]], + "requirements": [ + [ + "has_wood", + "has_gold" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Sword_1": [ - "Gold_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Gold Sword_1": [ + "Gold_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.gold_shovel": { - "requirements": [[ - "has_wood", - "has_gold" - ]], + "requirements": [ + [ + "has_wood", + "has_gold" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Shovel_1": [ - "Gold_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Gold Shovel_1": [ + "Gold_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.stone_shovel": { - "requirements": [[ - "has_stone", - "has_wood" - ]], + "requirements": [ + [ + "has_stone", + "has_wood" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } } }, - "rewards": {"recipes": {"Rock Shovel_1": [ - "Stone_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Rock Shovel_1": [ + "Stone_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.escape_potion": { - "requirements": [[ - "has_lapis", - "has_gunpowder", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_lapis", + "has_gunpowder", + "has_awkward_potion" + ] + ], "criteria": { "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_gunpowder": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gunpowder"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gunpowder" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Escape Potion_1": [ - "Lapis_7", - "Awkward Potion_1", - "Gunpowder_3" - ]}} + "rewards": { + "recipes": { + "Escape Potion_1": [ + "Lapis_7", + "Awkward Potion_1", + "Gunpowder_3" + ] + } + } }, "minicraft.advancements.recipes.obsidian_wall": { - "requirements": [["has_obsidian_brick"]], - "criteria": {"has_obsidian_brick": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Obsidian Brick"]}]} - }}, - "rewards": {"recipes": {"Obsidian Wall_1": ["Obsidian Brick_3"]}} + "requirements": [ + [ + "has_obsidian_brick" + ] + ], + "criteria": { + "has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Obsidian Brick" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Obsidian Wall_1": [ + "Obsidian Brick_3" + ] + } + } }, "minicraft.advancements.recipes.cyan_clothes": { - "requirements": [[ - "has_cactus", - "has_lapis", - "has_cloth" - ]], + "requirements": [ + [ + "has_cactus", + "has_lapis", + "has_cloth" + ] + ], "criteria": { "has_cactus": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cactus"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cactus" + ] + } + ] + } }, "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } } }, - "rewards": {"recipes": {"Cyan Clothes_1": [ - "Lapis_1", - "Cloth_5", - "Cactus_1" - ]}} + "rewards": { + "recipes": { + "Cyan Clothes_1": [ + "Lapis_1", + "Cloth_5", + "Cactus_1" + ] + } + } }, "minicraft.advancements.recipes.gem_armor": { - "requirements": [["has_gem"]], - "criteria": {"has_gem": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} - }}, - "rewards": {"recipes": {"Gem Armor_1": ["Gem_65"]}} + "requirements": [ + [ + "has_gem" + ] + ], + "criteria": { + "has_gem": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Gem Armor_1": [ + "Gem_65" + ] + } + } }, "minicraft.advancements.recipes.golden_apple": { - "requirements": [[ - "has_apple", - "has_gold" - ]], + "requirements": [ + [ + "has_apple", + "has_gold" + ] + ], "criteria": { "has_apple": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Apple"]}]} + "conditions": { + "items": [ + { + "items": [ + "Apple" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Apple_1": [ - "Gold_8", - "Apple_1" - ]}} + "rewards": { + "recipes": { + "Gold Apple_1": [ + "Gold_8", + "Apple_1" + ] + } + } }, "minicraft.advancements.recipes.arrow": { - "requirements": [[ - "has_stone", - "has_wood" - ]], + "requirements": [ + [ + "has_stone", + "has_wood" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } } }, - "rewards": {"recipes": {"Arrow_3": [ - "Stone_2", - "Wood_2" - ]}} + "rewards": { + "recipes": { + "Arrow_3": [ + "Stone_2", + "Wood_2" + ] + } + } }, "minicraft.advancements.recipes.stone_wall": { - "requirements": [["has_stone_brick"]], - "criteria": {"has_stone_brick": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone Brick"]}]} - }}, - "rewards": {"recipes": {"Stone Wall_1": ["Stone Brick_3"]}} + "requirements": [ + [ + "has_stone_brick" + ] + ], + "criteria": { + "has_stone_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Stone Brick" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Stone Wall_1": [ + "Stone Brick_3" + ] + } + } }, "minicraft.advancements.recipes.glass": { - "requirements": [[ - "has_coal", - "has_sand" - ]], + "requirements": [ + [ + "has_coal", + "has_sand" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_sand": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Sand"]}]} + "conditions": { + "items": [ + { + "items": [ + "Sand" + ] + } + ] + } } }, - "rewards": {"recipes": {"Glass_1": [ - "Coal_1", - "Sand_4" - ]}} + "rewards": { + "recipes": { + "Glass_1": [ + "Coal_1", + "Sand_4" + ] + } + } }, "minicraft.advancements.recipes.speed_potion": { - "requirements": [[ - "has_cactus", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_cactus", + "has_awkward_potion" + ] + ], "criteria": { "has_cactus": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cactus"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cactus" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Speed Potion_1": [ - "Cactus_5", - "Awkward Potion_1" - ]}} + "rewards": { + "recipes": { + "Speed Potion_1": [ + "Cactus_5", + "Awkward Potion_1" + ] + } + } }, "minicraft.advancements.recipes.gold_bow": { - "requirements": [[ - "has_wood", - "has_string", - "has_gold" - ]], + "requirements": [ + [ + "has_wood", + "has_string", + "has_gold" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Bow_1": [ - "Gold_5", - "String_2", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Gold Bow_1": [ + "Gold_5", + "String_2", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.gold_lantern": { - "requirements": [[ - "has_glass", - "has_gold", - "has_slime" - ]], + "requirements": [ + [ + "has_glass", + "has_gold", + "has_slime" + ] + ], "criteria": { "has_glass": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Glass"]}]} + "conditions": { + "items": [ + { + "items": [ + "Glass" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } }, "has_slime": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Slime"]}]} + "conditions": { + "items": [ + { + "items": [ + "Slime" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Lantern_1": [ - "Glass_4", - "Gold_10", - "Slime_5" - ]}} + "rewards": { + "recipes": { + "Gold Lantern_1": [ + "Glass_4", + "Gold_10", + "Slime_5" + ] + } + } }, "minicraft.advancements.recipes.plank_wall": { - "requirements": [["has_plank"]], - "criteria": {"has_plank": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Plank"]}]} - }}, - "rewards": {"recipes": {"Plank Wall_1": ["Plank_3"]}} + "requirements": [ + [ + "has_plank" + ] + ], + "criteria": { + "has_plank": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Plank" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Plank Wall_1": [ + "Plank_3" + ] + } + } }, "minicraft.advancements.recipes.iron_armor": { - "requirements": [["has_iron"]], - "criteria": {"has_iron": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} - }}, - "rewards": {"recipes": {"Iron Armor_1": ["Iron_10"]}} + "requirements": [ + [ + "has_iron" + ] + ], + "criteria": { + "has_iron": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Iron Armor_1": [ + "Iron_10" + ] + } + } }, "minicraft.advancements.recipes.iron_shovel": { - "requirements": [[ - "has_wood", - "has_iron" - ]], + "requirements": [ + [ + "has_wood", + "has_iron" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Shovel_1": [ - "Wood_5", - "Iron_5" - ]}} + "rewards": { + "recipes": { + "Iron Shovel_1": [ + "Wood_5", + "Iron_5" + ] + } + } }, "minicraft.advancements.recipes.yellow_wool": { - "requirements": [[ - "has_wool", - "has_flower" - ]], + "requirements": [ + [ + "has_wool", + "has_flower" + ] + ], "criteria": { "has_wool": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } }, "has_flower": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Flower"]}]} + "conditions": { + "items": [ + { + "items": [ + "Flower" + ] + } + ] + } } }, - "rewards": {"recipes": {"Yellow Wool_1": [ - "Flower_1", - "Wool_1" - ]}} + "rewards": { + "recipes": { + "Yellow Wool_1": [ + "Flower_1", + "Wool_1" + ] + } + } }, "minicraft.advancements.recipes.obsidian_door": { - "requirements": [["has_obsidian_brick"]], - "criteria": {"has_obsidian_brick": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Obsidian Brick"]}]} - }}, - "rewards": {"recipes": {"Obsidian Door_1": ["Obsidian Brick_5"]}} + "requirements": [ + [ + "has_obsidian_brick" + ] + ], + "criteria": { + "has_obsidian_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Obsidian Brick" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Obsidian Door_1": [ + "Obsidian Brick_5" + ] + } + } }, "minicraft.advancements.recipes.stone_hoe": { - "requirements": [[ - "has_stone", - "has_wood" - ]], + "requirements": [ + [ + "has_stone", + "has_wood" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } } }, - "rewards": {"recipes": {"Rock Hoe_1": [ - "Stone_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Rock Hoe_1": [ + "Stone_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.chest": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Chest_1": ["Wood_20"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Chest_1": [ + "Wood_20" + ] + } + } }, "minicraft.advancements.recipes.gem_hoe": { - "requirements": [[ - "has_wood", - "has_gem" - ]], + "requirements": [ + [ + "has_wood", + "has_gem" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Hoe_1": [ - "Wood_5", - "Gem_50" - ]}} + "rewards": { + "recipes": { + "Gem Hoe_1": [ + "Wood_5", + "Gem_50" + ] + } + } }, "minicraft.advancements.recipes.awkward_potion": { - "requirements": [[ - "has_lapis", - "has_glass_bottle" - ]], + "requirements": [ + [ + "has_lapis", + "has_glass_bottle" + ] + ], "criteria": { "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_glass_bottle": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Glass Bottle"]}]} + "conditions": { + "items": [ + { + "items": [ + "Glass Bottle" + ] + } + ] + } } }, - "rewards": {"recipes": {"Awkward Potion_1": [ - "Lapis_3", - "Glass Bottle_1" - ]}} + "rewards": { + "recipes": { + "Awkward Potion_1": [ + "Lapis_3", + "Glass Bottle_1" + ] + } + } }, "minicraft.advancements.recipes.reg_clothes": { - "requirements": [["has_cloth"]], - "criteria": {"has_cloth": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} - }}, - "rewards": {"recipes": {"Reg Clothes_1": ["Cloth_5"]}} + "requirements": [ + [ + "has_cloth" + ] + ], + "criteria": { + "has_cloth": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Reg Clothes_1": [ + "Cloth_5" + ] + } + } }, "minicraft.advancements.recipes.totem_of_air": { - "requirements": [[ - "has_gem", - "has_cloud_ore", - "has_lapis", - "has_gold" - ]], + "requirements": [ + [ + "has_gem", + "has_cloud_ore", + "has_lapis", + "has_gold" + ] + ], "criteria": { "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } }, "has_cloud_ore": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloud Ore"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloud Ore" + ] + } + ] + } }, "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Totem of Air_1": [ - "Lapis_5", - "Gold_10", - "Gem_10", - "Cloud Ore_5" - ]}} + "rewards": { + "recipes": { + "Totem of Air_1": [ + "Lapis_5", + "Gold_10", + "Gem_10", + "Cloud Ore_5" + ] + } + } }, "minicraft.advancements.recipes.iron_bow": { - "requirements": [[ - "has_wood", - "has_string", - "has_iron" - ]], + "requirements": [ + [ + "has_wood", + "has_string", + "has_iron" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Bow_1": [ - "String_2", - "Iron_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Iron Bow_1": [ + "String_2", + "Iron_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.wooden_shovel": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Wood Shovel_1": ["Wood_5"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Wood Shovel_1": [ + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.string": { - "requirements": [["has_wool"]], - "criteria": {"has_wool": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} - }}, - "rewards": {"recipes": {"String_2": ["Wool_1"]}} + "requirements": [ + [ + "has_wool" + ] + ], + "criteria": { + "has_wool": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "String_2": [ + "Wool_1" + ] + } + } }, "minicraft.advancements.recipes.loom": { - "requirements": [[ - "has_wood", - "has_wool" - ]], + "requirements": [ + [ + "has_wood", + "has_wool" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_wool": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } } }, - "rewards": {"recipes": {"Loom_1": [ - "Wood_10", - "Wool_5" - ]}} + "rewards": { + "recipes": { + "Loom_1": [ + "Wood_10", + "Wool_5" + ] + } + } }, "minicraft.advancements.recipes.bread": { - "requirements": [["has_wheat"]], - "criteria": {"has_wheat": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wheat"]}]} - }}, - "rewards": {"recipes": {"Bread_1": ["Wheat_4"]}} + "requirements": [ + [ + "has_wheat" + ] + ], + "criteria": { + "has_wheat": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wheat" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Bread_1": [ + "Wheat_4" + ] + } + } }, "minicraft.advancements.recipes.anvil": { - "requirements": [["has_iron"]], - "criteria": {"has_iron": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} - }}, - "rewards": {"recipes": {"Anvil_1": ["Iron_5"]}} + "requirements": [ + [ + "has_iron" + ] + ], + "criteria": { + "has_iron": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Anvil_1": [ + "Iron_5" + ] + } + } }, "minicraft.advancements.recipes.torch": { - "requirements": [[ - "has_coal", - "has_wood" - ]], + "requirements": [ + [ + "has_coal", + "has_wood" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } } }, - "rewards": {"recipes": {"Torch_2": [ - "Coal_1", - "Wood_1" - ]}} + "rewards": { + "recipes": { + "Torch_2": [ + "Coal_1", + "Wood_1" + ] + } + } }, "minicraft.advancements.recipes.gold_axe": { - "requirements": [[ - "has_wood", - "has_gold" - ]], + "requirements": [ + [ + "has_wood", + "has_gold" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Axe_1": [ - "Gold_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Gold Axe_1": [ + "Gold_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.iron_lantern": { - "requirements": [[ - "has_glass", - "has_slime", - "has_iron" - ]], + "requirements": [ + [ + "has_glass", + "has_slime", + "has_iron" + ] + ], "criteria": { "has_glass": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Glass"]}]} + "conditions": { + "items": [ + { + "items": [ + "Glass" + ] + } + ] + } }, "has_slime": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Slime"]}]} + "conditions": { + "items": [ + { + "items": [ + "Slime" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Lantern_1": [ - "Glass_4", - "Iron_8", - "Slime_5" - ]}} + "rewards": { + "recipes": { + "Iron Lantern_1": [ + "Glass_4", + "Iron_8", + "Slime_5" + ] + } + } }, "minicraft.advancements.recipes.enchanter": { - "requirements": [[ - "has_wood", - "has_string", - "has_lapis" - ]], + "requirements": [ + [ + "has_wood", + "has_string", + "has_lapis" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_string": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["String"]}]} + "conditions": { + "items": [ + { + "items": [ + "String" + ] + } + ] + } }, "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } } }, - "rewards": {"recipes": {"Enchanter_1": [ - "Lapis_10", - "String_2", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Enchanter_1": [ + "Lapis_10", + "String_2", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.gold_claymore": { - "requirements": [[ - "has_shard", - "has_gold_sword" - ]], + "requirements": [ + [ + "has_shard", + "has_gold_sword" + ] + ], "criteria": { "has_shard": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Shard"]}]} + "conditions": { + "items": [ + { + "items": [ + "Shard" + ] + } + ] + } }, "has_gold_sword": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold Sword"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold Sword" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Claymore_1": [ - "Shard_15", - "Gold Sword_1" - ]}} + "rewards": { + "recipes": { + "Gold Claymore_1": [ + "Shard_15", + "Gold Sword_1" + ] + } + } }, "minicraft.advancements.recipes.baked_potato": { - "requirements": [["has_potato"]], - "criteria": {"has_potato": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Potato"]}]} - }}, - "rewards": {"recipes": {"Baked Potato_1": ["Potato_1"]}} + "requirements": [ + [ + "has_potato" + ] + ], + "criteria": { + "has_potato": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Potato" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Baked Potato_1": [ + "Potato_1" + ] + } + } }, "minicraft.advancements.recipes.empty_bucket": { - "requirements": [["has_iron"]], - "criteria": {"has_iron": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} - }}, - "rewards": {"recipes": {"Empty Bucket_1": ["Iron_5"]}} + "requirements": [ + [ + "has_iron" + ] + ], + "criteria": { + "has_iron": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Empty Bucket_1": [ + "Iron_5" + ] + } + } }, "minicraft.advancements.recipes.gold_hoe": { - "requirements": [[ - "has_wood", - "has_gold" - ]], + "requirements": [ + [ + "has_wood", + "has_gold" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gold Hoe_1": [ - "Gold_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Gold Hoe_1": [ + "Gold_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.iron": { - "requirements": [[ - "has_coal", - "has_iron_ore" - ]], + "requirements": [ + [ + "has_coal", + "has_iron_ore" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_iron_ore": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron Ore"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron Ore" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron_1": [ - "Coal_1", - "Iron Ore_3" - ]}} + "rewards": { + "recipes": { + "Iron_1": [ + "Coal_1", + "Iron Ore_3" + ] + } + } }, "minicraft.advancements.recipes.stone_door": { - "requirements": [["has_stone_brick"]], - "criteria": {"has_stone_brick": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone Brick"]}]} - }}, - "rewards": {"recipes": {"Stone Door_1": ["Stone Brick_5"]}} + "requirements": [ + [ + "has_stone_brick" + ] + ], + "criteria": { + "has_stone_brick": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Stone Brick" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Stone Door_1": [ + "Stone Brick_5" + ] + } + } }, "minicraft.advancements.recipes.obsidian_poppet": { - "requirements": [[ - "has_shard", - "has_gem", - "has_lapis", - "has_gold" - ]], + "requirements": [ + [ + "has_shard", + "has_gem", + "has_lapis", + "has_gold" + ] + ], "criteria": { "has_shard": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Shard"]}]} + "conditions": { + "items": [ + { + "items": [ + "Shard" + ] + } + ] + } }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } }, "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_gold": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold" + ] + } + ] + } } }, - "rewards": {"recipes": {"Obsidian Poppet_1": [ - "Lapis_5", - "Gold_10", - "Shard_15", - "Gem_10" - ]}} + "rewards": { + "recipes": { + "Obsidian Poppet_1": [ + "Lapis_5", + "Gold_10", + "Shard_15", + "Gem_10" + ] + } + } }, "minicraft.advancements.recipes.gem_axe": { - "requirements": [[ - "has_wood", - "has_gem" - ]], + "requirements": [ + [ + "has_wood", + "has_gem" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Axe_1": [ - "Wood_5", - "Gem_50" - ]}} + "rewards": { + "recipes": { + "Gem Axe_1": [ + "Wood_5", + "Gem_50" + ] + } + } }, "minicraft.advancements.recipes.tnt": { - "requirements": [[ - "has_sand", - "has_gunpowder" - ]], + "requirements": [ + [ + "has_sand", + "has_gunpowder" + ] + ], "criteria": { "has_sand": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Sand"]}]} + "conditions": { + "items": [ + { + "items": [ + "Sand" + ] + } + ] + } }, "has_gunpowder": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gunpowder"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gunpowder" + ] + } + ] + } } }, - "rewards": {"recipes": {"Tnt_1": [ - "Sand_8", - "Gunpowder_10" - ]}} + "rewards": { + "recipes": { + "Tnt_1": [ + "Sand_8", + "Gunpowder_10" + ] + } + } }, "minicraft.advancements.recipes.iron_sword": { - "requirements": [[ - "has_wood", - "has_iron" - ]], + "requirements": [ + [ + "has_wood", + "has_iron" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_iron": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Iron"]}]} + "conditions": { + "items": [ + { + "items": [ + "Iron" + ] + } + ] + } } }, - "rewards": {"recipes": {"Iron Sword_1": [ - "Wood_5", - "Iron_5" - ]}} + "rewards": { + "recipes": { + "Iron Sword_1": [ + "Wood_5", + "Iron_5" + ] + } + } }, "minicraft.advancements.recipes.wooden_sword": { - "requirements": [["has_wood"]], - "criteria": {"has_wood": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} - }}, - "rewards": {"recipes": {"Wood Sword_1": ["Wood_5"]}} + "requirements": [ + [ + "has_wood" + ] + ], + "criteria": { + "has_wood": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Wood Sword_1": [ + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.furnace": { - "requirements": [["has_stone"]], - "criteria": {"has_stone": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} - }}, - "rewards": {"recipes": {"Furnace_1": ["Stone_20"]}} + "requirements": [ + [ + "has_stone" + ] + ], + "criteria": { + "has_stone": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Furnace_1": [ + "Stone_20" + ] + } + } }, "minicraft.advancements.recipes.gem_shovel": { - "requirements": [[ - "has_wood", - "has_gem" - ]], + "requirements": [ + [ + "has_wood", + "has_gem" + ] + ], "criteria": { "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } } }, - "rewards": {"recipes": {"Gem Shovel_1": [ - "Wood_5", - "Gem_50" - ]}} + "rewards": { + "recipes": { + "Gem Shovel_1": [ + "Wood_5", + "Gem_50" + ] + } + } }, "minicraft.advancements.recipes.black_clothes": { - "requirements": [[ - "has_coal", - "has_cloth" - ]], + "requirements": [ + [ + "has_coal", + "has_cloth" + ] + ], "criteria": { "has_coal": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Coal"]}]} + "conditions": { + "items": [ + { + "items": [ + "Coal" + ] + } + ] + } }, "has_cloth": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Cloth"]}]} + "conditions": { + "items": [ + { + "items": [ + "Cloth" + ] + } + ] + } } }, - "rewards": {"recipes": {"Black Clothes_1": [ - "Coal_1", - "Cloth_5" - ]}} + "rewards": { + "recipes": { + "Black Clothes_1": [ + "Coal_1", + "Cloth_5" + ] + } + } }, "minicraft.advancements.recipes.haste_potion": { - "requirements": [[ - "has_stone", - "has_wood", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_stone", + "has_wood", + "has_awkward_potion" + ] + ], "criteria": { "has_stone": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } }, "has_wood": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wood"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wood" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Haste Potion_1": [ - "Awkward Potion_1", - "Stone_5", - "Wood_5" - ]}} + "rewards": { + "recipes": { + "Haste Potion_1": [ + "Awkward Potion_1", + "Stone_5", + "Wood_5" + ] + } + } }, "minicraft.advancements.recipes.blue_wool": { - "requirements": [[ - "has_lapis", - "has_wool" - ]], + "requirements": [ + [ + "has_lapis", + "has_wool" + ] + ], "criteria": { "has_lapis": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Lapis"]}]} + "conditions": { + "items": [ + { + "items": [ + "Lapis" + ] + } + ] + } }, "has_wool": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Wool"]}]} + "conditions": { + "items": [ + { + "items": [ + "Wool" + ] + } + ] + } } }, - "rewards": {"recipes": {"Blue Wool_1": [ - "Lapis_1", - "Wool_1" - ]}} + "rewards": { + "recipes": { + "Blue Wool_1": [ + "Lapis_1", + "Wool_1" + ] + } + } }, "minicraft.advancements.recipes.ornate_obsidian": { - "requirements": [["has_raw_obsidian"]], - "criteria": {"has_raw_obsidian": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Raw Obsidian"]}]} - }}, - "rewards": {"recipes": {"Ornate Obsidian_1": ["Raw Obsidian_2"]}} + "requirements": [ + [ + "has_raw_obsidian" + ] + ], + "criteria": { + "has_raw_obsidian": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Raw Obsidian" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Ornate Obsidian_1": [ + "Raw Obsidian_2" + ] + } + } }, "minicraft.advancements.recipes.energy_potion": { - "requirements": [[ - "has_gem", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_gem", + "has_awkward_potion" + ] + ], "criteria": { "has_gem": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gem"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gem" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Energy Potion_1": [ - "Awkward Potion_1", - "Gem_25" - ]}} + "rewards": { + "recipes": { + "Energy Potion_1": [ + "Awkward Potion_1", + "Gem_25" + ] + } + } }, "minicraft.advancements.recipes.oven": { - "requirements": [["has_stone"]], - "criteria": {"has_stone": { - "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Stone"]}]} - }}, - "rewards": {"recipes": {"Oven_1": ["Stone_15"]}} + "requirements": [ + [ + "has_stone" + ] + ], + "criteria": { + "has_stone": { + "trigger": "inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "Stone" + ] + } + ] + } + } + }, + "rewards": { + "recipes": { + "Oven_1": [ + "Stone_15" + ] + } + } }, "minicraft.advancements.recipes.regen_potion": { - "requirements": [[ - "has_golden_apple", - "has_awkward_potion" - ]], + "requirements": [ + [ + "has_golden_apple", + "has_awkward_potion" + ] + ], "criteria": { "has_golden_apple": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Gold Apple"]}]} + "conditions": { + "items": [ + { + "items": [ + "Gold Apple" + ] + } + ] + } }, "has_awkward_potion": { "trigger": "inventory_changed", - "conditions": {"items": [{"items": ["Awkward Potion"]}]} + "conditions": { + "items": [ + { + "items": [ + "Awkward Potion" + ] + } + ] + } } }, - "rewards": {"recipes": {"Regen Potion_1": [ - "Gold Apple_1", - "Awkward Potion_1" - ]}} + "rewards": { + "recipes": { + "Regen Potion_1": [ + "Gold Apple_1", + "Awkward Potion_1" + ] + } + } } -} \ No newline at end of file +} From b0577473fe8556d231798d19815225324bf51c7f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:49:58 +0800 Subject: [PATCH 228/261] Fix loading torch ID mapping --- src/client/java/minicraft/saveload/Load.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 818a313c9..32bef2408 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -738,7 +738,7 @@ private void loadWorld(String filename) { public static void loadTile(short[] tiles, short[] data, int idx, String tileName, String tileData) { Matcher matcher; if ((matcher = OLD_TORCH_TILE_REGEX.matcher(tileName.toUpperCase())).matches()) { - tiles[idx] = 54; // ID of TORCH tile + tiles[idx] = 57; // ID of TORCH tile data[idx] = Tiles.get(matcher.group(1)).id; } else { tiles[idx] = Tiles.get(tileName).id; From fbba31dacbd2821e37c42db65de2475019ce124f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 28 Mar 2024 22:03:53 +0800 Subject: [PATCH 229/261] Reformat code --- .editorconfig | 1 + .../java/minicraft/entity/furniture/DungeonChest.java | 3 +-- .../java/minicraft/entity/particle/SandParticle.java | 1 - src/client/java/minicraft/item/Inventory.java | 1 - src/client/java/minicraft/level/Structure.java | 8 ++++---- src/client/java/minicraft/level/tile/FenceTile.java | 11 +++-------- src/client/java/minicraft/level/tile/Tile.java | 4 ++-- src/client/java/minicraft/level/tile/TorchTile.java | 3 --- src/client/java/minicraft/saveload/LegacyLoad.java | 2 -- src/client/java/minicraft/saveload/Load.java | 2 -- src/client/java/minicraft/screen/LoadingDisplay.java | 4 +++- src/client/java/minicraft/screen/QuestsDisplay.java | 2 +- 12 files changed, 15 insertions(+), 27 deletions(-) diff --git a/.editorconfig b/.editorconfig index 5a617d8bf..873123347 100644 --- a/.editorconfig +++ b/.editorconfig @@ -37,6 +37,7 @@ ij_java_method_annotation_wrap = on_every_item ij_java_field_annotation_wrap = on_every_item ij_java_do_not_wrap_after_single_annotation = false ij_java_do_not_wrap_after_single_annotation_in_parameter = true +ij_java_indent_case_from_switch = true [**.json] indent_style = space diff --git a/src/client/java/minicraft/entity/furniture/DungeonChest.java b/src/client/java/minicraft/entity/furniture/DungeonChest.java index fe516ddba..f158c37a4 100644 --- a/src/client/java/minicraft/entity/furniture/DungeonChest.java +++ b/src/client/java/minicraft/entity/furniture/DungeonChest.java @@ -9,7 +9,6 @@ import minicraft.gfx.Color; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.item.Inventory; import minicraft.item.Item; import minicraft.item.Items; import minicraft.item.StackableItem; @@ -27,7 +26,7 @@ public class DungeonChest extends Chest { /** * Creates a custom chest with the name Dungeon Chest. * @param random Populate the inventory of the DungeonChest using the loot table system with the given {@link Random} provider. - * {@code null} if populating the inventory is not intended. + * {@code null} if populating the inventory is not intended. */ public DungeonChest(@Nullable Random random) { this(random, false); diff --git a/src/client/java/minicraft/entity/particle/SandParticle.java b/src/client/java/minicraft/entity/particle/SandParticle.java index e05ecd6ad..b5048f565 100644 --- a/src/client/java/minicraft/entity/particle/SandParticle.java +++ b/src/client/java/minicraft/entity/particle/SandParticle.java @@ -1,6 +1,5 @@ package minicraft.entity.particle; -import minicraft.gfx.SpriteLinker; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; diff --git a/src/client/java/minicraft/item/Inventory.java b/src/client/java/minicraft/item/Inventory.java index 64f2cf453..90562fd3b 100644 --- a/src/client/java/minicraft/item/Inventory.java +++ b/src/client/java/minicraft/item/Inventory.java @@ -1,6 +1,5 @@ package minicraft.item; -import minicraft.entity.furniture.Furniture; import minicraft.util.Logging; import org.jetbrains.annotations.Nullable; diff --git a/src/client/java/minicraft/level/Structure.java b/src/client/java/minicraft/level/Structure.java index dc7a2edee..26be44858 100644 --- a/src/client/java/minicraft/level/Structure.java +++ b/src/client/java/minicraft/level/Structure.java @@ -11,7 +11,6 @@ import java.util.HashMap; import java.util.HashSet; -import java.util.Random; import java.util.function.Consumer; // this stores structures that can be drawn at any location. @@ -38,15 +37,16 @@ public void addFurniture(int x, int y, Furniture furniture) { this.furniture.put(new Point(x, y), furniture); } - public void draw(Level level, int xt, int yt) { draw(level, xt, yt, f -> {}); } + public void draw(Level level, int xt, int yt) { draw(level, xt, yt, f -> { }); } + public void draw(Level level, int xt, int yt, Consumer furnitureHandler) { for (TilePoint p : tiles) level.setTile(xt + p.x, yt + p.y, p.t); - for (Point p: furniture.keySet()) { + for (Point p : furniture.keySet()) { Furniture fur = furniture.get(p).copy(); furnitureHandler.accept(fur); - level.add(fur, xt+p.x, yt+p.y, true); + level.add(fur, xt + p.x, yt + p.y, true); } } diff --git a/src/client/java/minicraft/level/tile/FenceTile.java b/src/client/java/minicraft/level/tile/FenceTile.java index 308cfdfb9..c62f84ab6 100644 --- a/src/client/java/minicraft/level/tile/FenceTile.java +++ b/src/client/java/minicraft/level/tile/FenceTile.java @@ -7,20 +7,14 @@ import minicraft.entity.mob.Mob; import minicraft.entity.mob.Player; import minicraft.entity.particle.SmashParticle; -import minicraft.entity.particle.TextParticle; -import minicraft.gfx.Color; import minicraft.gfx.Screen; -import minicraft.gfx.Sprite; import minicraft.gfx.SpriteAnimation; -import minicraft.gfx.SpriteLinker; -import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.item.Item; import minicraft.item.Items; import minicraft.item.ToolItem; import minicraft.level.Level; import minicraft.util.AdvancementElement; -import minicraft.util.Logging; public class FenceTile extends Tile { @@ -35,6 +29,7 @@ public class FenceTile extends Tile { public boolean connectUp = false, connectDown = false, connectLeft = false, connectRight = false; protected FenceTile(Material type) { this(type, null); } + protected FenceTile(Material type, String name) { super(type + " " + (name == null ? "Fence" : name), null); this.type = type; @@ -113,7 +108,7 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at @Override public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { - if(Game.isMode("minicraft.settings.mode.creative")) + if (Game.isMode("minicraft.settings.mode.creative")) return false; // Go directly to hurt method if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; @@ -139,6 +134,6 @@ public void hurt(Level level, int x, int y, int dmg) { Sound.play("monsterhurt"); level.dropItem(x * 16 + 8, y * 16 + 8, Items.get(name)); level.setTile(x, y, Tiles.get((short) level.getData(x, y))); - }; + } } } diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index 49141d614..f5206255d 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -166,7 +166,7 @@ public boolean onExplode(Level level, int xt, int yt) { /** * @deprecated This should be planned to be removed as this method is not ideally used. - * The current only usage is in {@link Level#setTile(int, int, String)}. + * The current only usage is in {@link Level#setTile(int, int, String)}. */ @Deprecated public int getData(String data) { @@ -179,7 +179,7 @@ public int getData(String data) { /** * @deprecated Similar to {@link #getData(String)}. Also, param {@code thisData} is unused. - * The current only usage is in {@link minicraft.item.TileItem#interactOn(Tile, Level, int, int, Player, Direction)}. + * The current only usage is in {@link minicraft.item.TileItem#interactOn(Tile, Level, int, int, Player, Direction)}. */ @Deprecated public boolean matches(int thisData, String tileInfo) { diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index 17cb677aa..0d6c3170f 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -11,9 +11,6 @@ import minicraft.item.PowerGloveItem; import minicraft.level.Level; import minicraft.util.AdvancementElement; -import org.tinylog.Logger; - -import java.util.HashMap; public class TorchTile extends Tile { protected TorchTile() { diff --git a/src/client/java/minicraft/saveload/LegacyLoad.java b/src/client/java/minicraft/saveload/LegacyLoad.java index 25ca2df15..f0b391802 100644 --- a/src/client/java/minicraft/saveload/LegacyLoad.java +++ b/src/client/java/minicraft/saveload/LegacyLoad.java @@ -34,9 +34,7 @@ import minicraft.item.PotionType; import minicraft.item.StackableItem; import minicraft.level.Level; -import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; -import minicraft.level.tile.TorchTile; import minicraft.screen.LoadingDisplay; import minicraft.util.Logging; import org.tinylog.Logger; diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 19586ea53..c7082e7aa 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -48,9 +48,7 @@ import minicraft.item.Recipe; import minicraft.item.StackableItem; import minicraft.level.Level; -import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; -import minicraft.level.tile.TorchTile; import minicraft.network.Network; import minicraft.screen.AchievementsDisplay; import minicraft.screen.CraftingDisplay; diff --git a/src/client/java/minicraft/screen/LoadingDisplay.java b/src/client/java/minicraft/screen/LoadingDisplay.java index 3295926c8..00e861791 100644 --- a/src/client/java/minicraft/screen/LoadingDisplay.java +++ b/src/client/java/minicraft/screen/LoadingDisplay.java @@ -79,7 +79,9 @@ public static float getPercentage() { } public static void setMessage(String progressType) { - setMessage(progressType, true); } + setMessage(progressType, true); + } + public static void setMessage(String progressType, boolean localize) { LoadingDisplay.progressType = progressType; localizeProgressType = localize; diff --git a/src/client/java/minicraft/screen/QuestsDisplay.java b/src/client/java/minicraft/screen/QuestsDisplay.java index c21ae06c3..d03dd03df 100644 --- a/src/client/java/minicraft/screen/QuestsDisplay.java +++ b/src/client/java/minicraft/screen/QuestsDisplay.java @@ -261,7 +261,7 @@ public SeriesInformationDisplay(QuestSeries series) { series.isUnlocked() ? new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.status", Localization.getLocalized("minicraft.displays.quests.quest_info.display.status.unlocked")), Color.WHITE, false) : new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.status", - Localization.getLocalized("minicraft.displays.quests.quest_info.display.status.locked")), Color.GRAY, false) // Locked series would not been shown...? + Localization.getLocalized("minicraft.displays.quests.quest_info.display.status.locked")), Color.GRAY, false) // Locked series would not been shown...? ); entries.add(new StringEntry(Localization.getLocalized("minicraft.displays.quests.quest_info.display.quests_completed_count", From 50b59bb48e9ae9f4e869cc04090009215cd1e49a Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 28 Mar 2024 22:28:59 +0800 Subject: [PATCH 230/261] Update Sign to have similar mechanisms as Torch --- src/client/java/minicraft/entity/Entity.java | 5 --- src/client/java/minicraft/item/Items.java | 1 - src/client/java/minicraft/item/SignItem.java | 45 ------------------- src/client/java/minicraft/item/TileItem.java | 5 +++ .../java/minicraft/level/tile/SignTile.java | 38 +++++----------- .../java/minicraft/level/tile/Tile.java | 3 -- .../java/minicraft/level/tile/Tiles.java | 1 + 7 files changed, 18 insertions(+), 80 deletions(-) delete mode 100644 src/client/java/minicraft/item/SignItem.java diff --git a/src/client/java/minicraft/entity/Entity.java b/src/client/java/minicraft/entity/Entity.java index f0d1ff16b..e4720b59b 100644 --- a/src/client/java/minicraft/entity/Entity.java +++ b/src/client/java/minicraft/entity/Entity.java @@ -162,9 +162,6 @@ public boolean interact(Player player, @Nullable Item item, Direction attackDir) public boolean move(int xd, int yd) { if (Updater.saving || (xd == 0 && yd == 0)) return true; // Pretend that it kept moving - int prevXt = x >> 4; - int prevYt = y >> 4; - boolean stopped = true; // Used to check if the entity has BEEN stopped, COMPLETELY; below checks for a lack of collision. //noinspection RedundantIfStatement if (moveX(xd)) stopped = false; // Becomes false if horizontal movement was successful. @@ -172,8 +169,6 @@ public boolean move(int xd, int yd) { if (!stopped) { int xt = x >> 4; // The x tile coordinate that the entity is standing on. int yt = y >> 4; // The y tile coordinate that the entity is standing on. - if (prevXt != xt || prevYt != yt) - level.getTile(prevXt, prevYt).steppedOut(level, prevXt, prevYt, this); level.getTile(xt, yt).steppedOn(level, xt, yt, this); // Calls the steppedOn() method in a tile's class. (used for tiles like sand (footprints) or lava (burning)) } return !stopped; diff --git a/src/client/java/minicraft/item/Items.java b/src/client/java/minicraft/item/Items.java index 0d471827d..1cd9a1860 100644 --- a/src/client/java/minicraft/item/Items.java +++ b/src/client/java/minicraft/item/Items.java @@ -44,7 +44,6 @@ private static void addAll(ArrayList items) { addAll(SummonItem.getAllInstances()); addAll(HeartItem.getAllInstances()); addAll(WateringCanItem.getAllInstances()); - addAll(SignItem.getAllInstances()); } public static ArrayList getAll() { diff --git a/src/client/java/minicraft/item/SignItem.java b/src/client/java/minicraft/item/SignItem.java deleted file mode 100644 index f2a0ca269..000000000 --- a/src/client/java/minicraft/item/SignItem.java +++ /dev/null @@ -1,45 +0,0 @@ -package minicraft.item; - -import java.util.ArrayList; - -import minicraft.core.Game; -import minicraft.entity.Direction; -import minicraft.entity.mob.Player; -import minicraft.gfx.Sprite; -import minicraft.gfx.SpriteLinker; -import minicraft.level.Level; -import minicraft.level.tile.SignTile; -import minicraft.level.tile.Tile; -import minicraft.screen.SignDisplay; -import org.jetbrains.annotations.NotNull; - -public class SignItem extends TileItem { - private static final SpriteLinker.LinkedSprite sprite = new SpriteLinker.LinkedSprite(SpriteLinker.SpriteType.Item, "sign"); - private static final String[] solidTiles = { "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", - "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian" }; - - - public static ArrayList getAllInstances() { - ArrayList items = new ArrayList<>(); - items.add(new SignItem()); - return items; - } - - private SignItem() { this(1); } - private SignItem(int count) { - super("Sign", sprite, count, null, solidTiles); - } - - public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Direction attackDir) { - if (validTiles.contains(tile.name)) { - level.setTile(xt, yt, SignTile.getSignTile(tile)); - Game.setDisplay(new SignDisplay(level, xt, yt)); - return super.interactOn(true); - } - return super.interactOn(false); - } - - public @NotNull SignItem copy() { - return new SignItem(count); - } -} diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index c8298e323..24973aea3 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -12,6 +12,7 @@ import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.screen.AchievementsDisplay; +import minicraft.screen.SignDisplay; import minicraft.util.AdvancementElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -77,6 +78,10 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Grass Seeds", new LinkedSprite(SpriteType.Item, "seed"), new TileModel("grass"), "dirt")); items.add(new TileItem("Torch", new LinkedSprite(SpriteType.Item, "torch"), new TileModel("Torch", placeOverWithID), solidTiles)); + items.add(new TileItem("Sign", new LinkedSprite(SpriteType.Item, "sign"), new TileModel("Sign", (model1, target, level, xt, yt, player, attackDir) -> { + Game.setDisplay(new SignDisplay(level, xt, yt)); + return placeOverWithID.getTileData(model1, target, level, xt, yt, player, attackDir); + }), solidTiles)); // Creative mode available tiles: items.add(new TileItem("Farmland", SpriteLinker.missingTexture(SpriteType.Item), new TileModel("farmland"), "dirt", "grass", "hole")); diff --git a/src/client/java/minicraft/level/tile/SignTile.java b/src/client/java/minicraft/level/tile/SignTile.java index 3823604ca..88fb97ff5 100644 --- a/src/client/java/minicraft/level/tile/SignTile.java +++ b/src/client/java/minicraft/level/tile/SignTile.java @@ -18,59 +18,45 @@ import minicraft.level.tile.entity.SignTileEntity; import minicraft.screen.SignDisplay; import minicraft.screen.SignDisplayMenu; +import minicraft.util.AdvancementElement; import org.tinylog.Logger; public class SignTile extends Tile { - private static final SpriteAnimation sprite = new SpriteAnimation(SpriteLinker.SpriteType.Tile, "sign"); - - private final Tile onType; - - public static SignTile getSignTile(Tile onTile) { - int id = onTile.id & 0xFFFF; - if(id < 16384) id += 16384; - else Logger.tag("SignTile").info("Tried to place torch on torch or sign tile..."); - - if(Tiles.containsTile(id)) { - return (SignTile)Tiles.get(id); - } else { - SignTile tile = new SignTile(onTile); - Tiles.add(id, tile); - return tile; - } - } - - private SignTile(Tile onType) { - super("Sign "+ onType.name, sprite); - this.onType = onType; + protected SignTile() { + super("Sign", new SpriteAnimation(SpriteLinker.SpriteType.Tile, "sign")); } @Override public boolean connectsToSand(Level level, int x, int y) { - return onType.connectsToSand(level, x, y);//Tiles.get((short) level.getData(x, y)).connectsToSand(level, x, y); + return Tiles.get((short) level.getData(x, y)).connectsToSand(level, x, y); } @Override public boolean connectsToFluid(Level level, int x, int y) { - return onType.connectsToFluid(level, x, y);//Tiles.get((short) level.getData(x, y)).connectsToFluid(level, x, y); + return Tiles.get((short) level.getData(x, y)).connectsToFluid(level, x, y); } @Override public boolean connectsToGrass(Level level, int x, int y) { - return onType.connectsToGrass(level, x, y);//Tiles.get((short) level.getData(x, y)).connectsToGrass(level, x, y); + return Tiles.get((short) level.getData(x, y)).connectsToGrass(level, x, y); } public void render(Screen screen, Level level, int x, int y) { - onType.render(screen, level, x, y); + Tiles.get((short) level.getData(x, y)).render(screen, level, x, y); sprite.render(screen, level, x, y); } public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { if (item != null) { if (item instanceof ToolItem && ((ToolItem) item).type == ToolType.Axe) { - level.setTile(xt, yt, this.onType); + int data = level.getData(xt, yt); + level.setTile(xt, yt, Tiles.get((short) data)); SignDisplay.removeSign(level.depth, xt, yt); Sound.play("monsterhurt"); level.dropItem(xt*16+8, yt*16+8, Items.get("Sign")); + AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( + new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( + item, this, data, xt, yt, level.depth)); return true; } } else { // TODO Add a way to lock signs diff --git a/src/client/java/minicraft/level/tile/Tile.java b/src/client/java/minicraft/level/tile/Tile.java index 0cdf4948a..05873f53a 100644 --- a/src/client/java/minicraft/level/tile/Tile.java +++ b/src/client/java/minicraft/level/tile/Tile.java @@ -133,9 +133,6 @@ public boolean tick(Level level, int xt, int yt) { public void steppedOn(Level level, int xt, int yt, Entity entity) { } - /** What happens when you have just stepped out the tile (ex: sign) */ - public void steppedOut(Level level, int xt, int yt, Entity entity) {} - /** * Called when you hit an item on a tile (ex: Pickaxe on rock). * diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index dd4f6d4cb..0f7a481e9 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -84,6 +84,7 @@ public static void initTileList() { tiles.put((short) 55, new FenceTile(Tile.Material.Stone)); tiles.put((short) 56, new FenceTile(Tile.Material.Obsidian)); tiles.put((short) 57, new TorchTile()); + tiles.put((short) 58, new SignTile()); // WARNING: don't use this tile for anything! tiles.put((short) 255, new ConnectTile()); From 68df73b65e210b121e4cf964a40ea1106779f042 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:56:11 -0400 Subject: [PATCH 231/261] Update ChangeLog.md --- ChangeLog.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 1236fe666..52014cc36 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -11,13 +11,13 @@ but some sections are changed to compliant this project. ### Additions -* Added a quest system -* Added tutorial -* Added obsidian knight as the second boss +* Added quest system +* Added tutorials +* Added obsidian knight as the second boss (Air Wizard II replacement) * Added limitation to inventories * Added limitation to stackable items -* Added seven new debug - arguments - `--debug-log-time`, `--debug-log-thread`, `--debug-log-trace`, `--debug-filelog-full`, `--debug-level`, `--debug-locale`, `--debug-unloc-tracing` +* Added seven new debug arguments: + `--debug-log-time`, `--debug-log-thread`, `--debug-log-trace`, `--debug-filelog-full`, `--debug-level`, `--debug-locale`, `--debug-unloc-tracing` * Added a new argument for disabling hardware acceleration - `--no-hardware-acceleration` * Added a toggle for HUD display * Added a toggle for simplified effect display @@ -27,20 +27,17 @@ but some sections are changed to compliant this project. * Added a crash handler and a better look of dialog. * Added a simple ability for screenshots * Added dynamic for sounds -* Added sand particle for sand +* ReAdded sand footprint particle for sand * Added characters to the font (`ÀÂÄÈÎÌÏÒÙÛÝ*«»£$&€§ªº`) * Added world-wide seed * Added controller support * Added on-screen keyboard * Added glass bottle and made potions return glass bottles when used -* Added dyes (#445) -* Added coloured sheep (#445) -* Added ability to dye sheep and beds (#445) -* Cow and sheep now graze on grasses * Added a trigger to auto-enable hardware acceleration * Added support for lower-cased letters * Added item description menu * Added fences +* Added editable signs ### Changes @@ -66,10 +63,11 @@ but some sections are changed to compliant this project. * Iron and goal now require 3 ores instead of 4 for crafting * Renamed `assets/books/story_guide.txt` to `assets/books/game_guide.txt` * Updated `assets/books/game_guide.txt` and `assets/books/instructions.txt` +* Sand footprints are now more accurately placed ### Removals -* Removed stepped sand texture +* None (compared to 2.1.3) ### Fixes @@ -81,6 +79,7 @@ but some sections are changed to compliant this project. * Fixed possible crash when Air Wizard is not loaded * Fixed minor loading bugs to dungeon chests * Fixed performance issue in WaterTile ticking +* Fixed majority of audio issues ## [2.1.3] From 4ff2b77ea7d6aa33dffa36fcabf0eb93b54e1586 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:57:32 -0400 Subject: [PATCH 232/261] Update ChangeLog.md --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index 52014cc36..2298452c5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -64,6 +64,7 @@ but some sections are changed to compliant this project. * Renamed `assets/books/story_guide.txt` to `assets/books/game_guide.txt` * Updated `assets/books/game_guide.txt` and `assets/books/instructions.txt` * Sand footprints are now more accurately placed +* Optimized rendering ### Removals From 3a9d796c2d73cfa1a7863022ee88e5470a24b95c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 3 Apr 2024 01:18:23 +0800 Subject: [PATCH 233/261] Resolve post-merge errors --- .editorconfig | 1 - src/client/java/minicraft/gfx/Screen.java | 36 +++++++++++++++++++ .../java/minicraft/screen/SignDisplay.java | 11 ++---- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index 873123347..48902f6ed 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,7 +15,6 @@ ij_java_packages_to_use_import_on_demand = unset ij_java_class_count_to_use_import_on_demand = 99999999 ij_java_names_count_to_use_import_on_demand = 99999999 ij_java_use_single_class_imports = true -ij_java_use_fq_class_names = true ij_java_insert_inner_class_imports = false ij_java_layout_static_imports_separately = true ij_java_space_before_array_initializer_left_brace = true diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index 3ea910999..a8b997fbd 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -197,6 +197,37 @@ public void render(Graphics2D graphics) { } } + /** Placeholder way, for Sign cursor rendering */ + private class DrawLineSpecialRendering implements Rendering { + private final int x0, y0, l; + private final @MagicConstant(intValues = {0, 1}) int axis; // 0: x-axis; 1: Y-axis + + public DrawLineSpecialRendering(int x0, int y0, int l, int axis) { + this.x0 = x0; + this.y0 = y0; + this.l = l; + this.axis = axis; + } + + @Override + public void render(Graphics2D graphics) { + switch (axis) { + case 0: + for (int i = 0; i < l; i++) { // 1 pixel high and 8 pixel wide + int idx = x0 + i + y0 * Screen.w; + pixels[idx] = Color.getLightnessFromRGB(pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; + } + break; + case 1: + for (int i = 0; i < l; i++) { // 8 pixel high and 1 pixel wide + int idx = x0 + (y0 + i) * Screen.w; + pixels[idx] = Color.getLightnessFromRGB(pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; + } + break; + } + } + } + private class OverlayRendering implements Rendering { private final int currentLevel, xa, ya; private final double darkFactor; @@ -372,6 +403,11 @@ public void drawLine(int x0, int y0, int x1, int y1, int color) { queue(new DrawLineRendering(x0, y0, x1, y1, color)); } + /** Placeholder line drawing method specialized for sign cursor drawing */ + public void drawLineSpecial(int x0, int y0, @MagicConstant(intValues = {0, 1}) int axis, int l) { + queue(new DrawLineSpecialRendering(x0, y0, l, axis)); + } + /** * Sets the offset of the screen */ diff --git a/src/client/java/minicraft/screen/SignDisplay.java b/src/client/java/minicraft/screen/SignDisplay.java index b434c5d09..ce4459f11 100644 --- a/src/client/java/minicraft/screen/SignDisplay.java +++ b/src/client/java/minicraft/screen/SignDisplay.java @@ -163,16 +163,9 @@ public void render(Screen screen) { int cursorX = lineBeginning + displayX; int cursorY = bounds.getTop() + MinicraftImage.boxWidth + displayY; if (this.cursorX == rows.get(this.cursorY).length()) { // Replace cursor - int cursorRenderY = cursorY + MinicraftImage.boxWidth - 1; - for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 1 pixel high and 8 pixel wide - int idx = cursorX + i + cursorRenderY * Screen.w; - screen.pixels[idx] = Color.getLightnessFromRGB(screen.pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; - } + screen.drawLineSpecial(cursorX, cursorY + MinicraftImage.boxWidth - 1, 0, MinicraftImage.boxWidth); } else { // Insert cursor - for (int i = 0; i < MinicraftImage.boxWidth; i++) { // 8 pixel high and 1 pixel wide - int idx = cursorX + (cursorY + i) * Screen.w; - screen.pixels[idx] = Color.getLightnessFromRGB(screen.pixels[idx]) >= .5 ? Color.BLACK : Color.WHITE; - } + screen.drawLineSpecial(cursorX, cursorY, 1, MinicraftImage.boxWidth); } } } From 2b3ab6d540d5c2e84f8a0e605aa596eacf5ae81a Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 3 Apr 2024 21:08:32 +0800 Subject: [PATCH 234/261] Delete .github/ISSUE_TEMPLATE/question.md --- .github/ISSUE_TEMPLATE/question.md | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/question.md diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index c4c57ea96..000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: Question -about: Ask a question -title: Question -labels: Question -assignees: '' - ---- - -**What the question is about?** -A brief description of what you wanted to ask. Ex. I don't know how can I [...] - -**Additional context** -Add any other context or screenshots about the question here. From c2446d619f32564bf6997003c53e3b4ad7988a20 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 3 Apr 2024 21:10:24 +0800 Subject: [PATCH 235/261] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..25d01811d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Question + url: ../../../discussions + about: Ask a question From 2b2c0e7d7084ff17583fe5b8212f815cca6d8b32 Mon Sep 17 00:00:00 2001 From: Litorom Date: Wed, 3 Apr 2024 09:37:06 -0400 Subject: [PATCH 236/261] Added two missing solid tiles --- src/client/java/minicraft/item/TileItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index 24973aea3..66ae745b5 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -34,7 +34,7 @@ protected static ArrayList getAllInstances() { items.add(new TileItem("Natural Rock", new LinkedSprite(SpriteType.Item, "stone"), new TileModel("rock"), "hole", "dirt", "sand", "grass", "path", "water", "lava")); String[] solidTiles = { "dirt", "Wood Planks", "Stone Bricks", "Obsidian", "Wool", "Red Wool", "Blue Wool", - "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian" }; + "Green Wool", "Yellow Wool", "Black Wool", "grass", "sand", "path", "ornate stone", "ornate obsidian", "Raw Obsidian", "Stone" }; TileModel.TileDataGetter placeOverWithID = (model1, target, level, xt, yt, player, attackDir) -> target.id; items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), new TileModel("Wood Planks"), "hole", "water", "cloud")); From 22794d00cc7184383ef4f36ea84c8ff7b8d1aecd Mon Sep 17 00:00:00 2001 From: Litorom Date: Wed, 3 Apr 2024 09:44:32 -0400 Subject: [PATCH 237/261] Increment Version --- build.gradle | 2 +- src/client/java/minicraft/core/Game.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 353d19995..910e23dd8 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev6" + version = "2.2.0-dev7" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index 449b5ad96..a5d609c3b 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev6"); + public static final Version VERSION = new Version("2.2.0-dev7"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From 39d72d4e04e36b95e44d040961aa294a226ccbba Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sat, 6 Apr 2024 23:24:44 +0800 Subject: [PATCH 238/261] Update config.yml --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 25d01811d..bd9a33111 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - name: Question - url: ../../../discussions + url: https://github.com/MinicraftPlus/minicraft-plus-revived/discussions about: Ask a question From a4e6fb5a9c85dc2451156fb029038c6508a26523 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:17:38 +0800 Subject: [PATCH 239/261] Simplify screenshot feature --- src/client/java/minicraft/core/Renderer.java | 24 +++++++------------ .../java/minicraft/core/io/Settings.java | 1 - .../screen/OptionsMainMenuDisplay.java | 1 - .../minicraft/screen/OptionsWorldDisplay.java | 1 - 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index c85965e58..aa88698ab 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -33,6 +33,7 @@ import minicraft.screen.TutorialDisplayHandler; import minicraft.screen.entry.ListEntry; import minicraft.screen.entry.StringEntry; +import minicraft.util.Logging; import minicraft.util.Quest; import minicraft.util.Quest.QuestSeries; @@ -168,21 +169,14 @@ public static void render() { count++; } - try { // https://stackoverflow.com/a/4216635 - int w = image.getWidth(); - int h = image.getHeight(); - BufferedImage before = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); - before.getRaster().setRect(image.getData()); - int scale = (Integer) Settings.get("screenshot"); - // BufferedImage after = BigBufferedImage.create(scale * w, scale * h, BufferedImage.TYPE_INT_RGB); - AffineTransform at = new AffineTransform(); - at.scale(scale, scale); // Setting the scaling. - AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); - - // Use this solution without larger scales which use up a lot of memory. - // With scale 20, up to around 360MB overall RAM use. - BufferedImage after = scaleOp.filter(before, null); - ImageIO.write(after, "png", file); + try { + // A blank image as same as the canvas + BufferedImage img = new BufferedImage(canvas.getWidth(), canvas.getHeight(), BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = img.createGraphics(); + g2d.drawImage(image, xOffset, yOffset, ww, hh, null); // The same invoke as the one on canvas graphics + g2d.dispose(); + ImageIO.write(img, "png", file); + Logging.PLAYER.info("Saved screenshot as {}.", file.getName()); } catch (IOException e) { CrashHandler.errorHandle(e); } diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index a7af263c4..b7112eb6c 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -15,7 +15,6 @@ public final class Settings { static { options.put("fps", new RangeEntry("minicraft.settings.fps", 10, 300, getDefaultRefreshRate())); // Has to check if the game is running in a headless mode. If it doesn't set the fps to 60 - options.put("screenshot", new ArrayEntry<>("minicraft.settings.screenshot_scale", 1, 2, 5, 10, 15, 20)); // The magnification of screenshot. I would want to see ultimate sized. options.put("diff", new ArrayEntry<>("minicraft.settings.difficulty", "minicraft.settings.difficulty.easy", "minicraft.settings.difficulty.normal", "minicraft.settings.difficulty.hard")); options.get("diff").setSelection(1); options.put("mode", new ArrayEntry<>("minicraft.settings.mode", "minicraft.settings.mode.survival", "minicraft.settings.mode.creative", "minicraft.settings.mode.hardcore", "minicraft.settings.mode.score")); diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index 696a2ae62..6a5522fc6 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -15,7 +15,6 @@ public OptionsMainMenuDisplay() { new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), - Settings.getEntry("screenshot"), new SelectEntry("minicraft.display.options_display.resource_packs", () -> Game.setDisplay(new ResourcePackDisplay())) ) .setTitle("minicraft.displays.options_main_menu") diff --git a/src/client/java/minicraft/screen/OptionsWorldDisplay.java b/src/client/java/minicraft/screen/OptionsWorldDisplay.java index d9090f7a5..2bb06b800 100644 --- a/src/client/java/minicraft/screen/OptionsWorldDisplay.java +++ b/src/client/java/minicraft/screen/OptionsWorldDisplay.java @@ -65,7 +65,6 @@ private List getEntries() { new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), - Settings.getEntry("screenshot"), new SelectEntry("minicraft.display.options_display.resource_packs", () -> Game.setDisplay(new ResourcePackDisplay())) )); } From 8eec8c2e6f09571f991e6a650f8c037a9dffcfb4 Mon Sep 17 00:00:00 2001 From: Litorom Date: Tue, 16 Apr 2024 14:59:52 -0400 Subject: [PATCH 240/261] Increase despawn timer --- src/client/java/minicraft/entity/furniture/DeathChest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/java/minicraft/entity/furniture/DeathChest.java b/src/client/java/minicraft/entity/furniture/DeathChest.java index d9528da25..6cb218122 100644 --- a/src/client/java/minicraft/entity/furniture/DeathChest.java +++ b/src/client/java/minicraft/entity/furniture/DeathChest.java @@ -35,11 +35,11 @@ public DeathChest() { /// Set the expiration time based on the world difficulty. if (Settings.get("diff").equals("minicraft.settings.difficulty.easy")) { - time = 300 * Updater.normSpeed; + time = 450 * Updater.normSpeed; } else if (Settings.get("diff").equals("minicraft.settings.difficulty.normal")) { - time = 120 * Updater.normSpeed; + time = 300 * Updater.normSpeed; } else if (Settings.get("diff").equals("minicraft.settings.difficulty.hard")) { - time = 30 * Updater.normSpeed; + time = 150 * Updater.normSpeed; } } From 90899b09a9d3fc45c03b753888c68a13df84f2f1 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:52:58 -0400 Subject: [PATCH 241/261] Increment Version to full release (1/2) --- src/client/java/minicraft/core/Game.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index a5d609c3b..eee673575 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0-dev7"); + public static final Version VERSION = new Version("2.2.0"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; From 0b9379844f7a133b8f9fc6899b41d49169598ae8 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:53:30 -0400 Subject: [PATCH 242/261] Increment Version to full release (2/2) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 910e23dd8..3e430917d 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0-dev7" + version = "2.2.0" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' From 90fb69c044980eaaa4d4ecb6c6295641baa320cd Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:55:47 -0400 Subject: [PATCH 243/261] Update ChangeLog.md --- ChangeLog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 2298452c5..1de13b059 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -65,6 +65,8 @@ but some sections are changed to compliant this project. * Updated `assets/books/game_guide.txt` and `assets/books/instructions.txt` * Sand footprints are now more accurately placed * Optimized rendering +* Increased death chest despawn timer as follows: + Easy: 450 secs, Normal: 300 secs, Hard: 150 secs ### Removals From 2726481f0f0c77770dba4a49ef43dcdfe2fa1376 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Sun, 21 Apr 2024 14:45:56 +0800 Subject: [PATCH 244/261] Change Display Menu changing to as "cursor"-mapped --- src/client/java/minicraft/screen/Display.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/java/minicraft/screen/Display.java b/src/client/java/minicraft/screen/Display.java index 88ec10cf0..9e45a0417 100644 --- a/src/client/java/minicraft/screen/Display.java +++ b/src/client/java/minicraft/screen/Display.java @@ -76,9 +76,9 @@ public void tick(InputHandler input) { if (menus.length > 1 && menus[selection].isSelectable()) { // If menu set is unselectable, it must have been intentional, so prevent the user from setting it back. int prevSel = selection; - String shift = menus[selection].getCurEntry() instanceof ArrayEntry ? "shift-" : ""; - if (input.getMappedKey(shift + "left").isClicked() || input.leftTriggerPressed()) selection--; - if (input.getMappedKey(shift + "right").isClicked() || input.rightTriggerPressed()) selection++; + String shift = menus[selection].getCurEntry() instanceof ArrayEntry ? "shift+" : ""; + if (input.getMappedKey(shift + "cursor-left").isClicked() || input.leftTriggerPressed()) selection--; + if (input.getMappedKey(shift + "cursor-right").isClicked() || input.rightTriggerPressed()) selection++; if (prevSel != selection) { Sound.play("select"); From 7c8cfdee7966f2c674b1d6e052168969001a367f Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 23 Apr 2024 03:47:01 +0800 Subject: [PATCH 245/261] Fix unmatching change to the container menus --- src/client/java/minicraft/screen/ContainerDisplay.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 638df9801..9c108984a 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -20,8 +20,8 @@ public class ContainerDisplay extends Display { public ContainerDisplay(Player player, Chest chest) { menus = new Menu[] { - new InventoryMenu(chest, chest.getInventory(), chest.name, RelPos.LEFT, this::update), - new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.RIGHT, this::update) + new InventoryMenu(player, player.getInventory(), "minicraft.display.menus.inventory", RelPos.RIGHT, this::update), + new InventoryMenu(chest, chest.getInventory(), chest.name, RelPos.LEFT, this::update) }; this.player = player; this.chest = chest; From f7c6417022225de8c2460ef81f535dd4099e0693 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:51:12 -0400 Subject: [PATCH 246/261] Update entries to reflect recent version --- ideas/ideas for new additions.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ideas/ideas for new additions.txt b/ideas/ideas for new additions.txt index a9e5284ea..cc8f0ee87 100644 --- a/ideas/ideas for new additions.txt +++ b/ideas/ideas for new additions.txt @@ -5,9 +5,9 @@ New Potions?? [ ] Ragdoll potion: Allows you to control other mobs, but not other players. ++++ Additions -[ ] Add signs. So, when you walk over them, a message is displayed! +[X] Add signs. So, when you walk over them, a message is displayed! [ ] Add maps. Possible crafting recipe: bones and leather. One for each level on the smallest world size, and progressively more maps should be needed otherwise. Should I make the maps lock to "chuck" sort of locations, or always make the center the current location, where possible? It could work by having a mini-map in the upper-left whenever the map is the active item, and there is no menu open. -[ ] Bone meal to make trees grow. Though I might make something else that has the same functionality, instead. +[X] Bone meal to make trees grow. Though I might make something else that has the same functionality, instead. [ ] Tipped/Enchanted Arrows [ ] Fire [ ] Flint N' Steel @@ -17,7 +17,7 @@ Additions [ ] Milk & bad status effects. [ ] Boats; though I don't see them being *too* useful without infinite terrain and vast oceans... ++++ -[ ] add controller support +[X] Add controller support [ ] Make beds colorable [ ] Add world backup option, that user can select a download location. Then maybe... pack to zip? Also, I'll need to make a "restore" feature, and unzip it, so this could get complicated... [X] Custom skins From 06bb7c51e9cf32916362a47c708035476a12d340 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:24:31 +0800 Subject: [PATCH 247/261] Push localizations from Lokalise --- .../resources/assets/localization/de-de.json | 574 ++++++++-------- .../resources/assets/localization/en-gb.json | 548 ++++++++-------- .../resources/assets/localization/en-us.json | 418 ++++++------ .../resources/assets/localization/es-es.json | 570 ++++++++-------- .../resources/assets/localization/fr-fr.json | 551 ++++++++-------- .../resources/assets/localization/hu-hu.json | 616 +++++------------- .../resources/assets/localization/id-id.json | 551 ++++++++-------- .../resources/assets/localization/it-it.json | 551 ++++++++-------- .../resources/assets/localization/nb-no.json | 503 +++++++------- .../resources/assets/localization/nl-nl.json | 505 ++++++-------- .../resources/assets/localization/pl-pl.json | 492 +++----------- .../resources/assets/localization/pt-pt.json | 538 ++++++--------- .../resources/assets/localization/ru-ru.json | 551 ++++++++-------- .../resources/assets/localization/tr-tr.json | 524 +++++++-------- .../resources/assets/localization/uk-ua.json | 548 ++++++++-------- 15 files changed, 3486 insertions(+), 4554 deletions(-) diff --git a/src/client/resources/assets/localization/de-de.json b/src/client/resources/assets/localization/de-de.json index 8fec043ee..21f23fa84 100644 --- a/src/client/resources/assets/localization/de-de.json +++ b/src/client/resources/assets/localization/de-de.json @@ -1,49 +1,208 @@ { - "minicraft.achievement.woodcutter": "Holzfäller", - "minicraft.achievement.woodcutter.desc": "Sammel Holz.", + "Acorn": "Eichel", + "AirWizard Spawner": "Luftmagier-Monsterspawner", + "Antidious": "Gefährlich", + "Anvil": "Amboss", + "Apple": "Apfel", + "Axe": "Axt", + "Baked Potato": "Gebackene Kartoffeln", + "Bed": "Bett", + "Black Clothes": "Schwarze Kleidung", + "Black Wool": "Schwarze Wolle", + "Blue Clothes": "Blaue Kleidung", + "Blue Wool": "Blaue Wolle", + "Bone": "Knochen", + "Book": "Buch", + "Bow": "Bogen", + "Bread": "Brot", + "Cactus": "Kaktus", + "Cactus Sapling": "Kaktussetzling", + "Chest": "Kiste", + "Claymore": "Sprengmiene", + "Cloud": "Wolke", + "Cloud Cactus": "Wolken Kaktus", + "Cloud Ore": "Wolkenerz", + "Coal": "Kohle", + "Cooked Fish": "Gebratener Fisch", + "Cooked Pork": "Gebratenes Schweinerfleisch", + "Cow Spawner": "Kuh-Monsterspawner", + "Creeper Spawner": "Creeper-Monsterspawner", + "Cyan Clothes": "Cyan Kleidung", + "Death Chest": "Todesschatztruhe", + "Dirt": "Erde", + "Empty Bucket": "Leerer Eimer", + "Enchanter": "Verzauberungstisch", + "Energy Potion": "Energietrank", + "Escape Potion": "Fluchttrank", + "Explode": "Explodieren", + "Farmland": "Ackerland", + "Flower": "Blume", + "Furnace": "Ofen", + "Gem": "Edelstein", + "Gem Armor": "Edelsteinrüstung", + "Gem Fishing Rod": "Edelsteinrute", + "Gem Ore": "Edelsteinerz", + "Gold": "Gold", + "Gold Apple": "Goldener Apfel", + "Gold Armor": "Goldrüstung", + "Gold Fishing Rod": "Goldrute", + "Gold Lantern": "Gold-Laterne", + "Gold Ore": "Golderz", + "Grass": "Gras", + "Grass Seeds": "Grasssamen", + "Green Clothes": "Grüne Kleidung", + "Green Wool": "Grüne Wolle", + "GunPowder": "Schießpulver", + "Gunpowder": "Schießpulver", + "Hard Rock": "Hartgestein", + "Haste Potion": "Eiltrank", + "Health Potion": "Gesundheitstrank", + "Hoe": "Feldhacke", + "Hole": "Loch", + "Infinite Fall": "Unendlicher Fall", + "Iron": "Eisen", + "Iron Armor": "Eisenrüstung", + "Iron Fishing Rod": "Steinrute", + "Iron Lantern": "Eisen-Laterne", + "Iron Ore": "Eisenerz", + "Key": "Schlüssel", + "Knight Spawner": "Ritter-Monsterspawner", + "Lantern": "Laterne", + "Lapis": "Lapis", + "Lava": "Lava", + "Lava Brick": "Lavaziegel", + "Lava Bucket": "Lavaeimer", + "Lava Potion": "Lavatrank", + "Leather": "Leder", + "Leather Armor": "Lederrüstung", + "Light Potion": "Lichttrank", + "Loom": "Webstuhl", + "Natural Rock": "Naturgestein", + "None Potion": "Kein Trank", + "Obsidian": "Obsidian", + "Obsidian Brick": "Obsidianziegel", + "Obsidian Door": "Obsidiantür", + "Obsidian Wall": "Obsidianwand", + "Orange Clothes": "Orange Kleidung", + "Ornate Obsidian": "Verzierter Obsidian", + "Ornate Stone": "Verzierter Stein", + "Oven": "Backofen", + "Pickaxe": "Spitzhacke", + "Pig Spawner": "Schweine-Monsterspawner", + "Plank": "Planke", + "Plank Wall": "Bretterwand", + "Player": "Spieler", + "Pork Chop": "Schweinekotelett", + "Potato": "Kartoffel", + "Potion": "Trank", + "Power Glove": "Krafthanschuh", + "Purple Clothes": "Lilane Kleidung", + "Raw Beef": "Rohes Rindfleisch", + "Raw Fish": "Roher Fisch", + "Raw Obsidian": "Roher Obsidian", + "Raw Pork": "Rohes Schweinefleisch", + "Red Clothes": "Rote Kleidung", + "Red Wool": "Rote Wolle", + "Reg Clothes": "Reg Kleidung", + "Regen Potion": "Regenerationstrank", + "Rock": "Stein", + "Rose": "Rose", + "Sand": "Sand", + "Scale": "Schuppe", + "Seeds": "Samen", + "Shard": "Scherbe", + "Shears": "Schere", + "Sheep Spawner": "Schaf-Monsterspawner", + "Shield Potion": "Schildtrank", + "Shovel": "Schaufel", + "Skeleton Spawner": "Skellett-Monsterspawner", + "Slime": "Schleim", + "Slime Spawner": "Schleim-Monsterspawner", + "Snake Armor": "Schlangerüstung", + "Snake Spawner": "Schlangen-Monsterspawner", + "Speed Potion": "Geschwindigkeitstrank", + "Stairs Down": "Treppen runter", + "Stairs Up": "Treppen rauf", + "Steak": "Gebratenens Rindfleisch", + "Stone": "Stein", + "Stone Brick": "Steinziegel", + "Stone Bricks": "Steinziegel", + "Stone Door": "Steintür", + "Stone Wall": "Steinwand", + "Swim Potion": "Schwimmtrank", + "Sword": "Schwert", + "Time Potion": "Zeittrank", + "Tnt": "TNT", + "Torch": "Fackel", + "Totem of Air": "Totem der Luft", + "Tree": "Baum", + "Tree Sapling": "Baumsetzling", + "Water": "Wasser", + "Water Bucket": "Wassereimer", + "Wheat": "Weizen", + "Wheat Seeds": "Weizensamen", + "Wood": "Holz", + "Wood Door": "Holztür", + "Wood Fishing Rod": "Holzrute", + "Wood Planks": "Holzplanken", + "Wood Wall": "Holzwand", + "Wool": "Wolle", + "Workbench": "Werkbank", + "Yellow Clothes": "Gelbe Kleidung", + "Yellow Wool": "Gelbe Wolle", + "Zombie Spawner": "Zombie-Monsterspawner", + "minicraft.achievement.airwizard": "Besiege... die Luft?", + "minicraft.achievement.airwizard.desc": "Besiege den ersten Luftzauberer!", "minicraft.achievement.benchmarking": "Handwerker", "minicraft.achievement.benchmarking.desc": "Baue eine Werkbank.", - "minicraft.achievement.upgrade": "Fortschritt!", - "minicraft.achievement.upgrade.desc": "Baue ein beliebiges Steinwerkzeug.", - "minicraft.achievement.bow": "", "minicraft.achievement.bow.desc": "Schieße einen Pfeil mit einem Bogen ab.", - "minicraft.achievement.fish": "Geh Angeln!", - "minicraft.achievement.fish.desc": "Fische einen Fisch!", - "minicraft.achievement.doors": "Schutz durch die Tür", - "minicraft.achievement.doors.desc": "Baue eine Holztür.", - "minicraft.achievement.planks": "Du bist auf dem Holzweg!", - "minicraft.achievement.planks.desc": "Baue Holzplanken.", "minicraft.achievement.clothes": "Hab einen Farbenfrohen Tag!", "minicraft.achievement.clothes.desc": "Stelle Kleidung in einer Farbe her", "minicraft.achievement.demolition": "Abriss-Vorschau", "minicraft.achievement.demolition.desc": "Benutze TNT.", - "minicraft.achievement.survive_darkness": "Wer hat Angst vor der Dunkelheit?", - "minicraft.achievement.survive_darkness.desc": "Überlebe 5 Minuten in der absoluten Dunkelheit.", - "minicraft.achievement.lava": "Heiße Angelegenheiten", - "minicraft.achievement.lava.desc": "Trinke einen Lava Trank und versuche in Lava zu schwimmen.", + "minicraft.achievement.doors": "Schutz durch die Tür", + "minicraft.achievement.doors.desc": "Baue eine Holztür.", "minicraft.achievement.find_gem": "Sehr glänzend!", "minicraft.achievement.find_gem.desc": "Finde Edelsteinerz und baue es ab.", + "minicraft.achievement.fish": "Geh Angeln!", + "minicraft.achievement.fish.desc": "Fische einen Fisch!", + "minicraft.achievement.lava": "Heiße Angelegenheiten", + "minicraft.achievement.lava.desc": "Trinke einen Lava Trank und versuche in Lava zu schwimmen.", "minicraft.achievement.lowest_caves": "Dunkelheit hinter dem Licht", "minicraft.achievement.lowest_caves.desc": "Erreiche die untersten Höhlen.", "minicraft.achievement.obsidian_dungeon": "Von Rittern und Männern", "minicraft.achievement.obsidian_dungeon.desc": "Erreiche den Obsidian-Dungeon.", - "minicraft.achievement.airwizard": "Besiege... die Luft?", - "minicraft.achievement.airwizard.desc": "Besiege den ersten Luftzauberer!", + "minicraft.achievement.planks": "Du bist auf dem Holzweg!", + "minicraft.achievement.planks.desc": "Baue Holzplanken.", + "minicraft.achievement.plant_seed": "Ein zwielichtiger Ort", + "minicraft.achievement.plant_seed.desc": "Pflanze einen Samen und schaue zu wie er wächst", "minicraft.achievement.skin": "Modenschau", "minicraft.achievement.skin.desc": "Verändere dein Aussehen.", + "minicraft.achievement.survive_darkness": "Wer hat Angst vor der Dunkelheit?", + "minicraft.achievement.survive_darkness.desc": "Überlebe 5 Minuten in der absoluten Dunkelheit.", + "minicraft.achievement.upgrade": "Fortschritt!", + "minicraft.achievement.upgrade.desc": "Baue ein beliebiges Steinwerkzeug.", + "minicraft.achievement.woodcutter": "Holzfäller", + "minicraft.achievement.woodcutter.desc": "Sammle Holz.", + "minicraft.control_guide.attack": "Benutze %s, um Mobs anzugreifen oder Kacheln zu zerstören.", + "minicraft.control_guide.craft": "Benutze %s, um dein Handwerksmenü zu öffnen.", + "minicraft.control_guide.menu": "Verwenden Sie %s, um Ihr Inventarmenü zu öffnen.", + "minicraft.control_guide.move": "Verwende%sum dich zu bewegen.", "minicraft.display.entries.boolean.false": "Aus", "minicraft.display.entries.boolean.true": "An", "minicraft.display.gui.link_opening": "Im Browser öffnen", "minicraft.display.gui.perm_status.saving": "Speichern... %s%%", "minicraft.display.gui.perm_status.sleep_cancel": "Drücke %s zum Abbrechen", "minicraft.display.gui.perm_status.sleeping": "Schlafen...", - "minicraft.display.gui.potion_effects.hide_hint": "(%s zum verstecken!)", - "minicraft.display.gui.potion_effects.potion_dur": "", + "minicraft.display.gui.potion_effects.hide_hint": "(%s zum Verstecken!)", + "minicraft.display.gui.potion_effects.potion_dur": "%s(%d:%02d)", "minicraft.display.gui.score.current_score": "Aktuelle Punktzahl: %s", "minicraft.display.gui.score.time_left": "Zeit übrig %s%sm %ss", "minicraft.display.menus.inventory": "Inventar", "minicraft.display.options_display": "Einstellungen", - "minicraft.display.options_display.change_key_bindings": "Tastenbelegung", + "minicraft.display.options_display.change_key_bindings": "Tastenbelegung ändern", + "minicraft.display.options_display.language": "Sprache", + "minicraft.display.options_display.resource_packs": "Ressourcenpakete", "minicraft.display.popup.enter_confirm": "Eingabe zum bestätigen", "minicraft.display.popup.escape_cancel": "Esc zum abbrechen", "minicraft.display.popup.title_confirm": "Bestätigen", @@ -53,6 +212,26 @@ "minicraft.displays.achievements.display.not_achieved": "Nicht erreicht", "minicraft.displays.achievements.display.score": "Errungenschaftspunkte: %s", "minicraft.displays.book.default_book": "Dieses Buch hat keinen Inhalt.", + "minicraft.displays.controls": "Steuerung", + "minicraft.displays.controls.display.controller": "Controller", + "minicraft.displays.controls.display.controller.00": "Bewegen des Spielers erfolgt durch das DPAD", + "minicraft.displays.controls.display.controller.01": "Bewegen des Cursors durch das DPAD", + "minicraft.displays.controls.display.controller.02": "Die Auswahl der Einträge erfolgt mit A", + "minicraft.displays.controls.display.controller.03": "Das Verlassen der Seiten erfolgt mit B", + "minicraft.displays.controls.display.controller.04": "Angreifen, Zerstören und Interagieren mit Kacheln erfolgt mit A", + "minicraft.displays.controls.display.controller.05": "Das Öffnen von Menüs im Spiel erfolgt mit X", + "minicraft.displays.controls.display.controller.06": "Das Öffnen von Handwerk-Menüs erfolgt mit Y", + "minicraft.displays.controls.display.controller.07": "Das Aufheben von Möbel erfolgt mit der linken Schultertaste", + "minicraft.displays.controls.display.controller.08": "Das Fallenlassen von Gegenständen erfolgt mit der rechten Schultertaste", + "minicraft.displays.controls.display.controller.09": "Das Fallenlassen eines ganzen Stapels erfolgt mit dem rechten Stick", + "minicraft.displays.controls.display.controller.10": "Das Umschalten der Suchleiste im Inventar verwendet START", + "minicraft.displays.controls.display.controller.11": "Das Pausieren des Spiels erfolgt mit START", + "minicraft.displays.controls.display.controller.desc.0": "Auf Debug-Zuordnungen kann nicht zugegriffen werden", + "minicraft.displays.controls.display.controller.desc.1": "Detaillierte Zuordnungen sind unbrauchbar", + "minicraft.displays.controls.display.help.0": "%s/%s um weitere Steuerelemente zu sehen", + "minicraft.displays.controls.display.keyboard": "Tastatur", + "minicraft.displays.controls.display.keyboard.03": "Das Verlassen von Seiten erfolgt mit EXIT", + "minicraft.displays.controls.display.keyboard.04": "Zum schnellen Speichern wird QUICKSAVE verwendet", "minicraft.displays.crafting": "Bauen", "minicraft.displays.crafting.container_title.cost": "Kosten:", "minicraft.displays.crafting.container_title.have": "Du hast:", @@ -66,27 +245,36 @@ "minicraft.displays.info.display.time": "Zeit gespielt: %s Sekunden", "minicraft.displays.info.title": "Spieler Status", "minicraft.displays.key_input.display.help.0": "Drücke C/Eingabe um die Tastenbelegung zu ändern", - "minicraft.displays.key_input.display.help.1": "Drücke A um eine Tastenbelegung hinzuzufügen", + "minicraft.displays.key_input.display.help.1": "Drücke A, um eine Tastenbelegung hinzuzufügen", "minicraft.displays.key_input.display.help.2": "Shift-D setzt alle Tastenbelegungen auf den Standard", "minicraft.displays.key_input.display.help.3": "%s um zum Menü zurückzukommen", - "minicraft.displays.key_input.popup_display.confirm_reset": "Bist du sicher das du alle Tastenbelegungen auf Werkseinstellungen zurücksetzen willst?", + "minicraft.displays.key_input.popup_display.confirm_reset": "Bist du sicher, dass du alle Tastenbelegungen auf Werkseinstellungen zurücksetzen willst?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Drücke die gewünschte Tastenkombination", "minicraft.displays.key_input.title": "Steuerung", + "minicraft.displays.language_settings.title": "Sprache …", + "minicraft.displays.loading.message.dungeon_regeneration": "Regenerierung von B4", "minicraft.displays.loading.message.entities": "Entitäten", "minicraft.displays.loading.message.generating": "Generierung", "minicraft.displays.loading.message.level": "Level %s", "minicraft.displays.loading.message.levels": "Level", "minicraft.displays.loading.message.loading": "Laden", + "minicraft.displays.loading.message.quests": "Quests", "minicraft.displays.loading.message.saving": "Speichern", "minicraft.displays.loading.message.world": "Welt", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Laden der Welt wurde abgebrochen", + "minicraft.displays.loading.regeneration_popup.display.0": "Der Dungeon der alten Version (B4-Etage) wurde erkannt.", + "minicraft.displays.loading.regeneration_popup.display.1": "Regeneration ist notwendig", + "minicraft.displays.loading.regeneration_popup.display.2": "Die alten Daten auf dieser Etage werden gelöscht:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s zum Fortfahren", + "minicraft.displays.loading.regeneration_popup.display.4": "%s um das Laden der Welt abzubrechen", "minicraft.displays.options_main_menu": "Hautpmenü-Optionen", "minicraft.displays.options_main_menu.resource_packs": "Ressourcen-Pakete", "minicraft.displays.options_world": "Weltoptionen", - "minicraft.displays.options_world.off_tutorials_confirm_popup": "Bist du dir sicher das du die Tutorials für immer deaktivieren möchtests?", + "minicraft.displays.options_world.off_tutorials_confirm_popup": "Bist du dir sicher das du die Tutorials für immer deaktivieren möchtest?", "minicraft.displays.options_world.turn_off_tutorials": "Tutorials deaktivieren", "minicraft.displays.pause": "Pausiert", - "minicraft.displays.pause.display.exit_popup.0": "Bist du sicher das du das Spiel verlassen möchtest?", - "minicraft.displays.pause.display.exit_popup.1": "Dein ungespeicherter Vortschritt wird verloren gehen", + "minicraft.displays.pause.display.exit_popup.0": "Bist du sicher, dass du das Spiel verlassen möchtest?", + "minicraft.displays.pause.display.exit_popup.1": "Dein ungesicherter Fortschritt wird verloren gehen", "minicraft.displays.pause.display.exit_popup.cancel": "Abbrechen", "minicraft.displays.pause.display.exit_popup.quit": "Verlassen ohne zu speichern", "minicraft.displays.pause.display.help.choose": "%s: Wähle", @@ -101,20 +289,22 @@ "minicraft.displays.player_death.save_quit": "Speichern und verlassen", "minicraft.displays.player_death.title": "Du bist gestorben! Aww!", "minicraft.displays.player_inv.container_title.items": "Gegenstände", - "minicraft.displays.player_inv.display.help": "(%s) zum suchen.", + "minicraft.displays.player_inv.display.help": "(%s) zum Suchen.", "minicraft.displays.quests": "Aufgaben", "minicraft.displays.quests.display.header.completed": "Erfüllt", "minicraft.displays.quests.display.header.unlocked": "Freigeschaltet", + "minicraft.displays.quests.display.no_quest": "Keine Quest freigeschaltet", "minicraft.displays.quests.display.no_quest_desc": "Keine Aufgaben", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Es werden nur Tastatureingaben akzeptiert.", "minicraft.displays.resource_packs.display.help.move": "Benutze %s und %s um dich zu bewegen.", - "minicraft.displays.resource_packs.display.help.select": "%s zum prüfen.", "minicraft.displays.resource_packs.display.help.position": "UMSCHALT-[LINKS|RECHTS|OBEN|UNTEN], um Pakete zu verschieben.␣", + "minicraft.displays.resource_packs.display.help.select": "%s zum Prüfen.", "minicraft.displays.resource_packs.display.title": "Ressourcen-Pakete", "minicraft.displays.skin": "Skins", "minicraft.displays.skin.display.help.move": "Benutze %s und %s um dich zu bewegen.", "minicraft.displays.skin.display.help.select": "%s zum Auswählen und %s zum Abbrechen.", "minicraft.displays.title.display.cannot_check": "Es konnte nicht nach Updates gesucht werden.", - "minicraft.displays.title.display.checking": "Suche nach Updates...", + "minicraft.displays.title.display.checking": "Suche nach Updates …", "minicraft.displays.title.display.help.0": "(%s, %s zur Auswahl)", "minicraft.displays.title.display.help.1": "(%s to accept)", "minicraft.displays.title.display.help.2": "(%s um zurückzukehren)", @@ -132,6 +322,7 @@ "minicraft.displays.title.play.new_world": "Neue Welt", "minicraft.displays.title.quit": "Verlassen", "minicraft.displays.title.select_to_download": "--Hier zum Herunterladen auswählen--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Drücken Sie %s, um die Details des aktuellen Tutorials zu prüfen.", "minicraft.displays.world_gen.create_world": "Welt erschaffen", "minicraft.displays.world_gen.enter_world": "Gib einen Weltnamen ein", "minicraft.displays.world_gen.title": "Welt generierungsoptionen", @@ -141,7 +332,7 @@ "minicraft.displays.world_select.display.help.0": "%s zum bestätigen", "minicraft.displays.world_select.display.help.1": "%s um zurückzukehren", "minicraft.displays.world_select.display.help.2": "SHIFT-C zum kopieren", - "minicraft.displays.world_select.display.help.3": "SHIFT-R zum umbenennen", + "minicraft.displays.world_select.display.help.3": "%s zum Umbenennen", "minicraft.displays.world_select.display.help.4": "SHIFT-D zum löschen", "minicraft.displays.world_select.display.world_too_new": "Neuere version, laden der Welt nicht möglich!", "minicraft.displays.world_select.display.world_version": "Welt version: %s", @@ -152,322 +343,67 @@ "minicraft.displays.world_select.select_world": "Welt auswählen", "minicraft.notification.achievement_unlocked": "Errungenschaft freigeschaltet: %s", "minicraft.notification.air_wizard_defeated": "Luftzauberer besiegt!", - "minicraft.notification.cannot_sleep": "Kann nicht schlafen! %smin %s sek übrig!", + "minicraft.notification.boss_limit": "Es können keine Bosse mehr gespawnt werden", + "minicraft.notification.cannot_sleep": "Kann nicht schlafen! %smin %s s übrig!", "minicraft.notification.death_chest_retrieved": "Todestruhe wiedergefunden!", "minicraft.notification.defeat_air_wizard_first": "Der Luftzauberer muss zuerst besiegt werden.", "minicraft.notification.dig_hole": "Erst ein Loch graben!", "minicraft.notification.dungeon_opened": "Der Dungeon ist jetzt geöffnet!", "minicraft.notification.gem_pickaxe_required": "Edelstein-Spitzhacke erforderlich.", "minicraft.notification.invalid_placement": "Kann nur auf %s platziert werden!", + "minicraft.notification.knight_statue_exists": "Eine Ritterstatue existiert", + "minicraft.notification.obsidian_knight_awoken": "Der Obsidian-Ritter ist erwacht!", + "minicraft.notification.obsidian_knight_defeated": "Obsidianritter: wurde Besiegt!", "minicraft.notification.quest_completed": "Aufgabe abgeschlossen", "minicraft.notification.quest_unlocked": "Aufgabe freigeschaltet", + "minicraft.notification.spawn_on_boss_tile": "Kann nur im Bossraum gespawnt werden", "minicraft.notification.world_saved": "Welt gespeichert!", + "minicraft.notification.wrong_level_dungeon": "Kann nur auf der Dungeonebene gespawnt werden", "minicraft.notification.wrong_level_sky": "Kann nur in der Himmelsebene beschworen werden", - "minicraft.settings.fps": "Maximale FPS", + "minicraft.notifications.statue_tapped": "Du hörst widerhallendes Geflüster...", + "minicraft.quest.farming": "arbeitender Landwirt", + "minicraft.quest.farming.crafting_hoe": "Eine Hacke craften", + "minicraft.quest.farming.getting_wheat": "Ein Weizen anbauen", + "minicraft.quest.farming.making_farmland": "Ein Ackerland schaffen", + "minicraft.quest.farming.planting_potato": "Eine Kartoffel pflanzen", + "minicraft.quest.farming.planting_wheat": "Ein Weizenkorn pflanzen", + "minicraft.quest.gems": "Straße aus Gems", + "minicraft.quest.gems.gem_armor": "Meister des Schutzes", + "minicraft.quest.iron_equipments.getting_more_iron": "Reich an Eisen", + "minicraft.quest.iron_equipments.iron_tools": "Alle Tools upgraden", + "minicraft.quest.potions.powerful_potions": "Mächtige Tränke", + "minicraft.settings.autosave": "Automatisches Speichern", "minicraft.settings.difficulty": "Schwierigkeit", "minicraft.settings.difficulty.easy": "Einfach", - "minicraft.settings.difficulty.normal": "Normal", "minicraft.settings.difficulty.hard": "Schwer", - "minicraft.settings.mode": "Gamemode", - "minicraft.settings.mode.survival": "Überlebensmodus", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "Maximale FPS", + "minicraft.settings.mode": "Spielmodus", "minicraft.settings.mode.creative": "Kreativmodus", "minicraft.settings.mode.hardcore": "Hardcoremodus", "minicraft.settings.mode.score": "Punktzahl", + "minicraft.settings.mode.survival": "Überlebensmodus", "minicraft.settings.scoretime": "Zeit (Punktzahlmodus)", "minicraft.settings.screenshot_scale": "Schnappschuss-Auflösung", - "minicraft.settings.sound": "Soundeinstellungen", - "minicraft.settings.autosave": "Automtisches Speichern", "minicraft.settings.size": "Weltgröße", + "minicraft.settings.sound": "Soundeinstellungen", "minicraft.settings.theme": "Thema der Welt", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Wald", "minicraft.settings.theme.desert": "Wüste", - "minicraft.settings.theme.plain": "Grasland", + "minicraft.settings.theme.forest": "Wald", "minicraft.settings.theme.hell": "Hölle", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Grasland", "minicraft.settings.type": "Oberflächen-Typ", - "minicraft.settings.type.island": "Insel", "minicraft.settings.type.box": "Box", - "minicraft.settings.type.mountain": "Berg", "minicraft.settings.type.irregular": "Uneben", + "minicraft.settings.type.island": "Insel", + "minicraft.settings.type.mountain": "Berg", + "minicraft.skin.minecraft_alex": "Bekanntes Mädchen", + "minicraft.skin.minecraft_steve": "Bekannte Junge", "minicraft.skin.paul": "Paul", "minicraft.skin.paul_cape": "Paul mit Umhang", - "minicraft.skin.minecraft_steve": "Bekannte Junge", - "minicraft.skin.minecraft_alex": "Bekanntes Mädchen", "minicraft.text_particales.key_consumed": "-1 Schlüssel", - "Death Chest": "Todesschatztruhe", - "Player": "Spieler", - "Leather Armor": "Lederrüstung", - "Snake Armor": "Schlangerüstung", - "Iron Armor": "Eisenrüstung", - "Gold Armor": "Goldrüstung", - "Gem Armor": "Edelsteinrüstung", - "Book": "Buch", - "Antidious": "Gefährlich", - "Empty Bucket": "Leerer Eimer", - "Water Bucket": "Wassereimer", - "Lava Bucket": "Lavaeimer", - "Red Clothes": "Rote Kleidung", - "Blue Clothes": "Blaue Kleidung", - "Green Clothes": "Grüne Kleidung", - "Yellow Clothes": "Gelbe Kleidung", - "Black Clothes": "Schwarze Kleidung", - "Orange Clothes": "Orange Kleidung", - "Purple Clothes": "Lilane Kleidung", - "Cyan Clothes": "Cyan Kleidung", - "Reg Clothes": "Reg Kleidung", - "Bread": "Brot", - "Apple": "Apfel", - "Raw Pork": "Rohes Schweinefleisch", - "Raw Fish": "Roher Fisch", - "Raw Beef": "Rohes Rindfleisch", - "Pork Chop": "Schweinekotelett", - "Cooked Fish": "Gebratener Fisch", - "Cooked Pork": "Gebratenes Schweinerfleisch", - "Steak": "Gebratenens Rindfleisch", - "Gold Apple": "Goldener Apfel", - "Baked Potato": "Gebackene Kartoffeln", - "Cow Spawner": "Kuh-Monsterspawner", - "Pig Spawner": "Schweine-Monsterspawner", - "Sheep Spawner": "Schaf-Monsterspawner", - "Slime Spawner": "Schleim-Monsterspawner", - "Zombie Spawner": "Zombie-Monsterspawner", - "Creeper Spawner": "Creeper-Monsterspawner", - "Skeleton Spawner": "Skellett-Monsterspawner", - "Snake Spawner": "Schlangen-Monsterspawner", - "Knight Spawner": "Ritter-Monsterspawner", - "AirWizard Spawner": "Luftmagier-Monsterspawner", - "Workbench": "Werkbank", - "Oven": "Backofen", - "Furnace": "Ofen", - "Anvil": "Amboss", - "Enchanter": "Verzauberungstisch", - "Loom": "Webstuhl", - "Lantern": "Laterne", - "Iron Lantern": "Eisen-Laterne", - "Gold Lantern": "Gold-Laterne", - "Tnt": "TNT", - "Bed": "Bett", - "Chest": "Kiste", - "None Potion": "Kein Trank", - "Speed Potion": "Geschwindigkeitstrank", - "Light Potion": "Lichttrank", - "Swim Potion": "Schwimmtrank", - "Energy Potion": "Energietrank", - "Regen Potion": "Regenerationstrank", - "Health Potion": "Gesundheitstrank", - "Time Potion": "Zeittrank", - "Lava Potion": "Lavatrank", - "Shield Potion": "Schildtrank", - "Haste Potion": "Eiltrank", - "Escape Potion": "Fluchttrank", - "Potion": "Trank", - "Power Glove": "Krafthanschuh", - "Wood": "Holz", - "Stone": "Stein", - "Leather": "Leder", - "Wheat": "Weizen", - "Key": "Schlüssel", - "Coal": "Kohle", - "Iron Ore": "Eisenerz", - "Gold Ore": "Golderz", - "Gem Ore": "Edelsteinerz", - "Cloud Ore": "Wolkenerz", - "Iron": "Eisen", - "Gold": "Gold", - "Lapis": "Lapis", - "Rose": "Rose", - "GunPowder": "Schießpulver", - "Slime": "Schleim", - "Scale": "Schuppe", - "Shard": "Scherbe", - "Flower": "Blume", - "Acorn": "Eichel", - "Dirt": "Erde", - "Natural Rock": "Naturgestein", - "Plank": "Planke", - "Plank Wall": "Bretterwand", - "Wood Door": "Holztür", - "Stone Brick": "Steinziegel", - "Ornate Stone": "Verzierter Stein", - "Stone Wall": "Steinwand", - "Stone Door": "Steintür", - "Obsidian Brick": "Obsidianziegel", - "Ornate Obsidian": "Verzierter Obsidian", - "Obsidian Wall": "Obsidianwand", - "Obsidian Door": "Obsidiantür", - "Wool": "Wolle", - "Red Wool": "Rote Wolle", - "Blue Wool": "Blaue Wolle", - "Green Wool": "Grüne Wolle", - "Yellow Wool": "Gelbe Wolle", - "Black Wool": "Schwarze Wolle", - "Sand": "Sand", - "Cactus": "Kaktus", - "Seeds": "Samen", - "Wheat Seeds": "Weizensamen", - "Grass Seeds": "Grasssamen", - "Bone": "Knochen", - "Cloud": "Wolke", - "Rock": "Stein", - "Gem": "Edelstein", - "Potato": "Kartoffel", - "Wood Fishing Rod": "Holzrute", - "Iron Fishing Rod": "Steinrute", - "Gold Fishing Rod": "Goldrute", - "Gem Fishing Rod": "Edelsteinrute", - "Shovel": "Schaufel", - "Hoe": "Feldhacke", - "Sword": "Schwert", - "Pickaxe": "Spitzhacke", - "Axe": "Axt", - "Bow": "Bogen", - "Claymore": "Sprengmiene", - "Shears": "Schere", - "Torch": "Fackel", - "Wood Planks": "Holzplanken", - "Stone Bricks": "Steinziegel", - "Obsidian": "Obsidian", - "Wood Wall": "Holzwand", - "Grass": "Gras", - "Hole": "Loch", - "Stairs Up": "Treppen rauf", - "Stairs Down": "Treppen runter", - "Water": "Wasser", - "Tree": "Baum", - "Tree Sapling": "Baumsetzling", - "Cactus Sapling": "Kaktussetzling", - "Lava": "Lava", - "Lava Brick": "Lavaziegel", - "Explode": "Explodieren", - "Farmland": "Ackerland", - "Hard Rock": "Hartgestein", - "Infinite Fall": "Unendlicher Fall", - "Cloud Cactus": "Wolken Kaktus", - "Raw Obsidian": "Roher Obsidian", - "Totem of Air": "Totem der Luft", - "minicraft.control_guide.attack": "Benutze %s, um Mobs anzugreifen oder Kacheln zu zerstören.", - "minicraft.control_guide.craft": "Benutze %s, um dein Handwerksmenü zu öffnen.", - "minicraft.control_guide.menu": "Verwenden Sie %s, um Ihr Inventarmenü zu öffnen.", - "minicraft.control_guide.move": "Verwende %s um dich zu bewegen.", - "minicraft.displays.controls": "Steuerung", - "minicraft.displays.controls.display.controller": "Controller", - "minicraft.displays.controls.display.controller.00": "Bewegen des Spielers durch das DPAD", - "minicraft.displays.controls.display.controller.01": "Bewegen des Cursors durch das DPAD", - "minicraft.displays.controls.display.controller.02": "Die Auswahl der Einträge erfolgt mit A", - "minicraft.displays.controls.display.controller.03": "Das Verlassen der Seiten erfolgt mit B", - "minicraft.displays.controls.display.controller.04": "Angreifen, Zerstören und Interagieren mit Kacheln erfolgt mit A", - "minicraft.displays.controls.display.controller.05": "Das Öffnen von Menüs im Spiel erfolgt mit X", - "minicraft.displays.controls.display.controller.06": "Das Öffnen von Handwerk-Menüs erfolgt mit Y", - "minicraft.displays.controls.display.controller.07": "Das aufheben von Möbel erfolgt mit der linken Schultertaste", - "minicraft.displays.controls.display.controller.08": "Das fallenlassen von Gegenständen erfolgt mit der rechten Schultertaste", - "minicraft.displays.controls.display.controller.09": "Das fallenlassen eines ganzen Stapels erfolgt mit dem rechten Stick", - "minicraft.displays.controls.display.controller.10": "", - "minicraft.displays.controls.display.controller.11": "", - "minicraft.displays.controls.display.controller.12": "", - "minicraft.displays.controls.display.controller.13": "", - "minicraft.displays.controls.display.controller.14": "", - "minicraft.displays.controls.display.controller.15": "", - "minicraft.displays.controls.display.controller.desc.0": "", - "minicraft.displays.controls.display.controller.desc.1": "", - "minicraft.displays.controls.display.help.0": "", - "minicraft.displays.controls.display.keyboard": "", - "minicraft.displays.controls.display.keyboard.00": "", - "minicraft.displays.controls.display.keyboard.01": "", - "minicraft.displays.controls.display.keyboard.02": "", - "minicraft.displays.controls.display.keyboard.03": "", - "minicraft.displays.controls.display.keyboard.04": "", - "minicraft.displays.controls.display.keyboard.05": "", - "minicraft.displays.controls.display.keyboard.06": "", - "minicraft.displays.controls.display.keyboard.07": "", - "minicraft.displays.controls.display.keyboard.08": "", - "minicraft.displays.controls.display.keyboard.09": "", - "minicraft.displays.controls.display.keyboard.10": "", - "minicraft.displays.controls.display.keyboard.11": "", - "minicraft.displays.controls.display.keyboard.12": "", - "minicraft.displays.controls.display.keyboard.13": "", - "minicraft.displays.controls.display.keyboard.14": "", - "minicraft.displays.controls.display.keyboard.15": "", - "minicraft.displays.controls.display.keyboard.16": "", - "minicraft.displays.controls.display.keyboard.17": "", - "minicraft.displays.controls.display.keyboard.18": "", - "minicraft.displays.controls.display.keyboard.19": "", - "minicraft.displays.controls.display.keyboard.20": "", - "minicraft.displays.controls.display.keyboard.21": "", - "minicraft.displays.controls.display.keyboard.22": "", - "minicraft.displays.controls.display.keyboard.desc": "", - "minicraft.displays.loading.message.dungeon_regeneration": "", - "minicraft.displays.loading.message.quests": "", - "minicraft.displays.loading.regeneration_popup.display.0": "", - "minicraft.displays.loading.regeneration_popup.display.1": "", - "minicraft.displays.loading.regeneration_popup.display.2": "", - "minicraft.displays.loading.regeneration_popup.display.3": "", - "minicraft.displays.loading.regeneration_popup.display.4": "", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "", - "minicraft.displays.quests.display.no_quest": "", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", - "minicraft.notification.obsidian_knight_defeated": "", - "minicraft.notification.obsidian_knight_awoken": "", - "minicraft.notification.defeat_obsidian_knight_first": "", - "minicraft.notification.wrong_level_dungeon": "", - "minicraft.notification.boss_limit": "", - "minicraft.notification.spawn_on_boss_tile": "", - "minicraft.notifications.statue_tapped": "", - "minicraft.notifications.statue_touched": "", - "minicraft.quest.farming": "", - "minicraft.quest.farming.crafting_hoe": "", - "minicraft.quest.farming.crafting_hoe.description": "", - "minicraft.quest.farming.description": "", - "minicraft.quest.farming.getting_wheat": "", - "minicraft.quest.farming.getting_wheat.description": "", - "minicraft.quest.farming.making_farmland": "", - "minicraft.quest.farming.making_farmland.description": "", - "minicraft.quest.farming.planting_potato": "", - "minicraft.quest.farming.planting_potato.description": "", - "minicraft.quest.farming.planting_wheat": "", - "minicraft.quest.farming.planting_wheat.description": "", - "minicraft.quest.gems": "", - "minicraft.quest.gems.description": "", - "minicraft.quest.gems.gem_armor": "", - "minicraft.quest.gems.gem_armor.description": "", - "minicraft.quest.gems.gem_claymore": "", - "minicraft.quest.gems.gem_claymore.description": "", - "minicraft.quest.iron_equipments": "", - "minicraft.quest.iron_equipments.description": "", - "minicraft.quest.iron_equipments.getting_more_iron": "", - "minicraft.quest.iron_equipments.getting_more_iron.description": "", - "minicraft.quest.iron_equipments.iron_armor": "", - "minicraft.quest.iron_equipments.iron_armor.description": "", - "minicraft.quest.iron_equipments.iron_tools": "", - "minicraft.quest.iron_equipments.iron_tools.description": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", - "minicraft.quest.potions": "", - "minicraft.quest.potions.all_potions_prepared": "", - "minicraft.quest.potions.all_potions_prepared.description": "", - "minicraft.quest.potions.awkward_potions": "", - "minicraft.quest.potions.awkward_potions.description": "", - "minicraft.quest.potions.description": "", - "minicraft.quest.potions.powerful_potions": "", - "minicraft.quest.potions.powerful_potions.description": "", - "minicraft.tutorial.getting_rocks": "", - "minicraft.tutorial.getting_rocks.description": "", - "minicraft.tutorial.getting_wood": "", - "minicraft.tutorial.getting_wood.description": "", - "minicraft.tutorial.getting_wooden_pickaxe": "", - "minicraft.tutorial.getting_wooden_pickaxe.description": "", - "minicraft.tutorial.getting_workbench": "", - "minicraft.tutorial.getting_workbench.description": "", - "minicraft.tutorial.start_getting_wood": "", - "minicraft.tutorial.start_getting_wood.description": "", - "minicraft.display.options_display.language": "", - "minicraft.display.options_display.resource_packs": "", - "minicraft.displays.language_settings.title": "", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "", - "String": "", - "Glass": "", - "Cloth": "" + "minicraft.tutorial.getting_wood": "Mehr Holz bekommen", + "minicraft.tutorial.getting_wooden_pickaxe": "Eine Holzspitzhacke bekommen", + "minicraft.tutorial.getting_workbench": "Eine Werkbank bekommen" } diff --git a/src/client/resources/assets/localization/en-gb.json b/src/client/resources/assets/localization/en-gb.json index 67c15c9ed..a4e908aa6 100644 --- a/src/client/resources/assets/localization/en-gb.json +++ b/src/client/resources/assets/localization/en-gb.json @@ -1,36 +1,192 @@ { - "minicraft.achievement.woodcutter": "Woodcutter", - "minicraft.achievement.woodcutter.desc": "Get wood.", + "Acorn": "Acorn", + "AirWizard Spawner": "AirWizard Spawner", + "Antidious": "Antidious", + "Anvil": "Anvil", + "Apple": "Apple", + "Axe": "Axe", + "Baked Potato": "Baked Potato", + "Bed": "Bed", + "Black Clothes": "Black Clothes", + "Black Wool": "Black Wool", + "Blue Clothes": "Blue Clothes", + "Blue Wool": "Blue Wool", + "Bone": "Bone", + "Book": "Book", + "Bow": "Bow", + "Bread": "Bread", + "Cactus": "Cactus", + "Cactus Sapling": "Cactus Sapling", + "Chest": "Chest", + "Claymore": "Claymore", + "Cloud": "Cloud", + "Cloud Cactus": "Cloud Cactus", + "Cloud Ore": "Cloud Ore", + "Coal": "Coal", + "Cooked Fish": "Cooked Fish", + "Cooked Pork": "Cooked Pork", + "Cow Spawner": "Cow Spawner", + "Creeper Spawner": "Creeper Spawner", + "Cyan Clothes": "Cyan Clothes", + "Death Chest": "Death Chest", + "Dirt": "Dirt", + "Empty Bucket": "Empty Bucket", + "Enchanter": "Enchanter", + "Energy Potion": "Energy Potion", + "Escape Potion": "Escape Potion", + "Explode": "Explode", + "Farmland": "Farmland", + "Flower": "Flower", + "Furnace": "Furnace", + "Gem": "Gem", + "Gem Armor": "Gem Armor", + "Gem Fishing Rod": "Gem Fishing Rod", + "Gem Ore": "Gem Ore", + "Gold": "Gold", + "Gold Apple": "Gold Apple", + "Gold Armor": "Gold Armor", + "Gold Fishing Rod": "Gold Fishing Rod", + "Gold Lantern": "Gold Lantern", + "Gold Ore": "Gold Ore", + "Grass": "Grass", + "Grass Seeds": "Grass Seeds", + "Green Clothes": "Green Clothes", + "Green Wool": "Green Wool", + "GunPowder": "Gunpowder", + "Gunpowder": "Gunpowder", + "Hard Rock": "Hard Rock", + "Haste Potion": "Haste Potion", + "Health Potion": "Health Potion", + "Hoe": "Hoe", + "Hole": "Hole", + "Infinite Fall": "Infinite Fall", + "Iron": "Iron", + "Iron Armor": "Iron Armor", + "Iron Fishing Rod": "Iron Fishing Rod", + "Iron Lantern": "Iron Lantern", + "Iron Ore": "Iron Ore", + "Key": "Key", + "Knight Spawner": "Knight Spawner", + "Lantern": "Lantern", + "Lapis": "Lapis", + "Lava": "Lava", + "Lava Brick": "Lava Brick", + "Lava Bucket": "Lava Bucket", + "Lava Potion": "Lava Potion", + "Leather": "Leather", + "Leather Armor": "Leather Armor", + "Light Potion": "Light Potion", + "Loom": "Loom", + "Natural Rock": "Natural Rock", + "None Potion": "None Potion", + "Obsidian": "Obsidian", + "Obsidian Brick": "Obsidian Brick", + "Obsidian Door": "Obsidian Door", + "Obsidian Wall": "Obsidian Wall", + "Orange Clothes": "Orange Clothes", + "Ornate Obsidian": "Ornate Obsidian", + "Ornate Stone": "Ornate Stone", + "Oven": "Oven", + "Pickaxe": "Pickaxe", + "Pig Spawner": "Pig Spawner", + "Plank": "Plank", + "Plank Wall": "Plank Wall", + "Player": "Player", + "Pork Chop": "Pork Chop", + "Potato": "Potato", + "Potion": "Potion", + "Power Glove": "Power Glove", + "Purple Clothes": "Purple Clothes", + "Raw Beef": "Raw Beef", + "Raw Fish": "Raw Fish", + "Raw Obsidian": "Raw Obsidian", + "Raw Pork": "Raw Pork", + "Red Clothes": "Red Clothes", + "Red Wool": "Red Wool", + "Reg Clothes": "Reg Clothes", + "Regen Potion": "Regen Potion", + "Rock": "Rock", + "Rose": "Rose", + "Sand": "Sand", + "Scale": "Scale", + "Seeds": "Seeds", + "Shard": "Shard", + "Shears": "Shears", + "Sheep Spawner": "Sheep Spawner", + "Shield Potion": "Shield Potion", + "Shovel": "Shovel", + "Skeleton Spawner": "Skeleton Spawner", + "Slime": "Slime", + "Slime Spawner": "Slime Spawner", + "Snake Armor": "Snake Armor", + "Snake Spawner": "Snake Spawner", + "Speed Potion": "Speed Potion", + "Stairs Down": "Stairs Down", + "Stairs Up": "Stairs Up", + "Steak": "Steak", + "Stone": "Stone", + "Stone Brick": "Stone Brick", + "Stone Bricks": "Stone Brisk", + "Stone Door": "Stone Door", + "Stone Wall": "Stone Wall", + "Swim Potion": "Swim Potion", + "Sword": "Sword", + "Time Potion": "Time Potion", + "Tnt": "Tnt", + "Torch": "Torch", + "Totem of Air": "Totem of Air", + "Tree": "Tre", + "Tree Sapling": "Tree Sapling", + "Water": "Water", + "Water Bucket": "Water Bucket", + "Wheat": "Wheat", + "Wheat Seeds": "Wheat Seeds", + "Wood": "Wood", + "Wood Door": "Wood Door", + "Wood Fishing Rod": "Wood Fishing Rod", + "Wood Planks": "Wood Planks", + "Wood Wall": "Wood Wall", + "Wool": "Wool", + "Workbench": "Workbench", + "Yellow Clothes": "Yellow Clothes", + "Yellow Wool": "Yellow Wool", + "Zombie Spawner": "Zombie Spawner", + "minicraft.achievement.airwizard": "Defeat... the air?", + "minicraft.achievement.airwizard.desc": "Defeat the first Air Wizard!", "minicraft.achievement.benchmarking": "Benchmarking", "minicraft.achievement.benchmarking.desc": "Make a workbench.", - "minicraft.achievement.upgrade": "Upgrade!", - "minicraft.achievement.upgrade.desc": "Craft any Stone tool.", "minicraft.achievement.bow": "Bow down to me!", "minicraft.achievement.bow.desc": "Fire an arrow with a bow.", - "minicraft.achievement.fish": "Go Fish!", - "minicraft.achievement.fish.desc": "Fish up a Fish!", - "minicraft.achievement.doors": "Adooring Protection", - "minicraft.achievement.doors.desc": "Craft a wood door.", - "minicraft.achievement.planks": "Walk the Planks!", - "minicraft.achievement.planks.desc": "Craft wood planks.", "minicraft.achievement.clothes": "Have a colourful day!", "minicraft.achievement.clothes.desc": "Craft any color of clothes", "minicraft.achievement.demolition": "Demolition Demo", "minicraft.achievement.demolition.desc": "Use TNT.", - "minicraft.achievement.survive_darkness": "Afraid of the Dark?", - "minicraft.achievement.survive_darkness.desc": "Survive 5 minutes in total darkness.", - "minicraft.achievement.lava": "Hot Affairs", - "minicraft.achievement.lava.desc": "Use a lava potion to swim in lava.", + "minicraft.achievement.doors": "Adooring Protection", + "minicraft.achievement.doors.desc": "Craft a wood door.", "minicraft.achievement.find_gem": "Oooh Shiny!", "minicraft.achievement.find_gem.desc": "Find Gem Ore and mine it.", + "minicraft.achievement.fish": "Go Fish!", + "minicraft.achievement.fish.desc": "Fish up a Fish!", + "minicraft.achievement.lava": "Hot Affairs", + "minicraft.achievement.lava.desc": "Use a lava potion to swim in lava.", "minicraft.achievement.lowest_caves": "What the light hides behind", "minicraft.achievement.lowest_caves.desc": "Reach the lowest caves.", "minicraft.achievement.obsidian_dungeon": "Of Knights and Men", "minicraft.achievement.obsidian_dungeon.desc": "Reach the obsidian dungeon.", - "minicraft.achievement.airwizard": "Defeat... the air?", - "minicraft.achievement.airwizard.desc": "Defeat the first Air Wizard!", + "minicraft.achievement.planks": "Walk the Planks!", + "minicraft.achievement.planks.desc": "Craft wood planks.", "minicraft.achievement.skin": "Glamour Show", "minicraft.achievement.skin.desc": "Change your look.", + "minicraft.achievement.survive_darkness": "Afraid of the Dark?", + "minicraft.achievement.survive_darkness.desc": "Survive 5 minutes in total darkness.", + "minicraft.achievement.upgrade": "Upgrade!", + "minicraft.achievement.upgrade.desc": "Craft any Stone tool.", + "minicraft.achievement.woodcutter": "Woodcutter", + "minicraft.achievement.woodcutter.desc": "Get wood.", + "minicraft.control_guide.attack": "Use %s to attack mobs or destroy tiles.", + "minicraft.control_guide.craft": "Use %s to open your crafting menu.", + "minicraft.control_guide.menu": "Use %s to open your inventory menu.", + "minicraft.control_guide.move": "Use %s to move.", "minicraft.display.entries.boolean.false": "Off", "minicraft.display.entries.boolean.true": "On", "minicraft.display.gui.link_opening": "Opening with browser...", @@ -44,6 +200,8 @@ "minicraft.display.menus.inventory": "Inventory", "minicraft.display.options_display": "Settings", "minicraft.display.options_display.change_key_bindings": "Key bindings", + "minicraft.display.options_display.language": "Language", + "minicraft.display.options_display.resource_packs": "Resource packs", "minicraft.display.popup.enter_confirm": "enter to confirm", "minicraft.display.popup.escape_cancel": "escape to cancel", "minicraft.display.popup.title_confirm": "Confirm Action", @@ -53,6 +211,52 @@ "minicraft.displays.achievements.display.not_achieved": "Uncompleted", "minicraft.displays.achievements.display.score": "Achievement Score: %s", "minicraft.displays.book.default_book": "The book has no text.", + "minicraft.displays.controls": "Controls", + "minicraft.displays.controls.display.controller": "Controller", + "minicraft.displays.controls.display.controller.00": "Moving player uses DPAD", + "minicraft.displays.controls.display.controller.01": "Moving cursor uses DPAD", + "minicraft.displays.controls.display.controller.02": "Selecting entries uses A", + "minicraft.displays.controls.display.controller.03": "Exiting pages uses B", + "minicraft.displays.controls.display.controller.04": "Attacking entities, destroying and interacting tiles use A", + "minicraft.displays.controls.display.controller.05": "Opening menus in-game uses X", + "minicraft.displays.controls.display.controller.06": "Opening crafting menus uses Y", + "minicraft.displays.controls.display.controller.07": "Picking up furniture uses LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "Dropping 1 item uses RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Dropping whole stack of item uses RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "Toggling search bar in item menus uses START", + "minicraft.displays.controls.display.controller.11": "Pausing game uses START", + "minicraft.displays.controls.display.controller.12": "Use X to toggle on-screen keyboard on input", + "minicraft.displays.controls.display.controller.13": "Use B as shortcut for backspace on on-screen keyboard", + "minicraft.displays.controls.display.controller.14": "Use X to remove an selected item in inventory on creative mode", + "minicraft.displays.controls.display.controller.15": "Use Y to remove whole stack of item in inventory on creative mode", + "minicraft.displays.controls.display.controller.desc.0": "Debugging mappings are inaccessible", + "minicraft.displays.controls.display.controller.desc.1": "Detailed mappings are unusable", + "minicraft.displays.controls.display.help.0": "%s/%s to see another controls.", + "minicraft.displays.controls.display.keyboard": "Keyboard", + "minicraft.displays.controls.display.keyboard.00": "Moving player uses MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Moving cursor uses CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Selecting entries uses SELECT", + "minicraft.displays.controls.display.keyboard.03": "Exiting pags uses EXIT", + "minicraft.displays.controls.display.keyboard.04": "Quick saving uses QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Attacking entities, destroying and interacting tiles use ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Opening menus in-game uses MENU", + "minicraft.displays.controls.display.keyboard.07": "Opening crafting menus uses CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Picking up furniture uses PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Dropping 1 item uses DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Dropping whole stack of item uses DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Toggling search bar in item menus uses SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Browsing searched results uses PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Pausing game uses PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Toggling potion effect display uses POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Toggling simplified potion display uses SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Temperately expanding quest display in-game uses EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Toggling HUD uses TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Taking screenshot uses SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Showing in-game info uses INFO", + "minicraft.displays.controls.display.keyboard.20": "Toggling fullscreen uses FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Use D to remove an selected item in inventory on creative mode", + "minicraft.displays.controls.display.keyboard.22": "Use SHIFT-D to remove whole stack of item in inventory on creative mode", + "minicraft.displays.controls.display.keyboard.desc": "Debug mappings are not explained", "minicraft.displays.crafting": "Crafting", "minicraft.displays.crafting.container_title.cost": "Cost:", "minicraft.displays.crafting.container_title.have": "Have:", @@ -72,13 +276,22 @@ "minicraft.displays.key_input.popup_display.confirm_reset": "Are you sure you want to reset all key bindings to the default keys?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Press the desired key sequence", "minicraft.displays.key_input.title": "Controls", + "minicraft.displays.language_settings.title": "Language...", + "minicraft.displays.loading.message.dungeon_regeneration": "Regenerating B4", "minicraft.displays.loading.message.entities": "Entities", "minicraft.displays.loading.message.generating": "Generating", "minicraft.displays.loading.message.level": "Level %s", "minicraft.displays.loading.message.levels": "Levels", "minicraft.displays.loading.message.loading": "Loading", + "minicraft.displays.loading.message.quests": "Quests", "minicraft.displays.loading.message.saving": "Saving", "minicraft.displays.loading.message.world": "World", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "World loading cancelled", + "minicraft.displays.loading.regeneration_popup.display.0": "Old version dungeon (B4 floor) is detected.", + "minicraft.displays.loading.regeneration_popup.display.1": "Regeneration is needed.", + "minicraft.displays.loading.regeneration_popup.display.2": "Old data on that floor are going to be erased:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s to continue", + "minicraft.displays.loading.regeneration_popup.display.4": "%s to cancel world loading", "minicraft.displays.options_main_menu": "Main Menu Options", "minicraft.displays.options_main_menu.resource_packs": "Resource packs", "minicraft.displays.options_world": "World Options", @@ -105,10 +318,12 @@ "minicraft.displays.quests": "Quests", "minicraft.displays.quests.display.header.completed": "Completed", "minicraft.displays.quests.display.header.unlocked": "Unlocked", + "minicraft.displays.quests.display.no_quest": "No quest unlocked", "minicraft.displays.quests.display.no_quest_desc": "No quest", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Only keyboard input is accepted.", "minicraft.displays.resource_packs.display.help.move": "Use %s and %s to move.", - "minicraft.displays.resource_packs.display.help.select": "%s to examine", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[ARROW KEYS] to move packs. ", + "minicraft.displays.resource_packs.display.help.select": "%s to examine", "minicraft.displays.resource_packs.display.title": "Resource Packs", "minicraft.displays.skin": "Skins", "minicraft.displays.skin.display.help.move": "Use %s and %s to move.", @@ -132,6 +347,7 @@ "minicraft.displays.title.play.new_world": "New World", "minicraft.displays.title.quit": "Quit", "minicraft.displays.title.select_to_download": "--Select here to Download--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Press %s to examine the details of the current tutorial.", "minicraft.displays.world_gen.create_world": "Create World", "minicraft.displays.world_gen.enter_world": "Enter World Name", "minicraft.displays.world_gen.title": "World Gen Options", @@ -152,266 +368,23 @@ "minicraft.displays.world_select.select_world": "Select World", "minicraft.notification.achievement_unlocked": "Achivement unlocked: %s", "minicraft.notification.air_wizard_defeated": "Air Wizard Defeated!", + "minicraft.notification.boss_limit": "No more bosses can be spawned", "minicraft.notification.cannot_sleep": "Can't sleep! %sMin %s Sec left!", "minicraft.notification.death_chest_retrieved": "Death chest retrieved!", "minicraft.notification.defeat_air_wizard_first": "The Air Wizard must be defeated first.", + "minicraft.notification.defeat_obsidian_knight_first": "The Obsidian Knight must be defeated first.", "minicraft.notification.dig_hole": "Dig a hole first!", "minicraft.notification.dungeon_opened": "The Dungeon is now open!", "minicraft.notification.gem_pickaxe_required": "Gem Pickaxe Required.", "minicraft.notification.invalid_placement": "Can only be placed on %s!", + "minicraft.notification.obsidian_knight_awoken": "The Obsidian Knight has awoken!", + "minicraft.notification.obsidian_knight_defeated": "Obsidian Knight: Defeated!", "minicraft.notification.quest_completed": "Quest Completed", "minicraft.notification.quest_unlocked": "Quest unlocked", + "minicraft.notification.spawn_on_boss_tile": "Can only be summoned in the Boss Room", "minicraft.notification.world_saved": "World Saved!", + "minicraft.notification.wrong_level_dungeon": "Can only be summoned on the dungeon level", "minicraft.notification.wrong_level_sky": "Can only be summoned on the sky level", - "minicraft.settings.fps": "Max FPS", - "minicraft.settings.difficulty": "Difficulty", - "minicraft.settings.difficulty.easy": "Easy", - "minicraft.settings.difficulty.normal": "Normal", - "minicraft.settings.difficulty.hard": "Hard", - "minicraft.settings.mode": "Gamemode", - "minicraft.settings.mode.survival": "Survival", - "minicraft.settings.mode.creative": "Creative", - "minicraft.settings.mode.hardcore": "Hardcore", - "minicraft.settings.mode.score": "Score", - "minicraft.settings.scoretime": "Time (Score Mode)", - "minicraft.settings.screenshot_scale": "Screenshot Scale", - "minicraft.settings.sound": "Sound", - "minicraft.settings.autosave": "Autosave", - "minicraft.settings.size": "World Size", - "minicraft.settings.theme": "World Theme", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Forest", - "minicraft.settings.theme.desert": "Desert", - "minicraft.settings.theme.plain": "Plain", - "minicraft.settings.theme.hell": "Hell", - "minicraft.settings.type": "Terrain Type", - "minicraft.settings.type.island": "Island", - "minicraft.settings.type.box": "Box", - "minicraft.settings.type.mountain": "Mountain", - "minicraft.settings.type.irregular": "Irregular", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul with Cape", - "minicraft.skin.minecraft_steve": "Familiar Boy", - "minicraft.skin.minecraft_alex": "Familiar Girl", - "minicraft.text_particales.key_consumed": "-1 Key", - "Death Chest": "Death Chest", - "Player": "Player", - "Leather Armor": "Leather Armor", - "Snake Armor": "Snake Armor", - "Iron Armor": "Iron Armor", - "Gold Armor": "Gold Armor", - "Gem Armor": "Gem Armor", - "Book": "Book", - "Antidious": "Antidious", - "Empty Bucket": "Empty Bucket", - "Water Bucket": "Water Bucket", - "Lava Bucket": "Lava Bucket", - "Red Clothes": "Red Clothes", - "Blue Clothes": "Blue Clothes", - "Green Clothes": "Green Clothes", - "Yellow Clothes": "Yellow Clothes", - "Black Clothes": "Black Clothes", - "Orange Clothes": "Orange Clothes", - "Purple Clothes": "Purple Clothes", - "Cyan Clothes": "Cyan Clothes", - "Reg Clothes": "Reg Clothes", - "Bread": "Bread", - "Apple": "Apple", - "Raw Pork": "Raw Pork", - "Raw Fish": "Raw Fish", - "Raw Beef": "Raw Beef", - "Pork Chop": "Pork Chop", - "Cooked Fish": "Cooked Fish", - "Cooked Pork": "Cooked Pork", - "Steak": "Steak", - "Gold Apple": "Gold Apple", - "Baked Potato": "Baked Potato", - "Cow Spawner": "Cow Spawner", - "Pig Spawner": "Pig Spawner", - "Sheep Spawner": "Sheep Spawner", - "Slime Spawner": "Slime Spawner", - "Zombie Spawner": "Zombie Spawner", - "Creeper Spawner": "Creeper Spawner", - "Skeleton Spawner": "Skeleton Spawner", - "Snake Spawner": "Snake Spawner", - "Knight Spawner": "Knight Spawner", - "AirWizard Spawner": "AirWizard Spawner", - "Workbench": "Workbench", - "Oven": "Oven", - "Furnace": "Furnace", - "Anvil": "Anvil", - "Enchanter": "Enchanter", - "Loom": "Loom", - "Lantern": "Lantern", - "Iron Lantern": "Iron Lantern", - "Gold Lantern": "Gold Lantern", - "Tnt": "Tnt", - "Bed": "Bed", - "Chest": "Chest", - "None Potion": "None Potion", - "Speed Potion": "Speed Potion", - "Light Potion": "Light Potion", - "Swim Potion": "Swim Potion", - "Energy Potion": "Energy Potion", - "Regen Potion": "Regen Potion", - "Health Potion": "Health Potion", - "Time Potion": "Time Potion", - "Lava Potion": "Lava Potion", - "Shield Potion": "Shield Potion", - "Haste Potion": "Haste Potion", - "Escape Potion": "Escape Potion", - "Potion": "Potion", - "Power Glove": "Power Glove", - "Wood": "Wood", - "Stone": "Stone", - "Leather": "Leather", - "Wheat": "Wheat", - "Key": "Key", - "Coal": "Coal", - "Iron Ore": "Iron Ore", - "Gold Ore": "Gold Ore", - "Gem Ore": "Gem Ore", - "Cloud Ore": "Cloud Ore", - "Iron": "Iron", - "Gold": "Gold", - "Lapis": "Lapis", - "Rose": "Rose", - "GunPowder": "Gunpowder", - "Slime": "Slime", - "Scale": "Scale", - "Shard": "Shard", - "Flower": "Flower", - "Acorn": "Acorn", - "Dirt": "Dirt", - "Natural Rock": "Natural Rock", - "Plank": "Plank", - "Plank Wall": "Plank Wall", - "Wood Door": "Wood Door", - "Stone Brick": "Stone Brick", - "Ornate Stone": "Ornate Stone", - "Stone Wall": "Stone Wall", - "Stone Door": "Stone Door", - "Obsidian Brick": "Obsidian Brick", - "Ornate Obsidian": "Ornate Obsidian", - "Obsidian Wall": "Obsidian Wall", - "Obsidian Door": "Obsidian Door", - "Wool": "Wool", - "Red Wool": "Red Wool", - "Blue Wool": "Blue Wool", - "Green Wool": "Green Wool", - "Yellow Wool": "Yellow Wool", - "Black Wool": "Black Wool", - "Sand": "Sand", - "Cactus": "Cactus", - "Seeds": "Seeds", - "Wheat Seeds": "Wheat Seeds", - "Grass Seeds": "Grass Seeds", - "Bone": "Bone", - "Cloud": "Cloud", - "Rock": "Rock", - "Gem": "Gem", - "Potato": "Potato", - "Wood Fishing Rod": "Wood Fishing Rod", - "Iron Fishing Rod": "Iron Fishing Rod", - "Gold Fishing Rod": "Gold Fishing Rod", - "Gem Fishing Rod": "Gem Fishing Rod", - "Shovel": "Shovel", - "Hoe": "Hoe", - "Sword": "Sword", - "Pickaxe": "Pickaxe", - "Axe": "Axe", - "Bow": "Bow", - "Claymore": "Claymore", - "Shears": "Shears", - "Torch": "Torch", - "Wood Planks": "Wood Planks", - "Stone Bricks": "Stone Brisk", - "Obsidian": "Obsidian", - "Wood Wall": "Wood Wall", - "Grass": "Grass", - "Hole": "Hole", - "Stairs Up": "Stairs Up", - "Stairs Down": "Stairs Down", - "Water": "Water", - "Tree": "Tre", - "Tree Sapling": "Tree Sapling", - "Cactus Sapling": "Cactus Sapling", - "Lava": "Lava", - "Lava Brick": "Lava Brick", - "Explode": "Explode", - "Farmland": "Farmland", - "Hard Rock": "Hard Rock", - "Infinite Fall": "Infinite Fall", - "Cloud Cactus": "Cloud Cactus", - "Raw Obsidian": "Raw Obsidian", - "Totem of Air": "Totem of Air", - "minicraft.control_guide.attack": "Use %s to attack mobs or destroy tiles.", - "minicraft.control_guide.craft": "Use %s to open your crafting menu.", - "minicraft.control_guide.menu": "Use %s to open your inventory menu.", - "minicraft.control_guide.move": "Use %s to move.", - "minicraft.displays.controls": "Controls", - "minicraft.displays.controls.display.controller": "Controller", - "minicraft.displays.controls.display.controller.00": "Moving player uses DPAD", - "minicraft.displays.controls.display.controller.01": "Moving cursor uses DPAD", - "minicraft.displays.controls.display.controller.02": "Selecting entries uses A", - "minicraft.displays.controls.display.controller.03": "Exiting pages uses B", - "minicraft.displays.controls.display.controller.04": "Attacking entities, destroying and interacting tiles use A", - "minicraft.displays.controls.display.controller.05": "Opening menus in-game uses X", - "minicraft.displays.controls.display.controller.06": "Opening crafting menus uses Y", - "minicraft.displays.controls.display.controller.07": "Picking up furniture uses LEFTBUMPER", - "minicraft.displays.controls.display.controller.08": "Dropping 1 item uses RIGHTBUMPER", - "minicraft.displays.controls.display.controller.09": "Dropping whole stack of item uses RIGHTSTICK", - "minicraft.displays.controls.display.controller.10": "Toggling search bar in item menus uses START", - "minicraft.displays.controls.display.controller.11": "Pausing game uses START", - "minicraft.displays.controls.display.controller.12": "Use X to toggle on-screen keyboard on input", - "minicraft.displays.controls.display.controller.13": "Use B as shortcut for backspace on on-screen keyboard", - "minicraft.displays.controls.display.controller.14": "Use X to remove an selected item in inventory on creative mode", - "minicraft.displays.controls.display.controller.15": "Use Y to remove whole stack of item in inventory on creative mode", - "minicraft.displays.controls.display.controller.desc.0": "Debugging mappings are inaccessible", - "minicraft.displays.controls.display.controller.desc.1": "Detailed mappings are unusable", - "minicraft.displays.controls.display.help.0": "%s/%s to see another controls.", - "minicraft.displays.controls.display.keyboard": "Keyboard", - "minicraft.displays.controls.display.keyboard.00": "Moving player uses MOVE-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.01": "Moving cursor uses CURSOR-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.02": "Selecting entries uses SELECT", - "minicraft.displays.controls.display.keyboard.03": "Exiting pags uses EXIT", - "minicraft.displays.controls.display.keyboard.04": "Quick saving uses QUICKSAVE", - "minicraft.displays.controls.display.keyboard.05": "Attacking entities, destroying and interacting tiles use ATTACK", - "minicraft.displays.controls.display.keyboard.06": "Opening menus in-game uses MENU", - "minicraft.displays.controls.display.keyboard.07": "Opening crafting menus uses CRAFT", - "minicraft.displays.controls.display.keyboard.08": "Picking up furniture uses PICKUP", - "minicraft.displays.controls.display.keyboard.09": "Dropping 1 item uses DROP-ONE", - "minicraft.displays.controls.display.keyboard.10": "Dropping whole stack of item uses DROP-STACK", - "minicraft.displays.controls.display.keyboard.11": "Toggling search bar in item menus uses SEARCHER-BAR", - "minicraft.displays.controls.display.keyboard.12": "Browsing searched results uses PAGE-UP/DOWN", - "minicraft.displays.controls.display.keyboard.13": "Pausing game uses PAUSE", - "minicraft.displays.controls.display.keyboard.14": "Toggling potion effect display uses POTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.15": "Toggling simplified potion display uses SIMPPOTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.16": "Temperately expanding quest display in-game uses EXPANDQUESTDISPLAY", - "minicraft.displays.controls.display.keyboard.17": "Toggling HUD uses TOGGLEHUD", - "minicraft.displays.controls.display.keyboard.18": "Taking screenshot uses SCREENSHOT", - "minicraft.displays.controls.display.keyboard.19": "Showing in-game info uses INFO", - "minicraft.displays.controls.display.keyboard.20": "Toggling fullscreen uses FULLSCREEN", - "minicraft.displays.controls.display.keyboard.21": "Use D to remove an selected item in inventory on creative mode", - "minicraft.displays.controls.display.keyboard.22": "Use SHIFT-D to remove whole stack of item in inventory on creative mode", - "minicraft.displays.controls.display.keyboard.desc": "Debug mappings are not explained", - "minicraft.displays.loading.message.dungeon_regeneration": "Regenerating B4", - "minicraft.displays.loading.message.quests": "Quests", - "minicraft.displays.loading.regeneration_popup.display.0": "Old version dungeon (B4 floor) is detected.", - "minicraft.displays.loading.regeneration_popup.display.1": "Regeneration is needed.", - "minicraft.displays.loading.regeneration_popup.display.2": "Old data on that floor are going to be erased:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s to continue", - "minicraft.displays.loading.regeneration_popup.display.4": "%s to cancel world loading", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "World loading cancelled", - "minicraft.displays.quests.display.no_quest": "No quest unlocked", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Only keyboard input is accepted.", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Press %s to examine the details of the current tutorial.", - "minicraft.notification.obsidian_knight_defeated": "Obsidian Knight: Defeated!", - "minicraft.notification.obsidian_knight_awoken": "The Obsidian Knight has awoken!", - "minicraft.notification.defeat_obsidian_knight_first": "The Obsidian Knight must be defeated first.", - "minicraft.notification.wrong_level_dungeon": "Can only be summoned on the dungeon level", - "minicraft.notification.boss_limit": "No more bosses can be spawned", - "minicraft.notification.spawn_on_boss_tile": "Can only be summoned in the Boss Room", "minicraft.notifications.statue_tapped": "You hear echoed whispers...", "minicraft.notifications.statue_touched": "You hear the statue vibrating...", "minicraft.quest.farming": "Farming Farmer", @@ -450,6 +423,37 @@ "minicraft.quest.potions.description": "Getting the potions.", "minicraft.quest.potions.powerful_potions": "Powerful Potions", "minicraft.quest.potions.powerful_potions.description": "Getting the useful and powerful potions.", + "minicraft.settings.autosave": "Autosave", + "minicraft.settings.difficulty": "Difficulty", + "minicraft.settings.difficulty.easy": "Easy", + "minicraft.settings.difficulty.hard": "Hard", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "Max FPS", + "minicraft.settings.mode": "Gamemode", + "minicraft.settings.mode.creative": "Creative", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Score", + "minicraft.settings.mode.survival": "Survival", + "minicraft.settings.scoretime": "Time (Score Mode)", + "minicraft.settings.screenshot_scale": "Screenshot Scale", + "minicraft.settings.size": "World Size", + "minicraft.settings.sound": "Sound", + "minicraft.settings.theme": "World Theme", + "minicraft.settings.theme.desert": "Desert", + "minicraft.settings.theme.forest": "Forest", + "minicraft.settings.theme.hell": "Hell", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Plain", + "minicraft.settings.type": "Terrain Type", + "minicraft.settings.type.box": "Box", + "minicraft.settings.type.irregular": "Irregular", + "minicraft.settings.type.island": "Island", + "minicraft.settings.type.mountain": "Mountain", + "minicraft.skin.minecraft_alex": "Familiar Girl", + "minicraft.skin.minecraft_steve": "Familiar Boy", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul with Cape", + "minicraft.text_particales.key_consumed": "-1 Key", "minicraft.tutorial.getting_rocks": "Getting stones and coals", "minicraft.tutorial.getting_rocks.description": "Getting at least 5 stone and 5 coal items by destroying rocks with the pickaxe crafted.", "minicraft.tutorial.getting_wood": "Getting more wood", @@ -459,15 +463,5 @@ "minicraft.tutorial.getting_workbench": "Getting a workbench", "minicraft.tutorial.getting_workbench.description": "Crafting a workbench in the crafting menu. Placing it after that.", "minicraft.tutorial.start_getting_wood": "Beginning of All", - "minicraft.tutorial.start_getting_wood.description": "Continuously attacking trees to get wood.", - "minicraft.display.options_display.language": "Language", - "minicraft.display.options_display.resource_packs": "Resource packs", - "minicraft.displays.language_settings.title": "Language...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "", - "String": "", - "Glass": "", - "Cloth": "" + "minicraft.tutorial.start_getting_wood.description": "Continuously attacking trees to get wood." } diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index b0904272c..0f4509fbb 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -1,42 +1,206 @@ { - "minicraft.achievement.woodcutter": "Woodcutter", - "minicraft.achievement.woodcutter.desc": "Get wood.", + "Acorn": "Acorn", + "AirWizard Spawner": "AirWizard Spawner", + "Antidious": "Antidious", + "Anvil": "Anvil", + "Apple": "Apple", + "Arrow": "Arrow", + "Awkward Potion": "Awkward Potion", + "Axe": "Axe", + "Baked Potato": "Baked Potato", + "Bed": "Bed", + "Black Clothes": "Black Clothes", + "Black Wool": "Black Wool", + "Blue Clothes": "Blue Clothes", + "Blue Wool": "Blue Wool", + "Bone": "Bone", + "Book": "Book", + "Bow": "Bow", + "Bread": "Bread", + "Cactus": "Cactus", + "Cactus Sapling": "Cactus Sapling", + "Chest": "Chest", + "Claymore": "Claymore", + "Cloth": "Cloth", + "Cloud": "Cloud", + "Cloud Cactus": "Cloud Cactus", + "Cloud Ore": "Cloud Ore", + "Coal": "Coal", + "Cooked Fish": "Cooked Fish", + "Cooked Pork": "Cooked Pork", + "Cow Spawner": "Cow Spawner", + "Creeper Spawner": "Creeper Spawner", + "Cyan Clothes": "Cyan Clothes", + "Death Chest": "Death Chest", + "Dirt": "Dirt", + "Dungeon Chest": "Dungeon Chest", + "Empty Bucket": "Empty Bucket", + "Enchanter": "Enchanter", + "Energy Potion": "Energy Potion", + "Escape Potion": "Escape Potion", + "Explode": "Explode", + "Farmland": "Farmland", + "Flower": "Flower", + "Furnace": "Furnace", + "Gem": "Gem", + "Gem Armor": "Gem Armor", + "Gem Fishing Rod": "Gem Fishing Rod", + "Gem Ore": "Gem Ore", + "Glass": "Glass", + "Glass Bottle": "Glass Bottle", + "Gold": "Gold", + "Gold Apple": "Gold Apple", + "Gold Armor": "Gold Armor", + "Gold Fishing Rod": "Gold Fishing Rod", + "Gold Lantern": "Gold Lantern", + "Gold Ore": "Gold Ore", + "Grass": "Grass", + "Grass Seeds": "Grass Seeds", + "Green Clothes": "Green Clothes", + "Green Wool": "Green Wool", + "Gunpowder": "Gunpowder", + "Hard Rock": "Hard Rock", + "Haste Potion": "Haste Potion", + "Health Potion": "Health Potion", + "Hoe": "Hoe", + "Hole": "Hole", + "Infinite Fall": "Infinite Fall", + "Iron": "Iron", + "Iron Armor": "Iron Armor", + "Iron Fishing Rod": "Iron Fishing Rod", + "Iron Lantern": "Iron Lantern", + "Iron Ore": "Iron Ore", + "Key": "Key", + "Knight Spawner": "Knight Spawner", + "Lantern": "Lantern", + "Lapis": "Lapis", + "Lava": "Lava", + "Lava Brick": "Lava Brick", + "Lava Bucket": "Lava Bucket", + "Lava Potion": "Lava Potion", + "Leather": "Leather", + "Leather Armor": "Leather Armor", + "Light Potion": "Light Potion", + "Loom": "Loom", + "Natural Rock": "Natural Rock", + "None Potion": "None Potion", + "Obsidian": "Obsidian", + "Obsidian Brick": "Obsidian Brick", + "Obsidian Door": "Obsidian Door", + "Obsidian Fence": "Obsidian Fence", + "Obsidian Heart": "Obsidian Heart", + "Obsidian Poppet": "Obsidian Poppet", + "Obsidian Wall": "Obsidian Wall", + "Orange Clothes": "Orange Clothes", + "Ornate Obsidian": "Ornate Obsidian", + "Ornate Stone": "Ornate Stone", + "Oven": "Oven", + "Path": "Path", + "Pickaxe": "Pickaxe", + "Pig Spawner": "Pig Spawner", + "Plank": "Plank", + "Plank Wall": "Plank Wall", + "Player": "Player", + "Pork Chop": "Pork Chop", + "Potato": "Potato", + "Potion": "Potion", + "Power Glove": "Power Glove", + "Purple Clothes": "Purple Clothes", + "Raw Beef": "Raw Beef", + "Raw Fish": "Raw Fish", + "Raw Obsidian": "Raw Obsidian", + "Raw Pork": "Raw Pork", + "Red Clothes": "Red Clothes", + "Red Wool": "Red Wool", + "Reg Clothes": "Reg Clothes", + "Regen Potion": "Regen Potion", + "Rock": "Rock", + "Rose": "Rose", + "Sand": "Sand", + "Scale": "Scale", + "Seeds": "Seeds", + "Shard": "Shard", + "Shears": "Shears", + "Sheep Spawner": "Sheep Spawner", + "Shield Potion": "Shield Potion", + "Shovel": "Shovel", + "Skeleton Spawner": "Skeleton Spawner", + "Slime": "Slime", + "Slime Spawner": "Slime Spawner", + "Snake Armor": "Snake Armor", + "Snake Spawner": "Snake Spawner", + "Speed Potion": "Speed Potion", + "Stairs Down": "Stairs Down", + "Stairs Up": "Stairs Up", + "Steak": "Steak", + "Stone": "Stone", + "Stone Brick": "Stone Brick", + "Stone Bricks": "Stone Bricks", + "Stone Door": "Stone Door", + "Stone Fence": "Stone Fence", + "Stone Wall": "Stone Wall", + "String": "String", + "Swim Potion": "Swim Potion", + "Sword": "Sword", + "Time Potion": "Time Potion", + "Tnt": "Tnt", + "Torch": "Torch", + "Totem of Air": "Totem of Air", + "Tree": "Tree", + "Tree Sapling": "Tree Sapling", + "Water": "Water", + "Water Bucket": "Water Bucket", + "Wheat": "Wheat", + "Wheat Seeds": "Wheat Seeds", + "Wood": "Wood", + "Wood Door": "Wood Door", + "Wood Fence": "Wood Fence", + "Wood Fishing Rod": "Wood Fishing Rod", + "Wood Planks": "Wood Planks", + "Wood Wall": "Wood Wall", + "Wool": "Wool", + "Workbench": "Workbench", + "Yellow Clothes": "Yellow Clothes", + "Yellow Wool": "Yellow Wool", + "Zombie Spawner": "Zombie Spawner", + "minicraft.achievement.airwizard": "Defeat... the air?", + "minicraft.achievement.airwizard.desc": "Defeat the Air Wizard!", "minicraft.achievement.benchmarking": "Benchmarking", "minicraft.achievement.benchmarking.desc": "Make a workbench.", - "minicraft.achievement.upgrade": "Upgrade!", - "minicraft.achievement.upgrade.desc": "Craft any Stone tool.", - "minicraft.achievement.bow": "Bow down to me!", - "minicraft.achievement.bow.desc": "Fire an arrow with a bow.", - "minicraft.achievement.fish": "Go Fish!", - "minicraft.achievement.fish.desc": "Fish up a Fish!", - "minicraft.achievement.doors": "Adooring Protection", - "minicraft.achievement.doors.desc": "Craft a wood door.", - "minicraft.achievement.planks": "Walk the Planks!", - "minicraft.achievement.planks.desc": "Craft wood planks.", "minicraft.achievement.boat": "Boating license", "minicraft.achievement.boat.desc": "Craft a boat.", + "minicraft.achievement.bow": "Bow down to me!", + "minicraft.achievement.bow.desc": "Fire an arrow with a bow.", "minicraft.achievement.clothes": "Have a colourful day!", "minicraft.achievement.clothes.desc": "Craft any color of clothes.", "minicraft.achievement.demolition": "Demolition Demo", "minicraft.achievement.demolition.desc": "Use TNT.", - "minicraft.achievement.survive_darkness": "Afraid of the Dark?", - "minicraft.achievement.survive_darkness.desc": "Survive 5 minutes in total darkness.", - "minicraft.achievement.lava": "Hot Affairs", - "minicraft.achievement.lava.desc": "Use a lava potion to swim in lava.", + "minicraft.achievement.doors": "Adooring Protection", + "minicraft.achievement.doors.desc": "Craft a wood door.", "minicraft.achievement.find_gem": "Oooh Shiny!", "minicraft.achievement.find_gem.desc": "Find Gem Ore and mine it.", + "minicraft.achievement.fish": "Go Fish!", + "minicraft.achievement.fish.desc": "Fish up a Fish!", + "minicraft.achievement.lava": "Hot Affairs", + "minicraft.achievement.lava.desc": "Use a lava potion to swim in lava.", "minicraft.achievement.lowest_caves": "Darkness behind light", "minicraft.achievement.lowest_caves.desc": "Reach the lowest caves.", "minicraft.achievement.obsidian_dungeon": "Of Knights and Men", "minicraft.achievement.obsidian_dungeon.desc": "Reach the obsidian dungeon.", - "minicraft.achievement.airwizard": "Defeat... the air?", - "minicraft.achievement.airwizard.desc": "Defeat the Air Wizard!", "minicraft.achievement.obsidianknight": "Shattered Burning Heart", "minicraft.achievement.obsidianknight.desc": "Defeat the Obsidian Knight and obtain its heart!", - "minicraft.achievement.skin": "Fashion Show", - "minicraft.achievement.skin.desc": "Change your skin.", + "minicraft.achievement.planks": "Walk the Planks!", + "minicraft.achievement.planks.desc": "Craft wood planks.", "minicraft.achievement.plant_seed": "A Seedy Place", "minicraft.achievement.plant_seed.desc": "Plant a seed and watch it grow.", + "minicraft.achievement.skin": "Fashion Show", + "minicraft.achievement.skin.desc": "Change your skin.", + "minicraft.achievement.survive_darkness": "Afraid of the Dark?", + "minicraft.achievement.survive_darkness.desc": "Survive 5 minutes in total darkness.", + "minicraft.achievement.upgrade": "Upgrade!", + "minicraft.achievement.upgrade.desc": "Craft any Stone tool.", + "minicraft.achievement.woodcutter": "Woodcutter", + "minicraft.achievement.woodcutter.desc": "Get wood.", "minicraft.control_guide.attack": "Use %s to attack mobs or destroy tiles.", "minicraft.control_guide.craft": "Use %s to open your crafting menu.", "minicraft.control_guide.menu": "Use %s to open your inventory menu.", @@ -140,18 +304,18 @@ "minicraft.displays.loading.message.quests": "Quests", "minicraft.displays.loading.message.saving": "Saving", "minicraft.displays.loading.message.world": "World", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "World loading cancelled", "minicraft.displays.loading.regeneration_popup.display.0": "Old version dungeon (B4 floor) is detected.", "minicraft.displays.loading.regeneration_popup.display.1": "Regeneration is needed.", "minicraft.displays.loading.regeneration_popup.display.2": "Old data on that floor are going to be erased:", "minicraft.displays.loading.regeneration_popup.display.3": "%s to continue", "minicraft.displays.loading.regeneration_popup.display.4": "%s to cancel world loading", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "World loading cancelled", "minicraft.displays.options_main_menu": "Main Menu Options", "minicraft.displays.options_main_menu.resource_packs": "Resource packs", "minicraft.displays.options_world": "World Options", "minicraft.displays.options_world.off_tutorials_confirm_popup": "Are you sure you want to turn off the tutorials forever?", - "minicraft.displays.options_world.turn_off_tutorials": "Turn off tutorials", "minicraft.displays.options_world.skip_current_tutorial": "Skip current tutorial", + "minicraft.displays.options_world.turn_off_tutorials": "Turn off tutorials", "minicraft.displays.pause": "Paused", "minicraft.displays.pause.display.exit_popup.0": "Are you sure you want to exit the game?", "minicraft.displays.pause.display.exit_popup.1": "All unsaved progress will be lost", @@ -233,8 +397,7 @@ "minicraft.displays.world_select.select_world": "Select World", "minicraft.notification.achievement_unlocked": "Achivement unlocked: %s", "minicraft.notification.air_wizard_defeated": "Air Wizard Defeated!", - "minicraft.notification.obsidian_knight_defeated": "Obsidian Knight: Defeated!", - "minicraft.notification.obsidian_knight_awoken": "The Obsidian Knight has awoken!", + "minicraft.notification.boss_limit": "No more bosses can be spawned", "minicraft.notification.cannot_sleep": "Can't sleep! %sMin %s Sec left!", "minicraft.notification.death_chest_retrieved": "Death chest retrieved!", "minicraft.notification.defeat_air_wizard_first": "The Air Wizard must be defeated first.", @@ -243,15 +406,16 @@ "minicraft.notification.dungeon_opened": "The Dungeon is now open!", "minicraft.notification.gem_pickaxe_required": "Gem Pickaxe Required.", "minicraft.notification.invalid_placement": "Can only be placed on %s!", + "minicraft.notification.knight_statue_exists": "A knight statue exists", + "minicraft.notification.obsidian_knight_awoken": "The Obsidian Knight has awoken!", + "minicraft.notification.obsidian_knight_defeated": "Obsidian Knight: Defeated!", "minicraft.notification.quest_completed": "Quest completed", "minicraft.notification.quest_unlocked": "Quest unlocked", - "minicraft.notification.world_saved": "World Saved!", - "minicraft.notification.wrong_level_sky": "Can only be summoned on the sky level", - "minicraft.notification.wrong_level_dungeon": "Can only be summoned on the dungeon level", - "minicraft.notification.boss_limit": "No more bosses can be spawned", "minicraft.notification.spawn_on_boss_tile": "Can only be summoned in the Boss Room", - "minicraft.notification.knight_statue_exists": "A knight statue exists", "minicraft.notification.tutorials_completed": "Tutorials are completed.", + "minicraft.notification.world_saved": "World Saved!", + "minicraft.notification.wrong_level_dungeon": "Can only be summoned on the dungeon level", + "minicraft.notification.wrong_level_sky": "Can only be summoned on the sky level", "minicraft.notifications.statue_tapped": "You hear echoed whispers...", "minicraft.notifications.statue_touched": "You hear the statue vibrating...", "minicraft.quest.farming": "Farming Farmer", @@ -290,39 +454,39 @@ "minicraft.quest.potions.description": "Getting the potions.", "minicraft.quest.potions.powerful_potions": "Powerful Potions", "minicraft.quest.potions.powerful_potions.description": "Getting the useful and powerful potions.", - "minicraft.settings.fps": "Max FPS", + "minicraft.settings.autosave": "Autosave", "minicraft.settings.difficulty": "Difficulty", "minicraft.settings.difficulty.easy": "Easy", - "minicraft.settings.difficulty.normal": "Normal", "minicraft.settings.difficulty.hard": "Hard", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "Max FPS", "minicraft.settings.mode": "Game Mode", - "minicraft.settings.mode.survival": "Survival", "minicraft.settings.mode.creative": "Creative", "minicraft.settings.mode.hardcore": "Hardcore", "minicraft.settings.mode.score": "Score", + "minicraft.settings.mode.survival": "Survival", + "minicraft.settings.quests": "Quests", "minicraft.settings.scoretime": "Time (Score Mode)", "minicraft.settings.screenshot_scale": "Screenshot Scale", - "minicraft.settings.sound": "Sound", - "minicraft.settings.autosave": "Autosave", + "minicraft.settings.show_quests": "Quest Panel", "minicraft.settings.size": "World Size", + "minicraft.settings.sound": "Sound", "minicraft.settings.theme": "World Theme", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Forest", "minicraft.settings.theme.desert": "Desert", - "minicraft.settings.theme.plain": "Plain", + "minicraft.settings.theme.forest": "Forest", "minicraft.settings.theme.hell": "Hell", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Plain", + "minicraft.settings.tutorials": "Tutorials", "minicraft.settings.type": "Terrain Type", - "minicraft.settings.type.island": "Island", "minicraft.settings.type.box": "Box", - "minicraft.settings.type.mountain": "Mountain", "minicraft.settings.type.irregular": "Irregular", - "minicraft.settings.tutorials": "Tutorials", - "minicraft.settings.quests": "Quests", - "minicraft.settings.show_quests": "Quest Panel", + "minicraft.settings.type.island": "Island", + "minicraft.settings.type.mountain": "Mountain", + "minicraft.skin.minecraft_alex": "Familiar girl", + "minicraft.skin.minecraft_steve": "Familiar boy", "minicraft.skin.paul": "Paul", "minicraft.skin.paul_cape": "Paul with cape", - "minicraft.skin.minecraft_steve": "Familiar boy", - "minicraft.skin.minecraft_alex": "Familiar girl", "minicraft.text_particales.key_consumed": "-1 key", "minicraft.tutorial.getting_rocks": "Getting stones and coals", "minicraft.tutorial.getting_rocks.description": "Getting at least 5 stone and 5 coal items by destroying rocks with the pickaxe crafted.", @@ -333,169 +497,5 @@ "minicraft.tutorial.getting_workbench": "Getting a workbench", "minicraft.tutorial.getting_workbench.description": "Crafting a workbench in the crafting menu. Placing it after that.", "minicraft.tutorial.start_getting_wood": "Beginning of All", - "minicraft.tutorial.start_getting_wood.description": "Continuously Attacking trees to get wood.", - "Death Chest": "Death Chest", - "Player": "Player", - "Leather Armor": "Leather Armor", - "Snake Armor": "Snake Armor", - "Iron Armor": "Iron Armor", - "Gold Armor": "Gold Armor", - "Gem Armor": "Gem Armor", - "Book": "Book", - "Antidious": "Antidious", - "Empty Bucket": "Empty Bucket", - "Water Bucket": "Water Bucket", - "Lava Bucket": "Lava Bucket", - "Red Clothes": "Red Clothes", - "Blue Clothes": "Blue Clothes", - "Green Clothes": "Green Clothes", - "Yellow Clothes": "Yellow Clothes", - "Black Clothes": "Black Clothes", - "Orange Clothes": "Orange Clothes", - "Purple Clothes": "Purple Clothes", - "Cyan Clothes": "Cyan Clothes", - "Reg Clothes": "Reg Clothes", - "Bread": "Bread", - "Apple": "Apple", - "Raw Pork": "Raw Pork", - "Raw Fish": "Raw Fish", - "Raw Beef": "Raw Beef", - "Pork Chop": "Pork Chop", - "Cooked Fish": "Cooked Fish", - "Cooked Pork": "Cooked Pork", - "Steak": "Steak", - "Gold Apple": "Gold Apple", - "Baked Potato": "Baked Potato", - "Cow Spawner": "Cow Spawner", - "Pig Spawner": "Pig Spawner", - "Sheep Spawner": "Sheep Spawner", - "Slime Spawner": "Slime Spawner", - "Zombie Spawner": "Zombie Spawner", - "Creeper Spawner": "Creeper Spawner", - "Skeleton Spawner": "Skeleton Spawner", - "Snake Spawner": "Snake Spawner", - "Knight Spawner": "Knight Spawner", - "AirWizard Spawner": "AirWizard Spawner", - "Workbench": "Workbench", - "Oven": "Oven", - "Furnace": "Furnace", - "Anvil": "Anvil", - "Enchanter": "Enchanter", - "Loom": "Loom", - "Lantern": "Lantern", - "Iron Lantern": "Iron Lantern", - "Gold Lantern": "Gold Lantern", - "Tnt": "Tnt", - "Bed": "Bed", - "Chest": "Chest", - "None Potion": "None Potion", - "Speed Potion": "Speed Potion", - "Light Potion": "Light Potion", - "Swim Potion": "Swim Potion", - "Energy Potion": "Energy Potion", - "Regen Potion": "Regen Potion", - "Health Potion": "Health Potion", - "Time Potion": "Time Potion", - "Lava Potion": "Lava Potion", - "Shield Potion": "Shield Potion", - "Haste Potion": "Haste Potion", - "Escape Potion": "Escape Potion", - "Potion": "Potion", - "Power Glove": "Power Glove", - "Wood": "Wood", - "Stone": "Stone", - "Leather": "Leather", - "Wheat": "Wheat", - "Key": "Key", - "Arrow": "Arrow", - "String": "String", - "Coal": "Coal", - "Iron Ore": "Iron Ore", - "Gold Ore": "Gold Ore", - "Gem Ore": "Gem Ore", - "Cloud Ore": "Cloud Ore", - "Iron": "Iron", - "Gold": "Gold", - "Lapis": "Lapis", - "Rose": "Rose", - "Gunpowder": "Gunpowder", - "Slime": "Slime", - "Glass": "Glass", - "Cloth": "Cloth", - "Scale": "Scale", - "Shard": "Shard", - "Flower": "Flower", - "Acorn": "Acorn", - "Dirt": "Dirt", - "Natural Rock": "Natural Rock", - "Plank": "Plank", - "Plank Wall": "Plank Wall", - "Wood Door": "Wood Door", - "Stone Brick": "Stone Brick", - "Ornate Stone": "Ornate Stone", - "Stone Wall": "Stone Wall", - "Stone Door": "Stone Door", - "Obsidian Brick": "Obsidian Brick", - "Ornate Obsidian": "Ornate Obsidian", - "Obsidian Wall": "Obsidian Wall", - "Obsidian Door": "Obsidian Door", - "Wool": "Wool", - "Red Wool": "Red Wool", - "Blue Wool": "Blue Wool", - "Green Wool": "Green Wool", - "Yellow Wool": "Yellow Wool", - "Black Wool": "Black Wool", - "Sand": "Sand", - "Cactus": "Cactus", - "Seeds": "Seeds", - "Wheat Seeds": "Wheat Seeds", - "Grass Seeds": "Grass Seeds", - "Bone": "Bone", - "Cloud": "Cloud", - "Rock": "Rock", - "Gem": "Gem", - "Potato": "Potato", - "Wood Fishing Rod": "Wood Fishing Rod", - "Iron Fishing Rod": "Iron Fishing Rod", - "Gold Fishing Rod": "Gold Fishing Rod", - "Gem Fishing Rod": "Gem Fishing Rod", - "Shovel": "Shovel", - "Hoe": "Hoe", - "Sword": "Sword", - "Pickaxe": "Pickaxe", - "Axe": "Axe", - "Bow": "Bow", - "Claymore": "Claymore", - "Shears": "Shears", - "Torch": "Torch", - "Wood Planks": "Wood Planks", - "Stone Bricks": "Stone Bricks", - "Obsidian": "Obsidian", - "Wood Wall": "Wood Wall", - "Grass": "Grass", - "Hole": "Hole", - "Stairs Up": "Stairs Up", - "Stairs Down": "Stairs Down", - "Water": "Water", - "Tree": "Tree", - "Tree Sapling": "Tree Sapling", - "Cactus Sapling": "Cactus Sapling", - "Lava": "Lava", - "Lava Brick": "Lava Brick", - "Explode": "Explode", - "Farmland": "Farmland", - "Hard Rock": "Hard Rock", - "Infinite Fall": "Infinite Fall", - "Cloud Cactus": "Cloud Cactus", - "Raw Obsidian": "Raw Obsidian", - "Totem of Air": "Totem of Air", - "Dungeon Chest": "Dungeon Chest", - "Path": "Path", - "Glass Bottle": "Glass Bottle", - "Awkward Potion": "Awkward Potion", - "Obsidian Poppet": "Obsidian Poppet", - "Obsidian Heart": "Obsidian Heart", - "Wood Fence": "Wood Fence", - "Stone Fence": "Stone Fence", - "Obsidian Fence": "Obsidian Fence" + "minicraft.tutorial.start_getting_wood.description": "Continuously Attacking trees to get wood." } diff --git a/src/client/resources/assets/localization/es-es.json b/src/client/resources/assets/localization/es-es.json index 79ce2465f..b832b1627 100644 --- a/src/client/resources/assets/localization/es-es.json +++ b/src/client/resources/assets/localization/es-es.json @@ -1,49 +1,212 @@ { - "minicraft.achievement.woodcutter": "Cortaleña", - "minicraft.achievement.woodcutter.desc": "Obtén Madera.", + "Acorn": "Bellota", + "AirWizard Spawner": "Generador de Mago Aéreo", + "Antidious": "Antidious", + "Anvil": "Yunque", + "Apple": "Manzana", + "Arrow": "Flecha", + "Axe": "Hacha", + "Baked Potato": "Patata Cocida", + "Bed": "Cama", + "Black Clothes": "Ropa Negra", + "Black Wool": "Lana Negra", + "Blue Clothes": "Ropa Azul", + "Blue Wool": "Lana Azul", + "Bone": "Hueso", + "Book": "Libro", + "Bow": "Arco", + "Bread": "Pan", + "Cactus": "Cactus", + "Cactus Sapling": "Brote de Cactus", + "Chest": "Cofre", + "Claymore": "Claymore", + "Cloth": "Paño", + "Cloud": "Nube", + "Cloud Cactus": "Cactus Nuboso", + "Cloud Ore": "Mena Nubosa", + "Coal": "Carbón", + "Cooked Fish": "Pescado cocido", + "Cooked Pork": "Cerdo cocido", + "Cow Spawner": "Generador de Vaca", + "Creeper Spawner": "Generador de Creeper", + "Cyan Clothes": "Ropa Cian", + "Death Chest": "Cofre de Recuperación", + "Dirt": "Tierra", + "Empty Bucket": "Cubo vacío", + "Enchanter": "Encantador", + "Energy Potion": "Poción energética", + "Escape Potion": "Poción de escape", + "Explode": "Explosión", + "Farmland": "Tierra Fértil", + "Flower": "Flor", + "Furnace": "Horno", + "Gem": "Gema", + "Gem Armor": "Armadura de Gema", + "Gem Fishing Rod": "Estrobo de gema", + "Gem Ore": "Mena de Gema", + "Glass": "Cristal", + "Gold": "Oro", + "Gold Apple": "Manzana Dorada", + "Gold Armor": "Armadura de Oro", + "Gold Fishing Rod": "Estrobo de oro", + "Gold Lantern": "Farol de Oro", + "Gold Ore": "Mena de Oro", + "Grass": "Pasto", + "Grass Seeds": "Semillas de Pasto", + "Green Clothes": "Ropa Verde", + "Green Wool": "Lana Verde", + "Gunpowder": "Pólvora", + "Hard Rock": "Roca Dura", + "Haste Potion": "Poción de prisa", + "Health Potion": "Poción de vida", + "Hoe": "Azada", + "Hole": "Hoyo", + "Infinite Fall": "Caída Infinita", + "Iron": "Hierro", + "Iron Armor": "Armadura de Hierro", + "Iron Fishing Rod": "Estrobo de hierro", + "Iron Lantern": "Farol de Hierro", + "Iron Ore": "Mena de Hierro", + "Key": "Llave", + "Knight Spawner": "Generador de Caballero", + "Lantern": "Farol", + "Lapis": "Lapis", + "Lava": "Lava", + "Lava Brick": "Ladrillo de Lava", + "Lava Bucket": "Cubo de Lava", + "Lava Potion": "Poción ignífuga", + "Leather": "Cuero", + "Leather Armor": "Armadura de Cuero", + "Light Potion": "Poción lumínica", + "Loom": "Telar", + "Natural Rock": "Roca natural", + "None Potion": "Poción vacía", + "Obsidian": "Obsidiana", + "Obsidian Brick": "Ladrillo de Obsidiana", + "Obsidian Door": "Puerta de Obsidiana", + "Obsidian Wall": "Muro de Obsidiana", + "Orange Clothes": "Ropa Naranja", + "Ornate Obsidian": "Patrón de Obsidiana", + "Ornate Stone": "Patrón de Piedra", + "Oven": "Cocina", + "Pickaxe": "Pico", + "Pig Spawner": "Generador de Cerdo", + "Plank": "Tabla", + "Plank Wall": "Muro de Tablas", + "Player": "Jugador", + "Pork Chop": "Chuleta de Cerdo", + "Potato": "Patata", + "Potion": "Poción", + "Power Glove": "Guante Fuerte", + "Purple Clothes": "Ropa Morada", + "Raw Beef": "Bistec crudo", + "Raw Fish": "Pescado crudo", + "Raw Obsidian": "Obsidiana cruda", + "Raw Pork": "Cerdo crudo", + "Red Clothes": "Ropa Roja", + "Red Wool": "Lana Roja", + "Reg Clothes": "Ropa Común", + "Regen Potion": "Poción de regen.", + "Rock": "Roca", + "Rose": "Rosa", + "Sand": "Arena", + "Scale": "Escama", + "Seeds": "Semillas", + "Shard": "Pieza", + "Shears": "Tijeras", + "Sheep Spawner": "Generador de Oveja", + "Shield Potion": "Poción de escudo", + "Shovel": "Pala", + "Skeleton Spawner": "Generador de Esqueleto", + "Slime": "Slime", + "Slime Spawner": "Generador de Slime", + "Snake Armor": "Armadura de Víbora", + "Snake Spawner": "Generador de Víbora", + "Speed Potion": "Poción de velocidad", + "Stairs Down": "Escaleras Abajo", + "Stairs Up": "Escaleras Arriba", + "Steak": "Bistec", + "Stone": "Piedra", + "Stone Brick": "Ladrillo de Piedra", + "Stone Bricks": "Ladrillo de piedra", + "Stone Door": "Puerta de Piedra", + "Stone Wall": "Muro de Piedra", + "String": "Cuerda", + "Swim Potion": "Poción del mar", + "Sword": "Espada", + "Time Potion": "Poción contrarreloj", + "Tnt": "Dinamita", + "Torch": "Antorcha", + "Totem of Air": "Tótem aéreo", + "Tree": "Árbol", + "Tree Sapling": "Brote de Árbol", + "Water": "Agua", + "Water Bucket": "Cubo de Agua", + "Wheat": "Trigo", + "Wheat Seeds": "Semillas de Trigo", + "Wood": "Madera", + "Wood Door": "Puerta de Madera", + "Wood Fishing Rod": "Estrobo de madera", + "Wood Planks": "Tablas de Madera", + "Wood Wall": "Muro de Madera", + "Wool": "Lana", + "Workbench": "Mesa de trabajo", + "Yellow Clothes": "Ropa Amarilla", + "Yellow Wool": "Lana Amarilla", + "Zombie Spawner": "Generador de Zombi", + "minicraft.achievement.airwizard": "Desvanecido cual aire", + "minicraft.achievement.airwizard.desc": "¡Derrota al primer Mago aéreo!", "minicraft.achievement.benchmarking": "¡A fabricar!", "minicraft.achievement.benchmarking.desc": "Haz una Mesa de trabajo.", - "minicraft.achievement.upgrade": "Edad de piedra", - "minicraft.achievement.upgrade.desc": "Fabrica una herramienta de Piedra.", "minicraft.achievement.bow": "¡Tiro al blanco!", "minicraft.achievement.bow.desc": "Dispara una flecha con un arco.", - "minicraft.achievement.fish": "Pesca marina", - "minicraft.achievement.fish.desc": "¡Pesca un pez con un estrobo!", - "minicraft.achievement.doors": "Vistazo al Portazo", - "minicraft.achievement.doors.desc": "Fabrica una puerta de madera.", - "minicraft.achievement.planks": "¡Anda sobre las tablas!", - "minicraft.achievement.planks.desc": "Fabrica tablas de madera.", "minicraft.achievement.clothes": "¡Ten un día colorido!", "minicraft.achievement.clothes.desc": "Fabrica ropa de algún color", "minicraft.achievement.demolition": "¡La cosa está que explota!", "minicraft.achievement.demolition.desc": "Explota una dinamita.", - "minicraft.achievement.survive_darkness": "¿Tienes nictofobia?", - "minicraft.achievement.survive_darkness.desc": "Sobrevive 5 minutos en total oscuridad.", - "minicraft.achievement.lava": "Asuntos ignífugos", - "minicraft.achievement.lava.desc": "Usa una poción de lava para nadar en lava.", + "minicraft.achievement.doors": "Vistazo al Portazo", + "minicraft.achievement.doors.desc": "Fabrica una puerta de madera.", "minicraft.achievement.find_gem": "¡Qué brillante!", "minicraft.achievement.find_gem.desc": "Encuentra una mena de gema y mínala.", + "minicraft.achievement.fish": "Pesca marina", + "minicraft.achievement.fish.desc": "¡Pesca un pez con un estrobo!", + "minicraft.achievement.lava": "Asuntos ignífugos", + "minicraft.achievement.lava.desc": "Usa una poción ignífuga y date un baño calentito.", "minicraft.achievement.lowest_caves": "La oscuridad tras la luz", "minicraft.achievement.lowest_caves.desc": "Llega al nivel de cuevas más bajo.", "minicraft.achievement.obsidian_dungeon": "Los nobles y el hombre", "minicraft.achievement.obsidian_dungeon.desc": "Entra a la mazmorra de obsidiana.", - "minicraft.achievement.airwizard": "Desvanecido cual aire", - "minicraft.achievement.airwizard.desc": "¡Derrota al primer Mago aéreo!", + "minicraft.achievement.planks": "¡Anda sobre las tablas!", + "minicraft.achievement.planks.desc": "Fabrica tablas de madera.", + "minicraft.achievement.plant_seed": "¡Crece pequeña!", + "minicraft.achievement.plant_seed.desc": "Planta una semilla de cualquier tipo y espera a que crezca.", "minicraft.achievement.skin": "La nueva moda", "minicraft.achievement.skin.desc": "Cambia de aspecto.", + "minicraft.achievement.survive_darkness": "¿Tienes nictofobia?", + "minicraft.achievement.survive_darkness.desc": "Sobrevive 5 minutos en total oscuridad.", + "minicraft.achievement.upgrade": "Edad de piedra", + "minicraft.achievement.upgrade.desc": "Fabrica una herramienta de Piedra.", + "minicraft.achievement.woodcutter": "Cortaleña", + "minicraft.achievement.woodcutter.desc": "Obtén Madera.", + "minicraft.control_guide.attack": "Usa %s para atacar enemigos o destruir objetos.", + "minicraft.control_guide.craft": "Usa %s para abrir tu menú de fabricación.", + "minicraft.control_guide.menu": "Usa %s para abrir tu inventario.", + "minicraft.control_guide.move": "Usa %s para moverte.", "minicraft.display.entries.boolean.false": "No", "minicraft.display.entries.boolean.true": "Sí", "minicraft.display.gui.link_opening": "Abriendo en navegador...", "minicraft.display.gui.perm_status.saving": "Guardando... %s%%", "minicraft.display.gui.perm_status.sleep_cancel": "Presiona %s para cancelar", "minicraft.display.gui.perm_status.sleeping": "Durmiendo...", - "minicraft.display.gui.potion_effects.hide_hint": "(%s: ¡Tapar!)", + "minicraft.display.gui.potion_effects.hide_hint": "(%s: Ocultar)", "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", "minicraft.display.gui.score.current_score": "Puntaje actual: %s", "minicraft.display.gui.score.time_left": "Tiempo restante %s%sm %ss", "minicraft.display.menus.inventory": "Inventario", "minicraft.display.options_display": "Ajustes", "minicraft.display.options_display.change_key_bindings": "Atajos de teclado", + "minicraft.display.options_display.language": "Idioma", + "minicraft.display.options_display.resource_packs": "Lotes de recursos", "minicraft.display.popup.enter_confirm": "ENTER para confirmar", "minicraft.display.popup.escape_cancel": "ESC para cancelar", "minicraft.display.popup.title_confirm": "Confirmar acción", @@ -53,6 +216,52 @@ "minicraft.displays.achievements.display.not_achieved": "No Logrado", "minicraft.displays.achievements.display.score": "Puntaje de logros: %s", "minicraft.displays.book.default_book": "Este libro no tiene texto.", + "minicraft.displays.controls": "Controles", + "minicraft.displays.controls.display.controller": "Mando", + "minicraft.displays.controls.display.controller.00": "Mueve al jugador con el DPAD", + "minicraft.displays.controls.display.controller.01": "Mueve el cursor con el DPAD", + "minicraft.displays.controls.display.controller.02": "Selecciona opciones con A", + "minicraft.displays.controls.display.controller.03": "Sal de páginas con B", + "minicraft.displays.controls.display.controller.04": "Ataca enemigos, destruye e interactúa con objetos con A", + "minicraft.displays.controls.display.controller.05": "Abre menús en-juego con X", + "minicraft.displays.controls.display.controller.06": "Abre menús de fabricación con Y", + "minicraft.displays.controls.display.controller.07": "Coge muebles con LB", + "minicraft.displays.controls.display.controller.08": "Tira 1 objeto con RB", + "minicraft.displays.controls.display.controller.09": "Tira un montón entero de objetos con el STICK DERECHO", + "minicraft.displays.controls.display.controller.10": "Alterna la barra de búsqueda en menús de objetos con START", + "minicraft.displays.controls.display.controller.11": "Pausa el juego con START", + "minicraft.displays.controls.display.controller.12": "Usa X para alternar el teclado en pantalla", + "minicraft.displays.controls.display.controller.13": "Usa B como atajo de retroceso en teclado en pantalla", + "minicraft.displays.controls.display.controller.14": "Usa X para eliminar un objeto seleccionado en el inventario del modo creativo", + "minicraft.displays.controls.display.controller.15": "Usa Y para eliminar un montón entero de objetos en el inventario del modo creativo", + "minicraft.displays.controls.display.controller.desc.0": "Mapeos depuración inaccesibles", + "minicraft.displays.controls.display.controller.desc.1": "Mapeos detallados inusables", + "minicraft.displays.controls.display.help.0": "con %s/%s ves otros controles.", + "minicraft.displays.controls.display.keyboard": "Teclado", + "minicraft.displays.controls.display.keyboard.00": "Mueve al jugador con MOVE-(DIRECCIÓN)", + "minicraft.displays.controls.display.keyboard.01": "Mueve el cursor con CURSOR-(DIRECCIÓN)", + "minicraft.displays.controls.display.keyboard.02": "Selecciona opciones con SELECT", + "minicraft.displays.controls.display.keyboard.03": "Sal de páginas con EXIT", + "minicraft.displays.controls.display.keyboard.04": "Haz un guardado rápido con QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Ataca enemigos, destruye e interactúa con objetos con ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Abre menús en-juego con MENU", + "minicraft.displays.controls.display.keyboard.07": "Abre menús de fabricación con CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Coge muebles con PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Tira 1 objeto con DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Tira un montón entero de objetos con DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Alterna la barra de búsqueda en menús de objetos con SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Navega entre resultados de búsqueda con PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Pausa el juego con PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Alterna notificaciones de efectos de poción con POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Alterna notificaciones de pociones simplificadas con SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Expande notificaciones de misiones en-juego con EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Alterna la HUD con TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Toma capturas de pantalla con SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Muestra información de la partida con INFO", + "minicraft.displays.controls.display.keyboard.20": "Alterna pantalla completa con FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Usa D para eliminar un objeto seleccionado en el inventario del modo creativo", + "minicraft.displays.controls.display.keyboard.22": "Usa MAYÚS-D para eliminar un montón entero de objetos en el inventario del modo creativo", + "minicraft.displays.controls.display.keyboard.desc": "Mapeos depuración no explicados", "minicraft.displays.crafting": "Fabricando", "minicraft.displays.crafting.container_title.cost": "Vale:", "minicraft.displays.crafting.container_title.have": "Poseo:", @@ -67,18 +276,27 @@ "minicraft.displays.info.title": "Datos Jugador", "minicraft.displays.key_input.display.help.0": "Usa C/ENTER para cambiar atajos", "minicraft.displays.key_input.display.help.1": "Con A añades un atajo", - "minicraft.displays.key_input.display.help.2": "SHIFT-D reinicia todos los atajos", + "minicraft.displays.key_input.display.help.2": "MAYÚS-D reinicia todos los atajos", "minicraft.displays.key_input.display.help.3": "%s para volver al menú principal", "minicraft.displays.key_input.popup_display.confirm_reset": "¿Estás seguro de reiniciar atajos de teclado a los predeterminados?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Presiona la tecla que desees", "minicraft.displays.key_input.title": "Controles", + "minicraft.displays.language_settings.title": "Idioma...", + "minicraft.displays.loading.message.dungeon_regeneration": "Regenerando B4", "minicraft.displays.loading.message.entities": "Entidades", "minicraft.displays.loading.message.generating": "Generando", "minicraft.displays.loading.message.level": "Nivel %s", "minicraft.displays.loading.message.levels": "Niveles", "minicraft.displays.loading.message.loading": "Cargando", + "minicraft.displays.loading.message.quests": "Misiones", "minicraft.displays.loading.message.saving": "Guardando", "minicraft.displays.loading.message.world": "Mundo", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "La carga del mundo fue cancelada", + "minicraft.displays.loading.regeneration_popup.display.0": "La mazmorra versión antigua (Piso B4) fue detectada.", + "minicraft.displays.loading.regeneration_popup.display.1": "Se necesita una regeneración.", + "minicraft.displays.loading.regeneration_popup.display.2": "Los datos antiguos en ese piso serán eliminados:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s para continuar", + "minicraft.displays.loading.regeneration_popup.display.4": "%s para cancelar la carga del mundo", "minicraft.displays.options_main_menu": "Opciones Principales", "minicraft.displays.options_main_menu.resource_packs": "Lotes de recursos", "minicraft.displays.options_world": "Opciones de Mundo", @@ -105,10 +323,12 @@ "minicraft.displays.quests": "Misiones", "minicraft.displays.quests.display.header.completed": "Completas", "minicraft.displays.quests.display.header.unlocked": "Desbloqueadas", + "minicraft.displays.quests.display.no_quest": "No se han desbloqueado misiones", "minicraft.displays.quests.display.no_quest_desc": "Sin misión", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Solo se acepta teclado.", "minicraft.displays.resource_packs.display.help.move": "Usa %s y %s para mover.", + "minicraft.displays.resource_packs.display.help.position": "MAYÚS-[FLECHAS] para mover lotes. ", "minicraft.displays.resource_packs.display.help.select": "%s para examinar.", - "minicraft.displays.resource_packs.display.help.position": "SHIFT-[FLECHAS] para mover lotes. ", "minicraft.displays.resource_packs.display.title": "Lotes de recursos", "minicraft.displays.skin": "Aspectos", "minicraft.displays.skin.display.help.move": "Usa %s y %s para moverte.", @@ -131,12 +351,13 @@ "minicraft.displays.title.play.load_world": "Cargar Mundo", "minicraft.displays.title.play.new_world": "Crear Mundo", "minicraft.displays.title.quit": "Salir", - "minicraft.displays.title.select_to_download": "--Descárgala Aca--", + "minicraft.displays.title.select_to_download": "--Descárgala Acá--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Con %s examinas los detalles del tutorial actual.", "minicraft.displays.world_gen.create_world": "Crear Mundo", "minicraft.displays.world_gen.enter_world": "Nombre del mundo", "minicraft.displays.world_gen.title": "Opciones de Mundo", "minicraft.displays.world_gen.troublesome_input": "¿Problemas con el nombre?", - "minicraft.displays.world_gen.troublesome_input.msg": "Parece que has puesto letras como atajos de mover el cursor en vertical, lo cual puede molestar . Esto se puede cambiar en el menú atajos de teclado como las teclas \"cursor-XXX\". Por ahora, para escribir una letra en vez de mover el cursor, mantén SHIFT apretado al escribir.", + "minicraft.displays.world_gen.troublesome_input.msg": "Parece que has puesto letras como atajos de mover el cursor en vertical, lo cual puede molestar . Esto se puede cambiar en el menú atajos de teclado como las teclas \"cursor-XXX\". Por ahora, para escribir una letra en vez de mover el cursor, mantén MAYÚS apretado al escribir.", "minicraft.displays.world_gen.world_seed": "Semilla", "minicraft.displays.world_select.display.help.0": "%s para confirmar", "minicraft.displays.world_select.display.help.1": "%s para volver", @@ -152,266 +373,24 @@ "minicraft.displays.world_select.select_world": "Seleccionar mundo", "minicraft.notification.achievement_unlocked": "Logro desbloqueado: %s", "minicraft.notification.air_wizard_defeated": "¡Mago aéreo derrotado!", + "minicraft.notification.boss_limit": "Ya no se pueden invocar más jefes", "minicraft.notification.cannot_sleep": "¡No puedes dormir! ¡Quedan %s Min y %s Seg!", "minicraft.notification.death_chest_retrieved": "¡Cofre de recuperación obtenido!", "minicraft.notification.defeat_air_wizard_first": "El mago aéreo debe ser derrotado primero.", + "minicraft.notification.defeat_obsidian_knight_first": "El Caballero Obsidiano debe ser derrotado primero.", "minicraft.notification.dig_hole": "¡Cava un hoyo primero!", "minicraft.notification.dungeon_opened": "¡La mazmorra se abrió!", "minicraft.notification.gem_pickaxe_required": "Pico de gema requerido.", - "minicraft.notification.invalid_placement": "¡Sólo puede colocarse en %s!", + "minicraft.notification.invalid_placement": "¡Solo puede colocarse en %s!", + "minicraft.notification.knight_statue_exists": "Ya existe una estatua", + "minicraft.notification.obsidian_knight_awoken": "¡El Caballero Obsidiano ha despertado!", + "minicraft.notification.obsidian_knight_defeated": "Caballero Obsidiano: ¡Derrotado!", "minicraft.notification.quest_completed": "Misión completada", "minicraft.notification.quest_unlocked": "Misión desbloqueada", + "minicraft.notification.spawn_on_boss_tile": "Solo se puede invocar en la Sala de Combate", "minicraft.notification.world_saved": "¡Mundo guardado!", - "minicraft.notification.wrong_level_sky": "Solo se puede invocar en el cielo", - "minicraft.settings.fps": "FPS máximos", - "minicraft.settings.difficulty": "Dificultad", - "minicraft.settings.difficulty.easy": "Fácil", - "minicraft.settings.difficulty.normal": "Normal", - "minicraft.settings.difficulty.hard": "Difícil", - "minicraft.settings.mode": "Modo de juego", - "minicraft.settings.mode.survival": "Supervivencia", - "minicraft.settings.mode.creative": "Creativo", - "minicraft.settings.mode.hardcore": "Extremo", - "minicraft.settings.mode.score": "Puntaje", - "minicraft.settings.scoretime": "Cronometro (Modo Puntaje)", - "minicraft.settings.screenshot_scale": "Gama captura pantalla", - "minicraft.settings.sound": "Sonido", - "minicraft.settings.autosave": "Autoguardado", - "minicraft.settings.size": "Tamaño del mundo", - "minicraft.settings.theme": "Tema del mundo", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Arbolea", - "minicraft.settings.theme.desert": "Desierto", - "minicraft.settings.theme.plain": "Plano", - "minicraft.settings.theme.hell": "Magma", - "minicraft.settings.type": "Tipo de terreno", - "minicraft.settings.type.island": "Isla", - "minicraft.settings.type.box": "Caja", - "minicraft.settings.type.mountain": "Montaña", - "minicraft.settings.type.irregular": "Irregular", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul con capa", - "minicraft.skin.minecraft_steve": "Hombre conocido", - "minicraft.skin.minecraft_alex": "Mujer conocida", - "minicraft.text_particales.key_consumed": "-1 Llave", - "Death Chest": "Cofre de Recuperación", - "Player": "Jugador", - "Leather Armor": "Armadura de Cuero", - "Snake Armor": "Armadura de Víbora", - "Iron Armor": "Armadura de Hierro", - "Gold Armor": "Armadura de Oro", - "Gem Armor": "Armadura de Gema", - "Book": "Libro", - "Antidious": "Antidious", - "Empty Bucket": "Cubo vacío", - "Water Bucket": "Cubo de Agua", - "Lava Bucket": "Cubo de Lava", - "Red Clothes": "Ropa Roja", - "Blue Clothes": "Ropa Azul", - "Green Clothes": "Ropa Verde", - "Yellow Clothes": "Ropa Amarilla", - "Black Clothes": "Ropa Negra", - "Orange Clothes": "Ropa Naranja", - "Purple Clothes": "Ropa Morada", - "Cyan Clothes": "Ropa Cían", - "Reg Clothes": "Ropa Común", - "Bread": "Pan", - "Apple": "Manzana", - "Raw Pork": "Cerdo crudo", - "Raw Fish": "Pescado crudo", - "Raw Beef": "Bistec crudo", - "Pork Chop": "Chuleta de Cerdo", - "Cooked Fish": "Pescado cocido", - "Cooked Pork": "Cerdo cocido", - "Steak": "Bistec", - "Gold Apple": "Manzana Dorada", - "Baked Potato": "Patata Cocida", - "Cow Spawner": "Generador de Vaca", - "Pig Spawner": "Generador de Cerdo", - "Sheep Spawner": "Generador de Oveja", - "Slime Spawner": "Generador de Slime", - "Zombie Spawner": "Generador de Zombie", - "Creeper Spawner": "Generador de Creeper", - "Skeleton Spawner": "Generador de Esqueleto", - "Snake Spawner": "Generador de Víbora", - "Knight Spawner": "Generador de Caballero", - "AirWizard Spawner": "Generador de Mago Aéreo", - "Workbench": "Mesa de trabajo", - "Oven": "Cocina", - "Furnace": "Horno", - "Anvil": "Yunque", - "Enchanter": "Encantador", - "Loom": "Telar", - "Lantern": "Farol", - "Iron Lantern": "Farol de Hierro", - "Gold Lantern": "Farol de Oro", - "Tnt": "Dinamita", - "Bed": "Cama", - "Chest": "Cofre", - "None Potion": "Poción de Nada", - "Speed Potion": "Poción de Velocidad", - "Light Potion": "Poción de Luz", - "Swim Potion": "Poción del Mar", - "Energy Potion": "Poción Energética", - "Regen Potion": "Poción de Regen.", - "Health Potion": "Poción de Vida", - "Time Potion": "Poción Contrareloj", - "Lava Potion": "Poción de Lava", - "Shield Potion": "Poción de Escudo", - "Haste Potion": "Poción de Prisa", - "Escape Potion": "Poción de Escape", - "Potion": "Poción", - "Power Glove": "Guante Fuerte", - "Wood": "Madera", - "Stone": "Piedra", - "Leather": "Cuero", - "Wheat": "Trigo", - "Key": "Llave", - "Coal": "Carbón", - "Iron Ore": "Mena de Hierro", - "Gold Ore": "Mena de Oro", - "Gem Ore": "Mena de Gema", - "Cloud Ore": "Mena Nubosa", - "Iron": "Hierro", - "Gold": "Oro", - "Lapis": "Lapis", - "Rose": "Rosa", - "Gunpowder": "Pólvora", - "Slime": "Slime", - "Scale": "Escama", - "Shard": "Pieza", - "Flower": "Flor", - "Acorn": "Bellota", - "Dirt": "Tierra", - "Natural Rock": "Roca natural", - "Plank": "Tabla", - "Plank Wall": "Muro de Tablas", - "Wood Door": "Puerta de Madera", - "Stone Brick": "Ladrillo de Piedra", - "Ornate Stone": "Patrón de Piedra", - "Stone Wall": "Muro de Piedra", - "Stone Door": "Puerta de Piedra", - "Obsidian Brick": "Ladrillo de Obsidiana", - "Ornate Obsidian": "Patrón de Obsidiana", - "Obsidian Wall": "Muro de Obsidiana", - "Obsidian Door": "Puerta de Obsidiana", - "Wool": "Lana", - "Red Wool": "Lana Roja", - "Blue Wool": "Lana Azul", - "Green Wool": "Lana Verde", - "Yellow Wool": "Lana Amarilla", - "Black Wool": "Lana Negra", - "Sand": "Arena", - "Cactus": "Cactus", - "Seeds": "Semillas", - "Wheat Seeds": "Semillas de Trigo", - "Grass Seeds": "Semillas de Pasto", - "Bone": "Hueso", - "Cloud": "Nube", - "Rock": "Roca", - "Gem": "Gema", - "Potato": "Patata", - "Wood Fishing Rod": "Estrobo de madera", - "Iron Fishing Rod": "Estrobo de hierro", - "Gold Fishing Rod": "Estrobo de oro", - "Gem Fishing Rod": "Estrobo de gema", - "Shovel": "Pala", - "Hoe": "Azada", - "Sword": "Espada", - "Pickaxe": "Pico", - "Axe": "Hacha", - "Bow": "Arco", - "Claymore": "Claymore", - "Shears": "Tijeras", - "Torch": "Antorcha", - "Wood Planks": "Tablas de Madera", - "Stone Bricks": "Ladrillo de piedra", - "Obsidian": "Obsidiana", - "Wood Wall": "Muro de Madera", - "Grass": "Pasto", - "Hole": "Hoyo", - "Stairs Up": "Escaleras Arriba", - "Stairs Down": "Escaleras Abajo", - "Water": "Agua", - "Tree": "Árbol", - "Tree Sapling": "Brote de Árbol", - "Cactus Sapling": "Brote de Cactus", - "Lava": "Lava", - "Lava Brick": "Ladrillo de Lava", - "Explode": "Explosión", - "Farmland": "Tierra Fértil", - "Hard Rock": "Roca Dura", - "Infinite Fall": "Caída Infinita", - "Cloud Cactus": "Cactus Nuboso", - "Raw Obsidian": "Obsidiana cruda", - "Totem of Air": "Totem aéreo", - "minicraft.control_guide.attack": "Usa %s para atacar enemigos o destruir objetos.", - "minicraft.control_guide.craft": "Usa %s para abrir tu menú de fabricación.", - "minicraft.control_guide.menu": "Usa %s para abrir tu inventario.", - "minicraft.control_guide.move": "Usa %s para moverte.", - "minicraft.displays.controls": "Controles", - "minicraft.displays.controls.display.controller": "Mando", - "minicraft.displays.controls.display.controller.00": "Mueve al jugador con el DPAD", - "minicraft.displays.controls.display.controller.01": "Mueve el cursor con el DPAD", - "minicraft.displays.controls.display.controller.02": "Selecciona opciones con A", - "minicraft.displays.controls.display.controller.03": "Sal de páginas con B", - "minicraft.displays.controls.display.controller.04": "Ataca enemigos, destruye e interactúa con objetos con A", - "minicraft.displays.controls.display.controller.05": "Abre menús en-juego con X", - "minicraft.displays.controls.display.controller.06": "Abre menús de fabricación con Y", - "minicraft.displays.controls.display.controller.07": "Coge muebles con LB", - "minicraft.displays.controls.display.controller.08": "Tira 1 objeto con RB", - "minicraft.displays.controls.display.controller.09": "Tira un montón entero de objetos con el STICK DERECHO", - "minicraft.displays.controls.display.controller.10": "Alterna la barra de búsqueda en menús de objetos con START", - "minicraft.displays.controls.display.controller.11": "Pausa el juego con START", - "minicraft.displays.controls.display.controller.12": "Usa X para alternar el teclado en pantalla", - "minicraft.displays.controls.display.controller.13": "Usa B como atajo de retroceso en teclado en pantalla", - "minicraft.displays.controls.display.controller.14": "Usa X para eliminar un objeto seleccionado en el inventario del modo creativo", - "minicraft.displays.controls.display.controller.15": "Usa Y para eliminar un montón entero de objetos en el inventario del modo creativo", - "minicraft.displays.controls.display.controller.desc.0": "Mapeos depuración inaccesibles", - "minicraft.displays.controls.display.controller.desc.1": "Mapeos detallados inusables", - "minicraft.displays.controls.display.help.0": "con %s/%s ves otros controles.", - "minicraft.displays.controls.display.keyboard": "Teclado", - "minicraft.displays.controls.display.keyboard.00": "Mueve al jugador con MOVE-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.01": "Mueve el cursor con CURSOR-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.02": "Selecciona opciones con SELECT", - "minicraft.displays.controls.display.keyboard.03": "Sal de páginas con EXIT", - "minicraft.displays.controls.display.keyboard.04": "Haz un guardado rápido con QUICKSAVE", - "minicraft.displays.controls.display.keyboard.05": "Ataca enemigos, destruye e interactúa con objetos con ATTACK", - "minicraft.displays.controls.display.keyboard.06": "Abre menús en-juego con MENU", - "minicraft.displays.controls.display.keyboard.07": "Abre menús de fabricación con CRAFT", - "minicraft.displays.controls.display.keyboard.08": "Coge muebles con PICKUP", - "minicraft.displays.controls.display.keyboard.09": "Tira 1 objeto con DROP-ONE", - "minicraft.displays.controls.display.keyboard.10": "Tira un montón entero de objetos con DROP-STACK", - "minicraft.displays.controls.display.keyboard.11": "Alterna la barra de búsqueda en menús de objetos con SEARCHER-BAR", - "minicraft.displays.controls.display.keyboard.12": "Navega entre resultados de búsqueda con PAGE-UP/DOWN", - "minicraft.displays.controls.display.keyboard.13": "Pausa el juego con PAUSE", - "minicraft.displays.controls.display.keyboard.14": "Alterna notificaciones de efectos de poción con POTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.15": "Alterna notificaciones de pociones simplificadas con SIMPPOTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.16": "Expande notificaciones de misiones en-juego con EXPANDQUESTDISPLAY", - "minicraft.displays.controls.display.keyboard.17": "Alterna la HUD con TOGGLEHUD", - "minicraft.displays.controls.display.keyboard.18": "Toma capturas de pantalla con SCREENSHOT", - "minicraft.displays.controls.display.keyboard.19": "Muestra información de la partida con INFO", - "minicraft.displays.controls.display.keyboard.20": "Alterna pantalla completa con FULLSCREEN", - "minicraft.displays.controls.display.keyboard.21": "Usa D para eliminar un objeto seleccionado en el inventario del modo creativo", - "minicraft.displays.controls.display.keyboard.22": "Usa SHIFT-D para eliminar un montón entero de objetos en el inventario del modo creativo", - "minicraft.displays.controls.display.keyboard.desc": "Mapeos depuración no explicados", - "minicraft.displays.loading.message.dungeon_regeneration": "Regenerando B4", - "minicraft.displays.loading.message.quests": "Misiones", - "minicraft.displays.loading.regeneration_popup.display.0": "La mazmorra versión antigua (Piso B4) fue detectada.", - "minicraft.displays.loading.regeneration_popup.display.1": "Se necesita una regeneración.", - "minicraft.displays.loading.regeneration_popup.display.2": "Los datos antiguos en ese piso serán eliminados:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s para continuar", - "minicraft.displays.loading.regeneration_popup.display.4": "%s para cancelar la carga del mundo", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "La carga del mundo fue cancelada", - "minicraft.displays.quests.display.no_quest": "No se han desbloqueado misiones", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Solo se acepta teclado.", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Con %s examinas los detalles del tutorial actual.", - "minicraft.notification.obsidian_knight_defeated": "Caballero Obsidiano: ¡Derrotado!", - "minicraft.notification.obsidian_knight_awoken": "¡El Caballero Obsidiano ha despertado!", - "minicraft.notification.defeat_obsidian_knight_first": "El Caballero Obsidiano debe ser derrotado primero.", "minicraft.notification.wrong_level_dungeon": "Solo se puede invocar en la mazmorra", - "minicraft.notification.boss_limit": "Ya no se pueden invocar más jefes", - "minicraft.notification.spawn_on_boss_tile": "Solo se puede invocar en la Sala de Combate", + "minicraft.notification.wrong_level_sky": "Solo se puede invocar en el cielo", "minicraft.notifications.statue_tapped": "Hay susurros farfullurros...", "minicraft.notifications.statue_touched": "La estatua vibra con calibra...", "minicraft.quest.farming": "Agricultor", @@ -443,31 +422,52 @@ "minicraft.quest.iron_equipments.upgrading_pickaxe": "Pico Mejorado", "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Mejora tu pico.", "minicraft.quest.potions": "Mago Destilador", - "minicraft.quest.potions.all_potions_prepared": "Alquímia Mixta", + "minicraft.quest.potions.all_potions_prepared": "Alquimia Mixta", "minicraft.quest.potions.all_potions_prepared.description": "Obtén todos los efectos de poción al mismo tiempo.", "minicraft.quest.potions.awkward_potions": "Poción Extraña", "minicraft.quest.potions.awkward_potions.description": "Obtén una poción extraña.", "minicraft.quest.potions.description": "Obteniendo Pociones.", "minicraft.quest.potions.powerful_potions": "Pociones Poderosas", "minicraft.quest.potions.powerful_potions.description": "Obtén las pociones útiles y poderosas.", + "minicraft.settings.autosave": "Autoguardado", + "minicraft.settings.difficulty": "Dificultad", + "minicraft.settings.difficulty.easy": "Fácil", + "minicraft.settings.difficulty.hard": "Difícil", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "FPS máximos", + "minicraft.settings.mode": "Modo de juego", + "minicraft.settings.mode.creative": "Creativo", + "minicraft.settings.mode.hardcore": "Extremo", + "minicraft.settings.mode.score": "Puntaje", + "minicraft.settings.mode.survival": "Supervivencia", + "minicraft.settings.scoretime": "Cronometro (Modo Puntaje)", + "minicraft.settings.screenshot_scale": "Gama captura pantalla", + "minicraft.settings.size": "Tamaño del mundo", + "minicraft.settings.sound": "Sonido", + "minicraft.settings.theme": "Tema del mundo", + "minicraft.settings.theme.desert": "Desierto", + "minicraft.settings.theme.forest": "Arboleda", + "minicraft.settings.theme.hell": "Magma", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Plano", + "minicraft.settings.type": "Tipo de terreno", + "minicraft.settings.type.box": "Caja", + "minicraft.settings.type.irregular": "Irregular", + "minicraft.settings.type.island": "Isla", + "minicraft.settings.type.mountain": "Montaña", + "minicraft.skin.minecraft_alex": "Mujer conocida", + "minicraft.skin.minecraft_steve": "Hombre conocido", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul con capa", + "minicraft.text_particales.key_consumed": "-1 Llave", "minicraft.tutorial.getting_rocks": "Rocas y Carbón", "minicraft.tutorial.getting_rocks.description": "Obtén al menos 5 de piedra y 5 de carbón destruyendo rocas con el pico fabricado.", "minicraft.tutorial.getting_wood": "Mucha más madera", - "minicraft.tutorial.getting_wood.description": "Obtén al menos 10 de madera de los arboles.", + "minicraft.tutorial.getting_wood.description": "Obtén al menos 10 de madera de los árboles.", "minicraft.tutorial.getting_wooden_pickaxe": "El Pico de madera", "minicraft.tutorial.getting_wooden_pickaxe.description": "Fabrica un pico de madera en el menú de fabricación de la mesa de trabajo.", "minicraft.tutorial.getting_workbench": "La útil mesa de trabajo", "minicraft.tutorial.getting_workbench.description": "Fabrica una mesa de trabajo en el menú de fabricación. Luego colócala.", - "minicraft.tutorial.start_getting_wood": "Dónde Todo Comienza", - "minicraft.tutorial.start_getting_wood.description": "Ataca Arboles continuamente para obtener madera.", - "minicraft.display.options_display.language": "Idioma", - "minicraft.display.options_display.resource_packs": "Lotes de recursos", - "minicraft.displays.language_settings.title": "Idioma...", - "minicraft.achievement.plant_seed": "¡Crece pequeña!", - "minicraft.achievement.plant_seed.desc": "Planta una semilla de cualquier tipo y espera a que crezca.", - "minicraft.notification.knight_statue_exists": "Ya existe una estatua", - "Arrow": "Flecha", - "String": "Cuerda", - "Glass": "Cristal", - "Cloth": "Paño" + "minicraft.tutorial.start_getting_wood": "Donde Todo Comienza", + "minicraft.tutorial.start_getting_wood.description": "Ataca Arboles continuamente para obtener madera." } diff --git a/src/client/resources/assets/localization/fr-fr.json b/src/client/resources/assets/localization/fr-fr.json index f2dc707f4..864269241 100644 --- a/src/client/resources/assets/localization/fr-fr.json +++ b/src/client/resources/assets/localization/fr-fr.json @@ -1,36 +1,195 @@ { - "minicraft.achievement.woodcutter": "Bûcheron", - "minicraft.achievement.woodcutter.desc": "Obtenir du bois.", + "Acorn": "Gland", + "AirWizard Spawner": "Générateur de sorciers de l'Air ", + "Antidious": "Antidious", + "Anvil": "Enclume", + "Apple": "Pomme", + "Arrow": "Fleche", + "Axe": "Hache", + "Baked Potato": "Patate cuite", + "Bed": "Lit", + "Black Clothes": "Vêtements noirs", + "Black Wool": "Laine noire", + "Blue Clothes": "Vêtements bleus", + "Blue Wool": "Laine bleue", + "Bone": "Os", + "Book": "Livre", + "Bow": "Arc", + "Bread": "Pain", + "Cactus": "Cactus", + "Cactus Sapling": "Pousse de cactus", + "Chest": "Coffre", + "Claymore": "Claymore", + "Cloth": "Chiffon", + "Cloud": "Nuage", + "Cloud Cactus": "Cactus des nuages", + "Cloud Ore": "Minerai de nuage", + "Coal": "Charbon", + "Cooked Fish": "Poisson cuit", + "Cooked Pork": "Côtelette de porc cuite", + "Cow Spawner": "Générateur de vaches", + "Creeper Spawner": "Générateur de creepers", + "Cyan Clothes": "Vêtements cyans", + "Death Chest": "Coffre de la Mort", + "Dirt": "Terre", + "Empty Bucket": "Seau vide", + "Enchanter": "Enchanteur", + "Energy Potion": "Potion d'énergie", + "Escape Potion": "Potion d'échappement", + "Explode": "Exploser", + "Farmland": "Terre labourée", + "Flower": "Fleur", + "Furnace": "Fourneau", + "Gem": "Gemme", + "Gem Armor": "Armure en Gemme", + "Gem Fishing Rod": "Canne à pêche en gemme", + "Gem Ore": "Minerai de gemme", + "Glass": "Verre", + "Gold": "Or", + "Gold Apple": "Pomme d'Or", + "Gold Armor": "Armure en Or", + "Gold Fishing Rod": "Canne à pêche en or", + "Gold Lantern": "Lanterne en or", + "Gold Ore": "Minerai d'or", + "Grass": "Herbe", + "Grass Seeds": "Graines d'herbe", + "Green Clothes": "Vêtements verts", + "Green Wool": "Laine verte", + "Gunpowder": "Poudre noire", + "Hard Rock": "Roche dure", + "Haste Potion": "Potion de hâte", + "Health Potion": "Potion de soin", + "Hoe": "Houe", + "Hole": "Trou", + "Infinite Fall": "Chute infinie", + "Iron": "Fer", + "Iron Armor": "Armure en Fer", + "Iron Fishing Rod": "Canne à pêche en fer", + "Iron Lantern": "Lanterne en fer", + "Iron Ore": "Minerai de fer", + "Key": "Clé", + "Knight Spawner": "Générateur de chevaliers", + "Lantern": "Lanterne", + "Lapis": "Lapis", + "Lava": "Lave", + "Lava Brick": "Brique de lave", + "Lava Bucket": "Seau de lave", + "Lava Potion": "Potion de résistance à la lave", + "Leather": "Cuir", + "Leather Armor": "Armure en Cuir", + "Light Potion": "Potion de lumière", + "Loom": "Métier à tisser", + "Natural Rock": "Roche naturelle", + "None Potion": "Potion nulle", + "Obsidian": "Obsidienne", + "Obsidian Brick": "Brique d'obsidienne", + "Obsidian Door": "Porte en obsidienne", + "Obsidian Wall": "Mur d'obsidienne", + "Orange Clothes": "Vêtements oranges", + "Ornate Obsidian": "Obsidienne ornée", + "Ornate Stone": "Pierre ornée", + "Oven": "Four", + "Pickaxe": "Pioche", + "Pig Spawner": "Générateur de cochons", + "Plank": "Planche", + "Plank Wall": "Mur de planches", + "Player": "Joueur", + "Pork Chop": "Côtelette de porc", + "Potato": "Patate", + "Potion": "Potion", + "Power Glove": "Gant de force", + "Purple Clothes": "Vêtements violets", + "Raw Beef": "Bœuf cru", + "Raw Fish": "Poisson cru", + "Raw Obsidian": "Obsidienne brute", + "Raw Pork": "Porc cru", + "Red Clothes": "Vêtements rouges", + "Red Wool": "Laine rouge", + "Reg Clothes": "Guenilles", + "Regen Potion": "Potion de régénération", + "Rock": "Roche", + "Rose": "Rose", + "Sand": "Sable", + "Scale": "Écaille", + "Seeds": "Graines", + "Shard": "Tesson", + "Shears": "Ciseaux", + "Sheep Spawner": "Générateur de moutons", + "Shield Potion": "Potion de bouclier", + "Shovel": "Pelle", + "Skeleton Spawner": "Générateur de squelettes", + "Slime": "Slime", + "Slime Spawner": "Générateur de slimes", + "Snake Armor": "Armure de Serpent", + "Snake Spawner": "Générateur de serpents", + "Speed Potion": "Potion de vitesse", + "Stairs Down": "Descendre l'escalier", + "Stairs Up": "Monter l'escalier", + "Steak": "Steak", + "Stone": "Pierre", + "Stone Brick": "Brique de pierre", + "Stone Bricks": "Briques de pierre", + "Stone Door": "Porte en pierre", + "Stone Wall": "Mur de pierre", + "String": "Fil", + "Swim Potion": "Potion de nage", + "Sword": "Épée", + "Time Potion": "Potion de temps", + "Tnt": "TNT", + "Torch": "Torche", + "Totem of Air": "Totem de l'Air", + "Tree": "Arbre", + "Tree Sapling": "Pousse d'arbre", + "Water": "Eau", + "Water Bucket": "Seau d'eau", + "Wheat": "Blé", + "Wheat Seeds": "Graines de blé", + "Wood": "Bois", + "Wood Door": "Porte en bois", + "Wood Fishing Rod": "Canne à pêche en bois", + "Wood Planks": "Planches de bois", + "Wood Wall": "Mur de bois", + "Wool": "Laine", + "Workbench": "Établi", + "Yellow Clothes": "Vêtements jaunes", + "Yellow Wool": "Laine jaune", + "Zombie Spawner": "Générateur de zombies", + "minicraft.achievement.airwizard": "Vainqueur de... l'air?", + "minicraft.achievement.airwizard.desc": "Tuez votre premier magicien de l'air!", "minicraft.achievement.benchmarking": "Artisanat", "minicraft.achievement.benchmarking.desc": "Fabriquez un établi.", - "minicraft.achievement.upgrade": "Amélioration !", - "minicraft.achievement.upgrade.desc": "Fabriquez n'importe quel outil en pierre.", "minicraft.achievement.bow": "Prosternez-vous devant moi !", "minicraft.achievement.bow.desc": "Tirez une flèche avec un arc.", - "minicraft.achievement.fish": "Allez pêcher!", - "minicraft.achievement.fish.desc": "Pêcher un poisson!", - "minicraft.achievement.doors": "Protection des adorateurs", - "minicraft.achievement.doors.desc": "Fabriquez une porte en bois.", - "minicraft.achievement.planks": "Marche sur les planches!", - "minicraft.achievement.planks.desc": "Fabriquez des planches en bois.", "minicraft.achievement.clothes": "Passez une journée haute en couleurs!", "minicraft.achievement.clothes.desc": "Créez des vêtements de n'importe quelle couleur", "minicraft.achievement.demolition": "Démonstration de démolition", "minicraft.achievement.demolition.desc": "Utilisez de la TNT.", - "minicraft.achievement.survive_darkness": "Appeuré(e) par la nuit ?", - "minicraft.achievement.survive_darkness.desc": "Survivre 5 minutes dans l'obscurité totale.", - "minicraft.achievement.lava": "Affaires chaudes", - "minicraft.achievement.lava.desc": "Utilisez une potion de résistance à la lave pour nager dedans", + "minicraft.achievement.doors": "Protection des adorateurs", + "minicraft.achievement.doors.desc": "Fabriquez une porte en bois.", "minicraft.achievement.find_gem": "Oooh Brillant!", "minicraft.achievement.find_gem.desc": "Trouvez un minerai de gemmes et minez-le.", + "minicraft.achievement.fish": "Allez pêcher!", + "minicraft.achievement.fish.desc": "Pêcher un poisson!", + "minicraft.achievement.lava": "Affaires chaudes", + "minicraft.achievement.lava.desc": "Utilisez une potion de résistance à la lave pour nager dedans", "minicraft.achievement.lowest_caves": "L'obscurité derrière la lumière", "minicraft.achievement.lowest_caves.desc": "Atteignez les grottes les plus profondes.", "minicraft.achievement.obsidian_dungeon": "Des chevaliers et des hommes", "minicraft.achievement.obsidian_dungeon.desc": "Atteignez le donjon d'obsidienne.", - "minicraft.achievement.airwizard": "Vainqueur de... l'air?", - "minicraft.achievement.airwizard.desc": "Tuez votre premier magicien de l'air!", + "minicraft.achievement.planks": "Marche sur les planches!", + "minicraft.achievement.planks.desc": "Fabriquez des planches en bois.", "minicraft.achievement.skin": "Défilé de mode", "minicraft.achievement.skin.desc": "Changez votre skin.", + "minicraft.achievement.survive_darkness": "Appeuré(e) par la nuit ?", + "minicraft.achievement.survive_darkness.desc": "Survivre 5 minutes dans l'obscurité totale.", + "minicraft.achievement.upgrade": "Amélioration !", + "minicraft.achievement.upgrade.desc": "Fabriquez n'importe quel outil en pierre.", + "minicraft.achievement.woodcutter": "Bûcheron", + "minicraft.achievement.woodcutter.desc": "Obtenir du bois.", + "minicraft.control_guide.attack": "Utilisez %s pour attaquer les mobs ou détruire les entités", + "minicraft.control_guide.craft": "Utilisez %s pour ouvrir votre menu de fabrication", + "minicraft.control_guide.menu": "Utilisez %s pour ouvrir votre inventaire", + "minicraft.control_guide.move": "Utilisez %s pour bouger", "minicraft.display.entries.boolean.false": "Éteint", "minicraft.display.entries.boolean.true": "Allumé", "minicraft.display.gui.link_opening": "ouverture avec votre navigateur web", @@ -44,6 +203,8 @@ "minicraft.display.menus.inventory": "Inventaire", "minicraft.display.options_display": "Options", "minicraft.display.options_display.change_key_bindings": "Changer la configuration des touches", + "minicraft.display.options_display.language": "Langue", + "minicraft.display.options_display.resource_packs": "Packs de ressources", "minicraft.display.popup.enter_confirm": "Appuyez sur entrée pour confirmer", "minicraft.display.popup.escape_cancel": "Appuyez sur Echap pour annuler", "minicraft.display.popup.title_confirm": "Confirmer l'action", @@ -53,6 +214,52 @@ "minicraft.displays.achievements.display.not_achieved": "Pas encore réussi", "minicraft.displays.achievements.display.score": "Atteignez le score : %s", "minicraft.displays.book.default_book": "Ce livre n'a pas de texte", + "minicraft.displays.controls": "Contrôles", + "minicraft.displays.controls.display.controller": "Manette", + "minicraft.displays.controls.display.controller.00": "Bouger le joueur en utilisant de le DPAD", + "minicraft.displays.controls.display.controller.01": "Bouger le curseur en utilisant le DPAD", + "minicraft.displays.controls.display.controller.02": "Pour sélectionner, appuyez sur le bouton A", + "minicraft.displays.controls.display.controller.03": "Pour annuler, appuyez sur le bouton B", + "minicraft.displays.controls.display.controller.04": "Pour attaquer des entités, détruire et interagir avec les tuiles, appuyez sur le bouton A", + "minicraft.displays.controls.display.controller.05": "Pour ouvrir les menus en jeu, appuyez sur le bouton X", + "minicraft.displays.controls.display.controller.06": "Pour ouvrir le menu de fabrication, appuyez sur le bouton Y", + "minicraft.displays.controls.display.controller.07": "Pour récupérer des meubles, appuyez sur le bouton LB", + "minicraft.displays.controls.display.controller.08": "Pour jeter un objet, appuyez sur le bouton RB", + "minicraft.displays.controls.display.controller.09": "Pour jeter un tas entier, appuyez sur le stick directionnel droit", + "minicraft.displays.controls.display.controller.10": "Pour activer/désactiver la barre de recherche dans les menus, appuyez sur START", + "minicraft.displays.controls.display.controller.11": "Pour mettre le jeu en pause, appuyez sur START", + "minicraft.displays.controls.display.controller.12": "Pour activer/désactiver le clavier virtuel, appuyez sur X", + "minicraft.displays.controls.display.controller.13": "Pour effacer un caractère sur le clavier virtuel, appuyez sur B", + "minicraft.displays.controls.display.controller.14": "Pour retirer un objet sélectionné de l'inventaire créatif, appuyez sur X", + "minicraft.displays.controls.display.controller.15": "Pour retirer un tas entier de l'inventaire créatif, appuyez sur Y", + "minicraft.displays.controls.display.controller.desc.0": "Les mappings de débogage sont inaccessibles", + "minicraft.displays.controls.display.controller.desc.1": "Les mappings détaillés sont inusables", + "minicraft.displays.controls.display.help.0": "%s/%s pour voir d'autres contrôles.", + "minicraft.displays.controls.display.keyboard": "Clavier", + "minicraft.displays.controls.display.keyboard.00": "Pour déplacer le joueur, utilisez MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Pour déplacer le cursor, utilisez CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Pour sélectionner des entrées, appuyez sur SELECT", + "minicraft.displays.controls.display.keyboard.03": "Pour sortir des pages, appuyez sur EXIT", + "minicraft.displays.controls.display.keyboard.04": "Pour la sauvegarde rapide, appuyez sur QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Attaquer des entités, détruire et interagir avec des tuiles utiliser ATTACK", + "minicraft.displays.controls.display.keyboard.06": "L'ouverture du Menu dans le jeu utiliser MENU", + "minicraft.displays.controls.display.keyboard.07": "L'ouverture des menus d'artisanat utiliser CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Ramasser des meubles utiliser PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Dropper 1 article utiliser DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Dropper une pile entière d'éléments utiliser DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Basculer la barre de recherche dans les menus d'éléments utilise SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Pour parcourir les résultats de la recherche, utilisez PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Pour mettre en pause le jeu, appuyez sur PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Pour activer/désactiver l'interface des effets de potions, appuyez sur POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Pour activer/désactiver l'interface simplifiée de potions, appuyez sur SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "L'affichage des quêtes en expansion temporaire dans le jeu utilise EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Pour activer/désactiver le HUD, appuyez sur TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Pour prendre une capture d'écran, appuyez sur SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Pour des informations sur la partie, appuyez sur INFO", + "minicraft.displays.controls.display.keyboard.20": "Pour le mode plein écran, appuyez sur FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Pour retirer un objet sélectionné de l'inventaire créatif, appuyez sur D", + "minicraft.displays.controls.display.keyboard.22": "Utilisez MAJ-D pour jeter un stack entier d'un item dans votre inventaire en créatif", + "minicraft.displays.controls.display.keyboard.desc": "Le Debug Mappings n'est pas expliqué", "minicraft.displays.crafting": "Fabrication", "minicraft.displays.crafting.container_title.cost": "Coût :", "minicraft.displays.crafting.container_title.have": "Vous avez:", @@ -72,13 +279,22 @@ "minicraft.displays.key_input.popup_display.confirm_reset": "Êtes-vous sûr(e) de vouloir réinitialiser la configuration des touches ?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Pressez la combinaison de touches désirée", "minicraft.displays.key_input.title": "Contrôles", + "minicraft.displays.language_settings.title": "Langue...", + "minicraft.displays.loading.message.dungeon_regeneration": "Régénération du B4", "minicraft.displays.loading.message.entities": "Entités", "minicraft.displays.loading.message.generating": "Génération en cours", "minicraft.displays.loading.message.level": "Niveau %s", "minicraft.displays.loading.message.levels": "Niveaux", "minicraft.displays.loading.message.loading": "Chargement", + "minicraft.displays.loading.message.quests": "Quêtes", "minicraft.displays.loading.message.saving": "Sauvegarde", "minicraft.displays.loading.message.world": "Monde", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Chargement du monde annulé", + "minicraft.displays.loading.regeneration_popup.display.0": "L'ancienne version du donjon (étage B4) a été détecté.", + "minicraft.displays.loading.regeneration_popup.display.1": "Une régénération est nécessaire.", + "minicraft.displays.loading.regeneration_popup.display.2": "Les anciennes données de cet étage vont être effacer.", + "minicraft.displays.loading.regeneration_popup.display.3": "%s pour continuer", + "minicraft.displays.loading.regeneration_popup.display.4": "%s pour annuler le chargement du monde", "minicraft.displays.options_main_menu": "Options du menu principal", "minicraft.displays.options_main_menu.resource_packs": "Pack de ressources", "minicraft.displays.options_world": "Option du monde", @@ -105,10 +321,12 @@ "minicraft.displays.quests": "Quêtes", "minicraft.displays.quests.display.header.completed": "Complétée", "minicraft.displays.quests.display.header.unlocked": "Débloquer", + "minicraft.displays.quests.display.no_quest": "Aucune quête débloquée", "minicraft.displays.quests.display.no_quest_desc": "Pas de quête", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Seul les entrées par clavier sont acceptées", "minicraft.displays.resource_packs.display.help.move": "Utilisez %s et %s pour bouger", - "minicraft.displays.resource_packs.display.help.select": "%s pour examiner", "minicraft.displays.resource_packs.display.help.position": "MAJ-[GAUCHE|DROITE|HAUT|BAS] pour bouger des paquets. ␣", + "minicraft.displays.resource_packs.display.help.select": "%s pour examiner", "minicraft.displays.resource_packs.display.title": "Pack de Ressource", "minicraft.displays.skin": "Skins", "minicraft.displays.skin.display.help.move": "Utilisez %s et %s pour bouger", @@ -132,6 +350,7 @@ "minicraft.displays.title.play.new_world": "Nouveau monde", "minicraft.displays.title.quit": "Quitter", "minicraft.displays.title.select_to_download": "--Sélectionner ici pour télécharger--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Appuyez sur %s pour examiner les détails du tuto actuel.", "minicraft.displays.world_gen.create_world": "Créer un Monde", "minicraft.displays.world_gen.enter_world": "Entrer le nom du monde", "minicraft.displays.world_gen.title": "Options de génération du monde", @@ -152,266 +371,23 @@ "minicraft.displays.world_select.select_world": "Sélection du monde", "minicraft.notification.achievement_unlocked": "Succès atteint: %s", "minicraft.notification.air_wizard_defeated": "Sorcier de l'Air Battu!", + "minicraft.notification.boss_limit": "Plus aucun boss ne peut apparaître", "minicraft.notification.cannot_sleep": "Vous ne pouvez pas encore dormir! %sMin %s Sec restant!", "minicraft.notification.death_chest_retrieved": "Coffre de la Mort récupéré!", "minicraft.notification.defeat_air_wizard_first": "Le Sorcier de l'Air doit être vaincu d'abord.", + "minicraft.notification.defeat_obsidian_knight_first": "Le Chevalier d'Obsidienne doit être battu avant.", "minicraft.notification.dig_hole": "Vous devez creuser un trou avant!", "minicraft.notification.dungeon_opened": "Le Donjon est maintenant ouvert!", "minicraft.notification.gem_pickaxe_required": "Pioche en Gemme requise", "minicraft.notification.invalid_placement": "Ceci ne peut être placé que sur %s!", + "minicraft.notification.obsidian_knight_awoken": "Le Chevalier d'Obsidienne est réveillé!", + "minicraft.notification.obsidian_knight_defeated": "Chevalier d'Obsidienne: Battu!", "minicraft.notification.quest_completed": "Quête complétée", "minicraft.notification.quest_unlocked": "Quête débloquée", + "minicraft.notification.spawn_on_boss_tile": "Peut seulement être invoqué dans la sale du boss", "minicraft.notification.world_saved": "Monde Sauvegardé!", - "minicraft.notification.wrong_level_sky": "Ne peut être invoqué qu'au niveau du Ciel", - "minicraft.settings.fps": "FPS Max", - "minicraft.settings.difficulty": "Difficulté", - "minicraft.settings.difficulty.easy": "Facile", - "minicraft.settings.difficulty.normal": "Normal", - "minicraft.settings.difficulty.hard": "Difficile", - "minicraft.settings.mode": "Mode de Jeu", - "minicraft.settings.mode.survival": "Survie", - "minicraft.settings.mode.creative": "Créatif", - "minicraft.settings.mode.hardcore": "Hardcore", - "minicraft.settings.mode.score": "Score", - "minicraft.settings.scoretime": "Temps (Mode Score)", - "minicraft.settings.screenshot_scale": "Échelle du Screenshot", - "minicraft.settings.sound": "Son", - "minicraft.settings.autosave": "Sauvegarde automatique", - "minicraft.settings.size": "Taille du monde", - "minicraft.settings.theme": "Thème du monde", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Forêt", - "minicraft.settings.theme.desert": "Désert", - "minicraft.settings.theme.plain": "Plaine", - "minicraft.settings.theme.hell": "Enfer", - "minicraft.settings.type": "Type de Terrain", - "minicraft.settings.type.island": "Îles", - "minicraft.settings.type.box": "Boîte", - "minicraft.settings.type.mountain": "Montagne", - "minicraft.settings.type.irregular": "Irrégulier", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul avec cape", - "minicraft.skin.minecraft_steve": "Garçon familier", - "minicraft.skin.minecraft_alex": "Fille familière", - "minicraft.text_particales.key_consumed": "-1 clé", - "Death Chest": "Coffre de la Mort", - "Player": "Joueur", - "Leather Armor": "Armure en Cuir", - "Snake Armor": "Armure de Serpent", - "Iron Armor": "Armure en Fer", - "Gold Armor": "Armure en Or", - "Gem Armor": "Armure en Gemme", - "Book": "Livre", - "Antidious": "Antidious", - "Empty Bucket": "Seau vide", - "Water Bucket": "Seau d'eau", - "Lava Bucket": "Seau de lave", - "Red Clothes": "Vêtements rouges", - "Blue Clothes": "Vêtements bleus", - "Green Clothes": "Vêtements verts", - "Yellow Clothes": "Vêtements jaunes", - "Black Clothes": "Vêtements noirs", - "Orange Clothes": "Vêtements oranges", - "Purple Clothes": "Vêtements violets", - "Cyan Clothes": "Vêtements cyans", - "Reg Clothes": "Guenilles", - "Bread": "Pain", - "Apple": "Pomme", - "Raw Pork": "Porc cru", - "Raw Fish": "Poisson cru", - "Raw Beef": "Bœuf cru", - "Pork Chop": "Côtelette de porc", - "Cooked Fish": "Poisson cuit", - "Cooked Pork": "Côtelette de porc cuite", - "Steak": "Steak", - "Gold Apple": "Pomme d'Or", - "Baked Potato": "Patate cuite", - "Cow Spawner": "Générateur de vaches", - "Pig Spawner": "Générateur de cochons", - "Sheep Spawner": "Générateur de moutons", - "Slime Spawner": "Générateur de slimes", - "Zombie Spawner": "Générateur de zombies", - "Creeper Spawner": "Générateur de creepers", - "Skeleton Spawner": "Générateur de squelettes", - "Snake Spawner": "Générateur de serpents", - "Knight Spawner": "Générateur de chevaliers", - "AirWizard Spawner": "Générateur de sorciers de l'Air ", - "Workbench": "Établi", - "Oven": "Four", - "Furnace": "Fourneau", - "Anvil": "Enclume", - "Enchanter": "Enchanteur", - "Loom": "Métier à tisser", - "Lantern": "Lanterne", - "Iron Lantern": "Lanterne en fer", - "Gold Lantern": "Lanterne en or", - "Tnt": "TNT", - "Bed": "Lit", - "Chest": "Coffre", - "None Potion": "Potion nulle", - "Speed Potion": "Potion de vitesse", - "Light Potion": "Potion de lumière", - "Swim Potion": "Potion de nage", - "Energy Potion": "Potion d'énergie", - "Regen Potion": "Potion de régénération", - "Health Potion": "Potion de soin", - "Time Potion": "Potion de temps", - "Lava Potion": "Potion de résistance à la lave", - "Shield Potion": "Potion de bouclier", - "Haste Potion": "Potion de hâte", - "Escape Potion": "Potion d'échappement", - "Potion": "Potion", - "Power Glove": "Gant de force", - "Wood": "Bois", - "Stone": "Pierre", - "Leather": "Cuir", - "Wheat": "Blé", - "Key": "Clé", - "Coal": "Charbon", - "Iron Ore": "Minerai de fer", - "Gold Ore": "Minerai d'or", - "Gem Ore": "Minerai de gemme", - "Cloud Ore": "Minerai de nuage", - "Iron": "Fer", - "Gold": "Or", - "Lapis": "Lapis", - "Rose": "Rose", - "Gunpowder": "Poudre noire", - "Slime": "Slime", - "Scale": "Écaille", - "Shard": "Tesson", - "Flower": "Fleur", - "Acorn": "Gland", - "Dirt": "Terre", - "Natural Rock": "Roche naturelle", - "Plank": "Planche", - "Plank Wall": "Mur de planches", - "Wood Door": "Porte en bois", - "Stone Brick": "Brique de pierre", - "Ornate Stone": "Pierre ornée", - "Stone Wall": "Mur de pierre", - "Stone Door": "Porte en pierre", - "Obsidian Brick": "Brique d'obsidienne", - "Ornate Obsidian": "Obsidienne ornée", - "Obsidian Wall": "Mur d'obsidienne", - "Obsidian Door": "Porte en obsidienne", - "Wool": "Laine", - "Red Wool": "Laine rouge", - "Blue Wool": "Laine bleue", - "Green Wool": "Laine verte", - "Yellow Wool": "Laine jaune", - "Black Wool": "Laine noire", - "Sand": "Sable", - "Cactus": "Cactus", - "Seeds": "Graines", - "Wheat Seeds": "Graines de blé", - "Grass Seeds": "Graines d'herbe", - "Bone": "Os", - "Cloud": "Nuage", - "Rock": "Roche", - "Gem": "Gemme", - "Potato": "Patate", - "Wood Fishing Rod": "Canne à pêche en bois", - "Iron Fishing Rod": "Canne à pêche en fer", - "Gold Fishing Rod": "Canne à pêche en or", - "Gem Fishing Rod": "Canne à pêche en gemme", - "Shovel": "Pelle", - "Hoe": "Houe", - "Sword": "Épée", - "Pickaxe": "Pioche", - "Axe": "Hache", - "Bow": "Arc", - "Claymore": "Claymore", - "Shears": "Ciseaux", - "Torch": "Torche", - "Wood Planks": "Planches de bois", - "Stone Bricks": "Briques de pierre", - "Obsidian": "Obsidienne", - "Wood Wall": "Mur de bois", - "Grass": "Herbe", - "Hole": "Trou", - "Stairs Up": "Monter l'escalier", - "Stairs Down": "Descendre l'escalier", - "Water": "Eau", - "Tree": "Arbre", - "Tree Sapling": "Pousse d'arbre", - "Cactus Sapling": "Pousse de cactus", - "Lava": "Lave", - "Lava Brick": "Brique de lave", - "Explode": "Exploser", - "Farmland": "Terre labourée", - "Hard Rock": "Roche dure", - "Infinite Fall": "Chute infinie", - "Cloud Cactus": "Cactus des nuages", - "Raw Obsidian": "Obsidienne brute", - "Totem of Air": "Totem de l'Air", - "minicraft.control_guide.attack": "Utilisez %s pour attaquer les mobs ou détruire les entités", - "minicraft.control_guide.craft": "Utilisez %s pour ouvrir votre menu de fabrication", - "minicraft.control_guide.menu": "Utilisez %s pour ouvrir votre inventaire", - "minicraft.control_guide.move": "Utilisez %s pour bouger", - "minicraft.displays.controls": "Contrôles", - "minicraft.displays.controls.display.controller": "Manette", - "minicraft.displays.controls.display.controller.00": "Bouger le joueur en utilisant de le DPAD", - "minicraft.displays.controls.display.controller.01": "Bouger le curseur en utilisant le DPAD", - "minicraft.displays.controls.display.controller.02": "Pour sélectionner, appuyez sur le bouton A", - "minicraft.displays.controls.display.controller.03": "Pour annuler, appuyez sur le bouton B", - "minicraft.displays.controls.display.controller.04": "Pour attaquer des entités, détruire et interagir avec les tuiles, appuyez sur le bouton A", - "minicraft.displays.controls.display.controller.05": "Pour ouvrir les menus en jeu, appuyez sur le bouton X", - "minicraft.displays.controls.display.controller.06": "Pour ouvrir le menu de fabrication, appuyez sur le bouton Y", - "minicraft.displays.controls.display.controller.07": "Pour récupérer des meubles, appuyez sur le bouton LB", - "minicraft.displays.controls.display.controller.08": "Pour jeter un objet, appuyez sur le bouton RB", - "minicraft.displays.controls.display.controller.09": "Pour jeter un tas entier, appuyez sur le stick directionnel droit", - "minicraft.displays.controls.display.controller.10": "Pour activer/désactiver la barre de recherche dans les menus, appuyez sur START", - "minicraft.displays.controls.display.controller.11": "Pour mettre le jeu en pause, appuyez sur START", - "minicraft.displays.controls.display.controller.12": "Pour activer/désactiver le clavier virtuel, appuyez sur X", - "minicraft.displays.controls.display.controller.13": "Pour effacer un caractère sur le clavier virtuel, appuyez sur B", - "minicraft.displays.controls.display.controller.14": "Pour retirer un objet sélectionné de l'inventaire créatif, appuyez sur X", - "minicraft.displays.controls.display.controller.15": "Pour retirer un tas entier de l'inventaire créatif, appuyez sur Y", - "minicraft.displays.controls.display.controller.desc.0": "Les mappings de débogage sont inaccessibles", - "minicraft.displays.controls.display.controller.desc.1": "Les mappings détaillés sont inusables", - "minicraft.displays.controls.display.help.0": "%s/%s pour voir d'autres contrôles.", - "minicraft.displays.controls.display.keyboard": "Clavier", - "minicraft.displays.controls.display.keyboard.00": "Pour déplacer le joueur, utilisez MOVE-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.01": "Pour déplacer le cursor, utilisez CURSOR-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.02": "Pour sélectionner des entrées, appuyez sur SELECT", - "minicraft.displays.controls.display.keyboard.03": "Pour sortir des pages, appuyez sur EXIT", - "minicraft.displays.controls.display.keyboard.04": "Pour la sauvegarde rapide, appuyez sur QUICKSAVE", - "minicraft.displays.controls.display.keyboard.05": "Attaquer des entités, détruire et interagir avec des tuiles utiliser ATTACK", - "minicraft.displays.controls.display.keyboard.06": "L'ouverture du Menu dans le jeu utiliser MENU", - "minicraft.displays.controls.display.keyboard.07": "L'ouverture des menus d'artisanat utiliser CRAFT", - "minicraft.displays.controls.display.keyboard.08": "Ramasser des meubles utiliser PICKUP", - "minicraft.displays.controls.display.keyboard.09": "Dropper 1 article utiliser DROP-ONE", - "minicraft.displays.controls.display.keyboard.10": "Dropper une pile entière d'éléments utiliser DROP-STACK", - "minicraft.displays.controls.display.keyboard.11": "Basculer la barre de recherche dans les menus d'éléments utilise SEARCHER-BAR", - "minicraft.displays.controls.display.keyboard.12": "Pour parcourir les résultats de la recherche, utilisez PAGE-UP/DOWN", - "minicraft.displays.controls.display.keyboard.13": "Pour mettre en pause le jeu, appuyez sur PAUSE", - "minicraft.displays.controls.display.keyboard.14": "Pour activer/désactiver l'interface des effets de potions, appuyez sur POTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.15": "Pour activer/désactiver l'interface simplifiée de potions, appuyez sur SIMPPOTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.16": "L'affichage des quêtes en expansion temporaire dans le jeu utilise EXPANDQUESTDISPLAY", - "minicraft.displays.controls.display.keyboard.17": "Pour activer/désactiver le HUD, appuyez sur TOGGLEHUD", - "minicraft.displays.controls.display.keyboard.18": "Pour prendre une capture d'écran, appuyez sur SCREENSHOT", - "minicraft.displays.controls.display.keyboard.19": "Pour des informations sur la partie, appuyez sur INFO", - "minicraft.displays.controls.display.keyboard.20": "Pour le mode plein écran, appuyez sur FULLSCREEN", - "minicraft.displays.controls.display.keyboard.21": "Pour retirer un objet sélectionné de l'inventaire créatif, appuyez sur D", - "minicraft.displays.controls.display.keyboard.22": "Utilisez MAJ-D pour jeter un stack entier d'un item dans votre inventaire en créatif", - "minicraft.displays.controls.display.keyboard.desc": "Le Debug Mappings n'est pas expliqué", - "minicraft.displays.loading.message.dungeon_regeneration": "Régénération du B4", - "minicraft.displays.loading.message.quests": "Quêtes", - "minicraft.displays.loading.regeneration_popup.display.0": "L'ancienne version du donjon (étage B4) a été détecté.", - "minicraft.displays.loading.regeneration_popup.display.1": "Une régénération est nécessaire.", - "minicraft.displays.loading.regeneration_popup.display.2": "Les anciennes données de cet étage vont être effacer.", - "minicraft.displays.loading.regeneration_popup.display.3": "%s pour continuer", - "minicraft.displays.loading.regeneration_popup.display.4": "%s pour annuler le chargement du monde", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "Chargement du monde annulé", - "minicraft.displays.quests.display.no_quest": "Aucune quête débloquée", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Seul les entrées par clavier sont acceptées", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Appuyez sur %s pour examiner les détails du tuto actuel.", - "minicraft.notification.obsidian_knight_defeated": "Chevalier d'Obsidienne: Battu!", - "minicraft.notification.obsidian_knight_awoken": "Le Chevalier d'Obsidienne est réveillé!", - "minicraft.notification.defeat_obsidian_knight_first": "Le Chevalier d'Obsidienne doit être battu avant.", "minicraft.notification.wrong_level_dungeon": "Peut seulement être invoqué dans le donjon", - "minicraft.notification.boss_limit": "Plus aucun boss ne peut apparaître", - "minicraft.notification.spawn_on_boss_tile": "Peut seulement être invoqué dans la sale du boss", + "minicraft.notification.wrong_level_sky": "Ne peut être invoqué qu'au niveau du Ciel", "minicraft.notifications.statue_tapped": "Vous entendez des murmures en échos... ", "minicraft.notifications.statue_touched": "Vous entendez la statue vibrer...", "minicraft.quest.farming": "Fermier qui farm", @@ -450,6 +426,37 @@ "minicraft.quest.potions.description": "Obtenez toutes les potions.", "minicraft.quest.potions.powerful_potions": "Potions puissantes", "minicraft.quest.potions.powerful_potions.description": "Obtenez les potions puissantes et utiles.", + "minicraft.settings.autosave": "Sauvegarde automatique", + "minicraft.settings.difficulty": "Difficulté", + "minicraft.settings.difficulty.easy": "Facile", + "minicraft.settings.difficulty.hard": "Difficile", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "FPS Max", + "minicraft.settings.mode": "Mode de Jeu", + "minicraft.settings.mode.creative": "Créatif", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Score", + "minicraft.settings.mode.survival": "Survie", + "minicraft.settings.scoretime": "Temps (Mode Score)", + "minicraft.settings.screenshot_scale": "Échelle du Screenshot", + "minicraft.settings.size": "Taille du monde", + "minicraft.settings.sound": "Son", + "minicraft.settings.theme": "Thème du monde", + "minicraft.settings.theme.desert": "Désert", + "minicraft.settings.theme.forest": "Forêt", + "minicraft.settings.theme.hell": "Enfer", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Plaine", + "minicraft.settings.type": "Type de Terrain", + "minicraft.settings.type.box": "Boîte", + "minicraft.settings.type.irregular": "Irrégulier", + "minicraft.settings.type.island": "Îles", + "minicraft.settings.type.mountain": "Montagne", + "minicraft.skin.minecraft_alex": "Fille familière", + "minicraft.skin.minecraft_steve": "Garçon familier", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul avec cape", + "minicraft.text_particales.key_consumed": "-1 clé", "minicraft.tutorial.getting_rocks": "Récupérez de la pierre et du charbon", "minicraft.tutorial.getting_rocks.description": "Avoir récupéré au moins 5 pierres et 5 charbons en cassant des roches avec la pioche.", "minicraft.tutorial.getting_wood": "Prendre plus de bois", @@ -459,15 +466,5 @@ "minicraft.tutorial.getting_workbench": "Obtenir un établi", "minicraft.tutorial.getting_workbench.description": "Construisez un établi depuis le menu de fabrication. Placez-le juste après.", "minicraft.tutorial.start_getting_wood": "Le commencement", - "minicraft.tutorial.start_getting_wood.description": "Frapper des arbres en continu pour avoir du bois.", - "minicraft.display.options_display.language": "Langue", - "minicraft.display.options_display.resource_packs": "Packs de ressources", - "minicraft.displays.language_settings.title": "Langue...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Fleche", - "String": "Fil", - "Glass": "Verre", - "Cloth": "Chiffon" + "minicraft.tutorial.start_getting_wood.description": "Frapper des arbres en continu pour avoir du bois." } diff --git a/src/client/resources/assets/localization/hu-hu.json b/src/client/resources/assets/localization/hu-hu.json index 11b7354e9..e29b7f8f4 100644 --- a/src/client/resources/assets/localization/hu-hu.json +++ b/src/client/resources/assets/localization/hu-hu.json @@ -1,473 +1,195 @@ { - "minicraft.achievement.woodcutter": "Favágó", - "minicraft.achievement.woodcutter.desc": "Szerezd meg a fát", - "minicraft.achievement.benchmarking": "Ideje munkához látni!", - "minicraft.achievement.benchmarking.desc": "Készítsen egy munkapadot.", - "minicraft.achievement.upgrade": "Frissítés!", - "minicraft.achievement.upgrade.desc": "Készítsen bármilyen kőszerszámot.", - "minicraft.achievement.bow": "Hajoljatok meg előttem!", - "minicraft.achievement.bow.desc": "Lőj ki egy nyilat egy íjjal.", - "minicraft.achievement.fish": "Menjetek horgászni!", - "minicraft.achievement.fish.desc": "Szerezz egy halat", - "minicraft.achievement.doors": "Adooring védelem", - "minicraft.achievement.doors.desc": "Készítsen egy faajtót.", - "minicraft.achievement.planks": "Sétálj a deszkákon!", - "minicraft.achievement.planks.desc": "Fadeszkák készítése.", - "minicraft.achievement.clothes": "Legyen színes a napod!", - "minicraft.achievement.clothes.desc": "Készíts bármilyen színű ruhát", - "minicraft.achievement.demolition": "Dinamitát", - "minicraft.achievement.demolition.desc": "Használj Dinamitát.", - "minicraft.achievement.survive_darkness": "Félsz a sötétségtől?", - "minicraft.achievement.survive_darkness.desc": "Túlélni 5 percet teljes sötétségben.", - "minicraft.achievement.lava": "Forró ügyek", - "minicraft.achievement.lava.desc": "Használj lávaitalt a lávában való úszáshoz", - "minicraft.achievement.find_gem": "Oooh Shiny!", - "minicraft.achievement.find_gem.desc": "Találd meg a Gem Ore-t és bányászd ki.", - "minicraft.achievement.lowest_caves": "Sötétség a fény mögött", - "minicraft.achievement.lowest_caves.desc": "Elérni a legalacsonyabb barlangokat.", - "minicraft.achievement.obsidian_dungeon": "Of Knights and Men", - "minicraft.achievement.obsidian_dungeon.desc": "Érje el az obszidiánbörtönt.", - "minicraft.achievement.airwizard": "Győzd le... a levegőt?", - "minicraft.achievement.airwizard.desc": "Győzd le az első légvarázslót!", - "minicraft.achievement.skin": "Divatbemutató", - "minicraft.achievement.skin.desc": "Változtassa meg a bőrét.", - "minicraft.display.entries.boolean.false": "", - "minicraft.display.entries.boolean.true": "", - "minicraft.display.gui.link_opening": "", - "minicraft.display.gui.perm_status.saving": "", - "minicraft.display.gui.perm_status.sleep_cancel": "", - "minicraft.display.gui.perm_status.sleeping": "", - "minicraft.display.gui.potion_effects.hide_hint": "", - "minicraft.display.gui.potion_effects.potion_dur": "", - "minicraft.display.gui.score.current_score": "", - "minicraft.display.gui.score.time_left": "", - "minicraft.display.menus.inventory": "", - "minicraft.display.options_display": "", - "minicraft.display.options_display.change_key_bindings": "", - "minicraft.display.popup.enter_confirm": "Enter ha jó", - "minicraft.display.popup.escape_cancel": "Escape a visszamenéshez", - "minicraft.display.popup.title_confirm": "", - "minicraft.displays.achievements": "", - "minicraft.displays.achievements.display.achieved": "", - "minicraft.displays.achievements.display.help": "", - "minicraft.displays.achievements.display.not_achieved": "", - "minicraft.displays.achievements.display.score": "", - "minicraft.displays.book.default_book": "", - "minicraft.displays.crafting": "", - "minicraft.displays.crafting.container_title.cost": "", - "minicraft.displays.crafting.container_title.have": "", - "minicraft.displays.end_game.display.bonuses": "", - "minicraft.displays.end_game.display.final_score": "", - "minicraft.displays.end_game.display.player_score": "", - "minicraft.displays.end_game.display.unlocked": "", - "minicraft.displays.end_game.exit": "", - "minicraft.displays.info.display.exit_help": "", - "minicraft.displays.info.display.score": "", - "minicraft.displays.info.display.time": "", - "minicraft.displays.info.title": "", - "minicraft.displays.key_input.display.help.0": "", - "minicraft.displays.key_input.display.help.1": "", - "minicraft.displays.key_input.display.help.2": "", - "minicraft.displays.key_input.display.help.3": "", - "minicraft.displays.key_input.popup_display.confirm_reset": "", - "minicraft.displays.key_input.popup_display.press_key_sequence": "", - "minicraft.displays.key_input.title": "", - "minicraft.displays.loading.message.entities": "", - "minicraft.displays.loading.message.generating": "", - "minicraft.displays.loading.message.level": "", - "minicraft.displays.loading.message.levels": "", - "minicraft.displays.loading.message.loading": "", - "minicraft.displays.loading.message.saving": "", - "minicraft.displays.loading.message.world": "", - "minicraft.displays.options_main_menu": "", - "minicraft.displays.options_main_menu.resource_packs": "", - "minicraft.displays.options_world": "", - "minicraft.displays.options_world.off_tutorials_confirm_popup": "", - "minicraft.displays.options_world.turn_off_tutorials": "", - "minicraft.displays.pause": "", - "minicraft.displays.pause.display.exit_popup.0": "", - "minicraft.displays.pause.display.exit_popup.1": "", - "minicraft.displays.pause.display.exit_popup.cancel": "", - "minicraft.displays.pause.display.exit_popup.quit": "", - "minicraft.displays.pause.display.help.choose": "", - "minicraft.displays.pause.display.help.scroll": "", - "minicraft.displays.pause.menu": "", - "minicraft.displays.pause.return": "", - "minicraft.displays.pause.save": "", - "minicraft.displays.player_death.display.score": "", - "minicraft.displays.player_death.display.time": "", - "minicraft.displays.player_death.quit": "", - "minicraft.displays.player_death.respawn": "", - "minicraft.displays.player_death.save_quit": "", - "minicraft.displays.player_death.title": "", - "minicraft.displays.player_inv.container_title.items": "", - "minicraft.displays.player_inv.display.help": "", - "minicraft.displays.quests": "", - "minicraft.displays.quests.display.header.completed": "", - "minicraft.displays.quests.display.header.unlocked": "", - "minicraft.displays.quests.display.no_quest_desc": "", - "minicraft.displays.resource_packs.display.help.move": "", - "minicraft.displays.resource_packs.display.help.select": "", - "minicraft.displays.resource_packs.display.help.position": "", - "minicraft.displays.resource_packs.display.title": "", - "minicraft.displays.skin": "", - "minicraft.displays.skin.display.help.move": "", - "minicraft.displays.skin.display.help.select": "", - "minicraft.displays.title.display.cannot_check": "", - "minicraft.displays.title.display.checking": "", - "minicraft.displays.title.display.help.0": "", - "minicraft.displays.title.display.help.1": "", - "minicraft.displays.title.display.help.2": "", - "minicraft.displays.title.display.latest_already": "", - "minicraft.displays.title.display.new_version": "", - "minicraft.displays.title.display.version": "", - "minicraft.displays.title.help": "", - "minicraft.displays.title.help.about": "", - "minicraft.displays.title.help.credits": "", - "minicraft.displays.title.help.instructions": "", - "minicraft.displays.title.help.storyline_guide": "", - "minicraft.displays.title.link_to_version": "", - "minicraft.displays.title.play": "", - "minicraft.displays.title.play.load_world": "", - "minicraft.displays.title.play.new_world": "", - "minicraft.displays.title.quit": "", - "minicraft.displays.title.select_to_download": "", - "minicraft.displays.world_gen.create_world": "", - "minicraft.displays.world_gen.enter_world": "", - "minicraft.displays.world_gen.title": "", - "minicraft.displays.world_gen.troublesome_input": "", - "minicraft.displays.world_gen.troublesome_input.msg": "", - "minicraft.displays.world_gen.world_seed": "", - "minicraft.displays.world_select.display.help.0": "", - "minicraft.displays.world_select.display.help.1": "", - "minicraft.displays.world_select.display.help.2": "", - "minicraft.displays.world_select.display.help.3": "", - "minicraft.displays.world_select.display.help.4": "", - "minicraft.displays.world_select.display.world_too_new": "", - "minicraft.displays.world_select.display.world_version": "", - "minicraft.displays.world_select.popups.display.cancel": "", - "minicraft.displays.world_select.popups.display.change": "", - "minicraft.displays.world_select.popups.display.confirm": "", - "minicraft.displays.world_select.popups.display.delete": "", - "minicraft.displays.world_select.select_world": "", - "minicraft.notification.achievement_unlocked": "Elérés feloldva:", - "minicraft.notification.air_wizard_defeated": "", - "minicraft.notification.cannot_sleep": "", - "minicraft.notification.death_chest_retrieved": "", - "minicraft.notification.defeat_air_wizard_first": "", - "minicraft.notification.dig_hole": "Először áss egy gödröt!", - "minicraft.notification.dungeon_opened": "", - "minicraft.notification.gem_pickaxe_required": "", - "minicraft.notification.invalid_placement": "Csak a következőkre helyezhető el", - "minicraft.notification.quest_completed": "", - "minicraft.notification.quest_unlocked": "", - "minicraft.notification.world_saved": "", - "minicraft.notification.wrong_level_sky": "", - "minicraft.settings.fps": "", - "minicraft.settings.difficulty": "", - "minicraft.settings.difficulty.easy": "", - "minicraft.settings.difficulty.normal": "", - "minicraft.settings.difficulty.hard": "", - "minicraft.settings.mode": "", - "minicraft.settings.mode.survival": "", - "minicraft.settings.mode.creative": "", - "minicraft.settings.mode.hardcore": "", - "minicraft.settings.mode.score": "", - "minicraft.settings.scoretime": "", - "minicraft.settings.screenshot_scale": "", - "minicraft.settings.sound": "", - "minicraft.settings.autosave": "", - "minicraft.settings.size": "", - "minicraft.settings.theme": "", - "minicraft.settings.theme.normal": "", - "minicraft.settings.theme.forest": "", - "minicraft.settings.theme.desert": "", - "minicraft.settings.theme.plain": "", - "minicraft.settings.theme.hell": "", - "minicraft.settings.type": "", - "minicraft.settings.type.island": "", - "minicraft.settings.type.box": "", - "minicraft.settings.type.mountain": "", - "minicraft.settings.type.irregular": "", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul with cape", - "minicraft.skin.minecraft_steve": "Familiar boy", - "minicraft.skin.minecraft_alex": "Familiar girl", - "minicraft.text_particales.key_consumed": "", - "Death Chest": "Halálláda", - "Player": "Játékos", - "Leather Armor": "Bőrpáncél", - "Snake Armor": "Kígyópáncél", - "Iron Armor": "Vaspáncél", - "Gold Armor": "Aranypáncél", - "Gem Armor": "Kristálypáncél", - "Book": "Könyv", + "Acorn": "Makk", + "AirWizard Spawner": "Levegővarázsló idéző", "Antidious": "Antidious", - "Empty Bucket": "Üres vödör", - "Water Bucket": "Vizesvödör", - "Lava Bucket": "Lávásvödör", - "Red Clothes": "Piros ruha", - "Blue Clothes": "Kék ruha", - "Green Clothes": "Zöld ruha", - "Yellow Clothes": "Sárga ruha", + "Anvil": "Üllő", + "Apple": "Alma", + "Arrow": "Nyíl", + "Axe": "Balta", + "Baked Potato": "Sült burgonya", + "Bed": "Ágy", "Black Clothes": "Fekete ruha", - "Orange Clothes": "Narancssárga ruha", - "Purple Clothes": "Lila ruha", - "Cyan Clothes": "Cián ruha", - "Reg Clothes": "Reg ruha", + "Black Wool": "Fekete gyapjú", + "Blue Clothes": "Kék ruha", + "Blue Wool": "Kék gyapjú", + "Bone": "Csont", + "Book": "Könyv", + "Bow": "Íj", "Bread": "Kenyér", - "Apple": "Alma", - "Raw Pork": "Nyers disznóhús", - "Raw Fish": "Nyers hal", - "Raw Beef": "Nyers marhahús", - "Pork Chop": "Sült disznóhús", + "Cactus": "Kaktusz", + "Cactus Sapling": "Kaktuszcsemete", + "Chest": "Láda", + "Claymore": "Nagykard", + "Cloth": "Szövet", + "Cloud": "Felhő", + "Cloud Cactus": "Felhőkaktusz", + "Coal": "Szén", "Cooked Fish": "Sült hal", "Cooked Pork": "Sült marhahús", - "Steak": "Steak", - "Gold Apple": "Aranyalma", - "Baked Potato": "Sült burgonya", "Cow Spawner": "Tehén idéző", - "Pig Spawner": "Malac idéző", - "Sheep Spawner": "Bárány idéző", - "Slime Spawner": "Nyálka idéző", - "Zombie Spawner": "Zombi idéző", "Creeper Spawner": "Creeper idéző", - "Skeleton Spawner": "Csontváz idéző", - "Snake Spawner": "Kígyó idéző", - "Knight Spawner": "Lovag idéző", - "AirWizard Spawner": "Levegővarázsló idéző", - "Workbench": "Barkácsaztal", - "Oven": "Sütő", - "Furnace": "Kemence", - "Anvil": "Üllő", + "Cyan Clothes": "Cián ruha", + "Death Chest": "Halálláda", + "Dirt": "Föld", + "Empty Bucket": "Üres vödör", "Enchanter": "Varázsoló", - "Loom": "Szövőszék", - "Lantern": "Lámpa", - "Iron Lantern": "Vaslámpa", - "Gold Lantern": "Aranylámpa", - "Tnt": "TNT", - "Bed": "Ágy", - "Chest": "Láda", - "None Potion": "Haszontalan bájital", - "Speed Potion": "Gyorsaság bájital", - "Light Potion": "Fény bájital", - "Swim Potion": "Úszás bájital", "Energy Potion": "Energia bájital", - "Regen Potion": "Regenálódás bájital", - "Health Potion": "Élet bájital", - "Time Potion": "Idő bájital", - "Lava Potion": "Tűz bájital", - "Shield Potion": "Pajzs bájital", - "Haste Potion": "Sietség bájital", "Escape Potion": "Kijutás bájital", - "Potion": "Bájital", - "Power Glove": "Érőkesztyű", - "Wood": "Fa", - "Stone": "Kő", - "Leather": "Bőr", - "Wheat": "Búza", - "Key": "Kulcs", - "Coal": "Szén", - "Iron Ore": "Vasérc", - "Gold Ore": "Aranyérc", + "Explode": "Felrobban", + "Farmland": "Termőföld", + "Flower": "Virág", + "Furnace": "Kemence", + "Gem": "Kristály", + "Gem Armor": "Kristálypáncél", + "Gem Fishing Rod": "Kristály horgászbot", "Gem Ore": "Kristályérc", - "Cloud Ore": "", - "Iron": "Vas", + "Glass": "Üveg", "Gold": "Arany", - "Lapis": "Lazurit", - "Rose": "Rózsa", + "Gold Apple": "Aranyalma", + "Gold Armor": "Aranypáncél", + "Gold Fishing Rod": "Arany horgászbot", + "Gold Lantern": "Aranylámpa", + "Gold Ore": "Aranyérc", + "Grass": "Fű", + "Grass Seeds": "Fűmag", + "Green Clothes": "Zöld ruha", + "Green Wool": "Zöld gyapjú", "Gunpowder": "Puskapor", - "Slime": "Nyálka", - "Scale": "Pikkely", - "Shard": "Szilánk", - "Flower": "Virág", - "Acorn": "Makk", - "Dirt": "Föld", + "Hard Rock": "Nehéz kő", + "Haste Potion": "Sietség bájital", + "Health Potion": "Élet bájital", + "Hoe": "Kapa", + "Hole": "Lyuk", + "Infinite Fall": "Végtelen esés", + "Iron": "Vas", + "Iron Armor": "Vaspáncél", + "Iron Fishing Rod": "Vas horgászbot", + "Iron Lantern": "Vaslámpa", + "Iron Ore": "Vasérc", + "Key": "Kulcs", + "Knight Spawner": "Lovag idéző", + "Lantern": "Lámpa", + "Lapis": "Lazurit", + "Lava": "Láva", + "Lava Brick": "Lávatégla", + "Lava Bucket": "Lávásvödör", + "Lava Potion": "Tűz bájital", + "Leather": "Bőr", + "Leather Armor": "Bőrpáncél", + "Light Potion": "Fény bájital", + "Loom": "Szövőszék", "Natural Rock": "természetes kőzet", - "Plank": "Deszka", - "Plank Wall": "Deszkafal", - "Wood Door": "Faajtó", - "Stone Brick": "Kőtégla", - "Ornate Stone": "Díszes kő", - "Stone Wall": "Kőfal", - "Stone Door": "Kő ajtó", + "None Potion": "Haszontalan bájital", + "Obsidian": "Obszidián", "Obsidian Brick": "Obszidián tégla", - "Ornate Obsidian": "Díszes obszidián", - "Obsidian Wall": "Obszidián fal", "Obsidian Door": "Oszidián ajtó", - "Wool": "Gyapjú", + "Obsidian Wall": "Obszidián fal", + "Orange Clothes": "Narancssárga ruha", + "Ornate Obsidian": "Díszes obszidián", + "Ornate Stone": "Díszes kő", + "Oven": "Sütő", + "Pickaxe": "Csákány", + "Pig Spawner": "Malac idéző", + "Plank": "Deszka", + "Plank Wall": "Deszkafal", + "Player": "Játékos", + "Pork Chop": "Sült disznóhús", + "Potato": "Burgonya", + "Potion": "Bájital", + "Power Glove": "Érőkesztyű", + "Purple Clothes": "Lila ruha", + "Raw Beef": "Nyers marhahús", + "Raw Fish": "Nyers hal", + "Raw Pork": "Nyers disznóhús", + "Red Clothes": "Piros ruha", "Red Wool": "Piros gyapjú", - "Blue Wool": "Kék gyapjú", - "Green Wool": "Zöld gyapjú", - "Yellow Wool": "Sárga gyapjú", - "Black Wool": "Fekete gyapjú", + "Reg Clothes": "Reg ruha", + "Regen Potion": "Regenálódás bájital", + "Rock": "kő", + "Rose": "Rózsa", "Sand": "Homok", - "Cactus": "Kaktusz", + "Scale": "Pikkely", "Seeds": "Vetőmag", - "Wheat Seeds": "Búza vetőmagok", - "Grass Seeds": "Fűmag", - "Bone": "Csont", - "Cloud": "Felhő", - "Rock": "kő", - "Gem": "Kristály", - "Potato": "Burgonya", - "Wood Fishing Rod": "Fa horgászbot", - "Iron Fishing Rod": "Vas horgászbot", - "Gold Fishing Rod": "Arany horgászbot", - "Gem Fishing Rod": "Kristály horgászbot", + "Shard": "Szilánk", + "Shears": "olló", + "Sheep Spawner": "Bárány idéző", + "Shield Potion": "Pajzs bájital", "Shovel": "Ásó", - "Hoe": "Kapa", + "Skeleton Spawner": "Csontváz idéző", + "Slime": "Nyálka", + "Slime Spawner": "Nyálka idéző", + "Snake Armor": "Kígyópáncél", + "Snake Spawner": "Kígyó idéző", + "Speed Potion": "Gyorsaság bájital", + "Stairs Down": "Lefelé vezető lépcső", + "Stairs Up": "Felfelé vezető lépcső", + "Steak": "Steak", + "Stone": "Kő", + "Stone Brick": "Kőtégla", + "Stone Bricks": "Kőtégla", + "Stone Door": "Kő ajtó", + "Stone Wall": "Kőfal", + "String": "Fonál", + "Swim Potion": "Úszás bájital", "Sword": "Kard", - "Pickaxe": "Csákány", - "Axe": "Balta", - "Bow": "Íj", - "Claymore": "Nagykard", - "Shears": "olló", + "Time Potion": "Idő bájital", + "Tnt": "TNT", "Torch": "Fáklya", - "Wood Planks": "Fadeszka", - "Stone Bricks": "Kőtégla", - "Obsidian": "Obszidián", - "Wood Wall": "Fafal", - "Grass": "Fű", - "Hole": "Lyuk", - "Stairs Up": "Felfelé vezető lépcső", - "Stairs Down": "Lefelé vezető lépcső", - "Water": "Víz", "Tree": "Fa", "Tree Sapling": "Facsemete", - "Cactus Sapling": "Kaktuszcsemete", - "Lava": "Láva", - "Lava Brick": "Lávatégla", - "Explode": "Felrobban", - "Farmland": "Termőföld", - "Hard Rock": "Nehéz kő", - "Infinite Fall": "Végtelen esés", - "Cloud Cactus": "Felhőkaktusz", - "Raw Obsidian": "", - "Totem of Air": "", - "minicraft.control_guide.attack": "", - "minicraft.control_guide.craft": "", - "minicraft.control_guide.menu": "", - "minicraft.control_guide.move": "", - "minicraft.displays.controls": "", - "minicraft.displays.controls.display.controller": "", - "minicraft.displays.controls.display.controller.00": "", - "minicraft.displays.controls.display.controller.01": "", - "minicraft.displays.controls.display.controller.02": "", - "minicraft.displays.controls.display.controller.03": "", - "minicraft.displays.controls.display.controller.04": "", - "minicraft.displays.controls.display.controller.05": "", - "minicraft.displays.controls.display.controller.06": "", - "minicraft.displays.controls.display.controller.07": "", - "minicraft.displays.controls.display.controller.08": "", - "minicraft.displays.controls.display.controller.09": "", - "minicraft.displays.controls.display.controller.10": "", - "minicraft.displays.controls.display.controller.11": "", - "minicraft.displays.controls.display.controller.12": "", - "minicraft.displays.controls.display.controller.13": "", - "minicraft.displays.controls.display.controller.14": "", - "minicraft.displays.controls.display.controller.15": "", - "minicraft.displays.controls.display.controller.desc.0": "", - "minicraft.displays.controls.display.controller.desc.1": "", - "minicraft.displays.controls.display.help.0": "", - "minicraft.displays.controls.display.keyboard": "", - "minicraft.displays.controls.display.keyboard.00": "", - "minicraft.displays.controls.display.keyboard.01": "", - "minicraft.displays.controls.display.keyboard.02": "", - "minicraft.displays.controls.display.keyboard.03": "", - "minicraft.displays.controls.display.keyboard.04": "", - "minicraft.displays.controls.display.keyboard.05": "", - "minicraft.displays.controls.display.keyboard.06": "", - "minicraft.displays.controls.display.keyboard.07": "", - "minicraft.displays.controls.display.keyboard.08": "", - "minicraft.displays.controls.display.keyboard.09": "", - "minicraft.displays.controls.display.keyboard.10": "", - "minicraft.displays.controls.display.keyboard.11": "", - "minicraft.displays.controls.display.keyboard.12": "", - "minicraft.displays.controls.display.keyboard.13": "", - "minicraft.displays.controls.display.keyboard.14": "", - "minicraft.displays.controls.display.keyboard.15": "", - "minicraft.displays.controls.display.keyboard.16": "", - "minicraft.displays.controls.display.keyboard.17": "", - "minicraft.displays.controls.display.keyboard.18": "", - "minicraft.displays.controls.display.keyboard.19": "", - "minicraft.displays.controls.display.keyboard.20": "", - "minicraft.displays.controls.display.keyboard.21": "", - "minicraft.displays.controls.display.keyboard.22": "", - "minicraft.displays.controls.display.keyboard.desc": "", - "minicraft.displays.loading.message.dungeon_regeneration": "", - "minicraft.displays.loading.message.quests": "", - "minicraft.displays.loading.regeneration_popup.display.0": "", - "minicraft.displays.loading.regeneration_popup.display.1": "", - "minicraft.displays.loading.regeneration_popup.display.2": "", - "minicraft.displays.loading.regeneration_popup.display.3": "", - "minicraft.displays.loading.regeneration_popup.display.4": "", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "", - "minicraft.displays.quests.display.no_quest": "", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", - "minicraft.notification.obsidian_knight_defeated": "", - "minicraft.notification.obsidian_knight_awoken": "", - "minicraft.notification.defeat_obsidian_knight_first": "", - "minicraft.notification.wrong_level_dungeon": "", - "minicraft.notification.boss_limit": "", - "minicraft.notification.spawn_on_boss_tile": "", - "minicraft.notifications.statue_tapped": "", - "minicraft.notifications.statue_touched": "", - "minicraft.quest.farming": "", - "minicraft.quest.farming.crafting_hoe": "", - "minicraft.quest.farming.crafting_hoe.description": "", - "minicraft.quest.farming.description": "", - "minicraft.quest.farming.getting_wheat": "", - "minicraft.quest.farming.getting_wheat.description": "", - "minicraft.quest.farming.making_farmland": "", - "minicraft.quest.farming.making_farmland.description": "", - "minicraft.quest.farming.planting_potato": "", - "minicraft.quest.farming.planting_potato.description": "", - "minicraft.quest.farming.planting_wheat": "", - "minicraft.quest.farming.planting_wheat.description": "", - "minicraft.quest.gems": "", - "minicraft.quest.gems.description": "", - "minicraft.quest.gems.gem_armor": "", - "minicraft.quest.gems.gem_armor.description": "", - "minicraft.quest.gems.gem_claymore": "", - "minicraft.quest.gems.gem_claymore.description": "", - "minicraft.quest.iron_equipments": "", - "minicraft.quest.iron_equipments.description": "", - "minicraft.quest.iron_equipments.getting_more_iron": "", - "minicraft.quest.iron_equipments.getting_more_iron.description": "", - "minicraft.quest.iron_equipments.iron_armor": "", - "minicraft.quest.iron_equipments.iron_armor.description": "", - "minicraft.quest.iron_equipments.iron_tools": "", - "minicraft.quest.iron_equipments.iron_tools.description": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", - "minicraft.quest.potions": "", - "minicraft.quest.potions.all_potions_prepared": "", - "minicraft.quest.potions.all_potions_prepared.description": "", - "minicraft.quest.potions.awkward_potions": "", - "minicraft.quest.potions.awkward_potions.description": "", - "minicraft.quest.potions.description": "", - "minicraft.quest.potions.powerful_potions": "", - "minicraft.quest.potions.powerful_potions.description": "", - "minicraft.tutorial.getting_rocks": "", - "minicraft.tutorial.getting_rocks.description": "", - "minicraft.tutorial.getting_wood": "", - "minicraft.tutorial.getting_wood.description": "", - "minicraft.tutorial.getting_wooden_pickaxe": "", - "minicraft.tutorial.getting_wooden_pickaxe.description": "", - "minicraft.tutorial.getting_workbench": "", - "minicraft.tutorial.getting_workbench.description": "", - "minicraft.tutorial.start_getting_wood": "", - "minicraft.tutorial.start_getting_wood.description": "", - "minicraft.display.options_display.language": "", - "minicraft.display.options_display.resource_packs": "", - "minicraft.displays.language_settings.title": "", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Nyíl", - "String": "Fonál", - "Glass": "Üveg", - "Cloth": "Szövet" + "Water": "Víz", + "Water Bucket": "Vizesvödör", + "Wheat": "Búza", + "Wheat Seeds": "Búza vetőmagok", + "Wood": "Fa", + "Wood Door": "Faajtó", + "Wood Fishing Rod": "Fa horgászbot", + "Wood Planks": "Fadeszka", + "Wood Wall": "Fafal", + "Wool": "Gyapjú", + "Workbench": "Barkácsaztal", + "Yellow Clothes": "Sárga ruha", + "Yellow Wool": "Sárga gyapjú", + "Zombie Spawner": "Zombi idéző", + "minicraft.achievement.airwizard": "Győzd le... a levegőt?", + "minicraft.achievement.airwizard.desc": "Győzd le az első légvarázslót!", + "minicraft.achievement.benchmarking": "Ideje munkához látni!", + "minicraft.achievement.benchmarking.desc": "Készítsen egy munkapadot.", + "minicraft.achievement.bow": "Hajoljatok meg előttem!", + "minicraft.achievement.bow.desc": "Lőj ki egy nyilat egy íjjal.", + "minicraft.achievement.clothes": "Legyen színes a napod!", + "minicraft.achievement.clothes.desc": "Készíts bármilyen színű ruhát", + "minicraft.achievement.demolition": "Dinamitát", + "minicraft.achievement.demolition.desc": "Használj Dinamitát.", + "minicraft.achievement.doors": "Adooring védelem", + "minicraft.achievement.doors.desc": "Készítsen egy faajtót.", + "minicraft.achievement.find_gem": "Oooh Shiny!", + "minicraft.achievement.find_gem.desc": "Találd meg a Gem Ore-t és bányászd ki.", + "minicraft.achievement.fish": "Menjetek horgászni!", + "minicraft.achievement.fish.desc": "Szerezz egy halat", + "minicraft.achievement.lava": "Forró ügyek", + "minicraft.achievement.lava.desc": "Használj lávaitalt a lávában való úszáshoz", + "minicraft.achievement.lowest_caves": "Sötétség a fény mögött", + "minicraft.achievement.lowest_caves.desc": "Elérni a legalacsonyabb barlangokat.", + "minicraft.achievement.obsidian_dungeon": "Of Knights and Men", + "minicraft.achievement.obsidian_dungeon.desc": "Érje el az obszidiánbörtönt.", + "minicraft.achievement.planks": "Sétálj a deszkákon!", + "minicraft.achievement.planks.desc": "Fadeszkák készítése.", + "minicraft.achievement.skin": "Divatbemutató", + "minicraft.achievement.skin.desc": "Változtassa meg a bőrét.", + "minicraft.achievement.survive_darkness": "Félsz a sötétségtől?", + "minicraft.achievement.survive_darkness.desc": "Túlélni 5 percet teljes sötétségben.", + "minicraft.achievement.upgrade": "Frissítés!", + "minicraft.achievement.upgrade.desc": "Készítsen bármilyen kőszerszámot.", + "minicraft.achievement.woodcutter": "Favágó", + "minicraft.achievement.woodcutter.desc": "Szerezd meg a fát", + "minicraft.display.popup.enter_confirm": "Enter ha jó", + "minicraft.display.popup.escape_cancel": "Escape a visszamenéshez", + "minicraft.notification.achievement_unlocked": "Elérés feloldva:", + "minicraft.notification.dig_hole": "Először áss egy gödröt!", + "minicraft.notification.invalid_placement": "Csak a következőkre helyezhető el", + "minicraft.skin.minecraft_alex": "Familiar girl", + "minicraft.skin.minecraft_steve": "Familiar boy", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul with cape" } diff --git a/src/client/resources/assets/localization/id-id.json b/src/client/resources/assets/localization/id-id.json index 9ad6fdd00..7c646caa4 100644 --- a/src/client/resources/assets/localization/id-id.json +++ b/src/client/resources/assets/localization/id-id.json @@ -1,36 +1,195 @@ { - "minicraft.achievement.woodcutter": "Penebang", - "minicraft.achievement.woodcutter.desc": "Dapatkan kayu.", + "Acorn": "Biji Pohon", + "AirWizard Spawner": "Pemijahan PenyihirUdara", + "Antidious": "Antidious", + "Anvil": "Landasan", + "Apple": "Apel", + "Arrow": "Anak panah", + "Axe": "Kapak", + "Baked Potato": "Kentang Panggang", + "Bed": "Tempat tidur", + "Black Clothes": "Pakaian Item", + "Black Wool": "Wol Item", + "Blue Clothes": "Pakaian Biru", + "Blue Wool": "Wol Biru", + "Bone": "Tulang", + "Book": "Buku", + "Bow": "Busur", + "Bread": "Roti", + "Cactus": "Kaktus", + "Cactus Sapling": "Kaktus Muda", + "Chest": "Peti", + "Claymore": "Claymore", + "Cloth": "Kain", + "Cloud": "Awan", + "Cloud Cactus": "Kaktus Awan", + "Cloud Ore": "Bijih Awan", + "Coal": "Batu Bara", + "Cooked Fish": "Ikan Matang", + "Cooked Pork": "Daging Babi Matang", + "Cow Spawner": "Pemijahan Sapi", + "Creeper Spawner": "Pemijahan Creeper", + "Cyan Clothes": "Pakaian Cyan", + "Death Chest": "Peti Mati", + "Dirt": "Tanah", + "Empty Bucket": "Ember Kosong", + "Enchanter": "Enchanter", + "Energy Potion": "Ramuan Energi", + "Escape Potion": "Ramuan Melarikan Diri", + "Explode": "Meledak", + "Farmland": "Tanah Pertanian", + "Flower": "Bunga", + "Furnace": "Perapian", + "Gem": "Gem", + "Gem Armor": "Armor Gem", + "Gem Fishing Rod": "Pancing Gem", + "Gem Ore": "Bijih Gem", + "Glass": "Kaca", + "Gold": "Emas", + "Gold Apple": "Apel Emas", + "Gold Armor": "Armor Emas", + "Gold Fishing Rod": "Pancing Emas", + "Gold Lantern": "Lentera Emas", + "Gold Ore": "Bijih Emas", + "Grass": "Rumput", + "Grass Seeds": "Bibit Rumput", + "Green Clothes": "Pakaian Ijo", + "Green Wool": "Wol Ijo", + "Gunpowder": "Bubuk Mesiu", + "Hard Rock": "Batu Keras", + "Haste Potion": "Ramuan Tergesa-gesa", + "Health Potion": "Ramuan Darah", + "Hoe": "Cankul", + "Hole": "Lubang", + "Infinite Fall": "Jatuh Tak Terbatas", + "Iron": "Besi", + "Iron Armor": "Armor Besi", + "Iron Fishing Rod": "Pancing Besi", + "Iron Lantern": "Lentera Besi", + "Iron Ore": "Bijih Besi", + "Key": "Kunci", + "Knight Spawner": "Pemijahan Kesatria", + "Lantern": "Lentera", + "Lapis": "Lapis", + "Lava": "Lava", + "Lava Brick": "Bata Lava", + "Lava Bucket": "Ember Lava", + "Lava Potion": "Ramuan Lava", + "Leather": "Kulit", + "Leather Armor": "Armor Kulit", + "Light Potion": "Ramuan Ringan", + "Loom": "Mesin Tenun", + "Natural Rock": "Batu Alam", + "None Potion": "Ramuan Kosong", + "Obsidian": "Obsidian", + "Obsidian Brick": "Bata Obsidian", + "Obsidian Door": "Pintu Obsidian", + "Obsidian Wall": "Dinding Obsidian", + "Orange Clothes": "Pakaian Oranye", + "Ornate Obsidian": "Obsidian hiasan", + "Ornate Stone": "Batu Hiasan", + "Oven": "Oven", + "Pickaxe": "Beliung", + "Pig Spawner": "Pemijahan Babi", + "Plank": "Papan", + "Plank Wall": "Dinding Papan", + "Player": "Pemain", + "Pork Chop": "Daging Babi", + "Potato": "Kentang", + "Potion": "Ramuan", + "Power Glove": "Sarung Tangan Kekuatan", + "Purple Clothes": "Pakaian Ungu", + "Raw Beef": "Daging Mentah", + "Raw Fish": "Ikan Mentah", + "Raw Obsidian": "Obsidian Mentah", + "Raw Pork": "Babi Mentah", + "Red Clothes": "Pakaian Merah", + "Red Wool": "Wol Merah", + "Reg Clothes": "Pakaian Reguler", + "Regen Potion": "Ramuan Regen", + "Rock": "Batu", + "Rose": "Bunga Mawar", + "Sand": "Pasir", + "Scale": "Skala", + "Seeds": "Biji", + "Shard": "Beling", + "Shears": "Sepasang gunting", + "Sheep Spawner": "Pemijahan Kambing", + "Shield Potion": "Ramuan Perisai", + "Shovel": "Sekop", + "Skeleton Spawner": "Pemijahan Skeleton", + "Slime": "Lendir", + "Slime Spawner": "Pemijahan Slime", + "Snake Armor": "Armor Ular", + "Snake Spawner": "Pemijahan Ular", + "Speed Potion": "Ramuan Kecepatan", + "Stairs Down": "Tangga Turun", + "Stairs Up": "Tangga Naik", + "Steak": "Daging Panggang", + "Stone": "Batu", + "Stone Brick": "Batu Bata", + "Stone Bricks": "Batu Bata", + "Stone Door": "Pintu Batu", + "Stone Wall": "Dinding Batu", + "String": "Benang", + "Swim Potion": "Ramuan Berenang", + "Sword": "Pedang", + "Time Potion": "Ramuan Waktu", + "Tnt": "Tnt", + "Torch": "Obor", + "Totem of Air": "Totem Udara", + "Tree": "Pohon", + "Tree Sapling": "Pohon Muda", + "Water": "Air", + "Water Bucket": "Ember Air", + "Wheat": "Gandum", + "Wheat Seeds": "Biji Gandum", + "Wood": "Kayu", + "Wood Door": "Pintu Kayu", + "Wood Fishing Rod": "Pancing Kayu", + "Wood Planks": "Papan Kayu", + "Wood Wall": "Dinding Kayu", + "Wool": "Wol", + "Workbench": "Meja Kerja", + "Yellow Clothes": "Pakaian Kuning", + "Yellow Wool": "Wol Kuning", + "Zombie Spawner": "Pemijahan Zombie", + "minicraft.achievement.airwizard": "Mengalahkan... udara?", + "minicraft.achievement.airwizard.desc": "Kalahkan Penyihir Angin pertama!", "minicraft.achievement.benchmarking": "Bekerja", "minicraft.achievement.benchmarking.desc": "Membuat meja kerja.", - "minicraft.achievement.upgrade": "Meningkatkan!", - "minicraft.achievement.upgrade.desc": "Buat alat Batu apa saja.", "minicraft.achievement.bow": "Tunduk padaku!", "minicraft.achievement.bow.desc": "Menembak anak panah dengan busur.", - "minicraft.achievement.fish": "Pergi Ikan!", - "minicraft.achievement.fish.desc": "Memancing Ikan!", - "minicraft.achievement.doors": "Perlindungan Pintu", - "minicraft.achievement.doors.desc": "Buat pintu kayu.", - "minicraft.achievement.planks": "Berjalan di Papan!", - "minicraft.achievement.planks.desc": "Kerajinan papan kayu.", "minicraft.achievement.clothes": "Semoga harimu penuh warna!", "minicraft.achievement.clothes.desc": "Buat warna pakaian apa saja", "minicraft.achievement.demolition": "Pembongkaran", "minicraft.achievement.demolition.desc": "Gunakan TNT.", - "minicraft.achievement.survive_darkness": "Takut kegelapan?", - "minicraft.achievement.survive_darkness.desc": "Bertahan 5 menit dalam kegelapan total.", - "minicraft.achievement.lava": "Urusan Panas", - "minicraft.achievement.lava.desc": "Gunakan ramuan lava untuk berenang di lava.", + "minicraft.achievement.doors": "Perlindungan Pintu", + "minicraft.achievement.doors.desc": "Buat pintu kayu.", "minicraft.achievement.find_gem": "Ooh Mengkilap!", "minicraft.achievement.find_gem.desc": "Temukan Bijih Permata dan menambangnya.", + "minicraft.achievement.fish": "Pergi Ikan!", + "minicraft.achievement.fish.desc": "Memancing Ikan!", + "minicraft.achievement.lava": "Urusan Panas", + "minicraft.achievement.lava.desc": "Gunakan ramuan lava untuk berenang di lava.", "minicraft.achievement.lowest_caves": "Kegelapan di balik cahaya", "minicraft.achievement.lowest_caves.desc": "Mencapai gua terendah.", "minicraft.achievement.obsidian_dungeon": "Ksatria dan Pria", "minicraft.achievement.obsidian_dungeon.desc": "Mencapai ruang bawah tanah obsidian.", - "minicraft.achievement.airwizard": "Mengalahkan... udara?", - "minicraft.achievement.airwizard.desc": "Kalahkan Penyihir Angin pertama!", + "minicraft.achievement.planks": "Berjalan di Papan!", + "minicraft.achievement.planks.desc": "Kerajinan papan kayu.", "minicraft.achievement.skin": "Peragaan busana", "minicraft.achievement.skin.desc": "Ubah kulit Anda.", + "minicraft.achievement.survive_darkness": "Takut kegelapan?", + "minicraft.achievement.survive_darkness.desc": "Bertahan 5 menit dalam kegelapan total.", + "minicraft.achievement.upgrade": "Meningkatkan!", + "minicraft.achievement.upgrade.desc": "Buat alat Batu apa saja.", + "minicraft.achievement.woodcutter": "Penebang", + "minicraft.achievement.woodcutter.desc": "Dapatkan kayu.", + "minicraft.control_guide.attack": "Gunakan %s untuk menyerang atau menghancur.", + "minicraft.control_guide.craft": "Gunakan %s untuk membuka menu kerajinanmu.", + "minicraft.control_guide.menu": "Gunakan %s untuk membuka menu inventaris.", + "minicraft.control_guide.move": "Gunakan %s untuk bergerak.", "minicraft.display.entries.boolean.false": "Mati", "minicraft.display.entries.boolean.true": "Hidup", "minicraft.display.gui.link_opening": "Membuka dengan browser...", @@ -44,6 +203,8 @@ "minicraft.display.menus.inventory": "Inventaris", "minicraft.display.options_display": "Opsi", "minicraft.display.options_display.change_key_bindings": "Ganti Tombol Pintasan", + "minicraft.display.options_display.language": "Bahasa", + "minicraft.display.options_display.resource_packs": "Resours pack", "minicraft.display.popup.enter_confirm": "tekan enter untuk konfirmasi", "minicraft.display.popup.escape_cancel": "tekan escape untuk membatalkan", "minicraft.display.popup.title_confirm": "Konfirm Aksi", @@ -53,6 +214,52 @@ "minicraft.displays.achievements.display.not_achieved": "Tidak Tercapai", "minicraft.displays.achievements.display.score": "Skor Pencapaian: %s", "minicraft.displays.book.default_book": "Buku ini tidak memiliki teks.", + "minicraft.displays.controls": "Kontrol", + "minicraft.displays.controls.display.controller": "Kontroller", + "minicraft.displays.controls.display.controller.00": "Menggerak pemain menggunakan DPAD", + "minicraft.displays.controls.display.controller.01": "Menggerak kursor menggunakan DPAD", + "minicraft.displays.controls.display.controller.02": "Memilih entri menggunakan A", + "minicraft.displays.controls.display.controller.03": "Keluar halaman menggunakan B", + "minicraft.displays.controls.display.controller.04": "Menyerang entitas, menghancurkan dan berinteraksi tile menggunakan A", + "minicraft.displays.controls.display.controller.05": "Membuka menu dalam game menggunakan X", + "minicraft.displays.controls.display.controller.06": "Membuka menu kerajinan menggunakan Y", + "minicraft.displays.controls.display.controller.07": "Mengambil furnitur menggunakan LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "Menjatuhkan 1 item menggunakan RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Menjatuhkan seluruh tumpukan item menggunakan RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "Mengalihkan bilah pencarian di menu-menu item menggunakan START", + "minicraft.displays.controls.display.controller.11": "Menjeda permainan menggunakan START", + "minicraft.displays.controls.display.controller.12": "Gunakan X untuk mengaktifkan keyboard on-screen pada input", + "minicraft.displays.controls.display.controller.13": "Gunakan B sebagai pinstasan buat backspace di keyboard on-screen", + "minicraft.displays.controls.display.controller.14": "Gunakan X untuk menghapus item dalam inventaris mode kreatif", + "minicraft.displays.controls.display.controller.15": "Gunakan Y untuk menghapus seluruh tumpukan item dalam inventaris mode kreatif", + "minicraft.displays.controls.display.controller.desc.0": "Pemetaan debug tidak dapat diakses", + "minicraft.displays.controls.display.controller.desc.1": "Pemetaan terperinci tidak dapat digunakan", + "minicraft.displays.controls.display.help.0": "%s/%s untuk melihat kontrol-kontrol lain.", + "minicraft.displays.controls.display.keyboard": "Keyboard", + "minicraft.displays.controls.display.keyboard.00": "Menggerak pemain menggunakan MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Menggerak kursor menggunakan CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Mempilih entri menggunakan SELECT", + "minicraft.displays.controls.display.keyboard.03": "Keluar halaman menggunakan EXIT", + "minicraft.displays.controls.display.keyboard.04": "Menyimpan cepat menggunakan QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Menyerang entitas, menghancur dan interaksi pada tile menggunakan ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Membuka menu-menu dalam game menggunakan MENU", + "minicraft.displays.controls.display.keyboard.07": "Membuka menu kerajinan menggunakan CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Mengangkat furnitur menggunakan PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Menjatuhkan 1 item menggunakan DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Menjatuhkan seluruh tumpukan item menggunakan DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Beralih bilah pencarian di menu item menggunakan SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Browsing hasil pencarian menggunakan PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Menjeda game menggunakan PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Mengalih tampilan efek ramuan menggunakan POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Beralih tampilan ramuan yang disederhanakan menggunakan SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Mengembang tampilan misi dalam game menggunakan EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Mengalih HUD menggunakan TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Mengambil tangkapan layar menggunakan SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Menampil info dalam game menggunakan INFO", + "minicraft.displays.controls.display.keyboard.20": "Mengalih fullscreen menggunakan FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Gunakan D untuk menghapus item terpilih dalam inventaris mode kreatif", + "minicraft.displays.controls.display.keyboard.22": "Gunakan SHIFT-D untuk menghapus seluruh tumpukan item dalam inventaris mode kreatif", + "minicraft.displays.controls.display.keyboard.desc": "Pemetaan debug tidak dijelaskan", "minicraft.displays.crafting": "Kerajinan", "minicraft.displays.crafting.container_title.cost": "Biaya:", "minicraft.displays.crafting.container_title.have": "Memiliki:", @@ -72,13 +279,22 @@ "minicraft.displays.key_input.popup_display.confirm_reset": "Apakah anda yakin ingin menyetel ulang semua pengikatan tombol pintasan ke tombol pintasan default?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Tekan urutan tombol yang diinginkan", "minicraft.displays.key_input.title": "Kontrol", + "minicraft.displays.language_settings.title": "Bahasa...", + "minicraft.displays.loading.message.dungeon_regeneration": "Regenerasi B4", "minicraft.displays.loading.message.entities": "Entitas", "minicraft.displays.loading.message.generating": "Sedang Menggenerasi", "minicraft.displays.loading.message.level": "Level %s", "minicraft.displays.loading.message.levels": "Level", "minicraft.displays.loading.message.loading": "Memuat", + "minicraft.displays.loading.message.quests": "Misi-misi", "minicraft.displays.loading.message.saving": "Menyimpan", "minicraft.displays.loading.message.world": "Dunia", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Pemuatan dunia telah dibatalkan", + "minicraft.displays.loading.regeneration_popup.display.0": "Versi dungeon lama (B4 floor) terdeteksi.", + "minicraft.displays.loading.regeneration_popup.display.1": "Diperlukan regenerasi.", + "minicraft.displays.loading.regeneration_popup.display.2": "Data lama di lantai itu akan dihapus:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s untuk melanjutkan", + "minicraft.displays.loading.regeneration_popup.display.4": "%s untuk membatalkan pemuatan dunia", "minicraft.displays.options_main_menu": "Pilihan Menu Utama", "minicraft.displays.options_main_menu.resource_packs": "Resourse Pack", "minicraft.displays.options_world": "Opsi Dunia", @@ -105,10 +321,12 @@ "minicraft.displays.quests": "Misi", "minicraft.displays.quests.display.header.completed": "Selesai", "minicraft.displays.quests.display.header.unlocked": "Terbuka", + "minicraft.displays.quests.display.no_quest": "Tidak ada misi terbuka", "minicraft.displays.quests.display.no_quest_desc": "Tidak ada misi", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Hanya input melalui keyboard diterima.", "minicraft.displays.resource_packs.display.help.move": "Gunakan %s dan %s untuk bergerak.", - "minicraft.displays.resource_packs.display.help.select": "%s untuk periksa.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] untuk menggerak pack. ", + "minicraft.displays.resource_packs.display.help.select": "%s untuk periksa.", "minicraft.displays.resource_packs.display.title": "Resourse pack", "minicraft.displays.skin": "Skin-skin", "minicraft.displays.skin.display.help.move": "Gunakan %s dan %s untuk bergerak.", @@ -132,6 +350,7 @@ "minicraft.displays.title.play.new_world": "Dunia Baru", "minicraft.displays.title.quit": "Keluar", "minicraft.displays.title.select_to_download": "--Pilih di sini untuk Mengunduh--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Tekan %s untuk meneliti rincian tutorial.", "minicraft.displays.world_gen.create_world": "Ciptakan Dunia", "minicraft.displays.world_gen.enter_world": "Masukkan Nama Dunia", "minicraft.displays.world_gen.title": "Opsi Generasi Dunia", @@ -152,266 +371,23 @@ "minicraft.displays.world_select.select_world": "Pilih Dunia", "minicraft.notification.achievement_unlocked": "Prestasi terbuka: %s", "minicraft.notification.air_wizard_defeated": "Penyihir Udara Dikalahkan!", + "minicraft.notification.boss_limit": "Tidak ada lagi bos yang bisa dihasilkan", "minicraft.notification.cannot_sleep": "Tidak bisa tidur! %sMin %s Detik tersisa!", "minicraft.notification.death_chest_retrieved": "Peti kematian diambil!", "minicraft.notification.defeat_air_wizard_first": "Penyihir udara harus dikalahkan terlebih dahulu.", + "minicraft.notification.defeat_obsidian_knight_first": "Ksatria Obsidian harus dikalahkan terlebih dahulu.", "minicraft.notification.dig_hole": "Gali lubang dulu!", "minicraft.notification.dungeon_opened": "Dungeon sekarang terbuka!", "minicraft.notification.gem_pickaxe_required": "Beliung Gem Diperlukan.", "minicraft.notification.invalid_placement": "Hanya dapat ditempatkan pada %s!", + "minicraft.notification.obsidian_knight_awoken": "Ksatria Obsidian telah terbangun!", + "minicraft.notification.obsidian_knight_defeated": "Ksatria Obsidian: Dikalahkan!", "minicraft.notification.quest_completed": "Misi selesai", "minicraft.notification.quest_unlocked": "Misi terbuka", + "minicraft.notification.spawn_on_boss_tile": "Hanya bisa dipanggil di Boss Room", "minicraft.notification.world_saved": "Dunia tersimpan!", - "minicraft.notification.wrong_level_sky": "Hanya bisa summon di tingkat langit", - "minicraft.settings.fps": "FPS Maks", - "minicraft.settings.difficulty": "Kesulitan", - "minicraft.settings.difficulty.easy": "Mudah", - "minicraft.settings.difficulty.normal": "Normal", - "minicraft.settings.difficulty.hard": "Susah", - "minicraft.settings.mode": "Mode Permainan", - "minicraft.settings.mode.survival": "Surviv", - "minicraft.settings.mode.creative": "Kreatif", - "minicraft.settings.mode.hardcore": "Hardcore", - "minicraft.settings.mode.score": "Skor", - "minicraft.settings.scoretime": "Waktu (Mode Skor)", - "minicraft.settings.screenshot_scale": "Skala Tangkapan Layar", - "minicraft.settings.sound": "Suara", - "minicraft.settings.autosave": "Simpan otomatis", - "minicraft.settings.size": "Ukuran dunia", - "minicraft.settings.theme": "Tema Dunia", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Hutan", - "minicraft.settings.theme.desert": "Gurun", - "minicraft.settings.theme.plain": "Plain", - "minicraft.settings.theme.hell": "Neraka", - "minicraft.settings.type": "Tipe Terrain", - "minicraft.settings.type.island": "Pulau", - "minicraft.settings.type.box": "Kotak", - "minicraft.settings.type.mountain": "Gunung", - "minicraft.settings.type.irregular": "Tidak teratur", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul dengan jubah", - "minicraft.skin.minecraft_steve": "Anak laki-laki yang akrab", - "minicraft.skin.minecraft_alex": "Gadis yang akrab", - "minicraft.text_particales.key_consumed": "-1 tombol", - "Death Chest": "Peti Mati", - "Player": "Pemain", - "Leather Armor": "Armor Kulit", - "Snake Armor": "Armor Ular", - "Iron Armor": "Armor Besi", - "Gold Armor": "Armor Emas", - "Gem Armor": "Armor Gem", - "Book": "Buku", - "Antidious": "Antidious", - "Empty Bucket": "Ember Kosong", - "Water Bucket": "Ember Air", - "Lava Bucket": "Ember Lava", - "Red Clothes": "Pakaian Merah", - "Blue Clothes": "Pakaian Biru", - "Green Clothes": "Pakaian Ijo", - "Yellow Clothes": "Pakaian Kuning", - "Black Clothes": "Pakaian Item", - "Orange Clothes": "Pakaian Oranye", - "Purple Clothes": "Pakaian Ungu", - "Cyan Clothes": "Pakaian Cyan", - "Reg Clothes": "Pakaian Reguler", - "Bread": "Roti", - "Apple": "Apel", - "Raw Pork": "Babi Mentah", - "Raw Fish": "Ikan Mentah", - "Raw Beef": "Daging Mentah", - "Pork Chop": "Daging Babi", - "Cooked Fish": "Ikan Matang", - "Cooked Pork": "Daging Babi Matang", - "Steak": "Daging Panggang", - "Gold Apple": "Apel Emas", - "Baked Potato": "Kentang Panggang", - "Cow Spawner": "Pemijahan Sapi", - "Pig Spawner": "Pemijahan Babi", - "Sheep Spawner": "Pemijahan Kambing", - "Slime Spawner": "Pemijahan Slime", - "Zombie Spawner": "Pemijahan Zombie", - "Creeper Spawner": "Pemijahan Creeper", - "Skeleton Spawner": "Pemijahan Skeleton", - "Snake Spawner": "Pemijahan Ular", - "Knight Spawner": "Pemijahan Kesatria", - "AirWizard Spawner": "Pemijahan PenyihirUdara", - "Workbench": "Meja Kerja", - "Oven": "Oven", - "Furnace": "Perapian", - "Anvil": "Landasan", - "Enchanter": "Enchanter", - "Loom": "Mesin Tenun", - "Lantern": "Lentera", - "Iron Lantern": "Lentera Besi", - "Gold Lantern": "Lentera Emas", - "Tnt": "Tnt", - "Bed": "Tempat tidur", - "Chest": "Peti", - "None Potion": "Ramuan Kosong", - "Speed Potion": "Ramuan Kecepatan", - "Light Potion": "Ramuan Ringan", - "Swim Potion": "Ramuan Berenang", - "Energy Potion": "Ramuan Energi", - "Regen Potion": "Ramuan Regen", - "Health Potion": "Ramuan Darah", - "Time Potion": "Ramuan Waktu", - "Lava Potion": "Ramuan Lava", - "Shield Potion": "Ramuan Perisai", - "Haste Potion": "Ramuan Tergesa-gesa", - "Escape Potion": "Ramuan Melarikan Diri", - "Potion": "Ramuan", - "Power Glove": "Sarung Tangan Kekuatan", - "Wood": "Kayu", - "Stone": "Batu", - "Leather": "Kulit", - "Wheat": "Gandum", - "Key": "Kunci", - "Coal": "Batu Bara", - "Iron Ore": "Bijih Besi", - "Gold Ore": "Bijih Emas", - "Gem Ore": "Bijih Gem", - "Cloud Ore": "Bijih Awan", - "Iron": "Besi", - "Gold": "Emas", - "Lapis": "Lapis", - "Rose": "Bunga Mawar", - "Gunpowder": "Bubuk Mesiu", - "Slime": "Lendir", - "Scale": "Skala", - "Shard": "Beling", - "Flower": "Bunga", - "Acorn": "Biji Pohon", - "Dirt": "Tanah", - "Natural Rock": "Batu Alam", - "Plank": "Papan", - "Plank Wall": "Dinding Papan", - "Wood Door": "Pintu Kayu", - "Stone Brick": "Batu Bata", - "Ornate Stone": "Batu Hiasan", - "Stone Wall": "Dinding Batu", - "Stone Door": "Pintu Batu", - "Obsidian Brick": "Bata Obsidian", - "Ornate Obsidian": "Obsidian hiasan", - "Obsidian Wall": "Dinding Obsidian", - "Obsidian Door": "Pintu Obsidian", - "Wool": "Wol", - "Red Wool": "Wol Merah", - "Blue Wool": "Wol Biru", - "Green Wool": "Wol Ijo", - "Yellow Wool": "Wol Kuning", - "Black Wool": "Wol Item", - "Sand": "Pasir", - "Cactus": "Kaktus", - "Seeds": "Biji", - "Wheat Seeds": "Biji Gandum", - "Grass Seeds": "Bibit Rumput", - "Bone": "Tulang", - "Cloud": "Awan", - "Rock": "Batu", - "Gem": "Gem", - "Potato": "Kentang", - "Wood Fishing Rod": "Pancing Kayu", - "Iron Fishing Rod": "Pancing Besi", - "Gold Fishing Rod": "Pancing Emas", - "Gem Fishing Rod": "Pancing Gem", - "Shovel": "Sekop", - "Hoe": "Cankul", - "Sword": "Pedang", - "Pickaxe": "Beliung", - "Axe": "Kapak", - "Bow": "Busur", - "Claymore": "Claymore", - "Shears": "Sepasang gunting", - "Torch": "Obor", - "Wood Planks": "Papan Kayu", - "Stone Bricks": "Batu Bata", - "Obsidian": "Obsidian", - "Wood Wall": "Dinding Kayu", - "Grass": "Rumput", - "Hole": "Lubang", - "Stairs Up": "Tangga Naik", - "Stairs Down": "Tangga Turun", - "Water": "Air", - "Tree": "Pohon", - "Tree Sapling": "Pohon Muda", - "Cactus Sapling": "Kaktus Muda", - "Lava": "Lava", - "Lava Brick": "Bata Lava", - "Explode": "Meledak", - "Farmland": "Tanah Pertanian", - "Hard Rock": "Batu Keras", - "Infinite Fall": "Jatuh Tak Terbatas", - "Cloud Cactus": "Kaktus Awan", - "Raw Obsidian": "Obsidian Mentah", - "Totem of Air": "Totem Udara", - "minicraft.control_guide.attack": "Gunakan %s untuk menyerang atau menghancur.", - "minicraft.control_guide.craft": "Gunakan %s untuk membuka menu kerajinanmu.", - "minicraft.control_guide.menu": "Gunakan %s untuk membuka menu inventaris.", - "minicraft.control_guide.move": "Gunakan %s untuk bergerak.", - "minicraft.displays.controls": "Kontrol", - "minicraft.displays.controls.display.controller": "Kontroller", - "minicraft.displays.controls.display.controller.00": "Menggerak pemain menggunakan DPAD", - "minicraft.displays.controls.display.controller.01": "Menggerak kursor menggunakan DPAD", - "minicraft.displays.controls.display.controller.02": "Memilih entri menggunakan A", - "minicraft.displays.controls.display.controller.03": "Keluar halaman menggunakan B", - "minicraft.displays.controls.display.controller.04": "Menyerang entitas, menghancurkan dan berinteraksi tile menggunakan A", - "minicraft.displays.controls.display.controller.05": "Membuka menu dalam game menggunakan X", - "minicraft.displays.controls.display.controller.06": "Membuka menu kerajinan menggunakan Y", - "minicraft.displays.controls.display.controller.07": "Mengambil furnitur menggunakan LEFTBUMPER", - "minicraft.displays.controls.display.controller.08": "Menjatuhkan 1 item menggunakan RIGHTBUMPER", - "minicraft.displays.controls.display.controller.09": "Menjatuhkan seluruh tumpukan item menggunakan RIGHTSTICK", - "minicraft.displays.controls.display.controller.10": "Mengalihkan bilah pencarian di menu-menu item menggunakan START", - "minicraft.displays.controls.display.controller.11": "Menjeda permainan menggunakan START", - "minicraft.displays.controls.display.controller.12": "Gunakan X untuk mengaktifkan keyboard on-screen pada input", - "minicraft.displays.controls.display.controller.13": "Gunakan B sebagai pinstasan buat backspace di keyboard on-screen", - "minicraft.displays.controls.display.controller.14": "Gunakan X untuk menghapus item dalam inventaris mode kreatif", - "minicraft.displays.controls.display.controller.15": "Gunakan Y untuk menghapus seluruh tumpukan item dalam inventaris mode kreatif", - "minicraft.displays.controls.display.controller.desc.0": "Pemetaan debug tidak dapat diakses", - "minicraft.displays.controls.display.controller.desc.1": "Pemetaan terperinci tidak dapat digunakan", - "minicraft.displays.controls.display.help.0": "%s/%s untuk melihat kontrol-kontrol lain.", - "minicraft.displays.controls.display.keyboard": "Keyboard", - "minicraft.displays.controls.display.keyboard.00": "Menggerak pemain menggunakan MOVE-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.01": "Menggerak kursor menggunakan CURSOR-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.02": "Mempilih entri menggunakan SELECT", - "minicraft.displays.controls.display.keyboard.03": "Keluar halaman menggunakan EXIT", - "minicraft.displays.controls.display.keyboard.04": "Menyimpan cepat menggunakan QUICKSAVE", - "minicraft.displays.controls.display.keyboard.05": "Menyerang entitas, menghancur dan interaksi pada tile menggunakan ATTACK", - "minicraft.displays.controls.display.keyboard.06": "Membuka menu-menu dalam game menggunakan MENU", - "minicraft.displays.controls.display.keyboard.07": "Membuka menu kerajinan menggunakan CRAFT", - "minicraft.displays.controls.display.keyboard.08": "Mengangkat furnitur menggunakan PICKUP", - "minicraft.displays.controls.display.keyboard.09": "Menjatuhkan 1 item menggunakan DROP-ONE", - "minicraft.displays.controls.display.keyboard.10": "Menjatuhkan seluruh tumpukan item menggunakan DROP-STACK", - "minicraft.displays.controls.display.keyboard.11": "Beralih bilah pencarian di menu item menggunakan SEARCHER-BAR", - "minicraft.displays.controls.display.keyboard.12": "Browsing hasil pencarian menggunakan PAGE-UP/DOWN", - "minicraft.displays.controls.display.keyboard.13": "Menjeda game menggunakan PAUSE", - "minicraft.displays.controls.display.keyboard.14": "Mengalih tampilan efek ramuan menggunakan POTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.15": "Beralih tampilan ramuan yang disederhanakan menggunakan SIMPPOTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.16": "Mengembang tampilan misi dalam game menggunakan EXPANDQUESTDISPLAY", - "minicraft.displays.controls.display.keyboard.17": "Mengalih HUD menggunakan TOGGLEHUD", - "minicraft.displays.controls.display.keyboard.18": "Mengambil tangkapan layar menggunakan SCREENSHOT", - "minicraft.displays.controls.display.keyboard.19": "Menampil info dalam game menggunakan INFO", - "minicraft.displays.controls.display.keyboard.20": "Mengalih fullscreen menggunakan FULLSCREEN", - "minicraft.displays.controls.display.keyboard.21": "Gunakan D untuk menghapus item terpilih dalam inventaris mode kreatif", - "minicraft.displays.controls.display.keyboard.22": "Gunakan SHIFT-D untuk menghapus seluruh tumpukan item dalam inventaris mode kreatif", - "minicraft.displays.controls.display.keyboard.desc": "Pemetaan debug tidak dijelaskan", - "minicraft.displays.loading.message.dungeon_regeneration": "Regenerasi B4", - "minicraft.displays.loading.message.quests": "Misi-misi", - "minicraft.displays.loading.regeneration_popup.display.0": "Versi dungeon lama (B4 floor) terdeteksi.", - "minicraft.displays.loading.regeneration_popup.display.1": "Diperlukan regenerasi.", - "minicraft.displays.loading.regeneration_popup.display.2": "Data lama di lantai itu akan dihapus:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s untuk melanjutkan", - "minicraft.displays.loading.regeneration_popup.display.4": "%s untuk membatalkan pemuatan dunia", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "Pemuatan dunia telah dibatalkan", - "minicraft.displays.quests.display.no_quest": "Tidak ada misi terbuka", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Hanya input melalui keyboard diterima.", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Tekan %s untuk meneliti rincian tutorial.", - "minicraft.notification.obsidian_knight_defeated": "Ksatria Obsidian: Dikalahkan!", - "minicraft.notification.obsidian_knight_awoken": "Ksatria Obsidian telah terbangun!", - "minicraft.notification.defeat_obsidian_knight_first": "Ksatria Obsidian harus dikalahkan terlebih dahulu.", "minicraft.notification.wrong_level_dungeon": "Hanya bisa dipanggil di level dungeon", - "minicraft.notification.boss_limit": "Tidak ada lagi bos yang bisa dihasilkan", - "minicraft.notification.spawn_on_boss_tile": "Hanya bisa dipanggil di Boss Room", + "minicraft.notification.wrong_level_sky": "Hanya bisa summon di tingkat langit", "minicraft.notifications.statue_tapped": "Anda mendengar bisikan bergema...", "minicraft.notifications.statue_touched": "Anda mendengar patungnya bergetar...", "minicraft.quest.farming": "Petani Pertanian", @@ -450,6 +426,37 @@ "minicraft.quest.potions.description": "Mendapatkan ramuan-ramuannya.", "minicraft.quest.potions.powerful_potions": "Ramuan Kuat", "minicraft.quest.potions.powerful_potions.description": "Mendapatkan ramuan yang berguna dan kuat.", + "minicraft.settings.autosave": "Simpan otomatis", + "minicraft.settings.difficulty": "Kesulitan", + "minicraft.settings.difficulty.easy": "Mudah", + "minicraft.settings.difficulty.hard": "Susah", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "FPS Maks", + "minicraft.settings.mode": "Mode Permainan", + "minicraft.settings.mode.creative": "Kreatif", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Skor", + "minicraft.settings.mode.survival": "Surviv", + "minicraft.settings.scoretime": "Waktu (Mode Skor)", + "minicraft.settings.screenshot_scale": "Skala Tangkapan Layar", + "minicraft.settings.size": "Ukuran dunia", + "minicraft.settings.sound": "Suara", + "minicraft.settings.theme": "Tema Dunia", + "minicraft.settings.theme.desert": "Gurun", + "minicraft.settings.theme.forest": "Hutan", + "minicraft.settings.theme.hell": "Neraka", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Plain", + "minicraft.settings.type": "Tipe Terrain", + "minicraft.settings.type.box": "Kotak", + "minicraft.settings.type.irregular": "Tidak teratur", + "minicraft.settings.type.island": "Pulau", + "minicraft.settings.type.mountain": "Gunung", + "minicraft.skin.minecraft_alex": "Gadis yang akrab", + "minicraft.skin.minecraft_steve": "Anak laki-laki yang akrab", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul dengan jubah", + "minicraft.text_particales.key_consumed": "-1 tombol", "minicraft.tutorial.getting_rocks": "Mendapatkan batu dan bara", "minicraft.tutorial.getting_rocks.description": "Dapatkan setidaknya 5 item batu dan 5 item batu bara dengan menghancurkan batu dengan beliung yang dibuat.", "minicraft.tutorial.getting_wood": "Mendapatkan lebih banyak kayu", @@ -459,15 +466,5 @@ "minicraft.tutorial.getting_workbench": "Mendapatkan meja kerja", "minicraft.tutorial.getting_workbench.description": "Membuat meja kerja di menu kerajinan. Menempatkannya setelah itu.", "minicraft.tutorial.start_getting_wood": "Awal dari Semua", - "minicraft.tutorial.start_getting_wood.description": "Terus Menyerang pohon untuk mendapatkan kayu.", - "minicraft.display.options_display.language": "Bahasa", - "minicraft.display.options_display.resource_packs": "Resours pack", - "minicraft.displays.language_settings.title": "Bahasa...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Anak panah", - "String": "Benang", - "Glass": "Kaca", - "Cloth": "Kain" + "minicraft.tutorial.start_getting_wood.description": "Terus Menyerang pohon untuk mendapatkan kayu." } diff --git a/src/client/resources/assets/localization/it-it.json b/src/client/resources/assets/localization/it-it.json index a040f8cc0..198fc0485 100644 --- a/src/client/resources/assets/localization/it-it.json +++ b/src/client/resources/assets/localization/it-it.json @@ -1,36 +1,195 @@ { - "minicraft.achievement.woodcutter": "Taglialegna", - "minicraft.achievement.woodcutter.desc": "Prendi del legno.", + "Acorn": "Ghianda", + "AirWizard Spawner": "Generatore di maghi del vento", + "Antidious": "Antidoto", + "Anvil": "Incudine", + "Apple": "Mela", + "Arrow": "Freccia", + "Axe": "Ascia", + "Baked Potato": "Patata cotta", + "Bed": "Letto", + "Black Clothes": "Vestiti neri", + "Black Wool": "Lana nera", + "Blue Clothes": "Vestiti blu", + "Blue Wool": "Lana blu", + "Bone": "Ossa", + "Book": "Libro", + "Bow": "Arco", + "Bread": "Pane", + "Cactus": "Cactus", + "Cactus Sapling": "Alberello di cactus", + "Chest": "Cassa", + "Claymore": "Claymore", + "Cloth": "Stoffa", + "Cloud": "Nuvola", + "Cloud Cactus": "Cactus di nuvole", + "Cloud Ore": "Oro del cielo", + "Coal": "Carbone", + "Cooked Fish": "Pesce cotto", + "Cooked Pork": "Carne di maiale cotta", + "Cow Spawner": "Generatore di mucche", + "Creeper Spawner": "Generatore di creeper", + "Cyan Clothes": "Vestiti ciano", + "Death Chest": "Cassa della morte", + "Dirt": "Terra", + "Empty Bucket": "Secchio vuoto", + "Enchanter": "Incantatore", + "Energy Potion": "Pozione di energia", + "Escape Potion": "Pozione di fuga", + "Explode": "Esplodi", + "Farmland": "Terreno da coltivare", + "Flower": "Fiore", + "Furnace": "Fornace", + "Gem": "Gemma", + "Gem Armor": "Armatura di gemma", + "Gem Fishing Rod": "Canna da pesca di gemme", + "Gem Ore": "Gemma grezza", + "Glass": "Vetro", + "Gold": "Oro", + "Gold Apple": "Mela d'oro", + "Gold Armor": "Armatura d'oro", + "Gold Fishing Rod": "Canna da pesca d'oro", + "Gold Lantern": "Lanterna d'oro", + "Gold Ore": "Oro grezzo", + "Grass": "Erba", + "Grass Seeds": "Semi d'erba", + "Green Clothes": "Vestiti verdi", + "Green Wool": "Lana verde", + "Gunpowder": "Polvere da sparo", + "Hard Rock": "Terra dura", + "Haste Potion": "Pozione di rapidità", + "Health Potion": "Pozione di salute", + "Hoe": "Zappa", + "Hole": "Buco", + "Infinite Fall": "Caduta infinita", + "Iron": "Ferro", + "Iron Armor": "Armatura di ferro", + "Iron Fishing Rod": "Canna da pesca di ferro", + "Iron Lantern": "Lanterna di ferro", + "Iron Ore": "Ferro grezzo", + "Key": "Chiave", + "Knight Spawner": "Generatore di cavalieri", + "Lantern": "Lanterna", + "Lapis": "Lapislazzuli", + "Lava": "Lava", + "Lava Brick": "Mattoni di lava", + "Lava Bucket": "Secchio di lava", + "Lava Potion": "Pozione di resistenza alla lava", + "Leather": "Pelle", + "Leather Armor": "Armatura di pelle", + "Light Potion": "Pozione di luce", + "Loom": "Telaio", + "Natural Rock": "Roccia naturale", + "None Potion": "Pozione vuota", + "Obsidian": "Ossidiana", + "Obsidian Brick": "Mattone d'ossidiana", + "Obsidian Door": "Porta d'ossidiana", + "Obsidian Wall": "Muro d'ossidiana", + "Orange Clothes": "Vestiti arancioni", + "Ornate Obsidian": "Ornamento d'ossidiana", + "Ornate Stone": "Pietra ornamentale", + "Oven": "Forno", + "Pickaxe": "Piccone", + "Pig Spawner": "Generatore di maiali", + "Plank": "Assi", + "Plank Wall": "Muro d'assi", + "Player": "Giocatore", + "Pork Chop": "Carne di maiale cruda", + "Potato": "Patata", + "Potion": "Pozione", + "Power Glove": "Guanto potente", + "Purple Clothes": "Vestiti viola", + "Raw Beef": "Manzo crudo", + "Raw Fish": "Pesce crudo", + "Raw Obsidian": "Ossidiana grezza", + "Raw Pork": "Maiale crudo", + "Red Clothes": "Vestiti rossi", + "Red Wool": "Lana rossa", + "Reg Clothes": "Vestiti regolari", + "Regen Potion": "Pozione di rigenerazione", + "Rock": "Roccia", + "Rose": "Rosa", + "Sand": "Sabbia", + "Scale": "Squama", + "Seeds": "Semi", + "Shard": "Coccio", + "Shears": "Cesoie", + "Sheep Spawner": "Generatore di pecore", + "Shield Potion": "Pozione scudo", + "Shovel": "Pala", + "Skeleton Spawner": "Generatore di scheletri", + "Slime": "Slime", + "Slime Spawner": "Generatore di slime", + "Snake Armor": "Armatura di serpenti", + "Snake Spawner": "Generatore di serpenti", + "Speed Potion": "Pozione di velocità", + "Stairs Down": "Scale in giù", + "Stairs Up": "Scale in sù", + "Steak": "Bistecca", + "Stone": "Pietra", + "Stone Brick": "Mattone di pietra", + "Stone Bricks": "Mattoni di ferro", + "Stone Door": "Porta di pietra", + "Stone Wall": "Muro di pietra", + "String": "Corda", + "Swim Potion": "Pozione di nuoto", + "Sword": "Spada", + "Time Potion": "Pozione del tempo", + "Tnt": "TNT", + "Torch": "Torcia", + "Totem of Air": "Totem dell'aria", + "Tree": "Albero", + "Tree Sapling": "Alberello", + "Water": "Acqua", + "Water Bucket": "Secchio d'acqua", + "Wheat": "Grano", + "Wheat Seeds": "Semi di grano", + "Wood": "Legno", + "Wood Door": "Porta di legno", + "Wood Fishing Rod": "Canna da pesca di legno", + "Wood Planks": "Assi di legno", + "Wood Wall": "Muro di legno", + "Wool": "Lana", + "Workbench": "Banco da lavoro", + "Yellow Clothes": "Vestiti gialli", + "Yellow Wool": "Lana gialla", + "Zombie Spawner": "Generatore di zombie", + "minicraft.achievement.airwizard": "Sconfiggi... l'aria?", + "minicraft.achievement.airwizard.desc": "Sconfiggi il primo mago del vento!", "minicraft.achievement.benchmarking": "Ora del lavoro", "minicraft.achievement.benchmarking.desc": "Costruisci un banco da lavoro.", - "minicraft.achievement.upgrade": "Potenzia!", - "minicraft.achievement.upgrade.desc": "Costruisci qualsiasi utensile di ferro.", "minicraft.achievement.bow": "Scocca la freccia verso di me!", "minicraft.achievement.bow.desc": "Scocca una freccia con un arco.", - "minicraft.achievement.fish": "Pesca!", - "minicraft.achievement.fish.desc": "Pesca un pesce!", - "minicraft.achievement.doors": "Adooro la protezione", - "minicraft.achievement.doors.desc": "Costruisci una porta di legno.", - "minicraft.achievement.planks": "Cammina sulle assi!", - "minicraft.achievement.planks.desc": "Costruisci delle assi di legno.", "minicraft.achievement.clothes": "Che tu abbia una giornata colorata!", "minicraft.achievement.clothes.desc": "Costruisci un vestito di qualsiasi colore", "minicraft.achievement.demolition": "Demolizione Demo", "minicraft.achievement.demolition.desc": "Usa una TNT.", - "minicraft.achievement.survive_darkness": "Hai paura del buio?", - "minicraft.achievement.survive_darkness.desc": "Sopravvivi 5 minuti nel buio totale.", - "minicraft.achievement.lava": "Affari bollenti", - "minicraft.achievement.lava.desc": "Usa una pozione di resistenza alla lava per nuotare nella lava.", + "minicraft.achievement.doors": "Adooro la protezione", + "minicraft.achievement.doors.desc": "Costruisci una porta di legno.", "minicraft.achievement.find_gem": "Oooh Splendente!", "minicraft.achievement.find_gem.desc": "Trova dell'oro grezzo e minalo.", + "minicraft.achievement.fish": "Pesca!", + "minicraft.achievement.fish.desc": "Pesca un pesce!", + "minicraft.achievement.lava": "Affari bollenti", + "minicraft.achievement.lava.desc": "Usa una pozione di resistenza alla lava per nuotare nella lava.", "minicraft.achievement.lowest_caves": "Oscurità dietro la luce", "minicraft.achievement.lowest_caves.desc": "Raggiungi il livello più basso delle caverne.", "minicraft.achievement.obsidian_dungeon": "Di cavalieri e uomini", "minicraft.achievement.obsidian_dungeon.desc": "Raggiungi il dungeon di ossidiana.", - "minicraft.achievement.airwizard": "Sconfiggi... l'aria?", - "minicraft.achievement.airwizard.desc": "Sconfiggi il primo mago del vento!", + "minicraft.achievement.planks": "Cammina sulle assi!", + "minicraft.achievement.planks.desc": "Costruisci delle assi di legno.", "minicraft.achievement.skin": "Sfilata di moda", "minicraft.achievement.skin.desc": "Cambia la tua skin.", + "minicraft.achievement.survive_darkness": "Hai paura del buio?", + "minicraft.achievement.survive_darkness.desc": "Sopravvivi 5 minuti nel buio totale.", + "minicraft.achievement.upgrade": "Potenzia!", + "minicraft.achievement.upgrade.desc": "Costruisci qualsiasi utensile di ferro.", + "minicraft.achievement.woodcutter": "Taglialegna", + "minicraft.achievement.woodcutter.desc": "Prendi del legno.", + "minicraft.control_guide.attack": "Usa %s per attaccare i mostri o distruggere le piastrelle.", + "minicraft.control_guide.craft": "Usa %s per aprire il menù di creazione.", + "minicraft.control_guide.menu": "Usa %s per aprire l'inventario.", + "minicraft.control_guide.move": "Usa %s per muoverti.", "minicraft.display.entries.boolean.false": "Off", "minicraft.display.entries.boolean.true": "On", "minicraft.display.gui.link_opening": "Apertura con il browser...", @@ -44,6 +203,8 @@ "minicraft.display.menus.inventory": "Inventario", "minicraft.display.options_display": "Opzioni", "minicraft.display.options_display.change_key_bindings": "Cambia la sequenza tasti", + "minicraft.display.options_display.language": "Lingua", + "minicraft.display.options_display.resource_packs": "Pacchetti di risorse", "minicraft.display.popup.enter_confirm": "invio per confermare", "minicraft.display.popup.escape_cancel": "esc per annullare", "minicraft.display.popup.title_confirm": "Conferma azione", @@ -53,6 +214,52 @@ "minicraft.displays.achievements.display.not_achieved": "Non completato", "minicraft.displays.achievements.display.score": "Punteggio Obiettivi: %s", "minicraft.displays.book.default_book": "Questo libro non contiene scritte.", + "minicraft.displays.controls": "Controlli", + "minicraft.displays.controls.display.controller": "Joystick", + "minicraft.displays.controls.display.controller.00": "Muovi il giocatore con gli analogici", + "minicraft.displays.controls.display.controller.01": "Muovi il cursore con gli analogici", + "minicraft.displays.controls.display.controller.02": "Seleziona con il tasto A", + "minicraft.displays.controls.display.controller.03": "Esci dalle pagine con il tasto B", + "minicraft.displays.controls.display.controller.04": "Attaccare entità, distruggere e interagire con la piestrelle con il tasto A", + "minicraft.displays.controls.display.controller.05": "Aprire i menù di gioco con il tasto X", + "minicraft.displays.controls.display.controller.06": "Aprire i menù di creazione con il tasto Y", + "minicraft.displays.controls.display.controller.07": "Raccogli gli arredamenti con il Grilletto di Sinistra", + "minicraft.displays.controls.display.controller.08": "Butta un oggetto con il Grilletto di Destra", + "minicraft.displays.controls.display.controller.09": "Butta una pila di oggetti schiacciando l'Analogico di Destra", + "minicraft.displays.controls.display.controller.10": "Usa il tasto START per Attivare/Disattivare la barra di ricerca nel menù dell'oggetto", + "minicraft.displays.controls.display.controller.11": "Usa il tasto START per mettere in pausa il gioco", + "minicraft.displays.controls.display.controller.12": "Usa il tasto X per Attivare/Disattivare la tastiera a schermo", + "minicraft.displays.controls.display.controller.13": "Usa il tasto B come scorciatoia per lo spazio nella tastiera a schermo", + "minicraft.displays.controls.display.controller.14": "Usa il tasto X per rimuovere l'oggetto selezionato nell'inventario in modalità creativa", + "minicraft.displays.controls.display.controller.15": "Usa il tasto Y per rimuovere un'intera pila di oggetti dall'inventario in modalità creativa", + "minicraft.displays.controls.display.controller.desc.0": "Debugging delle mappe non accessibile", + "minicraft.displays.controls.display.controller.desc.1": "Mappe Dettagliate non utilizzabili", + "minicraft.displays.controls.display.help.0": "%s/%s per vedere altri controlli.", + "minicraft.displays.controls.display.keyboard": "Tastiera", + "minicraft.displays.controls.display.keyboard.00": "Muovere il giocatore con MOVIMENTO-(DIREZIONE)", + "minicraft.displays.controls.display.keyboard.01": "Muovere il cursore con CURSORE-(DIREZIONE)", + "minicraft.displays.controls.display.keyboard.02": "Seleziona con il tasto SELEZIONA", + "minicraft.displays.controls.display.keyboard.03": "Esci dalle pagine con il tasto ESCI", + "minicraft.displays.controls.display.keyboard.04": "Salvataggio rapido con SALVATAGGIO-RAPIDO", + "minicraft.displays.controls.display.keyboard.05": "Attaccare entità, distruggere e interagire con le piastrelle con ATTACCO", + "minicraft.displays.controls.display.keyboard.06": "Aprire i menù di gioco con MENU", + "minicraft.displays.controls.display.keyboard.07": "Aprire i menù di creazione con CREAZIONE", + "minicraft.displays.controls.display.keyboard.08": "Raccogli gli arredamenti con RACCOLTA", + "minicraft.displays.controls.display.keyboard.09": "Butta un oggetto con BUTTA-UNO", + "minicraft.displays.controls.display.keyboard.10": "Butta una pila di oggetti con BUTTA-PILA", + "minicraft.displays.controls.display.keyboard.11": "Usa BARRA-DI-RICERCA per Attivare/Disattivare la barra di ricerca nel menù dell'oggetto", + "minicraft.displays.controls.display.keyboard.12": "Consulta i risultati di ricerca con PAGINA-SU/GIU'", + "minicraft.displays.controls.display.keyboard.13": "Usa PAUSA per mettere in pausa il gioco", + "minicraft.displays.controls.display.keyboard.14": "Attiva/Disattiva gli effetti della pozione con POZIONEEFFETTI", + "minicraft.displays.controls.display.keyboard.15": "Attiva/Disattiva la semplificazione delle pozioni con POZIONEEFFETTISEMPL", + "minicraft.displays.controls.display.keyboard.16": "Espanzione moderata della schermata delle quest con QUESTSCHERMATAESPANDI", + "minicraft.displays.controls.display.keyboard.17": "Attiva/Disattiva l'HDU con ALTERNAHUD", + "minicraft.displays.controls.display.keyboard.18": "Fai uno screenshot con SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "Mostra informazioni in-gioco con INFO", + "minicraft.displays.controls.display.keyboard.20": "Attiva/Disattiva lo schermo intero con SCHERMOINTERO", + "minicraft.displays.controls.display.keyboard.21": "Usa D per rimuovere l'oggetto selezionato dall'inventario in modalità creativa", + "minicraft.displays.controls.display.keyboard.22": "Usa MAIUSC-D per rimuovere l'intera pila di articoli nell'inventario in modalità creativa", + "minicraft.displays.controls.display.keyboard.desc": "Debug delle mappe non spiegato", "minicraft.displays.crafting": "Creazione", "minicraft.displays.crafting.container_title.cost": "Costo:", "minicraft.displays.crafting.container_title.have": "Hai:", @@ -72,13 +279,22 @@ "minicraft.displays.key_input.popup_display.confirm_reset": "Sei sicuro di voler resettare tutte le sequenza tasti?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Premi la sequenza t asti desiderata", "minicraft.displays.key_input.title": "Controlli", + "minicraft.displays.language_settings.title": "Lingua...", + "minicraft.displays.loading.message.dungeon_regeneration": "Rigenerazione B4", "minicraft.displays.loading.message.entities": "Entità", "minicraft.displays.loading.message.generating": "Generazione", "minicraft.displays.loading.message.level": "Livello %s", "minicraft.displays.loading.message.levels": "Livelli", "minicraft.displays.loading.message.loading": "Caricamento", + "minicraft.displays.loading.message.quests": "Quest", "minicraft.displays.loading.message.saving": "Salvataggio", "minicraft.displays.loading.message.world": "Mondo", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Caricamento del mondo annullato", + "minicraft.displays.loading.regeneration_popup.display.0": "Una vecchia versione del dungeon (piano B4) è stata rilevata.", + "minicraft.displays.loading.regeneration_popup.display.1": "Rigenerazione necessaria.", + "minicraft.displays.loading.regeneration_popup.display.2": "I dati vecchi in quel piano verranno cancellati:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s per continuare", + "minicraft.displays.loading.regeneration_popup.display.4": "%s per annullare il caricamento del mondo", "minicraft.displays.options_main_menu": "Opzioni del menù principale", "minicraft.displays.options_main_menu.resource_packs": "Pacchetti risorse", "minicraft.displays.options_world": "Opzioni del mondo", @@ -105,10 +321,12 @@ "minicraft.displays.quests": "Quest", "minicraft.displays.quests.display.header.completed": "Completato", "minicraft.displays.quests.display.header.unlocked": "Sbloccato", + "minicraft.displays.quests.display.no_quest": "Nessuna quest sbloccata", "minicraft.displays.quests.display.no_quest_desc": "Nessuna quest", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Sono accettati solo input dalla tastiera.", "minicraft.displays.resource_packs.display.help.move": "Usa %s e %s per muoverti.", - "minicraft.displays.resource_packs.display.help.select": "%s per esaminare.", "minicraft.displays.resource_packs.display.help.position": "MAIUSC-[SINISTRA|DESTRA|SU|GIU'] per spostare i pacchetti.␣", + "minicraft.displays.resource_packs.display.help.select": "%s per esaminare.", "minicraft.displays.resource_packs.display.title": "Pacchetti risorse", "minicraft.displays.skin": "Skin", "minicraft.displays.skin.display.help.move": "Usa %s e %s per muoverti.", @@ -132,6 +350,7 @@ "minicraft.displays.title.play.new_world": "Nuovo mondo", "minicraft.displays.title.quit": "Esci", "minicraft.displays.title.select_to_download": "--Seleziona per scaricare--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Premere %s per esaminare i dettagli del tutorial attuale.", "minicraft.displays.world_gen.create_world": "Crea mondo", "minicraft.displays.world_gen.enter_world": "Inserisci il nome del mondo", "minicraft.displays.world_gen.title": "Opzioni di generazione del mondo", @@ -152,266 +371,23 @@ "minicraft.displays.world_select.select_world": "Scegli il mondo", "minicraft.notification.achievement_unlocked": "Obiettivo sbloccato: %s", "minicraft.notification.air_wizard_defeated": "Stregone dell'Aria sconfitto!", + "minicraft.notification.boss_limit": "Non possono essere generati altri boss", "minicraft.notification.cannot_sleep": "Non puoi dormire! %sMinuti %s Secondi rimasti!", "minicraft.notification.death_chest_retrieved": "Cassa della morte recuperata!", "minicraft.notification.defeat_air_wizard_first": "Devi prima sconfiggere lo Stregone dell'Aria.", + "minicraft.notification.defeat_obsidian_knight_first": "Devi prima sconfiggere il Cavaliere d'Ossidiana.", "minicraft.notification.dig_hole": "Scava una buca prima!", "minicraft.notification.dungeon_opened": "Il Dungeon è aperto!", "minicraft.notification.gem_pickaxe_required": "Piccozza di gemme richiesta.", "minicraft.notification.invalid_placement": "Può essere collocato solo su %s!", + "minicraft.notification.obsidian_knight_awoken": "Il Cavaliere d'Ossidiana si è risvegliato!", + "minicraft.notification.obsidian_knight_defeated": "Cavaliere d'Ossidiana: sconfitto!", "minicraft.notification.quest_completed": "Quest completata", "minicraft.notification.quest_unlocked": "Quest sbloccata", + "minicraft.notification.spawn_on_boss_tile": "Può essere evocato solo in una Stanza del Boss", "minicraft.notification.world_saved": "Mondo salvato!", - "minicraft.notification.wrong_level_sky": "Può essere evocato solo al livello del cielo", - "minicraft.settings.fps": "Massimo FPS", - "minicraft.settings.difficulty": "Difficoltà", - "minicraft.settings.difficulty.easy": "Facile", - "minicraft.settings.difficulty.normal": "Normale", - "minicraft.settings.difficulty.hard": "Difficile", - "minicraft.settings.mode": "Modaligà di gioco", - "minicraft.settings.mode.survival": "Sopravvivenza", - "minicraft.settings.mode.creative": "Creativa", - "minicraft.settings.mode.hardcore": "Hardcore", - "minicraft.settings.mode.score": "Punteggio", - "minicraft.settings.scoretime": "Tempo (Modalità a Punteggio)", - "minicraft.settings.screenshot_scale": "Proporzioni Screenshot", - "minicraft.settings.sound": "Suono", - "minicraft.settings.autosave": "Autosalvataggio", - "minicraft.settings.size": "Dimensione mondo", - "minicraft.settings.theme": "Tema mondo", - "minicraft.settings.theme.normal": "Normale", - "minicraft.settings.theme.forest": "Foresta", - "minicraft.settings.theme.desert": "Deserto", - "minicraft.settings.theme.plain": "Pianura", - "minicraft.settings.theme.hell": "Inferno", - "minicraft.settings.type": "Tipo di terreno", - "minicraft.settings.type.island": "Isola", - "minicraft.settings.type.box": "Scatola", - "minicraft.settings.type.mountain": "Montagna", - "minicraft.settings.type.irregular": "Irregolare", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul col mantello", - "minicraft.skin.minecraft_steve": "Ragazzo familiare", - "minicraft.skin.minecraft_alex": "Ragazza familiare", - "minicraft.text_particales.key_consumed": "-1 chiave", - "Death Chest": "Cassa della morte", - "Player": "Giocatore", - "Leather Armor": "Armatura di pelle", - "Snake Armor": "Armatura di serpenti", - "Iron Armor": "Armatura di ferro", - "Gold Armor": "Armatura d'oro", - "Gem Armor": "Armatura di gemma", - "Book": "Libro", - "Antidious": "Antidoto", - "Empty Bucket": "Secchio vuoto", - "Water Bucket": "Secchio d'acqua", - "Lava Bucket": "Secchio di lava", - "Red Clothes": "Vestiti rossi", - "Blue Clothes": "Vestiti blu", - "Green Clothes": "Vestiti verdi", - "Yellow Clothes": "Vestiti gialli", - "Black Clothes": "Vestiti neri", - "Orange Clothes": "Vestiti arancioni", - "Purple Clothes": "Vestiti viola", - "Cyan Clothes": "Vestiti ciano", - "Reg Clothes": "Vestiti regolari", - "Bread": "Pane", - "Apple": "Mela", - "Raw Pork": "Maiale crudo", - "Raw Fish": "Pesce crudo", - "Raw Beef": "Manzo crudo", - "Pork Chop": "Carne di maiale cruda", - "Cooked Fish": "Pesce cotto", - "Cooked Pork": "Carne di maiale cotta", - "Steak": "Bistecca", - "Gold Apple": "Mela d'oro", - "Baked Potato": "Patata cotta", - "Cow Spawner": "Generatore di mucche", - "Pig Spawner": "Generatore di maiali", - "Sheep Spawner": "Generatore di pecore", - "Slime Spawner": "Generatore di slime", - "Zombie Spawner": "Generatore di zombie", - "Creeper Spawner": "Generatore di creeper", - "Skeleton Spawner": "Generatore di scheletri", - "Snake Spawner": "Generatore di serpenti", - "Knight Spawner": "Generatore di cavalieri", - "AirWizard Spawner": "Generatore di maghi del vento", - "Workbench": "Banco da lavoro", - "Oven": "Forno", - "Furnace": "Fornace", - "Anvil": "Incudine", - "Enchanter": "Incantatore", - "Loom": "Telaio", - "Lantern": "Lanterna", - "Iron Lantern": "Lanterna di ferro", - "Gold Lantern": "Lanterna d'oro", - "Tnt": "TNT", - "Bed": "Letto", - "Chest": "Cassa", - "None Potion": "Pozione vuota", - "Speed Potion": "Pozione di velocità", - "Light Potion": "Pozione di luce", - "Swim Potion": "Pozione di nuoto", - "Energy Potion": "Pozione di energia", - "Regen Potion": "Pozione di rigenerazione", - "Health Potion": "Pozione di salute", - "Time Potion": "Pozione del tempo", - "Lava Potion": "Pozione di resistenza alla lava", - "Shield Potion": "Pozione scudo", - "Haste Potion": "Pozione di rapidità", - "Escape Potion": "Pozione di fuga", - "Potion": "Pozione", - "Power Glove": "Guanto potente", - "Wood": "Legno", - "Stone": "Pietra", - "Leather": "Pelle", - "Wheat": "Grano", - "Key": "Chiave", - "Coal": "Carbone", - "Iron Ore": "Ferro grezzo", - "Gold Ore": "Oro grezzo", - "Gem Ore": "Gemma grezza", - "Cloud Ore": "Oro del cielo", - "Iron": "Ferro", - "Gold": "Oro", - "Lapis": "Lapislazzuli", - "Rose": "Rosa", - "Gunpowder": "Polvere da sparo", - "Slime": "Slime", - "Scale": "Squama", - "Shard": "Coccio", - "Flower": "Fiore", - "Acorn": "Ghianda", - "Dirt": "Terra", - "Natural Rock": "Roccia naturale", - "Plank": "Assi", - "Plank Wall": "Muro d'assi", - "Wood Door": "Porta di legno", - "Stone Brick": "Mattone di pietra", - "Ornate Stone": "Pietra ornamentale", - "Stone Wall": "Muro di pietra", - "Stone Door": "Porta di pietra", - "Obsidian Brick": "Mattone d'ossidiana", - "Ornate Obsidian": "Ornamento d'ossidiana", - "Obsidian Wall": "Muro d'ossidiana", - "Obsidian Door": "Porta d'ossidiana", - "Wool": "Lana", - "Red Wool": "Lana rossa", - "Blue Wool": "Lana blu", - "Green Wool": "Lana verde", - "Yellow Wool": "Lana gialla", - "Black Wool": "Lana nera", - "Sand": "Sabbia", - "Cactus": "Cactus", - "Seeds": "Semi", - "Wheat Seeds": "Semi di grano", - "Grass Seeds": "Semi d'erba", - "Bone": "Ossa", - "Cloud": "Nuvola", - "Rock": "Roccia", - "Gem": "Gemma", - "Potato": "Patata", - "Wood Fishing Rod": "Canna da pesca di legno", - "Iron Fishing Rod": "Canna da pesca di ferro", - "Gold Fishing Rod": "Canna da pesca d'oro", - "Gem Fishing Rod": "Canna da pesca di gemme", - "Shovel": "Pala", - "Hoe": "Zappa", - "Sword": "Spada", - "Pickaxe": "Piccone", - "Axe": "Ascia", - "Bow": "Arco", - "Claymore": "Claymore", - "Shears": "Cesoie", - "Torch": "Torcia", - "Wood Planks": "Assi di legno", - "Stone Bricks": "Mattoni di ferro", - "Obsidian": "Ossidiana", - "Wood Wall": "Muro di legno", - "Grass": "Erba", - "Hole": "Buco", - "Stairs Up": "Scale in sù", - "Stairs Down": "Scale in giù", - "Water": "Acqua", - "Tree": "Albero", - "Tree Sapling": "Alberello", - "Cactus Sapling": "Alberello di cactus", - "Lava": "Lava", - "Lava Brick": "Mattoni di lava", - "Explode": "Esplodi", - "Farmland": "Terreno da coltivare", - "Hard Rock": "Terra dura", - "Infinite Fall": "Caduta infinita", - "Cloud Cactus": "Cactus di nuvole", - "Raw Obsidian": "Ossidiana grezza", - "Totem of Air": "Totem dell'aria", - "minicraft.control_guide.attack": "Usa %s per attaccare i mostri o distruggere le piastrelle.", - "minicraft.control_guide.craft": "Usa %s per aprire il menù di creazione.", - "minicraft.control_guide.menu": "Usa %s per aprire l'inventario.", - "minicraft.control_guide.move": "Usa %s per muoverti.", - "minicraft.displays.controls": "Controlli", - "minicraft.displays.controls.display.controller": "Joystick", - "minicraft.displays.controls.display.controller.00": "Muovi il giocatore con gli analogici", - "minicraft.displays.controls.display.controller.01": "Muovi il cursore con gli analogici", - "minicraft.displays.controls.display.controller.02": "Seleziona con il tasto A", - "minicraft.displays.controls.display.controller.03": "Esci dalle pagine con il tasto B", - "minicraft.displays.controls.display.controller.04": "Attaccare entità, distruggere e interagire con la piestrelle con il tasto A", - "minicraft.displays.controls.display.controller.05": "Aprire i menù di gioco con il tasto X", - "minicraft.displays.controls.display.controller.06": "Aprire i menù di creazione con il tasto Y", - "minicraft.displays.controls.display.controller.07": "Raccogli gli arredamenti con il Grilletto di Sinistra", - "minicraft.displays.controls.display.controller.08": "Butta un oggetto con il Grilletto di Destra", - "minicraft.displays.controls.display.controller.09": "Butta una pila di oggetti schiacciando l'Analogico di Destra", - "minicraft.displays.controls.display.controller.10": "Usa il tasto START per Attivare/Disattivare la barra di ricerca nel menù dell'oggetto", - "minicraft.displays.controls.display.controller.11": "Usa il tasto START per mettere in pausa il gioco", - "minicraft.displays.controls.display.controller.12": "Usa il tasto X per Attivare/Disattivare la tastiera a schermo", - "minicraft.displays.controls.display.controller.13": "Usa il tasto B come scorciatoia per lo spazio nella tastiera a schermo", - "minicraft.displays.controls.display.controller.14": "Usa il tasto X per rimuovere l'oggetto selezionato nell'inventario in modalità creativa", - "minicraft.displays.controls.display.controller.15": "Usa il tasto Y per rimuovere un'intera pila di oggetti dall'inventario in modalità creativa", - "minicraft.displays.controls.display.controller.desc.0": "Debugging delle mappe non accessibile", - "minicraft.displays.controls.display.controller.desc.1": "Mappe Dettagliate non utilizzabili", - "minicraft.displays.controls.display.help.0": "%s/%s per vedere altri controlli.", - "minicraft.displays.controls.display.keyboard": "Tastiera", - "minicraft.displays.controls.display.keyboard.00": "Muovere il giocatore con MOVIMENTO-(DIREZIONE)", - "minicraft.displays.controls.display.keyboard.01": "Muovere il cursore con CURSORE-(DIREZIONE)", - "minicraft.displays.controls.display.keyboard.02": "Seleziona con il tasto SELEZIONA", - "minicraft.displays.controls.display.keyboard.03": "Esci dalle pagine con il tasto ESCI", - "minicraft.displays.controls.display.keyboard.04": "Salvataggio rapido con SALVATAGGIO-RAPIDO", - "minicraft.displays.controls.display.keyboard.05": "Attaccare entità, distruggere e interagire con le piastrelle con ATTACCO", - "minicraft.displays.controls.display.keyboard.06": "Aprire i menù di gioco con MENU", - "minicraft.displays.controls.display.keyboard.07": "Aprire i menù di creazione con CREAZIONE", - "minicraft.displays.controls.display.keyboard.08": "Raccogli gli arredamenti con RACCOLTA", - "minicraft.displays.controls.display.keyboard.09": "Butta un oggetto con BUTTA-UNO", - "minicraft.displays.controls.display.keyboard.10": "Butta una pila di oggetti con BUTTA-PILA", - "minicraft.displays.controls.display.keyboard.11": "Usa BARRA-DI-RICERCA per Attivare/Disattivare la barra di ricerca nel menù dell'oggetto", - "minicraft.displays.controls.display.keyboard.12": "Consulta i risultati di ricerca con PAGINA-SU/GIU'", - "minicraft.displays.controls.display.keyboard.13": "Usa PAUSA per mettere in pausa il gioco", - "minicraft.displays.controls.display.keyboard.14": "Attiva/Disattiva gli effetti della pozione con POZIONEEFFETTI", - "minicraft.displays.controls.display.keyboard.15": "Attiva/Disattiva la semplificazione delle pozioni con POZIONEEFFETTISEMPL", - "minicraft.displays.controls.display.keyboard.16": "Espanzione moderata della schermata delle quest con QUESTSCHERMATAESPANDI", - "minicraft.displays.controls.display.keyboard.17": "Attiva/Disattiva l'HDU con ALTERNAHUD", - "minicraft.displays.controls.display.keyboard.18": "Fai uno screenshot con SCREENSHOT", - "minicraft.displays.controls.display.keyboard.19": "Mostra informazioni in-gioco con INFO", - "minicraft.displays.controls.display.keyboard.20": "Attiva/Disattiva lo schermo intero con SCHERMOINTERO", - "minicraft.displays.controls.display.keyboard.21": "Usa D per rimuovere l'oggetto selezionato dall'inventario in modalità creativa", - "minicraft.displays.controls.display.keyboard.22": "Usa MAIUSC-D per rimuovere l'intera pila di articoli nell'inventario in modalità creativa", - "minicraft.displays.controls.display.keyboard.desc": "Debug delle mappe non spiegato", - "minicraft.displays.loading.message.dungeon_regeneration": "Rigenerazione B4", - "minicraft.displays.loading.message.quests": "Quest", - "minicraft.displays.loading.regeneration_popup.display.0": "Una vecchia versione del dungeon (piano B4) è stata rilevata.", - "minicraft.displays.loading.regeneration_popup.display.1": "Rigenerazione necessaria.", - "minicraft.displays.loading.regeneration_popup.display.2": "I dati vecchi in quel piano verranno cancellati:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s per continuare", - "minicraft.displays.loading.regeneration_popup.display.4": "%s per annullare il caricamento del mondo", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "Caricamento del mondo annullato", - "minicraft.displays.quests.display.no_quest": "Nessuna quest sbloccata", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Sono accettati solo input dalla tastiera.", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Premere %s per esaminare i dettagli del tutorial attuale.", - "minicraft.notification.obsidian_knight_defeated": "Cavaliere d'Ossidiana: sconfitto!", - "minicraft.notification.obsidian_knight_awoken": "Il Cavaliere d'Ossidiana si è risvegliato!", - "minicraft.notification.defeat_obsidian_knight_first": "Devi prima sconfiggere il Cavaliere d'Ossidiana.", "minicraft.notification.wrong_level_dungeon": "Può essere evocato solo al livello dei dungeon", - "minicraft.notification.boss_limit": "Non possono essere generati altri boss", - "minicraft.notification.spawn_on_boss_tile": "Può essere evocato solo in una Stanza del Boss", + "minicraft.notification.wrong_level_sky": "Può essere evocato solo al livello del cielo", "minicraft.notifications.statue_tapped": "Senti echeggiare dei sussurri...", "minicraft.notifications.statue_touched": "Senti vibrare la statua...", "minicraft.quest.farming": "Contadino che lavora", @@ -450,6 +426,37 @@ "minicraft.quest.potions.description": "Ottenere le pozioni.", "minicraft.quest.potions.powerful_potions": "Pozioni potenti", "minicraft.quest.potions.powerful_potions.description": "Ottenere pozioni utili e potenti.", + "minicraft.settings.autosave": "Autosalvataggio", + "minicraft.settings.difficulty": "Difficoltà", + "minicraft.settings.difficulty.easy": "Facile", + "minicraft.settings.difficulty.hard": "Difficile", + "minicraft.settings.difficulty.normal": "Normale", + "minicraft.settings.fps": "Massimo FPS", + "minicraft.settings.mode": "Modaligà di gioco", + "minicraft.settings.mode.creative": "Creativa", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Punteggio", + "minicraft.settings.mode.survival": "Sopravvivenza", + "minicraft.settings.scoretime": "Tempo (Modalità a Punteggio)", + "minicraft.settings.screenshot_scale": "Proporzioni Screenshot", + "minicraft.settings.size": "Dimensione mondo", + "minicraft.settings.sound": "Suono", + "minicraft.settings.theme": "Tema mondo", + "minicraft.settings.theme.desert": "Deserto", + "minicraft.settings.theme.forest": "Foresta", + "minicraft.settings.theme.hell": "Inferno", + "minicraft.settings.theme.normal": "Normale", + "minicraft.settings.theme.plain": "Pianura", + "minicraft.settings.type": "Tipo di terreno", + "minicraft.settings.type.box": "Scatola", + "minicraft.settings.type.irregular": "Irregolare", + "minicraft.settings.type.island": "Isola", + "minicraft.settings.type.mountain": "Montagna", + "minicraft.skin.minecraft_alex": "Ragazza familiare", + "minicraft.skin.minecraft_steve": "Ragazzo familiare", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul col mantello", + "minicraft.text_particales.key_consumed": "-1 chiave", "minicraft.tutorial.getting_rocks": "Ottenere Pietra e Carbone", "minicraft.tutorial.getting_rocks.description": "Ottenere almeno 5 oggetti di Pietra e 5 di Carbone distruggendo rocce con la piccozza craftata.", "minicraft.tutorial.getting_wood": "Ottenere più legno", @@ -459,15 +466,5 @@ "minicraft.tutorial.getting_workbench": "Ottenere un bagno di lavoro", "minicraft.tutorial.getting_workbench.description": "Creare un banco di lavoro nel menù di creazione. E piazzarlo.", "minicraft.tutorial.start_getting_wood": "L'inizio di tutto", - "minicraft.tutorial.start_getting_wood.description": "Attacca continuamente gli alberi per ottenere il legno.", - "minicraft.display.options_display.language": "Lingua", - "minicraft.display.options_display.resource_packs": "Pacchetti di risorse", - "minicraft.displays.language_settings.title": "Lingua...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Freccia", - "String": "Corda", - "Glass": "Vetro", - "Cloth": "Stoffa" + "minicraft.tutorial.start_getting_wood.description": "Attacca continuamente gli alberi per ottenere il legno." } diff --git a/src/client/resources/assets/localization/nb-no.json b/src/client/resources/assets/localization/nb-no.json index b11f91dd6..3c114fcdd 100644 --- a/src/client/resources/assets/localization/nb-no.json +++ b/src/client/resources/assets/localization/nb-no.json @@ -1,36 +1,195 @@ { - "minicraft.achievement.woodcutter": "Woodcutter", - "minicraft.achievement.woodcutter.desc": "Få tak i tre.", + "Acorn": "Eikenøtt", + "AirWizard Spawner": "LuftTrollmann Spawner", + "Antidious": "Antidious", + "Anvil": "Ambolt", + "Apple": "Eple", + "Arrow": "Pil", + "Axe": "Øks", + "Baked Potato": "Bakt Potet", + "Bed": "Seng", + "Black Clothes": "Svarte Klær", + "Black Wool": "Svart Ull", + "Blue Clothes": "Blå Klær", + "Blue Wool": "Blå Ull", + "Bone": "Bein", + "Book": "Bok", + "Bow": "Bue", + "Bread": "Brød", + "Cactus": "Kaktus", + "Cactus Sapling": "Kaktus Spire", + "Chest": "Kiste", + "Claymore": "Claymore", + "Cloth": "Tøystykke", + "Cloud": "Sky", + "Cloud Cactus": "Sky kaktus", + "Cloud Ore": "Sky malm", + "Coal": "Kull", + "Cooked Fish": "Kokt fisk", + "Cooked Pork": "Stekt svinekjøtt", + "Cow Spawner": "Ku Spawner", + "Creeper Spawner": "Creeper Spawner", + "Cyan Clothes": "Cyan Klær", + "Death Chest": "Døds Kiste", + "Dirt": "Jord", + "Empty Bucket": "Tom Bøtte", + "Enchanter": "Forhekser", + "Energy Potion": "Energi Trylledrikk", + "Escape Potion": "Forsvinnelses Trylledrikk", + "Explode": "Eksploder", + "Farmland": "Dyrket mark", + "Flower": "Blomst", + "Furnace": "Ovn", + "Gem": "Juvel", + "Gem Armor": "Juvel rustning", + "Gem Fishing Rod": "Juvel Fiskestang", + "Gem Ore": "Juvel malm", + "Glass": "Glass", + "Gold": "Gull", + "Gold Apple": "Gull Eple", + "Gold Armor": "Gull rustning", + "Gold Fishing Rod": "Gull Fiskestang", + "Gold Lantern": "Gull Lykt", + "Gold Ore": "Gullmalm", + "Grass": "Gress", + "Grass Seeds": "Grass Frø", + "Green Clothes": "Grønne Klær", + "Green Wool": "Grønn Ull", + "Gunpowder": "Krutt", + "Hard Rock": "Hard Stein", + "Haste Potion": "Hastighet Trylledrikk", + "Health Potion": "Helse Trylledrikk", + "Hoe": "Ljå", + "Hole": "Hull", + "Infinite Fall": "Uendelig Fall", + "Iron": "Jern", + "Iron Armor": "Jern rustning", + "Iron Fishing Rod": "Jern Fiskestang", + "Iron Lantern": "Jern Lykt", + "Iron Ore": "Jernmalm", + "Key": "Nøkkel", + "Knight Spawner": "Ridder Spawner", + "Lantern": "Lykt", + "Lapis": "Lapis", + "Lava": "Lava", + "Lava Brick": "Lava Murstein", + "Lava Bucket": "Lava Bøtte", + "Lava Potion": "Lava Trylledrikk", + "Leather": "Lær", + "Leather Armor": "Lær rustning", + "Light Potion": "Lys Trylledrikk", + "Loom": "Vevstol", + "Natural Rock": "Naturstein", + "None Potion": "Ingen Trylledrikk", + "Obsidian": "Lavastein", + "Obsidian Brick": "Lavastein murstein", + "Obsidian Door": "Lavastein dør", + "Obsidian Wall": "Lavastein vegg", + "Orange Clothes": "Oransje Klær", + "Ornate Obsidian": "Dekorert Obsidian", + "Ornate Stone": "Dekorert Stone", + "Oven": "Stekeovn", + "Pickaxe": "Hakke", + "Pig Spawner": "Gris Spawner", + "Plank": "Planke", + "Plank Wall": "Planke Vegg", + "Player": "Spiller", + "Pork Chop": "Svinekjøtt", + "Potato": "Potet", + "Potion": "Trylledrikk", + "Power Glove": "Kraft hanske", + "Purple Clothes": "Lilla Klær", + "Raw Beef": "Rå biff", + "Raw Fish": "Rå fisk", + "Raw Obsidian": "Rå obsidian", + "Raw Pork": "Rått svinekjøtt", + "Red Clothes": "Røde Klær", + "Red Wool": "Rød Ull", + "Reg Clothes": "Vanlige Klær", + "Regen Potion": "Regen Trylledrikk", + "Rock": "Stein", + "Rose": "Rose", + "Sand": "Sand", + "Scale": "skala", + "Seeds": "frø", + "Shard": "Fragment", + "Shears": "Saks", + "Sheep Spawner": "Sau Spawner", + "Shield Potion": "Skjold Trylledrikk", + "Shovel": "Spade", + "Skeleton Spawner": "Skjelett Spawner", + "Slime": "Slim", + "Slime Spawner": "Slim Spawner", + "Snake Armor": "Slange rustning", + "Snake Spawner": "Slange Spawner", + "Speed Potion": "Fart Trylledrikk", + "Stairs Down": "Trapp ned", + "Stairs Up": "Trapp opp", + "Steak": "Biff", + "Stone": "Stein", + "Stone Brick": "Stein murstein", + "Stone Bricks": "Stein murstein", + "Stone Door": "Stein dør", + "Stone Wall": "Stein vegg", + "String": "Tråd", + "Swim Potion": "Svomme Trylledrikk", + "Sword": "Sverd", + "Time Potion": "Tid Trylledrikk", + "Tnt": "TNT", + "Torch": "Fakkel", + "Totem of Air": "Totem av luft", + "Tree": "Tre", + "Tree Sapling": "Tre Spire", + "Water": "Vann", + "Water Bucket": "Vann Bøtte", + "Wheat": "Hvete", + "Wheat Seeds": "Hvete Frø", + "Wood": "Tre", + "Wood Door": "Tre dør", + "Wood Fishing Rod": "Tre Fiskestang", + "Wood Planks": "Treplanker", + "Wood Wall": "Tre vegg", + "Wool": "Ull", + "Workbench": "Arbeidsbenk", + "Yellow Clothes": "Gule Klær", + "Yellow Wool": "Gul Ull", + "Zombie Spawner": "Zombie Spawner", + "minicraft.achievement.airwizard": "Defeat... the air?", + "minicraft.achievement.airwizard.desc": "Beseire den første lufttrollmannen!", "minicraft.achievement.benchmarking": "Benchmarking", "minicraft.achievement.benchmarking.desc": "Lag en arbeidsbenk.", - "minicraft.achievement.upgrade": "Upgrade!", - "minicraft.achievement.upgrade.desc": "Få tak i et redskap med bedre materiell enn tre.", "minicraft.achievement.bow": "Bow down to me!", "minicraft.achievement.bow.desc": "Drep et monster med en bue.", - "minicraft.achievement.fish": "Go Fish!", - "minicraft.achievement.fish.desc": "Fisk opp en fisk.", - "minicraft.achievement.doors": "Adooring Protection", - "minicraft.achievement.doors.desc": "Plasser alle dørtyper", - "minicraft.achievement.planks": "Walk the Planks!", - "minicraft.achievement.planks.desc": "Plasser alle typer planke.", "minicraft.achievement.clothes": "Have a colourful day!", "minicraft.achievement.clothes.desc": "Lag alle mulige fargede klær.", "minicraft.achievement.demolition": "Demolition Demo", "minicraft.achievement.demolition.desc": "Bruk TNT.", - "minicraft.achievement.survive_darkness": "Afraid of the Dark?", - "minicraft.achievement.survive_darkness.desc": "Overlev 5 minutter i mørket.", - "minicraft.achievement.lava": "Hot Affairs", - "minicraft.achievement.lava.desc": "Bruk en lava potion for å svømme i lava.", + "minicraft.achievement.doors": "Adooring Protection", + "minicraft.achievement.doors.desc": "Plasser alle dørtyper", "minicraft.achievement.find_gem": "Oooh Shiny!", "minicraft.achievement.find_gem.desc": "Finn juvelmalm og utgrav den.", + "minicraft.achievement.fish": "Go Fish!", + "minicraft.achievement.fish.desc": "Fisk opp en fisk.", + "minicraft.achievement.lava": "Hot Affairs", + "minicraft.achievement.lava.desc": "Bruk en lava potion for å svømme i lava.", "minicraft.achievement.lowest_caves": "Darkness behind light", "minicraft.achievement.lowest_caves.desc": "Nå de dypeste huler.", "minicraft.achievement.obsidian_dungeon": "Of Knights and Men", "minicraft.achievement.obsidian_dungeon.desc": "Nå obsidian fangehullet.", - "minicraft.achievement.airwizard": "Defeat... the air?", - "minicraft.achievement.airwizard.desc": "Beseire den første lufttrollmannen!", + "minicraft.achievement.planks": "Walk the Planks!", + "minicraft.achievement.planks.desc": "Plasser alle typer planke.", "minicraft.achievement.skin": "Fashion Show", "minicraft.achievement.skin.desc": "Endre utseendet ditt.", + "minicraft.achievement.survive_darkness": "Afraid of the Dark?", + "minicraft.achievement.survive_darkness.desc": "Overlev 5 minutter i mørket.", + "minicraft.achievement.upgrade": "Upgrade!", + "minicraft.achievement.upgrade.desc": "Få tak i et redskap med bedre materiell enn tre.", + "minicraft.achievement.woodcutter": "Woodcutter", + "minicraft.achievement.woodcutter.desc": "Få tak i tre.", + "minicraft.control_guide.attack": "Bruk %s for å angripe eller ødelegge.", + "minicraft.control_guide.craft": "Bruk %s for å åpne skapermeny.", + "minicraft.control_guide.menu": "Bruk %s for å åpne inventar.", + "minicraft.control_guide.move": "Bruk %s for å bevege deg.", "minicraft.display.entries.boolean.false": "Av", "minicraft.display.entries.boolean.true": "På", "minicraft.display.gui.link_opening": "Åpner med nettleser...", @@ -53,6 +212,11 @@ "minicraft.displays.achievements.display.not_achieved": "Ikkje oppnådd", "minicraft.displays.achievements.display.score": "Stilling av oppnåelser: %s", "minicraft.displays.book.default_book": "Denne boka har ingen tekst.", + "minicraft.displays.controls": "Kontroller", + "minicraft.displays.controls.display.controller": "Spillkontroller", + "minicraft.displays.controls.display.controller.desc.1": "Detaljerte bindinskart er ubrukelige", + "minicraft.displays.controls.display.help.0": "%s/%s for å se andre kontroller.", + "minicraft.displays.controls.display.keyboard": "Tastatur", "minicraft.displays.crafting": "Skaping", "minicraft.displays.crafting.container_title.cost": "Koster:", "minicraft.displays.crafting.container_title.have": "Har:", @@ -77,8 +241,14 @@ "minicraft.displays.loading.message.level": "Nivå %s", "minicraft.displays.loading.message.levels": "Nivåer", "minicraft.displays.loading.message.loading": "Laster", + "minicraft.displays.loading.message.quests": "Oppgaver", "minicraft.displays.loading.message.saving": "Lagrer", "minicraft.displays.loading.message.world": "Verden", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Lasting av verden avbrutt", + "minicraft.displays.loading.regeneration_popup.display.1": "Regenereing er krevd.", + "minicraft.displays.loading.regeneration_popup.display.2": "Gammel informasjon på bakken vil bli slettet:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s for å fortsette", + "minicraft.displays.loading.regeneration_popup.display.4": "%s for å avbryte lastingen av verden", "minicraft.displays.options_main_menu": "Hovedmenyinstillinger", "minicraft.displays.options_main_menu.resource_packs": "Resurspakker", "minicraft.displays.options_world": "Verdensinstillinger", @@ -105,10 +275,12 @@ "minicraft.displays.quests": "Oppgaver", "minicraft.displays.quests.display.header.completed": "Ferdig", "minicraft.displays.quests.display.header.unlocked": "Låst opp", + "minicraft.displays.quests.display.no_quest": "Ingen oppgave låst opp", "minicraft.displays.quests.display.no_quest_desc": "Ingen oppgave", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Kun tastaturinndata er godtatt.", "minicraft.displays.resource_packs.display.help.move": "Brul %s og %s for bevege.", - "minicraft.displays.resource_packs.display.help.select": "%s for å eksaminere.", "minicraft.displays.resource_packs.display.help.position": "Shift-[Venstetast|Høyretast|Opptast|Nedtast] for å bevege ressurspakker. ", + "minicraft.displays.resource_packs.display.help.select": "%s for å eksaminere.", "minicraft.displays.resource_packs.display.title": "Resurspakker", "minicraft.displays.skin": "Drakter", "minicraft.displays.skin.display.help.move": "Bruk %s og %s for å bevege.", @@ -132,11 +304,11 @@ "minicraft.displays.title.play.new_world": "Ny verden", "minicraft.displays.title.quit": "Lukk spill", "minicraft.displays.title.select_to_download": "--Trykk her for å laste ned--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Trykk på %s for å se detaljene av spillmanualen.", "minicraft.displays.world_gen.create_world": "Lag verden", "minicraft.displays.world_gen.enter_world": "Skriv inn navnet til verdenen", "minicraft.displays.world_gen.title": "Verdengenerator-instillinger", "minicraft.displays.world_gen.troublesome_input": "Problemer med navnet til verdenen?", - "minicraft.displays.world_gen.troublesome_input.msg": "", "minicraft.displays.world_gen.world_seed": "Verdengenerator-frø", "minicraft.displays.world_select.display.help.0": "%s for å bekrefte", "minicraft.displays.world_select.display.help.1": "%s for å gå tilbake", @@ -152,6 +324,7 @@ "minicraft.displays.world_select.select_world": "Velg verden", "minicraft.notification.achievement_unlocked": "Oppnåelse låst opp:", "minicraft.notification.air_wizard_defeated": "Lufttrollmann bekjempet!", + "minicraft.notification.boss_limit": "Ingen flere hovedfiender kan bli tilkalt", "minicraft.notification.cannot_sleep": "Kan ikkje sove! %s:%s igjen!", "minicraft.notification.death_chest_retrieved": "Dødskiste plukket opp!", "minicraft.notification.defeat_air_wizard_first": "Lufttrollmannen må bekjempes først.", @@ -161,257 +334,10 @@ "minicraft.notification.invalid_placement": "Kan kun bli plassert på", "minicraft.notification.quest_completed": "Oppgave gjennomført", "minicraft.notification.quest_unlocked": "Oppgave låst opp", + "minicraft.notification.spawn_on_boss_tile": "Kan kun bli tilkalt i sluttrommet", "minicraft.notification.world_saved": "Lagret verden!", - "minicraft.notification.wrong_level_sky": "Kan kun bli framkalt i skyene", - "minicraft.settings.fps": "Maks FPS", - "minicraft.settings.difficulty": "Vanskelighetsgrad", - "minicraft.settings.difficulty.easy": "Lett", - "minicraft.settings.difficulty.normal": "Normal", - "minicraft.settings.difficulty.hard": "Vanskelig", - "minicraft.settings.mode": "Spillmodus", - "minicraft.settings.mode.survival": "Overlevelse", - "minicraft.settings.mode.creative": "Kreativ", - "minicraft.settings.mode.hardcore": "Hardcore", - "minicraft.settings.mode.score": "Stilling", - "minicraft.settings.scoretime": "Tid (Stillingmodus)", - "minicraft.settings.screenshot_scale": "Skala til skjermbilde", - "minicraft.settings.sound": "Lyd", - "minicraft.settings.autosave": "Lagre automatisk", - "minicraft.settings.size": "Størrelse på verden", - "minicraft.settings.theme": "Tema på verden", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Skog", - "minicraft.settings.theme.desert": "Ørken", - "minicraft.settings.theme.plain": "Slette", - "minicraft.settings.theme.hell": "Helvete", - "minicraft.settings.type": "Terrengtype", - "minicraft.settings.type.island": "Øy", - "minicraft.settings.type.box": "Boks", - "minicraft.settings.type.mountain": "Fjell", - "minicraft.settings.type.irregular": "Unormalt", - "minicraft.skin.paul": "Pål", - "minicraft.skin.paul_cape": "Pål med kappe", - "minicraft.skin.minecraft_steve": "Gjenkjennelig gutt", - "minicraft.skin.minecraft_alex": "Gjenkjennelig jente", - "minicraft.text_particales.key_consumed": "-1 nøkkel", - "Death Chest": "Døds Kiste", - "Player": "Spiller", - "Leather Armor": "Lær rustning", - "Snake Armor": "Slange rustning", - "Iron Armor": "Jern rustning", - "Gold Armor": "Gull rustning", - "Gem Armor": "Juvel rustning", - "Book": "Bok", - "Antidious": "Antidious", - "Empty Bucket": "Tom Bøtte", - "Water Bucket": "Vann Bøtte", - "Lava Bucket": "Lava Bøtte", - "Red Clothes": "Røde Klær", - "Blue Clothes": "Blå Klær", - "Green Clothes": "Grønne Klær", - "Yellow Clothes": "Gule Klær", - "Black Clothes": "Svarte Klær", - "Orange Clothes": "Oransje Klær", - "Purple Clothes": "Lilla Klær", - "Cyan Clothes": "Cyan Klær", - "Reg Clothes": "Vanlige Klær", - "Bread": "Brød", - "Apple": "Eple", - "Raw Pork": "Rått svinekjøtt", - "Raw Fish": "Rå fisk", - "Raw Beef": "Rå biff", - "Pork Chop": "Svinekjøtt", - "Cooked Fish": "Kokt fisk", - "Cooked Pork": "Stekt svinekjøtt", - "Steak": "Biff", - "Gold Apple": "Gull Eple", - "Baked Potato": "Bakt Potet", - "Cow Spawner": "Ku Spawner", - "Pig Spawner": "Gris Spawner", - "Sheep Spawner": "Sau Spawner", - "Slime Spawner": "Slim Spawner", - "Zombie Spawner": "Zombie Spawner", - "Creeper Spawner": "Creeper Spawner", - "Skeleton Spawner": "Skjelett Spawner", - "Snake Spawner": "Slange Spawner", - "Knight Spawner": "Ridder Spawner", - "AirWizard Spawner": "LuftTrollmann Spawner", - "Workbench": "Arbeidsbenk", - "Oven": "Stekeovn", - "Furnace": "Ovn", - "Anvil": "Ambolt", - "Enchanter": "Forhekser", - "Loom": "Vevstol", - "Lantern": "Lykt", - "Iron Lantern": "Jern Lykt", - "Gold Lantern": "Gull Lykt", - "Tnt": "TNT", - "Bed": "Seng", - "Chest": "Kiste", - "None Potion": "Ingen Trylledrikk", - "Speed Potion": "Fart Trylledrikk", - "Light Potion": "Lys Trylledrikk", - "Swim Potion": "Svomme Trylledrikk", - "Energy Potion": "Energi Trylledrikk", - "Regen Potion": "Regen Trylledrikk", - "Health Potion": "Helse Trylledrikk", - "Time Potion": "Tid Trylledrikk", - "Lava Potion": "Lava Trylledrikk", - "Shield Potion": "Skjold Trylledrikk", - "Haste Potion": "Hastighet Trylledrikk", - "Escape Potion": "Forsvinnelses Trylledrikk", - "Potion": "Trylledrikk", - "Power Glove": "Kraft hanske", - "Wood": "Tre", - "Stone": "Stein", - "Leather": "Lær", - "Wheat": "Hvete", - "Key": "Nøkkel", - "Coal": "Kull", - "Iron Ore": "Jernmalm", - "Gold Ore": "Gullmalm", - "Gem Ore": "Juvel malm", - "Cloud Ore": "Sky malm", - "Iron": "Jern", - "Gold": "Gull", - "Lapis": "Lapis", - "Rose": "Rose", - "Gunpowder": "Krutt", - "Slime": "Slim", - "Scale": "skala", - "Shard": "Fragment", - "Flower": "Blomst", - "Acorn": "Eikenøtt", - "Dirt": "Jord", - "Natural Rock": "Naturstein", - "Plank": "Planke", - "Plank Wall": "Planke Vegg", - "Wood Door": "Tre dør", - "Stone Brick": "Stein murstein", - "Ornate Stone": "Dekorert Stone", - "Stone Wall": "Stein vegg", - "Stone Door": "Stein dør", - "Obsidian Brick": "Lavastein murstein", - "Ornate Obsidian": "Dekorert Obsidian", - "Obsidian Wall": "Lavastein vegg", - "Obsidian Door": "Lavastein dør", - "Wool": "Ull", - "Red Wool": "Rød Ull", - "Blue Wool": "Blå Ull", - "Green Wool": "Grønn Ull", - "Yellow Wool": "Gul Ull", - "Black Wool": "Svart Ull", - "Sand": "Sand", - "Cactus": "Kaktus", - "Seeds": "frø", - "Wheat Seeds": "Hvete Frø", - "Grass Seeds": "Grass Frø", - "Bone": "Bein", - "Cloud": "Sky", - "Rock": "Stein", - "Gem": "Juvel", - "Potato": "Potet", - "Wood Fishing Rod": "Tre Fiskestang", - "Iron Fishing Rod": "Jern Fiskestang", - "Gold Fishing Rod": "Gull Fiskestang", - "Gem Fishing Rod": "Juvel Fiskestang", - "Shovel": "Spade", - "Hoe": "Ljå", - "Sword": "Sverd", - "Pickaxe": "Hakke", - "Axe": "Øks", - "Bow": "Bue", - "Claymore": "Claymore", - "Shears": "Saks", - "Torch": "Fakkel", - "Wood Planks": "Treplanker", - "Stone Bricks": "Stein murstein", - "Obsidian": "Lavastein", - "Wood Wall": "Tre vegg", - "Grass": "Gress", - "Hole": "Hull", - "Stairs Up": "Trapp opp", - "Stairs Down": "Trapp ned", - "Water": "Vann", - "Tree": "Tre", - "Tree Sapling": "Tre Spire", - "Cactus Sapling": "Kaktus Spire", - "Lava": "Lava", - "Lava Brick": "Lava Murstein", - "Explode": "Eksploder", - "Farmland": "Dyrket mark", - "Hard Rock": "Hard Stein", - "Infinite Fall": "Uendelig Fall", - "Cloud Cactus": "Sky kaktus", - "Raw Obsidian": "Rå obsidian", - "Totem of Air": "Totem av luft", - "minicraft.control_guide.attack": "Bruk %s for å angripe eller ødelegge.", - "minicraft.control_guide.craft": "Bruk %s for å åpne skapermeny.", - "minicraft.control_guide.menu": "Bruk %s for å åpne inventar.", - "minicraft.control_guide.move": "Bruk %s for å bevege deg.", - "minicraft.displays.controls": "Kontroller", - "minicraft.displays.controls.display.controller": "Spillkontroller", - "minicraft.displays.controls.display.controller.00": "", - "minicraft.displays.controls.display.controller.01": "", - "minicraft.displays.controls.display.controller.02": "", - "minicraft.displays.controls.display.controller.03": "", - "minicraft.displays.controls.display.controller.04": "", - "minicraft.displays.controls.display.controller.05": "", - "minicraft.displays.controls.display.controller.06": "", - "minicraft.displays.controls.display.controller.07": "", - "minicraft.displays.controls.display.controller.08": "", - "minicraft.displays.controls.display.controller.09": "", - "minicraft.displays.controls.display.controller.10": "", - "minicraft.displays.controls.display.controller.11": "", - "minicraft.displays.controls.display.controller.12": "", - "minicraft.displays.controls.display.controller.13": "", - "minicraft.displays.controls.display.controller.14": "", - "minicraft.displays.controls.display.controller.15": "", - "minicraft.displays.controls.display.controller.desc.0": "", - "minicraft.displays.controls.display.controller.desc.1": "Detaljerte bindinskart er ubrukelige", - "minicraft.displays.controls.display.help.0": "%s/%s for å se andre kontroller.", - "minicraft.displays.controls.display.keyboard": "Tastatur", - "minicraft.displays.controls.display.keyboard.00": "", - "minicraft.displays.controls.display.keyboard.01": "", - "minicraft.displays.controls.display.keyboard.02": "", - "minicraft.displays.controls.display.keyboard.03": "", - "minicraft.displays.controls.display.keyboard.04": "", - "minicraft.displays.controls.display.keyboard.05": "", - "minicraft.displays.controls.display.keyboard.06": "", - "minicraft.displays.controls.display.keyboard.07": "", - "minicraft.displays.controls.display.keyboard.08": "", - "minicraft.displays.controls.display.keyboard.09": "", - "minicraft.displays.controls.display.keyboard.10": "", - "minicraft.displays.controls.display.keyboard.11": "", - "minicraft.displays.controls.display.keyboard.12": "", - "minicraft.displays.controls.display.keyboard.13": "", - "minicraft.displays.controls.display.keyboard.14": "", - "minicraft.displays.controls.display.keyboard.15": "", - "minicraft.displays.controls.display.keyboard.16": "", - "minicraft.displays.controls.display.keyboard.17": "", - "minicraft.displays.controls.display.keyboard.18": "", - "minicraft.displays.controls.display.keyboard.19": "", - "minicraft.displays.controls.display.keyboard.20": "", - "minicraft.displays.controls.display.keyboard.21": "", - "minicraft.displays.controls.display.keyboard.22": "", - "minicraft.displays.controls.display.keyboard.desc": "", - "minicraft.displays.loading.message.dungeon_regeneration": "", - "minicraft.displays.loading.message.quests": "Oppgaver", - "minicraft.displays.loading.regeneration_popup.display.0": "", - "minicraft.displays.loading.regeneration_popup.display.1": "Regenereing er krevd.", - "minicraft.displays.loading.regeneration_popup.display.2": "Gammel informasjon på bakken vil bli slettet:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s for å fortsette", - "minicraft.displays.loading.regeneration_popup.display.4": "%s for å avbryte lastingen av verden", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "Lasting av verden avbrutt", - "minicraft.displays.quests.display.no_quest": "Ingen oppgave låst opp", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Kun tastaturinndata er godtatt.", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Trykk på %s for å se detaljene av spillmanualen.", - "minicraft.notification.obsidian_knight_defeated": "", - "minicraft.notification.obsidian_knight_awoken": "", - "minicraft.notification.defeat_obsidian_knight_first": "", "minicraft.notification.wrong_level_dungeon": "Kan kun bli tilkalt i hulen", - "minicraft.notification.boss_limit": "Ingen flere hovedfiender kan bli tilkalt", - "minicraft.notification.spawn_on_boss_tile": "Kan kun bli tilkalt i sluttrommet", + "minicraft.notification.wrong_level_sky": "Kan kun bli framkalt i skyene", "minicraft.notifications.statue_tapped": "Du hører gjenklang av kviskring...", "minicraft.notifications.statue_touched": "Du skimter at stuatuen vibrerer...", "minicraft.quest.farming": "Jordbrukende jordbruker", @@ -450,6 +376,37 @@ "minicraft.quest.potions.description": "Få tak i trylledrikkene.", "minicraft.quest.potions.powerful_potions": "Kraftige trylledrikker", "minicraft.quest.potions.powerful_potions.description": "Få tak i brukbare og kraftige trylledrikker.", + "minicraft.settings.autosave": "Lagre automatisk", + "minicraft.settings.difficulty": "Vanskelighetsgrad", + "minicraft.settings.difficulty.easy": "Lett", + "minicraft.settings.difficulty.hard": "Vanskelig", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "Maks FPS", + "minicraft.settings.mode": "Spillmodus", + "minicraft.settings.mode.creative": "Kreativ", + "minicraft.settings.mode.hardcore": "Hardcore", + "minicraft.settings.mode.score": "Stilling", + "minicraft.settings.mode.survival": "Overlevelse", + "minicraft.settings.scoretime": "Tid (Stillingmodus)", + "minicraft.settings.screenshot_scale": "Skala til skjermbilde", + "minicraft.settings.size": "Størrelse på verden", + "minicraft.settings.sound": "Lyd", + "minicraft.settings.theme": "Tema på verden", + "minicraft.settings.theme.desert": "Ørken", + "minicraft.settings.theme.forest": "Skog", + "minicraft.settings.theme.hell": "Helvete", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Slette", + "minicraft.settings.type": "Terrengtype", + "minicraft.settings.type.box": "Boks", + "minicraft.settings.type.irregular": "Unormalt", + "minicraft.settings.type.island": "Øy", + "minicraft.settings.type.mountain": "Fjell", + "minicraft.skin.minecraft_alex": "Gjenkjennelig jente", + "minicraft.skin.minecraft_steve": "Gjenkjennelig gutt", + "minicraft.skin.paul": "Pål", + "minicraft.skin.paul_cape": "Pål med kappe", + "minicraft.text_particales.key_consumed": "-1 nøkkel", "minicraft.tutorial.getting_rocks": "Få tak i stein og kull", "minicraft.tutorial.getting_rocks.description": "Få tak i minst 5 stein og 5 kull av å ødelegge stein med en hakke.", "minicraft.tutorial.getting_wood": "Få tak i mer tre", @@ -459,15 +416,5 @@ "minicraft.tutorial.getting_workbench": "Få tak i en arbeidsbenk", "minicraft.tutorial.getting_workbench.description": "Lag en arbeidsbenk i skapermenyen. Plasser den etterpå.", "minicraft.tutorial.start_getting_wood": "Starten på alt", - "minicraft.tutorial.start_getting_wood.description": "Slå trer for å få tak i tre.", - "minicraft.display.options_display.language": "", - "minicraft.display.options_display.resource_packs": "", - "minicraft.displays.language_settings.title": "", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Pil", - "String": "Tråd", - "Glass": "Glass", - "Cloth": "Tøystykke" + "minicraft.tutorial.start_getting_wood.description": "Slå trer for å få tak i tre." } diff --git a/src/client/resources/assets/localization/nl-nl.json b/src/client/resources/assets/localization/nl-nl.json index 11c9208a8..b4d2c537c 100644 --- a/src/client/resources/assets/localization/nl-nl.json +++ b/src/client/resources/assets/localization/nl-nl.json @@ -1,36 +1,192 @@ { - "minicraft.achievement.woodcutter": "Houthakker", - "minicraft.achievement.woodcutter.desc": "Krijg hout.", + "Acorn": "Eikel", + "AirWizard Spawner": "Lucht Tovenaar Spawner", + "Antidious": "Tegendraads", + "Anvil": "Aambeeld", + "Apple": "Appel", + "Axe": "Bijl", + "Baked Potato": "Gebakken Aardappel", + "Bed": "Bed", + "Black Clothes": "Zwarte Kleren", + "Black Wool": "Zwart Wol", + "Blue Clothes": "Blauwe Kleren", + "Blue Wool": "Blauw Wol", + "Bone": "Bot", + "Book": "Boek", + "Bow": "Boog", + "Bread": "Brood", + "Cactus": "Cactus", + "Cactus Sapling": "Cactus Kiemplant", + "Chest": "Kist", + "Claymore": "Claymore", + "Cloud": "Wolk", + "Cloud Cactus": "Wolk Cactus", + "Cloud Ore": "Wolk Erts", + "Coal": "Steenkool", + "Cooked Fish": "Gekookte Vis", + "Cooked Pork": "Gebraden Varkensvlees", + "Cow Spawner": "Koe Spawner", + "Creeper Spawner": "Creeper Spawner", + "Cyan Clothes": "Cyaan Kleren", + "Death Chest": "Doodskist", + "Dirt": "Aarde", + "Empty Bucket": "Lege Emmer", + "Enchanter": "Betoveraar", + "Energy Potion": "Energie Drank", + "Escape Potion": "Onstappings Drank", + "Explode": "Explodeer", + "Farmland": "Akkerland", + "Flower": "Bloem", + "Furnace": "Smeltoven", + "Gem": "Edelsteen", + "Gem Armor": "Edelsteen Uitrusting", + "Gem Fishing Rod": "Edelsteen Vishengel", + "Gem Ore": "Edelsteen Erts", + "Gold": "Goud", + "Gold Apple": "Gouden Appel", + "Gold Armor": "Gouden Uitrusting", + "Gold Fishing Rod": "Gouden Vishengel", + "Gold Lantern": "Gouden Lantaarn", + "Gold Ore": "Gouderts", + "Grass": "Gras", + "Grass Seeds": "Gras Zaden", + "Green Clothes": "Groene Kleren", + "Green Wool": "Groen Wol", + "GunPowder": "Buskruit", + "Gunpowder": "Buskruit", + "Hard Rock": "Hard Steen", + "Haste Potion": "Haast Drank", + "Health Potion": "Genezings Drank", + "Hoe": "Schoffel", + "Hole": "Put", + "Infinite Fall": "Oneindige Val", + "Iron": "Ijzer", + "Iron Armor": "Ijzeren Uitrusting", + "Iron Fishing Rod": "Ijzeren Vishengel", + "Iron Lantern": "Ijzeren Lantaarn", + "Iron Ore": "Ijzererts", + "Key": "Sleutel", + "Knight Spawner": "Ridder Spawner", + "Lantern": "Lantaarn", + "Lapis": "Lapis", + "Lava": "Lava", + "Lava Brick": "Lava Baksteen", + "Lava Bucket": "Emmer met Lava", + "Lava Potion": "Lava Drank", + "Leather": "Leer", + "Leather Armor": "Leren Uitrusting", + "Light Potion": "Licht Drank", + "Loom": "Weefgetouw", + "Natural Rock": "Natuurlijke Steen", + "None Potion": "Geen Drank", + "Obsidian": "Obsidiaan", + "Obsidian Brick": "Obsidaan Baksteen", + "Obsidian Door": "Obsidiaan Muur", + "Obsidian Wall": "Obsidiaan Muur", + "Orange Clothes": "Oranje Kleren", + "Ornate Obsidian": "Sierlijk Obsidiaan", + "Ornate Stone": "Sierlijk Steen", + "Oven": "Oven", + "Pickaxe": "Pikhouweel", + "Pig Spawner": "Varken Spawner", + "Plank": "Plank", + "Plank Wall": "Planken Muur", + "Player": "Speler", + "Pork Chop": "Varkensvlees", + "Potato": "Aardappel", + "Potion": "Drank", + "Power Glove": "Power Handschoen", + "Purple Clothes": "Paarse Kleren", + "Raw Beef": "Rauw Biefstuk", + "Raw Fish": "Rauwe Vis", + "Raw Obsidian": "Rauw Obsidiaan", + "Raw Pork": "Rauw Varkensvlees", + "Red Clothes": "Rode Kleren", + "Red Wool": "Rood Wol", + "Reg Clothes": "Reg Kleren", + "Regen Potion": "Regeneratie Drank", + "Rock": "Rots", + "Rose": "Roos", + "Sand": "Zand", + "Scale": "Grootte", + "Seeds": "Zaden", + "Shard": "Scherf", + "Shears": "Schaar", + "Sheep Spawner": "Schaap Spawner", + "Shield Potion": "Schild Drank", + "Shovel": "Schep", + "Skeleton Spawner": "Skelet Spawner", + "Slime": "Slijm", + "Slime Spawner": "Slijm Spawner", + "Snake Armor": "Slangen Uitrusting", + "Snake Spawner": "Slang Spawner", + "Speed Potion": "Snelheids Drank", + "Stairs Down": "Trappen Omloog", + "Stairs Up": "Trappen Omhoog", + "Steak": "Biefstuk", + "Stone": "Steen", + "Stone Brick": "Stenen Baksteen", + "Stone Bricks": "Stenen Bakstenen", + "Stone Door": "Stenen Deur", + "Stone Wall": "Stenen Muur", + "Swim Potion": "Zwem Drank", + "Sword": "Zwaard", + "Time Potion": "Tijd Drank", + "Tnt": "Tnt", + "Torch": "Toorts", + "Totem of Air": "Totem van de Lucht", + "Tree": "Boom", + "Tree Sapling": "Boom Kiemplant", + "Water": "Water", + "Water Bucket": "Emmer met Water", + "Wheat": "Tarwe", + "Wheat Seeds": "Tarwe Zaden", + "Wood": "Hout", + "Wood Door": "Houten Deur", + "Wood Fishing Rod": "Houten Vishengel", + "Wood Planks": "Houten Planken", + "Wood Wall": "Houten Muur", + "Wool": "Wol", + "Workbench": "Werkbank", + "Yellow Clothes": "Gele Kleren", + "Yellow Wool": "Geel Wol", + "Zombie Spawner": "Zombie Spawner", + "minicraft.achievement.airwizard": "Versla... de lucht?", + "minicraft.achievement.airwizard.desc": "Versla de eerste Lucht Tovenaar!", "minicraft.achievement.benchmarking": "Benchmarking", "minicraft.achievement.benchmarking.desc": "Maak een werkbank.", - "minicraft.achievement.upgrade": "Upgrade!", - "minicraft.achievement.upgrade.desc": "Maak een stenen werktuig.", "minicraft.achievement.bow": "Buig voor mij!", "minicraft.achievement.bow.desc": "Schiet een pijl met een boog.", - "minicraft.achievement.fish": "Ga Vissen!", - "minicraft.achievement.fish.desc": "Vis een Vis!", - "minicraft.achievement.doors": "Met de deur in huis vallen", - "minicraft.achievement.doors.desc": "Maak een houten deur.", - "minicraft.achievement.planks": "De Planken Lopen!", - "minicraft.achievement.planks.desc": "Maak houten planken.", "minicraft.achievement.clothes": "Heb een kleurrijke dag!", "minicraft.achievement.clothes.desc": "Maak kleren met een kleur", "minicraft.achievement.demolition": "Ouwe slopert!", "minicraft.achievement.demolition.desc": "Gebruik TNT.", - "minicraft.achievement.survive_darkness": "Bang van het Donker?", - "minicraft.achievement.survive_darkness.desc": "Overleef 5 minuten in totale duisternis.", - "minicraft.achievement.lava": "Hete Zaken", - "minicraft.achievement.lava.desc": "Gebruik een lava brouwsel om in lava te zwemmen.", + "minicraft.achievement.doors": "Met de deur in huis vallen", + "minicraft.achievement.doors.desc": "Maak een houten deur.", "minicraft.achievement.find_gem": "Oooh glimmend!", "minicraft.achievement.find_gem.desc": "Zoek een Juweel Steen and hak het.", + "minicraft.achievement.fish": "Ga Vissen!", + "minicraft.achievement.fish.desc": "Vis een Vis!", + "minicraft.achievement.lava": "Hete Zaken", + "minicraft.achievement.lava.desc": "Gebruik een lava brouwsel om in lava te zwemmen.", "minicraft.achievement.lowest_caves": "Duisternis achter licht", "minicraft.achievement.lowest_caves.desc": "Bereik de laagste grotten.", "minicraft.achievement.obsidian_dungeon": "Van Ridders en Men", "minicraft.achievement.obsidian_dungeon.desc": "Bereik de obsidiaan kerker.", - "minicraft.achievement.airwizard": "Versla... de lucht?", - "minicraft.achievement.airwizard.desc": "Versla de eerste Lucht Tovenaar!", + "minicraft.achievement.planks": "De Planken Lopen!", + "minicraft.achievement.planks.desc": "Maak houten planken.", "minicraft.achievement.skin": "Mode Show", "minicraft.achievement.skin.desc": "Verander jouw uiterlijk.", + "minicraft.achievement.survive_darkness": "Bang van het Donker?", + "minicraft.achievement.survive_darkness.desc": "Overleef 5 minuten in totale duisternis.", + "minicraft.achievement.upgrade": "Upgrade!", + "minicraft.achievement.upgrade.desc": "Maak een stenen werktuig.", + "minicraft.achievement.woodcutter": "Houthakker", + "minicraft.achievement.woodcutter.desc": "Krijg hout.", + "minicraft.control_guide.attack": "Gebruik %s om monsters aan te vallen of om tegels te verwoesten.", + "minicraft.control_guide.craft": "Gebruik %s om je werk menu te openen.", + "minicraft.control_guide.menu": "Gebruik %s om je inventaris te openen.", + "minicraft.control_guide.move": "Gebruik %s om te bewegen.", "minicraft.display.entries.boolean.false": "Uit", "minicraft.display.entries.boolean.true": "Aan", "minicraft.display.gui.link_opening": "Aan het openen met web browser...", @@ -53,6 +209,19 @@ "minicraft.displays.achievements.display.not_achieved": "Nog niet behaald", "minicraft.displays.achievements.display.score": "Prestatie Score: %s", "minicraft.displays.book.default_book": "Dit boek heeft geen tekst.", + "minicraft.displays.controls": "Besturing", + "minicraft.displays.controls.display.controller": "Controller", + "minicraft.displays.controls.display.controller.00": "Speler bewegen gebruikt DPAD", + "minicraft.displays.controls.display.controller.01": "Cursor bewegen gebruikt DPAD", + "minicraft.displays.controls.display.controller.02": "Items selecteren gebruikt A", + "minicraft.displays.controls.display.controller.03": "Pagina's verlaten gebruikt B", + "minicraft.displays.controls.display.controller.04": "Aanvallen, tegels kapot maken en gebruiken via A", + "minicraft.displays.controls.display.controller.05": "Menu in-spel openen via X", + "minicraft.displays.controls.display.controller.06": "Maak menu openen via Y", + "minicraft.displays.controls.display.controller.07": "Meubels oppakken via LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "1 item laten vallen via RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Een hele stack van items laten vallen via RIGHTSTICK", + "minicraft.displays.controls.display.controller.11": "Het spel pauzeren via START", "minicraft.displays.crafting": "Maken", "minicraft.displays.crafting.container_title.cost": "Kost:", "minicraft.displays.crafting.container_title.have": "Heeft:", @@ -107,8 +276,8 @@ "minicraft.displays.quests.display.header.unlocked": "Ontgrendeld", "minicraft.displays.quests.display.no_quest_desc": "Geen uitdaging", "minicraft.displays.resource_packs.display.help.move": "Gebruik %s en %s om te bewegen.", - "minicraft.displays.resource_packs.display.help.select": "%s om te onderzoeken.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LINKS|RECHTS|OMHOOG|OMLAAG] om pakketten te bewegen.", + "minicraft.displays.resource_packs.display.help.select": "%s om te onderzoeken.", "minicraft.displays.resource_packs.display.title": "resourcepakketten", "minicraft.displays.skin": "Skins", "minicraft.displays.skin.display.help.move": "Gebruik %s en %s om te bewegen.", @@ -163,311 +332,35 @@ "minicraft.notification.quest_unlocked": "Uitdaging ontgrendeld", "minicraft.notification.world_saved": "Wereld Opgeslagen!", "minicraft.notification.wrong_level_sky": "Kan alleen op lucht level opgeroepen worden", - "minicraft.settings.fps": "Max FPS", + "minicraft.settings.autosave": "Automatisch opslaan", "minicraft.settings.difficulty": "Moeilijkheid", "minicraft.settings.difficulty.easy": "Makkelijk", - "minicraft.settings.difficulty.normal": "Normaal", "minicraft.settings.difficulty.hard": "Moeilijk", + "minicraft.settings.difficulty.normal": "Normaal", + "minicraft.settings.fps": "Max FPS", "minicraft.settings.mode": "Spel Modus", - "minicraft.settings.mode.survival": "Survival", "minicraft.settings.mode.creative": "Creatief", "minicraft.settings.mode.hardcore": "Hardcore", "minicraft.settings.mode.score": "Score", + "minicraft.settings.mode.survival": "Survival", "minicraft.settings.scoretime": "Tijd (Score Modus)", "minicraft.settings.screenshot_scale": "Schermafbeelding Grootte", - "minicraft.settings.sound": "Geluid", - "minicraft.settings.autosave": "Automatisch opslaan", "minicraft.settings.size": "Wereld Grootte", + "minicraft.settings.sound": "Geluid", "minicraft.settings.theme": "Wereld Thema", - "minicraft.settings.theme.normal": "Normaal", - "minicraft.settings.theme.forest": "Bos", "minicraft.settings.theme.desert": "Woestijn", - "minicraft.settings.theme.plain": "Vlakte", + "minicraft.settings.theme.forest": "Bos", "minicraft.settings.theme.hell": "Hel", + "minicraft.settings.theme.normal": "Normaal", + "minicraft.settings.theme.plain": "Vlakte", "minicraft.settings.type": "Type Terrein", - "minicraft.settings.type.island": "Eiland", "minicraft.settings.type.box": "Doos", - "minicraft.settings.type.mountain": "Berg", "minicraft.settings.type.irregular": "Onregelmatig", + "minicraft.settings.type.island": "Eiland", + "minicraft.settings.type.mountain": "Berg", + "minicraft.skin.minecraft_alex": "Bekend meisje", + "minicraft.skin.minecraft_steve": "Bekende jongen", "minicraft.skin.paul": "Paul", "minicraft.skin.paul_cape": "Paul met cape", - "minicraft.skin.minecraft_steve": "Bekende jongen", - "minicraft.skin.minecraft_alex": "Bekend meisje", - "minicraft.text_particales.key_consumed": "-1 sleutel", - "Death Chest": "Doodskist", - "Player": "Speler", - "Leather Armor": "Leren Uitrusting", - "Snake Armor": "Slangen Uitrusting", - "Iron Armor": "Ijzeren Uitrusting", - "Gold Armor": "Gouden Uitrusting", - "Gem Armor": "Edelsteen Uitrusting", - "Book": "Boek", - "Antidious": "Tegendraads", - "Empty Bucket": "Lege Emmer", - "Water Bucket": "Emmer met Water", - "Lava Bucket": "Emmer met Lava", - "Red Clothes": "Rode Kleren", - "Blue Clothes": "Blauwe Kleren", - "Green Clothes": "Groene Kleren", - "Yellow Clothes": "Gele Kleren", - "Black Clothes": "Zwarte Kleren", - "Orange Clothes": "Oranje Kleren", - "Purple Clothes": "Paarse Kleren", - "Cyan Clothes": "Cyaan Kleren", - "Reg Clothes": "Reg Kleren", - "Bread": "Brood", - "Apple": "Appel", - "Raw Pork": "Rauw Varkensvlees", - "Raw Fish": "Rauwe Vis", - "Raw Beef": "Rauw Biefstuk", - "Pork Chop": "Varkensvlees", - "Cooked Fish": "Gekookte Vis", - "Cooked Pork": "Gebraden Varkensvlees", - "Steak": "Biefstuk", - "Gold Apple": "Gouden Appel", - "Baked Potato": "Gebakken Aardappel", - "Cow Spawner": "Koe Spawner", - "Pig Spawner": "Varken Spawner", - "Sheep Spawner": "Schaap Spawner", - "Slime Spawner": "Slijm Spawner", - "Zombie Spawner": "Zombie Spawner", - "Creeper Spawner": "Creeper Spawner", - "Skeleton Spawner": "Skelet Spawner", - "Snake Spawner": "Slang Spawner", - "Knight Spawner": "Ridder Spawner", - "AirWizard Spawner": "Lucht Tovenaar Spawner", - "Workbench": "Werkbank", - "Oven": "Oven", - "Furnace": "Smeltoven", - "Anvil": "Aambeeld", - "Enchanter": "Betoveraar", - "Loom": "Weefgetouw", - "Lantern": "Lantaarn", - "Iron Lantern": "Ijzeren Lantaarn", - "Gold Lantern": "Gouden Lantaarn", - "Tnt": "Tnt", - "Bed": "Bed", - "Chest": "Kist", - "None Potion": "Geen Drank", - "Speed Potion": "Snelheids Drank", - "Light Potion": "Licht Drank", - "Swim Potion": "Zwem Drank", - "Energy Potion": "Energie Drank", - "Regen Potion": "Regeneratie Drank", - "Health Potion": "Genezings Drank", - "Time Potion": "Tijd Drank", - "Lava Potion": "Lava Drank", - "Shield Potion": "Schild Drank", - "Haste Potion": "Haast Drank", - "Escape Potion": "Onstappings Drank", - "Potion": "Drank", - "Power Glove": "Power Handschoen", - "Wood": "Hout", - "Stone": "Steen", - "Leather": "Leer", - "Wheat": "Tarwe", - "Key": "Sleutel", - "Coal": "Steenkool", - "Iron Ore": "Ijzererts", - "Gold Ore": "Gouderts", - "Gem Ore": "Edelsteen Erts", - "Cloud Ore": "Wolk Erts", - "Iron": "Ijzer", - "Gold": "Goud", - "Lapis": "Lapis", - "Rose": "Roos", - "GunPowder": "Buskruit", - "Slime": "Slijm", - "Scale": "Grootte", - "Shard": "Scherf", - "Flower": "Bloem", - "Acorn": "Eikel", - "Dirt": "Aarde", - "Natural Rock": "Natuurlijke Steen", - "Plank": "Plank", - "Plank Wall": "Planken Muur", - "Wood Door": "Houten Deur", - "Stone Brick": "Stenen Baksteen", - "Ornate Stone": "Sierlijk Steen", - "Stone Wall": "Stenen Muur", - "Stone Door": "Stenen Deur", - "Obsidian Brick": "Obsidaan Baksteen", - "Ornate Obsidian": "Sierlijk Obsidiaan", - "Obsidian Wall": "Obsidiaan Muur", - "Obsidian Door": "Obsidiaan Muur", - "Wool": "Wol", - "Red Wool": "Rood Wol", - "Blue Wool": "Blauw Wol", - "Green Wool": "Groen Wol", - "Yellow Wool": "Geel Wol", - "Black Wool": "Zwart Wol", - "Sand": "Zand", - "Cactus": "Cactus", - "Seeds": "Zaden", - "Wheat Seeds": "Tarwe Zaden", - "Grass Seeds": "Gras Zaden", - "Bone": "Bot", - "Cloud": "Wolk", - "Rock": "Rots", - "Gem": "Edelsteen", - "Potato": "Aardappel", - "Wood Fishing Rod": "Houten Vishengel", - "Iron Fishing Rod": "Ijzeren Vishengel", - "Gold Fishing Rod": "Gouden Vishengel", - "Gem Fishing Rod": "Edelsteen Vishengel", - "Shovel": "Schep", - "Hoe": "Schoffel", - "Sword": "Zwaard", - "Pickaxe": "Pikhouweel", - "Axe": "Bijl", - "Bow": "Boog", - "Claymore": "Claymore", - "Shears": "Schaar", - "Torch": "Toorts", - "Wood Planks": "Houten Planken", - "Stone Bricks": "Stenen Bakstenen", - "Obsidian": "Obsidiaan", - "Wood Wall": "Houten Muur", - "Grass": "Gras", - "Hole": "Put", - "Stairs Up": "Trappen Omhoog", - "Stairs Down": "Trappen Omloog", - "Water": "Water", - "Tree": "Boom", - "Tree Sapling": "Boom Kiemplant", - "Cactus Sapling": "Cactus Kiemplant", - "Lava": "Lava", - "Lava Brick": "Lava Baksteen", - "Explode": "Explodeer", - "Farmland": "Akkerland", - "Hard Rock": "Hard Steen", - "Infinite Fall": "Oneindige Val", - "Cloud Cactus": "Wolk Cactus", - "Raw Obsidian": "Rauw Obsidiaan", - "Totem of Air": "Totem van de Lucht", - "minicraft.control_guide.attack": "Gebruik %s om monsters aan te vallen of om tegels te verwoesten.", - "minicraft.control_guide.craft": "Gebruik %s om je werk menu te openen.", - "minicraft.control_guide.menu": "Gebruik %s om je inventaris te openen.", - "minicraft.control_guide.move": "Gebruik %s om te bewegen.", - "minicraft.displays.controls": "Besturing", - "minicraft.displays.controls.display.controller": "Controller", - "minicraft.displays.controls.display.controller.00": "Speler bewegen gebruikt DPAD", - "minicraft.displays.controls.display.controller.01": "Cursor bewegen gebruikt DPAD", - "minicraft.displays.controls.display.controller.02": "Items selecteren gebruikt A", - "minicraft.displays.controls.display.controller.03": "Pagina's verlaten gebruikt B", - "minicraft.displays.controls.display.controller.04": "Aanvallen, tegels kapot maken en gebruiken via A", - "minicraft.displays.controls.display.controller.05": "Menu in-spel openen via X", - "minicraft.displays.controls.display.controller.06": "Maak menu openen via Y", - "minicraft.displays.controls.display.controller.07": "Meubels oppakken via LEFTBUMPER", - "minicraft.displays.controls.display.controller.08": "1 item laten vallen via RIGHTBUMPER", - "minicraft.displays.controls.display.controller.09": "Een hele stack van items laten vallen via RIGHTSTICK", - "minicraft.displays.controls.display.controller.10": "", - "minicraft.displays.controls.display.controller.11": "Het spel pauzeren via START", - "minicraft.displays.controls.display.controller.12": "", - "minicraft.displays.controls.display.controller.13": "", - "minicraft.displays.controls.display.controller.14": "", - "minicraft.displays.controls.display.controller.15": "", - "minicraft.displays.controls.display.controller.desc.0": "", - "minicraft.displays.controls.display.controller.desc.1": "", - "minicraft.displays.controls.display.help.0": "", - "minicraft.displays.controls.display.keyboard": "", - "minicraft.displays.controls.display.keyboard.00": "", - "minicraft.displays.controls.display.keyboard.01": "", - "minicraft.displays.controls.display.keyboard.02": "", - "minicraft.displays.controls.display.keyboard.03": "", - "minicraft.displays.controls.display.keyboard.04": "", - "minicraft.displays.controls.display.keyboard.05": "", - "minicraft.displays.controls.display.keyboard.06": "", - "minicraft.displays.controls.display.keyboard.07": "", - "minicraft.displays.controls.display.keyboard.08": "", - "minicraft.displays.controls.display.keyboard.09": "", - "minicraft.displays.controls.display.keyboard.10": "", - "minicraft.displays.controls.display.keyboard.11": "", - "minicraft.displays.controls.display.keyboard.12": "", - "minicraft.displays.controls.display.keyboard.13": "", - "minicraft.displays.controls.display.keyboard.14": "", - "minicraft.displays.controls.display.keyboard.15": "", - "minicraft.displays.controls.display.keyboard.16": "", - "minicraft.displays.controls.display.keyboard.17": "", - "minicraft.displays.controls.display.keyboard.18": "", - "minicraft.displays.controls.display.keyboard.19": "", - "minicraft.displays.controls.display.keyboard.20": "", - "minicraft.displays.controls.display.keyboard.21": "", - "minicraft.displays.controls.display.keyboard.22": "", - "minicraft.displays.controls.display.keyboard.desc": "", - "minicraft.displays.loading.message.dungeon_regeneration": "", - "minicraft.displays.loading.message.quests": "", - "minicraft.displays.loading.regeneration_popup.display.0": "", - "minicraft.displays.loading.regeneration_popup.display.1": "", - "minicraft.displays.loading.regeneration_popup.display.2": "", - "minicraft.displays.loading.regeneration_popup.display.3": "", - "minicraft.displays.loading.regeneration_popup.display.4": "", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "", - "minicraft.displays.quests.display.no_quest": "", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", - "minicraft.notification.obsidian_knight_defeated": "", - "minicraft.notification.obsidian_knight_awoken": "", - "minicraft.notification.defeat_obsidian_knight_first": "", - "minicraft.notification.wrong_level_dungeon": "", - "minicraft.notification.boss_limit": "", - "minicraft.notification.spawn_on_boss_tile": "", - "minicraft.notifications.statue_tapped": "", - "minicraft.notifications.statue_touched": "", - "minicraft.quest.farming": "", - "minicraft.quest.farming.crafting_hoe": "", - "minicraft.quest.farming.crafting_hoe.description": "", - "minicraft.quest.farming.description": "", - "minicraft.quest.farming.getting_wheat": "", - "minicraft.quest.farming.getting_wheat.description": "", - "minicraft.quest.farming.making_farmland": "", - "minicraft.quest.farming.making_farmland.description": "", - "minicraft.quest.farming.planting_potato": "", - "minicraft.quest.farming.planting_potato.description": "", - "minicraft.quest.farming.planting_wheat": "", - "minicraft.quest.farming.planting_wheat.description": "", - "minicraft.quest.gems": "", - "minicraft.quest.gems.description": "", - "minicraft.quest.gems.gem_armor": "", - "minicraft.quest.gems.gem_armor.description": "", - "minicraft.quest.gems.gem_claymore": "", - "minicraft.quest.gems.gem_claymore.description": "", - "minicraft.quest.iron_equipments": "", - "minicraft.quest.iron_equipments.description": "", - "minicraft.quest.iron_equipments.getting_more_iron": "", - "minicraft.quest.iron_equipments.getting_more_iron.description": "", - "minicraft.quest.iron_equipments.iron_armor": "", - "minicraft.quest.iron_equipments.iron_armor.description": "", - "minicraft.quest.iron_equipments.iron_tools": "", - "minicraft.quest.iron_equipments.iron_tools.description": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", - "minicraft.quest.potions": "", - "minicraft.quest.potions.all_potions_prepared": "", - "minicraft.quest.potions.all_potions_prepared.description": "", - "minicraft.quest.potions.awkward_potions": "", - "minicraft.quest.potions.awkward_potions.description": "", - "minicraft.quest.potions.description": "", - "minicraft.quest.potions.powerful_potions": "", - "minicraft.quest.potions.powerful_potions.description": "", - "minicraft.tutorial.getting_rocks": "", - "minicraft.tutorial.getting_rocks.description": "", - "minicraft.tutorial.getting_wood": "", - "minicraft.tutorial.getting_wood.description": "", - "minicraft.tutorial.getting_wooden_pickaxe": "", - "minicraft.tutorial.getting_wooden_pickaxe.description": "", - "minicraft.tutorial.getting_workbench": "", - "minicraft.tutorial.getting_workbench.description": "", - "minicraft.tutorial.start_getting_wood": "", - "minicraft.tutorial.start_getting_wood.description": "", - "minicraft.display.options_display.language": "", - "minicraft.display.options_display.resource_packs": "", - "minicraft.displays.language_settings.title": "", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "", - "String": "", - "Glass": "", - "Cloth": "" + "minicraft.text_particales.key_consumed": "-1 sleutel" } diff --git a/src/client/resources/assets/localization/pl-pl.json b/src/client/resources/assets/localization/pl-pl.json index 9c6b55ab5..ca68888b7 100644 --- a/src/client/resources/assets/localization/pl-pl.json +++ b/src/client/resources/assets/localization/pl-pl.json @@ -1,123 +1,126 @@ { - "minicraft.achievement.woodcutter": "Drwal", - "minicraft.achievement.woodcutter.desc": "Zdobądź drewno.", - "minicraft.achievement.benchmarking": "", + "Acorn": "Żołądź", + "AirWizard Spawner": "Spawner AirWizarda", + "Anvil": "Kowadło", + "Apple": "Jabłko", + "Axe": "Topór", + "Baked Potato": "Pieczony ziemniak", + "Bed": "Łóżko", + "Black Clothes": "Czarne ubranie", + "Black Wool": "Czarna wełna", + "Blue Clothes": "Niebieskie ubranie", + "Blue Wool": "Niebieska wełna", + "Bone": "Kość", + "Book": "Książka", + "Bow": "Łuk", + "Bread": "Chleb", + "Cactus": "Kaktus", + "Cactus Sapling": "Sadzonka kaktusa", + "Chest": "Skrzynia", + "Cloud": "Chmura", + "Coal": "Węgiel", + "Cooked Fish": "Przyrządzona ryba", + "Cooked Pork": "Przyrządzona wołowina", + "Cow Spawner": "Spawner krów", + "Creeper Spawner": "Spawner creeperów", + "Cyan Clothes": "Turkusowe ubranie", + "Death Chest": "Skrzynia śmierci", + "Dirt": "Ziemia", + "Empty Bucket": "Puste wiaderko", + "Energy Potion": "Mikstura energii", + "Escape Potion": "Mikstura ucieczki", + "Farmland": "Ziemia uprawna", + "Flower": "Kwiatek", + "Furnace": "Piec", + "Gold": "Złoto", + "Gold Apple": "Złote jabłko", + "Gold Armor": "Złota zbroja", + "Gold Fishing Rod": "Złota wędka", + "Gold Lantern": "Złoty lampion", + "Gold Ore": "Złoże złota", + "Grass": "Trawa", + "Grass Seeds": "Nasiona trawy", + "Green Clothes": "Zielone ubranie", + "Green Wool": "Zielona wełna", + "GunPowder": "Proch", + "Gunpowder": "Proch", + "Hard Rock": "Twarda skała", + "Haste Potion": "Mikstura pośpiechu", + "Health Potion": "Mikstura zdrowia", + "Hoe": "Motyka", + "Hole": "Dziura", + "Iron": "Żelazo", + "Iron Armor": "Żelazna zbroja", + "Iron Fishing Rod": "Żelazna wędka", + "Iron Lantern": "Żelazny lampion", + "Iron Ore": "Złoże żelaza", + "Key": "Klucz", + "Knight Spawner": "Spawner rycerzy", + "Lantern": "Lampion", + "Lapis": "Lapis", + "Lava": "Lawa", + "Lava Brick": "Lawowa cegła", + "Lava Bucket": "Wiaderko z lawą", + "Lava Potion": "Mikstura pływania w lawie", + "Leather": "Skóra", + "Leather Armor": "Skórzana zbroja", + "minicraft.achievement.airwizard": "Pokonaj... powietrze?", + "minicraft.achievement.airwizard.desc": "Pokonaj pierwszego Air Wizarda!", "minicraft.achievement.benchmarking.desc": "Stwórz warsztat.", - "minicraft.achievement.upgrade": "Ulepszenie!", - "minicraft.achievement.upgrade.desc": "Stwórz dowolne kamienne narzędzie.", "minicraft.achievement.bow": "Uklęknij przede mną!", "minicraft.achievement.bow.desc": "Wystrzel strzałę z łuku.", - "minicraft.achievement.fish": "Idź na ryby!", - "minicraft.achievement.fish.desc": "Wyłów rybę!", - "minicraft.achievement.doors": "", - "minicraft.achievement.doors.desc": "Stwórz drewniane drzwi.", - "minicraft.achievement.planks": "", - "minicraft.achievement.planks.desc": "Stwórz deski.", - "minicraft.achievement.clothes": "", "minicraft.achievement.clothes.desc": "Stwórz ubranie dowolnego koloru", - "minicraft.achievement.demolition": "", "minicraft.achievement.demolition.desc": "Użyj TNT.", - "minicraft.achievement.survive_darkness": "Boisz się ciemności?", - "minicraft.achievement.survive_darkness.desc": "Przetrwaj 5 minut w zupełnej ciemności.", - "minicraft.achievement.lava": "", - "minicraft.achievement.lava.desc": "", + "minicraft.achievement.doors.desc": "Stwórz drewniane drzwi.", "minicraft.achievement.find_gem": "Oooo, świeci się!", - "minicraft.achievement.find_gem.desc": "", - "minicraft.achievement.lowest_caves": "", + "minicraft.achievement.fish": "Idź na ryby!", + "minicraft.achievement.fish.desc": "Wyłów rybę!", "minicraft.achievement.lowest_caves.desc": "Dojdź do najniższych jaskiń.", - "minicraft.achievement.obsidian_dungeon": "", "minicraft.achievement.obsidian_dungeon.desc": "Dostań się do lochu z obsydianu.", - "minicraft.achievement.airwizard": "Pokonaj... powietrze?", - "minicraft.achievement.airwizard.desc": "Pokonaj pierwszego Air Wizarda!", + "minicraft.achievement.planks.desc": "Stwórz deski.", "minicraft.achievement.skin": "Pokaz mody", "minicraft.achievement.skin.desc": "Zmień swoją skórkę.", + "minicraft.achievement.survive_darkness": "Boisz się ciemności?", + "minicraft.achievement.survive_darkness.desc": "Przetrwaj 5 minut w zupełnej ciemności.", + "minicraft.achievement.upgrade": "Ulepszenie!", + "minicraft.achievement.upgrade.desc": "Stwórz dowolne kamienne narzędzie.", + "minicraft.achievement.woodcutter": "Drwal", + "minicraft.achievement.woodcutter.desc": "Zdobądź drewno.", + "minicraft.control_guide.move": "Używaj %s do poruszania się.", "minicraft.display.entries.boolean.false": "Wył.", "minicraft.display.entries.boolean.true": "Wł.", - "minicraft.display.gui.link_opening": "", "minicraft.display.gui.perm_status.saving": "Zapisywanie... %s%%", "minicraft.display.gui.perm_status.sleep_cancel": "Naciśnij %s aby anulować", "minicraft.display.gui.perm_status.sleeping": "Spanie...", - "minicraft.display.gui.potion_effects.hide_hint": "", - "minicraft.display.gui.potion_effects.potion_dur": "", "minicraft.display.gui.score.current_score": "Bieżący wynik: %s", "minicraft.display.gui.score.time_left": "Pozostało %s%sm %ss", "minicraft.display.menus.inventory": "Ekwipunek", "minicraft.display.options_display": "Opcje", "minicraft.display.options_display.change_key_bindings": "Zmień przypisanie klawiszy", - "minicraft.display.popup.enter_confirm": "", - "minicraft.display.popup.escape_cancel": "", "minicraft.display.popup.title_confirm": "Potwierdź akcję", "minicraft.displays.achievements": "Osiągnięcia", "minicraft.displays.achievements.display.achieved": "Osiągnięto!", - "minicraft.displays.achievements.display.help": "", "minicraft.displays.achievements.display.not_achieved": "Nie osiągnięto", - "minicraft.displays.achievements.display.score": "", - "minicraft.displays.book.default_book": "", - "minicraft.displays.crafting": "", + "minicraft.displays.controls": "Sterowanie", + "minicraft.displays.controls.display.controller": "Kontroler", "minicraft.displays.crafting.container_title.cost": "Koszt:", - "minicraft.displays.crafting.container_title.have": "", - "minicraft.displays.end_game.display.bonuses": "", "minicraft.displays.end_game.display.final_score": "Wynik ostateczny: %s", "minicraft.displays.end_game.display.player_score": "Wynik gracza: %s", - "minicraft.displays.end_game.display.unlocked": "", "minicraft.displays.end_game.exit": "Wyjdź do Menu", - "minicraft.displays.info.display.exit_help": "", "minicraft.displays.info.display.score": "Bieżący wynik: %s", - "minicraft.displays.info.display.time": "", "minicraft.displays.info.title": "Statystyki gracza", "minicraft.displays.key_input.display.help.0": "Naciśnij C/Enter aby zmienić", "minicraft.displays.key_input.display.help.1": "Naciśnij A aby dodać", - "minicraft.displays.key_input.display.help.2": "", - "minicraft.displays.key_input.display.help.3": "", "minicraft.displays.key_input.popup_display.confirm_reset": "Czy jesteś pewien że chcesz zresetować wszystkie przypisania klawiszy do ustawień domyślnych?", - "minicraft.displays.key_input.popup_display.press_key_sequence": "", "minicraft.displays.key_input.title": "Sterowanie", - "minicraft.displays.loading.message.entities": "", - "minicraft.displays.loading.message.generating": "", - "minicraft.displays.loading.message.level": "", - "minicraft.displays.loading.message.levels": "", - "minicraft.displays.loading.message.loading": "", - "minicraft.displays.loading.message.saving": "", - "minicraft.displays.loading.message.world": "", "minicraft.displays.options_main_menu": "Opcje menu głównego", "minicraft.displays.options_main_menu.resource_packs": "Paczki z zasobami", "minicraft.displays.options_world": "Opcje świata", "minicraft.displays.options_world.off_tutorials_confirm_popup": "Czy jesteś pewien że chcesz trawle wyłączyć samouczki?", "minicraft.displays.options_world.turn_off_tutorials": "Wyłącz samouczki", - "minicraft.displays.pause": "", - "minicraft.displays.pause.display.exit_popup.0": "", - "minicraft.displays.pause.display.exit_popup.1": "", - "minicraft.displays.pause.display.exit_popup.cancel": "", - "minicraft.displays.pause.display.exit_popup.quit": "", - "minicraft.displays.pause.display.help.choose": "", - "minicraft.displays.pause.display.help.scroll": "", - "minicraft.displays.pause.menu": "", - "minicraft.displays.pause.return": "", - "minicraft.displays.pause.save": "", - "minicraft.displays.player_death.display.score": "", - "minicraft.displays.player_death.display.time": "", - "minicraft.displays.player_death.quit": "", - "minicraft.displays.player_death.respawn": "", - "minicraft.displays.player_death.save_quit": "", - "minicraft.displays.player_death.title": "", - "minicraft.displays.player_inv.container_title.items": "", - "minicraft.displays.player_inv.display.help": "", - "minicraft.displays.quests": "", - "minicraft.displays.quests.display.header.completed": "", - "minicraft.displays.quests.display.header.unlocked": "", - "minicraft.displays.quests.display.no_quest_desc": "", - "minicraft.displays.resource_packs.display.help.move": "", - "minicraft.displays.resource_packs.display.help.select": "", - "minicraft.displays.resource_packs.display.help.position": "", "minicraft.displays.resource_packs.display.title": "Paczki z zasobami", "minicraft.displays.skin": "Skórki", - "minicraft.displays.skin.display.help.move": "", - "minicraft.displays.skin.display.help.select": "", - "minicraft.displays.title.display.cannot_check": "", "minicraft.displays.title.display.checking": "Sprawdzanie aktualizacji...", - "minicraft.displays.title.display.help.0": "", - "minicraft.displays.title.display.help.1": "", - "minicraft.displays.title.display.help.2": "", "minicraft.displays.title.display.latest_already": "Posiadasz już najnowszą wersję.", "minicraft.displays.title.display.new_version": "Nowa wersja: %s", "minicraft.displays.title.display.version": "Wersja %s", @@ -131,343 +134,14 @@ "minicraft.displays.title.play.load_world": "Załaduj świat", "minicraft.displays.title.play.new_world": "Nowy świat", "minicraft.displays.title.quit": "Wyjdź", - "minicraft.displays.title.select_to_download": "", - "minicraft.displays.world_gen.create_world": "", - "minicraft.displays.world_gen.enter_world": "", "minicraft.displays.world_gen.title": "Opcje generatora świata", - "minicraft.displays.world_gen.troublesome_input": "", - "minicraft.displays.world_gen.troublesome_input.msg": "", - "minicraft.displays.world_gen.world_seed": "", - "minicraft.displays.world_select.display.help.0": "", - "minicraft.displays.world_select.display.help.1": "", - "minicraft.displays.world_select.display.help.2": "", - "minicraft.displays.world_select.display.help.3": "", - "minicraft.displays.world_select.display.help.4": "", "minicraft.displays.world_select.display.world_too_new": "Zbyt nowa wersja, nie można załadować!", "minicraft.displays.world_select.display.world_version": "Wersja Świata: %s", - "minicraft.displays.world_select.popups.display.cancel": "", - "minicraft.displays.world_select.popups.display.change": "", - "minicraft.displays.world_select.popups.display.confirm": "", - "minicraft.displays.world_select.popups.display.delete": "", - "minicraft.displays.world_select.select_world": "", - "minicraft.notification.achievement_unlocked": "", - "minicraft.notification.air_wizard_defeated": "", - "minicraft.notification.cannot_sleep": "", - "minicraft.notification.death_chest_retrieved": "", - "minicraft.notification.defeat_air_wizard_first": "", - "minicraft.notification.dig_hole": "", - "minicraft.notification.dungeon_opened": "", - "minicraft.notification.gem_pickaxe_required": "", - "minicraft.notification.invalid_placement": "", - "minicraft.notification.quest_completed": "", - "minicraft.notification.quest_unlocked": "", - "minicraft.notification.world_saved": "", - "minicraft.notification.wrong_level_sky": "", "minicraft.settings.fps": "Maksymalne FPS", - "minicraft.settings.difficulty": "", - "minicraft.settings.difficulty.easy": "", - "minicraft.settings.difficulty.normal": "", - "minicraft.settings.difficulty.hard": "", - "minicraft.settings.mode": "", - "minicraft.settings.mode.survival": "", - "minicraft.settings.mode.creative": "", - "minicraft.settings.mode.hardcore": "", - "minicraft.settings.mode.score": "", - "minicraft.settings.scoretime": "", "minicraft.settings.screenshot_scale": "Skala zrzutów ekranu", "minicraft.settings.sound": "Dźwięk", - "minicraft.settings.autosave": "", - "minicraft.settings.size": "", - "minicraft.settings.theme": "", - "minicraft.settings.theme.normal": "", - "minicraft.settings.theme.forest": "", - "minicraft.settings.theme.desert": "", - "minicraft.settings.theme.plain": "", - "minicraft.settings.theme.hell": "", - "minicraft.settings.type": "", - "minicraft.settings.type.island": "", - "minicraft.settings.type.box": "", - "minicraft.settings.type.mountain": "", - "minicraft.settings.type.irregular": "", - "minicraft.skin.paul": "Paweł", - "minicraft.skin.paul_cape": "Paweł z peleryną", - "minicraft.skin.minecraft_steve": "Znajomy chłopak", "minicraft.skin.minecraft_alex": "Znajoma dziewczyna", - "minicraft.text_particales.key_consumed": "", - "Death Chest": "Skrzynia śmierci", - "Player": "", - "Leather Armor": "Skórzana zbroja", - "Snake Armor": "", - "Iron Armor": "Żelazna zbroja", - "Gold Armor": "Złota zbroja", - "Gem Armor": "", - "Book": "Książka", - "Antidious": "", - "Empty Bucket": "Puste wiaderko", - "Water Bucket": "", - "Lava Bucket": "Wiaderko z lawą", - "Red Clothes": "", - "Blue Clothes": "Niebieskie ubranie", - "Green Clothes": "Zielone ubranie", - "Yellow Clothes": "", - "Black Clothes": "Czarne ubranie", - "Orange Clothes": "", - "Purple Clothes": "", - "Cyan Clothes": "Turkusowe ubranie", - "Reg Clothes": "", - "Bread": "Chleb", - "Apple": "Jabłko", - "Raw Pork": "", - "Raw Fish": "", - "Raw Beef": "", - "Pork Chop": "", - "Cooked Fish": "Przyrządzona ryba", - "Cooked Pork": "Przyrządzona wołowina", - "Steak": "", - "Gold Apple": "Złote jabłko", - "Baked Potato": "Pieczony ziemniak", - "Cow Spawner": "Spawner krów", - "Pig Spawner": "", - "Sheep Spawner": "", - "Slime Spawner": "", - "Zombie Spawner": "", - "Creeper Spawner": "Spawner creeperów", - "Skeleton Spawner": "", - "Snake Spawner": "", - "Knight Spawner": "Spawner rycerzy", - "AirWizard Spawner": "Spawner AirWizarda", - "Workbench": "", - "Oven": "", - "Furnace": "Piec", - "Anvil": "Kowadło", - "Enchanter": "", - "Loom": "", - "Lantern": "Lampion", - "Iron Lantern": "Żelazny lampion", - "Gold Lantern": "Złoty lampion", - "Tnt": "", - "Bed": "Łóżko", - "Chest": "Skrzynia", - "None Potion": "", - "Speed Potion": "", - "Light Potion": "", - "Swim Potion": "", - "Energy Potion": "Mikstura energii", - "Regen Potion": "", - "Health Potion": "Mikstura zdrowia", - "Time Potion": "", - "Lava Potion": "Mikstura pływania w lawie", - "Shield Potion": "", - "Haste Potion": "Mikstura pośpiechu", - "Escape Potion": "Mikstura ucieczki", - "Potion": "", - "Power Glove": "", - "Wood": "", - "Stone": "", - "Leather": "Skóra", - "Wheat": "", - "Key": "Klucz", - "Coal": "Węgiel", - "Iron Ore": "Złoże żelaza", - "Gold Ore": "Złoże złota", - "Gem Ore": "", - "Cloud Ore": "", - "Iron": "Żelazo", - "Gold": "Złoto", - "Lapis": "Lapis", - "Rose": "", - "GunPowder": "Proch", - "Slime": "", - "Scale": "", - "Shard": "", - "Flower": "Kwiatek", - "Acorn": "Żołądź", - "Dirt": "Ziemia", - "Natural Rock": "", - "Plank": "", - "Plank Wall": "", - "Wood Door": "", - "Stone Brick": "", - "Ornate Stone": "", - "Stone Wall": "", - "Stone Door": "", - "Obsidian Brick": "", - "Ornate Obsidian": "", - "Obsidian Wall": "", - "Obsidian Door": "", - "Wool": "", - "Red Wool": "", - "Blue Wool": "Niebieska wełna", - "Green Wool": "Zielona wełna", - "Yellow Wool": "", - "Black Wool": "Czarna wełna", - "Sand": "", - "Cactus": "Kaktus", - "Seeds": "", - "Wheat Seeds": "", - "Grass Seeds": "Nasiona trawy", - "Bone": "Kość", - "Cloud": "Chmura", - "Rock": "", - "Gem": "", - "Potato": "", - "Wood Fishing Rod": "", - "Iron Fishing Rod": "Żelazna wędka", - "Gold Fishing Rod": "Złota wędka", - "Gem Fishing Rod": "", - "Shovel": "", - "Hoe": "Motyka", - "Sword": "", - "Pickaxe": "", - "Axe": "Topór", - "Bow": "Łuk", - "Claymore": "", - "Shears": "", - "Torch": "", - "Wood Planks": "", - "Stone Bricks": "", - "Obsidian": "", - "Wood Wall": "", - "Grass": "Trawa", - "Hole": "Dziura", - "Stairs Up": "", - "Stairs Down": "", - "Water": "", - "Tree": "", - "Tree Sapling": "", - "Cactus Sapling": "Sadzonka kaktusa", - "Lava": "Lawa", - "Lava Brick": "Lawowa cegła", - "Explode": "", - "Farmland": "Ziemia uprawna", - "Hard Rock": "Twarda skała", - "Infinite Fall": "", - "Cloud Cactus": "", - "Raw Obsidian": "", - "Totem of Air": "", - "minicraft.control_guide.attack": "", - "minicraft.control_guide.craft": "", - "minicraft.control_guide.menu": "", - "minicraft.control_guide.move": "Używaj %s do poruszania się.", - "minicraft.displays.controls": "Sterowanie", - "minicraft.displays.controls.display.controller": "Kontroler", - "minicraft.displays.controls.display.controller.00": "", - "minicraft.displays.controls.display.controller.01": "", - "minicraft.displays.controls.display.controller.02": "", - "minicraft.displays.controls.display.controller.03": "", - "minicraft.displays.controls.display.controller.04": "", - "minicraft.displays.controls.display.controller.05": "", - "minicraft.displays.controls.display.controller.06": "", - "minicraft.displays.controls.display.controller.07": "", - "minicraft.displays.controls.display.controller.08": "", - "minicraft.displays.controls.display.controller.09": "", - "minicraft.displays.controls.display.controller.10": "", - "minicraft.displays.controls.display.controller.11": "", - "minicraft.displays.controls.display.controller.12": "", - "minicraft.displays.controls.display.controller.13": "", - "minicraft.displays.controls.display.controller.14": "", - "minicraft.displays.controls.display.controller.15": "", - "minicraft.displays.controls.display.controller.desc.0": "", - "minicraft.displays.controls.display.controller.desc.1": "", - "minicraft.displays.controls.display.help.0": "", - "minicraft.displays.controls.display.keyboard": "", - "minicraft.displays.controls.display.keyboard.00": "", - "minicraft.displays.controls.display.keyboard.01": "", - "minicraft.displays.controls.display.keyboard.02": "", - "minicraft.displays.controls.display.keyboard.03": "", - "minicraft.displays.controls.display.keyboard.04": "", - "minicraft.displays.controls.display.keyboard.05": "", - "minicraft.displays.controls.display.keyboard.06": "", - "minicraft.displays.controls.display.keyboard.07": "", - "minicraft.displays.controls.display.keyboard.08": "", - "minicraft.displays.controls.display.keyboard.09": "", - "minicraft.displays.controls.display.keyboard.10": "", - "minicraft.displays.controls.display.keyboard.11": "", - "minicraft.displays.controls.display.keyboard.12": "", - "minicraft.displays.controls.display.keyboard.13": "", - "minicraft.displays.controls.display.keyboard.14": "", - "minicraft.displays.controls.display.keyboard.15": "", - "minicraft.displays.controls.display.keyboard.16": "", - "minicraft.displays.controls.display.keyboard.17": "", - "minicraft.displays.controls.display.keyboard.18": "", - "minicraft.displays.controls.display.keyboard.19": "", - "minicraft.displays.controls.display.keyboard.20": "", - "minicraft.displays.controls.display.keyboard.21": "", - "minicraft.displays.controls.display.keyboard.22": "", - "minicraft.displays.controls.display.keyboard.desc": "", - "minicraft.displays.loading.message.dungeon_regeneration": "", - "minicraft.displays.loading.message.quests": "", - "minicraft.displays.loading.regeneration_popup.display.0": "", - "minicraft.displays.loading.regeneration_popup.display.1": "", - "minicraft.displays.loading.regeneration_popup.display.2": "", - "minicraft.displays.loading.regeneration_popup.display.3": "", - "minicraft.displays.loading.regeneration_popup.display.4": "", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "", - "minicraft.displays.quests.display.no_quest": "", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", - "minicraft.notification.obsidian_knight_defeated": "", - "minicraft.notification.obsidian_knight_awoken": "", - "minicraft.notification.defeat_obsidian_knight_first": "", - "minicraft.notification.wrong_level_dungeon": "", - "minicraft.notification.boss_limit": "", - "minicraft.notification.spawn_on_boss_tile": "", - "minicraft.notifications.statue_tapped": "", - "minicraft.notifications.statue_touched": "", - "minicraft.quest.farming": "", - "minicraft.quest.farming.crafting_hoe": "", - "minicraft.quest.farming.crafting_hoe.description": "", - "minicraft.quest.farming.description": "", - "minicraft.quest.farming.getting_wheat": "", - "minicraft.quest.farming.getting_wheat.description": "", - "minicraft.quest.farming.making_farmland": "", - "minicraft.quest.farming.making_farmland.description": "", - "minicraft.quest.farming.planting_potato": "", - "minicraft.quest.farming.planting_potato.description": "", - "minicraft.quest.farming.planting_wheat": "", - "minicraft.quest.farming.planting_wheat.description": "", - "minicraft.quest.gems": "", - "minicraft.quest.gems.description": "", - "minicraft.quest.gems.gem_armor": "", - "minicraft.quest.gems.gem_armor.description": "", - "minicraft.quest.gems.gem_claymore": "", - "minicraft.quest.gems.gem_claymore.description": "", - "minicraft.quest.iron_equipments": "", - "minicraft.quest.iron_equipments.description": "", - "minicraft.quest.iron_equipments.getting_more_iron": "", - "minicraft.quest.iron_equipments.getting_more_iron.description": "", - "minicraft.quest.iron_equipments.iron_armor": "", - "minicraft.quest.iron_equipments.iron_armor.description": "", - "minicraft.quest.iron_equipments.iron_tools": "", - "minicraft.quest.iron_equipments.iron_tools.description": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe": "", - "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "", - "minicraft.quest.potions": "", - "minicraft.quest.potions.all_potions_prepared": "", - "minicraft.quest.potions.all_potions_prepared.description": "", - "minicraft.quest.potions.awkward_potions": "", - "minicraft.quest.potions.awkward_potions.description": "", - "minicraft.quest.potions.description": "", - "minicraft.quest.potions.powerful_potions": "", - "minicraft.quest.potions.powerful_potions.description": "", - "minicraft.tutorial.getting_rocks": "", - "minicraft.tutorial.getting_rocks.description": "", - "minicraft.tutorial.getting_wood": "", - "minicraft.tutorial.getting_wood.description": "", - "minicraft.tutorial.getting_wooden_pickaxe": "", - "minicraft.tutorial.getting_wooden_pickaxe.description": "", - "minicraft.tutorial.getting_workbench": "", - "minicraft.tutorial.getting_workbench.description": "", - "minicraft.tutorial.start_getting_wood": "", - "minicraft.tutorial.start_getting_wood.description": "", - "minicraft.display.options_display.language": "", - "minicraft.display.options_display.resource_packs": "", - "minicraft.displays.language_settings.title": "", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "", - "String": "", - "Glass": "", - "Cloth": "" + "minicraft.skin.minecraft_steve": "Znajomy chłopak", + "minicraft.skin.paul": "Paweł", + "minicraft.skin.paul_cape": "Paweł z peleryną" } diff --git a/src/client/resources/assets/localization/pt-pt.json b/src/client/resources/assets/localization/pt-pt.json index d5026f790..e55850c6c 100644 --- a/src/client/resources/assets/localization/pt-pt.json +++ b/src/client/resources/assets/localization/pt-pt.json @@ -1,36 +1,190 @@ { - "minicraft.achievement.woodcutter": "Lenhador", - "minicraft.achievement.woodcutter.desc": "Obtenha madeira.", + "Acorn": "Noz", + "AirWizard Spawner": "Invocar Mago dos Ventos", + "Antidious": "Gibi", + "Anvil": "Bigorna", + "Apple": "Maçã", + "Arrow": "Flecha", + "Axe": "Machado", + "Baked Potato": "Batata assada", + "Bed": "Cama", + "Black Clothes": "Camisa Preta", + "Black Wool": "Lã Preta", + "Blue Clothes": "Camisa Azul", + "Blue Wool": "Lã Azul", + "Bone": "Osso", + "Book": "Livro", + "Bow": "Arco", + "Bread": "Pão", + "Cactus": "Cacto", + "Cactus Sapling": "Semente de Cacto", + "Chest": "Baú", + "Claymore": "Espada Escocesa", + "Cloth": "Tecido", + "Cloud": "Nuvem", + "Cloud Cactus": "Nuvem de Cacto", + "Coal": "Carvão", + "Cooked Fish": "Peixe Assado", + "Cooked Pork": "Carne de Porco Assada", + "Cow Spawner": "Invocar Vaca", + "Creeper Spawner": "Invocar Creeper", + "Cyan Clothes": "Camisa Ciana", + "Death Chest": "Baú da Morte", + "Dirt": "Terra", + "Empty Bucket": "Balde vazio", + "Enchanter": "Encantadora", + "Energy Potion": "Poção da Energia", + "Escape Potion": "Poção de Fuga", + "Explode": "Explodir", + "Farmland": "Terra Arrada", + "Flower": "Flor", + "Furnace": "Fornalha", + "Gem": "Gema", + "Gem Armor": "Armadura de Gema", + "Gem Fishing Rod": "Vara de pescar de gema", + "Gem Ore": "Minério de gema", + "Glass": "Vidro", + "Gold": "Ouro", + "Gold Apple": "Maçã Dourada", + "Gold Armor": "Armadura Dourada", + "Gold Fishing Rod": "Vara de pescar de ouro", + "Gold Lantern": "Lamparina de Ouro", + "Gold Ore": "Minério de Ouro", + "Grass": "Grama", + "Grass Seeds": "Sementes de Erva", + "Green Clothes": "Camisa Verde", + "Green Wool": "Lã Verde", + "Gunpowder": "Pólvora", + "Hard Rock": "Pedra Dura", + "Haste Potion": "Poção de Pressa", + "Health Potion": "Poção da Vida", + "Hoe": "Enxada", + "Hole": "Buraco", + "Infinite Fall": "Queda Infinita", + "Iron": "Ferro", + "Iron Armor": "Armadura de Ferro", + "Iron Fishing Rod": "Vara de pescar de ferro", + "Iron Lantern": "Lamparina de Ferro", + "Iron Ore": "Minério de Ferro", + "Key": "Chave", + "Knight Spawner": "Invocar Cavaleiro", + "Lantern": "Lamparina", + "Lapis": "Lápis", + "Lava": "Lava", + "Lava Brick": "Tijolos de Lava", + "Lava Bucket": "Balde com Lava", + "Lava Potion": "Poção da Lava", + "Leather": "Couro", + "Leather Armor": "Armadura de Couro", + "Light Potion": "Poção da Luz", + "Loom": "Costureira", + "Natural Rock": "Rocha Natural", + "None Potion": "Poção vazia", + "Obsidian": "Obsidiana", + "Obsidian Brick": "Tijolos de Obsidiana", + "Obsidian Door": "Porta de Obsidiana", + "Obsidian Wall": "Parede de Obsidiana", + "Orange Clothes": "Camisa Laranja", + "Ornate Obsidian": "Obsidiana ornamentada", + "Ornate Stone": "Pedra Ornamentada", + "Oven": "Forno", + "Pickaxe": "Picareta", + "Pig Spawner": "Invocar Porco", + "Plank": "Tábua", + "Plank Wall": "Parede de Madeira", + "Player": "Jogador", + "Pork Chop": "Carne de Porco", + "Potato": "Batata", + "Potion": "Poção", + "Power Glove": "Luva do Poder", + "Purple Clothes": "Camisa Roxa", + "Raw Beef": "Bife Cru", + "Raw Fish": "Peixe Cru", + "Raw Pork": "Carne de Porco crua", + "Red Clothes": "Camisa Vermelha", + "Red Wool": "Lã Vermelha", + "Reg Clothes": "Camisa Regular", + "Regen Potion": "Poção de Regeneração", + "Rock": "Pedra", + "Rose": "Rosa", + "Sand": "Areia", + "Scale": "Esquama", + "Seeds": "Sementes", + "Shard": "Fragmento", + "Shears": "Tesoura", + "Sheep Spawner": "Invocar Cabra", + "Shield Potion": "Poção do Escudo", + "Shovel": "Pá", + "Skeleton Spawner": "Invocar Esqueleto", + "Slime": "Gosma", + "Slime Spawner": "Invocar Gosma", + "Snake Armor": "Armadura de Serpente", + "Snake Spawner": "Invocar Cobra", + "Speed Potion": "Poção de Agilidade", + "Stairs Down": "Escadas abaixo", + "Stairs Up": "Escadas acima", + "Steak": "Bife Cozido", + "Stone": "Pedra", + "Stone Brick": "Tijolos de Pedra", + "Stone Bricks": "Tijolos de Pedra", + "Stone Door": "Porta de Pedra", + "Stone Wall": "Parede de Pedra", + "String": "Linha", + "Swim Potion": "Poção da Natação", + "Sword": "Espada", + "Time Potion": "Poção do Tempo", + "Tnt": "Dinamite", + "Torch": "Tocha", + "Totem of Air": "Totem do ar", + "Tree": "Árvore", + "Tree Sapling": "Muda de Árvore", + "Water": "Água", + "Water Bucket": "Balde com Água", + "Wheat": "Trigo", + "Wheat Seeds": "Sementes de Trigo", + "Wood": "Madeira", + "Wood Door": "Porta de Madeira", + "Wood Fishing Rod": "Vara de pescar de madeira", + "Wood Planks": "Tábuas de Madeira", + "Wood Wall": "Parede de Madeira", + "Wool": "Lã", + "Workbench": "Mesa de trabalho", + "Yellow Clothes": "Camisa Amarela", + "Yellow Wool": "Lã Amarela", + "Zombie Spawner": "Invocar Zumbi", + "minicraft.achievement.airwizard": "Derrotar... o ar?", + "minicraft.achievement.airwizard.desc": "Derrote o primeiro Mago dos ventos!", "minicraft.achievement.benchmarking": "Trabalhar!", "minicraft.achievement.benchmarking.desc": "Faça uma mesa de trabalho.", - "minicraft.achievement.upgrade": "Melhoria!", - "minicraft.achievement.upgrade.desc": "Crie qualquer ferramenta de pedra.", "minicraft.achievement.bow": "Curve-se a mim!", "minicraft.achievement.bow.desc": "Dispare uma flecha com um arco.", - "minicraft.achievement.fish": "Vai pescar!", - "minicraft.achievement.fish.desc": "Pesque um peixe!", - "minicraft.achievement.doors": "Proteção Adorável", - "minicraft.achievement.doors.desc": "Faça uma porta de madeira.", - "minicraft.achievement.planks": "Ande nas pranchas!", - "minicraft.achievement.planks.desc": "Faça pranchas de madeira.", "minicraft.achievement.clothes": "Tenha um dia colorido!", "minicraft.achievement.clothes.desc": "Crie qualquer cor de roupa", "minicraft.achievement.demolition": "Demonstração de demolição", "minicraft.achievement.demolition.desc": "Usa TNT.", - "minicraft.achievement.survive_darkness": "Medo do escuro?", - "minicraft.achievement.survive_darkness.desc": "Sobreviva 5 minutos na escuridão total.", - "minicraft.achievement.lava": "Assuntos quentes", - "minicraft.achievement.lava.desc": "Usa uma poção de lava para nadar na lava.", + "minicraft.achievement.doors": "Proteção Adorável", + "minicraft.achievement.doors.desc": "Faça uma porta de madeira.", "minicraft.achievement.find_gem": "Oooh Brilhante!", "minicraft.achievement.find_gem.desc": "Encontra um minério de gema e minere-o.", + "minicraft.achievement.fish": "Vai pescar!", + "minicraft.achievement.fish.desc": "Pesque um peixe!", + "minicraft.achievement.lava": "Assuntos quentes", + "minicraft.achievement.lava.desc": "Usa uma poção de lava para nadar na lava.", "minicraft.achievement.lowest_caves": "Escuridão atrás da luz", "minicraft.achievement.lowest_caves.desc": "Alcance as cavernas mais baixas.", "minicraft.achievement.obsidian_dungeon": "De cavaleiros e homens", "minicraft.achievement.obsidian_dungeon.desc": "Alcance a masmorra de obsidiana.", - "minicraft.achievement.airwizard": "Derrotar... o ar?", - "minicraft.achievement.airwizard.desc": "Derrote o primeiro Mago dos ventos!", + "minicraft.achievement.planks": "Ande nas pranchas!", + "minicraft.achievement.planks.desc": "Faça pranchas de madeira.", "minicraft.achievement.skin": "Desfile de moda", "minicraft.achievement.skin.desc": "Muda a tua skin", + "minicraft.achievement.survive_darkness": "Medo do escuro?", + "minicraft.achievement.survive_darkness.desc": "Sobreviva 5 minutos na escuridão total.", + "minicraft.achievement.upgrade": "Melhoria!", + "minicraft.achievement.upgrade.desc": "Crie qualquer ferramenta de pedra.", + "minicraft.achievement.woodcutter": "Lenhador", + "minicraft.achievement.woodcutter.desc": "Obtenha madeira.", + "minicraft.control_guide.move": "Usa %s para te movimentares.", "minicraft.display.entries.boolean.false": "Não", "minicraft.display.entries.boolean.true": "Sim", "minicraft.display.gui.link_opening": "A abrir no browser...", @@ -38,12 +192,13 @@ "minicraft.display.gui.perm_status.sleep_cancel": "Pressiona %s para cancelar", "minicraft.display.gui.perm_status.sleeping": "A dormir...", "minicraft.display.gui.potion_effects.hide_hint": "(%s to ocultar!)", - "minicraft.display.gui.potion_effects.potion_dur": "", "minicraft.display.gui.score.current_score": "Pontuação atual: %s", "minicraft.display.gui.score.time_left": "Tempo restante %s%sm %ss", "minicraft.display.menus.inventory": "Inventário", "minicraft.display.options_display": "Definições", "minicraft.display.options_display.change_key_bindings": "Redefinir atalhos", + "minicraft.display.options_display.language": "Idioma", + "minicraft.display.options_display.resource_packs": "Pacotes de recursos", "minicraft.display.popup.enter_confirm": "enter para confirmar", "minicraft.display.popup.escape_cancel": "esc para cancelar", "minicraft.display.popup.title_confirm": "Confirmar ação", @@ -53,44 +208,44 @@ "minicraft.displays.achievements.display.not_achieved": "Não conquistado", "minicraft.displays.achievements.display.score": "Pontuação da conquista: %s", "minicraft.displays.book.default_book": "Este livro não contém nenhum texto.", + "minicraft.displays.controls": "Controlos", + "minicraft.displays.controls.display.controller": "Comando", + "minicraft.displays.controls.display.controller.11": "Para pausar o jogo usa START", + "minicraft.displays.controls.display.keyboard": "Teclado", "minicraft.displays.crafting": "Criação", "minicraft.displays.crafting.container_title.cost": "Custo:", "minicraft.displays.crafting.container_title.have": "Tens:", - "minicraft.displays.end_game.display.bonuses": "", "minicraft.displays.end_game.display.final_score": "Pontuação final: %s", "minicraft.displays.end_game.display.player_score": "Pontuação do jogador: %s", - "minicraft.displays.end_game.display.unlocked": "", "minicraft.displays.end_game.exit": "Sair para o menu principal", "minicraft.displays.info.display.exit_help": "%s/%s:Sair", "minicraft.displays.info.display.score": "Pontuação atual: %s", "minicraft.displays.info.display.time": "Tempo de jogo: %s", "minicraft.displays.info.title": "Estatísticas do jogador", - "minicraft.displays.key_input.display.help.0": "", "minicraft.displays.key_input.display.help.1": "Prime A para adicionar atalho", "minicraft.displays.key_input.display.help.2": "Shift-D para repor teclas", "minicraft.displays.key_input.display.help.3": "%s para voltar ao menu principal", - "minicraft.displays.key_input.popup_display.confirm_reset": "", - "minicraft.displays.key_input.popup_display.press_key_sequence": "", "minicraft.displays.key_input.title": "Controlos", + "minicraft.displays.language_settings.title": "Idioma...", "minicraft.displays.loading.message.entities": "Entidades", "minicraft.displays.loading.message.generating": "A gerar", "minicraft.displays.loading.message.level": "Nível %s", "minicraft.displays.loading.message.levels": "Níveis", "minicraft.displays.loading.message.loading": "A carregar", + "minicraft.displays.loading.message.quests": "Missões", "minicraft.displays.loading.message.saving": "A salvar", "minicraft.displays.loading.message.world": "Mundo", - "minicraft.displays.options_main_menu": "", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Carregamento do mundo foi cancelado", + "minicraft.displays.loading.regeneration_popup.display.3": "%s para continuar", + "minicraft.displays.loading.regeneration_popup.display.4": "%s para cancelar o carregamento do mundo", "minicraft.displays.options_main_menu.resource_packs": "Pacotes de recursos", - "minicraft.displays.options_world": "", "minicraft.displays.options_world.off_tutorials_confirm_popup": "Tens a certeza que queres desativar tutoriais para sempre?", "minicraft.displays.options_world.turn_off_tutorials": "Desativar tutoriais", "minicraft.displays.pause": "Pausa", "minicraft.displays.pause.display.exit_popup.0": "Tens a certeza que queres sair do jogo?", - "minicraft.displays.pause.display.exit_popup.1": "", "minicraft.displays.pause.display.exit_popup.cancel": "Cancelar", "minicraft.displays.pause.display.exit_popup.quit": "Sair sem guardar", "minicraft.displays.pause.display.help.choose": "%s: Escolher", - "minicraft.displays.pause.display.help.scroll": "", "minicraft.displays.pause.menu": "Menu principal", "minicraft.displays.pause.return": "Voltar ao jogo", "minicraft.displays.pause.save": "Guardar jogo", @@ -105,369 +260,82 @@ "minicraft.displays.quests": "Missões", "minicraft.displays.quests.display.header.completed": "Completado", "minicraft.displays.quests.display.header.unlocked": "Desbloqueada", + "minicraft.displays.quests.display.no_quest": "Nenhuma missão desbloqueada", "minicraft.displays.quests.display.no_quest_desc": "Nenhuma missão", "minicraft.displays.resource_packs.display.help.move": "Usa %s e %s para te movimentares.", - "minicraft.displays.resource_packs.display.help.select": "%s para examinar.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] para mover pacotes.␣", + "minicraft.displays.resource_packs.display.help.select": "%s para examinar.", "minicraft.displays.resource_packs.display.title": "Pacotes de recurso", "minicraft.displays.skin": "Skins", "minicraft.displays.skin.display.help.move": "Usa %s e %s para te movimentares.", "minicraft.displays.skin.display.help.select": "%s para selecionar e %s para cancelar.", - "minicraft.displays.title.display.cannot_check": "", - "minicraft.displays.title.display.checking": "", "minicraft.displays.title.display.help.0": "(%s, %s para selecionar)", "minicraft.displays.title.display.help.1": "(%s para aceitar)", "minicraft.displays.title.display.help.2": "(%s para voltar)", - "minicraft.displays.title.display.latest_already": "", - "minicraft.displays.title.display.new_version": "", "minicraft.displays.title.display.version": "Versão %s", "minicraft.displays.title.help": "Ajuda", "minicraft.displays.title.help.about": "Sobre", "minicraft.displays.title.help.credits": "Créditos", "minicraft.displays.title.help.instructions": "Instruções", - "minicraft.displays.title.help.storyline_guide": "", - "minicraft.displays.title.link_to_version": "", "minicraft.displays.title.play": "Jogar", "minicraft.displays.title.play.load_world": "Carregar mundo", "minicraft.displays.title.play.new_world": "Novo mundo", "minicraft.displays.title.quit": "Sair", - "minicraft.displays.title.select_to_download": "", "minicraft.displays.world_gen.create_world": "Criar mundo", - "minicraft.displays.world_gen.enter_world": "", - "minicraft.displays.world_gen.title": "", - "minicraft.displays.world_gen.troublesome_input": "", - "minicraft.displays.world_gen.troublesome_input.msg": "", "minicraft.displays.world_gen.world_seed": "Seed do mundo", "minicraft.displays.world_select.display.help.0": "%s para confirmar", "minicraft.displays.world_select.display.help.1": "%s para voltar", "minicraft.displays.world_select.display.help.2": "SHIFT-C para copiar", "minicraft.displays.world_select.display.help.3": "SHIFT-R para renomear", "minicraft.displays.world_select.display.help.4": "SHIFT-D para eliminar", - "minicraft.displays.world_select.display.world_too_new": "", "minicraft.displays.world_select.display.world_version": "Versão do mundo: %s", "minicraft.displays.world_select.popups.display.cancel": "%s para cancelar", - "minicraft.displays.world_select.popups.display.change": "", "minicraft.displays.world_select.popups.display.confirm": "%s para confirmar", - "minicraft.displays.world_select.popups.display.delete": "", "minicraft.displays.world_select.select_world": "Selecionar mundo", "minicraft.notification.achievement_unlocked": "Conquista desbloqueada:", "minicraft.notification.air_wizard_defeated": "Mago do Ar foi derrotado!", - "minicraft.notification.cannot_sleep": "", - "minicraft.notification.death_chest_retrieved": "", - "minicraft.notification.defeat_air_wizard_first": "", "minicraft.notification.dig_hole": "Cava um buraco primeiro!", - "minicraft.notification.dungeon_opened": "", - "minicraft.notification.gem_pickaxe_required": "", "minicraft.notification.invalid_placement": "Só pode ser colocado em", "minicraft.notification.quest_completed": "Missão completada", "minicraft.notification.quest_unlocked": "Missão desbloqueada", "minicraft.notification.world_saved": "O mundo foi salvo!", - "minicraft.notification.wrong_level_sky": "", - "minicraft.settings.fps": "", + "minicraft.quest.farming.crafting_hoe": "Criar uma enxada", + "minicraft.quest.farming.getting_wheat": "Recolher trigo", + "minicraft.quest.iron_equipments.getting_more_iron": "Rico em ferro", + "minicraft.quest.iron_equipments.getting_more_iron.description": "Recolhe mais ferro.", + "minicraft.quest.iron_equipments.iron_armor": "Melhorar armadura", + "minicraft.quest.iron_equipments.iron_armor.description": "Melhorar a tua armadura para ferro.", + "minicraft.quest.iron_equipments.iron_tools": "Melhorar todas as ferramentas", + "minicraft.quest.iron_equipments.iron_tools.description": "Melhorar todas as tuas ferramentas para ferro.", + "minicraft.quest.iron_equipments.upgrading_pickaxe": "Picareta avançada", + "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Melhorar a tua picareta.", + "minicraft.quest.potions.description": "Obtém poções", + "minicraft.settings.autosave": "Gravação automática", "minicraft.settings.difficulty": "Dificuldade", "minicraft.settings.difficulty.easy": "Fácil", - "minicraft.settings.difficulty.normal": "Normal", "minicraft.settings.difficulty.hard": "Difícil", + "minicraft.settings.difficulty.normal": "Normal", "minicraft.settings.mode": "Modo de jogo", - "minicraft.settings.mode.survival": "Sobrevivência", "minicraft.settings.mode.creative": "Criativo", - "minicraft.settings.mode.hardcore": "", "minicraft.settings.mode.score": "Pontuação", - "minicraft.settings.scoretime": "", - "minicraft.settings.screenshot_scale": "", - "minicraft.settings.sound": "Som", - "minicraft.settings.autosave": "Gravação automática", + "minicraft.settings.mode.survival": "Sobrevivência", "minicraft.settings.size": "Tamanho do mundo", + "minicraft.settings.sound": "Som", "minicraft.settings.theme": "Tema do mundo", - "minicraft.settings.theme.normal": "", - "minicraft.settings.theme.forest": "Floresta", "minicraft.settings.theme.desert": "Deserto", - "minicraft.settings.theme.plain": "Planície", + "minicraft.settings.theme.forest": "Floresta", "minicraft.settings.theme.hell": "Inferno", + "minicraft.settings.theme.plain": "Planície", "minicraft.settings.type": "Tipo de terreno", "minicraft.settings.type.island": "Ilha", - "minicraft.settings.type.box": "", "minicraft.settings.type.mountain": "Montanha", - "minicraft.settings.type.irregular": "", + "minicraft.skin.minecraft_alex": "Rapariga conhecida", + "minicraft.skin.minecraft_steve": "Rapaz conhecido", "minicraft.skin.paul": "Paul", "minicraft.skin.paul_cape": "Paul com capa", - "minicraft.skin.minecraft_steve": "Rapaz conhecido", - "minicraft.skin.minecraft_alex": "Rapariga conhecida", - "minicraft.text_particales.key_consumed": "", - "Death Chest": "Baú da Morte", - "Player": "Jogador", - "Leather Armor": "Armadura de Couro", - "Snake Armor": "Armadura de Serpente", - "Iron Armor": "Armadura de Ferro", - "Gold Armor": "Armadura Dourada", - "Gem Armor": "Armadura de Gema", - "Book": "Livro", - "Antidious": "Gibi", - "Empty Bucket": "Balde vazio", - "Water Bucket": "Balde com Água", - "Lava Bucket": "Balde com Lava", - "Red Clothes": "Camisa Vermelha", - "Blue Clothes": "Camisa Azul", - "Green Clothes": "Camisa Verde", - "Yellow Clothes": "Camisa Amarela", - "Black Clothes": "Camisa Preta", - "Orange Clothes": "Camisa Laranja", - "Purple Clothes": "Camisa Roxa", - "Cyan Clothes": "Camisa Ciana", - "Reg Clothes": "Camisa Regular", - "Bread": "Pão", - "Apple": "Maçã", - "Raw Pork": "Carne de Porco crua", - "Raw Fish": "Peixe Cru", - "Raw Beef": "Bife Cru", - "Pork Chop": "Carne de Porco", - "Cooked Fish": "Peixe Assado", - "Cooked Pork": "Carne de Porco Assada", - "Steak": "Bife Cozido", - "Gold Apple": "Maçã Dourada", - "Baked Potato": "Batata assada", - "Cow Spawner": "Invocar Vaca", - "Pig Spawner": "Invocar Porco", - "Sheep Spawner": "Invocar Cabra", - "Slime Spawner": "Invocar Gosma", - "Zombie Spawner": "Invocar Zumbi", - "Creeper Spawner": "Invocar Creeper", - "Skeleton Spawner": "Invocar Esqueleto", - "Snake Spawner": "Invocar Cobra", - "Knight Spawner": "Invocar Cavaleiro", - "AirWizard Spawner": "Invocar Mago dos Ventos", - "Workbench": "Mesa de trabalho", - "Oven": "Forno", - "Furnace": "Fornalha", - "Anvil": "Bigorna", - "Enchanter": "Encantadora", - "Loom": "Costureira", - "Lantern": "Lamparina", - "Iron Lantern": "Lamparina de Ferro", - "Gold Lantern": "Lamparina de Ouro", - "Tnt": "Dinamite", - "Bed": "Cama", - "Chest": "Baú", - "None Potion": "Poção vazia", - "Speed Potion": "Poção de Agilidade", - "Light Potion": "Poção da Luz", - "Swim Potion": "Poção da Natação", - "Energy Potion": "Poção da Energia", - "Regen Potion": "Poção de Regeneração", - "Health Potion": "Poção da Vida", - "Time Potion": "Poção do Tempo", - "Lava Potion": "Poção da Lava", - "Shield Potion": "Poção do Escudo", - "Haste Potion": "Poção de Pressa", - "Escape Potion": "Poção de Fuga", - "Potion": "Poção", - "Power Glove": "Luva do Poder", - "Wood": "Madeira", - "Stone": "Pedra", - "Leather": "Couro", - "Wheat": "Trigo", - "Key": "Chave", - "Coal": "Carvão", - "Iron Ore": "Minério de Ferro", - "Gold Ore": "Minério de Ouro", - "Gem Ore": "Minério de gema", - "Cloud Ore": "", - "Iron": "Ferro", - "Gold": "Ouro", - "Lapis": "Lápis", - "Rose": "Rosa", - "Gunpowder": "Pólvora", - "Slime": "Gosma", - "Scale": "Esquama", - "Shard": "Fragmento", - "Flower": "Flor", - "Acorn": "Noz", - "Dirt": "Terra", - "Natural Rock": "Rocha Natural", - "Plank": "Tábua", - "Plank Wall": "Parede de Madeira", - "Wood Door": "Porta de Madeira", - "Stone Brick": "Tijolos de Pedra", - "Ornate Stone": "Pedra Ornamentada", - "Stone Wall": "Parede de Pedra", - "Stone Door": "Porta de Pedra", - "Obsidian Brick": "Tijolos de Obsidiana", - "Ornate Obsidian": "Obsidiana ornamentada", - "Obsidian Wall": "Parede de Obsidiana", - "Obsidian Door": "Porta de Obsidiana", - "Wool": "Lã", - "Red Wool": "Lã Vermelha", - "Blue Wool": "Lã Azul", - "Green Wool": "Lã Verde", - "Yellow Wool": "Lã Amarela", - "Black Wool": "Lã Preta", - "Sand": "Areia", - "Cactus": "Cacto", - "Seeds": "Sementes", - "Wheat Seeds": "Sementes de Trigo", - "Grass Seeds": "Sementes de Erva", - "Bone": "Osso", - "Cloud": "Nuvem", - "Rock": "Pedra", - "Gem": "Gema", - "Potato": "Batata", - "Wood Fishing Rod": "Vara de pescar de madeira", - "Iron Fishing Rod": "Vara de pescar de ferro", - "Gold Fishing Rod": "Vara de pescar de ouro", - "Gem Fishing Rod": "Vara de pescar de gema", - "Shovel": "Pá", - "Hoe": "Enxada", - "Sword": "Espada", - "Pickaxe": "Picareta", - "Axe": "Machado", - "Bow": "Arco", - "Claymore": "Espada Escocesa", - "Shears": "Tesoura", - "Torch": "Tocha", - "Wood Planks": "Tábuas de Madeira", - "Stone Bricks": "Tijolos de Pedra", - "Obsidian": "Obsidiana", - "Wood Wall": "Parede de Madeira", - "Grass": "Grama", - "Hole": "Buraco", - "Stairs Up": "Escadas acima", - "Stairs Down": "Escadas abaixo", - "Water": "Água", - "Tree": "Árvore", - "Tree Sapling": "Muda de Árvore", - "Cactus Sapling": "Semente de Cacto", - "Lava": "Lava", - "Lava Brick": "Tijolos de Lava", - "Explode": "Explodir", - "Farmland": "Terra Arrada", - "Hard Rock": "Pedra Dura", - "Infinite Fall": "Queda Infinita", - "Cloud Cactus": "Nuvem de Cacto", - "Raw Obsidian": "", - "Totem of Air": "Totem do ar", - "minicraft.control_guide.attack": "", - "minicraft.control_guide.craft": "", - "minicraft.control_guide.menu": "", - "minicraft.control_guide.move": "Usa %s para te movimentares.", - "minicraft.displays.controls": "Controlos", - "minicraft.displays.controls.display.controller": "Comando", - "minicraft.displays.controls.display.controller.00": "", - "minicraft.displays.controls.display.controller.01": "", - "minicraft.displays.controls.display.controller.02": "", - "minicraft.displays.controls.display.controller.03": "", - "minicraft.displays.controls.display.controller.04": "", - "minicraft.displays.controls.display.controller.05": "", - "minicraft.displays.controls.display.controller.06": "", - "minicraft.displays.controls.display.controller.07": "", - "minicraft.displays.controls.display.controller.08": "", - "minicraft.displays.controls.display.controller.09": "", - "minicraft.displays.controls.display.controller.10": "", - "minicraft.displays.controls.display.controller.11": "Para pausar o jogo usa START", - "minicraft.displays.controls.display.controller.12": "", - "minicraft.displays.controls.display.controller.13": "", - "minicraft.displays.controls.display.controller.14": "", - "minicraft.displays.controls.display.controller.15": "", - "minicraft.displays.controls.display.controller.desc.0": "", - "minicraft.displays.controls.display.controller.desc.1": "", - "minicraft.displays.controls.display.help.0": "", - "minicraft.displays.controls.display.keyboard": "Teclado", - "minicraft.displays.controls.display.keyboard.00": "", - "minicraft.displays.controls.display.keyboard.01": "", - "minicraft.displays.controls.display.keyboard.02": "", - "minicraft.displays.controls.display.keyboard.03": "", - "minicraft.displays.controls.display.keyboard.04": "", - "minicraft.displays.controls.display.keyboard.05": "", - "minicraft.displays.controls.display.keyboard.06": "", - "minicraft.displays.controls.display.keyboard.07": "", - "minicraft.displays.controls.display.keyboard.08": "", - "minicraft.displays.controls.display.keyboard.09": "", - "minicraft.displays.controls.display.keyboard.10": "", - "minicraft.displays.controls.display.keyboard.11": "", - "minicraft.displays.controls.display.keyboard.12": "", - "minicraft.displays.controls.display.keyboard.13": "", - "minicraft.displays.controls.display.keyboard.14": "", - "minicraft.displays.controls.display.keyboard.15": "", - "minicraft.displays.controls.display.keyboard.16": "", - "minicraft.displays.controls.display.keyboard.17": "", - "minicraft.displays.controls.display.keyboard.18": "", - "minicraft.displays.controls.display.keyboard.19": "", - "minicraft.displays.controls.display.keyboard.20": "", - "minicraft.displays.controls.display.keyboard.21": "", - "minicraft.displays.controls.display.keyboard.22": "", - "minicraft.displays.controls.display.keyboard.desc": "", - "minicraft.displays.loading.message.dungeon_regeneration": "", - "minicraft.displays.loading.message.quests": "Missões", - "minicraft.displays.loading.regeneration_popup.display.0": "", - "minicraft.displays.loading.regeneration_popup.display.1": "", - "minicraft.displays.loading.regeneration_popup.display.2": "", - "minicraft.displays.loading.regeneration_popup.display.3": "%s para continuar", - "minicraft.displays.loading.regeneration_popup.display.4": "%s para cancelar o carregamento do mundo", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "Carregamento do mundo foi cancelado", - "minicraft.displays.quests.display.no_quest": "Nenhuma missão desbloqueada", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", - "minicraft.notification.obsidian_knight_defeated": "", - "minicraft.notification.obsidian_knight_awoken": "", - "minicraft.notification.defeat_obsidian_knight_first": "", - "minicraft.notification.wrong_level_dungeon": "", - "minicraft.notification.boss_limit": "", - "minicraft.notification.spawn_on_boss_tile": "", - "minicraft.notifications.statue_tapped": "", - "minicraft.notifications.statue_touched": "", - "minicraft.quest.farming": "", - "minicraft.quest.farming.crafting_hoe": "Criar uma enxada", - "minicraft.quest.farming.crafting_hoe.description": "", - "minicraft.quest.farming.description": "", - "minicraft.quest.farming.getting_wheat": "Recolher trigo", - "minicraft.quest.farming.getting_wheat.description": "", - "minicraft.quest.farming.making_farmland": "", - "minicraft.quest.farming.making_farmland.description": "", - "minicraft.quest.farming.planting_potato": "", - "minicraft.quest.farming.planting_potato.description": "", - "minicraft.quest.farming.planting_wheat": "", - "minicraft.quest.farming.planting_wheat.description": "", - "minicraft.quest.gems": "", - "minicraft.quest.gems.description": "", - "minicraft.quest.gems.gem_armor": "", - "minicraft.quest.gems.gem_armor.description": "", - "minicraft.quest.gems.gem_claymore": "", - "minicraft.quest.gems.gem_claymore.description": "", - "minicraft.quest.iron_equipments": "", - "minicraft.quest.iron_equipments.description": "", - "minicraft.quest.iron_equipments.getting_more_iron": "Rico em ferro", - "minicraft.quest.iron_equipments.getting_more_iron.description": "Recolhe mais ferro.", - "minicraft.quest.iron_equipments.iron_armor": "Melhorar armadura", - "minicraft.quest.iron_equipments.iron_armor.description": "Melhorar a tua armadura para ferro.", - "minicraft.quest.iron_equipments.iron_tools": "Melhorar todas as ferramentas", - "minicraft.quest.iron_equipments.iron_tools.description": "Melhorar todas as tuas ferramentas para ferro.", - "minicraft.quest.iron_equipments.upgrading_pickaxe": "Picareta avançada", - "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Melhorar a tua picareta.", - "minicraft.quest.potions": "", - "minicraft.quest.potions.all_potions_prepared": "", - "minicraft.quest.potions.all_potions_prepared.description": "", - "minicraft.quest.potions.awkward_potions": "", - "minicraft.quest.potions.awkward_potions.description": "", - "minicraft.quest.potions.description": "Obtém poções", - "minicraft.quest.potions.powerful_potions": "", - "minicraft.quest.potions.powerful_potions.description": "", "minicraft.tutorial.getting_rocks": "Recolhe pedra e carvão", - "minicraft.tutorial.getting_rocks.description": "", "minicraft.tutorial.getting_wood": "Recolhe mais madeira", - "minicraft.tutorial.getting_wood.description": "", "minicraft.tutorial.getting_wooden_pickaxe": "Obtém uma picareta de madeira", - "minicraft.tutorial.getting_wooden_pickaxe.description": "", "minicraft.tutorial.getting_workbench": "Obtém uma mesa de trabalho", - "minicraft.tutorial.getting_workbench.description": "", - "minicraft.tutorial.start_getting_wood": "O começo", - "minicraft.tutorial.start_getting_wood.description": "", - "minicraft.display.options_display.language": "Idioma", - "minicraft.display.options_display.resource_packs": "Pacotes de recursos", - "minicraft.displays.language_settings.title": "Idioma...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Flecha", - "String": "Linha", - "Glass": "Vidro", - "Cloth": "Tecido" + "minicraft.tutorial.start_getting_wood": "O começo" } diff --git a/src/client/resources/assets/localization/ru-ru.json b/src/client/resources/assets/localization/ru-ru.json index c5159e95a..d567600ba 100644 --- a/src/client/resources/assets/localization/ru-ru.json +++ b/src/client/resources/assets/localization/ru-ru.json @@ -1,36 +1,195 @@ { - "minicraft.achievement.woodcutter": "Лесоруб", - "minicraft.achievement.woodcutter.desc": "Добыть древесину.", + "Acorn": "Жёлудь", + "AirWizard Spawner": "Призыватель Небесных колдунов", + "Antidious": "Антидия (английский)", + "Anvil": "Наковальня", + "Apple": "Яблоко", + "Arrow": "Стрелка", + "Axe": "Топор", + "Baked Potato": "Печёный картофель", + "Bed": "Кровать", + "Black Clothes": "Черная одежда", + "Black Wool": "Черная шерсть", + "Blue Clothes": "Синяя одежда", + "Blue Wool": "Синяя шерсть", + "Bone": "Кость", + "Book": "Книга", + "Bow": "Лук", + "Bread": "Хлеб", + "Cactus": "Кактус", + "Cactus Sapling": "Саженец кактуса", + "Chest": "Сундук", + "Claymore": "Клеймор", + "Cloth": "Ткань", + "Cloud": "Облако", + "Cloud Cactus": "Облачный кактус", + "Cloud Ore": "Облачная руда", + "Coal": "Уголь", + "Cooked Fish": "Копченая рыба", + "Cooked Pork": "Жареная свинина", + "Cow Spawner": "Призыватель коров", + "Creeper Spawner": "Призыватель криперов", + "Cyan Clothes": "Голубая одежда", + "Death Chest": "Сундук смерти", + "Dirt": "Земля", + "Empty Bucket": "Пустое ведро", + "Enchanter": "Алтарь", + "Energy Potion": "Зелье энергии", + "Escape Potion": "Зелье возврата", + "Explode": "Взорвать", + "Farmland": "Вспаханная земля", + "Flower": "Цветок", + "Furnace": "Печь", + "Gem": "Самоцвет", + "Gem Armor": "Самоцветовая броня", + "Gem Fishing Rod": "Самоцветовая удочка", + "Gem Ore": "Самоцветная руда", + "Glass": "Стекло", + "Gold": "Золотой слиток", + "Gold Apple": "Золотое яблоко", + "Gold Armor": "Золотая броня", + "Gold Fishing Rod": "Золотая удочка", + "Gold Lantern": "Золотой фонарь", + "Gold Ore": "Золотая руда", + "Grass": "Трава", + "Grass Seeds": "Семена травы", + "Green Clothes": "Зеленая одежда", + "Green Wool": "Зеленая шерсть", + "Gunpowder": "Порох", + "Hard Rock": "Твёрдая скала", + "Haste Potion": "Зелье спешки", + "Health Potion": "Зелье здоровья", + "Hoe": "Мотыга", + "Hole": "Дыра", + "Infinite Fall": "Бездна", + "Iron": "Железный слиток", + "Iron Armor": "Железная броня", + "Iron Fishing Rod": "Железная удочка", + "Iron Lantern": "Железный фонарь", + "Iron Ore": "Железная руда", + "Key": "Ключ", + "Knight Spawner": "Призыватель рыцарей", + "Lantern": "Фонарь", + "Lapis": "Лазурит", + "Lava": "Лава", + "Lava Brick": "Лавовый кирпич", + "Lava Bucket": "Ведро лавы", + "Lava Potion": "Зелье жаростойкости", + "Leather": "Кожа", + "Leather Armor": "Кожаные доспехи", + "Light Potion": "Зелье ночного зрения", + "Loom": "Ткацкий станок", + "Natural Rock": "Природный камень", + "None Potion": "Пустое зелье", + "Obsidian": "Обсидиан", + "Obsidian Brick": "Обсидиановый кирпич", + "Obsidian Door": "Обсидиановая дверь", + "Obsidian Wall": "Обсидиановая стена", + "Orange Clothes": "Оранжевая одежда", + "Ornate Obsidian": "Резной обсидиан", + "Ornate Stone": "Резной камень", + "Oven": "Духовка", + "Pickaxe": "Кирка", + "Pig Spawner": "Призыватель свиней", + "Plank": "Доска", + "Plank Wall": "Деревянная стена", + "Player": "Игрок", + "Pork Chop": "Жареная свинина", + "Potato": "Картофель", + "Potion": "Зелье", + "Power Glove": "Перчатка силы", + "Purple Clothes": "Фиолетовая одежда", + "Raw Beef": "Сырая говядина", + "Raw Fish": "Сырая рыба", + "Raw Obsidian": "Обсидиан", + "Raw Pork": "Сырая свинина", + "Red Clothes": "Красная одежда", + "Red Wool": "Красная шерсть", + "Reg Clothes": "Поношенная одежда", + "Regen Potion": "Зелье регенерации", + "Rock": "Камень", + "Rose": "Роза", + "Sand": "Песок", + "Scale": "Чешуя", + "Seeds": "Семена", + "Shard": "Осколок", + "Shears": "Ножницы", + "Sheep Spawner": "Призыватель овец", + "Shield Potion": "Зелье защиты", + "Shovel": "Лопата", + "Skeleton Spawner": "Призыватель скелетов", + "Slime": "Слизь", + "Slime Spawner": "Призыватель слизней", + "Snake Armor": "Змеиная броня", + "Snake Spawner": "Призыватель змей", + "Speed Potion": "Зелье скорости", + "Stairs Down": "Лестница вниз", + "Stairs Up": "Лестница вверх", + "Steak": "Стейк", + "Stone": "Камень", + "Stone Brick": "Каменный кирпич", + "Stone Bricks": "Каменные кирпичи", + "Stone Door": "Каменная дверь", + "Stone Wall": "Каменная стена", + "String": "Строка", + "Swim Potion": "Зелье плавучести", + "Sword": "Меч", + "Time Potion": "Зелье времени", + "Tnt": "Взрывчатка", + "Torch": "Факел", + "Totem of Air": "Тотем воздуха", + "Tree": "Дерево", + "Tree Sapling": "Саженец дерева", + "Water": "Вода", + "Water Bucket": "Ведро воды", + "Wheat": "Пшеница", + "Wheat Seeds": "Семена пшеницы", + "Wood": "Дерево", + "Wood Door": "Деревянная дверь", + "Wood Fishing Rod": "Деревянная удочка", + "Wood Planks": "Деревянные доски", + "Wood Wall": "Деревянная стена", + "Wool": "Шерсть", + "Workbench": "Верстак", + "Yellow Clothes": "Желтая одежда", + "Yellow Wool": "Желтая шерсть", + "Zombie Spawner": "Призыватель зомби", + "minicraft.achievement.airwizard": "Победить... воздух?", + "minicraft.achievement.airwizard.desc": "Победите первого Небесного колдуна!", "minicraft.achievement.benchmarking": "Верстачество", "minicraft.achievement.benchmarking.desc": "Создайте верстак.", - "minicraft.achievement.upgrade": "Обновка!", - "minicraft.achievement.upgrade.desc": "Создайте любой каменный инструмент.", "minicraft.achievement.bow": "Стрелок!", "minicraft.achievement.bow.desc": "Выстрелить из лука.", - "minicraft.achievement.fish": "Идем рыбачить!", - "minicraft.achievement.fish.desc": "Поймайте рыбу!", - "minicraft.achievement.doors": "Дверная защита", - "minicraft.achievement.doors.desc": "Создайте деревянную дверь.", - "minicraft.achievement.planks": "Пройдись по доскам!", - "minicraft.achievement.planks.desc": "Создайте деревянные доски.", "minicraft.achievement.clothes": "Красочного вам дня!", "minicraft.achievement.clothes.desc": "Создайте одежду любого цвета.", "minicraft.achievement.demolition": "Демонстрация разрушения", "minicraft.achievement.demolition.desc": "Используйте взрывчатку.", - "minicraft.achievement.survive_darkness": "Боишься темноты?", - "minicraft.achievement.survive_darkness.desc": "Выживите 5 минут в полной темноте.", - "minicraft.achievement.lava": "Горячие делишки", - "minicraft.achievement.lava.desc": "Используйте зелье жаростойкости, чтобы плавать в лаве.", + "minicraft.achievement.doors": "Дверная защита", + "minicraft.achievement.doors.desc": "Создайте деревянную дверь.", "minicraft.achievement.find_gem": "Ооо, блестяшка!", "minicraft.achievement.find_gem.desc": "Найдите самоцветную руду и вскопайте ее.", + "minicraft.achievement.fish": "Идем рыбачить!", + "minicraft.achievement.fish.desc": "Поймайте рыбу!", + "minicraft.achievement.lava": "Горячие делишки", + "minicraft.achievement.lava.desc": "Используйте зелье жаростойкости, чтобы плавать в лаве.", "minicraft.achievement.lowest_caves": "Тьма за светом", "minicraft.achievement.lowest_caves.desc": "Достигните самого нижнего уровня пещер.", "minicraft.achievement.obsidian_dungeon": "О рыцарях и людях", "minicraft.achievement.obsidian_dungeon.desc": "Попадите в обсидиановое подземелье.", - "minicraft.achievement.airwizard": "Победить... воздух?", - "minicraft.achievement.airwizard.desc": "Победите первого Небесного колдуна!", + "minicraft.achievement.planks": "Пройдись по доскам!", + "minicraft.achievement.planks.desc": "Создайте деревянные доски.", "minicraft.achievement.skin": "Модный приговор", "minicraft.achievement.skin.desc": "Измените свой прикид.", + "minicraft.achievement.survive_darkness": "Боишься темноты?", + "minicraft.achievement.survive_darkness.desc": "Выживите 5 минут в полной темноте.", + "minicraft.achievement.upgrade": "Обновка!", + "minicraft.achievement.upgrade.desc": "Создайте любой каменный инструмент.", + "minicraft.achievement.woodcutter": "Лесоруб", + "minicraft.achievement.woodcutter.desc": "Добыть древесину.", + "minicraft.control_guide.attack": "Используйте %s, чтобы атаковать мобов или разрушать блоки.", + "minicraft.control_guide.craft": "Используйте %s, чтобы открыть Меню создания.", + "minicraft.control_guide.menu": "Используйте %s, чтобы открыть Меню инвентаря.", + "minicraft.control_guide.move": "Используйте %s, чтобы двигатся.", "minicraft.display.entries.boolean.false": "Выкл", "minicraft.display.entries.boolean.true": "Вкл", "minicraft.display.gui.link_opening": "Открывается в браузере...", @@ -44,6 +203,8 @@ "minicraft.display.menus.inventory": "Инвентарь", "minicraft.display.options_display": "Настройки", "minicraft.display.options_display.change_key_bindings": "Изменить управление", + "minicraft.display.options_display.language": "Язык", + "minicraft.display.options_display.resource_packs": "Наборы ресурсов", "minicraft.display.popup.enter_confirm": "ENTER, чтобы подтвердить", "minicraft.display.popup.escape_cancel": "ESCAPE для отмены", "minicraft.display.popup.title_confirm": "Подтвердить действие", @@ -53,6 +214,52 @@ "minicraft.displays.achievements.display.not_achieved": "Не получено", "minicraft.displays.achievements.display.score": "Очков достижений: %s", "minicraft.displays.book.default_book": "В данной книге нет текста.", + "minicraft.displays.controls": "Управление", + "minicraft.displays.controls.display.controller": "Контроллер", + "minicraft.displays.controls.display.controller.00": "За передвижение игрока отвечает DPAD", + "minicraft.displays.controls.display.controller.01": "За передвижение курсора отвечает DPAD", + "minicraft.displays.controls.display.controller.02": "За выбор элемента отвечает A", + "minicraft.displays.controls.display.controller.03": "За выход со страниц отвечает B", + "minicraft.displays.controls.display.controller.04": "За атаку, разрушение и использование отвечает A", + "minicraft.displays.controls.display.controller.05": "За открытие меню в игре отвечает X", + "minicraft.displays.controls.display.controller.06": "За открытие меню создания отвечает Y", + "minicraft.displays.controls.display.controller.07": "За перетаскивание мебели отвечает LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "За выбрасывание 1 предмета отвечает RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "За выбрасывание стака предметов отвечает RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "За открытие строки поиска в инвентаре отвечает START", + "minicraft.displays.controls.display.controller.11": "За паузу во время игры отвечает START", + "minicraft.displays.controls.display.controller.12": "Используйте X, чтобы активировать экранную клавиатуру", + "minicraft.displays.controls.display.controller.13": "Используйте B как Backspace на экранной клавиатуре", + "minicraft.displays.controls.display.controller.14": "Используйте X, чтобы убрать выбранный предмет в инвентаре Творческого режима", + "minicraft.displays.controls.display.controller.15": "Используйте Y, чтобы удалить стак предметов в инвентаре Творческого режима", + "minicraft.displays.controls.display.controller.desc.0": "Клавиши отладки недоступны", + "minicraft.displays.controls.display.controller.desc.1": "Детализированные назначения неиспользуемы", + "minicraft.displays.controls.display.help.0": "%s/%s чтобы увидеть другие клавиши управления.", + "minicraft.displays.controls.display.keyboard": "Клавиатура", + "minicraft.displays.controls.display.keyboard.00": "За передвижение игрока отвечает MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "За передвижение курсора отвечает CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "За выбор ячеек отвечает SELECT", + "minicraft.displays.controls.display.keyboard.03": "За выход со страниц отвечает EXIT", + "minicraft.displays.controls.display.keyboard.04": "За быстрое сохранение отвечает QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "За атаку, разрушение и использование отвечает ATTACK", + "minicraft.displays.controls.display.keyboard.06": "За открытие внутриигровых меню отвечает MENU", + "minicraft.displays.controls.display.keyboard.07": "За открытие меню создания отвечает CRAFT", + "minicraft.displays.controls.display.keyboard.08": "За перетаскивание мебели отвечает PICKUP", + "minicraft.displays.controls.display.keyboard.09": "За выбрасывание 1 предмета отвечает DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "За выбрасывание стака предметов отвечает DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "За переключение строки поиска в меню предметов отвечает SEARCHER_BAR", + "minicraft.displays.controls.display.keyboard.12": "За навигацию по результатам поиска отвечает PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "За паузу отвечает PAUSE", + "minicraft.displays.controls.display.keyboard.14": "За переключение экрана эффектов зелий отвечает POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "За переключение упрощенного экрана зелий отвечает SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "За временное разворачивание экрана заданий во время игры отвечает EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "За переключение интерфейса отвечает TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "За создание скриншота отвечает SCREENSHOT", + "minicraft.displays.controls.display.keyboard.19": "За отображение внутриигровой информации отвечает INFO", + "minicraft.displays.controls.display.keyboard.20": "За переключение полноэкранного режима отвечает FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Используйте D, чтобы удалить выбранный предмет в инвентаре творческого режима", + "minicraft.displays.controls.display.keyboard.22": "Используйте SHIFT-D чтобы удалить стак предметов в инвентаре в творческого режима", + "minicraft.displays.controls.display.keyboard.desc": "Отладочные клавиши не описаны", "minicraft.displays.crafting": "Создание", "minicraft.displays.crafting.container_title.cost": "Цена:", "minicraft.displays.crafting.container_title.have": "Есть:", @@ -72,13 +279,22 @@ "minicraft.displays.key_input.popup_display.confirm_reset": "Вы уверены, что хотите сбросить все клавиши управления?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Нажмите желаемую последовательность клавиш", "minicraft.displays.key_input.title": "Управление", + "minicraft.displays.language_settings.title": "Язык...", + "minicraft.displays.loading.message.dungeon_regeneration": "Восстановление B4", "minicraft.displays.loading.message.entities": "Существа", "minicraft.displays.loading.message.generating": "Генерация", "minicraft.displays.loading.message.level": "Уровень %s", "minicraft.displays.loading.message.levels": "Уровни", "minicraft.displays.loading.message.loading": "Загрузка", + "minicraft.displays.loading.message.quests": "Задания", "minicraft.displays.loading.message.saving": "Сохранение", "minicraft.displays.loading.message.world": "Мир", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Загрузка мира отменена", + "minicraft.displays.loading.regeneration_popup.display.0": "Обнаружено подземелье старой версии (этаж B4).", + "minicraft.displays.loading.regeneration_popup.display.1": "Необходима регенерация.", + "minicraft.displays.loading.regeneration_popup.display.2": "Старые данные на этом этаже будут стёрты:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s чтобы продолжить", + "minicraft.displays.loading.regeneration_popup.display.4": "%s чтобы отменить загрузку мира", "minicraft.displays.options_main_menu": "Настройки", "minicraft.displays.options_main_menu.resource_packs": "Пакеты ресурсов", "minicraft.displays.options_world": "Настройки мира", @@ -105,10 +321,12 @@ "minicraft.displays.quests": "Задания", "minicraft.displays.quests.display.header.completed": "Выполнено", "minicraft.displays.quests.display.header.unlocked": "Открыто", + "minicraft.displays.quests.display.no_quest": "Нет открытых заданий", "minicraft.displays.quests.display.no_quest_desc": "Нет задания", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Доступен только ввод с клавиатуры.", "minicraft.displays.resource_packs.display.help.move": "Используйте %s и %s для навигации.", - "minicraft.displays.resource_packs.display.help.select": "%s чтобы изучить.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] чтобы двигать пакеты. ", + "minicraft.displays.resource_packs.display.help.select": "%s чтобы изучить.", "minicraft.displays.resource_packs.display.title": "Пакеты ресурсов", "minicraft.displays.skin": "Скины", "minicraft.displays.skin.display.help.move": "Используйте %s и %s для навигации.", @@ -132,6 +350,7 @@ "minicraft.displays.title.play.new_world": "Создать мир", "minicraft.displays.title.quit": "Выйти", "minicraft.displays.title.select_to_download": "--Выберите это, чтобы скачать--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Нажмите %s, чтобы узнать подробности текущего туторила.", "minicraft.displays.world_gen.create_world": "Создать мир", "minicraft.displays.world_gen.enter_world": "Название мира", "minicraft.displays.world_gen.title": "Настройки генератора", @@ -152,266 +371,23 @@ "minicraft.displays.world_select.select_world": "Выбор мира", "minicraft.notification.achievement_unlocked": "Получено достижение: %s", "minicraft.notification.air_wizard_defeated": "Небесный колдун побеждён!", + "minicraft.notification.boss_limit": "Нельзя призвать больше боссов", "minicraft.notification.cannot_sleep": "Вы сможете спать через %s мин %s сек!", "minicraft.notification.death_chest_retrieved": "Сундук смерти возвращён!", "minicraft.notification.defeat_air_wizard_first": "Сначала необходимо победить Небесного колдуна.", + "minicraft.notification.defeat_obsidian_knight_first": "Сначала необходимо победить Обсидианового Рыцаря.", "minicraft.notification.dig_hole": "Сначала выкопайте яму!", "minicraft.notification.dungeon_opened": "Темница теперь открыта!", "minicraft.notification.gem_pickaxe_required": "Нужна самоцветовая кирка.", "minicraft.notification.invalid_placement": "Это можно разместить только на %s!", + "minicraft.notification.obsidian_knight_awoken": "Обсидиановый Рыцарь был пробужден!", + "minicraft.notification.obsidian_knight_defeated": "Обсидиановый Рыцарь: Повержен!", "minicraft.notification.quest_completed": "Задание выполнено", "minicraft.notification.quest_unlocked": "Задание открыто", + "minicraft.notification.spawn_on_boss_tile": "Может быть призван только в Комнате Босса", "minicraft.notification.world_saved": "Мир сохранён!", - "minicraft.notification.wrong_level_sky": "Можно призвать только на небесах", - "minicraft.settings.fps": "Максимальный FPS", - "minicraft.settings.difficulty": "Сложность", - "minicraft.settings.difficulty.easy": "Легкая", - "minicraft.settings.difficulty.normal": "Нормальная", - "minicraft.settings.difficulty.hard": "Тяжелая", - "minicraft.settings.mode": "Режим игры", - "minicraft.settings.mode.survival": "Выживание", - "minicraft.settings.mode.creative": "Творческий", - "minicraft.settings.mode.hardcore": "Хардкор", - "minicraft.settings.mode.score": "Счёт", - "minicraft.settings.scoretime": "Время (Режим счёта)", - "minicraft.settings.screenshot_scale": "Мастштаб скриншота", - "minicraft.settings.sound": "Звук", - "minicraft.settings.autosave": "Автосохранение", - "minicraft.settings.size": "Размер мира", - "minicraft.settings.theme": "Тип мира", - "minicraft.settings.theme.normal": "Обычный", - "minicraft.settings.theme.forest": "Лес", - "minicraft.settings.theme.desert": "Пустыня", - "minicraft.settings.theme.plain": "Плоский", - "minicraft.settings.theme.hell": "Ад", - "minicraft.settings.type": "Тип ландшафта", - "minicraft.settings.type.island": "Остров", - "minicraft.settings.type.box": "Коробка", - "minicraft.settings.type.mountain": "Гора", - "minicraft.settings.type.irregular": "Неравномерный", - "minicraft.skin.paul": "Павел", - "minicraft.skin.paul_cape": "Павел в плаще", - "minicraft.skin.minecraft_steve": "Знакомый парень", - "minicraft.skin.minecraft_alex": "Знакомая девушка", - "minicraft.text_particales.key_consumed": "-1 ключ", - "Death Chest": "Сундук смерти", - "Player": "Игрок", - "Leather Armor": "Кожаные доспехи", - "Snake Armor": "Змеиная броня", - "Iron Armor": "Железная броня", - "Gold Armor": "Золотая броня", - "Gem Armor": "Самоцветовая броня", - "Book": "Книга", - "Antidious": "Антидия (английский)", - "Empty Bucket": "Пустое ведро", - "Water Bucket": "Ведро воды", - "Lava Bucket": "Ведро лавы", - "Red Clothes": "Красная одежда", - "Blue Clothes": "Синяя одежда", - "Green Clothes": "Зеленая одежда", - "Yellow Clothes": "Желтая одежда", - "Black Clothes": "Черная одежда", - "Orange Clothes": "Оранжевая одежда", - "Purple Clothes": "Фиолетовая одежда", - "Cyan Clothes": "Голубая одежда", - "Reg Clothes": "Поношенная одежда", - "Bread": "Хлеб", - "Apple": "Яблоко", - "Raw Pork": "Сырая свинина", - "Raw Fish": "Сырая рыба", - "Raw Beef": "Сырая говядина", - "Pork Chop": "Жареная свинина", - "Cooked Fish": "Копченая рыба", - "Cooked Pork": "Жареная свинина", - "Steak": "Стейк", - "Gold Apple": "Золотое яблоко", - "Baked Potato": "Печёный картофель", - "Cow Spawner": "Призыватель коров", - "Pig Spawner": "Призыватель свиней", - "Sheep Spawner": "Призыватель овец", - "Slime Spawner": "Призыватель слизней", - "Zombie Spawner": "Призыватель зомби", - "Creeper Spawner": "Призыватель криперов", - "Skeleton Spawner": "Призыватель скелетов", - "Snake Spawner": "Призыватель змей", - "Knight Spawner": "Призыватель рыцарей", - "AirWizard Spawner": "Призыватель Небесных колдунов", - "Workbench": "Верстак", - "Oven": "Духовка", - "Furnace": "Печь", - "Anvil": "Наковальня", - "Enchanter": "Алтарь", - "Loom": "Ткацкий станок", - "Lantern": "Фонарь", - "Iron Lantern": "Железный фонарь", - "Gold Lantern": "Золотой фонарь", - "Tnt": "Взрывчатка", - "Bed": "Кровать", - "Chest": "Сундук", - "None Potion": "Пустое зелье", - "Speed Potion": "Зелье скорости", - "Light Potion": "Зелье ночного зрения", - "Swim Potion": "Зелье плавучести", - "Energy Potion": "Зелье энергии", - "Regen Potion": "Зелье регенерации", - "Health Potion": "Зелье здоровья", - "Time Potion": "Зелье времени", - "Lava Potion": "Зелье жаростойкости", - "Shield Potion": "Зелье защиты", - "Haste Potion": "Зелье спешки", - "Escape Potion": "Зелье возврата", - "Potion": "Зелье", - "Power Glove": "Перчатка силы", - "Wood": "Дерево", - "Stone": "Камень", - "Leather": "Кожа", - "Wheat": "Пшеница", - "Key": "Ключ", - "Coal": "Уголь", - "Iron Ore": "Железная руда", - "Gold Ore": "Золотая руда", - "Gem Ore": "Самоцветная руда", - "Cloud Ore": "Облачная руда", - "Iron": "Железный слиток", - "Gold": "Золотой слиток", - "Lapis": "Лазурит", - "Rose": "Роза", - "Gunpowder": "Порох", - "Slime": "Слизь", - "Scale": "Чешуя", - "Shard": "Осколок", - "Flower": "Цветок", - "Acorn": "Жёлудь", - "Dirt": "Земля", - "Natural Rock": "Природный камень", - "Plank": "Доска", - "Plank Wall": "Деревянная стена", - "Wood Door": "Деревянная дверь", - "Stone Brick": "Каменный кирпич", - "Ornate Stone": "Резной камень", - "Stone Wall": "Каменная стена", - "Stone Door": "Каменная дверь", - "Obsidian Brick": "Обсидиановый кирпич", - "Ornate Obsidian": "Резной обсидиан", - "Obsidian Wall": "Обсидиановая стена", - "Obsidian Door": "Обсидиановая дверь", - "Wool": "Шерсть", - "Red Wool": "Красная шерсть", - "Blue Wool": "Синяя шерсть", - "Green Wool": "Зеленая шерсть", - "Yellow Wool": "Желтая шерсть", - "Black Wool": "Черная шерсть", - "Sand": "Песок", - "Cactus": "Кактус", - "Seeds": "Семена", - "Wheat Seeds": "Семена пшеницы", - "Grass Seeds": "Семена травы", - "Bone": "Кость", - "Cloud": "Облако", - "Rock": "Камень", - "Gem": "Самоцвет", - "Potato": "Картофель", - "Wood Fishing Rod": "Деревянная удочка", - "Iron Fishing Rod": "Железная удочка", - "Gold Fishing Rod": "Золотая удочка", - "Gem Fishing Rod": "Самоцветовая удочка", - "Shovel": "Лопата", - "Hoe": "Мотыга", - "Sword": "Меч", - "Pickaxe": "Кирка", - "Axe": "Топор", - "Bow": "Лук", - "Claymore": "Клеймор", - "Shears": "Ножницы", - "Torch": "Факел", - "Wood Planks": "Деревянные доски", - "Stone Bricks": "Каменные кирпичи", - "Obsidian": "Обсидиан", - "Wood Wall": "Деревянная стена", - "Grass": "Трава", - "Hole": "Дыра", - "Stairs Up": "Лестница вверх", - "Stairs Down": "Лестница вниз", - "Water": "Вода", - "Tree": "Дерево", - "Tree Sapling": "Саженец дерева", - "Cactus Sapling": "Саженец кактуса", - "Lava": "Лава", - "Lava Brick": "Лавовый кирпич", - "Explode": "Взорвать", - "Farmland": "Вспаханная земля", - "Hard Rock": "Твёрдая скала", - "Infinite Fall": "Бездна", - "Cloud Cactus": "Облачный кактус", - "Raw Obsidian": "Обсидиан", - "Totem of Air": "Тотем воздуха", - "minicraft.control_guide.attack": "Используйте %s, чтобы атаковать мобов или разрушать блоки.", - "minicraft.control_guide.craft": "Используйте %s, чтобы открыть Меню создания.", - "minicraft.control_guide.menu": "Используйте %s, чтобы открыть Меню инвентаря.", - "minicraft.control_guide.move": "Используйте %s, чтобы двигатся.", - "minicraft.displays.controls": "Управление", - "minicraft.displays.controls.display.controller": "Контроллер", - "minicraft.displays.controls.display.controller.00": "За передвижение игрока отвечает DPAD", - "minicraft.displays.controls.display.controller.01": "За передвижение курсора отвечает DPAD", - "minicraft.displays.controls.display.controller.02": "За выбор элемента отвечает A", - "minicraft.displays.controls.display.controller.03": "За выход со страниц отвечает B", - "minicraft.displays.controls.display.controller.04": "За атаку, разрушение и использование отвечает A", - "minicraft.displays.controls.display.controller.05": "За открытие меню в игре отвечает X", - "minicraft.displays.controls.display.controller.06": "За открытие меню создания отвечает Y", - "minicraft.displays.controls.display.controller.07": "За перетаскивание мебели отвечает LEFTBUMPER", - "minicraft.displays.controls.display.controller.08": "За выбрасывание 1 предмета отвечает RIGHTBUMPER", - "minicraft.displays.controls.display.controller.09": "За выбрасывание стака предметов отвечает RIGHTSTICK", - "minicraft.displays.controls.display.controller.10": "За открытие строки поиска в инвентаре отвечает START", - "minicraft.displays.controls.display.controller.11": "За паузу во время игры отвечает START", - "minicraft.displays.controls.display.controller.12": "Используйте X, чтобы активировать экранную клавиатуру", - "minicraft.displays.controls.display.controller.13": "Используйте B как Backspace на экранной клавиатуре", - "minicraft.displays.controls.display.controller.14": "Используйте X, чтобы убрать выбранный предмет в инвентаре Творческого режима", - "minicraft.displays.controls.display.controller.15": "Используйте Y, чтобы удалить стак предметов в инвентаре Творческого режима", - "minicraft.displays.controls.display.controller.desc.0": "Клавиши отладки недоступны", - "minicraft.displays.controls.display.controller.desc.1": "Детализированные назначения неиспользуемы", - "minicraft.displays.controls.display.help.0": "%s/%s чтобы увидеть другие клавиши управления.", - "minicraft.displays.controls.display.keyboard": "Клавиатура", - "minicraft.displays.controls.display.keyboard.00": "За передвижение игрока отвечает MOVE-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.01": "За передвижение курсора отвечает CURSOR-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.02": "За выбор ячеек отвечает SELECT", - "minicraft.displays.controls.display.keyboard.03": "За выход со страниц отвечает EXIT", - "minicraft.displays.controls.display.keyboard.04": "За быстрое сохранение отвечает QUICKSAVE", - "minicraft.displays.controls.display.keyboard.05": "За атаку, разрушение и использование отвечает ATTACK", - "minicraft.displays.controls.display.keyboard.06": "За открытие внутриигровых меню отвечает MENU", - "minicraft.displays.controls.display.keyboard.07": "За открытие меню создания отвечает CRAFT", - "minicraft.displays.controls.display.keyboard.08": "За перетаскивание мебели отвечает PICKUP", - "minicraft.displays.controls.display.keyboard.09": "За выбрасывание 1 предмета отвечает DROP-ONE", - "minicraft.displays.controls.display.keyboard.10": "За выбрасывание стака предметов отвечает DROP-STACK", - "minicraft.displays.controls.display.keyboard.11": "За переключение строки поиска в меню предметов отвечает SEARCHER_BAR", - "minicraft.displays.controls.display.keyboard.12": "За навигацию по результатам поиска отвечает PAGE-UP/DOWN", - "minicraft.displays.controls.display.keyboard.13": "За паузу отвечает PAUSE", - "minicraft.displays.controls.display.keyboard.14": "За переключение экрана эффектов зелий отвечает POTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.15": "За переключение упрощенного экрана зелий отвечает SIMPPOTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.16": "За временное разворачивание экрана заданий во время игры отвечает EXPANDQUESTDISPLAY", - "minicraft.displays.controls.display.keyboard.17": "За переключение интерфейса отвечает TOGGLEHUD", - "minicraft.displays.controls.display.keyboard.18": "За создание скриншота отвечает SCREENSHOT", - "minicraft.displays.controls.display.keyboard.19": "За отображение внутриигровой информации отвечает INFO", - "minicraft.displays.controls.display.keyboard.20": "За переключение полноэкранного режима отвечает FULLSCREEN", - "minicraft.displays.controls.display.keyboard.21": "Используйте D, чтобы удалить выбранный предмет в инвентаре творческого режима", - "minicraft.displays.controls.display.keyboard.22": "Используйте SHIFT-D чтобы удалить стак предметов в инвентаре в творческого режима", - "minicraft.displays.controls.display.keyboard.desc": "Отладочные клавиши не описаны", - "minicraft.displays.loading.message.dungeon_regeneration": "Восстановление B4", - "minicraft.displays.loading.message.quests": "Задания", - "minicraft.displays.loading.regeneration_popup.display.0": "Обнаружено подземелье старой версии (этаж B4).", - "minicraft.displays.loading.regeneration_popup.display.1": "Необходима регенерация.", - "minicraft.displays.loading.regeneration_popup.display.2": "Старые данные на этом этаже будут стёрты:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s чтобы продолжить", - "minicraft.displays.loading.regeneration_popup.display.4": "%s чтобы отменить загрузку мира", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "Загрузка мира отменена", - "minicraft.displays.quests.display.no_quest": "Нет открытых заданий", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Доступен только ввод с клавиатуры.", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Нажмите %s, чтобы узнать подробности текущего туторила.", - "minicraft.notification.obsidian_knight_defeated": "Обсидиановый Рыцарь: Повержен!", - "minicraft.notification.obsidian_knight_awoken": "Обсидиановый Рыцарь был пробужден!", - "minicraft.notification.defeat_obsidian_knight_first": "Сначала необходимо победить Обсидианового Рыцаря.", "minicraft.notification.wrong_level_dungeon": "Может быть призван только на этаже темницы", - "minicraft.notification.boss_limit": "Нельзя призвать больше боссов", - "minicraft.notification.spawn_on_boss_tile": "Может быть призван только в Комнате Босса", + "minicraft.notification.wrong_level_sky": "Можно призвать только на небесах", "minicraft.notifications.statue_tapped": "Вы слышите раздающийся эхом шёпот...", "minicraft.notifications.statue_touched": "Вы слышите, как статуя вибрирует...", "minicraft.quest.farming": "Фермерство", @@ -450,6 +426,37 @@ "minicraft.quest.potions.description": "Получение зелий.", "minicraft.quest.potions.powerful_potions": "Мощные Зелья", "minicraft.quest.potions.powerful_potions.description": "Получение полезных и мощных зелий.", + "minicraft.settings.autosave": "Автосохранение", + "minicraft.settings.difficulty": "Сложность", + "minicraft.settings.difficulty.easy": "Легкая", + "minicraft.settings.difficulty.hard": "Тяжелая", + "minicraft.settings.difficulty.normal": "Нормальная", + "minicraft.settings.fps": "Максимальный FPS", + "minicraft.settings.mode": "Режим игры", + "minicraft.settings.mode.creative": "Творческий", + "minicraft.settings.mode.hardcore": "Хардкор", + "minicraft.settings.mode.score": "Счёт", + "minicraft.settings.mode.survival": "Выживание", + "minicraft.settings.scoretime": "Время (Режим счёта)", + "minicraft.settings.screenshot_scale": "Мастштаб скриншота", + "minicraft.settings.size": "Размер мира", + "minicraft.settings.sound": "Звук", + "minicraft.settings.theme": "Тип мира", + "minicraft.settings.theme.desert": "Пустыня", + "minicraft.settings.theme.forest": "Лес", + "minicraft.settings.theme.hell": "Ад", + "minicraft.settings.theme.normal": "Обычный", + "minicraft.settings.theme.plain": "Плоский", + "minicraft.settings.type": "Тип ландшафта", + "minicraft.settings.type.box": "Коробка", + "minicraft.settings.type.irregular": "Неравномерный", + "minicraft.settings.type.island": "Остров", + "minicraft.settings.type.mountain": "Гора", + "minicraft.skin.minecraft_alex": "Знакомая девушка", + "minicraft.skin.minecraft_steve": "Знакомый парень", + "minicraft.skin.paul": "Павел", + "minicraft.skin.paul_cape": "Павел в плаще", + "minicraft.text_particales.key_consumed": "-1 ключ", "minicraft.tutorial.getting_rocks": "Получение камня и угля", "minicraft.tutorial.getting_rocks.description": "Получение как минимум 5 камней и 5 углей путём разрушения скал при помощи кирки.", "minicraft.tutorial.getting_wood": "Больше дерева", @@ -459,15 +466,5 @@ "minicraft.tutorial.getting_workbench": "Получение верстака", "minicraft.tutorial.getting_workbench.description": "Создание верстака в меню создание и размещение его.", "minicraft.tutorial.start_getting_wood": "Начало Начал", - "minicraft.tutorial.start_getting_wood.description": "Продолжительно атаковать деревья для получения древесины.", - "minicraft.display.options_display.language": "Язык", - "minicraft.display.options_display.resource_packs": "Наборы ресурсов", - "minicraft.displays.language_settings.title": "Язык...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Стрелка", - "String": "Строка", - "Glass": "Стекло", - "Cloth": "Ткань" + "minicraft.tutorial.start_getting_wood.description": "Продолжительно атаковать деревья для получения древесины." } diff --git a/src/client/resources/assets/localization/tr-tr.json b/src/client/resources/assets/localization/tr-tr.json index b5d09e6b5..6637b7bee 100644 --- a/src/client/resources/assets/localization/tr-tr.json +++ b/src/client/resources/assets/localization/tr-tr.json @@ -1,36 +1,195 @@ { - "minicraft.achievement.woodcutter": "Oduncu", - "minicraft.achievement.woodcutter.desc": "Ahşap alın.", + "Acorn": "Palamut", + "AirWizard Spawner": "HavaBüyücüsü Doğurucu", + "Antidious": "Atidos", + "Anvil": "Örs", + "Apple": "Elma", + "Arrow": "Ok", + "Axe": "Balta", + "Baked Potato": "Fırınlanmış patates", + "Bed": "Yatak", + "Black Clothes": "Siyah Kıyafet", + "Black Wool": "Siyah Yün", + "Blue Clothes": "Mavi Kıyafet", + "Blue Wool": "Mavi Yün", + "Bone": "Kemik", + "Book": "Kitap", + "Bow": "Yay", + "Bread": "Ekmek", + "Cactus": "Kaktüs", + "Cactus Sapling": "Kaktüs Fidanı", + "Chest": "Sandık", + "Claymore": "Güçlü Kılıç", + "Cloth": "Kumaş", + "Cloud": "Bulut", + "Cloud Cactus": "Bulut Kaktüsü", + "Cloud Ore": "Bulut Madeni", + "Coal": "Kömür", + "Cooked Fish": "Pişmiş Balık", + "Cooked Pork": "Pişmiş Domuz Eti", + "Cow Spawner": "İnek Doğurucu", + "Creeper Spawner": "Kripır Doğurucu", + "Cyan Clothes": "Turkuaz Kıyafet", + "Death Chest": "Ölüm Sandığı", + "Dirt": "Toprak", + "Empty Bucket": "Boş Kova", + "Enchanter": "Büyü Masası", + "Energy Potion": "Enerji İksiri", + "Escape Potion": "Kaçış İksiri", + "Explode": "Patlama", + "Farmland": "Çapalanmış Toprak", + "Flower": "Çiçek", + "Furnace": "Fırın", + "Gem": "Kristal", + "Gem Armor": "Kristal Zırh", + "Gem Fishing Rod": "Mücevher Olta", + "Gem Ore": "Çiğ Kristal", + "Glass": "Cam", + "Gold": "Altın", + "Gold Apple": "Altın Elma", + "Gold Armor": "Altın Zırh", + "Gold Fishing Rod": "Altın Olta", + "Gold Lantern": "Altın Lamba", + "Gold Ore": "Çiğ Altın", + "Grass": "Çimen", + "Grass Seeds": "Çimen Tohumu", + "Green Clothes": "Yeşil Kıyafet", + "Green Wool": "Yeşil Yün", + "Gunpowder": "Barut", + "Hard Rock": "Sert Taş", + "Haste Potion": "Acele İksiri", + "Health Potion": "Can İksiri", + "Hoe": "Çapa", + "Hole": "Delik", + "Infinite Fall": "Sonsuz Uçurum", + "Iron": "Demir", + "Iron Armor": "Demir Zırh", + "Iron Fishing Rod": "Demir Olta", + "Iron Lantern": "Demir Lamba", + "Iron Ore": "Çiğ Demir", + "Key": "Anahtar", + "Knight Spawner": "Şovalye Doğurucu", + "Lantern": "Lamba", + "Lapis": "Lapis", + "Lava": "Lav", + "Lava Brick": "Lav Tuğla", + "Lava Bucket": "Lav Kovası", + "Lava Potion": "Lav İksiri", + "Leather": "Deri", + "Leather Armor": "Deri Zırh", + "Light Potion": "Işık İksiri", + "Loom": "Dokuma Tahtası", + "Natural Rock": "Doğal Kaya", + "None Potion": "Boş İksir", + "Obsidian": "Obsidyen", + "Obsidian Brick": "Obsidyen Tuğla", + "Obsidian Door": "Obsidyen Kapı", + "Obsidian Wall": "Obsidyen Duvar", + "Orange Clothes": "Turuncu Kıyafet", + "Ornate Obsidian": "süslü obsidyen", + "Ornate Stone": "süslü taş", + "Oven": "Ocak", + "Pickaxe": "Kazma", + "Pig Spawner": "Domuz Doğurucu", + "Plank": "Tahta", + "Plank Wall": "Tahta Duvar", + "Player": "Karakter", + "Pork Chop": "Domuz Pirzola", + "Potato": "Patates", + "Potion": "Zehir", + "Power Glove": "Güç Eldiveni", + "Purple Clothes": "Mor Kıyafet", + "Raw Beef": "Çiğ İnek Eti", + "Raw Fish": "Çiğ Balık", + "Raw Obsidian": "İşlenmemiş Obsidyen", + "Raw Pork": "Çiğ Domuz Eti", + "Red Clothes": "Kırmızı Kıyafet", + "Red Wool": "Kırmızı Yün", + "Reg Clothes": "Kıyafet", + "Regen Potion": "Yenilenme İksiri", + "Rock": "Taş", + "Rose": "Gül", + "Sand": "Kum", + "Scale": "Pul", + "Seeds": "Tohum", + "Shard": "Kırık Parça", + "Shears": "Makas", + "Sheep Spawner": "Koyun Doğurucu", + "Shield Potion": "Kalkan İksiri", + "Shovel": "Kürek", + "Skeleton Spawner": "İskelet Doğurucu", + "Slime": "Balçık", + "Slime Spawner": "Balçık Doğurucu", + "Snake Armor": "Yılan Zırh", + "Snake Spawner": "Yılan Doğurucu", + "Speed Potion": "Hız İksiri", + "Stairs Down": "Aşağıya Merdiven", + "Stairs Up": "Yukarı Merdiven", + "Steak": "Pişmiş İnek Eti", + "Stone": "Taş", + "Stone Brick": "Taş Tuğla", + "Stone Bricks": "Taş Tuğla", + "Stone Door": "Taş Kapı", + "Stone Wall": "Taş Duvar", + "String": "İp", + "Swim Potion": "Yüzme İksiri", + "Sword": "Kılıç", + "Time Potion": "Zaman İksiri", + "Tnt": "Patlayıcı", + "Torch": "Meşale", + "Totem of Air": "Hava Totemi", + "Tree": "Ağaç", + "Tree Sapling": "Fidan", + "Water": "Su", + "Water Bucket": "Su Kovası", + "Wheat": "Buğday", + "Wheat Seeds": "Buğday tohumları", + "Wood": "Odun", + "Wood Door": "Tahta Kapı", + "Wood Fishing Rod": "Ahşap Olta", + "Wood Planks": "Kalas", + "Wood Wall": "Tahta Duvar", + "Wool": "Yün", + "Workbench": "Çalışma Masası", + "Yellow Clothes": "Sarı Kıyafet", + "Yellow Wool": "Sarı Yün", + "Zombie Spawner": "Hortlak Doğurucu", + "minicraft.achievement.airwizard": "Yenilgi... rüzgar mı?", + "minicraft.achievement.airwizard.desc": "İlk Hava Sihirbazını yen!", "minicraft.achievement.benchmarking": "Çalışmak!", "minicraft.achievement.benchmarking.desc": "Bir tezgah yapın.", - "minicraft.achievement.upgrade": "Güncelleme!", - "minicraft.achievement.upgrade.desc": "Herhangi bir Taş aleti yapın.", "minicraft.achievement.bow": "Bana boyun eğ!", "minicraft.achievement.bow.desc": "Bir yay ile bir ok ateşleyin.", - "minicraft.achievement.fish": "Git Balık!", - "minicraft.achievement.fish.desc": "Bir Balığa Balık Tut!", - "minicraft.achievement.doors": "Kapıda Koruma", - "minicraft.achievement.doors.desc": "Ahşap bir kapı yapın.", - "minicraft.achievement.planks": "Plank'larda Yürüyün!", - "minicraft.achievement.planks.desc": "Ahşap plakalar yapın.", "minicraft.achievement.clothes": "Renkli bir gün geçirin!", "minicraft.achievement.clothes.desc": "Herhangi bir renk giysi yapın", "minicraft.achievement.demolition": "Yıkım Demosu", "minicraft.achievement.demolition.desc": "TNT'yi kullanın.", - "minicraft.achievement.survive_darkness": "Karanlıktan korkmak?", - "minicraft.achievement.survive_darkness.desc": "Toplam karanlıkta 5 dakika hayatta kalın.", - "minicraft.achievement.lava": "Sıcak işler", - "minicraft.achievement.lava.desc": "Lavda yüzmek için bir lav iksiri kullanın.", + "minicraft.achievement.doors": "Kapıda Koruma", + "minicraft.achievement.doors.desc": "Ahşap bir kapı yapın.", "minicraft.achievement.find_gem": "Oooh Parlak!", "minicraft.achievement.find_gem.desc": "Gem Cevherini bulun ve benimseyin.", + "minicraft.achievement.fish": "Git Balık!", + "minicraft.achievement.fish.desc": "Bir Balığa Balık Tut!", + "minicraft.achievement.lava": "Sıcak işler", + "minicraft.achievement.lava.desc": "Lavda yüzmek için bir lav iksiri kullanın.", "minicraft.achievement.lowest_caves": "Işığın ardındaki karanlık", "minicraft.achievement.lowest_caves.desc": "En alçak mağaralara ulaşın.", "minicraft.achievement.obsidian_dungeon": "Şövalyeler ve Erkekler", "minicraft.achievement.obsidian_dungeon.desc": "Obsidyen zindanına ulaşın.", - "minicraft.achievement.airwizard": "Yenilgi... rüzgar mı?", - "minicraft.achievement.airwizard.desc": "İlk Hava Sihirbazını yen!", + "minicraft.achievement.planks": "Plank'larda Yürüyün!", + "minicraft.achievement.planks.desc": "Ahşap plakalar yapın.", "minicraft.achievement.skin": "Moda şovu", "minicraft.achievement.skin.desc": "Cildinizi değiştirin.", + "minicraft.achievement.survive_darkness": "Karanlıktan korkmak?", + "minicraft.achievement.survive_darkness.desc": "Toplam karanlıkta 5 dakika hayatta kalın.", + "minicraft.achievement.upgrade": "Güncelleme!", + "minicraft.achievement.upgrade.desc": "Herhangi bir Taş aleti yapın.", + "minicraft.achievement.woodcutter": "Oduncu", + "minicraft.achievement.woodcutter.desc": "Ahşap alın.", + "minicraft.control_guide.attack": "%s ile moblara saldır veya blok kır.", + "minicraft.control_guide.craft": "%s ile üretim menüsünü aç.", + "minicraft.control_guide.menu": "%s ile envater menünü aç.", + "minicraft.control_guide.move": "%s ile haraket et.", "minicraft.display.entries.boolean.false": "Kapalı", "minicraft.display.entries.boolean.true": "Açık", "minicraft.display.gui.link_opening": "Tarayıcıda açılıyor...", @@ -44,6 +203,7 @@ "minicraft.display.menus.inventory": "Envanter", "minicraft.display.options_display": "Ayarlar", "minicraft.display.options_display.change_key_bindings": "Tuş atamalarını değiştir", + "minicraft.display.options_display.language": "Dil", "minicraft.display.popup.enter_confirm": "enter tuşuna basarak kabul edin", "minicraft.display.popup.escape_cancel": "escape tuşuna basarak iptal edin", "minicraft.display.popup.title_confirm": "Onayla", @@ -53,6 +213,15 @@ "minicraft.displays.achievements.display.not_achieved": "Başarılmadı", "minicraft.displays.achievements.display.score": "Başarım Skoru: %s", "minicraft.displays.book.default_book": "Bu kitapta yazı yok.", + "minicraft.displays.controls": "Kontroller", + "minicraft.displays.controls.display.controller": "Kontrolcü", + "minicraft.displays.controls.display.controller.00": "Oyuncu DPAD ile haraket ettirilir", + "minicraft.displays.controls.display.controller.01": "İmleç DPAD ile haraket ettirilir", + "minicraft.displays.controls.display.controller.03": "Sayfalardan B ile çıkılır", + "minicraft.displays.controls.display.controller.04": "Varlıklara saldırmak, parçalamak ve bloklarla etkileşime geçmek A'yı kullanır", + "minicraft.displays.controls.display.controller.05": "Oyun içi menüleri X ile açılır", + "minicraft.displays.controls.display.controller.06": "Üretim menüsü Y ile açılır", + "minicraft.displays.controls.display.keyboard.05": "Varlıklara saldırmak, parçalamak ve bloklarla etkileşime geçmek SALDIRI'yı kullanır", "minicraft.displays.crafting": "Üretim", "minicraft.displays.crafting.container_title.cost": "Maaliyet:", "minicraft.displays.crafting.container_title.have": "Sahip:", @@ -107,8 +276,8 @@ "minicraft.displays.quests.display.header.unlocked": "Açıldı", "minicraft.displays.quests.display.no_quest_desc": "Görev yok", "minicraft.displays.resource_packs.display.help.move": "%s ve %s ile haraket et.", - "minicraft.displays.resource_packs.display.help.select": "%s ile incele.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[SOL|SAĞ|YUKARI|AŞAĞI] ile paketleri sırala", + "minicraft.displays.resource_packs.display.help.select": "%s ile incele.", "minicraft.displays.resource_packs.display.title": "Kaynak Paketleri", "minicraft.displays.skin": "Skinler", "minicraft.displays.skin.display.help.move": "%s ve %s ile hareket et", @@ -136,8 +305,6 @@ "minicraft.displays.world_gen.enter_world": "Dünya İsmini Gir", "minicraft.displays.world_gen.title": "Dünya Jenerasyon Ayarları", "minicraft.displays.world_gen.troublesome_input": "Dünya isminde sorun mu var?", - "minicraft.displays.world_gen.troublesome_input.msg": "", - "minicraft.displays.world_gen.world_seed": "", "minicraft.displays.world_select.display.help.0": "%s ile onayla", "minicraft.displays.world_select.display.help.1": "%s ile geri dön", "minicraft.displays.world_select.display.help.2": "SHIFT-C ile kopyala", @@ -151,295 +318,31 @@ "minicraft.displays.world_select.popups.display.delete": "%s\"%s\"%s dünyasını silmek istediğine emin misin? Bu geri alınamaz!", "minicraft.displays.world_select.select_world": "Dünya Seç", "minicraft.notification.achievement_unlocked": "Başarının kilidi açıldı:", - "minicraft.notification.air_wizard_defeated": "", + "minicraft.notification.boss_limit": "Daha fazla Boss çağırılamaz", "minicraft.notification.cannot_sleep": "Uyuyamazsın! %s Dakika %s Saniye kaldı!", "minicraft.notification.death_chest_retrieved": "Ölüm sandığı alındı!", - "minicraft.notification.defeat_air_wizard_first": "", "minicraft.notification.dig_hole": "Önce bir delik kazın!", "minicraft.notification.dungeon_opened": "Zindan artık açık!", "minicraft.notification.gem_pickaxe_required": "Mücevher Kazma Gerekli.", "minicraft.notification.invalid_placement": "Sadece üzerine yerleştirilebilir", "minicraft.notification.quest_completed": "Görev tamamlandı", "minicraft.notification.quest_unlocked": "Görev açıldı", + "minicraft.notification.spawn_on_boss_tile": "Sadece Boss odasında çağırılabilir", "minicraft.notification.world_saved": "Dünya Kaydedildi!", "minicraft.notification.wrong_level_sky": "Sadece gökyüzü seviyesinde çağırılabilir", - "minicraft.settings.fps": "Maks FPS", - "minicraft.settings.difficulty": "Zorluk", - "minicraft.settings.difficulty.easy": "Kolay", - "minicraft.settings.difficulty.normal": "Normal", - "minicraft.settings.difficulty.hard": "Zor", - "minicraft.settings.mode": "Oyun Modu", - "minicraft.settings.mode.survival": "Hayatta Kalma", - "minicraft.settings.mode.creative": "Yaratıcı", - "minicraft.settings.mode.hardcore": "Zorlayıcı", - "minicraft.settings.mode.score": "Skor", - "minicraft.settings.scoretime": "Zaman (Skor Modu)", - "minicraft.settings.screenshot_scale": "Ekran Görüntüsü Büyüklüğü", - "minicraft.settings.sound": "Ses", - "minicraft.settings.autosave": "Otomatik Kayıt", - "minicraft.settings.size": "Dün Büyüklüğü", - "minicraft.settings.theme": "Dünya Teması", - "minicraft.settings.theme.normal": "Normal", - "minicraft.settings.theme.forest": "Orman", - "minicraft.settings.theme.desert": "Çöl", - "minicraft.settings.theme.plain": "Düzlük", - "minicraft.settings.theme.hell": "Cehennem", - "minicraft.settings.type": "Arazi Türü", - "minicraft.settings.type.island": "Ada", - "minicraft.settings.type.box": "Kutu", - "minicraft.settings.type.mountain": "Dağ", - "minicraft.settings.type.irregular": "Düzensiz", - "minicraft.skin.paul": "Paul", - "minicraft.skin.paul_cape": "Paul pelerinli", - "minicraft.skin.minecraft_steve": "tanıdık çocuk", - "minicraft.skin.minecraft_alex": "tanıdık kız", - "minicraft.text_particales.key_consumed": "-1 anahtar", - "Death Chest": "Ölüm Sandığı", - "Player": "Karakter", - "Leather Armor": "Deri Zırh", - "Snake Armor": "Yılan Zırh", - "Iron Armor": "Demir Zırh", - "Gold Armor": "Altın Zırh", - "Gem Armor": "Kristal Zırh", - "Book": "Kitap", - "Antidious": "Atidos", - "Empty Bucket": "Boş Kova", - "Water Bucket": "Su Kovası", - "Lava Bucket": "Lav Kovası", - "Red Clothes": "Kırmızı Kıyafet", - "Blue Clothes": "Mavi Kıyafet", - "Green Clothes": "Yeşil Kıyafet", - "Yellow Clothes": "Sarı Kıyafet", - "Black Clothes": "Siyah Kıyafet", - "Orange Clothes": "Turuncu Kıyafet", - "Purple Clothes": "Mor Kıyafet", - "Cyan Clothes": "Turkuaz Kıyafet", - "Reg Clothes": "Kıyafet", - "Bread": "Ekmek", - "Apple": "Elma", - "Raw Pork": "Çiğ Domuz Eti", - "Raw Fish": "Çiğ Balık", - "Raw Beef": "Çiğ İnek Eti", - "Pork Chop": "Domuz Pirzola", - "Cooked Fish": "Pişmiş Balık", - "Cooked Pork": "Pişmiş Domuz Eti", - "Steak": "Pişmiş İnek Eti", - "Gold Apple": "Altın Elma", - "Baked Potato": "Fırınlanmış patates", - "Cow Spawner": "İnek Doğurucu", - "Pig Spawner": "Domuz Doğurucu", - "Sheep Spawner": "Koyun Doğurucu", - "Slime Spawner": "Balçık Doğurucu", - "Zombie Spawner": "Hortlak Doğurucu", - "Creeper Spawner": "Kripır Doğurucu", - "Skeleton Spawner": "İskelet Doğurucu", - "Snake Spawner": "Yılan Doğurucu", - "Knight Spawner": "Şovalye Doğurucu", - "AirWizard Spawner": "HavaBüyücüsü Doğurucu", - "Workbench": "Çalışma Masası", - "Oven": "Ocak", - "Furnace": "Fırın", - "Anvil": "Örs", - "Enchanter": "Büyü Masası", - "Loom": "Dokuma Tahtası", - "Lantern": "Lamba", - "Iron Lantern": "Demir Lamba", - "Gold Lantern": "Altın Lamba", - "Tnt": "Patlayıcı", - "Bed": "Yatak", - "Chest": "Sandık", - "None Potion": "Boş İksir", - "Speed Potion": "Hız İksiri", - "Light Potion": "Işık İksiri", - "Swim Potion": "Yüzme İksiri", - "Energy Potion": "Enerji İksiri", - "Regen Potion": "Yenilenme İksiri", - "Health Potion": "Can İksiri", - "Time Potion": "Zaman İksiri", - "Lava Potion": "Lav İksiri", - "Shield Potion": "Kalkan İksiri", - "Haste Potion": "Acele İksiri", - "Escape Potion": "Kaçış İksiri", - "Potion": "Zehir", - "Power Glove": "Güç Eldiveni", - "Wood": "Odun", - "Stone": "Taş", - "Leather": "Deri", - "Wheat": "Buğday", - "Key": "Anahtar", - "Coal": "Kömür", - "Iron Ore": "Çiğ Demir", - "Gold Ore": "Çiğ Altın", - "Gem Ore": "Çiğ Kristal", - "Cloud Ore": "Bulut Madeni", - "Iron": "Demir", - "Gold": "Altın", - "Lapis": "Lapis", - "Rose": "Gül", - "Gunpowder": "Barut", - "Slime": "Balçık", - "Scale": "Pul", - "Shard": "Kırık Parça", - "Flower": "Çiçek", - "Acorn": "Palamut", - "Dirt": "Toprak", - "Natural Rock": "Doğal Kaya", - "Plank": "Tahta", - "Plank Wall": "Tahta Duvar", - "Wood Door": "Tahta Kapı", - "Stone Brick": "Taş Tuğla", - "Ornate Stone": "süslü taş", - "Stone Wall": "Taş Duvar", - "Stone Door": "Taş Kapı", - "Obsidian Brick": "Obsidyen Tuğla", - "Ornate Obsidian": "süslü obsidyen", - "Obsidian Wall": "Obsidyen Duvar", - "Obsidian Door": "Obsidyen Kapı", - "Wool": "Yün", - "Red Wool": "Kırmızı Yün", - "Blue Wool": "Mavi Yün", - "Green Wool": "Yeşil Yün", - "Yellow Wool": "Sarı Yün", - "Black Wool": "Siyah Yün", - "Sand": "Kum", - "Cactus": "Kaktüs", - "Seeds": "Tohum", - "Wheat Seeds": "Buğday tohumları", - "Grass Seeds": "Çimen Tohumu", - "Bone": "Kemik", - "Cloud": "Bulut", - "Rock": "Taş", - "Gem": "Kristal", - "Potato": "Patates", - "Wood Fishing Rod": "Ahşap Olta", - "Iron Fishing Rod": "Demir Olta", - "Gold Fishing Rod": "Altın Olta", - "Gem Fishing Rod": "Mücevher Olta", - "Shovel": "Kürek", - "Hoe": "Çapa", - "Sword": "Kılıç", - "Pickaxe": "Kazma", - "Axe": "Balta", - "Bow": "Yay", - "Claymore": "Güçlü Kılıç", - "Shears": "Makas", - "Torch": "Meşale", - "Wood Planks": "Kalas", - "Stone Bricks": "Taş Tuğla", - "Obsidian": "Obsidyen", - "Wood Wall": "Tahta Duvar", - "Grass": "Çimen", - "Hole": "Delik", - "Stairs Up": "Yukarı Merdiven", - "Stairs Down": "Aşağıya Merdiven", - "Water": "Su", - "Tree": "Ağaç", - "Tree Sapling": "Fidan", - "Cactus Sapling": "Kaktüs Fidanı", - "Lava": "Lav", - "Lava Brick": "Lav Tuğla", - "Explode": "Patlama", - "Farmland": "Çapalanmış Toprak", - "Hard Rock": "Sert Taş", - "Infinite Fall": "Sonsuz Uçurum", - "Cloud Cactus": "Bulut Kaktüsü", - "Raw Obsidian": "İşlenmemiş Obsidyen", - "Totem of Air": "Hava Totemi", - "minicraft.control_guide.attack": "%s ile moblara saldır veya blok kır.", - "minicraft.control_guide.craft": "%s ile üretim menüsünü aç.", - "minicraft.control_guide.menu": "%s ile envater menünü aç.", - "minicraft.control_guide.move": "%s ile haraket et.", - "minicraft.displays.controls": "Kontroller", - "minicraft.displays.controls.display.controller": "Kontrolcü", - "minicraft.displays.controls.display.controller.00": "Oyuncu DPAD ile haraket ettirilir", - "minicraft.displays.controls.display.controller.01": "İmleç DPAD ile haraket ettirilir", - "minicraft.displays.controls.display.controller.02": "", - "minicraft.displays.controls.display.controller.03": "Sayfalardan B ile çıkılır", - "minicraft.displays.controls.display.controller.04": "Varlıklara saldırmak, parçalamak ve bloklarla etkileşime geçmek A'yı kullanır", - "minicraft.displays.controls.display.controller.05": "Oyun içi menüleri X ile açılır", - "minicraft.displays.controls.display.controller.06": "Üretim menüsü Y ile açılır", - "minicraft.displays.controls.display.controller.07": "", - "minicraft.displays.controls.display.controller.08": "", - "minicraft.displays.controls.display.controller.09": "", - "minicraft.displays.controls.display.controller.10": "", - "minicraft.displays.controls.display.controller.11": "", - "minicraft.displays.controls.display.controller.12": "", - "minicraft.displays.controls.display.controller.13": "", - "minicraft.displays.controls.display.controller.14": "", - "minicraft.displays.controls.display.controller.15": "", - "minicraft.displays.controls.display.controller.desc.0": "", - "minicraft.displays.controls.display.controller.desc.1": "", - "minicraft.displays.controls.display.help.0": "", - "minicraft.displays.controls.display.keyboard": "", - "minicraft.displays.controls.display.keyboard.00": "", - "minicraft.displays.controls.display.keyboard.01": "", - "minicraft.displays.controls.display.keyboard.02": "", - "minicraft.displays.controls.display.keyboard.03": "", - "minicraft.displays.controls.display.keyboard.04": "", - "minicraft.displays.controls.display.keyboard.05": "Varlıklara saldırmak, parçalamak ve bloklarla etkileşime geçmek SALDIRI'yı kullanır", - "minicraft.displays.controls.display.keyboard.06": "", - "minicraft.displays.controls.display.keyboard.07": "", - "minicraft.displays.controls.display.keyboard.08": "", - "minicraft.displays.controls.display.keyboard.09": "", - "minicraft.displays.controls.display.keyboard.10": "", - "minicraft.displays.controls.display.keyboard.11": "", - "minicraft.displays.controls.display.keyboard.12": "", - "minicraft.displays.controls.display.keyboard.13": "", - "minicraft.displays.controls.display.keyboard.14": "", - "minicraft.displays.controls.display.keyboard.15": "", - "minicraft.displays.controls.display.keyboard.16": "", - "minicraft.displays.controls.display.keyboard.17": "", - "minicraft.displays.controls.display.keyboard.18": "", - "minicraft.displays.controls.display.keyboard.19": "", - "minicraft.displays.controls.display.keyboard.20": "", - "minicraft.displays.controls.display.keyboard.21": "", - "minicraft.displays.controls.display.keyboard.22": "", - "minicraft.displays.controls.display.keyboard.desc": "", - "minicraft.displays.loading.message.dungeon_regeneration": "", - "minicraft.displays.loading.message.quests": "", - "minicraft.displays.loading.regeneration_popup.display.0": "", - "minicraft.displays.loading.regeneration_popup.display.1": "", - "minicraft.displays.loading.regeneration_popup.display.2": "", - "minicraft.displays.loading.regeneration_popup.display.3": "", - "minicraft.displays.loading.regeneration_popup.display.4": "", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "", - "minicraft.displays.quests.display.no_quest": "", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "", - "minicraft.notification.obsidian_knight_defeated": "", - "minicraft.notification.obsidian_knight_awoken": "", - "minicraft.notification.defeat_obsidian_knight_first": "", - "minicraft.notification.wrong_level_dungeon": "", - "minicraft.notification.boss_limit": "Daha fazla Boss çağırılamaz", - "minicraft.notification.spawn_on_boss_tile": "Sadece Boss odasında çağırılabilir", - "minicraft.notifications.statue_tapped": "", - "minicraft.notifications.statue_touched": "", - "minicraft.quest.farming": "", "minicraft.quest.farming.crafting_hoe": "Çapa üretmek", "minicraft.quest.farming.crafting_hoe.description": "Tezgahtan herhangi bir çapa üret", "minicraft.quest.farming.description": "Çiftçi olmanın", "minicraft.quest.farming.getting_wheat": "Buğday Hasadı", - "minicraft.quest.farming.getting_wheat.description": "", "minicraft.quest.farming.making_farmland": "Tarım arazisi yapmak", "minicraft.quest.farming.making_farmland.description": "Toprak bloğunu çapa ile işleyerek tarım arazisi yap", "minicraft.quest.farming.planting_potato": "Patates ekmek", - "minicraft.quest.farming.planting_potato.description": "", "minicraft.quest.farming.planting_wheat": "Buğday ekmek", - "minicraft.quest.farming.planting_wheat.description": "", "minicraft.quest.gems": "Mücevher Yolu", - "minicraft.quest.gems.description": "", "minicraft.quest.gems.gem_armor": "Korunmanın Ustası", - "minicraft.quest.gems.gem_armor.description": "", - "minicraft.quest.gems.gem_claymore": "", - "minicraft.quest.gems.gem_claymore.description": "", "minicraft.quest.iron_equipments": "Demirin Ustası", - "minicraft.quest.iron_equipments.description": "", "minicraft.quest.iron_equipments.getting_more_iron": "Demirden Zengin", - "minicraft.quest.iron_equipments.getting_more_iron.description": "", - "minicraft.quest.iron_equipments.iron_armor": "", - "minicraft.quest.iron_equipments.iron_armor.description": "", "minicraft.quest.iron_equipments.iron_tools": "Bütün aletlerini geliştir", - "minicraft.quest.iron_equipments.iron_tools.description": "", "minicraft.quest.iron_equipments.upgrading_pickaxe": "Gelişmiş kazma", "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Kazmanı geliştir.", "minicraft.quest.potions": "İksirlerin Ustası", @@ -447,27 +350,40 @@ "minicraft.quest.potions.all_potions_prepared.description": "Bütün iksirlerini aynı anda elde et.", "minicraft.quest.potions.awkward_potions": "Garip İksir", "minicraft.quest.potions.awkward_potions.description": "Garip iksir elde et.", - "minicraft.quest.potions.description": "", - "minicraft.quest.potions.powerful_potions": "", - "minicraft.quest.potions.powerful_potions.description": "", - "minicraft.tutorial.getting_rocks": "", - "minicraft.tutorial.getting_rocks.description": "", + "minicraft.settings.autosave": "Otomatik Kayıt", + "minicraft.settings.difficulty": "Zorluk", + "minicraft.settings.difficulty.easy": "Kolay", + "minicraft.settings.difficulty.hard": "Zor", + "minicraft.settings.difficulty.normal": "Normal", + "minicraft.settings.fps": "Maks FPS", + "minicraft.settings.mode": "Oyun Modu", + "minicraft.settings.mode.creative": "Yaratıcı", + "minicraft.settings.mode.hardcore": "Zorlayıcı", + "minicraft.settings.mode.score": "Skor", + "minicraft.settings.mode.survival": "Hayatta Kalma", + "minicraft.settings.scoretime": "Zaman (Skor Modu)", + "minicraft.settings.screenshot_scale": "Ekran Görüntüsü Büyüklüğü", + "minicraft.settings.size": "Dün Büyüklüğü", + "minicraft.settings.sound": "Ses", + "minicraft.settings.theme": "Dünya Teması", + "minicraft.settings.theme.desert": "Çöl", + "minicraft.settings.theme.forest": "Orman", + "minicraft.settings.theme.hell": "Cehennem", + "minicraft.settings.theme.normal": "Normal", + "minicraft.settings.theme.plain": "Düzlük", + "minicraft.settings.type": "Arazi Türü", + "minicraft.settings.type.box": "Kutu", + "minicraft.settings.type.irregular": "Düzensiz", + "minicraft.settings.type.island": "Ada", + "minicraft.settings.type.mountain": "Dağ", + "minicraft.skin.minecraft_alex": "tanıdık kız", + "minicraft.skin.minecraft_steve": "tanıdık çocuk", + "minicraft.skin.paul": "Paul", + "minicraft.skin.paul_cape": "Paul pelerinli", + "minicraft.text_particales.key_consumed": "-1 anahtar", "minicraft.tutorial.getting_wood": "Daha fazla odun", - "minicraft.tutorial.getting_wood.description": "", "minicraft.tutorial.getting_wooden_pickaxe": "Tahta kazma elde etmek", - "minicraft.tutorial.getting_wooden_pickaxe.description": "", "minicraft.tutorial.getting_workbench": "Tezgah masası almak", - "minicraft.tutorial.getting_workbench.description": "", "minicraft.tutorial.start_getting_wood": "Her şeyin başlangıcı", - "minicraft.tutorial.start_getting_wood.description": "Ağaçlara aralıksız saldırarak odun alırsın", - "minicraft.display.options_display.language": "Dil", - "minicraft.display.options_display.resource_packs": "", - "minicraft.displays.language_settings.title": "", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "Ok", - "String": "İp", - "Glass": "Cam", - "Cloth": "Kumaş" + "minicraft.tutorial.start_getting_wood.description": "Ağaçlara aralıksız saldırarak odun alırsın" } diff --git a/src/client/resources/assets/localization/uk-ua.json b/src/client/resources/assets/localization/uk-ua.json index c2a78343a..6b1502b62 100644 --- a/src/client/resources/assets/localization/uk-ua.json +++ b/src/client/resources/assets/localization/uk-ua.json @@ -1,36 +1,192 @@ { - "minicraft.achievement.woodcutter": "Лісоруб", - "minicraft.achievement.woodcutter.desc": "Добути деревину.", + "Acorn": "Жолудь", + "AirWizard Spawner": "Викликач повітряного чарівника", + "Antidious": "Античний", + "Anvil": "Ковадло", + "Apple": "Яблуко", + "Axe": "Сокира", + "Baked Potato": "Приготована картопля", + "Bed": "Ліжко", + "Black Clothes": "Чорний одяг", + "Black Wool": "Чорна шерсть", + "Blue Clothes": "Синій одяг", + "Blue Wool": "Синя шерсть", + "Bone": "Кістка", + "Book": "Книга", + "Bow": "Лук", + "Bread": "Хліб", + "Cactus": "Кактус", + "Cactus Sapling": "Саджанець кактуса", + "Chest": "Скриня", + "Claymore": "Великий меч", + "Cloud": "Хмара", + "Cloud Cactus": "Повітряний кактус", + "Cloud Ore": "Повітряна руда", + "Coal": "Вугілля", + "Cooked Fish": "Приготована риба", + "Cooked Pork": "Приготована яловичина", + "Cow Spawner": "Викликач корови", + "Creeper Spawner": "Викликач кріперів", + "Cyan Clothes": "Блакитний одяг", + "Death Chest": "Скриня мертв'яка", + "Dirt": "Земля", + "Empty Bucket": "Пусте відро", + "Enchanter": "Чарувальний стіл", + "Energy Potion": "Зілля енергії", + "Escape Potion": "Зілля втечі", + "Explode": "Взірвати", + "Farmland": "Угіддя", + "Flower": "Квітка", + "Furnace": "Піч", + "Gem": "Кристал", + "Gem Armor": "Кристалічна броня", + "Gem Fishing Rod": "Кристалічна вудка", + "Gem Ore": "Кристалічна руда", + "Gold": "Золото", + "Gold Apple": "Золоте яблука", + "Gold Armor": "Золота броня", + "Gold Fishing Rod": "Золота вудка", + "Gold Lantern": "Золотий ліхтар", + "Gold Ore": "Золота руда", + "Grass": "Трава", + "Grass Seeds": "Зерно трави", + "Green Clothes": "Зелений одяг", + "Green Wool": "Зелена шерсть", + "GunPowder": "Порох", + "Gunpowder": "Порох", + "Hard Rock": "Міцний камінь", + "Haste Potion": "Зілля поспіху", + "Health Potion": "Зілля здоров'я", + "Hoe": "Мотика", + "Hole": "Яма", + "Infinite Fall": "Нескінчене падіння", + "Iron": "Залізо", + "Iron Armor": "Залізна броня", + "Iron Fishing Rod": "Залізна вудка", + "Iron Lantern": "Залізний ліхтар", + "Iron Ore": "Залізна руда", + "Key": "Ключ", + "Knight Spawner": "Викликач лицарів", + "Lantern": "Ліхтар", + "Lapis": "Ляпіс", + "Lava": "Лава", + "Lava Brick": "Лавова цегла", + "Lava Bucket": "Відро з лавою", + "Lava Potion": "Зілля лави", + "Leather": "Шкіра", + "Leather Armor": "Шкіряна броня", + "Light Potion": "Зілля світла", + "Loom": "Ткацький станок", + "Natural Rock": "Натуральний камінь", + "None Potion": "Пусте зілля", + "Obsidian": "Обсідіан", + "Obsidian Brick": "Обсидіанова цегля", + "Obsidian Door": "Обсідіанові двері", + "Obsidian Wall": "Обсідіанова стіна", + "Orange Clothes": "Помаранчевий одяг", + "Ornate Obsidian": "Оздоблений обсидіан", + "Ornate Stone": "Оздоблений камінь", + "Oven": "Духова шафа", + "Pickaxe": "Кирка", + "Pig Spawner": "Викликач свині", + "Plank": "Доска", + "Plank Wall": "Стіна з досок", + "Player": "Гравець", + "Pork Chop": "Свиняча відбивна", + "Potato": "Картопля", + "Potion": "Зілля", + "Power Glove": "Рукавиця сили", + "Purple Clothes": "Фіолетовий одяг", + "Raw Beef": "Сира яловичина", + "Raw Fish": "Сира риба", + "Raw Obsidian": "Сирий обсидіан", + "Raw Pork": "Сира свинина", + "Red Clothes": "Червоний одяг", + "Red Wool": "Червона шерсть", + "Reg Clothes": "Стара одежа", + "Regen Potion": "Зілля відновлення", + "Rock": "Камінь", + "Rose": "Роза", + "Sand": "Пісок", + "Scale": "Зміїна луска", + "Seeds": "Зерно", + "Shard": "Осколок", + "Shears": "Ножиці", + "Sheep Spawner": "Викликач овець", + "Shield Potion": "Зілля захисту", + "Shovel": "Лопата", + "Skeleton Spawner": "Викликач скелетів", + "Slime": "Слайм", + "Slime Spawner": "Викликач слаймів", + "Snake Armor": "Броня зі зміїної шкури", + "Snake Spawner": "Викликач змій", + "Speed Potion": "Зілля швидкості", + "Stairs Down": "Сходи вних", + "Stairs Up": "Сходи вгору", + "Steak": "Стейк", + "Stone": "Каміння", + "Stone Brick": "Кам'яна цегла", + "Stone Bricks": "Кам'яна цегла", + "Stone Door": "Кам'яні двері", + "Stone Wall": "Кам'яна стіна", + "Swim Potion": "Зілля плавання", + "Sword": "Меч", + "Time Potion": "Зілля часу", + "Tnt": "Динаміт", + "Torch": "Смолоскип", + "Totem of Air": "Тотем повітря", + "Tree": "Дерево", + "Tree Sapling": "Саджанець дерева", + "Water": "Вода", + "Water Bucket": "Відро з водою", + "Wheat": "Пшениця", + "Wheat Seeds": "Зерно пшениці", + "Wood": "Деревина", + "Wood Door": "Дерев'яні двері", + "Wood Fishing Rod": "Дерев'яна вудка", + "Wood Planks": "Доски", + "Wood Wall": "Дерев'яна стіна", + "Wool": "Шерсть", + "Workbench": "Верстат", + "Yellow Clothes": "Жовтий одяг", + "Yellow Wool": "Жовта шерсть", + "Zombie Spawner": "Викликач зомбі", + "minicraft.achievement.airwizard": "Перемогти... повітря?", + "minicraft.achievement.airwizard.desc": "Перемогти першого Повітряного Чарівника!", "minicraft.achievement.benchmarking": "Зверстати верстат", "minicraft.achievement.benchmarking.desc": "Змайструйте верстат з дерева.", - "minicraft.achievement.upgrade": "Оновлення!", - "minicraft.achievement.upgrade.desc": "Змайструйте будь-який кам'яний інструмент.", "minicraft.achievement.bow": "Лук — всьому голова!", "minicraft.achievement.bow.desc": "Вистреліть з лука.", - "minicraft.achievement.fish": "Порибальмо!", - "minicraft.achievement.fish.desc": "Впіймайте рибу!", - "minicraft.achievement.doors": "Дверний захист", - "minicraft.achievement.doors.desc": "Змайструйте дерев'яні двері.", - "minicraft.achievement.planks": "Пройдися по дошці!", - "minicraft.achievement.planks.desc": "Змайструйте дошки.", "minicraft.achievement.clothes": "Який же кольоровий день!", "minicraft.achievement.clothes.desc": "Зшийте одяг будь-якого кольору", "minicraft.achievement.demolition": "Деконструкція", "minicraft.achievement.demolition.desc": "Використайте динаміт.", - "minicraft.achievement.survive_darkness": "Боїтеся темряви?", - "minicraft.achievement.survive_darkness.desc": "Виживіть 5 хвилин в непроглядній тьмі.", - "minicraft.achievement.lava": "Гаряча ванна", - "minicraft.achievement.lava.desc": "Використайте зілля лави, щоб поплавати у лаві.", + "minicraft.achievement.doors": "Дверний захист", + "minicraft.achievement.doors.desc": "Змайструйте дерев'яні двері.", "minicraft.achievement.find_gem": "Ох, блищить!", "minicraft.achievement.find_gem.desc": "Знайдіть та видобудьте кристалічну руду.", + "minicraft.achievement.fish": "Порибальмо!", + "minicraft.achievement.fish.desc": "Впіймайте рибу!", + "minicraft.achievement.lava": "Гаряча ванна", + "minicraft.achievement.lava.desc": "Використайте зілля лави, щоб поплавати у лаві.", "minicraft.achievement.lowest_caves": "Темрява за світлом", "minicraft.achievement.lowest_caves.desc": "Досягніть найглибших печер.", "minicraft.achievement.obsidian_dungeon": "Серед лицарів і людей", "minicraft.achievement.obsidian_dungeon.desc": "Досягнути обсидіанового підземелля.", - "minicraft.achievement.airwizard": "Перемогти... повітря?", - "minicraft.achievement.airwizard.desc": "Перемогти першого Повітряного Чарівника!", + "minicraft.achievement.planks": "Пройдися по дошці!", + "minicraft.achievement.planks.desc": "Змайструйте дошки.", "minicraft.achievement.skin": "Показ моди", "minicraft.achievement.skin.desc": "Змініть свій скін.", + "minicraft.achievement.survive_darkness": "Боїтеся темряви?", + "minicraft.achievement.survive_darkness.desc": "Виживіть 5 хвилин в непроглядній тьмі.", + "minicraft.achievement.upgrade": "Оновлення!", + "minicraft.achievement.upgrade.desc": "Змайструйте будь-який кам'яний інструмент.", + "minicraft.achievement.woodcutter": "Лісоруб", + "minicraft.achievement.woodcutter.desc": "Добути деревину.", + "minicraft.control_guide.attack": "Використовуйте %s щоб атакувати істот чи знищувати стіни й скелі.", + "minicraft.control_guide.craft": "Використовуйте %s, щоб відкрити меню крафту.", + "minicraft.control_guide.menu": "Використовуйте %s, щоб відкрити інвентар.", + "minicraft.control_guide.move": "Використовуйте %s для руху.", "minicraft.display.entries.boolean.false": "Вимк", "minicraft.display.entries.boolean.true": "Увімк", "minicraft.display.gui.link_opening": "Відкриваємо в браузері...", @@ -44,6 +200,8 @@ "minicraft.display.menus.inventory": "Інвертар", "minicraft.display.options_display": "Налаштування", "minicraft.display.options_display.change_key_bindings": "Змінити прив'язки клавіш", + "minicraft.display.options_display.language": "Мова", + "minicraft.display.options_display.resource_packs": "Пакунки ресурсів", "minicraft.display.popup.enter_confirm": "enter для підтвердження", "minicraft.display.popup.escape_cancel": "escape, щоб скасувати", "minicraft.display.popup.title_confirm": "Підтвердити дію", @@ -53,6 +211,52 @@ "minicraft.displays.achievements.display.not_achieved": "Не досягнено", "minicraft.displays.achievements.display.score": "Рахунок досягнень: %s", "minicraft.displays.book.default_book": "У цій книзі немає тексту.", + "minicraft.displays.controls": "Керування", + "minicraft.displays.controls.display.controller": "Контролер", + "minicraft.displays.controls.display.controller.00": "Для переміщення гравця використовуйте DPAD", + "minicraft.displays.controls.display.controller.01": "Для переміщення вказівника використовуйте DPAD", + "minicraft.displays.controls.display.controller.02": "Обирайте елементи меню з A", + "minicraft.displays.controls.display.controller.03": "Для виходу зі сторінок використовуйте B", + "minicraft.displays.controls.display.controller.04": "Атакуйте сутності, руйнуйте та взаємодійте з об'єктами використовуючи A", + "minicraft.displays.controls.display.controller.05": "Щоб відкривати ігрові меню використовуйте X", + "minicraft.displays.controls.display.controller.06": "Відкривайте меню крафту з Y", + "minicraft.displays.controls.display.controller.07": "Для підняття меблів використовуйте LEFTBUMPER", + "minicraft.displays.controls.display.controller.08": "Щоб кинути один предмет, використовуйте RIGHTBUMPER", + "minicraft.displays.controls.display.controller.09": "Щоб кинути повний стак предмету, використовуйте RIGHTSTICK", + "minicraft.displays.controls.display.controller.10": "Перемикайте строку пошуку в меню предметів з START", + "minicraft.displays.controls.display.controller.11": "START для призупинки гри", + "minicraft.displays.controls.display.controller.12": "Використовуйте X для перемикання екранної клавіатури при вводі", + "minicraft.displays.controls.display.controller.13": "Використовуйте B як комбінацію клавіш для повернення на екранну клавіатуру", + "minicraft.displays.controls.display.controller.14": "Натисніть X щоб видалити обраний предмет з інвентарю творчого режиму", + "minicraft.displays.controls.display.controller.15": "Натисніть Y щоб видалити стак предметів з інвентарю творчого режиму", + "minicraft.displays.controls.display.controller.desc.0": "Налагоджувальні прив'язки недоступні", + "minicraft.displays.controls.display.controller.desc.1": "Детальні прив'язки дуже важко використовувати", + "minicraft.displays.controls.display.help.0": "%s/%s щоб побачити інші елементи керування.", + "minicraft.displays.controls.display.keyboard": "Клавіатура", + "minicraft.displays.controls.display.keyboard.00": "Рухайте гравця з MOVE-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.01": "Для переміщення вказівника використовуйте CURSOR-(DIRECTION)", + "minicraft.displays.controls.display.keyboard.02": "Обирайте елементи меню з SELECT", + "minicraft.displays.controls.display.keyboard.03": "Виходьте зі сторінок з EXIT", + "minicraft.displays.controls.display.keyboard.04": "Швидке збереження використовує QUICKSAVE", + "minicraft.displays.controls.display.keyboard.05": "Атакуйте істот, знищуйте та взаємодійте з предметами за допомогою ATTACK", + "minicraft.displays.controls.display.keyboard.06": "Відкривайте ігрові меню з MENU", + "minicraft.displays.controls.display.keyboard.07": "Відкривайте меню крафту з CRAFT", + "minicraft.displays.controls.display.keyboard.08": "Для підняття меблів використовуйте PICKUP", + "minicraft.displays.controls.display.keyboard.09": "Щоб кинути один предмет, використовуйте DROP-ONE", + "minicraft.displays.controls.display.keyboard.10": "Щоб кинути цілий стак предмету, використовуйте DROP-STACK", + "minicraft.displays.controls.display.keyboard.11": "Перемикайте пошукову строку з SEARCHER-BAR", + "minicraft.displays.controls.display.keyboard.12": "Проглядайте результати пошуку використовуючи PAGE-UP/DOWN", + "minicraft.displays.controls.display.keyboard.13": "Для призупинки гри використовуйте PAUSE", + "minicraft.displays.controls.display.keyboard.14": "Перемикайте показ зілля з POTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.15": "Перемикайте спрощений показ зілля з SIMPPOTIONEFFECTS", + "minicraft.displays.controls.display.keyboard.16": "Поступове розширення відображення квестів у грі використовує EXPANDQUESTDISPLAY", + "minicraft.displays.controls.display.keyboard.17": "Перемикайте HUD з TOGGLEHUD", + "minicraft.displays.controls.display.keyboard.18": "Використовуйте SCREENSHOT, щоб зняти знімок екрана", + "minicraft.displays.controls.display.keyboard.19": "Показ ігрової інформації використовує INFO", + "minicraft.displays.controls.display.keyboard.20": "Перемикайте повноекранного режиму з FULLSCREEN", + "minicraft.displays.controls.display.keyboard.21": "Натисніть D щоб видалити обраний предмет з інвентарю творчого режиму", + "minicraft.displays.controls.display.keyboard.22": "Використайте SHIFT-D, щоб видалити цілий стак предмету в інвентарі в творчому режимі", + "minicraft.displays.controls.display.keyboard.desc": "Налагоджувальні прив'язки не мають пояснень", "minicraft.displays.crafting": "Майстрування", "minicraft.displays.crafting.container_title.cost": "Ціна:", "minicraft.displays.crafting.container_title.have": "Маю:", @@ -72,13 +276,22 @@ "minicraft.displays.key_input.popup_display.confirm_reset": "Ви впевнені, що хочете стерти усі прив'язки клавіш?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Натисніть бажану послідовність клавіш", "minicraft.displays.key_input.title": "Керування", + "minicraft.displays.language_settings.title": "Мова...", + "minicraft.displays.loading.message.dungeon_regeneration": "Перестворюємо B4", "minicraft.displays.loading.message.entities": "Істоти", "minicraft.displays.loading.message.generating": "Генеруємо", "minicraft.displays.loading.message.level": "Рівень %s", "minicraft.displays.loading.message.levels": "Рівні", "minicraft.displays.loading.message.loading": "Завантаження", + "minicraft.displays.loading.message.quests": "Завдання", "minicraft.displays.loading.message.saving": "Збереження", "minicraft.displays.loading.message.world": "Світ", + "minicraft.displays.loading.regeneration_cancellation_popup.display": "Завантаження світу скасовано", + "minicraft.displays.loading.regeneration_popup.display.0": "Стара версія підземелля (рівень B4) помічена.", + "minicraft.displays.loading.regeneration_popup.display.1": "Необхідне перестворення.", + "minicraft.displays.loading.regeneration_popup.display.2": "Старі дані на цьому рівні будуть стерті:", + "minicraft.displays.loading.regeneration_popup.display.3": "%s, щоб продовжити", + "minicraft.displays.loading.regeneration_popup.display.4": "%s, щоб скасувати завантаження світу", "minicraft.displays.options_main_menu": "Опції головного меню", "minicraft.displays.options_main_menu.resource_packs": "Пакунки ресурсів", "minicraft.displays.options_world": "Налаштування світу", @@ -105,10 +318,12 @@ "minicraft.displays.quests": "Завдання", "minicraft.displays.quests.display.header.completed": "Виконані", "minicraft.displays.quests.display.header.unlocked": "Розблоковані", + "minicraft.displays.quests.display.no_quest": "Немає розблокованих завдань", "minicraft.displays.quests.display.no_quest_desc": "Немає завдань", + "minicraft.displays.resource_packs.display.help.keyboard_needed": "Тільки ввід з клавіатури приймається.", "minicraft.displays.resource_packs.display.help.move": "Використовуйте %s і %s для переміщення.", - "minicraft.displays.resource_packs.display.help.select": "%s, щоб дослідити.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] щоб переміщати пакунки. ", + "minicraft.displays.resource_packs.display.help.select": "%s, щоб дослідити.", "minicraft.displays.resource_packs.display.title": "Пакунки ресурсів", "minicraft.displays.skin": "Скіни", "minicraft.displays.skin.display.help.move": "Використовуйте %s та %s для переміщення.", @@ -132,6 +347,7 @@ "minicraft.displays.title.play.new_world": "Новий світ", "minicraft.displays.title.quit": "Вийти", "minicraft.displays.title.select_to_download": "--Оберіть тут для завантаження--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Натисніть %s, щоб переглянути подробиці щодо підказки.", "minicraft.displays.world_gen.create_world": "Створити світ", "minicraft.displays.world_gen.enter_world": "Введіть ім'я для світу", "minicraft.displays.world_gen.title": "Налаштування генерації світу", @@ -152,266 +368,23 @@ "minicraft.displays.world_select.select_world": "Оберіть світ", "minicraft.notification.achievement_unlocked": "Досягнення розблоковано: %s", "minicraft.notification.air_wizard_defeated": "Повітряного чарівника подолано!", + "minicraft.notification.boss_limit": "Не можна викликати більше босів", "minicraft.notification.cannot_sleep": "Не можу спати! Залишилося %s хвилин і %s секунд!", "minicraft.notification.death_chest_retrieved": "Скриню мертв'яка забрано!", "minicraft.notification.defeat_air_wizard_first": "Спочатку треба перемогти повітряного чарівника.", + "minicraft.notification.defeat_obsidian_knight_first": "Спочатку треба перемогти обсидіанового лицаря.", "minicraft.notification.dig_hole": "Спочатку викопайте яму!", "minicraft.notification.dungeon_opened": "Підземелля відчинено!", "minicraft.notification.gem_pickaxe_required": "Необхідна кристалічна кирка.", "minicraft.notification.invalid_placement": "Можна поставити тільки на %s!", + "minicraft.notification.obsidian_knight_awoken": "Обсидіановий лицар повстав!", + "minicraft.notification.obsidian_knight_defeated": "Обсидіановий лицар: Знищений!", "minicraft.notification.quest_completed": "Завдання виконано", "minicraft.notification.quest_unlocked": "Завдання розблоковано", + "minicraft.notification.spawn_on_boss_tile": "Можна викликати тільки в кімнаті боса", "minicraft.notification.world_saved": "Світ збережено!", + "minicraft.notification.wrong_level_dungeon": "Можна викликати тільки в підземеллі", "minicraft.notification.wrong_level_sky": "Можна викликати тільки на повітряному рівні", - "minicraft.settings.fps": "Максимальний FPS", - "minicraft.settings.difficulty": "Складність", - "minicraft.settings.difficulty.easy": "Легко", - "minicraft.settings.difficulty.normal": "Звичайно", - "minicraft.settings.difficulty.hard": "Важко", - "minicraft.settings.mode": "Режим гри", - "minicraft.settings.mode.survival": "Виживання", - "minicraft.settings.mode.creative": "Творчість", - "minicraft.settings.mode.hardcore": "Хардкор", - "minicraft.settings.mode.score": "Рахунок", - "minicraft.settings.scoretime": "Час (Режим рахунку)", - "minicraft.settings.screenshot_scale": "Розмір знімка екрана", - "minicraft.settings.sound": "Звук", - "minicraft.settings.autosave": "Автоматичне збереження", - "minicraft.settings.size": "Розмір світу", - "minicraft.settings.theme": "Тема світу", - "minicraft.settings.theme.normal": "Звичайна", - "minicraft.settings.theme.forest": "Ліс", - "minicraft.settings.theme.desert": "Пустеля", - "minicraft.settings.theme.plain": "Рівнина", - "minicraft.settings.theme.hell": "Ад", - "minicraft.settings.type": "Тип світу", - "minicraft.settings.type.island": "Острів", - "minicraft.settings.type.box": "Коробка", - "minicraft.settings.type.mountain": "Скеля", - "minicraft.settings.type.irregular": "Незвичайний", - "minicraft.skin.paul": "Павел", - "minicraft.skin.paul_cape": "Павел з накидкою", - "minicraft.skin.minecraft_steve": "Знайомий хлопчик", - "minicraft.skin.minecraft_alex": "Знайома дівчинка", - "minicraft.text_particales.key_consumed": "Ключ використано", - "Death Chest": "Скриня мертв'яка", - "Player": "Гравець", - "Leather Armor": "Шкіряна броня", - "Snake Armor": "Броня зі зміїної шкури", - "Iron Armor": "Залізна броня", - "Gold Armor": "Золота броня", - "Gem Armor": "Кристалічна броня", - "Book": "Книга", - "Antidious": "Античний", - "Empty Bucket": "Пусте відро", - "Water Bucket": "Відро з водою", - "Lava Bucket": "Відро з лавою", - "Red Clothes": "Червоний одяг", - "Blue Clothes": "Синій одяг", - "Green Clothes": "Зелений одяг", - "Yellow Clothes": "Жовтий одяг", - "Black Clothes": "Чорний одяг", - "Orange Clothes": "Помаранчевий одяг", - "Purple Clothes": "Фіолетовий одяг", - "Cyan Clothes": "Блакитний одяг", - "Reg Clothes": "Стара одежа", - "Bread": "Хліб", - "Apple": "Яблуко", - "Raw Pork": "Сира свинина", - "Raw Fish": "Сира риба", - "Raw Beef": "Сира яловичина", - "Pork Chop": "Свиняча відбивна", - "Cooked Fish": "Приготована риба", - "Cooked Pork": "Приготована яловичина", - "Steak": "Стейк", - "Gold Apple": "Золоте яблука", - "Baked Potato": "Приготована картопля", - "Cow Spawner": "Викликач корови", - "Pig Spawner": "Викликач свині", - "Sheep Spawner": "Викликач овець", - "Slime Spawner": "Викликач слаймів", - "Zombie Spawner": "Викликач зомбі", - "Creeper Spawner": "Викликач кріперів", - "Skeleton Spawner": "Викликач скелетів", - "Snake Spawner": "Викликач змій", - "Knight Spawner": "Викликач лицарів", - "AirWizard Spawner": "Викликач повітряного чарівника", - "Workbench": "Верстат", - "Oven": "Духова шафа", - "Furnace": "Піч", - "Anvil": "Ковадло", - "Enchanter": "Чарувальний стіл", - "Loom": "Ткацький станок", - "Lantern": "Ліхтар", - "Iron Lantern": "Залізний ліхтар", - "Gold Lantern": "Золотий ліхтар", - "Tnt": "Динаміт", - "Bed": "Ліжко", - "Chest": "Скриня", - "None Potion": "Пусте зілля", - "Speed Potion": "Зілля швидкості", - "Light Potion": "Зілля світла", - "Swim Potion": "Зілля плавання", - "Energy Potion": "Зілля енергії", - "Regen Potion": "Зілля відновлення", - "Health Potion": "Зілля здоров'я", - "Time Potion": "Зілля часу", - "Lava Potion": "Зілля лави", - "Shield Potion": "Зілля захисту", - "Haste Potion": "Зілля поспіху", - "Escape Potion": "Зілля втечі", - "Potion": "Зілля", - "Power Glove": "Рукавиця сили", - "Wood": "Деревина", - "Stone": "Каміння", - "Leather": "Шкіра", - "Wheat": "Пшениця", - "Key": "Ключ", - "Coal": "Вугілля", - "Iron Ore": "Залізна руда", - "Gold Ore": "Золота руда", - "Gem Ore": "Кристалічна руда", - "Cloud Ore": "Повітряна руда", - "Iron": "Залізо", - "Gold": "Золото", - "Lapis": "Ляпіс", - "Rose": "Роза", - "GunPowder": "Порох", - "Slime": "Слайм", - "Scale": "Зміїна луска", - "Shard": "Осколок", - "Flower": "Квітка", - "Acorn": "Жолудь", - "Dirt": "Земля", - "Natural Rock": "Натуральний камінь", - "Plank": "Доска", - "Plank Wall": "Стіна з досок", - "Wood Door": "Дерев'яні двері", - "Stone Brick": "Кам'яна цегла", - "Ornate Stone": "Оздоблений камінь", - "Stone Wall": "Кам'яна стіна", - "Stone Door": "Кам'яні двері", - "Obsidian Brick": "Обсидіанова цегля", - "Ornate Obsidian": "Оздоблений обсидіан", - "Obsidian Wall": "Обсідіанова стіна", - "Obsidian Door": "Обсідіанові двері", - "Wool": "Шерсть", - "Red Wool": "Червона шерсть", - "Blue Wool": "Синя шерсть", - "Green Wool": "Зелена шерсть", - "Yellow Wool": "Жовта шерсть", - "Black Wool": "Чорна шерсть", - "Sand": "Пісок", - "Cactus": "Кактус", - "Seeds": "Зерно", - "Wheat Seeds": "Зерно пшениці", - "Grass Seeds": "Зерно трави", - "Bone": "Кістка", - "Cloud": "Хмара", - "Rock": "Камінь", - "Gem": "Кристал", - "Potato": "Картопля", - "Wood Fishing Rod": "Дерев'яна вудка", - "Iron Fishing Rod": "Залізна вудка", - "Gold Fishing Rod": "Золота вудка", - "Gem Fishing Rod": "Кристалічна вудка", - "Shovel": "Лопата", - "Hoe": "Мотика", - "Sword": "Меч", - "Pickaxe": "Кирка", - "Axe": "Сокира", - "Bow": "Лук", - "Claymore": "Великий меч", - "Shears": "Ножиці", - "Torch": "Смолоскип", - "Wood Planks": "Доски", - "Stone Bricks": "Кам'яна цегла", - "Obsidian": "Обсідіан", - "Wood Wall": "Дерев'яна стіна", - "Grass": "Трава", - "Hole": "Яма", - "Stairs Up": "Сходи вгору", - "Stairs Down": "Сходи вних", - "Water": "Вода", - "Tree": "Дерево", - "Tree Sapling": "Саджанець дерева", - "Cactus Sapling": "Саджанець кактуса", - "Lava": "Лава", - "Lava Brick": "Лавова цегла", - "Explode": "Взірвати", - "Farmland": "Угіддя", - "Hard Rock": "Міцний камінь", - "Infinite Fall": "Нескінчене падіння", - "Cloud Cactus": "Повітряний кактус", - "Raw Obsidian": "Сирий обсидіан", - "Totem of Air": "Тотем повітря", - "minicraft.control_guide.attack": "Використовуйте %s щоб атакувати істот чи знищувати стіни й скелі.", - "minicraft.control_guide.craft": "Використовуйте %s, щоб відкрити меню крафту.", - "minicraft.control_guide.menu": "Використовуйте %s, щоб відкрити інвентар.", - "minicraft.control_guide.move": "Використовуйте %s для руху.", - "minicraft.displays.controls": "Керування", - "minicraft.displays.controls.display.controller": "Контролер", - "minicraft.displays.controls.display.controller.00": "Для переміщення гравця використовуйте DPAD", - "minicraft.displays.controls.display.controller.01": "Для переміщення вказівника використовуйте DPAD", - "minicraft.displays.controls.display.controller.02": "Обирайте елементи меню з A", - "minicraft.displays.controls.display.controller.03": "Для виходу зі сторінок використовуйте B", - "minicraft.displays.controls.display.controller.04": "Атакуйте сутності, руйнуйте та взаємодійте з об'єктами використовуючи A", - "minicraft.displays.controls.display.controller.05": "Щоб відкривати ігрові меню використовуйте X", - "minicraft.displays.controls.display.controller.06": "Відкривайте меню крафту з Y", - "minicraft.displays.controls.display.controller.07": "Для підняття меблів використовуйте LEFTBUMPER", - "minicraft.displays.controls.display.controller.08": "Щоб кинути один предмет, використовуйте RIGHTBUMPER", - "minicraft.displays.controls.display.controller.09": "Щоб кинути повний стак предмету, використовуйте RIGHTSTICK", - "minicraft.displays.controls.display.controller.10": "Перемикайте строку пошуку в меню предметів з START", - "minicraft.displays.controls.display.controller.11": "START для призупинки гри", - "minicraft.displays.controls.display.controller.12": "Використовуйте X для перемикання екранної клавіатури при вводі", - "minicraft.displays.controls.display.controller.13": "Використовуйте B як комбінацію клавіш для повернення на екранну клавіатуру", - "minicraft.displays.controls.display.controller.14": "Натисніть X щоб видалити обраний предмет з інвентарю творчого режиму", - "minicraft.displays.controls.display.controller.15": "Натисніть Y щоб видалити стак предметів з інвентарю творчого режиму", - "minicraft.displays.controls.display.controller.desc.0": "Налагоджувальні прив'язки недоступні", - "minicraft.displays.controls.display.controller.desc.1": "Детальні прив'язки дуже важко використовувати", - "minicraft.displays.controls.display.help.0": "%s/%s щоб побачити інші елементи керування.", - "minicraft.displays.controls.display.keyboard": "Клавіатура", - "minicraft.displays.controls.display.keyboard.00": "Рухайте гравця з MOVE-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.01": "Для переміщення вказівника використовуйте CURSOR-(DIRECTION)", - "minicraft.displays.controls.display.keyboard.02": "Обирайте елементи меню з SELECT", - "minicraft.displays.controls.display.keyboard.03": "Виходьте зі сторінок з EXIT", - "minicraft.displays.controls.display.keyboard.04": "Швидке збереження використовує QUICKSAVE", - "minicraft.displays.controls.display.keyboard.05": "Атакуйте істот, знищуйте та взаємодійте з предметами за допомогою ATTACK", - "minicraft.displays.controls.display.keyboard.06": "Відкривайте ігрові меню з MENU", - "minicraft.displays.controls.display.keyboard.07": "Відкривайте меню крафту з CRAFT", - "minicraft.displays.controls.display.keyboard.08": "Для підняття меблів використовуйте PICKUP", - "minicraft.displays.controls.display.keyboard.09": "Щоб кинути один предмет, використовуйте DROP-ONE", - "minicraft.displays.controls.display.keyboard.10": "Щоб кинути цілий стак предмету, використовуйте DROP-STACK", - "minicraft.displays.controls.display.keyboard.11": "Перемикайте пошукову строку з SEARCHER-BAR", - "minicraft.displays.controls.display.keyboard.12": "Проглядайте результати пошуку використовуючи PAGE-UP/DOWN", - "minicraft.displays.controls.display.keyboard.13": "Для призупинки гри використовуйте PAUSE", - "minicraft.displays.controls.display.keyboard.14": "Перемикайте показ зілля з POTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.15": "Перемикайте спрощений показ зілля з SIMPPOTIONEFFECTS", - "minicraft.displays.controls.display.keyboard.16": "Поступове розширення відображення квестів у грі використовує EXPANDQUESTDISPLAY", - "minicraft.displays.controls.display.keyboard.17": "Перемикайте HUD з TOGGLEHUD", - "minicraft.displays.controls.display.keyboard.18": "Використовуйте SCREENSHOT, щоб зняти знімок екрана", - "minicraft.displays.controls.display.keyboard.19": "Показ ігрової інформації використовує INFO", - "minicraft.displays.controls.display.keyboard.20": "Перемикайте повноекранного режиму з FULLSCREEN", - "minicraft.displays.controls.display.keyboard.21": "Натисніть D щоб видалити обраний предмет з інвентарю творчого режиму", - "minicraft.displays.controls.display.keyboard.22": "Використайте SHIFT-D, щоб видалити цілий стак предмету в інвентарі в творчому режимі", - "minicraft.displays.controls.display.keyboard.desc": "Налагоджувальні прив'язки не мають пояснень", - "minicraft.displays.loading.message.dungeon_regeneration": "Перестворюємо B4", - "minicraft.displays.loading.message.quests": "Завдання", - "minicraft.displays.loading.regeneration_popup.display.0": "Стара версія підземелля (рівень B4) помічена.", - "minicraft.displays.loading.regeneration_popup.display.1": "Необхідне перестворення.", - "minicraft.displays.loading.regeneration_popup.display.2": "Старі дані на цьому рівні будуть стерті:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s, щоб продовжити", - "minicraft.displays.loading.regeneration_popup.display.4": "%s, щоб скасувати завантаження світу", - "minicraft.displays.loading.regeneration_cancellation_popup.display": "Завантаження світу скасовано", - "minicraft.displays.quests.display.no_quest": "Немає розблокованих завдань", - "minicraft.displays.resource_packs.display.help.keyboard_needed": "Тільки ввід з клавіатури приймається.", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Натисніть %s, щоб переглянути подробиці щодо підказки.", - "minicraft.notification.obsidian_knight_defeated": "Обсидіановий лицар: Знищений!", - "minicraft.notification.obsidian_knight_awoken": "Обсидіановий лицар повстав!", - "minicraft.notification.defeat_obsidian_knight_first": "Спочатку треба перемогти обсидіанового лицаря.", - "minicraft.notification.wrong_level_dungeon": "Можна викликати тільки в підземеллі", - "minicraft.notification.boss_limit": "Не можна викликати більше босів", - "minicraft.notification.spawn_on_boss_tile": "Можна викликати тільки в кімнаті боса", "minicraft.notifications.statue_tapped": "Ви чуєте відлуння шепіту...", "minicraft.notifications.statue_touched": "Ви відчуваєте, що статуя вібрує...", "minicraft.quest.farming": "Фермер", @@ -450,6 +423,37 @@ "minicraft.quest.potions.description": "Діставати зілля.", "minicraft.quest.potions.powerful_potions": "Могутні зілля", "minicraft.quest.potions.powerful_potions.description": "Дістаньте корисні та могутні зілля.", + "minicraft.settings.autosave": "Автоматичне збереження", + "minicraft.settings.difficulty": "Складність", + "minicraft.settings.difficulty.easy": "Легко", + "minicraft.settings.difficulty.hard": "Важко", + "minicraft.settings.difficulty.normal": "Звичайно", + "minicraft.settings.fps": "Максимальний FPS", + "minicraft.settings.mode": "Режим гри", + "minicraft.settings.mode.creative": "Творчість", + "minicraft.settings.mode.hardcore": "Хардкор", + "minicraft.settings.mode.score": "Рахунок", + "minicraft.settings.mode.survival": "Виживання", + "minicraft.settings.scoretime": "Час (Режим рахунку)", + "minicraft.settings.screenshot_scale": "Розмір знімка екрана", + "minicraft.settings.size": "Розмір світу", + "minicraft.settings.sound": "Звук", + "minicraft.settings.theme": "Тема світу", + "minicraft.settings.theme.desert": "Пустеля", + "minicraft.settings.theme.forest": "Ліс", + "minicraft.settings.theme.hell": "Ад", + "minicraft.settings.theme.normal": "Звичайна", + "minicraft.settings.theme.plain": "Рівнина", + "minicraft.settings.type": "Тип світу", + "minicraft.settings.type.box": "Коробка", + "minicraft.settings.type.irregular": "Незвичайний", + "minicraft.settings.type.island": "Острів", + "minicraft.settings.type.mountain": "Скеля", + "minicraft.skin.minecraft_alex": "Знайома дівчинка", + "minicraft.skin.minecraft_steve": "Знайомий хлопчик", + "minicraft.skin.paul": "Павел", + "minicraft.skin.paul_cape": "Павел з накидкою", + "minicraft.text_particales.key_consumed": "Ключ використано", "minicraft.tutorial.getting_rocks": "Видобути каміння та вугілля", "minicraft.tutorial.getting_rocks.description": "Дістаньте хоча б 5 камінців і 5 штук вугілля з каміння раніше створеною киркою.", "minicraft.tutorial.getting_wood": "Видобути більше деревини", @@ -459,15 +463,5 @@ "minicraft.tutorial.getting_workbench": "Дістати верстат", "minicraft.tutorial.getting_workbench.description": "Створіть верстат в меню крафту. Та поставте на землю.", "minicraft.tutorial.start_getting_wood": "Початок всього", - "minicraft.tutorial.start_getting_wood.description": "Атакуйте дерева, щоб отримати деревину.", - "minicraft.display.options_display.language": "Мова", - "minicraft.display.options_display.resource_packs": "Пакунки ресурсів", - "minicraft.displays.language_settings.title": "Мова...", - "minicraft.achievement.plant_seed": "", - "minicraft.achievement.plant_seed.desc": "", - "minicraft.notification.knight_statue_exists": "", - "Arrow": "", - "String": "", - "Glass": "", - "Cloth": "" + "minicraft.tutorial.start_getting_wood.description": "Атакуйте дерева, щоб отримати деревину." } From e24dd758dfa8731681bf14b7cad215b96d984485 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 1 May 2024 14:18:07 +0800 Subject: [PATCH 248/261] Turn most * and / 16 to bit shifts --- src/client/java/minicraft/core/Renderer.java | 8 ++-- src/client/java/minicraft/entity/Arrow.java | 6 +-- .../entity/furniture/DungeonChest.java | 2 +- .../minicraft/entity/furniture/Spawner.java | 2 +- src/client/java/minicraft/entity/mob/Mob.java | 2 +- .../java/minicraft/entity/mob/Player.java | 4 +- .../java/minicraft/item/FurnitureItem.java | 4 +- src/client/java/minicraft/level/Level.java | 42 +++++++++---------- .../java/minicraft/level/tile/CactusTile.java | 6 +-- .../java/minicraft/level/tile/CloudTile.java | 2 +- .../java/minicraft/level/tile/DecorTile.java | 2 +- .../java/minicraft/level/tile/DirtTile.java | 2 +- .../java/minicraft/level/tile/DoorTile.java | 2 +- .../java/minicraft/level/tile/FloorTile.java | 2 +- .../java/minicraft/level/tile/FlowerTile.java | 10 ++--- .../java/minicraft/level/tile/GrassTile.java | 4 +- .../minicraft/level/tile/HardRockTile.java | 8 ++-- .../minicraft/level/tile/MaterialTile.java | 2 +- .../java/minicraft/level/tile/OreTile.java | 6 +-- .../java/minicraft/level/tile/PathTile.java | 2 +- .../java/minicraft/level/tile/RockTile.java | 8 ++-- .../java/minicraft/level/tile/SandTile.java | 2 +- .../java/minicraft/level/tile/TorchTile.java | 2 +- .../java/minicraft/level/tile/TreeTile.java | 16 +++---- .../java/minicraft/level/tile/WallTile.java | 6 +-- .../java/minicraft/level/tile/WoolTile.java | 2 +- .../level/tile/farming/PotatoTile.java | 2 +- .../level/tile/farming/WheatTile.java | 2 +- .../java/minicraft/screen/BookDisplay.java | 2 +- 29 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/client/java/minicraft/core/Renderer.java b/src/client/java/minicraft/core/Renderer.java index aa88698ab..8d92bab9d 100644 --- a/src/client/java/minicraft/core/Renderer.java +++ b/src/client/java/minicraft/core/Renderer.java @@ -196,8 +196,8 @@ private static void renderLevel() { // Stop scrolling if the screen is at the ... if (xScroll < 0) xScroll = 0; // ...Left border. if (yScroll < 0) yScroll = 0; // ...Top border. - if (xScroll > level.w * 16 - Screen.w) xScroll = level.w * 16 - Screen.w; // ...Right border. - if (yScroll > level.h * 16 - Screen.h) yScroll = level.h * 16 - Screen.h; // ...Bottom border. + if (xScroll > (level.w << 4) - Screen.w) xScroll = (level.w << 4) - Screen.w; // ...Right border. + if (yScroll > (level.h << 4) - Screen.h) yScroll = (level.h << 4) - Screen.h; // ...Bottom border. if (currentLevel > 3) { // If the current level is higher than 3 (which only the sky level (and dungeon) is) MinicraftImage cloud = spriteLinker.getSheet(SpriteType.Tile, "cloud_background"); for (int y = 0; y < 28; y++) @@ -504,8 +504,8 @@ private static void renderDebugInfo() { info.add((Updater.normSpeed * Updater.gamespeed) + " tps"); info.add("walk spd: " + player.moveSpeed); - info.add("X: " + (player.x / 16) + "-" + (player.x % 16)); - info.add("Y: " + (player.y / 16) + "-" + (player.y % 16)); + info.add("X: " + (player.x >> 4) + "-" + (player.x % 16)); + info.add("Y: " + (player.y >> 4) + "-" + (player.y % 16)); if (levels[currentLevel] != null) info.add("Tile: " + levels[currentLevel].getTile(player.x >> 4, player.y >> 4).name); if (isMode("minicraft.settings.mode.score")) info.add("Score: " + player.getScore()); diff --git a/src/client/java/minicraft/entity/Arrow.java b/src/client/java/minicraft/entity/Arrow.java index cd7695905..8b565c286 100644 --- a/src/client/java/minicraft/entity/Arrow.java +++ b/src/client/java/minicraft/entity/Arrow.java @@ -75,9 +75,9 @@ public void tick() { mob.hurt(owner, damage, dir); //normal hurting to other mobs } - if (!level.getTile(x / 16, y / 16).mayPass(level, x / 16, y / 16, this) - && !level.getTile(x / 16, y / 16).connectsToFluid(level, x / 16, y / 16) - && level.getTile(x / 16, y / 16).id != 16) { + if (!level.getTile(x >> 4, y >> 4).mayPass(level, x >> 4, y >> 4, this) + && !level.getTile(x >> 4, y >> 4).connectsToFluid(level, x >> 4, y >> 4) + && level.getTile(x >> 4, y >> 4).id != 16) { this.remove(); try { sprite.destroy(); diff --git a/src/client/java/minicraft/entity/furniture/DungeonChest.java b/src/client/java/minicraft/entity/furniture/DungeonChest.java index f158c37a4..faf63c717 100644 --- a/src/client/java/minicraft/entity/furniture/DungeonChest.java +++ b/src/client/java/minicraft/entity/furniture/DungeonChest.java @@ -62,7 +62,7 @@ public boolean use(Player player) { isLocked = false; this.sprite = openSprite; // Set to the unlocked color - level.add(new SmashParticle(x * 16, y * 16)); + level.add(new SmashParticle(x << 4, y << 4)); level.add(new TextParticle(Localization.getLocalized("minicraft.text_particales.key_consumed"), x, y, Color.RED)); level.chestCount--; diff --git a/src/client/java/minicraft/entity/furniture/Spawner.java b/src/client/java/minicraft/entity/furniture/Spawner.java index b8ff39b03..3a9f74479 100644 --- a/src/client/java/minicraft/entity/furniture/Spawner.java +++ b/src/client/java/minicraft/entity/furniture/Spawner.java @@ -38,7 +38,7 @@ public class Spawner extends Furniture { private final Random rnd = new Random(); - private static final int ACTIVE_RADIUS = 8 * 16; + private static final int ACTIVE_RADIUS = 8 << 4; private static final int minSpawnInterval = 200, maxSpawnInterval = 500; private static final int minMobSpawnChance = 10; // 1 in minMobSpawnChance chance of calling trySpawn every interval. diff --git a/src/client/java/minicraft/entity/mob/Mob.java b/src/client/java/minicraft/entity/mob/Mob.java index 468749c2b..bd2cd181e 100644 --- a/src/client/java/minicraft/entity/mob/Mob.java +++ b/src/client/java/minicraft/entity/mob/Mob.java @@ -58,7 +58,7 @@ public void tick() { if (canBurn()) { if (this.burningDuration > 0) { - if (level.getTile(x / 16, y / 16) == Tiles.get("water")) this.burningDuration = 0; + if (level.getTile(x >> 4, y >> 4) == Tiles.get("water")) this.burningDuration = 0; if (this.burningDuration % 10 == 0) level.add(new BurnParticle(x - 8 + (random.nextInt(8) - 4), y - 8 + (random.nextInt(8) - 4))); this.burningDuration--; diff --git a/src/client/java/minicraft/entity/mob/Player.java b/src/client/java/minicraft/entity/mob/Player.java index fecd9eb88..0198aa4e6 100644 --- a/src/client/java/minicraft/entity/mob/Player.java +++ b/src/client/java/minicraft/entity/mob/Player.java @@ -876,7 +876,7 @@ public void render(Screen screen) { // Renders swimming if (isSwimming() && onFallDelay <= 0) { yo += 4; // y offset is moved up by 4 - if (level.getTile(x / 16, y / 16) == Tiles.get("water")) { + if (level.getTile(x >> 4, y >> 4) == Tiles.get("water")) { // animation effect if (tickTime / 8 % 2 == 0) { @@ -887,7 +887,7 @@ public void render(Screen screen) { screen.render(xo + 8, yo + 3, 5, 1, 1, hudSheet.getSheet()); } - } else if (level.getTile(x / 16, y / 16) == Tiles.get("lava")) { + } else if (level.getTile(x >> 4, y >> 4) == Tiles.get("lava")) { if (tickTime / 8 % 2 == 0) { screen.render(xo + 0, yo + 3, 6, 0, 1, hudSheet.getSheet()); // Render the lava graphic diff --git a/src/client/java/minicraft/item/FurnitureItem.java b/src/client/java/minicraft/item/FurnitureItem.java index 4e1a79ebd..780edc594 100644 --- a/src/client/java/minicraft/item/FurnitureItem.java +++ b/src/client/java/minicraft/item/FurnitureItem.java @@ -87,8 +87,8 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player, Sound.play("craft"); // Placed furniture's X and Y positions - furniture.x = xt * 16 + 8; - furniture.y = yt * 16 + 8; + furniture.x = (xt << 4) + 8; + furniture.y = (yt << 4) + 8; level.add(furniture); // Adds the furniture to the world if (Game.isMode("minicraft.settings.mode.creative")) diff --git a/src/client/java/minicraft/level/Level.java b/src/client/java/minicraft/level/Level.java index 0fc8e8966..3009b1888 100644 --- a/src/client/java/minicraft/level/Level.java +++ b/src/client/java/minicraft/level/Level.java @@ -343,8 +343,8 @@ private void checkChestCount(boolean check) { } } if (d.x == 0 && d.y == 0) { - d.x = x2 * 16 - 8; - d.y = y2 * 16 - 8; + d.x = (x2 << 4) - 8; + d.y = (y2 << 4) - 8; } add(d); @@ -541,7 +541,7 @@ public void renderLight(Screen screen, int xScroll, int yScroll, int brightness) if (x < 0 || y < 0 || x >= this.w || y >= this.h) continue; int lr = getTile(x, y).getLightRadius(this, x, y); - if (lr > 0) screen.renderLight(x * 16 + 8, y * 16 + 8, lr * brightness); + if (lr > 0) screen.renderLight((x << 4) + 8, (y << 4) + 8, lr * brightness); } } screen.setOffset(0, 0); @@ -610,8 +610,8 @@ public void add(Entity entity, int x, int y) { public void add(Entity entity, int x, int y, boolean tileCoords) { if (entity == null) return; if (tileCoords) { - x = x * 16 + 8; - y = y * 16 + 8; + x = (x << 4) + 8; + y = (y << 4) + 8; } entity.setLevel(this, x, y); @@ -983,8 +983,8 @@ private void generateSpawnerStructures() { if (xaxis2) { for (int s2 = x3; s2 < w - s2; s2++) { if (getTile(s2, y3) == Tiles.get("rock")) { - sp.x = s2 * 16 - 24; - sp.y = y3 * 16 - 24; + sp.x = (s2 << 4) - 24; + sp.y = (y3 << 4) - 24; } } } else { @@ -1001,23 +1001,23 @@ private void generateSpawnerStructures() { sp.y = y3 * 16 - 8; } - if (getTile(sp.x / 16, sp.y / 16) == Tiles.get("rock")) { - setTile(sp.x / 16, sp.y / 16, Tiles.get("dirt")); + if (getTile(sp.x >> 4, sp.y >> 4) == Tiles.get("rock")) { + setTile(sp.x >> 4, sp.y >> 4, Tiles.get("dirt")); } - Structure.mobDungeonCenter.draw(this, sp.x / 16, sp.y / 16); + Structure.mobDungeonCenter.draw(this, sp.x >> 4, sp.y >> 4); - if (getTile(sp.x / 16, sp.y / 16 - 4) == Tiles.get("dirt")) { - Structure.mobDungeonNorth.draw(this, sp.x / 16, sp.y / 16 - 5); + if (getTile(sp.x >> 4, (sp.y >> 4) - 4) == Tiles.get("dirt")) { + Structure.mobDungeonNorth.draw(this, sp.x >> 4, (sp.y >> 4) - 5); } - if (getTile(sp.x / 16, sp.y / 16 + 4) == Tiles.get("dirt")) { - Structure.mobDungeonSouth.draw(this, sp.x / 16, sp.y / 16 + 5); + if (getTile(sp.x >> 4, (sp.y >> 4) + 4) == Tiles.get("dirt")) { + Structure.mobDungeonSouth.draw(this, sp.x >> 4, (sp.y >> 4) + 5); } - if (getTile(sp.x / 16 + 4, sp.y / 16) == Tiles.get("dirt")) { - Structure.mobDungeonEast.draw(this, sp.x / 16 + 5, sp.y / 16); + if (getTile((sp.x >> 4) + 4, sp.y >> 4) == Tiles.get("dirt")) { + Structure.mobDungeonEast.draw(this, (sp.x >> 4) + 5, sp.y >> 4); } - if (getTile(sp.x / 16 - 4, sp.y / 16) == Tiles.get("dirt")) { - Structure.mobDungeonWest.draw(this, sp.x / 16 - 5, sp.y / 16); + if (getTile((sp.x >> 4) - 4, sp.y >> 4) == Tiles.get("dirt")) { + Structure.mobDungeonWest.draw(this, (sp.x >> 4) - 5, sp.y >> 4); } add(sp); @@ -1072,11 +1072,11 @@ private void generateSpawnerStructures() { sp.y = y3 * 16 - 8; } - if (getTile(sp.x / 16, sp.y / 16) == Tiles.get("Obsidian Wall")) { - setTile(sp.x / 16, sp.y / 16, Tiles.get("dirt")); + if (getTile(sp.x >> 4, sp.y >> 4) == Tiles.get("Obsidian Wall")) { + setTile(sp.x >> 4, sp.y >> 4, Tiles.get("dirt")); } - Structure.dungeonSpawner.draw(this, sp.x / 16, sp.y / 16); + Structure.dungeonSpawner.draw(this, sp.x >> 4, sp.y >> 4); add(sp); for (int rpt = 0; rpt < 2; rpt++) { diff --git a/src/client/java/minicraft/level/tile/CactusTile.java b/src/client/java/minicraft/level/tile/CactusTile.java index 41f42c2c5..8f076592a 100644 --- a/src/client/java/minicraft/level/tile/CactusTile.java +++ b/src/client/java/minicraft/level/tile/CactusTile.java @@ -35,14 +35,14 @@ public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction at int damage = level.getData(x, y) + dmg; int cHealth = 10; if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = cHealth; - level.add(new SmashParticle(x * 16, y * 16)); - level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + level.add(new SmashParticle(x << 4, y << 4)); + level.add(new TextParticle("" + dmg, (x << 4) + 8, (y << 4) + 8, Color.RED)); if (damage >= cHealth) { //int count = random.nextInt(2) + 2; level.setTile(x, y, Tiles.get("sand")); Sound.play("monsterhurt"); - level.dropItem(x * 16 + 8, y * 16 + 8, 2, 4, Items.get("Cactus")); + level.dropItem((x << 4) + 8, (y << 4) + 8, 2, 4, Items.get("Cactus")); } else { level.setData(x, y, damage); } diff --git a/src/client/java/minicraft/level/tile/CloudTile.java b/src/client/java/minicraft/level/tile/CloudTile.java index f9326ebfe..869ffb0f1 100644 --- a/src/client/java/minicraft/level/tile/CloudTile.java +++ b/src/client/java/minicraft/level/tile/CloudTile.java @@ -34,7 +34,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get("Infinite Fall")); // Would allow you to shovel cloud, I think. Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, 1, 3, Items.get("Cloud")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, 1, 3, Items.get("Cloud")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/DecorTile.java b/src/client/java/minicraft/level/tile/DecorTile.java index b4266bd94..bd54a1cba 100644 --- a/src/client/java/minicraft/level/tile/DecorTile.java +++ b/src/client/java/minicraft/level/tile/DecorTile.java @@ -48,7 +48,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D throw new IllegalStateException("Unexpected value: " + type); } Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, drop); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, drop); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/DirtTile.java b/src/client/java/minicraft/level/tile/DirtTile.java index 95bf00e49..32bdf3112 100644 --- a/src/client/java/minicraft/level/tile/DirtTile.java +++ b/src/client/java/minicraft/level/tile/DirtTile.java @@ -62,7 +62,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get("Hole")); Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Dirt")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get("Dirt")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/DoorTile.java b/src/client/java/minicraft/level/tile/DoorTile.java index 021a07159..495595c7a 100644 --- a/src/client/java/minicraft/level/tile/DoorTile.java +++ b/src/client/java/minicraft/level/tile/DoorTile.java @@ -57,7 +57,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get((short) (id + 3))); // Will get the corresponding floor tile. Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get(type.name() + " Door")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get(type.name() + " Door")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/FloorTile.java b/src/client/java/minicraft/level/tile/FloorTile.java index d7190a48f..466cfafc0 100644 --- a/src/client/java/minicraft/level/tile/FloorTile.java +++ b/src/client/java/minicraft/level/tile/FloorTile.java @@ -57,7 +57,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D break; } Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, drop); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, drop); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/FlowerTile.java b/src/client/java/minicraft/level/tile/FlowerTile.java index 88a88a41d..0fadc749e 100644 --- a/src/client/java/minicraft/level/tile/FlowerTile.java +++ b/src/client/java/minicraft/level/tile/FlowerTile.java @@ -47,7 +47,7 @@ public boolean tick(Level level, int xt, int yt) { public void render(Screen screen, Level level, int x, int y) { Tiles.get("Grass").render(screen, level, x, y); int data = level.getData(x, y); - int shape = (data / 16) % 2; + int shape = (data >> 4) % 2; (shape == 0 ? flowerSprite0 : flowerSprite1).render(screen, level, x, y); } @@ -59,8 +59,8 @@ public boolean interact(Level level, int x, int y, Player player, Item item, Dir int data = level.getData(x, y); level.setTile(x, y, Tiles.get("Grass")); Sound.play("monsterhurt"); - level.dropItem(x * 16 + 8, y * 16 + 8, Items.get("Flower")); - level.dropItem(x * 16 + 8, y * 16 + 8, Items.get("Rose")); + level.dropItem((x << 4) + 8, (y << 4) + 8, Items.get("Flower")); + level.dropItem((x << 4) + 8, (y << 4) + 8, Items.get("Rose")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, x, y, level.depth)); @@ -72,8 +72,8 @@ public boolean interact(Level level, int x, int y, Player player, Item item, Dir } public boolean hurt(Level level, int x, int y, Mob source, int dmg, Direction attackDir) { - level.dropItem(x * 16 + 8, y * 16 + 8, 0, 1, Items.get("Flower")); - level.dropItem(x * 16 + 8, y * 16 + 8, 0, 1, Items.get("Rose")); + level.dropItem((x << 4) + 8, (y << 4) + 8, 0, 1, Items.get("Flower")); + level.dropItem((x << 4) + 8, (y << 4) + 8, 0, 1, Items.get("Rose")); level.setTile(x, y, Tiles.get("Grass")); return true; } diff --git a/src/client/java/minicraft/level/tile/GrassTile.java b/src/client/java/minicraft/level/tile/GrassTile.java index 05e728760..4e66b4118 100644 --- a/src/client/java/minicraft/level/tile/GrassTile.java +++ b/src/client/java/minicraft/level/tile/GrassTile.java @@ -59,7 +59,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D level.setTile(xt, yt, Tiles.get("Dirt")); Sound.play("monsterhurt"); if (random.nextInt(5) == 0) { // 20% chance to drop Grass seeds - level.dropItem(xt * 16 + 8, yt * 16 + 8, 1, Items.get("Grass Seeds")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, 1, Items.get("Grass Seeds")); } AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( @@ -73,7 +73,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D level.setTile(xt, yt, Tiles.get("Farmland")); Sound.play("monsterhurt"); if (random.nextInt(5) != 0) { // 80% chance to drop Wheat seeds - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Wheat Seeds")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get("Wheat Seeds")); } AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( diff --git a/src/client/java/minicraft/level/tile/HardRockTile.java b/src/client/java/minicraft/level/tile/HardRockTile.java index bfc8c37af..84bc8f2b5 100644 --- a/src/client/java/minicraft/level/tile/HardRockTile.java +++ b/src/client/java/minicraft/level/tile/HardRockTile.java @@ -65,14 +65,14 @@ public void hurt(Level level, int x, int y, int dmg) { int damage = level.getData(x, y) + dmg; int hrHealth = 200; if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = hrHealth; - level.add(new SmashParticle(x * 16, y * 16)); + level.add(new SmashParticle(x << 4, y << 4)); Sound.play("monsterhurt"); - level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + level.add(new TextParticle("" + dmg, (x << 4) + 8, (y << 4) + 8, Color.RED)); if (damage >= hrHealth) { level.setTile(x, y, Tiles.get("dirt")); - level.dropItem(x * 16 + 8, y * 16 + 8, 1, 3, Items.get("Stone")); - level.dropItem(x * 16 + 8, y * 16 + 8, 0, 1, Items.get("Coal")); + level.dropItem((x << 4) + 8, (y << 4) + 8, 1, 3, Items.get("Stone")); + level.dropItem((x << 4) + 8, (y << 4) + 8, 0, 1, Items.get("Coal")); } else { level.setData(x, y, damage); } diff --git a/src/client/java/minicraft/level/tile/MaterialTile.java b/src/client/java/minicraft/level/tile/MaterialTile.java index 83b8ff3f2..c3220f9c6 100644 --- a/src/client/java/minicraft/level/tile/MaterialTile.java +++ b/src/client/java/minicraft/level/tile/MaterialTile.java @@ -53,7 +53,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D throw new IllegalStateException("Unexpected value: " + type); } Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, drop); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, drop); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/OreTile.java b/src/client/java/minicraft/level/tile/OreTile.java index 23c374a42..e34470f95 100644 --- a/src/client/java/minicraft/level/tile/OreTile.java +++ b/src/client/java/minicraft/level/tile/OreTile.java @@ -94,10 +94,10 @@ public void hurt(Level level, int x, int y, int dmg) { int oreH = random.nextInt(10) * 4 + 20; if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = oreH; - level.add(new SmashParticle(x * 16, y * 16)); + level.add(new SmashParticle(x << 4, y << 4)); Sound.play("monsterhurt"); - level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + level.add(new TextParticle("" + dmg, (x << 4) + 8, (y << 4) + 8, Color.RED)); if (dmg > 0) { int count = random.nextInt(2); if (damage >= oreH) { @@ -113,7 +113,7 @@ public void hurt(Level level, int x, int y, int dmg) { if (type.drop.equals(Items.get("gem"))) { AchievementsDisplay.setAchievement("minicraft.achievement.find_gem", true); } - level.dropItem(x * 16 + 8, y * 16 + 8, count, type.getOre()); + level.dropItem((x << 4) + 8, (y << 4) + 8, count, type.getOre()); } } diff --git a/src/client/java/minicraft/level/tile/PathTile.java b/src/client/java/minicraft/level/tile/PathTile.java index e05d9bffa..781604b40 100644 --- a/src/client/java/minicraft/level/tile/PathTile.java +++ b/src/client/java/minicraft/level/tile/PathTile.java @@ -33,7 +33,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get("Hole")); Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Dirt")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get("Dirt")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/RockTile.java b/src/client/java/minicraft/level/tile/RockTile.java index fe1dc6a6b..6fde9871f 100644 --- a/src/client/java/minicraft/level/tile/RockTile.java +++ b/src/client/java/minicraft/level/tile/RockTile.java @@ -76,10 +76,10 @@ public void hurt(Level level, int x, int y, int dmg) { dropCoal = true; } - level.add(new SmashParticle(x * 16, y * 16)); + level.add(new SmashParticle(x << 4, y << 4)); Sound.play("monsterhurt"); - level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + level.add(new TextParticle("" + dmg, (x << 4) + 8, (y << 4) + 8, Color.RED)); if (damage >= maxHealth) { int stone = 1; if (dropCoal) { @@ -90,10 +90,10 @@ public void hurt(Level level, int x, int y, int dmg) { coal += 1; } - level.dropItem(x * 16 + 8, y * 16 + 8, 0, coal, Items.get("Coal")); + level.dropItem((x << 4) + 8, (y << 4) + 8, 0, coal, Items.get("Coal")); } - level.dropItem(x * 16 + 8, y * 16 + 8, stone, Items.get("Stone")); + level.dropItem((x << 4) + 8, (y << 4) + 8, stone, Items.get("Stone")); level.setTile(x, y, Tiles.get("Dirt")); } else { level.setData(x, y, damage); diff --git a/src/client/java/minicraft/level/tile/SandTile.java b/src/client/java/minicraft/level/tile/SandTile.java index 02d1020d1..960dcde72 100644 --- a/src/client/java/minicraft/level/tile/SandTile.java +++ b/src/client/java/minicraft/level/tile/SandTile.java @@ -69,7 +69,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get("Hole")); Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Sand")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get("Sand")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/TorchTile.java b/src/client/java/minicraft/level/tile/TorchTile.java index 0d6c3170f..f60626698 100644 --- a/src/client/java/minicraft/level/tile/TorchTile.java +++ b/src/client/java/minicraft/level/tile/TorchTile.java @@ -46,7 +46,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get((short) data)); Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get("Torch")); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get("Torch")); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/TreeTile.java b/src/client/java/minicraft/level/tile/TreeTile.java index b71ac28a2..6b9a76160 100644 --- a/src/client/java/minicraft/level/tile/TreeTile.java +++ b/src/client/java/minicraft/level/tile/TreeTile.java @@ -83,27 +83,27 @@ public void render(Screen screen, Level level, int x, int y) { Sprite spriteFull = level.treeTypes[x + y * level.w].treeSpriteFull.getSprite(); if (isUpTileSame && isUpLeftTileSame && isLeftTileSame) { - screen.render(x * 16 + 0, y * 16, spriteFull.spritePixels[0][1]); + screen.render((x << 4) + 0, (y << 4) + 0, spriteFull.spritePixels[0][1]); } else { - screen.render(x * 16 + 0, y * 16, sprite.spritePixels[0][0]); + screen.render((x << 4) + 0, (y << 4) + 0, sprite.spritePixels[0][0]); } if (isUpTileSame && isUpRightTileSame && isRightTileSame) { - screen.render(x * 16 + 8, y * 16, spriteFull.spritePixels[0][0]); + screen.render((x << 4) + 8, (y << 4) + 0, spriteFull.spritePixels[0][0]); } else { - screen.render(x * 16 + 8, y * 16, sprite.spritePixels[0][1]); + screen.render((x << 4) + 8, (y << 4) + 0, sprite.spritePixels[0][1]); } if (isDownTileSame && isDownLeftTileSame && isLeftTileSame) { - screen.render(x * 16 + 0, y * 16 + 8, spriteFull.spritePixels[1][1]); + screen.render((x << 4) + 0, (y << 4) + 8, spriteFull.spritePixels[1][1]); } else { - screen.render(x * 16 + 0, y * 16 + 8, sprite.spritePixels[1][0]); + screen.render((x << 4) + 0, (y << 4) + 8, sprite.spritePixels[1][0]); } if (isDownTileSame && isDownRightTileSame && isRightTileSame) { - screen.render(x * 16 + 8, y * 16 + 8, spriteFull.spritePixels[1][0]); + screen.render((x << 4) + 8, (y << 4) + 8, spriteFull.spritePixels[1][0]); } else { - screen.render(x * 16 + 8, y * 16 + 8, sprite.spritePixels[1][1]); + screen.render((x << 4) + 8, (y << 4) + 8, sprite.spritePixels[1][1]); } } diff --git a/src/client/java/minicraft/level/tile/WallTile.java b/src/client/java/minicraft/level/tile/WallTile.java index 0a8f5a576..48466fd54 100644 --- a/src/client/java/minicraft/level/tile/WallTile.java +++ b/src/client/java/minicraft/level/tile/WallTile.java @@ -93,10 +93,10 @@ public void hurt(Level level, int x, int y, int dmg) { int sbwHealth = 100; if (Game.isMode("minicraft.settings.mode.creative")) dmg = damage = sbwHealth; - level.add(new SmashParticle(x * 16, y * 16)); + level.add(new SmashParticle(x << 4, y << 4)); Sound.play("monsterhurt"); - level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.RED)); + level.add(new TextParticle("" + dmg, (x << 4) + 8, (y << 4) + 8, Color.RED)); if (damage >= sbwHealth) { String itemName = "", tilename = ""; switch (type) { // Get what tile to set and what item to drop @@ -117,7 +117,7 @@ public void hurt(Level level, int x, int y, int dmg) { } } - level.dropItem(x * 16 + 8, y * 16 + 8, 1, 3 - type.ordinal(), Items.get(itemName)); + level.dropItem((x << 4) + 8, (y << 4) + 8, 1, 3 - type.ordinal(), Items.get(itemName)); level.setTile(x, y, Tiles.get(tilename)); } else { level.setData(x, y, damage); diff --git a/src/client/java/minicraft/level/tile/WoolTile.java b/src/client/java/minicraft/level/tile/WoolTile.java index ddcfc98bb..f269e90b5 100644 --- a/src/client/java/minicraft/level/tile/WoolTile.java +++ b/src/client/java/minicraft/level/tile/WoolTile.java @@ -27,7 +27,7 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D int data = level.getData(xt, yt); level.setTile(xt, yt, Tiles.get("Hole")); Sound.play("monsterhurt"); - level.dropItem(xt * 16 + 8, yt * 16 + 8, Items.get(name)); + level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get(name)); AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.INSTANCE.trigger( new AdvancementElement.AdvancementTrigger.ItemUsedOnTileTrigger.ItemUsedOnTileTriggerConditionHandler.ItemUsedOnTileTriggerConditions( item, this, data, xt, yt, level.depth)); diff --git a/src/client/java/minicraft/level/tile/farming/PotatoTile.java b/src/client/java/minicraft/level/tile/farming/PotatoTile.java index 505b17860..619dbf2fc 100644 --- a/src/client/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/client/java/minicraft/level/tile/farming/PotatoTile.java @@ -25,6 +25,6 @@ public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); int stage = (int) ((float) age / maxAge * 5); - screen.render(x * 16, y * 16, spritStages[stage]); + screen.render(x << 4, y << 4, spritStages[stage]); } } diff --git a/src/client/java/minicraft/level/tile/farming/WheatTile.java b/src/client/java/minicraft/level/tile/farming/WheatTile.java index 39f585bf4..31fb0fe5a 100644 --- a/src/client/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/client/java/minicraft/level/tile/farming/WheatTile.java @@ -25,6 +25,6 @@ public void render(Screen screen, Level level, int x, int y) { int age = (level.getData(x, y) >> 3) & maxAge; Tiles.get("Farmland").render(screen, level, x, y); int stage = (int) ((float) age / maxAge * 5); - screen.render(x * 16, y * 16, spritStages[stage]); + screen.render(x << 4, y << 4, spritStages[stage]); } } diff --git a/src/client/java/minicraft/screen/BookDisplay.java b/src/client/java/minicraft/screen/BookDisplay.java index b31dbdf6d..d46684d82 100644 --- a/src/client/java/minicraft/screen/BookDisplay.java +++ b/src/client/java/minicraft/screen/BookDisplay.java @@ -18,7 +18,7 @@ public class BookDisplay extends Display { private static final String defaultBook = "This book has no text."; private static final int spacing = 3; - private static final int minX = 15, maxX = 15 + 8 * 32, minY = 8 * 5, maxY = 8 * 5 + 8 * 16; + private static final int minX = 15, maxX = 15 + 8 * 32, minY = 8 * 5, maxY = 8 * 5 + (8 << 4); // First array is page and second is line. private String[][] lines; From fcbd867b6b9e5bf5568a1c6fa84afb20293dc86a Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 1 May 2024 23:10:27 +0800 Subject: [PATCH 249/261] Minimally optimize light rendering Lights neighbouring lights in all 8 directions are rendered as a square of tile instead of circle --- src/client/java/minicraft/gfx/Screen.java | 51 +++++++++++++++-------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/src/client/java/minicraft/gfx/Screen.java b/src/client/java/minicraft/gfx/Screen.java index a8b997fbd..dbc05cb22 100644 --- a/src/client/java/minicraft/gfx/Screen.java +++ b/src/client/java/minicraft/gfx/Screen.java @@ -5,6 +5,7 @@ import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; import org.intellij.lang.annotations.MagicConstant; +import org.jetbrains.annotations.NotNull; import java.awt.AlphaComposite; import java.awt.Graphics2D; @@ -16,6 +17,9 @@ import java.math.MathContext; import java.util.ArrayDeque; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.IntStream; public class Screen { @@ -455,9 +459,9 @@ public void overlay(int currentLevel, int xa, int ya) { } else if (currentLevel >= 5) darkFactor = MAXDARK; - // The Integer array of pixels to overlay the screen with. + // The Integer array of pixels to overlay the screen with. queue(new OverlayRendering(currentLevel, xa, ya, darkFactor)); - } + } public void renderLight(int x, int y, int r) { // Applies offsets: @@ -478,16 +482,7 @@ private static class LightOverlay { public final byte[] bufPixels; public final BufferedImage overlay = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); public final int[] olPixels; - public final ArrayDeque lights = new ArrayDeque<>(); - - private static class LightRadius { - public final int x, y, r; - public LightRadius(int x, int y, int r) { - this.x = x; - this.y = y; - this.r = r; - } - } + public final HashMap<@NotNull Point, @NotNull Integer> lights = new HashMap<>(); public LightOverlay() { bufPixels = ((DataBufferByte) buffer.getRaster().getDataBuffer()).getData(); @@ -523,20 +518,40 @@ public double getOverlayOpacity(int currentLevel, double darkFactor) { } public void renderLight(int x, int y, int r) { - lights.add(new LightRadius(x, y, r)); + lights.put(new Point(x, y), r); } public BufferedImage render(int xa, int ya) { Graphics2D g2d = buffer.createGraphics(); g2d.setBackground(java.awt.Color.BLACK); g2d.clearRect(0, 0, w, h); - LightRadius lightRadius; - while ((lightRadius = lights.poll()) != null) { - int x = lightRadius.x, y = lightRadius.y, r = lightRadius.r; - g2d.setPaint(new RadialGradientPaint(x, y, r, graFractions, graColors)); - g2d.fillOval(x - r, y - r, r * 2, r * 2); + for (Map.Entry e : lights.entrySet()) { + int x = e.getKey().x, y = e.getKey().y, r = e.getValue(); + boolean[] surrounds = new boolean[8]; + for (int xx = -16; xx < 17; ++xx) { + for (int yy = -16; yy < 17; ++yy) { + if (xx != 0 || yy != 0) { + Point pp = new Point(x + xx, y + yy); + if (lights.containsKey(pp) && r <= lights.get(pp)) { + double theta = Math.atan2(yy, xx); + if (theta < 0) theta += 2 * Math.PI; // Ensures it is positive. + surrounds[(int) (theta * 4 / Math.PI)] = true; + } + } + } + } + + // Reduce lighting circles on screen + if (IntStream.range(0, surrounds.length).allMatch(i -> surrounds[i])) { + g2d.setColor(java.awt.Color.WHITE); + g2d.fillRect(x - 8, y - 8, 16, 16); + } else { + g2d.setPaint(new RadialGradientPaint(x, y, r, graFractions, graColors)); + g2d.fillOval(x - r, y - r, r * 2, r * 2); + } } g2d.dispose(); + lights.clear(); for (int x = 0; x < w; ++x) { for (int y = 0; y < h; ++y) { From 48adf4f834d10dd4ef9899b407066ef048f7159c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 2 May 2024 05:42:58 +0800 Subject: [PATCH 250/261] Add OpenGL HWA option --- src/client/java/minicraft/core/Game.java | 8 +++++-- .../java/minicraft/core/io/Settings.java | 2 ++ src/client/java/minicraft/saveload/Load.java | 23 +++++++++++++------ src/client/java/minicraft/saveload/Save.java | 1 + .../screen/OptionsMainMenuDisplay.java | 1 + .../minicraft/screen/OptionsWorldDisplay.java | 1 + .../resources/assets/localization/en-us.json | 1 + 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index eee673575..b5a61c39e 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -100,6 +100,11 @@ public static void main(String[] args) { Analytics.GameStartup.ping(); + new Load(true, true); // This loads basic saved preferences. + // Reference: https://stackoverflow.com/a/13832805 + if ((boolean) Settings.get("hwa")) System.setProperty("sun.java2d.opengl", "true"); + MAX_FPS = (int) Settings.get("fps"); // DO NOT put this above. + input = new InputHandler(Renderer.canvas); ResourcePackDisplay.initPacks(); @@ -116,8 +121,7 @@ public static void main(String[] args) { World.resetGame(); // "half"-starts a new game, to set up initial variables player.eid = 0; - new Load(true); // This loads any saved preferences. - MAX_FPS = (int) Settings.get("fps"); // DO NOT put this above. + new Load(true, false); // This loads any saved preferences. // Update fullscreen frame if Updater.FULLSCREEN was updated previously if (Updater.FULLSCREEN) { diff --git a/src/client/java/minicraft/core/io/Settings.java b/src/client/java/minicraft/core/io/Settings.java index b7112eb6c..e3dfdde31 100644 --- a/src/client/java/minicraft/core/io/Settings.java +++ b/src/client/java/minicraft/core/io/Settings.java @@ -25,6 +25,8 @@ public final class Settings { options.put("sound", new BooleanEntry("minicraft.settings.sound", true)); options.put("autosave", new BooleanEntry("minicraft.settings.autosave", true)); + // For Windows, OpenGL hardware acceleration is disabled by default + options.put("hwa", new BooleanEntry("minicraft.settings.opengl_hwa", !FileHandler.OS.contains("windows"))); options.put("size", new ArrayEntry<>("minicraft.settings.size", 128, 256, 512)); options.put("theme", new ArrayEntry<>("minicraft.settings.theme", "minicraft.settings.theme.normal", "minicraft.settings.theme.forest", "minicraft.settings.theme.desert", "minicraft.settings.theme.plain", "minicraft.settings.theme.hell")); diff --git a/src/client/java/minicraft/saveload/Load.java b/src/client/java/minicraft/saveload/Load.java index 3207777a8..2f27d358d 100644 --- a/src/client/java/minicraft/saveload/Load.java +++ b/src/client/java/minicraft/saveload/Load.java @@ -3,6 +3,7 @@ import minicraft.core.Game; import minicraft.core.Updater; import minicraft.core.World; +import minicraft.core.io.FileHandler; import minicraft.core.io.Localization; import minicraft.core.io.Settings; import minicraft.entity.Arrow; @@ -207,11 +208,11 @@ public Load() { } public Load(Version worldVersion) { - this(false); + this(false, false); worldVer = worldVersion; } - public Load(boolean loadConfig) { + public Load(boolean loadConfig, boolean partialLoad) { if (!loadConfig) return; boolean resave = false; @@ -220,11 +221,11 @@ public Load(boolean loadConfig) { // Check if Preferences.json exists. (new version) if (new File(location + "Preferences.json").exists()) { - loadPrefs("Preferences"); + loadPrefs("Preferences", partialLoad); // Check if Preferences.miniplussave exists. (old version) } else if (new File(location + "Preferences" + extension).exists()) { - loadPrefsOld("Preferences"); + loadPrefsOld("Preferences", partialLoad); Logging.SAVELOAD.info("Upgrading preferences to JSON."); resave = true; @@ -234,6 +235,8 @@ public Load(boolean loadConfig) { resave = true; } + if (partialLoad) return; // Partial loading only loads partial preferences + // Load unlocks. (new version) File testFileOld = new File(location + "unlocks" + extension); File testFile = new File(location + "Unlocks" + extension); @@ -447,7 +450,7 @@ private void loadMode(String modedata) { Settings.setIdx("mode", mode); } - private void loadPrefsOld(String filename) { + private void loadPrefsOld(String filename, boolean partialLoad) { loadFromFile(location + filename + extension); Version prefVer = new Version("2.0.2"); // the default, b/c this doesn't really matter much being specific past this if it's not set below. @@ -460,8 +463,11 @@ private void loadPrefsOld(String filename) { if (prefVer.compareTo(new Version("2.0.4-dev2")) >= 0) Settings.set("fps", Integer.parseInt(data.remove(0))); - if (prefVer.compareTo(new Version("2.0.7-dev5")) >= 0) + if (partialLoad) return; // Partial loading only loads basic settings. + + if (prefVer.compareTo(new Version("2.0.7-dev5")) >= 0) { data.remove(0); // Numeral skin indices are replaced. + } List subdata; if (prefVer.compareTo(new Version("2.0.3-dev1")) < 0) { @@ -525,7 +531,7 @@ private void loadPrefsOld(String filename) { } } - private void loadPrefs(String filename) { + private void loadPrefs(String filename, boolean partialLoad) { JSONObject json; try { json = new JSONObject(loadFromFile(location + filename + ".json", false)); @@ -542,6 +548,9 @@ private void loadPrefs(String filename) { Settings.set("autosave", json.getBoolean("autosave")); Settings.set("fps", json.getInt("fps")); Settings.set("showquests", json.optBoolean("showquests", true)); + if (json.has("hwa")) Settings.set("hwa", json.getBoolean("hwa")); // Default should have been configured + + if (partialLoad) return; // Partial loading only loads basic settings. if (json.has("lang")) { String lang = json.getString("lang"); diff --git a/src/client/java/minicraft/saveload/Save.java b/src/client/java/minicraft/saveload/Save.java index 2238ca164..43d827550 100644 --- a/src/client/java/minicraft/saveload/Save.java +++ b/src/client/java/minicraft/saveload/Save.java @@ -206,6 +206,7 @@ private void writePrefs() { json.put("keymap", new JSONArray(Game.input.getKeyPrefs())); json.put("resourcePacks", new JSONArray(ResourcePackDisplay.getLoadedPacks())); json.put("showquests", String.valueOf(Settings.get("showquests"))); + json.put("hwa", String.valueOf(Settings.get("hwa"))); // Save json try { diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index 6a5522fc6..0332e1b26 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -12,6 +12,7 @@ public OptionsMainMenuDisplay() { Settings.getEntry("fps"), Settings.getEntry("sound"), Settings.getEntry("showquests"), + Settings.getEntry("hardwareacc"), new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), diff --git a/src/client/java/minicraft/screen/OptionsWorldDisplay.java b/src/client/java/minicraft/screen/OptionsWorldDisplay.java index 2bb06b800..f82627c44 100644 --- a/src/client/java/minicraft/screen/OptionsWorldDisplay.java +++ b/src/client/java/minicraft/screen/OptionsWorldDisplay.java @@ -62,6 +62,7 @@ private List getEntries() { Settings.getEntry("fps"), Settings.getEntry("sound"), Settings.getEntry("autosave"), + Settings.getEntry("hardwareacc"), new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 0f4509fbb..ff6e4112a 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -465,6 +465,7 @@ "minicraft.settings.mode.hardcore": "Hardcore", "minicraft.settings.mode.score": "Score", "minicraft.settings.mode.survival": "Survival", + "minicraft.settings.opengl_hwa": "OpenGL Hardware Acceleration", "minicraft.settings.quests": "Quests", "minicraft.settings.scoretime": "Time (Score Mode)", "minicraft.settings.screenshot_scale": "Screenshot Scale", From d01deb3ca91ee1450d0ac555161aaf8c2d796557 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 2 May 2024 05:57:28 +0800 Subject: [PATCH 251/261] Add option entry and popup for HWA --- .../screen/OptionsMainMenuDisplay.java | 25 ++++++++++++++++++- .../minicraft/screen/OptionsWorldDisplay.java | 24 +++++++++++++++++- .../resources/assets/localization/en-us.json | 2 ++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java index 0332e1b26..f01b53ef3 100644 --- a/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java +++ b/src/client/java/minicraft/screen/OptionsMainMenuDisplay.java @@ -1,18 +1,23 @@ package minicraft.screen; import minicraft.core.Game; +import minicraft.core.io.FileHandler; +import minicraft.core.io.InputHandler; import minicraft.core.io.Settings; import minicraft.saveload.Save; import minicraft.screen.entry.SelectEntry; +import java.util.ArrayList; + public class OptionsMainMenuDisplay extends Display { + private final boolean prevHwaValue = (boolean) Settings.get("hwa"); public OptionsMainMenuDisplay() { super(true, new Menu.Builder(false, 6, RelPos.LEFT, Settings.getEntry("fps"), Settings.getEntry("sound"), Settings.getEntry("showquests"), - Settings.getEntry("hardwareacc"), + Settings.getEntry("hwa"), new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), @@ -22,6 +27,24 @@ public OptionsMainMenuDisplay() { .createMenu()); } + @Override + public void tick(InputHandler input) { + if (!prevHwaValue && (boolean) Settings.get("hwa") && FileHandler.OS.contains("windows") && input.inputPressed("EXIT")) { + ArrayList callbacks = new ArrayList<>(); + callbacks.add(new PopupDisplay.PopupActionCallback("SELECT", m -> { + Game.exitDisplay(2); + return true; + })); + Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig( + "minicraft.display.options_display.popup.hwa_warning.title", callbacks, 2), + "minicraft.display.options_display.popup.hwa_warning.content", + "minicraft.display.popup.escape_cancel", "minicraft.display.popup.enter_confirm")); + return; + } + + super.tick(input); + } + @Override public void onExit() { new Save(); diff --git a/src/client/java/minicraft/screen/OptionsWorldDisplay.java b/src/client/java/minicraft/screen/OptionsWorldDisplay.java index f82627c44..c297d1d52 100644 --- a/src/client/java/minicraft/screen/OptionsWorldDisplay.java +++ b/src/client/java/minicraft/screen/OptionsWorldDisplay.java @@ -1,6 +1,8 @@ package minicraft.screen; import minicraft.core.Game; +import minicraft.core.io.FileHandler; +import minicraft.core.io.InputHandler; import minicraft.core.io.Settings; import minicraft.gfx.Color; import minicraft.saveload.Save; @@ -15,6 +17,8 @@ import java.util.concurrent.Executors; public class OptionsWorldDisplay extends Display { + private final boolean prevHwaValue = (boolean) Settings.get("hwa"); + public OptionsWorldDisplay() { super(true); @@ -57,12 +61,30 @@ public OptionsWorldDisplay() { }; } + @Override + public void tick(InputHandler input) { + if (!prevHwaValue && (boolean) Settings.get("hwa") && FileHandler.OS.contains("windows") && input.inputPressed("EXIT")) { + ArrayList callbacks = new ArrayList<>(); + callbacks.add(new PopupDisplay.PopupActionCallback("SELECT", m -> { + Game.exitDisplay(2); + return true; + })); + Game.setDisplay(new PopupDisplay(new PopupDisplay.PopupConfig( + "minicraft.display.options_display.popup.hwa_warning.title", callbacks, 2), + "minicraft.display.options_display.popup.hwa_warning.content", + "minicraft.display.popup.escape_cancel", "minicraft.display.popup.enter_confirm")); + return; + } + + super.tick(input); + } + private List getEntries() { return new ArrayList<>(Arrays.asList(Settings.getEntry("diff"), Settings.getEntry("fps"), Settings.getEntry("sound"), Settings.getEntry("autosave"), - Settings.getEntry("hardwareacc"), + Settings.getEntry("hwa"), new SelectEntry("minicraft.display.options_display.change_key_bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("minicraft.displays.controls", () -> Game.setDisplay(new ControlsDisplay())), new SelectEntry("minicraft.display.options_display.language", () -> Game.setDisplay(new LanguageSettingsDisplay())), diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index ff6e4112a..b01642386 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -219,6 +219,8 @@ "minicraft.display.options_display": "Options", "minicraft.display.options_display.change_key_bindings": "Change Key Bindings", "minicraft.display.options_display.language": "Language", + "minicraft.display.options_display.popup.hwa_warning.content": "Possible visual problem might occur if OpenGL Hardware Acceleration is enabled. Please confirm if proceed.", + "minicraft.display.options_display.popup.hwa_warning.title": "Warning", "minicraft.display.options_display.resource_packs": "Resource packs", "minicraft.display.popup.enter_confirm": "Enter to confirm", "minicraft.display.popup.escape_cancel": "Escape to cancel", From 2ba62f8173da2d4ed2501d7d21417d3b7b72cd6c Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 2 May 2024 05:58:12 +0800 Subject: [PATCH 252/261] Remove `--no-hardware-acceleration` flag --- src/client/java/minicraft/core/Initializer.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/client/java/minicraft/core/Initializer.java b/src/client/java/minicraft/core/Initializer.java index db5c8a7cd..de2c99e44 100644 --- a/src/client/java/minicraft/core/Initializer.java +++ b/src/client/java/minicraft/core/Initializer.java @@ -63,13 +63,9 @@ static void parseArgs(String[] args) { Localization.isDebugLocaleEnabled = true; } else if (args[i].equalsIgnoreCase("--debug-unloc-tracing")) { Localization.unlocalizedStringTracing = true; - } else if (args[i].equalsIgnoreCase("--no-hardware-acceleration")) { - enableHardwareAcceleration = false; } } ((TinylogLoggingProvider) ProviderRegistry.getLoggingProvider()).init(); - // Reference: https://stackoverflow.com/a/13832805 - if (enableHardwareAcceleration) System.setProperty("sun.java2d.opengl", "true"); FileHandler.determineGameDir(saveDir); } From 19d6297b58f313f9ff43676733341f48be90c329 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Wed, 8 May 2024 00:49:32 +0800 Subject: [PATCH 253/261] Fix a miss of copy of texture of stone hoe --- .../assets/textures/item/stone_hoe.png | Bin 152 -> 179 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/client/resources/assets/textures/item/stone_hoe.png b/src/client/resources/assets/textures/item/stone_hoe.png index 438f6e9cde40121827d441d055b92eb140e5101b..2d7707408a658fc033be38a8ec3727062b17b6a4 100644 GIT binary patch delta 138 zcmbQixS4T+VLeN_qpu?a!^VE@KZ&di3=EtF9+AZi419+{nDKc2iWH!rho_5Uh(>U- zf@DNQ#2@xVjp>b?UWXf(FEp9arkTX@dBFlh;~)RKLa!glsSB+$;AL0v^iA~LaZ$l+ oPQP9!(+966hB!|)HZ}&XQ<9F%NB1uWn#thl>gTeK*(sq302*^G#sB~S delta 110 zcmV-!0FnQ*0hj@hF=tXqL_t(2Q)6Tx02tBbEi5elgTzjpI02SJQ2>*~sh}}4`2Y6v zPZ>Vm{>X6s?R8WWK$0s~T?5+)lZ0CVlSGz)xs4H@B-jK^Va@;8bizyk0927H31@yY QPyhe`07*qoM6N<$g7%**$N&HU From 20b8c9bcb16a619796f6fd76ad4bda3c58b18e91 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Fri, 10 May 2024 23:09:51 +0800 Subject: [PATCH 254/261] Fix a typo in ChangeLog.md --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 1236fe666..58925f115 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -63,7 +63,7 @@ but some sections are changed to compliant this project. * Reduced food stamina cost * Made some strings lower-cased * Updated spawning and despawning conditions -* Iron and goal now require 3 ores instead of 4 for crafting +* Iron and gold now require 3 ores instead of 4 for crafting * Renamed `assets/books/story_guide.txt` to `assets/books/game_guide.txt` * Updated `assets/books/game_guide.txt` and `assets/books/instructions.txt` From 3fe6fb5a004f7ab265f4c96ac66f93a87ffc3004 Mon Sep 17 00:00:00 2001 From: Litorom <70768734+Litorom@users.noreply.github.com> Date: Tue, 21 May 2024 15:07:53 -0400 Subject: [PATCH 255/261] Fix grammar --- src/client/resources/assets/localization/en-us.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index b01642386..60c374467 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -219,7 +219,7 @@ "minicraft.display.options_display": "Options", "minicraft.display.options_display.change_key_bindings": "Change Key Bindings", "minicraft.display.options_display.language": "Language", - "minicraft.display.options_display.popup.hwa_warning.content": "Possible visual problem might occur if OpenGL Hardware Acceleration is enabled. Please confirm if proceed.", + "minicraft.display.options_display.popup.hwa_warning.content": "Possible visual problems might occur if OpenGL Hardware Acceleration is enabled. Please confirm if you want to proceed.", "minicraft.display.options_display.popup.hwa_warning.title": "Warning", "minicraft.display.options_display.resource_packs": "Resource packs", "minicraft.display.popup.enter_confirm": "Enter to confirm", From 39c87c46f1517120db838f2cd2db49ae6e7bfd4b Mon Sep 17 00:00:00 2001 From: Litorom Date: Fri, 24 May 2024 11:36:30 -0400 Subject: [PATCH 256/261] Update DecorTile.java to allow for more decors + Added Ornate Wood + Added code for raw ethereal & sandstone --- build.gradle | 2 +- src/client/java/minicraft/core/Game.java | 2 +- src/client/java/minicraft/item/TileItem.java | 1 + .../java/minicraft/level/tile/DecorTile.java | 57 ++++++++++++++---- .../java/minicraft/level/tile/Tiles.java | 5 +- .../assets/textures/tile/ornate_wood.png | Bin 0 -> 275 bytes 6 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 src/client/resources/assets/textures/tile/ornate_wood.png diff --git a/build.gradle b/build.gradle index 3e430917d..01be4c064 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { allprojects { apply plugin: "java" - version = "2.2.0" + version = "2.2.1-dev1" sourceCompatibility = 8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' diff --git a/src/client/java/minicraft/core/Game.java b/src/client/java/minicraft/core/Game.java index eee673575..33013807b 100644 --- a/src/client/java/minicraft/core/Game.java +++ b/src/client/java/minicraft/core/Game.java @@ -25,7 +25,7 @@ protected Game() { public static final String NAME = "Minicraft Plus"; // This is the name on the application window. - public static final Version VERSION = new Version("2.2.0"); + public static final Version VERSION = new Version("2.2.1-dev1"); public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes. public static Player player; diff --git a/src/client/java/minicraft/item/TileItem.java b/src/client/java/minicraft/item/TileItem.java index 66ae745b5..4c4ea0d3e 100644 --- a/src/client/java/minicraft/item/TileItem.java +++ b/src/client/java/minicraft/item/TileItem.java @@ -38,6 +38,7 @@ protected static ArrayList getAllInstances() { TileModel.TileDataGetter placeOverWithID = (model1, target, level, xt, yt, player, attackDir) -> target.id; items.add(new TileItem("Plank", new LinkedSprite(SpriteType.Item, "plank"), new TileModel("Wood Planks"), "hole", "water", "cloud")); + items.add(new TileItem("Ornate Wood", new LinkedSprite(SpriteType.Item, "plank"), new TileModel("Ornate Wood"), "hole", "water", "cloud")); items.add(new TileItem("Plank Wall", new LinkedSprite(SpriteType.Item, "plank_wall"), new TileModel("Wood Wall"), "Wood Planks")); items.add(new TileItem("Wood Door", new LinkedSprite(SpriteType.Item, "wood_door"), new TileModel("Wood Door"), "Wood Planks")); items.add(new TileItem("Wood Fence", new LinkedSprite(SpriteType.Item, "wood_fence"), new TileModel("Wood Fence", placeOverWithID), solidTiles)); diff --git a/src/client/java/minicraft/level/tile/DecorTile.java b/src/client/java/minicraft/level/tile/DecorTile.java index b4266bd94..24df67f40 100644 --- a/src/client/java/minicraft/level/tile/DecorTile.java +++ b/src/client/java/minicraft/level/tile/DecorTile.java @@ -4,6 +4,7 @@ import minicraft.entity.Direction; import minicraft.entity.Entity; import minicraft.entity.mob.Player; +import minicraft.gfx.Screen; import minicraft.gfx.SpriteAnimation; import minicraft.gfx.SpriteLinker.SpriteType; import minicraft.item.Item; @@ -13,22 +14,51 @@ import minicraft.util.AdvancementElement; public class DecorTile extends Tile { - private static SpriteAnimation stoneSprite = new SpriteAnimation(SpriteType.Tile, "ornate_stone"); - private static SpriteAnimation obsidianSprite = new SpriteAnimation(SpriteType.Tile, "ornate_obsidian"); + private static final SpriteAnimation stoneSprite = new SpriteAnimation(SpriteType.Tile, "ornate_stone"); + private static final SpriteAnimation obsidianSprite = new SpriteAnimation(SpriteType.Tile, "ornate_obsidian"); + private static final SpriteAnimation woodSprite = new SpriteAnimation(SpriteType.Tile, "ornate_wood"); + private static final SpriteAnimation sandStoneSprite = new SpriteAnimation(SpriteType.Tile, "sandstone"); + private static final SpriteAnimation rawEtherealSprite = new SpriteAnimation(SpriteType.Tile, "cloud");//"raw_ethereal"); - protected Material type; + public enum decorType { + ORNATE_OBSIDIAN(obsidianSprite, "Ornate Obsidian", Material.Obsidian), + ORNATE_STONE(stoneSprite, "Ornate Stone", Material.Stone), + ORNATE_WOOD(woodSprite, "Ornate Wood", Material.Wood), + SANDSTONE(sandStoneSprite, "Sandstone", Material.Stone), + RAW_ETHEREAL(rawEtherealSprite, "Raw Ethereal", Material.Obsidian),; - protected DecorTile(Material type) { - super((type == Material.Obsidian ? "Ornate Obsidian" : type == Material.Stone ? "Ornate Stone" : "Decorated " + type.name()), - type == Material.Stone ? stoneSprite : obsidianSprite); - this.type = type; + private final SpriteAnimation decorSprite; + private final String name; + private final Material mType; + + decorType (SpriteAnimation sprite, String name, Material mType) { + this.decorSprite = sprite; + this.name = name; + this.mType = mType; + } + } + + private final decorType thisType; + private final Material mType; + + protected DecorTile(decorType type) { + super(type.name, null); maySpawn = true; + thisType = type; + sprite = thisType.decorSprite; + mType = thisType.mType; + } + + @Override + public void render(Screen screen, Level level, int x, int y) { + super.render(screen, level, x, y); + screen.render(x * 16 + 0, y * 16, sprite.getCurrentFrame().getSprite().spritePixels[0][0]); } public boolean interact(Level level, int xt, int yt, Player player, Item item, Direction attackDir) { if (item instanceof ToolItem) { ToolItem tool = (ToolItem) item; - if (tool.type == type.getRequiredTool()) { + if (tool.type == mType.getRequiredTool()) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { int data = level.getData(xt, yt); if (level.depth == 1) { @@ -37,15 +67,18 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D level.setTile(xt, yt, Tiles.get("Hole")); } Item drop; - switch (type) { - case Stone: + switch (thisType) { + case ORNATE_STONE: drop = Items.get("Ornate Stone"); break; - case Obsidian: + case ORNATE_OBSIDIAN: drop = Items.get("Ornate Obsidian"); break; + case ORNATE_WOOD: + drop = Items.get("Ornate Wood"); + break; default: - throw new IllegalStateException("Unexpected value: " + type); + throw new IllegalStateException("Unexpected value: " + thisType); } Sound.play("monsterhurt"); level.dropItem(xt * 16 + 8, yt * 16 + 8, drop); diff --git a/src/client/java/minicraft/level/tile/Tiles.java b/src/client/java/minicraft/level/tile/Tiles.java index 0f7a481e9..7380454a6 100644 --- a/src/client/java/minicraft/level/tile/Tiles.java +++ b/src/client/java/minicraft/level/tile/Tiles.java @@ -71,8 +71,8 @@ public static void initTileList() { tiles.put((short) 42, new PotatoTile("Potato")); tiles.put((short) 43, new MaterialTile(Tile.Material.Stone)); tiles.put((short) 44, new MaterialTile(Tile.Material.Obsidian)); - tiles.put((short) 45, new DecorTile(Tile.Material.Stone)); - tiles.put((short) 46, new DecorTile(Tile.Material.Obsidian)); + tiles.put((short) 45, new DecorTile(DecorTile.decorType.ORNATE_STONE)); + tiles.put((short) 46, new DecorTile(DecorTile.decorType.ORNATE_OBSIDIAN)); tiles.put((short) 47, new BossWallTile()); tiles.put((short) 48, new BossFloorTile()); tiles.put((short) 49, new BossDoorTile()); @@ -85,6 +85,7 @@ public static void initTileList() { tiles.put((short) 56, new FenceTile(Tile.Material.Obsidian)); tiles.put((short) 57, new TorchTile()); tiles.put((short) 58, new SignTile()); + tiles.put((short) 59, new DecorTile(DecorTile.decorType.ORNATE_WOOD)); // WARNING: don't use this tile for anything! tiles.put((short) 255, new ConnectTile()); diff --git a/src/client/resources/assets/textures/tile/ornate_wood.png b/src/client/resources/assets/textures/tile/ornate_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..8e5780f3e426d5f3432613a85c932f7330bf5d91 GIT binary patch literal 275 zcmV+u0qp*XP)Px#%}GQ-R5(wildBE_F%U(&217uhNf0Rb13rUa2Tg)TK`#|xdQq=4Hsqd0=zTckptpX0mO}Snk^+6z321E~=3c$PQGD0ba zBO@)>Ya)P(A^ Date: Fri, 24 May 2024 12:02:10 -0400 Subject: [PATCH 257/261] Update ChangeLog.md --- ChangeLog.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index fb763bd32..14a3d4f46 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), but some sections are changed to compliant this project. +## [2.2.1] + +### Additions + +* Added ornate wood tiles + +### Changes + +* Disabled hardware acceleration by default +* Hardware acceleration is now a toggle in settings +* Screenshots will now be the size of the rendered view within the window +* Updated localization + +### Removals + +* Removed argument flag `--no-hardware-acceleration` +* Removed screenshot size setting + +### Fixes + +* Optimized light source rendering +* Optimized calculations +* Fixed the texture on stone hoe + ## [2.2.0] ### Additions From 596dd7793d39b3cecae3591a06355a8285c045b8 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Tue, 18 Jun 2024 21:35:47 +0800 Subject: [PATCH 258/261] Add inventory capacity counter --- .../java/minicraft/screen/ContainerDisplay.java | 15 +++++++++++++++ .../java/minicraft/screen/PlayerInvDisplay.java | 7 +++++++ .../resources/assets/localization/en-us.json | 1 + 3 files changed, 23 insertions(+) diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 04d846b02..370d36070 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -3,9 +3,13 @@ import com.studiohartman.jamepad.ControllerButton; import minicraft.core.Game; import minicraft.core.io.InputHandler; +import minicraft.core.io.Localization; import minicraft.entity.ItemHolder; import minicraft.entity.furniture.Chest; import minicraft.entity.mob.Player; +import minicraft.gfx.Color; +import minicraft.gfx.Font; +import minicraft.gfx.Rectangle; import minicraft.gfx.Screen; import minicraft.item.Inventory; import minicraft.item.Item; @@ -68,6 +72,17 @@ public void render(Screen screen) { if (onScreenKeyboardMenu != null) { onScreenKeyboardMenu.render(screen); } + + String counterLeft = Localization.getLocalized("minicraft.display.menus.inventory.counter", + player.getInventory().invSize(), player.getInventory().getMaxSlots()); + Rectangle boundsLeft = menus[0].getBounds(); + Font.drawBackground(counterLeft, screen, boundsLeft.getRight() - counterLeft.length() * 8, + boundsLeft.getTop() - 8, Color.GRAY); + + String counterRight = Localization.getLocalized("minicraft.display.menus.inventory.counter", + chest.getInventory().invSize(), chest.getInventory().getMaxSlots()); + Rectangle boundsRight = menus[1].getBounds(); + Font.drawBackground(counterRight, screen, boundsRight.getLeft(), boundsRight.getTop() - 8, Color.GRAY); } @Override diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index 1b8ba02ea..b7f24f32d 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -8,6 +8,7 @@ import minicraft.gfx.Color; import minicraft.gfx.Font; import minicraft.gfx.Point; +import minicraft.gfx.Rectangle; import minicraft.gfx.Screen; import minicraft.item.Inventory; import minicraft.item.Item; @@ -192,6 +193,12 @@ public void render(Screen screen) { super.render(screen); + String counterLeft = Localization.getLocalized("minicraft.display.menus.inventory.counter", + player.getInventory().invSize(), player.getInventory().getMaxSlots()); + Rectangle boundsLeft = menus[0].getBounds(); + Font.drawBackground(counterLeft, screen, boundsLeft.getRight() - counterLeft.length() * 8, + boundsLeft.getTop() - 8, Color.GRAY); + // Searcher help text String text = Localization.getLocalized("minicraft.displays.player_inv.display.help", Game.input.getMapping("SEARCHER-BAR")); Font.draw(text, screen, selection == 0 ? 12 : Screen.w - 12 - Font.textWidth(text), menus[creativeMode ? 2 : 1].getBounds().getBottom() + 8, Color.WHITE); diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 60c374467..37cbc7e2a 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -216,6 +216,7 @@ "minicraft.display.gui.score.current_score": "Current score: %s", "minicraft.display.gui.score.time_left": "Time left %s%sm %ss", "minicraft.display.menus.inventory": "Inventory", + "minicraft.display.menus.inventory.counter": "%s/%s", "minicraft.display.options_display": "Options", "minicraft.display.options_display.change_key_bindings": "Change Key Bindings", "minicraft.display.options_display.language": "Language", From 284bd9bbe7c202837da0399b533248f0264fcc53 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:44:47 +0800 Subject: [PATCH 259/261] Push localizations from Lokalise --- .../resources/assets/localization/de-de.json | 1 - .../resources/assets/localization/en-gb.json | 1 - .../resources/assets/localization/en-us.json | 3 + .../resources/assets/localization/es-es.json | 207 ++++++++++-------- .../resources/assets/localization/nl-nl.json | 1 - .../resources/assets/localization/pl-pl.json | 1 - .../resources/assets/localization/ru-ru.json | 79 +++++-- .../resources/assets/localization/uk-ua.json | 1 - 8 files changed, 177 insertions(+), 117 deletions(-) diff --git a/src/client/resources/assets/localization/de-de.json b/src/client/resources/assets/localization/de-de.json index 21f23fa84..6f97fc899 100644 --- a/src/client/resources/assets/localization/de-de.json +++ b/src/client/resources/assets/localization/de-de.json @@ -52,7 +52,6 @@ "Grass Seeds": "Grasssamen", "Green Clothes": "Grüne Kleidung", "Green Wool": "Grüne Wolle", - "GunPowder": "Schießpulver", "Gunpowder": "Schießpulver", "Hard Rock": "Hartgestein", "Haste Potion": "Eiltrank", diff --git a/src/client/resources/assets/localization/en-gb.json b/src/client/resources/assets/localization/en-gb.json index a4e908aa6..57193ebc7 100644 --- a/src/client/resources/assets/localization/en-gb.json +++ b/src/client/resources/assets/localization/en-gb.json @@ -52,7 +52,6 @@ "Grass Seeds": "Grass Seeds", "Green Clothes": "Green Clothes", "Green Wool": "Green Wool", - "GunPowder": "Gunpowder", "Gunpowder": "Gunpowder", "Hard Rock": "Hard Rock", "Haste Potion": "Haste Potion", diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 0f4509fbb..60c374467 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -219,6 +219,8 @@ "minicraft.display.options_display": "Options", "minicraft.display.options_display.change_key_bindings": "Change Key Bindings", "minicraft.display.options_display.language": "Language", + "minicraft.display.options_display.popup.hwa_warning.content": "Possible visual problems might occur if OpenGL Hardware Acceleration is enabled. Please confirm if you want to proceed.", + "minicraft.display.options_display.popup.hwa_warning.title": "Warning", "minicraft.display.options_display.resource_packs": "Resource packs", "minicraft.display.popup.enter_confirm": "Enter to confirm", "minicraft.display.popup.escape_cancel": "Escape to cancel", @@ -465,6 +467,7 @@ "minicraft.settings.mode.hardcore": "Hardcore", "minicraft.settings.mode.score": "Score", "minicraft.settings.mode.survival": "Survival", + "minicraft.settings.opengl_hwa": "OpenGL Hardware Acceleration", "minicraft.settings.quests": "Quests", "minicraft.settings.scoretime": "Time (Score Mode)", "minicraft.settings.screenshot_scale": "Screenshot Scale", diff --git a/src/client/resources/assets/localization/es-es.json b/src/client/resources/assets/localization/es-es.json index b832b1627..77e13150a 100644 --- a/src/client/resources/assets/localization/es-es.json +++ b/src/client/resources/assets/localization/es-es.json @@ -5,6 +5,7 @@ "Anvil": "Yunque", "Apple": "Manzana", "Arrow": "Flecha", + "Awkward Potion": "Poción Extraña", "Axe": "Hacha", "Baked Potato": "Patata Cocida", "Bed": "Cama", @@ -25,17 +26,18 @@ "Cloud Cactus": "Cactus Nuboso", "Cloud Ore": "Mena Nubosa", "Coal": "Carbón", - "Cooked Fish": "Pescado cocido", - "Cooked Pork": "Cerdo cocido", + "Cooked Fish": "Pescado Cocido", + "Cooked Pork": "Cerdo Cocido", "Cow Spawner": "Generador de Vaca", "Creeper Spawner": "Generador de Creeper", "Cyan Clothes": "Ropa Cian", "Death Chest": "Cofre de Recuperación", "Dirt": "Tierra", + "Dungeon Chest": "Cofre de Mazmorra", "Empty Bucket": "Cubo vacío", "Enchanter": "Encantador", - "Energy Potion": "Poción energética", - "Escape Potion": "Poción de escape", + "Energy Potion": "Poción Energética", + "Escape Potion": "Poción de Escape", "Explode": "Explosión", "Farmland": "Tierra Fértil", "Flower": "Flor", @@ -45,6 +47,7 @@ "Gem Fishing Rod": "Estrobo de gema", "Gem Ore": "Mena de Gema", "Glass": "Cristal", + "Glass Bottle": "Botella de Cristal", "Gold": "Oro", "Gold Apple": "Manzana Dorada", "Gold Armor": "Armadura de Oro", @@ -57,8 +60,8 @@ "Green Wool": "Lana Verde", "Gunpowder": "Pólvora", "Hard Rock": "Roca Dura", - "Haste Potion": "Poción de prisa", - "Health Potion": "Poción de vida", + "Haste Potion": "Poción de Prisa", + "Health Potion": "Poción de Vida", "Hoe": "Azada", "Hole": "Hoyo", "Infinite Fall": "Caída Infinita", @@ -74,21 +77,25 @@ "Lava": "Lava", "Lava Brick": "Ladrillo de Lava", "Lava Bucket": "Cubo de Lava", - "Lava Potion": "Poción ignífuga", + "Lava Potion": "Poción Ignífuga", "Leather": "Cuero", "Leather Armor": "Armadura de Cuero", - "Light Potion": "Poción lumínica", + "Light Potion": "Poción Lumínica", "Loom": "Telar", "Natural Rock": "Roca natural", - "None Potion": "Poción vacía", + "None Potion": "Poción Vacía", "Obsidian": "Obsidiana", "Obsidian Brick": "Ladrillo de Obsidiana", "Obsidian Door": "Puerta de Obsidiana", + "Obsidian Fence": "Valla de Obsidiana", + "Obsidian Heart": "Corazón de Obsidiana", + "Obsidian Poppet": "Figura de Obsidiana", "Obsidian Wall": "Muro de Obsidiana", "Orange Clothes": "Ropa Naranja", "Ornate Obsidian": "Patrón de Obsidiana", "Ornate Stone": "Patrón de Piedra", "Oven": "Cocina", + "Path": "Camino", "Pickaxe": "Pico", "Pig Spawner": "Generador de Cerdo", "Plank": "Tabla", @@ -99,14 +106,14 @@ "Potion": "Poción", "Power Glove": "Guante Fuerte", "Purple Clothes": "Ropa Morada", - "Raw Beef": "Bistec crudo", - "Raw Fish": "Pescado crudo", - "Raw Obsidian": "Obsidiana cruda", - "Raw Pork": "Cerdo crudo", + "Raw Beef": "Bistec Crudo", + "Raw Fish": "Pescado Crudo", + "Raw Obsidian": "Obsidiana Cruda", + "Raw Pork": "Cerdo Crudo", "Red Clothes": "Ropa Roja", "Red Wool": "Lana Roja", "Reg Clothes": "Ropa Común", - "Regen Potion": "Poción de regen.", + "Regen Potion": "Poción de Regen.", "Rock": "Roca", "Rose": "Rosa", "Sand": "Arena", @@ -115,14 +122,14 @@ "Shard": "Pieza", "Shears": "Tijeras", "Sheep Spawner": "Generador de Oveja", - "Shield Potion": "Poción de escudo", + "Shield Potion": "Poción de Escudo", "Shovel": "Pala", "Skeleton Spawner": "Generador de Esqueleto", "Slime": "Slime", "Slime Spawner": "Generador de Slime", "Snake Armor": "Armadura de Víbora", "Snake Spawner": "Generador de Víbora", - "Speed Potion": "Poción de velocidad", + "Speed Potion": "Poción de Velocidad", "Stairs Down": "Escaleras Abajo", "Stairs Up": "Escaleras Arriba", "Steak": "Bistec", @@ -130,14 +137,15 @@ "Stone Brick": "Ladrillo de Piedra", "Stone Bricks": "Ladrillo de piedra", "Stone Door": "Puerta de Piedra", + "Stone Fence": "Valla de Piedra", "Stone Wall": "Muro de Piedra", "String": "Cuerda", - "Swim Potion": "Poción del mar", + "Swim Potion": "Poción de Natación", "Sword": "Espada", - "Time Potion": "Poción contrarreloj", + "Time Potion": "Poción Contrarreloj", "Tnt": "Dinamita", "Torch": "Antorcha", - "Totem of Air": "Tótem aéreo", + "Totem of Air": "Tótem Aéreo", "Tree": "Árbol", "Tree Sapling": "Brote de Árbol", "Water": "Agua", @@ -146,6 +154,7 @@ "Wheat Seeds": "Semillas de Trigo", "Wood": "Madera", "Wood Door": "Puerta de Madera", + "Wood Fence": "Valla de Madera", "Wood Fishing Rod": "Estrobo de madera", "Wood Planks": "Tablas de Madera", "Wood Wall": "Muro de Madera", @@ -155,13 +164,15 @@ "Yellow Wool": "Lana Amarilla", "Zombie Spawner": "Generador de Zombi", "minicraft.achievement.airwizard": "Desvanecido cual aire", - "minicraft.achievement.airwizard.desc": "¡Derrota al primer Mago aéreo!", + "minicraft.achievement.airwizard.desc": "¡Derrota al Mago aéreo!", "minicraft.achievement.benchmarking": "¡A fabricar!", "minicraft.achievement.benchmarking.desc": "Haz una Mesa de trabajo.", + "minicraft.achievement.boat": "Rema a Roma", + "minicraft.achievement.boat.desc": "Fabrica un bote.", "minicraft.achievement.bow": "¡Tiro al blanco!", "minicraft.achievement.bow.desc": "Dispara una flecha con un arco.", "minicraft.achievement.clothes": "¡Ten un día colorido!", - "minicraft.achievement.clothes.desc": "Fabrica ropa de algún color", + "minicraft.achievement.clothes.desc": "Fabrica ropa de cualquier color.", "minicraft.achievement.demolition": "¡La cosa está que explota!", "minicraft.achievement.demolition.desc": "Explota una dinamita.", "minicraft.achievement.doors": "Vistazo al Portazo", @@ -176,9 +187,11 @@ "minicraft.achievement.lowest_caves.desc": "Llega al nivel de cuevas más bajo.", "minicraft.achievement.obsidian_dungeon": "Los nobles y el hombre", "minicraft.achievement.obsidian_dungeon.desc": "Entra a la mazmorra de obsidiana.", + "minicraft.achievement.obsidianknight": "Rompiste su corazón", + "minicraft.achievement.obsidianknight.desc": "¡Derrota al Caballero Obsidiano y obtén su corazón!", "minicraft.achievement.planks": "¡Anda sobre las tablas!", "minicraft.achievement.planks.desc": "Fabrica tablas de madera.", - "minicraft.achievement.plant_seed": "¡Crece pequeña!", + "minicraft.achievement.plant_seed": "¡Crece, pequeña!", "minicraft.achievement.plant_seed.desc": "Planta una semilla de cualquier tipo y espera a que crezca.", "minicraft.achievement.skin": "La nueva moda", "minicraft.achievement.skin.desc": "Cambia de aspecto.", @@ -187,16 +200,16 @@ "minicraft.achievement.upgrade": "Edad de piedra", "minicraft.achievement.upgrade.desc": "Fabrica una herramienta de Piedra.", "minicraft.achievement.woodcutter": "Cortaleña", - "minicraft.achievement.woodcutter.desc": "Obtén Madera.", - "minicraft.control_guide.attack": "Usa %s para atacar enemigos o destruir objetos.", - "minicraft.control_guide.craft": "Usa %s para abrir tu menú de fabricación.", - "minicraft.control_guide.menu": "Usa %s para abrir tu inventario.", - "minicraft.control_guide.move": "Usa %s para moverte.", + "minicraft.achievement.woodcutter.desc": "Obtén madera.", + "minicraft.control_guide.attack": "%s: Atacar enemigos o destruir cosas", + "minicraft.control_guide.craft": "%s: Abrir menú de fabricación", + "minicraft.control_guide.menu": "%s: Abrir menú de inventario", + "minicraft.control_guide.move": "%s: Moverse", "minicraft.display.entries.boolean.false": "No", "minicraft.display.entries.boolean.true": "Sí", "minicraft.display.gui.link_opening": "Abriendo en navegador...", "minicraft.display.gui.perm_status.saving": "Guardando... %s%%", - "minicraft.display.gui.perm_status.sleep_cancel": "Presiona %s para cancelar", + "minicraft.display.gui.perm_status.sleep_cancel": "%s: Cancelar", "minicraft.display.gui.perm_status.sleeping": "Durmiendo...", "minicraft.display.gui.potion_effects.hide_hint": "(%s: Ocultar)", "minicraft.display.gui.potion_effects.potion_dur": "%s (%d:%02d)", @@ -206,13 +219,15 @@ "minicraft.display.options_display": "Ajustes", "minicraft.display.options_display.change_key_bindings": "Atajos de teclado", "minicraft.display.options_display.language": "Idioma", + "minicraft.display.options_display.popup.hwa_warning.content": "Al habilitar Aceleración de Hardware OpenGL eres susceptible a experimentar errores visuales. Confirma si quieres habilitarla.", + "minicraft.display.options_display.popup.hwa_warning.title": "Advertencia", "minicraft.display.options_display.resource_packs": "Lotes de recursos", "minicraft.display.popup.enter_confirm": "ENTER para confirmar", "minicraft.display.popup.escape_cancel": "ESC para cancelar", "minicraft.display.popup.title_confirm": "Confirmar acción", "minicraft.displays.achievements": "Logros", "minicraft.displays.achievements.display.achieved": "¡Logrado!", - "minicraft.displays.achievements.display.help": "Usa %s y %s para moverte.", + "minicraft.displays.achievements.display.help": "%s, %s: Moverse", "minicraft.displays.achievements.display.not_achieved": "No Logrado", "minicraft.displays.achievements.display.score": "Puntaje de logros: %s", "minicraft.displays.book.default_book": "Este libro no tiene texto.", @@ -235,8 +250,8 @@ "minicraft.displays.controls.display.controller.14": "Usa X para eliminar un objeto seleccionado en el inventario del modo creativo", "minicraft.displays.controls.display.controller.15": "Usa Y para eliminar un montón entero de objetos en el inventario del modo creativo", "minicraft.displays.controls.display.controller.desc.0": "Mapeos depuración inaccesibles", - "minicraft.displays.controls.display.controller.desc.1": "Mapeos detallados inusables", - "minicraft.displays.controls.display.help.0": "con %s/%s ves otros controles.", + "minicraft.displays.controls.display.controller.desc.1": "Mapeos detallados no usables", + "minicraft.displays.controls.display.help.0": "%s/%s: Ver controles de mando", "minicraft.displays.controls.display.keyboard": "Teclado", "minicraft.displays.controls.display.keyboard.00": "Mueve al jugador con MOVE-(DIRECCIÓN)", "minicraft.displays.controls.display.keyboard.01": "Mueve el cursor con CURSOR-(DIRECCIÓN)", @@ -260,24 +275,24 @@ "minicraft.displays.controls.display.keyboard.19": "Muestra información de la partida con INFO", "minicraft.displays.controls.display.keyboard.20": "Alterna pantalla completa con FULLSCREEN", "minicraft.displays.controls.display.keyboard.21": "Usa D para eliminar un objeto seleccionado en el inventario del modo creativo", - "minicraft.displays.controls.display.keyboard.22": "Usa MAYÚS-D para eliminar un montón entero de objetos en el inventario del modo creativo", + "minicraft.displays.controls.display.keyboard.22": "Usa SHIFT-D para eliminar un montón entero de objetos en el inventario del modo creativo", "minicraft.displays.controls.display.keyboard.desc": "Mapeos depuración no explicados", "minicraft.displays.crafting": "Fabricando", "minicraft.displays.crafting.container_title.cost": "Vale:", - "minicraft.displays.crafting.container_title.have": "Poseo:", - "minicraft.displays.end_game.display.bonuses": "", + "minicraft.displays.crafting.container_title.have": "Tengo:", + "minicraft.displays.end_game.display.bonuses": "", "minicraft.displays.end_game.display.final_score": "Puntaje final: %s", "minicraft.displays.end_game.display.player_score": "Puntaje del jugador: %s", "minicraft.displays.end_game.display.unlocked": "¡Desbloqueado! %s Tiempo Cronometro", - "minicraft.displays.end_game.exit": "Salir al menú principal", - "minicraft.displays.info.display.exit_help": "%s/%s:Salir", + "minicraft.displays.end_game.exit": "Salir al Menú principal", + "minicraft.displays.info.display.exit_help": "%s/%s: Salir", "minicraft.displays.info.display.score": "Puntaje actual: %s", "minicraft.displays.info.display.time": "Tiempo jugado: %s", - "minicraft.displays.info.title": "Datos Jugador", - "minicraft.displays.key_input.display.help.0": "Usa C/ENTER para cambiar atajos", - "minicraft.displays.key_input.display.help.1": "Con A añades un atajo", - "minicraft.displays.key_input.display.help.2": "MAYÚS-D reinicia todos los atajos", - "minicraft.displays.key_input.display.help.3": "%s para volver al menú principal", + "minicraft.displays.info.title": "Datos de Jugador", + "minicraft.displays.key_input.display.help.0": "C/ENTER: Cambiar atajo de teclado", + "minicraft.displays.key_input.display.help.1": "A: Añadir atajo de teclado", + "minicraft.displays.key_input.display.help.2": "SHIFT-D: Reiniciar atajos de teclado", + "minicraft.displays.key_input.display.help.3": "%s: Volver al menú principal", "minicraft.displays.key_input.popup_display.confirm_reset": "¿Estás seguro de reiniciar atajos de teclado a los predeterminados?", "minicraft.displays.key_input.popup_display.press_key_sequence": "Presiona la tecla que desees", "minicraft.displays.key_input.title": "Controles", @@ -292,23 +307,24 @@ "minicraft.displays.loading.message.saving": "Guardando", "minicraft.displays.loading.message.world": "Mundo", "minicraft.displays.loading.regeneration_cancellation_popup.display": "La carga del mundo fue cancelada", - "minicraft.displays.loading.regeneration_popup.display.0": "La mazmorra versión antigua (Piso B4) fue detectada.", + "minicraft.displays.loading.regeneration_popup.display.0": "La mazmorra de una versión antigua (Piso B4) fue detectada.", "minicraft.displays.loading.regeneration_popup.display.1": "Se necesita una regeneración.", "minicraft.displays.loading.regeneration_popup.display.2": "Los datos antiguos en ese piso serán eliminados:", - "minicraft.displays.loading.regeneration_popup.display.3": "%s para continuar", - "minicraft.displays.loading.regeneration_popup.display.4": "%s para cancelar la carga del mundo", + "minicraft.displays.loading.regeneration_popup.display.3": "%s: Continuar", + "minicraft.displays.loading.regeneration_popup.display.4": "%s: Cancelar carga del mundo", "minicraft.displays.options_main_menu": "Opciones Principales", "minicraft.displays.options_main_menu.resource_packs": "Lotes de recursos", "minicraft.displays.options_world": "Opciones de Mundo", "minicraft.displays.options_world.off_tutorials_confirm_popup": "¿Estás seguro de desactivar los tutoriales para siempre?", + "minicraft.displays.options_world.skip_current_tutorial": "Saltar tutorial actual", "minicraft.displays.options_world.turn_off_tutorials": "Desactivar tutoriales", "minicraft.displays.pause": "Pausado", "minicraft.displays.pause.display.exit_popup.0": "¿Estás seguro de salir de la partida?", "minicraft.displays.pause.display.exit_popup.1": "Todo el progreso no guardado se perderá", "minicraft.displays.pause.display.exit_popup.cancel": "Cancelar", "minicraft.displays.pause.display.exit_popup.quit": "Salir de todas formas", - "minicraft.displays.pause.display.help.choose": "%s: Seleccionar", - "minicraft.displays.pause.display.help.scroll": "%s y %s para desplazarse", + "minicraft.displays.pause.display.help.choose": "%s: Elegir", + "minicraft.displays.pause.display.help.scroll": "%s, %s: Desplazarse", "minicraft.displays.pause.menu": "Menú principal", "minicraft.displays.pause.return": "Reanudar", "minicraft.displays.pause.save": "Guardar partida", @@ -319,25 +335,35 @@ "minicraft.displays.player_death.save_quit": "Salir y guardar", "minicraft.displays.player_death.title": "¡Has muerto! ¡Auch!", "minicraft.displays.player_inv.container_title.items": "Objetos", - "minicraft.displays.player_inv.display.help": "(%s) para buscar.", + "minicraft.displays.player_inv.display.help": "(%s: Buscar)", "minicraft.displays.quests": "Misiones", "minicraft.displays.quests.display.header.completed": "Completas", "minicraft.displays.quests.display.header.unlocked": "Desbloqueadas", "minicraft.displays.quests.display.no_quest": "No se han desbloqueado misiones", "minicraft.displays.quests.display.no_quest_desc": "Sin misión", + "minicraft.displays.quests.quest_info.display.description": "Descripción: %s", + "minicraft.displays.quests.quest_info.display.ongoing_quests": "Misiones Empezadas: %s", + "minicraft.displays.quests.quest_info.display.progress": "Progreso: (%d/%d)", + "minicraft.displays.quests.quest_info.display.progress_uncompleted": "Sin completar", + "minicraft.displays.quests.quest_info.display.quests_completed_count": "Misiones completas: %d", + "minicraft.displays.quests.quest_info.display.status": "Estado: %s", + "minicraft.displays.quests.quest_info.display.status.completed": "Completado", + "minicraft.displays.quests.quest_info.display.status.locked": "Bloqueado", + "minicraft.displays.quests.quest_info.display.status.unlocked": "Desbloqueado", + "minicraft.displays.quests.quest_info.view_quests": "Ver misiones de esta serie", "minicraft.displays.resource_packs.display.help.keyboard_needed": "Solo se acepta teclado.", - "minicraft.displays.resource_packs.display.help.move": "Usa %s y %s para mover.", - "minicraft.displays.resource_packs.display.help.position": "MAYÚS-[FLECHAS] para mover lotes. ", - "minicraft.displays.resource_packs.display.help.select": "%s para examinar.", + "minicraft.displays.resource_packs.display.help.move": "%s, %s: Moverse", + "minicraft.displays.resource_packs.display.help.position": "SHIFT-[FLECHAS]: Mover lotes", + "minicraft.displays.resource_packs.display.help.select": "%s: Examinar", "minicraft.displays.resource_packs.display.title": "Lotes de recursos", "minicraft.displays.skin": "Aspectos", - "minicraft.displays.skin.display.help.move": "Usa %s y %s para moverte.", - "minicraft.displays.skin.display.help.select": "%s seleccionar, y %s cancelar.", + "minicraft.displays.skin.display.help.move": "%s, %s: Moverse", + "minicraft.displays.skin.display.help.select": "%s: Seleccionar, %s: Cancelar", "minicraft.displays.title.display.cannot_check": "No pudo buscar actualizaciones.", "minicraft.displays.title.display.checking": "Buscando actualizaciones...", - "minicraft.displays.title.display.help.0": "(%s, %s para seleccionar)", - "minicraft.displays.title.display.help.1": "(%s para aceptar)", - "minicraft.displays.title.display.help.2": "(%s para volver)", + "minicraft.displays.title.display.help.0": "(%s, %s: Seleccionar)", + "minicraft.displays.title.display.help.1": "(%s: Aceptar)", + "minicraft.displays.title.display.help.2": "(%s: Volver)", "minicraft.displays.title.display.latest_already": "Tienes la última versión.", "minicraft.displays.title.display.new_version": "Nueva: %s", "minicraft.displays.title.display.version": "Versión %s", @@ -351,30 +377,30 @@ "minicraft.displays.title.play.load_world": "Cargar Mundo", "minicraft.displays.title.play.new_world": "Crear Mundo", "minicraft.displays.title.quit": "Salir", - "minicraft.displays.title.select_to_download": "--Descárgala Acá--", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Con %s examinas los detalles del tutorial actual.", + "minicraft.displays.title.select_to_download": "--Descárgala aquí--", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Examina los detalles del tutorial actual con %s.", "minicraft.displays.world_gen.create_world": "Crear Mundo", - "minicraft.displays.world_gen.enter_world": "Nombre del mundo", + "minicraft.displays.world_gen.enter_world": "Nombre del Mundo", "minicraft.displays.world_gen.title": "Opciones de Mundo", "minicraft.displays.world_gen.troublesome_input": "¿Problemas con el nombre?", - "minicraft.displays.world_gen.troublesome_input.msg": "Parece que has puesto letras como atajos de mover el cursor en vertical, lo cual puede molestar . Esto se puede cambiar en el menú atajos de teclado como las teclas \"cursor-XXX\". Por ahora, para escribir una letra en vez de mover el cursor, mantén MAYÚS apretado al escribir.", + "minicraft.displays.world_gen.troublesome_input.msg": "Parece que has puesto letras como atajos de mover el cursor en vertical, lo cual puede molestar. Esto se puede cambiar en el menú atajos de teclado como las teclas \"cursor-XXX\". Por ahora, para escribir una letra en vez de mover el cursor, mantén SHIFT apretado al escribir.", "minicraft.displays.world_gen.world_seed": "Semilla", - "minicraft.displays.world_select.display.help.0": "%s para confirmar", - "minicraft.displays.world_select.display.help.1": "%s para volver", - "minicraft.displays.world_select.display.help.2": "SHIFT-C para copiar", - "minicraft.displays.world_select.display.help.3": "SHIFT-R para renombrar", - "minicraft.displays.world_select.display.help.4": "SHIFT-D para eliminar", + "minicraft.displays.world_select.display.help.0": "%s: Confirmar", + "minicraft.displays.world_select.display.help.1": "%s: Volver", + "minicraft.displays.world_select.display.help.2": "%s: Copiar mundo", + "minicraft.displays.world_select.display.help.3": "%s: Renombrar mundo", + "minicraft.displays.world_select.display.help.4": "%s: Eliminar mundo", "minicraft.displays.world_select.display.world_too_new": "¡No se puede cargar el mundo, versión mayor!", - "minicraft.displays.world_select.display.world_version": "Versión del mundo: %s", - "minicraft.displays.world_select.popups.display.cancel": "%s para cancelar", - "minicraft.displays.world_select.popups.display.change": "Nuevo nombre:", - "minicraft.displays.world_select.popups.display.confirm": "%s para confirmar", + "minicraft.displays.world_select.display.world_version": "Versión del Mundo: %s", + "minicraft.displays.world_select.popups.display.cancel": "%s: Cancelar", + "minicraft.displays.world_select.popups.display.change": "Nuevo Nombre:", + "minicraft.displays.world_select.popups.display.confirm": "%s: Confirmar", "minicraft.displays.world_select.popups.display.delete": "¿Estás seguro de querer eliminar \n%s\"%s\"%s?\n¡Esto no se puede deshacer!", - "minicraft.displays.world_select.select_world": "Seleccionar mundo", + "minicraft.displays.world_select.select_world": "Seleccionar Mundo", "minicraft.notification.achievement_unlocked": "Logro desbloqueado: %s", - "minicraft.notification.air_wizard_defeated": "¡Mago aéreo derrotado!", + "minicraft.notification.air_wizard_defeated": "Mago Aéreo: ¡Derrotado!", "minicraft.notification.boss_limit": "Ya no se pueden invocar más jefes", - "minicraft.notification.cannot_sleep": "¡No puedes dormir! ¡Quedan %s Min y %s Seg!", + "minicraft.notification.cannot_sleep": "¡No puedes dormir! ¡Espera %s :%s !", "minicraft.notification.death_chest_retrieved": "¡Cofre de recuperación obtenido!", "minicraft.notification.defeat_air_wizard_first": "El mago aéreo debe ser derrotado primero.", "minicraft.notification.defeat_obsidian_knight_first": "El Caballero Obsidiano debe ser derrotado primero.", @@ -388,22 +414,23 @@ "minicraft.notification.quest_completed": "Misión completada", "minicraft.notification.quest_unlocked": "Misión desbloqueada", "minicraft.notification.spawn_on_boss_tile": "Solo se puede invocar en la Sala de Combate", + "minicraft.notification.tutorials_completed": "Has completado los tutoriales.", "minicraft.notification.world_saved": "¡Mundo guardado!", "minicraft.notification.wrong_level_dungeon": "Solo se puede invocar en la mazmorra", "minicraft.notification.wrong_level_sky": "Solo se puede invocar en el cielo", - "minicraft.notifications.statue_tapped": "Hay susurros farfullurros...", - "minicraft.notifications.statue_touched": "La estatua vibra con calibra...", + "minicraft.notifications.statue_tapped": "Los susurros hacen eco...", + "minicraft.notifications.statue_touched": "La estatua oyes vibrar...", "minicraft.quest.farming": "Agricultor", "minicraft.quest.farming.crafting_hoe": "Fabrica una azada", "minicraft.quest.farming.crafting_hoe.description": "Fabrica cualquier azada en una mesa de trabajo", "minicraft.quest.farming.description": "Lo básico de un agricultor.", - "minicraft.quest.farming.getting_wheat": "Sembradío de Trigo", + "minicraft.quest.farming.getting_wheat": "Sembradío de trigo", "minicraft.quest.farming.getting_wheat.description": "Recoge trigo rompiendo una siembra de trigo ya crecida.", - "minicraft.quest.farming.making_farmland": "Cultivo Activo", + "minicraft.quest.farming.making_farmland": "Cultivo activo", "minicraft.quest.farming.making_farmland.description": "Haz tierra fértil interactuando con una azada a un trozo de tierra.", "minicraft.quest.farming.planting_potato": "Plantando patatas", "minicraft.quest.farming.planting_potato.description": "Planta una patata poniendo una patata en tierra fértil", - "minicraft.quest.farming.planting_wheat": "Plantando Trigo", + "minicraft.quest.farming.planting_wheat": "Plantando trigo", "minicraft.quest.farming.planting_wheat.description": "Planta trigo poniendo semillas de trigo en tierra fértil.", "minicraft.quest.gems": "Llévame a la Gema", "minicraft.quest.gems.description": "Preparando equipamiento de gema.", @@ -413,7 +440,7 @@ "minicraft.quest.gems.gem_claymore.description": "Obtén claymore de gema.", "minicraft.quest.iron_equipments": "Herrero Nuevo", "minicraft.quest.iron_equipments.description": "Obtén todo el equipamiento de hierro.", - "minicraft.quest.iron_equipments.getting_more_iron": "Me Sobra el Hierro", + "minicraft.quest.iron_equipments.getting_more_iron": "Me sobra el hierro", "minicraft.quest.iron_equipments.getting_more_iron.description": "Obtén aún más hierro.", "minicraft.quest.iron_equipments.iron_armor": "Mejora de armadura", "minicraft.quest.iron_equipments.iron_armor.description": "Mejora tu armadura a hierro.", @@ -434,33 +461,37 @@ "minicraft.settings.difficulty.easy": "Fácil", "minicraft.settings.difficulty.hard": "Difícil", "minicraft.settings.difficulty.normal": "Normal", - "minicraft.settings.fps": "FPS máximos", - "minicraft.settings.mode": "Modo de juego", + "minicraft.settings.fps": "FPS Máx.", + "minicraft.settings.mode": "Modo de Juego", "minicraft.settings.mode.creative": "Creativo", "minicraft.settings.mode.hardcore": "Extremo", "minicraft.settings.mode.score": "Puntaje", "minicraft.settings.mode.survival": "Supervivencia", + "minicraft.settings.opengl_hwa": "Acelerac. de Hardware OpenGL", + "minicraft.settings.quests": "Misiones", "minicraft.settings.scoretime": "Cronometro (Modo Puntaje)", - "minicraft.settings.screenshot_scale": "Gama captura pantalla", - "minicraft.settings.size": "Tamaño del mundo", + "minicraft.settings.screenshot_scale": "Gama de Capturas", + "minicraft.settings.show_quests": "Panel de Misiones", + "minicraft.settings.size": "Tamaño del Mundo", "minicraft.settings.sound": "Sonido", - "minicraft.settings.theme": "Tema del mundo", + "minicraft.settings.theme": "Tema del Mundo", "minicraft.settings.theme.desert": "Desierto", "minicraft.settings.theme.forest": "Arboleda", "minicraft.settings.theme.hell": "Magma", "minicraft.settings.theme.normal": "Normal", "minicraft.settings.theme.plain": "Plano", - "minicraft.settings.type": "Tipo de terreno", + "minicraft.settings.tutorials": "Tutoriales", + "minicraft.settings.type": "Tipo de Terreno", "minicraft.settings.type.box": "Caja", "minicraft.settings.type.irregular": "Irregular", "minicraft.settings.type.island": "Isla", "minicraft.settings.type.mountain": "Montaña", - "minicraft.skin.minecraft_alex": "Mujer conocida", - "minicraft.skin.minecraft_steve": "Hombre conocido", + "minicraft.skin.minecraft_alex": "Chica conocida", + "minicraft.skin.minecraft_steve": "Chico conocido", "minicraft.skin.paul": "Paul", "minicraft.skin.paul_cape": "Paul con capa", "minicraft.text_particales.key_consumed": "-1 Llave", - "minicraft.tutorial.getting_rocks": "Rocas y Carbón", + "minicraft.tutorial.getting_rocks": "Rocas y carbón", "minicraft.tutorial.getting_rocks.description": "Obtén al menos 5 de piedra y 5 de carbón destruyendo rocas con el pico fabricado.", "minicraft.tutorial.getting_wood": "Mucha más madera", "minicraft.tutorial.getting_wood.description": "Obtén al menos 10 de madera de los árboles.", @@ -468,6 +499,6 @@ "minicraft.tutorial.getting_wooden_pickaxe.description": "Fabrica un pico de madera en el menú de fabricación de la mesa de trabajo.", "minicraft.tutorial.getting_workbench": "La útil mesa de trabajo", "minicraft.tutorial.getting_workbench.description": "Fabrica una mesa de trabajo en el menú de fabricación. Luego colócala.", - "minicraft.tutorial.start_getting_wood": "Donde Todo Comienza", - "minicraft.tutorial.start_getting_wood.description": "Ataca Arboles continuamente para obtener madera." + "minicraft.tutorial.start_getting_wood": "Donde todo comienza", + "minicraft.tutorial.start_getting_wood.description": "Ataca árboles continuamente para obtener madera." } diff --git a/src/client/resources/assets/localization/nl-nl.json b/src/client/resources/assets/localization/nl-nl.json index b4d2c537c..bad9e5bf7 100644 --- a/src/client/resources/assets/localization/nl-nl.json +++ b/src/client/resources/assets/localization/nl-nl.json @@ -52,7 +52,6 @@ "Grass Seeds": "Gras Zaden", "Green Clothes": "Groene Kleren", "Green Wool": "Groen Wol", - "GunPowder": "Buskruit", "Gunpowder": "Buskruit", "Hard Rock": "Hard Steen", "Haste Potion": "Haast Drank", diff --git a/src/client/resources/assets/localization/pl-pl.json b/src/client/resources/assets/localization/pl-pl.json index ca68888b7..dadf07806 100644 --- a/src/client/resources/assets/localization/pl-pl.json +++ b/src/client/resources/assets/localization/pl-pl.json @@ -42,7 +42,6 @@ "Grass Seeds": "Nasiona trawy", "Green Clothes": "Zielone ubranie", "Green Wool": "Zielona wełna", - "GunPowder": "Proch", "Gunpowder": "Proch", "Hard Rock": "Twarda skała", "Haste Potion": "Mikstura pośpiechu", diff --git a/src/client/resources/assets/localization/ru-ru.json b/src/client/resources/assets/localization/ru-ru.json index d567600ba..e4188b03f 100644 --- a/src/client/resources/assets/localization/ru-ru.json +++ b/src/client/resources/assets/localization/ru-ru.json @@ -4,7 +4,8 @@ "Antidious": "Антидия (английский)", "Anvil": "Наковальня", "Apple": "Яблоко", - "Arrow": "Стрелка", + "Arrow": "Стрела", + "Awkward Potion": "Странное зелье", "Axe": "Топор", "Baked Potato": "Печёный картофель", "Bed": "Кровать", @@ -32,6 +33,7 @@ "Cyan Clothes": "Голубая одежда", "Death Chest": "Сундук смерти", "Dirt": "Земля", + "Dungeon Chest": "Сундук подземелья", "Empty Bucket": "Пустое ведро", "Enchanter": "Алтарь", "Energy Potion": "Зелье энергии", @@ -41,10 +43,11 @@ "Flower": "Цветок", "Furnace": "Печь", "Gem": "Самоцвет", - "Gem Armor": "Самоцветовая броня", + "Gem Armor": "Самоцветная броня", "Gem Fishing Rod": "Самоцветовая удочка", "Gem Ore": "Самоцветная руда", "Glass": "Стекло", + "Glass Bottle": "Стеклянный пузырёк", "Gold": "Золотой слиток", "Gold Apple": "Золотое яблоко", "Gold Armor": "Золотая броня", @@ -84,11 +87,15 @@ "Obsidian": "Обсидиан", "Obsidian Brick": "Обсидиановый кирпич", "Obsidian Door": "Обсидиановая дверь", + "Obsidian Fence": "Обсидиановый забор", + "Obsidian Heart": "Обсидиановое сердце", + "Obsidian Poppet": "Обсидиановая кукла", "Obsidian Wall": "Обсидиановая стена", "Orange Clothes": "Оранжевая одежда", "Ornate Obsidian": "Резной обсидиан", "Ornate Stone": "Резной камень", "Oven": "Духовка", + "Path": "Путь", "Pickaxe": "Кирка", "Pig Spawner": "Призыватель свиней", "Plank": "Доска", @@ -105,7 +112,7 @@ "Raw Pork": "Сырая свинина", "Red Clothes": "Красная одежда", "Red Wool": "Красная шерсть", - "Reg Clothes": "Поношенная одежда", + "Reg Clothes": "Обычная одежда", "Regen Potion": "Зелье регенерации", "Rock": "Камень", "Rose": "Роза", @@ -130,8 +137,9 @@ "Stone Brick": "Каменный кирпич", "Stone Bricks": "Каменные кирпичи", "Stone Door": "Каменная дверь", + "Stone Fence": "Каменный забор", "Stone Wall": "Каменная стена", - "String": "Строка", + "String": "Нить", "Swim Potion": "Зелье плавучести", "Sword": "Меч", "Time Potion": "Зелье времени", @@ -144,8 +152,9 @@ "Water Bucket": "Ведро воды", "Wheat": "Пшеница", "Wheat Seeds": "Семена пшеницы", - "Wood": "Дерево", + "Wood": "Древесина", "Wood Door": "Деревянная дверь", + "Wood Fence": "Деревянный забор", "Wood Fishing Rod": "Деревянная удочка", "Wood Planks": "Деревянные доски", "Wood Wall": "Деревянная стена", @@ -158,11 +167,13 @@ "minicraft.achievement.airwizard.desc": "Победите первого Небесного колдуна!", "minicraft.achievement.benchmarking": "Верстачество", "minicraft.achievement.benchmarking.desc": "Создайте верстак.", + "minicraft.achievement.boat": "Лодочные права", + "minicraft.achievement.boat.desc": "Смастерите лодку.", "minicraft.achievement.bow": "Стрелок!", "minicraft.achievement.bow.desc": "Выстрелить из лука.", "minicraft.achievement.clothes": "Красочного вам дня!", "minicraft.achievement.clothes.desc": "Создайте одежду любого цвета.", - "minicraft.achievement.demolition": "Демонстрация разрушения", + "minicraft.achievement.demolition": "Демонстрация Разрушения", "minicraft.achievement.demolition.desc": "Используйте взрывчатку.", "minicraft.achievement.doors": "Дверная защита", "minicraft.achievement.doors.desc": "Создайте деревянную дверь.", @@ -176,8 +187,12 @@ "minicraft.achievement.lowest_caves.desc": "Достигните самого нижнего уровня пещер.", "minicraft.achievement.obsidian_dungeon": "О рыцарях и людях", "minicraft.achievement.obsidian_dungeon.desc": "Попадите в обсидиановое подземелье.", + "minicraft.achievement.obsidianknight": "Разбитое Пылающее Сердце", + "minicraft.achievement.obsidianknight.desc": "Победи Обсидианового Рыцаря и заполучи его сердце!", "minicraft.achievement.planks": "Пройдись по доскам!", "minicraft.achievement.planks.desc": "Создайте деревянные доски.", + "minicraft.achievement.plant_seed": "Поле чудес", + "minicraft.achievement.plant_seed.desc": "Посадите семечко и наблюдайте как оно растёт.", "minicraft.achievement.skin": "Модный приговор", "minicraft.achievement.skin.desc": "Измените свой прикид.", "minicraft.achievement.survive_darkness": "Боишься темноты?", @@ -185,7 +200,7 @@ "minicraft.achievement.upgrade": "Обновка!", "minicraft.achievement.upgrade.desc": "Создайте любой каменный инструмент.", "minicraft.achievement.woodcutter": "Лесоруб", - "minicraft.achievement.woodcutter.desc": "Добыть древесину.", + "minicraft.achievement.woodcutter.desc": "Добудьте древесину.", "minicraft.control_guide.attack": "Используйте %s, чтобы атаковать мобов или разрушать блоки.", "minicraft.control_guide.craft": "Используйте %s, чтобы открыть Меню создания.", "minicraft.control_guide.menu": "Используйте %s, чтобы открыть Меню инвентаря.", @@ -299,6 +314,7 @@ "minicraft.displays.options_main_menu.resource_packs": "Пакеты ресурсов", "minicraft.displays.options_world": "Настройки мира", "minicraft.displays.options_world.off_tutorials_confirm_popup": "Вы уверены, что хотите навсегда выключить обучение?", + "minicraft.displays.options_world.skip_current_tutorial": "Пропустить текущее обучение", "minicraft.displays.options_world.turn_off_tutorials": "Выключить обучение", "minicraft.displays.pause": "Пауза", "minicraft.displays.pause.display.exit_popup.0": "Вы уверены, что хотите выйти из игры?", @@ -323,6 +339,16 @@ "minicraft.displays.quests.display.header.unlocked": "Открыто", "minicraft.displays.quests.display.no_quest": "Нет открытых заданий", "minicraft.displays.quests.display.no_quest_desc": "Нет задания", + "minicraft.displays.quests.quest_info.display.description": "Описание: %s", + "minicraft.displays.quests.quest_info.display.ongoing_quests": "Текущие задания: %s", + "minicraft.displays.quests.quest_info.display.progress": "Прогресс: (%d/%d)", + "minicraft.displays.quests.quest_info.display.progress_uncompleted": "Не завершено", + "minicraft.displays.quests.quest_info.display.quests_completed_count": "Завершённые задания: %d", + "minicraft.displays.quests.quest_info.display.status": "Статус: %s", + "minicraft.displays.quests.quest_info.display.status.completed": "Завершено", + "minicraft.displays.quests.quest_info.display.status.locked": "Закрыто", + "minicraft.displays.quests.quest_info.display.status.unlocked": "Разблокировано", + "minicraft.displays.quests.quest_info.view_quests": "Посмотреть все задания этой серии", "minicraft.displays.resource_packs.display.help.keyboard_needed": "Доступен только ввод с клавиатуры.", "minicraft.displays.resource_packs.display.help.move": "Используйте %s и %s для навигации.", "minicraft.displays.resource_packs.display.help.position": "SHIFT-[LEFT|RIGHT|UP|DOWN] чтобы двигать пакеты. ", @@ -350,7 +376,7 @@ "minicraft.displays.title.play.new_world": "Создать мир", "minicraft.displays.title.quit": "Выйти", "minicraft.displays.title.select_to_download": "--Выберите это, чтобы скачать--", - "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Нажмите %s, чтобы узнать подробности текущего туторила.", + "minicraft.displays.tutorial_display_handler.display.element_examine_help": "Нажмите %s, чтобы узнать подробности текущего обучения.", "minicraft.displays.world_gen.create_world": "Создать мир", "minicraft.displays.world_gen.enter_world": "Название мира", "minicraft.displays.world_gen.title": "Настройки генератора", @@ -359,9 +385,9 @@ "minicraft.displays.world_gen.world_seed": "Ключ генерации", "minicraft.displays.world_select.display.help.0": "%s чтобы подтвердить", "minicraft.displays.world_select.display.help.1": "%s чтобы вернутся", - "minicraft.displays.world_select.display.help.2": "SHIFT-C чтобы скопировать", - "minicraft.displays.world_select.display.help.3": "SHIFT-R чтобы переименовать", - "minicraft.displays.world_select.display.help.4": "SHIFT-D чтобы удалить", + "minicraft.displays.world_select.display.help.2": "%s чтобы скопировать", + "minicraft.displays.world_select.display.help.3": "%s чтобы переименовать", + "minicraft.displays.world_select.display.help.4": "%s чтобы удалить", "minicraft.displays.world_select.display.world_too_new": "Более новая версия, невозможно загрузить!", "minicraft.displays.world_select.display.world_version": "Версия мира: %s", "minicraft.displays.world_select.popups.display.cancel": "%s для отмены", @@ -378,13 +404,15 @@ "minicraft.notification.defeat_obsidian_knight_first": "Сначала необходимо победить Обсидианового Рыцаря.", "minicraft.notification.dig_hole": "Сначала выкопайте яму!", "minicraft.notification.dungeon_opened": "Темница теперь открыта!", - "minicraft.notification.gem_pickaxe_required": "Нужна самоцветовая кирка.", + "minicraft.notification.gem_pickaxe_required": "Нужна самоцветная кирка.", "minicraft.notification.invalid_placement": "Это можно разместить только на %s!", + "minicraft.notification.knight_statue_exists": "Статуя рыцаря существует", "minicraft.notification.obsidian_knight_awoken": "Обсидиановый Рыцарь был пробужден!", "minicraft.notification.obsidian_knight_defeated": "Обсидиановый Рыцарь: Повержен!", "minicraft.notification.quest_completed": "Задание выполнено", "minicraft.notification.quest_unlocked": "Задание открыто", "minicraft.notification.spawn_on_boss_tile": "Может быть призван только в Комнате Босса", + "minicraft.notification.tutorials_completed": "Обучения завершены.", "minicraft.notification.world_saved": "Мир сохранён!", "minicraft.notification.wrong_level_dungeon": "Может быть призван только на этаже темницы", "minicraft.notification.wrong_level_sky": "Можно призвать только на небесах", @@ -403,26 +431,26 @@ "minicraft.quest.farming.planting_wheat": "Посев пшеницы", "minicraft.quest.farming.planting_wheat.description": "Посев пшеницы путём рассыпания её семян на вспаханную землю.", "minicraft.quest.gems": "Дорога самоцветов", - "minicraft.quest.gems.description": "Получение самоцветовой экипировки.", + "minicraft.quest.gems.description": "Получение самоцветной экипировки.", "minicraft.quest.gems.gem_armor": "Мастер защиты", - "minicraft.quest.gems.gem_armor.description": "Получение самоцветовой брони.", + "minicraft.quest.gems.gem_armor.description": "Получение самоцветной брони.", "minicraft.quest.gems.gem_claymore": "Мастер оружия", - "minicraft.quest.gems.gem_claymore.description": "Получение самоцветового клеймора.", + "minicraft.quest.gems.gem_claymore.description": "Получение самоцветного клеймора.", "minicraft.quest.iron_equipments": "Мастер железа", "minicraft.quest.iron_equipments.description": "Получение всей железной экипировки.", "minicraft.quest.iron_equipments.getting_more_iron": "Железный магнат", "minicraft.quest.iron_equipments.getting_more_iron.description": "Ещё больше железа.", "minicraft.quest.iron_equipments.iron_armor": "Улучшение брони", "minicraft.quest.iron_equipments.iron_armor.description": "Улучшение вашей брони до железной.", - "minicraft.quest.iron_equipments.iron_tools": "Улучшение инструментов", - "minicraft.quest.iron_equipments.iron_tools.description": "Улучшение всех ваших инструментов до железных", + "minicraft.quest.iron_equipments.iron_tools": "Улучшение всех инструментов", + "minicraft.quest.iron_equipments.iron_tools.description": "Улучшение ваших инструментов до железных.", "minicraft.quest.iron_equipments.upgrading_pickaxe": "Улучшенная кирка", "minicraft.quest.iron_equipments.upgrading_pickaxe.description": "Улучшение вашей кирки.", "minicraft.quest.potions": "Зельевар", - "minicraft.quest.potions.all_potions_prepared": "Изучение зелий", - "minicraft.quest.potions.all_potions_prepared.description": "Получение всех зелий одномоментно.", - "minicraft.quest.potions.awkward_potions": "Пустое зелье", - "minicraft.quest.potions.awkward_potions.description": "Получение пустого зелья", + "minicraft.quest.potions.all_potions_prepared": "Изучатель зелий", + "minicraft.quest.potions.all_potions_prepared.description": "Получение всех зелий одновременно.", + "minicraft.quest.potions.awkward_potions": "Странное зелье", + "minicraft.quest.potions.awkward_potions.description": "Получение странного зелья", "minicraft.quest.potions.description": "Получение зелий.", "minicraft.quest.potions.powerful_potions": "Мощные Зелья", "minicraft.quest.potions.powerful_potions.description": "Получение полезных и мощных зелий.", @@ -437,8 +465,10 @@ "minicraft.settings.mode.hardcore": "Хардкор", "minicraft.settings.mode.score": "Счёт", "minicraft.settings.mode.survival": "Выживание", + "minicraft.settings.quests": "Задания", "minicraft.settings.scoretime": "Время (Режим счёта)", - "minicraft.settings.screenshot_scale": "Мастштаб скриншота", + "minicraft.settings.screenshot_scale": "Масштаб скриншота", + "minicraft.settings.show_quests": "Панель заданий", "minicraft.settings.size": "Размер мира", "minicraft.settings.sound": "Звук", "minicraft.settings.theme": "Тип мира", @@ -447,6 +477,7 @@ "minicraft.settings.theme.hell": "Ад", "minicraft.settings.theme.normal": "Обычный", "minicraft.settings.theme.plain": "Плоский", + "minicraft.settings.tutorials": "Обучения", "minicraft.settings.type": "Тип ландшафта", "minicraft.settings.type.box": "Коробка", "minicraft.settings.type.irregular": "Неравномерный", @@ -460,11 +491,11 @@ "minicraft.tutorial.getting_rocks": "Получение камня и угля", "minicraft.tutorial.getting_rocks.description": "Получение как минимум 5 камней и 5 углей путём разрушения скал при помощи кирки.", "minicraft.tutorial.getting_wood": "Больше дерева", - "minicraft.tutorial.getting_wood.description": "Получение как минимум 10 древесины из деревев.", + "minicraft.tutorial.getting_wood.description": "Получение как минимум 10 древесины из деревьев.", "minicraft.tutorial.getting_wooden_pickaxe": "Получение деревянной кирки", "minicraft.tutorial.getting_wooden_pickaxe.description": "Создание деревянной кирки в меню создания на верстаке.", "minicraft.tutorial.getting_workbench": "Получение верстака", - "minicraft.tutorial.getting_workbench.description": "Создание верстака в меню создание и размещение его.", + "minicraft.tutorial.getting_workbench.description": "Создание верстака в меню создания и размещение его.", "minicraft.tutorial.start_getting_wood": "Начало Начал", "minicraft.tutorial.start_getting_wood.description": "Продолжительно атаковать деревья для получения древесины." } diff --git a/src/client/resources/assets/localization/uk-ua.json b/src/client/resources/assets/localization/uk-ua.json index 6b1502b62..7ee9a6d8c 100644 --- a/src/client/resources/assets/localization/uk-ua.json +++ b/src/client/resources/assets/localization/uk-ua.json @@ -52,7 +52,6 @@ "Grass Seeds": "Зерно трави", "Green Clothes": "Зелений одяг", "Green Wool": "Зелена шерсть", - "GunPowder": "Порох", "Gunpowder": "Порох", "Hard Rock": "Міцний камінь", "Haste Potion": "Зілля поспіху", From 0992b4311345e46b9743bdd720f618fd9c2717b9 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:18:22 +0800 Subject: [PATCH 260/261] Update inventory counter design --- .../minicraft/screen/ContainerDisplay.java | 194 +++++++++++++++++- .../minicraft/screen/PlayerInvDisplay.java | 133 +++++++++++- .../resources/assets/localization/en-us.json | 1 - .../assets/textures/gui/inventory_counter.png | Bin 0 -> 417 bytes 4 files changed, 313 insertions(+), 15 deletions(-) create mode 100644 src/client/resources/assets/textures/gui/inventory_counter.png diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index 370d36070..d9fd45e48 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -2,6 +2,7 @@ import com.studiohartman.jamepad.ControllerButton; import minicraft.core.Game; +import minicraft.core.Renderer; import minicraft.core.io.InputHandler; import minicraft.core.io.Localization; import minicraft.entity.ItemHolder; @@ -9,8 +10,10 @@ import minicraft.entity.mob.Player; import minicraft.gfx.Color; import minicraft.gfx.Font; +import minicraft.gfx.MinicraftImage; import minicraft.gfx.Rectangle; import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker; import minicraft.item.Inventory; import minicraft.item.Item; import minicraft.item.StackableItem; @@ -19,6 +22,9 @@ public class ContainerDisplay extends Display { private static final int padding = 10; + private final MinicraftImage counterSheet = + Renderer.spriteLinker.getSheet(SpriteLinker.SpriteType.Gui, "inventory_counter"); + private Player player; private Chest chest; @@ -73,16 +79,186 @@ public void render(Screen screen) { onScreenKeyboardMenu.render(screen); } - String counterLeft = Localization.getLocalized("minicraft.display.menus.inventory.counter", - player.getInventory().invSize(), player.getInventory().getMaxSlots()); - Rectangle boundsLeft = menus[0].getBounds(); - Font.drawBackground(counterLeft, screen, boundsLeft.getRight() - counterLeft.length() * 8, - boundsLeft.getTop() - 8, Color.GRAY); + // It would be better if this could be made into InventoryMenu, but not possible at the moment. + if (selection == 0) { + // LHS is focused + Rectangle boundsLeft = menus[0].getBounds(); + int sizeLeft = player.getInventory().invSize(); + int capLeft = player.getInventory().getMaxSlots(); + // Expanded counter + if (sizeLeft < 10) { // At the moment at most just 2 digits and always 2 digits for capacity (no worry yet) + // Background + screen.render(boundsLeft.getRight() + 2 - (23 - 5), boundsLeft.getTop() - 2, + 12, 12, 3, 13, counterSheet); + // Skips the middle part as that is for more digits + screen.render(boundsLeft.getRight() + 2 - 15, boundsLeft.getTop() - 2, + 20, 12, 15, 13, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 16, boundsLeft.getTop(), + 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, + 0, 4, 5, capLeft, Color.GRAY); + } else { + // Background + screen.render(boundsLeft.getRight() + 2 - 23, boundsLeft.getTop() - 2, + 12, 12, 23, 13, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 21, boundsLeft.getTop(), + 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, + 0, 4, 5, capLeft, Color.GRAY); + } + + // RHS is not focused + Rectangle boundsRight = menus[1].getBounds(); + int sizeRight = chest.getInventory().invSize(); + int capRight = chest.getInventory().getMaxSlots(); + // Minimized counter + if (sizeRight < 10) { // no worry yet, really + // Background + screen.render(boundsRight.getLeft() + 4, boundsRight.getTop() - 1, + 0, 12, 4, 9, counterSheet); + // Skips the middle part as that is for more digits + screen.render(boundsRight.getLeft() + 8, boundsRight.getTop() - 1, + 8, 12, 4, 9, counterSheet); + + // Digits + renderCounterNumber(screen, boundsRight.getLeft() + 4 + 2, boundsRight.getTop() + 1, + 0, 4, 5, sizeRight, fadeColor(colorByHeaviness(calculateHeaviness(sizeRight, capRight), false))); + } else { + // Background + screen.render(boundsRight.getLeft() + 4, boundsRight.getTop() - 1, + 0, 12, 12, 9, counterSheet); + + // Digits + renderCounterNumber(screen, boundsRight.getLeft() + 4 + 2, boundsRight.getTop() + 1, + 0, 4, 5, sizeRight, fadeColor(colorByHeaviness(calculateHeaviness(sizeRight, capRight), false))); + } + } else { // assert selection == 1 + // LHS is not focused + Rectangle boundsLeft = menus[0].getBounds(); + int sizeLeft = player.getInventory().invSize(); + int capLeft = player.getInventory().getMaxSlots(); + // Minimized counter + if (sizeLeft < 10) { + // Background + screen.render(boundsLeft.getRight() - 4 - 8, boundsLeft.getTop() - 1, + 0, 12, 4, 9, counterSheet); + // Skips the middle part as that is for more digits + screen.render(boundsLeft.getRight() - 4 - 4, boundsLeft.getTop() - 1, + 8, 12, 4, 9, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() - 4 - 6, boundsLeft.getTop() + 1, + 0, 4, 5, sizeLeft, fadeColor(colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), false))); + } else { + // Background + screen.render(boundsLeft.getRight() - 4 - 12, boundsLeft.getTop() - 1, + 0, 12, 12, 9, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() - 4 - 11, boundsLeft.getTop() + 1, + 0, 4, 5, sizeLeft, fadeColor(colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), false))); + } + + // RHS is focused + Rectangle boundsRight = menus[1].getBounds(); + int sizeRight = chest.getInventory().invSize(); + int capRight = chest.getInventory().getMaxSlots(); + // Expanded counter (background horizontally mirrored) + if (sizeRight < 10) { + // Background + screen.render(boundsRight.getLeft() - 2 + (20 - 5), boundsRight.getTop() - 2, + 12, 12, 3, 13, counterSheet, 1); + // Skips the middle part as that is for more digits + screen.render(boundsRight.getLeft() - 2, boundsRight.getTop() - 2, + 20, 12, 15, 13, counterSheet, 1); + + // Digits + renderCounterNumber(screen, boundsRight.getLeft() - 2 + 11, boundsRight.getTop(), + 5, 5, 7, sizeRight, colorByHeaviness(calculateHeaviness(sizeRight, capRight), true)); + renderCounterNumber(screen, boundsRight.getLeft(), boundsRight.getTop() + 3, + 0, 4, 5, capRight, Color.GRAY); + } else { + // Background + screen.render(boundsRight.getLeft() - 2, boundsRight.getTop() - 2, + 12, 12, 23, 13, counterSheet, 1); + + // Digits + renderCounterNumber(screen, boundsRight.getLeft() - 2 + 11, boundsRight.getTop(), + 5, 5, 7, sizeRight, colorByHeaviness(calculateHeaviness(sizeRight, capRight), true)); + renderCounterNumber(screen, boundsRight.getLeft(), boundsRight.getTop() + 3, + 0, 4, 5, capRight, Color.GRAY); + } + } + } + + // xp, yp - x, y target pixel; ys - y source pixel; w, h - w, h of a digit sprite; n - number to render + private void renderCounterNumber(Screen screen, int xp, int yp, int ys, int w, int h, int n, int color) { + String display = String.valueOf(n); + for (int i = 0; i < display.length(); ++i) { + screen.render(xp + i * w, yp, w * (display.charAt(i) - '0'), ys, w, h, counterSheet, 0, color); + } + } + + // Gives a percentage of heaviness according to size and capacity. + // n <= cap && n >= 0 && cap > 0 + private float calculateHeaviness(int n, int cap) { + // Formula: -(x - 1)^2 + 1 # always positive as (co-)domain=[0,1] + float inner = (float) n / cap - 1; + return constrainDecimal(-(inner * inner) + 1); + } + + // Constrain any possible floating point calculation error causing potential issues + private float constrainDecimal(float val) { + if (val > 1) return 1; + if (val < 0) return 0; + return val; + } + + // Main color means more vibrant color, i.e. with greenness; else with whiteness instead + // Colors here are calculated as two phases as of the property of RGB space. + private int colorByHeaviness(float val, boolean main) { + if (main) { + if (val < .5) { + // From green (0) to yellow (.5) linearly + return ((int) (val / .5F * 255) << 16) | 0x100FF00; + } else { + // From yellow (.5) to red (1) linearly + return ((int) ((1 - val) / .5F * 255) << 8) | 0x1FF0000; + } + } else { + if (val < .3) { + // From white (0) to yellow (.3) linearly + return (int) (val / .3F * 255) | 0x1FFFF00; + } else { + // From yellow (.3) to red (1) linearly + return ((int) ((1 - val) / .7F * 255) << 8) | 0x1FF0000; + } + } + } - String counterRight = Localization.getLocalized("minicraft.display.menus.inventory.counter", - chest.getInventory().invSize(), chest.getInventory().getMaxSlots()); - Rectangle boundsRight = menus[1].getBounds(); - Font.drawBackground(counterRight, screen, boundsRight.getLeft(), boundsRight.getTop() - 8, Color.GRAY); + /** + * Fading required color on counter background. Counter background here is hardcoded as #2A3299 while + * fading alpha (opacity) of the color is hardcoded as 35%. + */ + private int fadeColor(int color) { + /* + * Z = X + (Y - X) * P # Source: https://stackoverflow.com/a/12228643 + * where Z: new color value, X: background, Y: overlay color value, P: overlay opacity + */ + final float P = .35F; + int r = (color >> 16) & 0xFF; + int g = (color >> 8) & 0xFF; + int b = color & 0xFF; + + // New color values + int nr = 0x2A + (int) ((r - 0x2A) * P); + int ng = 0x32 + (int) ((g - 0x32) * P); + int nb = 0x99 + (int) ((b - 0x99) * P); + return 0x1000000 | (nr << 16) | (ng << 8) | nb; } @Override diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index b7f24f32d..83a5c583b 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -2,14 +2,17 @@ import com.studiohartman.jamepad.ControllerButton; import minicraft.core.Game; +import minicraft.core.Renderer; import minicraft.core.io.InputHandler; import minicraft.core.io.Localization; import minicraft.entity.mob.Player; import minicraft.gfx.Color; import minicraft.gfx.Font; +import minicraft.gfx.MinicraftImage; import minicraft.gfx.Point; import minicraft.gfx.Rectangle; import minicraft.gfx.Screen; +import minicraft.gfx.SpriteLinker; import minicraft.item.Inventory; import minicraft.item.Item; import minicraft.item.Items; @@ -21,6 +24,8 @@ public class PlayerInvDisplay extends Display { private static final int padding = 10; private final Player player; + private final MinicraftImage counterSheet = + Renderer.spriteLinker.getSheet(SpriteLinker.SpriteType.Gui, "inventory_counter"); private String itemDescription = ""; private Menu.Builder descriptionMenuBuilder; @@ -193,11 +198,63 @@ public void render(Screen screen) { super.render(screen); - String counterLeft = Localization.getLocalized("minicraft.display.menus.inventory.counter", - player.getInventory().invSize(), player.getInventory().getMaxSlots()); - Rectangle boundsLeft = menus[0].getBounds(); - Font.drawBackground(counterLeft, screen, boundsLeft.getRight() - counterLeft.length() * 8, - boundsLeft.getTop() - 8, Color.GRAY); + if (selection == 0) { + // LHS is focused + Rectangle boundsLeft = menus[0].getBounds(); + int sizeLeft = player.getInventory().invSize(); + int capLeft = player.getInventory().getMaxSlots(); + // Expanded counter + if (sizeLeft < 10) { // At the moment at most just 2 digits and always 2 digits for capacity (no worry yet) + // Background + screen.render(boundsLeft.getRight() + 2 - (23 - 5), boundsLeft.getTop() - 2, + 12, 12, 3, 13, counterSheet); + // Skips the middle part as that is for more digits + screen.render(boundsLeft.getRight() + 2 - 15, boundsLeft.getTop() - 2, + 20, 12, 15, 13, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 16, boundsLeft.getTop(), + 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, + 0, 4, 5, capLeft, Color.GRAY); + } else { + // Background + screen.render(boundsLeft.getRight() + 2 - 23, boundsLeft.getTop() - 2, + 12, 12, 23, 13, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 21, boundsLeft.getTop(), + 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, + 0, 4, 5, capLeft, Color.GRAY); + } + } else if (creativeMode) { // assert selection == 1 + // LHS is not focused + Rectangle boundsLeft = menus[0].getBounds(); + int sizeLeft = player.getInventory().invSize(); + int capLeft = player.getInventory().getMaxSlots(); + // Minimized counter + if (sizeLeft < 10) { + // Background + screen.render(boundsLeft.getRight() - 4 - 8, boundsLeft.getTop() - 1, + 0, 12, 4, 9, counterSheet); + // Skips the middle part as that is for more digits + screen.render(boundsLeft.getRight() - 4 - 4, boundsLeft.getTop() - 1, + 8, 12, 4, 9, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() - 4 - 6, boundsLeft.getTop() + 1, + 0, 4, 5, sizeLeft, fadeColor(colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), false))); + } else { + // Background + screen.render(boundsLeft.getRight() - 4 - 12, boundsLeft.getTop() - 1, + 0, 12, 12, 9, counterSheet); + + // Digits + renderCounterNumber(screen, boundsLeft.getRight() - 4 - 11, boundsLeft.getTop() + 1, + 0, 4, 5, sizeLeft, fadeColor(colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), false))); + } + } // Searcher help text String text = Localization.getLocalized("minicraft.displays.player_inv.display.help", Game.input.getMapping("SEARCHER-BAR")); @@ -207,6 +264,72 @@ public void render(Screen screen) { onScreenKeyboardMenu.render(screen); } + // xp, yp - x, y target pixel; ys - y source pixel; w, h - w, h of a digit sprite; n - number to render + private void renderCounterNumber(Screen screen, int xp, int yp, int ys, int w, int h, int n, int color) { + String display = String.valueOf(n); + for (int i = 0; i < display.length(); ++i) { + screen.render(xp + i * w, yp, w * (display.charAt(i) - '0'), ys, w, h, counterSheet, 0, color); + } + } + + // Gives a percentage of heaviness according to size and capacity. + // n <= cap && n >= 0 && cap > 0 + private float calculateHeaviness(int n, int cap) { + // Formula: -(x - 1)^2 + 1 # always positive as (co-)domain=[0,1] + float inner = (float) n / cap - 1; + return constrainDecimal(-(inner * inner) + 1); + } + + // Constrain any possible floating point calculation error causing potential issues + private float constrainDecimal(float val) { + if (val > 1) return 1; + if (val < 0) return 0; + return val; + } + + // Main color means more vibrant color, i.e. with greenness; else with whiteness instead + // Colors here are calculated as two phases as of the property of RGB space. + private int colorByHeaviness(float val, boolean main) { + if (main) { + if (val < .5) { + // From green (0) to yellow (.5) linearly + return ((int) (val / .5F * 255) << 16) | 0x100FF00; + } else { + // From yellow (.5) to red (1) linearly + return ((int) ((1 - val) / .5F * 255) << 8) | 0x1FF0000; + } + } else { + if (val < .3) { + // From white (0) to yellow (.3) linearly + return (int) (val / .3F * 255) | 0x1FFFF00; + } else { + // From yellow (.3) to red (1) linearly + return ((int) ((1 - val) / .7F * 255) << 8) | 0x1FF0000; + } + } + } + + /** + * Fading required color on counter background. Counter background here is hardcoded as #2A3299 while + * fading alpha (opacity) of the color is hardcoded as 35%. + */ + private int fadeColor(int color) { + /* + * Z = X + (Y - X) * P # Source: https://stackoverflow.com/a/12228643 + * where Z: new color value, X: background, Y: overlay color value, P: overlay opacity + */ + final float P = .35F; + int r = (color >> 16) & 0xFF; + int g = (color >> 8) & 0xFF; + int b = color & 0xFF; + + // New color values + int nr = 0x2A + (int) ((r - 0x2A) * P); + int ng = 0x32 + (int) ((g - 0x32) * P); + int nb = 0x99 + (int) ((b - 0x99) * P); + return 0x1000000 | (nr << 16) | (ng << 8) | nb; + } + @Override protected void onSelectionChange(int oldSel, int newSel) { super.onSelectionChange(oldSel, newSel); diff --git a/src/client/resources/assets/localization/en-us.json b/src/client/resources/assets/localization/en-us.json index 37cbc7e2a..60c374467 100644 --- a/src/client/resources/assets/localization/en-us.json +++ b/src/client/resources/assets/localization/en-us.json @@ -216,7 +216,6 @@ "minicraft.display.gui.score.current_score": "Current score: %s", "minicraft.display.gui.score.time_left": "Time left %s%sm %ss", "minicraft.display.menus.inventory": "Inventory", - "minicraft.display.menus.inventory.counter": "%s/%s", "minicraft.display.options_display": "Options", "minicraft.display.options_display.change_key_bindings": "Change Key Bindings", "minicraft.display.options_display.language": "Language", diff --git a/src/client/resources/assets/textures/gui/inventory_counter.png b/src/client/resources/assets/textures/gui/inventory_counter.png new file mode 100644 index 0000000000000000000000000000000000000000..98a14b6fc181fd0d2ad20930c11861a21508a0a1 GIT binary patch literal 417 zcmeAS@N?(olHy`uVBq!ia0vp^7C@}P!3-n|?t0$>QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`MFV_7T>t<7|LN1G8#ivK>2_)v%~X{M0m`(6?QaKC>?J{d!9WE-z#!$# z>;@F#EbxddW?aSZYBej9YV?63k)^OA@E?JKXb7Ho39RkA)f zS^2csg=I^pUW)2IAa&5c;g0s>CcDCoY?8IDr#QPWh+4R^FLYHj`pG$Gp{D&rpJQBx z&DKff4arjs&P8TEQm^Q;uCh~ky@1PDwTVTmNI$Y+uIX});JI-4<{M9#dUh$f5_i+aQd-pbqs!b3cMFIc7Q^S!PC{xWt~$( F69DJLtw;a> literal 0 HcmV?d00001 From 99d758a49643d0a62c8ba5d4344cf7fd5c75abc7 Mon Sep 17 00:00:00 2001 From: BenCheung0422 <74168521+BenCheung0422@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:32:38 +0800 Subject: [PATCH 261/261] Fix positioning and sizing of inventory counter --- .../minicraft/screen/ContainerDisplay.java | 22 +++++++++--------- .../minicraft/screen/PlayerInvDisplay.java | 12 +++++----- .../assets/textures/gui/inventory_counter.png | Bin 417 -> 414 bytes 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/client/java/minicraft/screen/ContainerDisplay.java b/src/client/java/minicraft/screen/ContainerDisplay.java index d9fd45e48..ac6d8a4b7 100644 --- a/src/client/java/minicraft/screen/ContainerDisplay.java +++ b/src/client/java/minicraft/screen/ContainerDisplay.java @@ -88,24 +88,24 @@ public void render(Screen screen) { // Expanded counter if (sizeLeft < 10) { // At the moment at most just 2 digits and always 2 digits for capacity (no worry yet) // Background - screen.render(boundsLeft.getRight() + 2 - (23 - 5), boundsLeft.getTop() - 2, + screen.render(boundsLeft.getRight() + 2 - (23 - 5), boundsLeft.getTop() - 3, 12, 12, 3, 13, counterSheet); // Skips the middle part as that is for more digits - screen.render(boundsLeft.getRight() + 2 - 15, boundsLeft.getTop() - 2, + screen.render(boundsLeft.getRight() + 2 - 15, boundsLeft.getTop() - 3, 20, 12, 15, 13, counterSheet); // Digits - renderCounterNumber(screen, boundsLeft.getRight() + 2 - 16, boundsLeft.getTop(), + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 16, boundsLeft.getTop() - 1, 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, 0, 4, 5, capLeft, Color.GRAY); } else { // Background - screen.render(boundsLeft.getRight() + 2 - 23, boundsLeft.getTop() - 2, + screen.render(boundsLeft.getRight() + 2 - 23, boundsLeft.getTop() - 3, 12, 12, 23, 13, counterSheet); // Digits - renderCounterNumber(screen, boundsLeft.getRight() + 2 - 21, boundsLeft.getTop(), + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 21, boundsLeft.getTop() - 1, 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, 0, 4, 5, capLeft, Color.GRAY); @@ -159,7 +159,7 @@ public void render(Screen screen) { 0, 12, 12, 9, counterSheet); // Digits - renderCounterNumber(screen, boundsLeft.getRight() - 4 - 11, boundsLeft.getTop() + 1, + renderCounterNumber(screen, boundsLeft.getRight() - 4 - 10, boundsLeft.getTop() + 1, 0, 4, 5, sizeLeft, fadeColor(colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), false))); } @@ -170,24 +170,24 @@ public void render(Screen screen) { // Expanded counter (background horizontally mirrored) if (sizeRight < 10) { // Background - screen.render(boundsRight.getLeft() - 2 + (20 - 5), boundsRight.getTop() - 2, + screen.render(boundsRight.getLeft() - 2 + (20 - 5), boundsRight.getTop() - 3, 12, 12, 3, 13, counterSheet, 1); // Skips the middle part as that is for more digits - screen.render(boundsRight.getLeft() - 2, boundsRight.getTop() - 2, + screen.render(boundsRight.getLeft() - 2, boundsRight.getTop() - 3, 20, 12, 15, 13, counterSheet, 1); // Digits - renderCounterNumber(screen, boundsRight.getLeft() - 2 + 11, boundsRight.getTop(), + renderCounterNumber(screen, boundsRight.getLeft() - 2 + 11, boundsRight.getTop() - 1, 5, 5, 7, sizeRight, colorByHeaviness(calculateHeaviness(sizeRight, capRight), true)); renderCounterNumber(screen, boundsRight.getLeft(), boundsRight.getTop() + 3, 0, 4, 5, capRight, Color.GRAY); } else { // Background - screen.render(boundsRight.getLeft() - 2, boundsRight.getTop() - 2, + screen.render(boundsRight.getLeft() - 2, boundsRight.getTop() - 3, 12, 12, 23, 13, counterSheet, 1); // Digits - renderCounterNumber(screen, boundsRight.getLeft() - 2 + 11, boundsRight.getTop(), + renderCounterNumber(screen, boundsRight.getLeft() - 2 + 11, boundsRight.getTop() - 1, 5, 5, 7, sizeRight, colorByHeaviness(calculateHeaviness(sizeRight, capRight), true)); renderCounterNumber(screen, boundsRight.getLeft(), boundsRight.getTop() + 3, 0, 4, 5, capRight, Color.GRAY); diff --git a/src/client/java/minicraft/screen/PlayerInvDisplay.java b/src/client/java/minicraft/screen/PlayerInvDisplay.java index 83a5c583b..1b7c59961 100644 --- a/src/client/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/client/java/minicraft/screen/PlayerInvDisplay.java @@ -206,24 +206,24 @@ public void render(Screen screen) { // Expanded counter if (sizeLeft < 10) { // At the moment at most just 2 digits and always 2 digits for capacity (no worry yet) // Background - screen.render(boundsLeft.getRight() + 2 - (23 - 5), boundsLeft.getTop() - 2, + screen.render(boundsLeft.getRight() + 2 - (23 - 5), boundsLeft.getTop() - 3, 12, 12, 3, 13, counterSheet); // Skips the middle part as that is for more digits - screen.render(boundsLeft.getRight() + 2 - 15, boundsLeft.getTop() - 2, + screen.render(boundsLeft.getRight() + 2 - 15, boundsLeft.getTop() - 3, 20, 12, 15, 13, counterSheet); // Digits - renderCounterNumber(screen, boundsLeft.getRight() + 2 - 16, boundsLeft.getTop(), + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 16, boundsLeft.getTop() - 1, 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, 0, 4, 5, capLeft, Color.GRAY); } else { // Background - screen.render(boundsLeft.getRight() + 2 - 23, boundsLeft.getTop() - 2, + screen.render(boundsLeft.getRight() + 2 - 23, boundsLeft.getTop() - 3, 12, 12, 23, 13, counterSheet); // Digits - renderCounterNumber(screen, boundsLeft.getRight() + 2 - 21, boundsLeft.getTop(), + renderCounterNumber(screen, boundsLeft.getRight() + 2 - 21, boundsLeft.getTop() - 1, 5, 5, 7, sizeLeft, colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), true)); renderCounterNumber(screen, boundsLeft.getRight() + 2 - 10, boundsLeft.getTop() + 3, 0, 4, 5, capLeft, Color.GRAY); @@ -251,7 +251,7 @@ public void render(Screen screen) { 0, 12, 12, 9, counterSheet); // Digits - renderCounterNumber(screen, boundsLeft.getRight() - 4 - 11, boundsLeft.getTop() + 1, + renderCounterNumber(screen, boundsLeft.getRight() - 4 - 10, boundsLeft.getTop() + 1, 0, 4, 5, sizeLeft, fadeColor(colorByHeaviness(calculateHeaviness(sizeLeft, capLeft), false))); } } diff --git a/src/client/resources/assets/textures/gui/inventory_counter.png b/src/client/resources/assets/textures/gui/inventory_counter.png index 98a14b6fc181fd0d2ad20930c11861a21508a0a1..fb704054fe13c42fe865b498d02fbad8bae67d22 100644 GIT binary patch delta 286 zcmV+(0pb3k1D*qriGKk9Nkl^3`<&?|34XP$yO$Xa^Qrh9a*-LE~JuD zDJ24H1b+c?uZ$Dw#K{_@^%W{REJ9b{6di;Xg~;R+I78ETMKWnC#1Y&Py8|4fgmKPF z6QAHI?&$fDtb;1dln4^2$hBkvHfv51=Gsvu6SQvB3U)G5RDbC%cLK=VAggsPc{ynj z<&>g{>aHkkN^Mx07*qoM6N<$g7o5mz5oCK delta 289 zcmV++0p9+e1EB+uiGKkCNklp3FNl6iKZM2Q;+EV~|TlwvNa)PdHv1P`oGYTb=mx6L&0&ROdIGWNO+ z9@W>z!&hExaAUl`^U`>DUETQ)#{8>3G3NL9%$Shg<1xR%2gdZzd1#!Nhp%3T*I)3- n0Sgx_jqmVpyc)rm#@2oSPA(t~&?vZv00000NkvXXu0mjfPDY2I