diff --git a/src/main/java/minicraft/core/Game.java b/src/main/java/minicraft/core/Game.java index 6ec9e644..2f3696e2 100644 --- a/src/main/java/minicraft/core/Game.java +++ b/src/main/java/minicraft/core/Game.java @@ -12,6 +12,7 @@ import org.jetbrains.annotations.Nullable; import org.tinylog.Logger; +import minicraft.core.io.CrashHandler; import minicraft.core.io.FileHandler; import minicraft.core.io.InputHandler; import minicraft.core.io.Settings; @@ -183,7 +184,7 @@ public static void main(String[] args) { } Renderer.canvas.setVisible(false); - Initializer.frame.add(new CrashReport(crashString)); + Initializer.frame.add(new CrashHandler(crashString)); Initializer.frame.pack(); Initializer.frame.setVisible(true); }); diff --git a/src/main/java/minicraft/core/Initializer.java b/src/main/java/minicraft/core/Initializer.java index 74a262df..75b33a71 100644 --- a/src/main/java/minicraft/core/Initializer.java +++ b/src/main/java/minicraft/core/Initializer.java @@ -36,7 +36,7 @@ private Initializer() {} /** * Reference to actual frame, also it may be null. */ - static JFrame frame; + public static JFrame frame; static LogoSplashCanvas logoSplash = new LogoSplashCanvas(); // These store the number of frames and ticks in the previous second, used for fps, at least. diff --git a/src/main/java/minicraft/core/Renderer.java b/src/main/java/minicraft/core/Renderer.java index 93fd3b01..850da58b 100644 --- a/src/main/java/minicraft/core/Renderer.java +++ b/src/main/java/minicraft/core/Renderer.java @@ -17,7 +17,7 @@ import org.tinylog.Logger; -import minicraft.core.io.Settings; +import minicraft.core.io.Localization; import minicraft.entity.Entity; import minicraft.entity.furniture.Bed; import minicraft.entity.mob.AirWizard; @@ -210,7 +210,6 @@ private static void renderLevel() { } } - // for earthquakes level.renderBackground(screen, xScroll, yScroll); // Renders current level background level.renderSprites(screen, xScroll, yScroll); // Renders level sprites on screen @@ -239,10 +238,8 @@ private static void renderLevel() { // Brightens all int brightnessMultiplier = player.potionEffects.containsKey(PotionType.Light) ? 12 : 8; level.renderLight(lightScreen, xScroll, yScroll, brightnessMultiplier); // Finds (and renders) all the light from objects (like the player, lanterns, and lava). - screen.darkness(lightScreen, currentLevel, xScroll, yScroll); - + screen.darkness(lightScreen, currentLevel, xScroll, yScroll); } - } /** @@ -289,11 +286,11 @@ private static void renderGui() { ArrayList permStatus = new ArrayList<>(); if (Updater.saving) { - permStatus.add("Saving... " + Math.round(LoadingDisplay.getPercentage()) + "%"); + permStatus.add(Localization.getLocalized("Saving") + " " + Math.round(LoadingDisplay.getPercentage()) + "%"); } if (Bed.sleeping()) { - permStatus.add("Sleeping" + ellipsis.updateAndGet()); + permStatus.add(Localization.getLocalized("Sleeping") + ellipsis.updateAndGet()); } if (!permStatus.isEmpty()) { @@ -469,7 +466,7 @@ private static void renderGui() { } // Render the bosses health bar on screen - if (!player.isRemoved() && Settings.get("bossbar").equals("On screen")) { + if (!player.isRemoved()) { // Check if are a boss close to the player in the current level List entitiesInRange = Game.levels[Game.currentLevel].getEntitiesInRect(new Rectangle(player.x, player.y, 360 << 1, 360 << 1, Rectangle.CENTER_DIMS)); @@ -547,23 +544,24 @@ private static void renderDebugInfo() { info.add("Base: " + "Minicraft Plus Legacy"); subinfo.add("J: " + Utils.JAVA_VERSION + " x" + Utils.JAVA_ARCH); info.add("" + TimeData.date()); subinfo.add(Utils.getGeneralMemoryUsage()); info.add(Initializer.fra + " fps" ); subinfo.add(Utils.getMemoryAllocation()); - info.add("Day tiks: " + Updater.tickCount + " (" + Updater.getTime() + ")"); + info.add("Day tiks: " + Updater.tickCount + " (" + Updater.getTime() + ")"); subinfo.add(""); info.add((Updater.normalSpeed * Updater.gameSpeed) + " tps"); // player info - info.add("Walk spd: " + player.moveSpeed); - info.add("X: " + (player.x >> 4) + "." + (player.x % 16)); - info.add("Y: " + (player.y >> 4) + "." + (player.y % 16)); - info.add(""); - + info.add("Walk spd: " + player.moveSpeed); subinfo.add("AW beaten: " + AirWizard.beaten); + info.add("X: " + (player.x >> 4) + "." + (player.x % 16)); subinfo.add("AW active: " + EyeQueen.active); + info.add("Y: " + (player.y >> 4) + "." + (player.y % 16)); subinfo.add(""); + info.add(""); subinfo.add("EQ beaten: " + AirWizard.beaten); + subinfo.add("EQ active: " + AirWizard.active); info.add("Tile: " + levels[currentLevel].getTile(player.x >> 4, player.y >> 4).name); - info.add("Id: " + levels[currentLevel].getTile(player.x >> 4, player.y >> 4).id); + info.add("ID: " + levels[currentLevel].getTile(player.x >> 4, player.y >> 4).id); info.add("Data: " + levels[currentLevel].getData(player.x >> 4, player.y >> 4)); info.add("Depth: " + levels[currentLevel].depth + " (" + levels[currentLevel].w +"x" + levels[currentLevel].h +")"); info.add(""); if (isMode("score")) { info.add("Score " + player.getScore()); + info.add(""); } if (levels[currentLevel] != null) { diff --git a/src/main/java/minicraft/core/World.java b/src/main/java/minicraft/core/World.java index 4733315d..ba97d8b8 100644 --- a/src/main/java/minicraft/core/World.java +++ b/src/main/java/minicraft/core/World.java @@ -15,6 +15,7 @@ import minicraft.screen.PlayerDeathDisplay; import minicraft.screen.WorldGenDisplay; import minicraft.screen.WorldSelectDisplay; +import minicraft.util.Action; public class World extends Game { private World() {} diff --git a/src/main/java/minicraft/core/CrashReport.java b/src/main/java/minicraft/core/io/CrashHandler.java similarity index 92% rename from src/main/java/minicraft/core/CrashReport.java rename to src/main/java/minicraft/core/io/CrashHandler.java index ef2b1efb..ebef3178 100644 --- a/src/main/java/minicraft/core/CrashReport.java +++ b/src/main/java/minicraft/core/io/CrashHandler.java @@ -1,84 +1,89 @@ -package minicraft.core; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.InputStream; - -import javax.imageio.ImageIO; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; - -public class CrashReport extends JPanel { - private static final long serialVersionUID = 1L; - - private JTextArea crashTextArea; - private JScrollPane crashScrollPane; - private JLabel crashIconLabel; - - // TODO: Add a crash log save, save all into a txt file - - public CrashReport(String crash) { - // Crash log Structure - crashTextArea = new JTextArea(5, 5); - crashIconLabel = new JLabel(); - - Image icon = null; - try ( - InputStream is = Game.class.getResourceAsStream("/resources/title.png")) { - BufferedImage titleIcon = ImageIO.read(is); - icon = titleIcon.getScaledInstance(258 + 16, 60 + 8, Image.SCALE_REPLICATE); - crashIconLabel.setIcon(new ImageIcon(icon)); - } catch (IOException exception) { - exception.printStackTrace(); - } - - crashTextArea.setForeground(Color.BLACK); - crashTextArea.setBackground(Color.WHITE); - - // Crash message - crashTextArea.setText(crash); - crashTextArea.setEditable(false); - crashTextArea.setFont(new Font("Consolas", Font.PLAIN, 12)); - - // All white, is better - UIManager.put("OptionPane.background", Color.white); - UIManager.put("Panel.background", Color.white); - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException exception) { - exception.printStackTrace(); - } - - // Adjust size and set layout - setPreferredSize(new Dimension(Renderer.getWindowSize())); - setLayout(null); - - // Add components to parent widget - crashScrollPane = new JScrollPane(crashTextArea); - crashTextArea.select(0, 0); // Reset the scroll bars position - add(crashScrollPane); - add(crashIconLabel); - - // Set component bounds (only needed by absolute positioning) - crashScrollPane.setBounds(69, 100, 732, 380); - crashIconLabel.setBounds((Renderer.getWindowSize().width / 2) - (icon.getWidth(Initializer.frame) / 2), 25, 258 + 16, 60 + 8); - setBackground(new Color(46, 53, 69)); - } - - /** - * Manually launched crash! - */ - public static void crashMePlease() { - throw new NullPointerException("Manually initiated crash! :D"); - } - -} +package minicraft.core.io; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; + +import javax.imageio.ImageIO; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +import minicraft.core.Game; +import minicraft.core.Initializer; +import minicraft.core.Renderer; + +public class CrashHandler extends JPanel { + private static final long serialVersionUID = 1L; + + private JTextArea crashTextArea; + private JScrollPane crashScrollPane; + private JLabel crashIconLabel; + + // TODO: Add a crash log save, save all into a txt file + + public CrashHandler(String crash) { + // Crash log Structure + crashTextArea = new JTextArea(5, 5); + crashIconLabel = new JLabel(); + + Image icon = null; + + try ( + InputStream is = Game.class.getResourceAsStream("/resources/title.png")) { + BufferedImage titleIcon = ImageIO.read(is); + icon = titleIcon.getScaledInstance(258 + 16, 60 + 8, Image.SCALE_REPLICATE); + crashIconLabel.setIcon(new ImageIcon(icon)); + } catch (IOException exception) { + exception.printStackTrace(); + } + + crashTextArea.setForeground(Color.BLACK); + crashTextArea.setBackground(Color.WHITE); + + // Crash message + crashTextArea.setText(crash); + crashTextArea.setEditable(false); + crashTextArea.setFont(new Font("Consolas", Font.PLAIN, 12)); + + // All white, is better + UIManager.put("OptionPane.background", Color.white); + UIManager.put("Panel.background", Color.white); + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException exception) { + exception.printStackTrace(); + } + + // Adjust size and set layout + setPreferredSize(new Dimension(Renderer.getWindowSize())); + setLayout(null); + + // Add components to parent widget + crashScrollPane = new JScrollPane(crashTextArea); + crashTextArea.select(0, 0); // Reset the scroll bars position + add(crashScrollPane); + add(crashIconLabel); + + // Set component bounds (only needed by absolute positioning) + crashScrollPane.setBounds(69, 100, 732, 380); + crashIconLabel.setBounds((Renderer.getWindowSize().width / 2) - (icon.getWidth(Initializer.frame) / 2), 25, 258 + 16, 60 + 8); + setBackground(new Color(46, 53, 69)); + } + + /** + * Manually launched crash! + */ + public static void crashMePlease() { + throw new NullPointerException("Manually initiated crash! :D"); + } + +} diff --git a/src/main/java/minicraft/core/io/Settings.java b/src/main/java/minicraft/core/io/Settings.java index 427f3c42..25a124ff 100644 --- a/src/main/java/minicraft/core/io/Settings.java +++ b/src/main/java/minicraft/core/io/Settings.java @@ -29,14 +29,12 @@ public class Settings { options.put("sound", new BooleanEntry("Sound", true)); options.put("autosave", new BooleanEntry("Autosave", true)); - options.put("ambient", new ArrayEntry<>("Ambient", "Nice", "Normal", "Scary")); - options.put("cheats", new BooleanEntry("Cheats", true)); options.put("size", new ArrayEntry<>("World Size", 256, 512)); options.get("size").setSelection(0); - options.put("theme", new ArrayEntry<>("World Theme", "Normal", "Forest", "Desert", "Plain", "Hell", "Snow")); + options.put("theme", new ArrayEntry<>("World Theme", "Normal", "Forest", "Desert", "Plain", "Tundra", "Hell")); options.put("type", new ArrayEntry<>("Terrain Type", "Island", "Box", "Mountain", "Irregular")); options.put("unlockedskin", new BooleanEntry("Wear Suit", false)); @@ -56,20 +54,11 @@ public class Settings { Game.player.suitOn = (boolean) value; } }); - - options.put("textures", new ArrayEntry<>("Textures", "Original", "Custom")); - options.get("textures").setSelection(0); // Video options options.put("fps", new RangeEntry("Max FPS", 30, 300, getRefreshRate())); - options.put("vsync", new BooleanEntry("V.Sync", false)); - - options.put("bossbar", new ArrayEntry<>("Bossbar type", "On screen", "On entity", "Percent")); - options.get("bossbar").setSelection(0); - options.put("particles", new BooleanEntry("Particles", true)); options.put("shadows", new BooleanEntry("Shadows", true)); - } public static void initialize() { diff --git a/src/main/java/minicraft/core/io/Sound.java b/src/main/java/minicraft/core/io/Sound.java index 102e96d5..22c474aa 100644 --- a/src/main/java/minicraft/core/io/Sound.java +++ b/src/main/java/minicraft/core/io/Sound.java @@ -165,7 +165,13 @@ public static void play(String key) { public static void playAt(String key, int x, int y) { Sound sound = sounds.get(key); // Logger.debug("Playing sound clip '{}', at ({}, {}) ...", key, x, y); - if (sound != null) sound.playAt(x, y); + if (sound != null) sound.playAt(x, y, true); + } + + public static void playAt(String key, int x, int y, boolean async) { + Sound sound = sounds.get(key); + // Logger.debug("Playing sound clip '{}', at ({}, {}) ...", key, x, y); + if (sound != null) sound.playAt(x, y, async); } public static void loop(String key, boolean start) { @@ -179,7 +185,7 @@ public static void stop(String key) { if (sound != null) al.alSourceStop(sound.source); } - private void playAt(int x, int y) { + private void playAt(int x, int y, boolean async) { if (!Settings.getBoolean("sound")) { return; } @@ -189,22 +195,26 @@ private void playAt(int x, int y) { if (player == null) { return; } + + if (!async) { + int[] state = new int[1]; + al.alGetSourcei(source, AL.AL_SOURCE_STATE, state, 0); + if (state[0] != AL.AL_PLAYING) { + al.alSourcePlay(source); + } + } else { + al.alSourcePlay(source); + } - // Play the source without setting the volume - al.alSourcePlay(source); - - // Calculate the distance between the sound source and the player double distance = Math.sqrt(Math.pow(x - player.x, 2) + Math.pow(y - player.y, 2)); - // TODO: improve this using an thread to dynamically change the 'Sound Gain' while the player moves - // Set the volume based on the distance from the player - float volume = 1.0f - (float) distance / 180.0f; - if (volume < 0.0f) { - return; + float volume = 1.0f - ((float) distance / 175.0f); + + if (volume <= 0.0f) { + return; } - - // Set the source volume + al.alSourcef(source, AL.AL_GAIN, volume); } @@ -216,7 +226,6 @@ private void play() { al.alSourcePlay(source); } - private void loop(boolean start) { if (!Settings.getBoolean("sound")) { return; diff --git a/src/main/java/minicraft/entity/ItemEntity.java b/src/main/java/minicraft/entity/ItemEntity.java index 9eec0f87..735662d8 100644 --- a/src/main/java/minicraft/entity/ItemEntity.java +++ b/src/main/java/minicraft/entity/ItemEntity.java @@ -87,7 +87,7 @@ public String getData() { @Override public void tick() { time++; - if (time >= lifeTime && !item.equals(Items.get("AlAzif"))) { // if the time is larger or equal to lifeTime then... + if (time >= lifeTime && !item.equals(Items.get("Grimoire"))) { // if the time is larger or equal to lifeTime then... remove(); // remove from the world return; // skip the rest of the code } @@ -130,7 +130,7 @@ public void tick() { yy += goty - expectedy; // If some item touch lava, is burned - if (level.getTile(x >> 4,y >> 4) instanceof LavaTile && !item.equals(Items.get("AlAzif"))) { + if (level.getTile(x >> 4,y >> 4) instanceof LavaTile && !item.equals(Items.get("Grimoire"))) { for (int i = 0; i < 1 + random.nextInt(2); i++) { int randX = random.nextInt(16); int randY = random.nextInt(12); @@ -143,7 +143,7 @@ public void tick() { } } - if (item.equals(Items.get("AlAzif")) && time % 20 == 0) { + if (item.equals(Items.get("Grimoire")) && time % 20 == 0) { for (int i = 0; i < 1 + random.nextInt(2); i++) { level.add(new FireParticle(x - 8 + random.nextInt(8), y - 12 + random.nextInt(12))); } @@ -166,7 +166,7 @@ public void render(Screen screen) { } /* This first part is for the blinking effect */ - if (time >= lifeTime - 6 * 20 && !item.equals(Items.get("AlAzif"))) { + if (time >= lifeTime - 6 * 20 && !item.equals(Items.get("Grimoire"))) { if (time / 6 % 2 == 0) return; } @@ -218,7 +218,7 @@ public int getLightRadius() { this.item.equals(Items.get("Gold Lantern")) || this.item.equals(Items.get("Summon Altar")) ) ? 1: - this.item.equals(Items.get("AlAzif")) ? 2 : 0; + this.item.equals(Items.get("Grimoire")) ? 2 : 0; } } diff --git a/src/main/java/minicraft/entity/furniture/Bed.java b/src/main/java/minicraft/entity/furniture/Bed.java index 2ade087a..bafe84b4 100644 --- a/src/main/java/minicraft/entity/furniture/Bed.java +++ b/src/main/java/minicraft/entity/furniture/Bed.java @@ -42,12 +42,7 @@ public static boolean checkCanSleep(Player player) { if (inBed(player)) return false; if (!(Updater.tickCount >= Updater.sleepStartTime || Updater.tickCount < Updater.sleepEndTime && Updater.pastFirstDay)) { - // it is too early to sleep; display how much time is remaining. - // gets the seconds until sleeping allowed. normalSpeed is in tiks/sec. - int seconds = (int) Math.ceil((Updater.sleepStartTime - Updater.tickCount) * 1.0 / Updater.normalSpeed); - - String note = "Can't sleep! " + (seconds / 60) + "Mins " + (seconds % 60) + " Secs left!"; - Game.notifications.add(note); // Add the notification displaying the time remaining in minutes and seconds. + Game.notifications.add("You can only sleep at night!"); return false; } return true; diff --git a/src/main/java/minicraft/entity/furniture/Crafter.java b/src/main/java/minicraft/entity/furniture/Crafter.java index 50b35381..c68aec6a 100644 --- a/src/main/java/minicraft/entity/furniture/Crafter.java +++ b/src/main/java/minicraft/entity/furniture/Crafter.java @@ -18,7 +18,6 @@ public enum Type { Furnace(new Sprite(12, 30, 2, 2, 2), 3, 2, Recipes.furnaceRecipes, true), // NOTE: this true Anvil(new Sprite(8, 30, 2, 2, 2), 3, 2, Recipes.anvilRecipes, false), Enchanter(new Sprite(22, 30, 2, 2, 2), 7, 2, Recipes.enchantRecipes, false), - Assembler(new Sprite(30, 30, 2, 2, 2), 7, 2, Recipes.assemblerRecipes, false), Stonecutter(new Sprite(32, 30, 2, 2, 2), 7, 2, Recipes.stonecutterRecipes, false), Brewery(new Sprite(34, 30, 2, 2, 2), 7, 2, Recipes.breweryRecipes, false), Loom(new Sprite(24, 30, 2, 2, 2), 7, 2, Recipes.loomRecipes, false); diff --git a/src/main/java/minicraft/entity/mob/AirWizard.java b/src/main/java/minicraft/entity/mob/AirWizard.java index 1ec46f28..f72529d5 100644 --- a/src/main/java/minicraft/entity/mob/AirWizard.java +++ b/src/main/java/minicraft/entity/mob/AirWizard.java @@ -8,7 +8,6 @@ import minicraft.entity.Entity; import minicraft.entity.Spark; import minicraft.graphic.Color; -import minicraft.graphic.Font; import minicraft.graphic.MobSprite; import minicraft.graphic.Screen; import minicraft.item.Items; @@ -17,15 +16,11 @@ public class AirWizard extends EnemyMob { - private static MobSprite[][][] spritesMain; - private static MobSprite[][][] spritesFirstPahse; private static MobSprite[][][] spritesSecondPhase; private static MobSprite[][][] spritesThirdPhase; static { - // FIXME: The Air Wizard skin sprites should change beetween phases - spritesMain = new MobSprite[2][4][2]; spritesFirstPahse = new MobSprite[2][4][2]; spritesSecondPhase = new MobSprite[2][4][2]; spritesThirdPhase = new MobSprite[2][4][2]; @@ -40,12 +35,10 @@ public class AirWizard extends EnemyMob { spritesSecondPhase[i] = list; } - for (int i = 0; i < 2; i++) { // Furius wizard + for (int i = 0; i < 2; i++) { // Utimate wizard MobSprite[][] list = MobSprite.compileMobSpriteAnimations(30, 10 + (i * 2)); spritesThirdPhase[i] = list; } - - spritesMain = spritesFirstPahse; // Start on first phase } public static boolean beaten = false; @@ -74,7 +67,7 @@ public AirWizard(int lvl) { * @param secondform determines if the wizard should be level 2 or 1. */ public AirWizard(boolean secondform) { - super(secondform ? 2 : 1, spritesMain, secondform ? 18000 : 10500, false, 16 * 8, -1, 10, 50); + super(secondform ? 2 : 1, spritesFirstPahse, secondform ? 18000 : 10500, false, 16 * 8, -1, 10, 50); active = true; entity = this; @@ -83,7 +76,7 @@ public AirWizard(boolean secondform) { this.secondform = secondform; if (secondform) speed = 3; if (!secondform) { - beaten = false; // <- needed for new worlds :( + beaten = false; speed = 2; } @@ -114,14 +107,14 @@ public void tick() { if (health <= (secondform ? 12000 : 7000) && currentPhase == 1) { // change to phase 2 Sound.playAt("wizardChangePhase", this.x, this.y); - spritesMain = spritesSecondPhase; + this.lvlSprites = spritesSecondPhase; currentPhase = 2; } if (health <= (secondform ? 6000 : 3500) && currentPhase == 2) { // change to phase 3 Sound.playAt("wizardChangePhase", this.x, this.y); - spritesMain = spritesThirdPhase; + this.lvlSprites = spritesThirdPhase; currentPhase = 3; } @@ -248,37 +241,20 @@ public void doHurt(int damage, Direction attackDir) { @Override public void render(Screen screen) { - super.render(screen); - - int textColor = Color.get(1, 0, 204, 0); - int textColor2 = Color.get(1, 0, 51, 0); - int percent = health / (maxHealth / 100); - String h = percent + "%"; - - if (percent < 1) { - h = "1%"; - } - - if (percent < 16) { - textColor = Color.get(1, 204, 0, 0); - textColor2 = Color.get(1, 51, 0, 0); - } else if (percent < 51) { - textColor = Color.get(1, 204, 204, 9); - textColor2 = Color.get(1, 51, 51, 0); - } - - int textwidth = Font.textWidth(h); - - // Bossbar on the the Air wizard - if (Settings.get("bossbar").equals("On entity")) { - Font.drawBar(screen, (x - Screen.w / 12 + 26), y - 24, length); - } - - // Bossbar percent - if (Settings.get("bossbar").equals("Percent")) { - Font.draw(h, screen, (x - textwidth / 2) + 1, y - 17, textColor2); - Font.draw(h, screen, (x - textwidth / 2), y - 18, textColor); - } + // When is charging a attack ... + if (currentPhase == 1 && attackDelay > 0) { + if (tickTime / 5 % 4 == 0) { + super.render(screen, secondform ? Color.GREEN : Color.RED); + return; + } + } else if (currentPhase > 1) { + if (tickTime / 3 % 2 == 0) { + super.render(screen, secondform ? Color.GREEN : Color.RED); + return; + } + } + + super.render(screen); } @Override @@ -302,19 +278,19 @@ public void die() { } } - Sound.playAt("wizardDeath", this.x, this.y); + Sound.playAt("wizardDeath", x, y); - level.dropItem(x, y, Items.get("AlAzif")); - if (!secondform) { // Kill first Air wizard achievement AchievementsDisplay.setAchievement("minicraft.achievement.airwizard", true); if (!beaten) { - Updater.notifyAll("The Air Wizard was beaten?", 200); - Updater.notifyAll("Unlocked Dungeons!", 200); + Updater.notifyAll("The Dungeon is now open!", 200); + Updater.notifyAll("A book lies on the ground...", 200); beaten = true; } + + level.dropItem(x, y, Items.get("Grimoire")); active = false; entity = null; @@ -334,7 +310,9 @@ public void die() { // Unlock the Air wizard suit :D Settings.set("unlockedskin", true); } + new Save(); + super.die(); // Calls the die() method in EnemyMob.java } diff --git a/src/main/java/minicraft/entity/mob/Chicken.java b/src/main/java/minicraft/entity/mob/Chicken.java index 3d44f1ba..41d54342 100644 --- a/src/main/java/minicraft/entity/mob/Chicken.java +++ b/src/main/java/minicraft/entity/mob/Chicken.java @@ -32,8 +32,8 @@ public void tick() { followOnHold(Items.get("Seeds"), 2); // Chicken sounds - if ((this.tickTime % (random.nextInt(100) + 120) == 0)) { - playSound(sounds, 6); + if ((tickTime % 100 == 0) && random.nextInt(4) == 0) { + playSound(sounds, 4); } } diff --git a/src/main/java/minicraft/entity/mob/Cow.java b/src/main/java/minicraft/entity/mob/Cow.java index 6563f950..15e3c72a 100644 --- a/src/main/java/minicraft/entity/mob/Cow.java +++ b/src/main/java/minicraft/entity/mob/Cow.java @@ -20,11 +20,11 @@ public void tick() { super.tick(); // follows to the player if holds wheat - followOnHold(Items.get("Wheat"), 3); + followOnHold(Items.get("Wheat"), 4); // Cow sounds - if ((tickTime % (random.nextInt(100) + 120) == 0)) { - playSound(sounds, 8); + if ((tickTime % 150 == 0) && random.nextInt(4) == 0) { + playSound(sounds, 7); } } diff --git a/src/main/java/minicraft/entity/mob/EnemyMob.java b/src/main/java/minicraft/entity/mob/EnemyMob.java index f6045dd0..7e729396 100644 --- a/src/main/java/minicraft/entity/mob/EnemyMob.java +++ b/src/main/java/minicraft/entity/mob/EnemyMob.java @@ -120,6 +120,12 @@ public void render(Screen screen) { sprites = lvlSprites[lvl - 1]; super.render(screen); } + + @Override + public void render(Screen screen, int color) { + sprites = lvlSprites[lvl - 1]; + super.render(screen, color); + } @Override protected void touchedBy(Entity entity) { // if an entity (like the player) touches the enemy mob diff --git a/src/main/java/minicraft/entity/mob/EyeQueen.java b/src/main/java/minicraft/entity/mob/EyeQueen.java index 0cf3c6c7..07c2f51a 100644 --- a/src/main/java/minicraft/entity/mob/EyeQueen.java +++ b/src/main/java/minicraft/entity/mob/EyeQueen.java @@ -1,14 +1,12 @@ package minicraft.entity.mob; import minicraft.core.Updater; -import minicraft.core.io.Settings; import minicraft.core.io.Sound; import minicraft.entity.Direction; import minicraft.entity.Entity; import minicraft.entity.Fireball; import minicraft.entity.particle.FireParticle; import minicraft.graphic.Color; -import minicraft.graphic.Font; import minicraft.graphic.MobSprite; import minicraft.graphic.Point; import minicraft.graphic.Screen; @@ -230,50 +228,14 @@ public void tick() { @Override public void render(Screen screen) { - - if (deathing || attackDelay > 0) { - if (tickTime / 4 % 2 == 0) { - if (deathing) { - super.render(screen, Color.RED, true); - } else { - super.render(screen, Color.RED, false); - } - } else { - super.render(screen); - } - } else { - super.render(screen); + if (attackDelay > 0) { + if (tickTime / 4 % 2 == 0) { + super.render(screen, Color.RED, deathing); + return; + } } - - int textColor = Color.get(1, 0, 204, 0); - int textColor2 = Color.get(1, 0, 51, 0); - int percent = health / (maxHealth / 100); - String h = percent + "%"; - - if (percent < 1) { - h = "1%"; - } - - if (percent < 16) { - textColor = Color.get(1, 204, 0, 0); - textColor2 = Color.get(1, 51, 0, 0); - } else if (percent < 51) { - textColor = Color.get(1, 204, 204, 9); - textColor2 = Color.get(1, 51, 51, 0); - } - - int textwidth = Font.textWidth(h); - - // Bossbar on the the Air wizard - if (Settings.get("bossbar").equals("On entity")) { - Font.drawBar(screen, (x - Screen.w / 12 + 16), y - 24, length); - } - - // Bossbar percent - if (Settings.get("bossbar").equals("Percent")) { - Font.draw(h, screen, (x - textwidth / 2) + 1, y - 17, textColor2); - Font.draw(h, screen, (x - textwidth / 2), y - 18, textColor); - } + + super.render(screen); } @Override @@ -294,7 +256,7 @@ public void die() { } dropItem(25, 50, Items.get("emerald")); - dropItem(1, 1, Items.get("AlAzif")); + dropItem(1, 1, Items.get("Grimoire")); super.die(); } diff --git a/src/main/java/minicraft/entity/mob/Keeper.java b/src/main/java/minicraft/entity/mob/Keeper.java index bb97372f..def85fad 100644 --- a/src/main/java/minicraft/entity/mob/Keeper.java +++ b/src/main/java/minicraft/entity/mob/Keeper.java @@ -2,8 +2,6 @@ import minicraft.core.io.Settings; import minicraft.core.io.Sound; -import minicraft.graphic.Color; -import minicraft.graphic.Font; import minicraft.graphic.MobSprite; import minicraft.graphic.Screen; @@ -74,36 +72,6 @@ public void tick() { @Override public void render(Screen screen) { super.render(screen); - - int textColor = Color.get(1, 0, 204, 0); - int textColor2 = Color.get(1, 0, 51, 0); - int percent = health / (maxHealth / 100); - String h = percent + "%"; - - if (percent < 1) { - h = "1%"; - } - - if (percent < 16) { - textColor = Color.get(1, 204, 0, 0); - textColor2 = Color.get(1, 51, 0, 0); - } else if (percent < 51) { - textColor = Color.get(1, 204, 204, 9); - textColor2 = Color.get(1, 51, 51, 0); - } - - int textwidth = Font.textWidth(h); - - // Bossbar on the the Air wizard - if (Settings.get("bossbar").equals("On entity")) { - Font.drawBar(screen, (x - Screen.w / 12 + 16), y - 24, length); - } - - // Bossbar percent - if (Settings.get("bossbar").equals("Percent")) { - Font.draw(h, screen, (x - textwidth / 2) + 1, y - 17, textColor2); - Font.draw(h, screen, (x - textwidth / 2), y - 18, textColor); - } } public boolean canSwim() { diff --git a/src/main/java/minicraft/entity/mob/MobAi.java b/src/main/java/minicraft/entity/mob/MobAi.java index 384bcbcf..2b5bf4a1 100644 --- a/src/main/java/minicraft/entity/mob/MobAi.java +++ b/src/main/java/minicraft/entity/mob/MobAi.java @@ -258,7 +258,7 @@ protected void playSound(String[] sounds, int heardRadius) { if (player != null && player.isWithin(heardRadius, this)) { int randomNum = random.nextInt(sounds.length); - Sound.playAt(sounds[randomNum], x, y); + Sound.playAt(sounds[randomNum], x, y, false); } } @@ -266,7 +266,7 @@ protected void playSound(String sound, int heardRadius) { Player player = getClosestPlayer(); if (player != null && player.isWithin(heardRadius, this)) { - Sound.playAt(sound, x, y); + Sound.playAt(sound, x, y, false); } } diff --git a/src/main/java/minicraft/entity/mob/Pig.java b/src/main/java/minicraft/entity/mob/Pig.java index 81ecff2b..0713ae23 100644 --- a/src/main/java/minicraft/entity/mob/Pig.java +++ b/src/main/java/minicraft/entity/mob/Pig.java @@ -20,11 +20,11 @@ public void tick() { super.tick(); // follows to the player if holds a carrot - followOnHold(Items.get("Carrot"), 5); + followOnHold(Items.get("Carrot"), 3); // Pig sounds - if ((this.tickTime % (random.nextInt(100) + 120) == 0)) { - playSound(sounds, 7); + if ((tickTime % 180 == 0) && random.nextInt(4) == 0) { + playSound(sounds, 6); } } diff --git a/src/main/java/minicraft/entity/mob/Player.java b/src/main/java/minicraft/entity/mob/Player.java index ea8dfb71..17892cae 100644 --- a/src/main/java/minicraft/entity/mob/Player.java +++ b/src/main/java/minicraft/entity/mob/Player.java @@ -153,9 +153,7 @@ public class Player extends Mob implements ItemHolder, ClientTickable { public int fishingTicks = maxFishingTicks; public int fishingLevel; - public boolean playerBurning = false; public boolean fallWarn = false; - private int burnTime = 0; // NICE NIGHT STUFF public boolean isNiceNight = false; // Spawn mobs or spaw fireflyes? @@ -167,6 +165,8 @@ public class Player extends Mob implements ItemHolder, ClientTickable { public Player(@Nullable Player previousInstance, InputHandler input) { super(sprites, Player.maxHealth); x = 24; y = 24; + + updatePlayerSkin(); this.input = input; playerInventory = new Inventory() { @@ -313,33 +313,6 @@ public void tick() { } isNiceNight = (nightCount == 4); - // PLAYER BURNING - if (playerBurning) { - if (tickTime / 16 % 4 == 0 && burnTime != 120) { - if (Settings.get("particles").equals(true)) { - level.add(new FireParticle(x - 4 + random.nextInt(10), y - 4 + random.nextInt(9))); - } - if (!(potionEffects.containsKey(PotionType.Lava) || potionEffects.containsKey(PotionType.xLava))) { - this.hurt(this, 1); - } - burnTime++; - } - } else { - burnTime = 0; - } - - // if touch water extinguish the fire - if (onTile instanceof WaterTile) { - burnTime = 0; - playerBurning = false; - } - - // if burntime is equals to 120 stop - if (burnTime == 120) { - burnTime = 0; - playerBurning = false; - } - tickMultiplier(); if (!potionEffects.isEmpty() && !Bed.inBed(this)) { @@ -1034,8 +1007,6 @@ private void updatePlayerSkin() { @Override public void render(Screen screen) { - updatePlayerSkin(); - MobSprite[][] spriteSet; // The default, walking sprites. if (activeItem instanceof FurnitureItem) { @@ -1065,12 +1036,9 @@ public void render(Screen screen) { } } else if (onTile instanceof LavaTile) { - - // BURN THE PLAYER - playerBurning = true; - + // Animation effect - if (tickTime / 8 % 2 == 0) { + if (tickTime / 16 % 4 == 0) { screen.render(xo + 0, yo + 3, 6 + (2 << 5), 1, 3); // Render the lava graphic screen.render(xo + 8, yo + 3, 6 + (2 << 5), 0, 3); // Render the mirrored lava graphic to the right. } else { @@ -1237,7 +1205,7 @@ public void findStartPos(Level level) { public void findStartPos(Level level, boolean setSpawn) { Point spawnPos; - List spawnTilePositions = level.getMatchingTiles(Tiles.get("Grass")); + List spawnTilePositions = level.getMatchingTiles(Tiles.get("Grass"), Tiles.get("Sand"), Tiles.get("Snow")); if (spawnTilePositions.isEmpty()) { spawnTilePositions.addAll(level.getMatchingTiles((t, x, y) -> t.maySpawn())); @@ -1260,6 +1228,7 @@ public void findStartPos(Level level, boolean setSpawn) { spawnx = spawnPos.x; spawny = spawnPos.y; } + // Set (entity) coordinates of player to the center of the tile. this.x = (spawnPos.x * 16) + 8; // conversion from tile coords to entity coords. this.y = (spawnPos.y * 16) + 8; @@ -1275,6 +1244,7 @@ public void respawn(Level level) { if (!level.getTile(spawnx, spawny).maySpawn()) { findStartPos(level); } + // Move the player to the spawnpoint this.x = (spawnx * 16) + 8; this.y = (spawny * 16) + 8; @@ -1398,7 +1368,9 @@ protected void doHurt(int damage, Direction attackDir) { if (healthDamage > 0 || this != Game.player) { level.add(new TextParticle("" + damage, x, y, Color.get(-1, 504))); - if (this == Game.player) super.doHurt(healthDamage, attackDir); // Sets knockback, and takes away health. + if (this == Game.player) { + super.doHurt(healthDamage, attackDir); // Sets knockback, and takes away health. + } } Sound.playAt("playerHurt", this.x, this.y); @@ -1422,7 +1394,9 @@ private void directHurt(int damage, Direction attackDir) { if (healthDamage > 0 || this != Game.player) { level.add(new TextParticle("" + damage, x, y, Color.get(-1, 504))); - if (this == Game.player) super.doHurt(healthDamage, attackDir); // Sets knockback, and takes away health. + if (this == Game.player) { + super.doHurt(healthDamage, attackDir); // Sets knockback, and takes away health. + } } Sound.playAt("playerHurt", this.x, this.y); diff --git a/src/main/java/minicraft/entity/mob/Sheep.java b/src/main/java/minicraft/entity/mob/Sheep.java index 9481d2a7..351080b3 100644 --- a/src/main/java/minicraft/entity/mob/Sheep.java +++ b/src/main/java/minicraft/entity/mob/Sheep.java @@ -59,14 +59,14 @@ public void tick() { } // follows to the player if holds wheat - followOnHold(Items.get("Wheat"), 3); + followOnHold(Items.get("Wheat"), 4); - if ((tickTime % (random.nextInt(100) + 120) == 0)) { + if ((tickTime % 200 == 0)) { if (level.getTile(x >> 4, y >> 4) instanceof SnowTile) { - remove(); level.add(new Goat(), x, y); - } else if (random.nextBoolean()) { - playSound(sounds, 8); + remove(); + } else if (random.nextInt(4) == 0) { + playSound(sounds, 7); } } } diff --git a/src/main/java/minicraft/entity/mob/Sheepuff.java b/src/main/java/minicraft/entity/mob/Sheepuff.java index ca37184b..f22b8a27 100644 --- a/src/main/java/minicraft/entity/mob/Sheepuff.java +++ b/src/main/java/minicraft/entity/mob/Sheepuff.java @@ -19,10 +19,10 @@ public Sheepuff() { public void tick() { super.tick(); - followOnHold(Items.get("Sky Wart"), 3); + followOnHold(Items.get("Sky Wart"), 4); if ((tickTime % (random.nextInt(150) + 120) == 0)) { - playSound(sounds, 8); + playSound(sounds, 7); } } diff --git a/src/main/java/minicraft/entity/particle/BrightParticle.java b/src/main/java/minicraft/entity/particle/BrightParticle.java index d9e310b9..e13bc1c3 100644 --- a/src/main/java/minicraft/entity/particle/BrightParticle.java +++ b/src/main/java/minicraft/entity/particle/BrightParticle.java @@ -5,25 +5,26 @@ public class BrightParticle extends Particle { /// This is used for the Lanterns. private static Sprite sprite = new Sprite(0, 17, 3); - private int spriteFrame = 0; + private static int spriteFrame = 0; /** - * Creates a new particle at the given position. It has a custom lifetime of ticks - * and a bright looking sprite. + * Creates a new particle at the specified position. The particle has a custom lifetime in ticks + * and a bright-looking sprite. * - * @param x X map positiona - * @param y Y map position + * @param x X-coordinate of the map position + * @param y Y-coordinate of the map position + * @param time Lifetime of the particle in ticks */ public BrightParticle(int x, int y, int time) { super(x, y, time, sprite); } /** - * Creates a new particle at the given position. It has a lifetime of 16 ticks - * and a bright looking sprite. + * Creates a new particle at the specified position. The particle has a lifetime of 16 ticks + * and a bright-looking sprite. * - * @param x X map positiona - * @param y Y map position + * @param x X-coordinate of the map position + * @param y Y-coordinate of the map position */ public BrightParticle(int x, int y) { this(x, y, 16); @@ -35,6 +36,6 @@ public void tick() { super.tick(); spriteFrame = (spriteFrame + 1) % 4; - sprite = new Sprite(spriteFrame, 17, 3); + sprite = new Sprite(spriteFrame, 16, 3); } } diff --git a/src/main/java/minicraft/entity/particle/HeartParticle.java b/src/main/java/minicraft/entity/particle/HeartParticle.java deleted file mode 100644 index cf10ee3b..00000000 --- a/src/main/java/minicraft/entity/particle/HeartParticle.java +++ /dev/null @@ -1,30 +0,0 @@ -package minicraft.entity.particle; - -import minicraft.graphic.Sprite; - -public class HeartParticle extends Particle { - /// This is used for lovely mobs. - - private static Sprite Sprites = new Sprite(0, 16, 3); - private int frame = 0; - - /** - * Creates a new particle at the given position. It has a lifetime of 16 ticks - * and a heart looking sprite. - * - * @param x X map position - * @param y Y map position - */ - public HeartParticle(int x, int y) { - super(x, y, 16, Sprites); - } - - // Used for the hearts animations :) - public void tick() { - super.tick(); - - // Animation - frame = (frame + 1) % 4; - Sprites = new Sprite(frame, 16, 3); - } -} diff --git a/src/main/java/minicraft/graphic/Font.java b/src/main/java/minicraft/graphic/Font.java index 50fb808a..268bfc21 100644 --- a/src/main/java/minicraft/graphic/Font.java +++ b/src/main/java/minicraft/graphic/Font.java @@ -19,7 +19,8 @@ public class Font { "αβΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■А" + "БВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ" + "абвгдеёжзийклмнопрстуфхцчшщъыьэю" + - "яÁÍíÓÚÀÂÈÊËÌÎÏÒÔŒœÙÛÝýŸÃãÕõ"; + "яÁÍíÓÚÀÂÈÊËÌÎÏÒÔŒœÙÛÝýŸÃãÕõ✪✫✬✭✮" + + "✯✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿❀❁❂❃"; /* * The order of the letters in the chars string is represented in the order that diff --git a/src/main/java/minicraft/item/BookItem.java b/src/main/java/minicraft/item/BookItem.java index fef105d1..996f2633 100644 --- a/src/main/java/minicraft/item/BookItem.java +++ b/src/main/java/minicraft/item/BookItem.java @@ -17,7 +17,7 @@ protected static ArrayList getAllInstances() { ArrayList items = new ArrayList(); items.add(new BookItem("Book", new Sprite(0, 8, 0), null)); items.add(new BookItem("Antidious", new Sprite(1, 8, 0), BookData.antVenomBook, true)); - items.add(new BookItem("AlAzif", new Sprite(0, 28, 0), BookData.AlAzif, true)); + items.add(new BookItem("Grimoire", new Sprite(2, 8, 0), BookData.Grimoire, true)); return items; } diff --git a/src/main/java/minicraft/item/PotionType.java b/src/main/java/minicraft/item/PotionType.java index 521eafdd..89510539 100644 --- a/src/main/java/minicraft/item/PotionType.java +++ b/src/main/java/minicraft/item/PotionType.java @@ -44,8 +44,6 @@ public boolean toggleEffect(Player player, boolean addEffect) { xShield(Color.get(1, 65, 65, 157), 10400), Haste(Color.get(1, 106, 37, 106), 4800), - Blindness(Color.get(1, 48, 48, 64), 22000), - Escape(Color.get(1, 85, 62, 62), 0) { public boolean toggleEffect(Player player, boolean addEffect) { if (addEffect) { @@ -60,9 +58,9 @@ public boolean toggleEffect(Player player, boolean addEffect) { int depthDiff = playerDepth > 0 ? -1 : 1; World.scheduleLevelChange(depthDiff, () -> { - Level plevel = World.levels[World.levelIndex(playerDepth + depthDiff)]; - if (plevel != null && !plevel.getTile(player.x >> 4, player.y >> 4).mayPass(plevel, player.x >> 4, player.y >> 4, player)) { - player.findStartPos(plevel, false); + Level playerLevel = World.levels[World.levelIndex(playerDepth + depthDiff)]; + if (playerLevel != null && !playerLevel.getTile(player.x >> 4, player.y >> 4).mayPass(playerLevel, player.x >> 4, player.y >> 4, player)) { + player.findStartPos(playerLevel, false); } }); } diff --git a/src/main/java/minicraft/item/Recipe.java b/src/main/java/minicraft/item/Recipe.java index f5f5b7f3..aff0a75d 100644 --- a/src/main/java/minicraft/item/Recipe.java +++ b/src/main/java/minicraft/item/Recipe.java @@ -49,7 +49,7 @@ public boolean craft(Player player) { if (!Game.isMode("Creative")) { // remove the cost items from the inventory. for (String cost : costs.keySet().toArray(new String[0])) { - if (!cost.contains("ALAZIF")) player.getInventory().removeItems(Items.get(cost), costs.get(cost)); + if (!cost.contains("GRIMOIRE")) player.getInventory().removeItems(Items.get(cost), costs.get(cost)); } } diff --git a/src/main/java/minicraft/item/Recipes.java b/src/main/java/minicraft/item/Recipes.java index 13f4c7b7..40dd1219 100644 --- a/src/main/java/minicraft/item/Recipes.java +++ b/src/main/java/minicraft/item/Recipes.java @@ -11,7 +11,6 @@ public class Recipes { public static final ArrayList enchantRecipes = new ArrayList<>(); public static final ArrayList craftRecipes = new ArrayList<>(); public static final ArrayList loomRecipes = new ArrayList<>(); - public static final ArrayList assemblerRecipes = new ArrayList<>(); public static final ArrayList stonecutterRecipes = new ArrayList<>(); public static final ArrayList breweryRecipes = new ArrayList<>(); @@ -172,7 +171,7 @@ public class Recipes { ovenRecipes.add(new Recipe("Carrot Soup_3", "Bowl_3", "Carrot_3")); enchantRecipes.add(new Recipe("Slimy Amulet_1", "gold_8", "green clothes_2")); - enchantRecipes.add(new Recipe("Eye Amulet_1", "gold_8", "AlAzif_1", "Sticky essence_2")); + enchantRecipes.add(new Recipe("Eye Amulet_1", "gold_8", "Grimoire_1", "Sticky essence_2")); enchantRecipes.add(new Recipe("Gold Apple_1", "apple_1", "gold_8")); enchantRecipes.add(new Recipe("Gold Carrot_1", "carrot_1", "gold_8")); enchantRecipes.add(new Recipe("potion_1", "glass_1", "Lapis_3")); diff --git a/src/main/java/minicraft/level/LevelGen.java b/src/main/java/minicraft/level/LevelGen.java index ec991570..08841b17 100644 --- a/src/main/java/minicraft/level/LevelGen.java +++ b/src/main/java/minicraft/level/LevelGen.java @@ -20,6 +20,8 @@ public class LevelGen { private static long worldSeed = 0; private static final Random random = new Random(worldSeed); // Initializes the random class + private static int stairsRadius = 15; + private double[] values; // An array of doubles, used to help making noise for the map private final int w, h; @@ -171,10 +173,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("Sand Rock").id & 0xffff] < 100) continue; if (count[Tiles.get("Grass").id & 0xffff] < 100) continue; - if (count[Tiles.get("Snow").id & 0xffff] < 100) continue; if (count[Tiles.get("Oak Tree").id & 0xffff] < 100) continue; if (count[Tiles.get("Stairs Down").id & 0xffff] == 0) continue; @@ -336,30 +335,63 @@ private static short[][] createTopMap(int w, int h) { // create surface map // World themes logic if ("Island".equals(terrainType)) { - if (val < -0.7) { - if ("Hell".equals(terrainTheme)) { + // Oceans generation + if (val < -0.8) { + if (terrainTheme == "Hell") { map[i] = Tiles.get("Lava").id; } else { - if (tval > -0.20 && hval > 0.60) { + if (tval > -0.20 && hval > 0.60) { map[i] = Tiles.get("Ice").id; } else { map[i] = Tiles.get("Water").id; } } - } else if (val > 1.2 && mval > -1.8) { - if (tval > 0.30 && hval < 0.16 && val > 0.41) { + + // Mountains generation + } else if (val > 1.2 && mval > -1.5) { + // Terrain themes + if (terrainTheme == "Desert") { + if (tval > 0.30 && hval < 0.16 && val > 0.41) { + map[i] = Tiles.get("Sand Rock").id; + } else { + map[i] = Tiles.get("Up Rock").id; + } + } else if (terrainTheme == "Tundra") { + map[i] = Tiles.get("Up Rock").id; + } + + // Normal generation + else if (tval > 0.30 && hval < 0.16 && val > 0.41) { map[i] = Tiles.get("Sand Rock").id; } else { map[i] = Tiles.get("Up Rock").id; } + + // Terrain generation } else { - if (tval > 0.30 && hval < 0.16 && val > 0.41) { - map[i] = Tiles.get("sand").id; + // Terrain themes + if (terrainTheme == "Desert") { + if (tval > -0.45 && hval > -0.95 && val > -0.16) { + map[i] = Tiles.get("Sand").id; + } else { + map[i] = Tiles.get("Grass").id; + } + } else if (terrainTheme == "Tundra") { + if (tval > -0.45 && hval > -0.95) { + map[i] = Tiles.get("Snow").id; + } else { + map[i] = Tiles.get("Grass").id; + } + } + + // Normal generation + else if (tval > 0.30 && hval < 0.16 && val > 0.41) { + map[i] = Tiles.get("Sand").id; } else { if (tval > -0.20 && hval > 0.60) { - map[i] = Tiles.get("snow").id; + map[i] = Tiles.get("Snow").id; } else { - map[i] = Tiles.get("grass").id; + map[i] = Tiles.get("Grass").id; } } } @@ -436,9 +468,8 @@ private static short[][] createTopMap(int w, int h) { // create surface map } else { map[index] = Tiles.get("Pine Tree").id; } - } - - if (map[index] == Tiles.get("Grass").id) { + + } else if (map[index] == Tiles.get("Grass").id) { if (random.nextBoolean()) { map[index] = Tiles.get("Oak Tree").id; } else { @@ -449,8 +480,6 @@ private static short[][] createTopMap(int w, int h) { // create surface map } } - - // VEGETATION GENERATION STEP LoadingDisplay.setMessage("Generating meadow"); for (int i = 0; i < flowerThreshold; i++) { @@ -485,6 +514,7 @@ private static short[][] createTopMap(int w, int h) { // create surface map } } } + for (int i = 0; i < flowerThreshold; i++) { int x = random.nextInt(w); int y = random.nextInt(h); @@ -495,38 +525,43 @@ private static short[][] createTopMap(int w, int h) { // create surface map int yy = y + random.nextInt(5) - random.nextInt(5); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { - if (map[xx + yy * w] == Tiles.get("Grass").id) { - map[xx + yy * w] = Tiles.get("Lawn").id; - data[xx + yy * w] = (short) (pos + random.nextInt(4) * 16); + int index = xx + yy * w; + + if (map[index] == Tiles.get("Grass").id) { + map[index] = Tiles.get("Lawn").id; + data[index] = (short) (pos + random.nextInt(4) * 16); } } } } - - // add cactus to sand + for (int i = 0; i < (fullSize / 100); i++) { int x = random.nextInt(w); int y = random.nextInt(h); - for (int j = 0; j < 5; j++) { + for (int j = 0; j < 8; j++) { int xx = x + random.nextInt(15) + random.nextInt(10) + random.nextInt(5); int yy = y + random.nextInt(15) + random.nextInt(10) + random.nextInt(5); if (xx >= 0 && yy >= 0 && xx < w && yy < h) { - if (map[xx + yy * w] == Tiles.get("Sand").id && random.nextInt(6) == 3) { - map[xx + yy * w] = Tiles.get("Cactus").id; + int index = xx + yy * w; + if (map[index] == Tiles.get("Sand").id && random.nextInt(6) == 3) { + map[index] = Tiles.get("Cactus").id; } } } } + // add ice spikes to snow for (int i = 0; i < (fullSize / 100); i++) { int xx = random.nextInt(w); int yy = random.nextInt(h); + if (xx >= 0 && yy >= 0 && xx < w && yy < h) { - if (map[xx + yy * w] == Tiles.get("Snow").id) { - map[xx + yy * w] = Tiles.get("Ice Spike").id; + int index = xx + yy * w; + if (map[index] == Tiles.get("Snow").id) { + map[index] = Tiles.get("Ice Spike").id; } } } @@ -535,12 +570,15 @@ private static short[][] createTopMap(int w, int h) { // create surface map for (int i = 0; i < (fullSize / 100); i++) { int x = random.nextInt(w); int y = random.nextInt(h); + for (int j = 0; j < 20; j++) { int xx = x + random.nextInt(2) - random.nextInt(2); int yy = y + random.nextInt(2) - random.nextInt(2); + if (xx >= 0 && yy >= 0 && xx < w && yy < h) { - if (map[xx + yy * w] == Tiles.get("Snow").id) { - map[xx + yy * w] = Tiles.get("Ice Spike").id; + int index = xx + yy * w; + if (map[index] == Tiles.get("Snow").id) { + map[index] = Tiles.get("Ice Spike").id; } } } @@ -549,12 +587,15 @@ private static short[][] createTopMap(int w, int h) { // create surface map for (int i = 0; i < (fullSize / 100); i++) { int x = random.nextInt(w); int y = random.nextInt(h); + for (int j = 0; j < 20; j++) { int xx = x + random.nextInt(2) - random.nextInt(2); int yy = y + random.nextInt(2) - random.nextInt(2); + if (xx >= 0 && yy >= 0 && xx < w && yy < h) { - if (map[xx + yy * w] == Tiles.get("Snow").id) { - map[xx + yy * w] = Tiles.get("Ice").id; + int index = xx + yy * w; + if (map[index] == Tiles.get("Snow").id) { + map[index] = Tiles.get("Ice").id; } } } @@ -564,7 +605,7 @@ private static short[][] createTopMap(int w, int h) { // create surface map for (int j = 0; j < h; j++) { for (int x = 0; x < w; x++) { int index = x + j * w; - if (map[index] != Tiles.get("Water").id && ( + if ((map[index] != Tiles.get("Water").id || map[index] != Tiles.get("Lava").id) && ( map[index] == Tiles.get("Grass").id || map[index] == Tiles.get("Oak Tree").id || map[index] == Tiles.get("Daisy").id || @@ -579,9 +620,15 @@ private static short[][] createTopMap(int w, int h) { // create surface map for (int tx = x - 1; tx <= x + 1; tx++) { for (int ty = j - 1; ty <= j + 1; ty++) { if ((tx >= 0 && ty >= 0 && tx < w && ty < h) && (tx != x || ty != j)) { + // Normal theme if (map[tx + ty * w] == Tiles.get("Water").id) { replace = true; break; + + // Hell theme + } else if (map[tx + ty * w] == Tiles.get("Lava").id) { + replace = true; + break; } } } @@ -593,6 +640,33 @@ private static short[][] createTopMap(int w, int h) { // create surface map } } } + + for (int j = 0; j < h; j++) { + for (int x = 0; x < w; x++) { + int index = x + j * w; + if (map[index] != Tiles.get("Up Rock").id && ( + map[index] == Tiles.get("Sand Rock").id)) { + boolean replace = false; + + // Check the tiles around the current position + for (int tx = x - (2 + random.nextInt(1)); tx <= x + (2 + random.nextInt(1)); tx++) { + for (int ty = j - (2 + random.nextInt(1)); ty <= j + (2 + random.nextInt(1)); ty++) { + if ((tx >= 0 && ty >= 0 && tx < w && ty < h) && (tx != x || ty != j)) { + if (map[tx + ty * w] == Tiles.get("Up Rock").id) { + replace = true; + break; + } + } + } + } + + if (replace) { + map[index] = Tiles.get("Sand").id; + } + } + } + } + LoadingDisplay.setMessage("Generating mountains"); @@ -622,7 +696,7 @@ private static short[][] createTopMap(int w, int h) { // create surface map } } } - + for (int j = 0; j < h; j++) { for (int x = 0; x < w; x++) { // if there are Grass tiles or Trees in front of the Sand tiles, if so, replace them with Grass if (map[x + j * w] != Tiles.get("Sand").id && map[x + j * w] == Tiles.get("Grass").id || @@ -648,8 +722,7 @@ private static short[][] createTopMap(int w, int h) { // create surface map } } } - - + for (int j = 0; j < h; j++) { for (int x = 0; x < w; x++) { // if there are Snow tiles or Trees in front of the Ice tiles, if so, replace them with snow if (map[x + j * w] != Tiles.get("Ice").id && map[x + j * w] == Tiles.get("Snow").id || @@ -675,9 +748,9 @@ private static short[][] createTopMap(int w, int h) { // create surface map } } } - + for (int j = 0; j < h; j++) { - for (int x = 0; x < w; x++) { // if there are Snow tiles or Trees in front of the Grass tiles, if so, replace them with Snow + for (int x = 0; x < w; x++) { // if there are Snow tiles or Trees in front of the Grass tiles, if so, replace them with Snow if (map[x + j * w] != Tiles.get("Grass").id && map[x + j * w] == Tiles.get("Snow").id || map[x + j * w] != Tiles.get("Grass").id && map[x + j * w] == Tiles.get("Fir Tree").id || map[x + j * w] != Tiles.get("Grass").id && map[x + j * w] == Tiles.get("Pine Tree").id) { @@ -702,10 +775,9 @@ private static short[][] createTopMap(int w, int h) { // create surface map // Generate the stairs inside the rock int stairsCount = 0; - int stairsRadius = 15; // Logger.debug("Generating stairs for surface level..."); - + stairsLoop: for (int i = 0; i < (fullSize / 100); i++) { // loops a certain number of times, more for bigger world @@ -1077,7 +1149,7 @@ private static short[][] createSkyMap(int w, int h) { } // Generate skygrass in cloud tile - LoadingDisplay.setMessage("Generating sky highlands"); + LoadingDisplay.setMessage("Generating clouds"); for (int i = 0; i < heavenThreshold; i++) { int xs = halfWidth - 22; // divide the 60 (down) by 2 -> 30 to center int ys = halfHeight - 22; @@ -1105,7 +1177,7 @@ private static short[][] createSkyMap(int w, int h) { // Make the central island // Logger.debug("Generating central island ..."); - LoadingDisplay.setMessage("Generating sky mountains"); + LoadingDisplay.setMessage("Generating mountains"); for (int i = 0; i < heavenThreshold; i++) { int xs = halfWidth - 22; int ys = halfHeight - 22; @@ -1131,8 +1203,6 @@ private static short[][] createSkyMap(int w, int h) { } } - // Generate the ferrosite edge for the central island - LoadingDisplay.setMessage("Generating sky midlands"); for (int i = 0; i < heavenThreshold; i++) { int xs = halfWidth - 38; // center position int ys = halfHeight - 40; @@ -1410,8 +1480,6 @@ public static void main(String[] args) { boolean hasquit = false; while (!hasquit) { // stop the loop and close the program - - long startNanoTime = System.nanoTime(); int w = 256, h = w; int mapScale = 0; @@ -1423,9 +1491,13 @@ public static void main(String[] args) { int lvl = maplvls[idx++ % maplvls.length]; if (lvl > 2 || lvl < -4) continue; - - short[][] fullmap = LevelGen.createAndValidateMap(w, h, -3, random.nextLong()); - + + long startNanoTime = System.nanoTime(); + + short[][] fullmap = LevelGen.createAndValidateMap(w, h, 0, random.nextLong()); + + long endSecondsTime = (System.nanoTime() - startNanoTime) >> 30; + if (fullmap == null) continue; short[] map = fullmap[0]; @@ -1459,7 +1531,7 @@ public static void main(String[] args) { else if (map[i] == Tiles.get("Magma").id) pixels[i] = 0xC83C20; else if (map[i] == Tiles.get("Rock").id) pixels[i] = 0x7a7a7a; else if (map[i] == Tiles.get("Up Rock").id) pixels[i] = 0x939393; - else if (map[i] == Tiles.get("Sand Rock").id) pixels[i] = 0x777451; + else if (map[i] == Tiles.get("Sand Rock").id) pixels[i] = 0x7a7a7a; else if (map[i] == Tiles.get("Iron Ore").id) pixels[i] = 0x452728; else if (map[i] == Tiles.get("Gold Ore").id) pixels[i] = 0x948028; @@ -1515,12 +1587,9 @@ public static void main(String[] args) { else pixels[i] = 0x000000; } } - - long endSecondsTime = (System.nanoTime() - startNanoTime) >> 30; - String finalGenTime = "took " + endSecondsTime + "s"; - + // Print the seed and the elapsed time - Logger.debug("Generated level {}, with seed {}, {}", lvl, worldSeed, finalGenTime); + Logger.debug("Generated level {}, with seed {}, took {}s", lvl, worldSeed, endSecondsTime); img.setRGB(0, 0, w, h, pixels, 0, w); // Sets the pixels into the image diff --git a/src/main/java/minicraft/level/Structure.java b/src/main/java/minicraft/level/Structure.java index 9b414004..0093f45e 100644 --- a/src/main/java/minicraft/level/Structure.java +++ b/src/main/java/minicraft/level/Structure.java @@ -209,7 +209,7 @@ public int hashCode() { "WFFFWGGGWSTTTSWGGGWFFFW\n" + "WFFFDGGGTTTTTTTGGGDFFFW\n" + "WFFFWGGGWSTTTSWGGGWFFFW\n" + - "WWFvW**GWSSTSSWG**WFFWW\n" + + "WWFFW**GWSSTSSWG**WFFWW\n" + "*WFWW**GWWWTWWWG**WWFW*\n" + "*WFW***GGGGGGGGG***WFW*\n" + "*WWW******GGG******WWW*\n" + @@ -226,9 +226,9 @@ public int hashCode() { villageCrops.setData("F:Oak Planks,W:Oak Wall,D:Oak Door,G:Grass,O:Path,C:potato,Z:wheat,X:Water", "WWWWWO*O**WWWWW\n" + "WFFFW*OO**WFFFW\n" + - "WFFFDOO*OODFFFW\n" + + "WFFFDOO*OOWFFFW\n" + "WFFFW*OO**WFFFW\n" + - "WWWWW**OO*WWWWW\n" + + "WWWWW**OO*WWDWW\n" + "**OO**OO*OO*OO*\n" + "*OO*O*OOO**OO**\n" + "OO*OOOOGOOOO*OO\n" + diff --git a/src/main/java/minicraft/level/tile/LawnTile.java b/src/main/java/minicraft/level/tile/LawnTile.java index c7ee7b5a..6a3e14ae 100644 --- a/src/main/java/minicraft/level/tile/LawnTile.java +++ b/src/main/java/minicraft/level/tile/LawnTile.java @@ -65,7 +65,6 @@ public boolean interact(Level level, int x, int y, Player player, Item item, Dir if (toolType == ToolType.Shovel) { if (player.payStamina(2 - tool.level) && tool.payDurability()) { level.setTile(x, y, Tiles.get("Grass")); - //Sound.genericHurt.playOnDisplay(); if (random.nextInt(3) == 0) { // 28% chance to drop Seeds level.dropItem((x << 4) + 8, (y << 4) + 8, 2, Items.get("Seeds")); diff --git a/src/main/java/minicraft/level/tile/PathTile.java b/src/main/java/minicraft/level/tile/PathTile.java index 2a2bff32..5c4ddc2e 100644 --- a/src/main/java/minicraft/level/tile/PathTile.java +++ b/src/main/java/minicraft/level/tile/PathTile.java @@ -1,5 +1,6 @@ package minicraft.level.tile; +import minicraft.core.io.Sound; import minicraft.entity.Direction; import minicraft.entity.mob.Player; import minicraft.graphic.Screen; @@ -30,8 +31,8 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D if (toolType == ToolType.Shovel) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { + Sound.playAt("genericHurt", xt << 4, yt << 4); level.setTile(xt, yt, Tiles.get("Hole")); - //Sound.genericHurt.playOnLevel(xt << 4, yt << 4); level.dropItem((xt << 4) + 8, (yt << 4) + 8, Items.get("Dirt")); return true; } diff --git a/src/main/java/minicraft/level/tile/SaplingTile.java b/src/main/java/minicraft/level/tile/SaplingTile.java index 121ba929..ea3a8ef6 100644 --- a/src/main/java/minicraft/level/tile/SaplingTile.java +++ b/src/main/java/minicraft/level/tile/SaplingTile.java @@ -1,6 +1,5 @@ package minicraft.level.tile; -import minicraft.core.io.Sound; import minicraft.entity.Direction; import minicraft.entity.mob.Mob; import minicraft.graphic.Screen; @@ -38,7 +37,6 @@ public boolean tick(Level level, int x, int y) { // Don't grow if there is an entity on this tile. if (age > 100 && !level.isEntityOnTile(x, y)) { level.setTile(x, y, growsTo); // TODO: add grow sound - Sound.playAt("genericHurt", x, y); } else { level.setData(x, y, age); } @@ -47,7 +45,6 @@ public boolean tick(Level level, int x, int y) { @Override public boolean hurt(Level level, int x, int y, Mob source, int hurtDamage, Direction attackDir) { - Sound.playAt("genericHurt", x, y); level.setTile(x, y, onType); return true; } diff --git a/src/main/java/minicraft/level/tile/SkyFernTile.java b/src/main/java/minicraft/level/tile/SkyFernTile.java index 2fe44f18..cbdf43ef 100644 --- a/src/main/java/minicraft/level/tile/SkyFernTile.java +++ b/src/main/java/minicraft/level/tile/SkyFernTile.java @@ -79,8 +79,8 @@ public boolean interact(Level level, int x, int y, Player player, Item item, Dir ToolItem tool = (ToolItem) item; if (tool.type == ToolType.Shovel) { if (player.payStamina(2 - tool.level) && tool.payDurability()) { - Sound.playAt("genericHurt", x, y); + Sound.playAt("genericHurt", x << 4, y << 4); level.setTile(x, y, Tiles.get("Sky Grass")); if (random.nextInt(20) == 10) { // 20% chance to drop sky seeds diff --git a/src/main/java/minicraft/level/tile/SkyGrassTile.java b/src/main/java/minicraft/level/tile/SkyGrassTile.java index e2ca1094..8b6f59da 100644 --- a/src/main/java/minicraft/level/tile/SkyGrassTile.java +++ b/src/main/java/minicraft/level/tile/SkyGrassTile.java @@ -76,11 +76,14 @@ public boolean interact(Level level, int xt, int yt, Player player, Item item, D if (toolType == ToolType.Shovel) { if (player.payStamina(4 - tool.level) && tool.payDurability()) { + Sound.playAt("genericHurt", xt << 4, yt << 4); level.setTile(xt, yt, Tiles.get("Ferrosite")); // would allow you to shovel cloud, I think. + if (random.nextInt(20) == 0) { // 20% chance to drop sky seeds level.dropItem((xt << 4) + 8, (yt << 4) + 8, 2, Items.get("Sky Seeds")); } + level.dropItem((xt << 4) + 8, (yt << 4) + 8, 1, 2, Items.get("Cloud")); return true; } diff --git a/src/main/java/minicraft/level/tile/SkyLawnTile.java b/src/main/java/minicraft/level/tile/SkyLawnTile.java index 5c51be63..bcc45c42 100644 --- a/src/main/java/minicraft/level/tile/SkyLawnTile.java +++ b/src/main/java/minicraft/level/tile/SkyLawnTile.java @@ -39,7 +39,6 @@ public boolean interact(Level level, int x, int y, Player player, Item item, Dir if (tool.type == ToolType.Shovel) { if (player.payStamina(2 - tool.level) && tool.payDurability()) { level.setTile(x, y, Tiles.get("Sky grass")); - //Sound.genericHurt.playOnDisplay(); if (random.nextInt(20) == 1) { // 20% chance to drop sky seeds level.dropItem((x << 4) + 8, (y << 4) + 8, Items.get("Sky Seeds")); diff --git a/src/main/java/minicraft/level/tile/SproutTile.java b/src/main/java/minicraft/level/tile/SproutTile.java index ff0e228a..7d096ff3 100644 --- a/src/main/java/minicraft/level/tile/SproutTile.java +++ b/src/main/java/minicraft/level/tile/SproutTile.java @@ -1,6 +1,5 @@ package minicraft.level.tile; -import minicraft.core.io.Sound; import minicraft.entity.Direction; import minicraft.entity.mob.Mob; import minicraft.graphic.Screen; @@ -51,7 +50,6 @@ public boolean tick(Level level, int x, int y) { @Override public boolean hurt(Level level, int x, int y, Mob source, int hurtDamage, Direction attackDir) { - Sound.playAt("genericHurt", x, y); level.setTile(x, y, onType); return true; } diff --git a/src/main/java/minicraft/level/tile/farming/CarrotTile.java b/src/main/java/minicraft/level/tile/farming/CarrotTile.java index fd3f5192..51ce5637 100644 --- a/src/main/java/minicraft/level/tile/farming/CarrotTile.java +++ b/src/main/java/minicraft/level/tile/farming/CarrotTile.java @@ -38,9 +38,8 @@ protected void harvest(Level level, int x, int y, Entity entity) { if (age >= 50 && entity instanceof Player) { ((Player) entity).addScore(random.nextInt(5) + 1); } - - // Play sound. - Sound.playAt("genericHurt", x, y); + + Sound.playAt("genericHurt", x << 4, y << 4); if (random.nextBoolean()) { level.setTile(x, y, Tiles.get("Dirt")); diff --git a/src/main/java/minicraft/level/tile/farming/ParsnipTile.java b/src/main/java/minicraft/level/tile/farming/ParsnipTile.java index aac5a52c..3a8d4804 100644 --- a/src/main/java/minicraft/level/tile/farming/ParsnipTile.java +++ b/src/main/java/minicraft/level/tile/farming/ParsnipTile.java @@ -1,6 +1,5 @@ package minicraft.level.tile.farming; -import minicraft.core.io.Sound; import minicraft.entity.Entity; import minicraft.entity.ItemEntity; import minicraft.entity.mob.Player; @@ -55,8 +54,6 @@ protected void harvest(Level level, int x, int y, Entity entity) { } else if (age >= maxAge - maxAge / 5) { count = random.nextInt(2); } - - Sound.playAt("genericHurt", x, y); level.dropItem((x << 4) + 8, (y << 4) + 8, count, Items.get("Gold Carrot")); diff --git a/src/main/java/minicraft/level/tile/farming/Plant.java b/src/main/java/minicraft/level/tile/farming/Plant.java index f2f5ff49..7fddb72d 100644 --- a/src/main/java/minicraft/level/tile/farming/Plant.java +++ b/src/main/java/minicraft/level/tile/farming/Plant.java @@ -87,7 +87,7 @@ protected void harvest(Level level, int x, int y, Entity entity) { ((Player) entity).addScore(random.nextInt(5) + 1); } - Sound.playAt("genericHurt", x, y); + Sound.playAt("genericHurt", x << 4, y << 4); if (random.nextBoolean()) { level.setTile(x, y, Tiles.get("Dirt")); diff --git a/src/main/java/minicraft/level/tile/farming/PotatoTile.java b/src/main/java/minicraft/level/tile/farming/PotatoTile.java index a09905f9..65b4b2d5 100644 --- a/src/main/java/minicraft/level/tile/farming/PotatoTile.java +++ b/src/main/java/minicraft/level/tile/farming/PotatoTile.java @@ -1,6 +1,5 @@ package minicraft.level.tile.farming; -import minicraft.core.io.Sound; import minicraft.entity.Entity; import minicraft.entity.ItemEntity; import minicraft.entity.mob.Player; @@ -60,9 +59,6 @@ protected void harvest(Level level, int x, int y, Entity entity) { if (age >= maxAge && entity instanceof Player) { ((Player) entity).addScore(random.nextInt(4) + 1); } - - // Play sound - Sound.playAt("genericHurt", x, y); if (random.nextBoolean()) { level.setTile(x, y, Tiles.get("Dirt")); diff --git a/src/main/java/minicraft/level/tile/farming/SkyPlant.java b/src/main/java/minicraft/level/tile/farming/SkyPlant.java index cb670e6a..5579a692 100644 --- a/src/main/java/minicraft/level/tile/farming/SkyPlant.java +++ b/src/main/java/minicraft/level/tile/farming/SkyPlant.java @@ -85,7 +85,7 @@ protected void harvest(Level level, int x, int y, Entity entity) { count = random.nextInt(2) + 1; } - Sound.playAt("genericHurt", x, y); + Sound.playAt("genericHurt", x << 4, y << 4); level.dropItem((x << 4) + 8, (y << 4) + 8, count, Items.get(name)); diff --git a/src/main/java/minicraft/level/tile/farming/SkyWartTile.java b/src/main/java/minicraft/level/tile/farming/SkyWartTile.java index 13c48b65..01031e70 100644 --- a/src/main/java/minicraft/level/tile/farming/SkyWartTile.java +++ b/src/main/java/minicraft/level/tile/farming/SkyWartTile.java @@ -54,7 +54,7 @@ protected void harvest(Level level, int x, int y, Entity entity) { count = random.nextInt(2); } - Sound.playAt("genericHurt", x, y); + Sound.playAt("genericHurt", x << 4, y << 4); level.dropItem((x << 4) + 8, (y << 4) + 8, count, Items.get("Sky wart")); diff --git a/src/main/java/minicraft/level/tile/farming/WheatTile.java b/src/main/java/minicraft/level/tile/farming/WheatTile.java index 5a739868..fc534929 100644 --- a/src/main/java/minicraft/level/tile/farming/WheatTile.java +++ b/src/main/java/minicraft/level/tile/farming/WheatTile.java @@ -66,8 +66,7 @@ protected void harvest(Level level, int x, int y, Entity entity) { ((Player) entity).addScore(random.nextInt(4) + 1); } - // Play sound. - Sound.playAt("genericHurt", x, y); + Sound.playAt("genericHurt", x << 4, y << 4); if (random.nextBoolean()) { level.setTile(x, y, Tiles.get("Dirt")); diff --git a/src/main/java/minicraft/network/Network.java b/src/main/java/minicraft/network/Network.java index fcabb11f..32d97203 100644 --- a/src/main/java/minicraft/network/Network.java +++ b/src/main/java/minicraft/network/Network.java @@ -10,11 +10,11 @@ import kong.unirest.JsonNode; import kong.unirest.Unirest; import kong.unirest.UnirestException; -import minicraft.core.Action; import minicraft.core.Game; import minicraft.core.VersionInfo; import minicraft.entity.Entity; import minicraft.level.Level; +import minicraft.util.Action; public class Network extends Game { private Network() {} diff --git a/src/main/java/minicraft/saveload/Load.java b/src/main/java/minicraft/saveload/Load.java index bb2876c2..fa361716 100644 --- a/src/main/java/minicraft/saveload/Load.java +++ b/src/main/java/minicraft/saveload/Load.java @@ -67,12 +67,6 @@ import minicraft.entity.mob.Slime; import minicraft.entity.mob.Snake; import minicraft.entity.mob.Zombie; -import minicraft.entity.particle.BrightParticle; -import minicraft.entity.particle.CloudParticle; -import minicraft.entity.particle.FireParticle; -import minicraft.entity.particle.HeartParticle; -import minicraft.entity.particle.SmashParticle; -import minicraft.entity.particle.SplashParticle; import minicraft.entity.particle.TextParticle; import minicraft.graphic.Color; import minicraft.item.ArmorItem; @@ -425,9 +419,8 @@ private void loadPrefs(String filename) { Settings.set("sound", json.getBoolean("sound")); Settings.set("autosave", json.getBoolean("autosave")); Settings.set("diff", json.has("diff") ? json.getString("diff") : "Normal"); + Settings.set("fps", json.getInt("fps")); - Settings.set("vsync", json.getBoolean("vsync")); - Settings.set("bossbar", json.has("diff") ? json.getString("diff") : "On screen"); Settings.set("particles", json.getBoolean("particles")); Settings.set("shadows", json.getBoolean("shadows")); @@ -1090,7 +1083,6 @@ private static Entity getEntity(String string, int moblvl) { case "Knight": return new Knight(moblvl); case "OldGolem": return new OldGolem(moblvl); case "Snake": return new Snake(moblvl); - case "Cthulhu": return new EyeQueen(moblvl); // Check... case "EyeQueen": return new EyeQueen(moblvl); case "DeepGuardian": return new Keeper(moblvl); case "Keeper": return new Keeper(moblvl); @@ -1107,7 +1099,6 @@ private static Entity getEntity(String string, int moblvl) { case "Anvil": return new Crafter(Crafter.Type.Anvil); case "Enchanter": return new Crafter(Crafter.Type.Enchanter); case "Stonecutter": return new Crafter(Crafter.Type.Stonecutter); - case "Assembler": return new Crafter(Crafter.Type.Assembler); case "Brewery": return new Crafter(Crafter.Type.Brewery); case "Loom": return new Crafter(Crafter.Type.Loom); case "Furnace": return new Crafter(Crafter.Type.Furnace); @@ -1121,15 +1112,6 @@ private static Entity getEntity(String string, int moblvl) { case "Arrow": return new Arrow(new Skeleton(0), 0, 0, Direction.NONE, 0); case "ItemEntity": return new ItemEntity(Items.get("unknown"), 0, 0); - // Load Particles - case "FireParticle": return new FireParticle(0, 0); - case "SplashParticle": return new SplashParticle(0, 0); - case "HeartParticle": return new HeartParticle(0, 0); - case "BrightParticle": return new BrightParticle(0, 0); - case "SmashParticle": return new SmashParticle(0, 0); - case "CloudParticle": return new CloudParticle(0, 0); - case "TextParticle": return new TextParticle("", 0, 0, 0); - default: System.err.println("LOAD ERROR: unknown or outdated entity requested: " + string); return null; diff --git a/src/main/java/minicraft/saveload/Save.java b/src/main/java/minicraft/saveload/Save.java index 32a5f616..c6318598 100644 --- a/src/main/java/minicraft/saveload/Save.java +++ b/src/main/java/minicraft/saveload/Save.java @@ -209,8 +209,6 @@ private void writePrefs() { json.put("autosave", String.valueOf(Settings.get("autosave"))); json.put("fps", String.valueOf(Settings.get("fps"))); - json.put("vsync", String.valueOf(Settings.get("vsync"))); - json.put("bossbar", Settings.get("bossbar")); json.put("particles", String.valueOf(Settings.get("particles"))); json.put("shadows", String.valueOf(Settings.get("shadows"))); @@ -220,7 +218,6 @@ private void writePrefs() { json.put("savedUUID", MultiplayerDisplay.savedUUID); json.put("savedUsername", MultiplayerDisplay.savedUsername); - json.put("keymap", new JSONArray(Game.input.getKeyPrefs())); json.put("texturePack", TexturePackDisplay.getLoadedPack()); diff --git a/src/main/java/minicraft/screen/BookDisplay.java b/src/main/java/minicraft/screen/BookDisplay.java index 33217dc4..d725c5b7 100644 --- a/src/main/java/minicraft/screen/BookDisplay.java +++ b/src/main/java/minicraft/screen/BookDisplay.java @@ -11,6 +11,7 @@ import minicraft.graphic.Screen; import minicraft.graphic.SpriteSheet; import minicraft.screen.entry.StringEntry; +import minicraft.util.BookData; public class BookDisplay extends Display { @@ -61,20 +62,38 @@ public BookDisplay(String book, boolean hasTitle) { Menu.Builder builder = new Menu.Builder(true, spacing, RelPos.CENTER); - Menu pageCount = builder - .setPositioning(new Point(Screen.w / 2, 48 + spacing), RelPos.BOTTOM) - .setSize(maxX - minX + SpriteSheet.boxWidth * 2, maxY - minY + SpriteSheet.boxWidth * 2) - .setShouldRender(false) - .setBackground(19) - .createMenu(); + Menu pageCount = builder.createMenu(); + + if (book == BookData.Grimoire) { + pageCount = builder + .setPositioning(new Point(Screen.w / 2, 48 + spacing), RelPos.BOTTOM) + .setSize(maxX - minX + SpriteSheet.boxWidth * 2, maxY - minY + SpriteSheet.boxWidth * 2) + .setShouldRender(false) + .setBackground(18) + .createMenu(); + } else { + pageCount = builder + .setPositioning(new Point(Screen.w / 2, 48 + spacing), RelPos.BOTTOM) + .setSize(maxX - minX + SpriteSheet.boxWidth * 2, maxY - minY + SpriteSheet.boxWidth * 2) + .setShouldRender(false) + .setBackground(19) + .createMenu(); + } 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(); + + if (book == BookData.Grimoire) { + for (int i = 0; i < lines.length; i++) { + menus[i + pageOffset] = builder.setEntries(StringEntry.useLines(Color.GREEN, lines[i])).createMenu(); + } + } else { + for (int i = 0; i < lines.length; i++) { + menus[i + pageOffset] = builder.setEntries(StringEntry.useLines(Color.WHITE, lines[i])).createMenu(); + } } menus[page + pageOffset].shouldRender = true; diff --git a/src/main/java/minicraft/screen/CreditsDisplay.java b/src/main/java/minicraft/screen/CreditsDisplay.java index fdd68c13..0ecc53e0 100644 --- a/src/main/java/minicraft/screen/CreditsDisplay.java +++ b/src/main/java/minicraft/screen/CreditsDisplay.java @@ -57,65 +57,65 @@ public void render(Screen screen) { Font.draw("--------[ Aircraft ]--------", screen, sh - 41, 190 - line, titleColor); - Font.draw("Aircraft by:", screen, sh - 41, 210 - line, categoryColor); - Font.draw(" - TheBigEye", screen, sh - 41, 220 - line, nameColor); + Font.draw(" Aircraft by:", screen, sh - 41, 210 - line, categoryColor); + Font.draw(" - TheBigEye", screen, sh - 41, 220 - line, nameColor); - Font.draw("Minicraft Plus by:", screen, sh - 41, 235 - line, categoryColor); - Font.draw(" - Davideesk", screen, sh - 41, 245 - line, nameColor); - Font.draw(" - Dillyg10", screen, sh - 41, 255 - line, nameColor); + Font.draw(" Minicraft Plus by:", screen, sh - 41, 235 - line, categoryColor); + Font.draw(" - Davideesk", screen, sh - 41, 245 - line, nameColor); + Font.draw(" - Dillyg10", screen, sh - 41, 255 - line, nameColor); - Font.draw("Minicraft by:", screen, sh - 41, 270 - line, categoryColor); - Font.draw(" - Markus persson", screen, sh - 41, 280 - line, nameColor); + Font.draw(" Minicraft by:", screen, sh - 41, 270 - line, categoryColor); + Font.draw(" - Markus persson", screen, sh - 41, 280 - line, nameColor); Font.draw(" -[ Desing ]- ", screen, sh - 41, 300 - line, sectionColor); - Font.draw("Textures artists:", screen, sh - 41, 320 - line, categoryColor); - Font.draw(" - TheBigEye", screen, sh - 41, 330 - line, nameColor); - Font.draw(" - Sanzo", screen, sh - 41, 340 - line, nameColor); - Font.draw(" - GameCreator2004", screen, sh - 41, 350 - line, nameColor); - Font.draw(" - RiverOaken (Rcraft textures)", screen, sh - 41, 360 - line, nameColor); + Font.draw(" Textures artists:", screen, sh - 41, 320 - line, categoryColor); + Font.draw(" - TheBigEye", screen, sh - 41, 330 - line, nameColor); + Font.draw(" - Sanzo", screen, sh - 41, 340 - line, nameColor); + Font.draw(" - GameCreator2004", screen, sh - 41, 350 - line, nameColor); + Font.draw(" - RiverOaken (Rcraft textures)", screen, sh - 41, 360 - line, nameColor); - Font.draw("Music artists:", screen, sh - 41, 375 - line, categoryColor); - Font.draw(" - TheBigEye", screen, sh - 41, 385 - line, nameColor); - Font.draw(" - Ed B. Martinez (Minicraft flash)", screen, sh - 41, 395 - line, nameColor); + Font.draw(" Music artists:", screen, sh - 41, 375 - line, categoryColor); + Font.draw(" - TheBigEye", screen, sh - 41, 385 - line, nameColor); + Font.draw(" - Ed B. Martinez (Minicraft flash)", screen, sh - 41, 395 - line, nameColor); - Font.draw("Sounds:", screen, sh - 41, 410 - line, categoryColor); - Font.draw(" - TheBigEye", screen, sh - 41, 420 - line, nameColor); - Font.draw(" - Markus persson (Minicraft)", screen, sh - 41, 430 - line, nameColor); + Font.draw(" Sounds:", screen, sh - 41, 410 - line, categoryColor); + Font.draw(" - TheBigEye", screen, sh - 41, 420 - line, nameColor); + Font.draw(" - Markus persson (Minicraft)", screen, sh - 41, 430 - line, nameColor); - Font.draw("GUI desing:", screen, sh - 41, 445 - line, categoryColor); - Font.draw(" - TheBigEye", screen, sh - 41, 455 - line, nameColor); + Font.draw(" GUI desing:", screen, sh - 41, 445 - line, categoryColor); + Font.draw(" - TheBigEye", screen, sh - 41, 455 - line, nameColor); Font.draw(" >{ Programming }; ", screen, sh - 41, 475 - line, sectionColor); - Font.draw("Main developer:", screen, sh - 41, 495 - line, categoryColor); - Font.draw(" - TheBigEye", screen, sh - 41, 505 - line, nameColor); - - Font.draw("Code contributions:", screen, sh - 41, 520 - line, categoryColor); - Font.draw(" - A.L.I.C.E", screen, sh - 41, 530 - line, nameColor); - Font.draw(" - UdhavKumar", screen, sh - 41, 540 - line, nameColor); - Font.draw(" - pelletsstarPL", screen, sh - 41, 550 - line, nameColor); - - Font.draw("Thanks to...", screen, sh - 41, 570 - line, sectionColor); - Font.draw(" - pelletsstarPL", screen, sh - 41, 580 - line, nameColor); - Font.draw(" - terrarianmisha", screen, sh - 41, 590 - line, nameColor); - Font.draw(" - Litorom1", screen, sh - 41, 600 - line, nameColor); - Font.draw(" - Felix pants", screen, sh - 41, 610 - line, nameColor); - Font.draw(" - benichi (why not, xd)", screen, sh - 41, 620 - line, nameColor); - Font.draw(" - Fusyon", screen, sh - 41, 630 - line, nameColor); - Font.draw(" - ChrisJ", screen, sh - 41, 640 - line, nameColor); - Font.draw(" - dafist", screen, sh - 41, 650 - line, nameColor); - Font.draw(" - EduardoPlayer13", screen, sh - 41, 660 - line, nameColor); - Font.draw(" - Makkkkus", screen, sh - 41, 670 - line, nameColor); - Font.draw(" - BoxDude", screen, sh - 41, 680 - line, nameColor); - Font.draw(" - MrToad", screen, sh - 41, 690 - line, nameColor); - Font.draw(" - itayfeder", screen, sh - 41, 700 - line, nameColor); + Font.draw(" Main developer:", screen, sh - 41, 495 - line, categoryColor); + Font.draw(" - TheBigEye", screen, sh - 41, 505 - line, nameColor); + + Font.draw(" Code contributions:", screen, sh - 41, 520 - line, categoryColor); + Font.draw(" - A.L.I.C.E", screen, sh - 41, 530 - line, nameColor); + Font.draw(" - UdhavKumar", screen, sh - 41, 540 - line, nameColor); + Font.draw(" - pelletsstarPL", screen, sh - 41, 550 - line, nameColor); + + Font.draw(" Thanks to...", screen, sh - 41, 570 - line, sectionColor); + Font.draw(" - pelletsstarPL", screen, sh - 41, 580 - line, nameColor); + Font.draw(" - terrarianmisha", screen, sh - 41, 590 - line, nameColor); + Font.draw(" - Litorom1", screen, sh - 41, 600 - line, nameColor); + Font.draw(" - Felix pants", screen, sh - 41, 610 - line, nameColor); + Font.draw(" - benichi (why not, xd)", screen, sh - 41, 620 - line, nameColor); + Font.draw(" - Fusyon", screen, sh - 41, 630 - line, nameColor); + Font.draw(" - ChrisJ", screen, sh - 41, 640 - line, nameColor); + Font.draw(" - dafist", screen, sh - 41, 650 - line, nameColor); + Font.draw(" - EduardoPlayer13", screen, sh - 41, 660 - line, nameColor); + Font.draw(" - Makkkkus", screen, sh - 41, 670 - line, nameColor); + Font.draw(" - BoxDude", screen, sh - 41, 680 - line, nameColor); + Font.draw(" - MrToad", screen, sh - 41, 690 - line, nameColor); + Font.draw(" - itayfeder", screen, sh - 41, 700 - line, nameColor); Font.draw("for giving me ideas and", screen, sh - 41, 720 - line, Color.YELLOW); Font.draw(" participate in the ", screen, sh - 41, 730 - line, Color.YELLOW); Font.draw("development of this nice mod ", screen, sh - 51, 740 - line, Color.YELLOW); - Font.draw("And thanks to the Minicraft plus", screen, sh - 59, 780 - line, Color.YELLOW); + Font.draw("And thanks to the Minicraft Plus", screen, sh - 59, 780 - line, Color.YELLOW); Font.draw("maintainers that thanks to their", screen, sh - 59, 790 - line, Color.YELLOW); - Font.draw("work this mod is possible :)", screen, sh - 41, 800 - line, Color.YELLOW); + Font.draw(" work, this mod is possible :)", screen, sh - 41, 800 - line, Color.YELLOW); } } diff --git a/src/main/java/minicraft/screen/LoadingDisplay.java b/src/main/java/minicraft/screen/LoadingDisplay.java index 6974c73a..16dc36fa 100644 --- a/src/main/java/minicraft/screen/LoadingDisplay.java +++ b/src/main/java/minicraft/screen/LoadingDisplay.java @@ -87,7 +87,7 @@ public static void setProgressType(String progressType) { } public static void setMessage(String message) { - LoadingDisplay.message = message; + LoadingDisplay.message = Localization.getLocalized(message); } public static void progress(float amt) { diff --git a/src/main/java/minicraft/screen/MultiplayerDisplay.java b/src/main/java/minicraft/screen/MultiplayerDisplay.java index d3cc7926..75f5aeae 100644 --- a/src/main/java/minicraft/screen/MultiplayerDisplay.java +++ b/src/main/java/minicraft/screen/MultiplayerDisplay.java @@ -8,12 +8,12 @@ import kong.unirest.JsonNode; import kong.unirest.Unirest; import kong.unirest.UnirestException; -import minicraft.core.Action; import minicraft.core.Game; import minicraft.core.io.InputHandler; import minicraft.graphic.Color; import minicraft.graphic.Ellipsis; import minicraft.graphic.Ellipsis.SequentialEllipsis; +import minicraft.util.Action; import minicraft.graphic.Font; import minicraft.graphic.FontStyle; import minicraft.graphic.Screen; diff --git a/src/main/java/minicraft/screen/OptionsDisplay.java b/src/main/java/minicraft/screen/OptionsDisplay.java index 13682032..cb7f8487 100644 --- a/src/main/java/minicraft/screen/OptionsDisplay.java +++ b/src/main/java/minicraft/screen/OptionsDisplay.java @@ -20,7 +20,7 @@ public class OptionsDisplay extends Display { boolean originalSound = Settings.getBoolean("sound"); - + public OptionsDisplay() { super(true); @@ -28,10 +28,10 @@ public OptionsDisplay() { new BlankEntry(), Settings.getEntry("diff"), Settings.getEntry("sound"), - Settings.getEntry("ambient"), Settings.getEntry("autosave"), Settings.getEntry("skinon"), Settings.getEntry("language"), + new SelectEntry("Video options", () -> Game.setDisplay(new VideoOptionsDisplay())), new SelectEntry("Change Key Bindings", () -> Game.setDisplay(new KeyInputDisplay())), new SelectEntry("Texture packs", () -> Game.setDisplay(new TexturePackDisplay())), @@ -51,7 +51,13 @@ public OptionsDisplay() { Menu popupMenu = new Menu.Builder(true, 4, RelPos.CENTER) .setShouldRender(false) .setSelectable(false) - .setEntries(StringEntry.useLines(Color.RED, "A restart will be required, you can continue playing anyway", "enter to confirm", "escape to cancel")) + + .setEntries(StringEntry.useLines(Color.RED, + "A restart is needed, you can continue playing anyway", + "enter to confirm", + "escape to cancel") + ) + .setTitle("Confirm Action") .createMenu(); diff --git a/src/main/java/minicraft/screen/PlayerDeathDisplay.java b/src/main/java/minicraft/screen/PlayerDeathDisplay.java index 2e9f94b2..4f97278c 100644 --- a/src/main/java/minicraft/screen/PlayerDeathDisplay.java +++ b/src/main/java/minicraft/screen/PlayerDeathDisplay.java @@ -17,13 +17,6 @@ public class PlayerDeathDisplay extends Display { // This is an IMPORTANT bool, determines if the user should respawn or not. :) public static boolean shouldRespawn = true; - private static final String[] deadSpashes = { - "You died! Aww!", "Its humiliating!", "Luck for the next!", - "That had to hurt!", "What a pity!", "In the end?!", - "Don't mistake my silence!", "There are things we forget ...", "Great, you died!", - "Unforeseen consequences", - }; - public PlayerDeathDisplay() { super(false, false); @@ -52,7 +45,7 @@ public PlayerDeathDisplay() { menus = new Menu[] { new Menu.Builder(true, 0, RelPos.LEFT, entries) .setPositioning(new Point(SpriteSheet.boxWidth, SpriteSheet.boxWidth * 3), RelPos.BOTTOM_RIGHT) - .setTitle(deadSpashes[random.nextInt(9)]).setTitlePos(RelPos.TOP_LEFT).createMenu() + .setTitle("You died! Aww!").setTitlePos(RelPos.TOP_LEFT).createMenu() }; } } diff --git a/src/main/java/minicraft/screen/PlayerInvDisplay.java b/src/main/java/minicraft/screen/PlayerInvDisplay.java index d2775ab5..8deb4f24 100644 --- a/src/main/java/minicraft/screen/PlayerInvDisplay.java +++ b/src/main/java/minicraft/screen/PlayerInvDisplay.java @@ -38,7 +38,7 @@ public void render(Screen screen) { super.render(screen); if (!menus[0].searcherBarActive) { - String text = "(" + Game.input.getMapping("SEARCHER-BAR") + ") " + Localization.getLocalized("to search."); + String text = "(" + Game.input.getMapping("SEARCHER-BAR") + ") " + Localization.getLocalized("to search"); FontStyle style = new FontStyle(Color.WHITE).setShadowType(Color.BLACK, true).setXPos(menus[0].getBounds().getLeft() + 2).setYPos(menus[0].getBounds().getHeight() + 10); Font.drawParagraph(text, screen, style, 1); } diff --git a/src/main/java/minicraft/screen/TexturePackDisplay.java b/src/main/java/minicraft/screen/TexturePackDisplay.java index 2f0fde91..7684fa41 100644 --- a/src/main/java/minicraft/screen/TexturePackDisplay.java +++ b/src/main/java/minicraft/screen/TexturePackDisplay.java @@ -234,7 +234,7 @@ public void render(Screen screen) { } // Title - Font.drawCentered(Localization.getLocalized("Texture Packs"), screen, Screen.h - 280, Color.YELLOW); + Font.drawCentered(Localization.getLocalized("Texture packs"), screen, Screen.h - 280, Color.YELLOW); // Movement instructions Font.drawCentered("Use " + Game.input.getMapping("MOVE-DOWN") + ", " + Game.input.getMapping("MOVE-UP") + ", " + Game.input.getMapping("SELECT"), screen, Screen.h - 11, Color.GRAY); diff --git a/src/main/java/minicraft/screen/TitleDisplay.java b/src/main/java/minicraft/screen/TitleDisplay.java index 130904aa..433bec64 100644 --- a/src/main/java/minicraft/screen/TitleDisplay.java +++ b/src/main/java/minicraft/screen/TitleDisplay.java @@ -11,10 +11,10 @@ import org.json.JSONArray; import org.json.JSONObject; -import minicraft.core.CrashReport; import minicraft.core.Game; import minicraft.core.Renderer; import minicraft.core.World; +import minicraft.core.io.CrashHandler; import minicraft.core.io.InputHandler; import minicraft.core.io.Sound; import minicraft.graphic.Color; @@ -154,7 +154,7 @@ public void init(Display parent) { public void tick(InputHandler input) { if (input.getKey("r").clicked) rand = random.nextInt(splashes.size() - 3) + 3; if (input.getKey("shift-c").clicked) Game.setDisplay(new CharsTestDisplay()); - if (input.getKey("shift-x").clicked) CrashReport.crashMePlease(); + if (input.getKey("shift-x").clicked) CrashHandler.crashMePlease(); super.tick(input); diff --git a/src/main/java/minicraft/screen/VideoOptionsDisplay.java b/src/main/java/minicraft/screen/VideoOptionsDisplay.java index 02b0fc1e..5d7ff1f9 100644 --- a/src/main/java/minicraft/screen/VideoOptionsDisplay.java +++ b/src/main/java/minicraft/screen/VideoOptionsDisplay.java @@ -12,19 +12,16 @@ public class VideoOptionsDisplay extends Display { int originalFPS = (int) Settings.get("fps"); - boolean originalVsync = Settings.getBoolean("vsync"); public VideoOptionsDisplay() { super(true); Menu optionsMenu = new Menu.Builder(true, 6, RelPos.LEFT, - new BlankEntry(), + new BlankEntry(), Settings.getEntry("fps"), - Settings.getEntry("vsync"), Settings.getEntry("particles"), Settings.getEntry("shadows"), - new BlankEntry(), - Settings.getEntry("bossbar") + new BlankEntry() ) .setTitle("Video options") .createMenu(); @@ -32,10 +29,13 @@ public VideoOptionsDisplay() { Menu popupMenu = new Menu.Builder(true, 4, RelPos.CENTER) .setShouldRender(false) .setSelectable(false) + .setEntries(StringEntry.useLines(Color.RED, - "A restart will be required, you can continue playing anyway", - "enter to confirm", "escape to cancel" + "A restart is needed, you can continue playing anyway", + "enter to confirm", + "escape to cancel" )) + .setTitle("Confirm Action") .createMenu(); @@ -67,14 +67,8 @@ public void tick(InputHandler input) { return; } - if (originalVsync == true) { - Settings.set("fps", Settings.getRefreshRate()); - } else if (originalFPS != (int) Settings.get("fps")) { - Settings.set("vsync", false); - } - // If exit key is pressed, then display the popup menu if changes requiring a restart have been made - if (input.getKey("exit").clicked && originalFPS != (int) Settings.get("fps") || input.getKey("exit").clicked && originalVsync != Settings.getBoolean("vsync")) { + if (input.getKey("exit").clicked && originalFPS != (int) Settings.get("fps")) { menus[1].shouldRender = true; return; } diff --git a/src/main/java/minicraft/screen/WorldGenDisplay.java b/src/main/java/minicraft/screen/WorldGenDisplay.java index 999cd09f..ca016bef 100644 --- a/src/main/java/minicraft/screen/WorldGenDisplay.java +++ b/src/main/java/minicraft/screen/WorldGenDisplay.java @@ -84,7 +84,7 @@ public int getColor(boolean isSelected) { } }; - nameHelp.setVisible(true); + nameHelp.setVisible(false); HashSet controls = new HashSet<>(); controls.addAll(Arrays.asList(Game.input.getMapping("cursor-up").split("/"))); diff --git a/src/main/java/minicraft/screen/entry/SelectEntry.java b/src/main/java/minicraft/screen/entry/SelectEntry.java index b7c7bcae..a9a09101 100644 --- a/src/main/java/minicraft/screen/entry/SelectEntry.java +++ b/src/main/java/minicraft/screen/entry/SelectEntry.java @@ -1,10 +1,10 @@ package minicraft.screen.entry; -import minicraft.core.Action; import minicraft.core.io.InputHandler; import minicraft.core.io.Localization; import minicraft.core.io.Sound; import minicraft.graphic.Font; +import minicraft.util.Action; public class SelectEntry extends ListEntry { diff --git a/src/main/java/minicraft/core/Action.java b/src/main/java/minicraft/util/Action.java similarity index 67% rename from src/main/java/minicraft/core/Action.java rename to src/main/java/minicraft/util/Action.java index 62cfda32..869fe4e3 100644 --- a/src/main/java/minicraft/core/Action.java +++ b/src/main/java/minicraft/util/Action.java @@ -1,6 +1,6 @@ -package minicraft.core; - -@FunctionalInterface -public interface Action { - void act(); -} +package minicraft.util; + +@FunctionalInterface +public interface Action { + void act(); +} diff --git a/src/main/java/minicraft/util/BookData.java b/src/main/java/minicraft/util/BookData.java index eaadd107..3277fdab 100644 --- a/src/main/java/minicraft/util/BookData.java +++ b/src/main/java/minicraft/util/BookData.java @@ -13,7 +13,7 @@ public class BookData { public static final String credits = loadBook("credits"); public static final String antVenomBook = loadBook("antidous"); public static final String storylineGuide = loadBook("story_guide"); - public static final String AlAzif = loadBook("alazif"); + public static final String Grimoire = loadBook("grimoire"); private static String loadBook(String bookTitle) { String book; diff --git a/src/main/java/minicraft/core/Condition.java b/src/main/java/minicraft/util/Condition.java similarity index 70% rename from src/main/java/minicraft/core/Condition.java rename to src/main/java/minicraft/util/Condition.java index 00f0e508..fe075de1 100644 --- a/src/main/java/minicraft/core/Condition.java +++ b/src/main/java/minicraft/util/Condition.java @@ -1,6 +1,6 @@ -package minicraft.core; - -@FunctionalInterface -public interface Condition { - boolean check(); -} +package minicraft.util; + +@FunctionalInterface +public interface Condition { + boolean check(); +} diff --git a/src/main/java/minicraft/core/MonoCondition.java b/src/main/java/minicraft/util/MonoCondition.java similarity index 73% rename from src/main/java/minicraft/core/MonoCondition.java rename to src/main/java/minicraft/util/MonoCondition.java index af766662..f5c946ce 100644 --- a/src/main/java/minicraft/core/MonoCondition.java +++ b/src/main/java/minicraft/util/MonoCondition.java @@ -1,6 +1,6 @@ -package minicraft.core; - -@FunctionalInterface -public interface MonoCondition { - boolean check(T arg); -} +package minicraft.util; + +@FunctionalInterface +public interface MonoCondition { + boolean check(T arg); +} diff --git a/src/main/resources/resources/books/alazif.txt b/src/main/resources/resources/books/alazif.txt deleted file mode 100644 index a4d2e05a..00000000 --- a/src/main/resources/resources/books/alazif.txt +++ /dev/null @@ -1,29 +0,0 @@ -============o============ - - -( AlAzift ) - -------------------------- -- . .- -- --- --- - - - - ------ ---- -- -. . - ----- - - - - ---- -------------------------- -----------{ | }---------- -------------------------- -============o============ -gnineve dooG ,sdneirf raed .yadot uoy sserdda I htiw a xim fo aiglatson dna edutitarg .wonk ton od uoy fo ynam taht wonk I ,yllanosrep em wonk ton od ton od uoy .em fo draeh evah uoy ebyam ro ,em fo draeh evah uoy spahrep tub ,dlrow siht hguorht egassap ym fo ecart a dnuof evah uoy ebyam .seY ,s’ti em ,eyE giB ehT .lla evoba tub ,niarB giB ro eyE neerG dellac osla ,eyE giB ehT .uoy fo eno ma I ,lla evoba tub ,na ,rerutnevda ,rotarec ,remaerd A - -oga emit gnol A .efil ym degnahc taht tcejorp a detrats I .ytinummoc lufrednow a fo htworg eht ot etubirtnoc dna ,egdelwonk ym erahs ,saedi ym sserpxe ot em dewolla taht tcejorp a .flesym naht reggib gnihtemos fo trap leef em edam dna ,em detroppus ,em democlew taht ytinummoc A .gninrael dna ,pihsdneirf ,nuf fo stnemom elbattogrofnu em evag taht ytinummoc a .taht lla roF .luftearg ylpeed ma I - -,efil ni gnihtyreve ekil tuB .sengellahc dna ,selcatsbo ,sti ,seitluciffid sti dah osla tcejorp siht .ti evorpmi ot ron ,ti niatniam ot ron ,ti poleved ot ysae ton saw tI .lla ti evael ot ,lewat eht ni worht ot ,pu evig ot tuoba saw I nehw semit erew erehT .degaruocsid dna ,detsuahxe ,detartsurf tlef I nehw semit erew erehT .ssekanew sti dna ,sekatims ,sti ,snoitatimil sti htiw ,namuh a tsuj ma I .oreh a ron ,suineg a ron ,gnimmargorp ni trepxe na ton ma I - -,gnittiuq tuoba thguoht I emit yreve revewoH .esoprup a dah I taht ,enola ton saw I taht ,no gniog htrow saw ti taht leef em edam ohw esoht lla oT .tsurt rieht ,tnemegaruocne rieht ,kcabdeef rieht em evag ohw esoht lla oT .ti detaicerppa ohw ,ti deulav ohw ,krow ym deyojne ohw esoht lla oT .uoy derembemer I ,uoy derembemer I .em deniatsus dah taht noitanimreted eht ,em devom dah taht noissap eht ,em nevird dah taht noisulli eht derembemer I .detrats dah I yhw derembemer I ,gnittiuq tuoba thguoht I emit yreve - -,tniop gninrut siht ot ereh ,ereh tog I os dnA .esoprup a dah I taht ,enola ton saw I taht ,no gniog htrow saw ti taht leef em edam ohw esoht lla oT .ytinummoc siht rof evol emas eht ,pleh ot erised emas eht ,tirips evitavonni emas eht evah ohw ,em ekil srehto era ereht taht ezilaer I .notab eht ssap ot emit si ti taht dna ,elcyc sti detelpmoc sah tcejorp ym taht ezilaer I ,tniop gninrut siht ot ereh ,ereh tog I os dnA - -,yppah ot eunitnoc ot ,eurT smaerD rieht ekam ot eunitnoc ot ,ytinummoc siht worg ot eunitnoc ot meht tnaw I .etubirtnoc ot ,etaerc ot ,sevlesmeht sserpxe ot eerf eb ot meht tnaw I .ssergorp rieht wols ron ,ytivitaerc rieht timil ron ,yaw rieht ni dnats ot tnaw t’nod I .dna dnA .ytinummoc siht rof evol emas eht ,pleh ot erised emas eht ,tirips evitavonni emas eht evah ohw ,em ekil srehto era ereht taht ezilaer I - -,meht gnivol ,meht gnigarucne ,meht gnitroppus ,ereh eb syawla lliw I taht .sriehT llits si ti taht ,evlove ot seunitnoc ti taht ,evil llits si tcejorp siht taht won wonk yeht taht tuB .lla ta telf ton reven I ybem yadgooG dias reven I ebyam ro ,meht ot yadgooG dias reven I ebyam tuB .em knaht yeht tub ,em rebmemer t’nod yeht ebyam tuB .em leef yeht tub ,em ot klat t’nod yeht ebyam tuB .em ees yeht tub ,em ot netsil t’nod yeht ebyam tuB .noitarimda dna edirp htiw ,ereh ni ,renroc a ,ereh yats ,trap ym rof ,I - -,yeE giB ehT ,evol htiW .era uoy gnihtyreve rof uoy knaht ,em nevig evah uoy gnihtyreve rof uoy knaht .sdneirf ,tseb eht uoy hsiw I diff --git a/src/main/resources/resources/books/grimoire.txt b/src/main/resources/resources/books/grimoire.txt new file mode 100644 index 00000000..b110b1fc --- /dev/null +++ b/src/main/resources/resources/books/grimoire.txt @@ -0,0 +1,10 @@ + +-- The Ancient -- +- Grimoire - + + + + +\0✪✫✬ ✭✮✯✰✱✲✳ ✴✵✶✷✸✹✺✻✼ ✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱✲ ✳✴✵✶✷✸✹✺✻✼✽✾ ✿❀❁❂ ✪✫✬✭✮ ✯✰✱✲✳✴✵✶✷ ✸✹✺✻✼✽✾✿❀ ❁❂ ✪✫✬✭✮✯ ✰✱✲✳✴✵✶✷✸ ✹✺✻✼✽✾✿❀❁ ❂ ✪✫✬✭✮✯✰ ✱✲✳✴✵✶✷✸✹ ✺✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱ ✲✳✴✵✶✷✸✹✺ ✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱✲✳ ✴✵✶✷✸✹✺✻✼✽ ✾✿❀❁❂ ✪✫✬ ✭✮✯✰✱✲✳✴✵ ✶✷✸✹✺✻✼✽✾ ✿❀❁❂ ✪✫✬✭ ✮✯✰✱✲✳✴✵✶ ✷✸✹✺✻✼✽✾✿ ❀❁❂ ✪✫✬✭✮ ✯✰✱✲✳✴✵✶✷ ✸✹✺✻✼✽✾✿❀ ❁❂ ✪✫✬✭✮✯ ✰✱✲✳✴✵✶✷✸ ✹✺✻✼✽✾✿❀❁ ❂ ✪✫✬✭✮✯✰ ✱✲✳✴✵✶✷✸✹ ✺✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱ ✲✳✴✵✶✷✸✹✺ ✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱✲✳ ✴✵✶✷✸✹✺✻✼✽ ✾✿❀❁❂ ✪✫✬ ✭✮✯✰✱✲✳✴✵ ✶✷✸✹✺✻✼✽✾ ✿❀❁❂ ✪✫✬✭ ✮✯✰✱✲✳✴✵✶ ✷✸✹✺✻✼✽✾✿ ❀❁❂ ✪✫✬✭✮ ✯✰✱✲✳✴✵✶✷ ✸✹✺✻✼✽✾✿❀ ❁❂ ✪✫✬✭✮✯ ✰✱✲✳✴✵✶✷✸ ✹✺✻✼✽✾✿❀❁ ❂ ✪✫✬✭✮✯✰ ✱✲✳✴✵✶✷✸✹ ✺✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱ ✲✳✴✵✶✷✸✹✺ ✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱✲✳ ✴✵✶✷✸✹✺✻✼✽ ✾✿❀❁❂ ✪✫✬ ✭✮✯✰✱✲✳✴✵ ✶✷✸✹✺✻✼✽✾ ✿❀❁❂ ✪✫✬✭ ✮✯✰✱✲✳✴✵✶ ✷✸✹✺✻✼✽✾✿ ❀❁❂ ✪✫✬✭✮ ✯✰✱✲✳✴✵✶✷ ✸✹✺✻✼✽✾✿❀ ❁❂ ✪✫✬✭✮✯ ✰✱✲✳✴✵✶✷✸ ✹✺✻✼✽✾✿❀❁ ❂ ✪✫✬✭✮✯✰ ✱✲✳✴✵✶✷✸✹ ✺✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱ ✲✳✴✵✶✷✸✹✺ ✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱✲✳ ✴✵✶✷✸✹✺✻✼✽ ✾✿❀❁❂ ✪✫✬ ✭✮✯✰✱✲✳✴✵ ✶✷✸✹✺✻✼✽✾ ✿❀❁❂ ✪✫✬✭ ✮✯✰✱✲✳✴✵✶ ✷✸✹✺✻✼✽✾✿ ❀❁❂ ✪✫✬✭✮ ✯✰✱✲✳✴✵✶✷ ✸✹✺✻✼✽✾✿❀ ❁❂ ✪✫✬✭✮✯ ✰✱✲✳✴✵✶✷✸ ✹✺✻✼✽✾✿❀❁ ❂ ✪✫✬✭✮✯✰ ✱✲✳✴✵✶✷✸✹ ✺✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱ ✲✳✴✵✶✷✸✹✺ ✻✼✽✾✿❀❁❂ ✪✫✬✭✮✯✰✱✲✳ ✴✵✶✷✸✹✺✻✼✽ ✾✿❀❁❂ ✪✫✬ ✭ + +\0✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ ✳✴✵✶✷ ✸✹✺✻✼ ✽✾✿❀❁ ❂ ✪✫✬ ✭✮✯✰✱✲ \ No newline at end of file diff --git a/src/main/resources/resources/localization/english_en-us.mcpl b/src/main/resources/resources/localization/english_en-us.mcpl index b5e3261c..3fd16318 100644 --- a/src/main/resources/resources/localization/english_en-us.mcpl +++ b/src/main/resources/resources/localization/english_en-us.mcpl @@ -33,7 +33,7 @@ minicraft.achievement.upgrade.desc Get a tool made of a material that is stronger than wood. minicraft.achievement.iron_tools -How heavy! +Its heavy! minicraft.achievement.iron_tools.desc Get a tool made of a material that is stronger than stone. @@ -45,7 +45,7 @@ minicraft.achievement.monsters.desc Kill a hostile mob. minicraft.achievement.fish -To fish! +Time to fish! minicraft.achievement.fish.desc Get a fish. @@ -75,7 +75,7 @@ minicraft.achievement.demolition.desc Use TNT. minicraft.achievement.explosive_ending -An explosive eding +An explosive ending minicraft.achievement.explosive_ending.desc "Accidentally" blow yourself up. @@ -155,24 +155,24 @@ Entities Entities # AirWizard.java -Air Wizard: Defeated! -Air Wizard: Defeated! +The Air Wizard was beaten! +The Air Wizard was beaten! The Dungeon is now open! The Dungeon is now open! +A book lies on the ground... +A book lies on the ground... + A costume lies on the ground... A costume lies on the ground... # Bed.java -Can't sleep! -Can't sleep! - -Min -Min +Sleeping +Sleeping - Sec left! - Sec left! +You can only sleep at night! +You can only sleep at night! # DungeonChest.java You hear a noise from the surface! @@ -199,9 +199,6 @@ Can't set home here! Home Sweet Home! Home Sweet Home! -Mode penalty: -2 health -Mode penalty: -2 health - You don't have a home! You don't have a home! @@ -247,8 +244,8 @@ Book Antidious Antidious -AlAzif -AlAzif +Grimoire +Grimoire # BucketItem.java @@ -345,9 +342,6 @@ Gold Carrot # FurnitureItem.java -KingZombie Spawner -Kings Zombie Spawner - Cow Spawner Cows Spawner @@ -384,9 +378,6 @@ Slimes Spawner Zombie Spawner Zombies Spawner -Mooshroom Spawner -Mooshrooms Spawner - Creeper Spawner Creepers Spawner @@ -400,7 +391,7 @@ Knight Spawner Knights Spawner OldGolem Spawner -Rust golems Spawner +Rust Golems Spawner AirWizard Spawner Air Wizards Spawner @@ -408,12 +399,12 @@ Air Wizards Spawner EyeQueen Spawner Eye Queens Spawner -Cthulhu Spawner -Cthulhus Spawner - Keeper Spawner Keepers Spawner +Firefly Spawner +Fireflies Spawner + Workbench Workbench @@ -429,9 +420,6 @@ Anvil Enchanter Enchanter -Assembler -Assembler - Stonecutter Stonecutter @@ -481,6 +469,9 @@ Map book Eye Amulet Eye Amulet +Slimy Amulet +Slimy Amulet + # PotionType.java None Potion @@ -543,9 +534,6 @@ Haste Potion Escape Potion Escape Potion -Blindness Potion -Blindness Potion - Potion Potion @@ -732,30 +720,6 @@ Spring Flint Flint -Flint and Steel -Flint and Steel - -Protection I -Protection I - -Protection II -Protection II - -Protection III -Protection III - -Sharp I -Sharp I - -Sharp II -Sharp II - -Sharp III -Sharp III - -Cordyceps essence -Cordyceps essence - Sticky essence Sticky essence @@ -767,17 +731,17 @@ Master essence # TileItem.java -Flower -Flower +Daisy +Daisy -Orange Tulip -Orange Tulip +Rose +Rose -Red Mushroom -Red Mushroom +Dandelion +Dandelion -Brown Mushroom -Brown Mushroom +Poppy +Poppy Acorn Acorn @@ -794,8 +758,17 @@ Pine Cone Dirt Dirt -Sky dirt -Sky dirt +Sky Grass +Sky Grass + +Ice +Ice + +Red Mushroom +Red Mushroom + +Brown Mushroom +Brown Mushroom Natural Rock Natural Rock @@ -1171,6 +1144,9 @@ unable to get localhost address # Save.java +Saving +Saving + World Saved! World Saved! @@ -1296,35 +1272,44 @@ ESCAPE to Return to menu Loading Loading +Starting +Starting + Generating Generating -Separating -Separating +Generating surface! +Generating surface! -Planting -Planting +Generating caves! +Generating caves! -Eroding -Eroding +Generating the dungeon! +Generating the dungeon! -Digging -Digging +Generating the heaven! +Generating the heaven! -Raising -Raising +Generating forests +Generating forests -Leveling -Leveling +Generating meadow +Generating meadow -Flattening -Flattening +Generating beaches +Generating beaches -Molding -Molding +Generating mountains +Generating mountains -Building -Building +Generating mushrooms +Generating mushrooms + +Generating ores +Generating ores + +Generating clouds +Generating clouds Rendering Rendering @@ -1452,6 +1437,9 @@ Texture packs Open Game Folder Open Game Folder +Open World Folder +Open World Folder + # PauseDisplay.java Return to Game @@ -1507,8 +1495,8 @@ Quit without saving Inventory Inventory -to search. -to search. +to search +to search # TitleDisplay.java @@ -1521,9 +1509,6 @@ Load World New World New World -Multiplayer -Multiplayer - Options Options @@ -1588,12 +1573,6 @@ World Seed Enter World Name Enter World Name -Trouble with 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. -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. - Create World Create World @@ -1700,27 +1679,12 @@ Sound Autosave Autosave -Ambient -Ambient - Particles Particles Shadows Shadows -Bossbar type -Bossbar type - -On screen -On screen - -On entity -On entity - -Percent -Percent - World Size World Size diff --git a/src/main/resources/resources/localization/eyenglish_en-us.mcpl b/src/main/resources/resources/localization/eyenglish_en-us.mcpl index 8787b934..4f7d39f4 100644 --- a/src/main/resources/resources/localization/eyenglish_en-us.mcpl +++ b/src/main/resources/resources/localization/eyenglish_en-us.mcpl @@ -543,9 +543,6 @@ noitoP etsaH Escape Potion noitoP epacsE -Blindness Potion -noitoP ssendnilB - Potion noitoP diff --git a/src/main/resources/resources/localization/russian_ru-ru.mcpl b/src/main/resources/resources/localization/russian_ru-ru.mcpl index f9922dd4..5218f046 100644 --- a/src/main/resources/resources/localization/russian_ru-ru.mcpl +++ b/src/main/resources/resources/localization/russian_ru-ru.mcpl @@ -1,26 +1,180 @@ ### Translation created by IsNoLe - ported to Aircraft by TheBigEye +### Achievement + +# achievement + +minicraft.achievement.woodcutter +Дровосек + +minicraft.achievement.woodcutter.desc +Возьмите немного дерева. + +minicraft.achievement.benchmarking +Время крафта + +minicraft.achievement.benchmarking.desc +Создайте верстак. + +minicraft.achievement.mine_stone +Каменный век! + +minicraft.achievement.mine_stone.desc +Добудьте камень своей новой киркой. + +minicraft.achievement.smelt_iron +Железный век!! + +minicraft.achievement.smelt_iron.desc +Добудьте железо и расплавьте его. + +minicraft.achievement.upgrade +Обновление! + +minicraft.achievement.upgrade.desc +Сделайте инструмент из материала, который прочнее дерева. + +minicraft.achievement.iron_tools +Это тяжело! + +minicraft.achievement.iron_tools.desc +Сделайте инструмент из материала, который прочнее камня. + +minicraft.achievement.monsters +Что это такое?! + +minicraft.achievement.monsters.desc +Убейте враждебного монстра. + +minicraft.achievement.fish +Время ловить рыбу! + +minicraft.achievement.fish.desc +Get a fish. + +minicraft.achievement.doors +Демасиадас пуэртас! + +minicraft.achievement.doors.desc +Разместите все типы дверей. + +minicraft.achievement.planks +Идите по доскам! + +minicraft.achievement.planks.desc +Размещайте все виды досок. + +minicraft.achievement.clothes +Красочного дня! + +minicraft.achievement.clothes.desc +Craft all the colorful clothes. + +minicraft.achievement.demolition +Бум! + +minicraft.achievement.demolition.desc +Используйте динамит. + +minicraft.achievement.explosive_ending +Взрывной финал + +minicraft.achievement.explosive_ending.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.second_airwizard +Загробная жизнь! + +minicraft.achievement.second_airwizard.desc +Убейте второго Волшебника Воздуха. + +minicraft.achievement.eye_queen +Я тебя вижу! + +minicraft.achievement.eye_queen.desc +Призвать и убить Королеву Глаз. + +minicraft.achievement.eat_all_food +На диете + +minicraft.achievement.eat_all_food.desc +Ешьте все, что можно есть. + + +# AchievementDisplay.java +Earned! +Заработано! + +Not Earned +Не заработано + +Achievements Score: +Оценка достижений: + ### entity +## entity.particle +## entity.particle end + +# Entity.java +Entities +Сущности + # AirWizard.java -Air Wizard: Defeated! -Маг Воздуха: Повержен! +The Air Wizard was beaten! +Волшебник Воздуха побежден! The Dungeon is now open! Подземелье теперь открыто! +A book lies on the ground... +Книга лежит на земле... + A costume lies on the ground... Костюм лежит на земле... # Bed.java -Can't sleep! -Нельзя спать! - -Min -Мин +Спать +Спать - Sec left! - Сек. сталось! +You can only sleep at night! +Ночью можно только спать! # DungeonChest.java You hear a noise from the surface! @@ -47,9 +201,6 @@ Can't set home here! Home Sweet Home! Дом милый дом! -Mode penalty: -2 health -Режим штрафа: -2 здоровья - You don't have a home! У тебя нет дома! diff --git a/src/main/resources/resources/localization/spanish_es.mcpl b/src/main/resources/resources/localization/spanish_es.mcpl index e081cc95..6ba8259b 100644 --- a/src/main/resources/resources/localization/spanish_es.mcpl +++ b/src/main/resources/resources/localization/spanish_es.mcpl @@ -155,24 +155,24 @@ Entities Entidades # AirWizard.java -Air Wizard: Defeated! -Mago de Aire: Derrotado! +The Air Wizard was beaten! +El Mago de Aire fue derrotado! The Dungeon is now open! El calabozo esta abierto ahora! +A book lies on the ground... +Un libro descansa en el suelo... + A costume lies on the ground... Un disfraz descansa en el suelo... # Bed.java -Can't sleep! -No puedes dormir! - -Min -Min +Sleeping +Durmiendo - Sec left! - Seg restante! +You can only sleep at night! +Solo puedes dormir de noche! # DungeonChest.java You hear a noise from the surface! @@ -199,9 +199,6 @@ No puedes establecer la casa aqui! 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! @@ -217,22 +214,22 @@ No puedes ir a casa desde aqui! # ArmorItem.java Leather Armor -Armadura De Cuero +Armadura de Cuero Snake Armor -Armadura De Serpiente +Armadura de Serpiente ChainMail Armor -Armadura Cota De Malla +Armadura Cota de Malla Iron Armor -Armadura De Hierro +Armadura de Hierro Gold Armor -Armadura De Oro +Armadura de Oro Gem Armor -Armadura De Gema +Armadura de Gema # BoatItem.java @@ -247,8 +244,8 @@ Libro Antidious Antidoto -AlAzif -Libro Del Aire +Grimoire +Grimorio # BucketItem.java @@ -256,10 +253,10 @@ Empty Bucket Cubeta Vacia Water Bucket -Cubeta De Agua +Cubeta de Agua Lava Bucket -Cubeta De Lava +Cubeta de Lava Bucket Cubeta @@ -282,7 +279,7 @@ Black Clothes Traje Negro Orange Clothes -Traje Anaranjada +Traje Anaranjado Purple Clothes Traje Morado @@ -305,10 +302,10 @@ Frozen palette Paleta Congelada Mushroom Soup -Sopa De hongos +Sopa de hongos Carrot Soup -Sopa De Zanahoria +Sopa de Zanahoria Raw Chicken Pollo Crudo @@ -326,7 +323,7 @@ Cooked Chicken Pollo Cocinado Pork Chop -Chuleta De Cerdo +Chuleta de Cerdo Cooked Fish Pescado Cocido @@ -345,77 +342,71 @@ Zanahoria Dorada # FurnitureItem.java -KingZombie Spawner -Generador De Reyes Zombies - Cow Spawner -Generador De Vacas +Generador de Vacas Pig Spawner -Generador De Cerdos +Generador de Cerdos Sheep Spawner -Generador De Ovejas +Generador de Ovejas Goat Spawner -Generador De Cabras +Generador de Cabras Chicken Spawner -Generador De Pollos +Generador de Pollos Cleric Spawner -Generador De Clerigos +Generador de Clerigos Librarian Spawner -Generador De Bibliotecarios +Generador de Bibliotecarios GuiMan Spawner -Generador De Pinguinos +Generador de Pinguinos Cat Spawner -Generador De Gatos +Generador de Gatos Golem Spawner -Generador De Golems +Generador de Golems Slime Spawner -Generador De Slimes +Generador de Slimes Zombie Spawner -Generador De Zombies - -Mooshroom Spawner -Generador De Vacahongos +Generador de Zombies Creeper Spawner -Generador De Creepers +Generador de Creepers Skeleton Spawner -Generador De Esqueletos +Generador de Esqueletos Snake Spawner -Generador De Serpientes +Generador de Serpientes Knight Spawner -Generador De Caballeros +Generador de Caballeros OldGolem Spawner -Generador De Golems viejos +Generador de Golems viejos AirWizard Spawner -Generador De Magos de Aire +Generador de Magos de Aire EyeQueen Spawner -Generador De Reinas Ojo - -Cthulhu Spawner -Generador De Cthulhu +Generador de Reinas Ojo Keeper Spawner -Generador De Guardian +Generador de Guardian + +Firefly Spawner +Generador de Luciernagas Workbench -Mesa De Trabajo +Mesa de Trabajo Oven Horno @@ -429,9 +420,6 @@ Yunque Enchanter Encantador -Assembler -Ensamblador - Stonecutter Cortapiedra @@ -445,10 +433,10 @@ Lantern Linterna Iron Lantern -Linterna De Hierro +Linterna de Hierro Gold Lantern -Linterna De Oro +Linterna de Oro Tnt Dinamita @@ -457,29 +445,32 @@ Bed Cama Slime Statue -Estatua De Slime +Estatua de Slime Zombie Statue -Estatua De Zombie +Estatua de Zombie Skeleton Statue -Estatua De Esqueleto +Estatua de Esqueleto Chest Cofre Dungeon Chest -Cofre De mazmorra +Cofre de Calabozo # MapItem.java Map book -Libro De mapas +Libro de Mapas # AmuletItem.java Eye Amulet -Amuleto Del ojo +Amuleto del Ojo + +Slimy Amulet +Amuleto del Guardian # PotionType.java @@ -487,64 +478,61 @@ None Potion Ninguna Pocion Speed Potion -Pocion De Velocidad +Pocion de Velocidad xSpeed Potion -Pocion De Velocidad II +Pocion de Velocidad II Light Potion -Pocion De Luz +Pocion de Luz xLight Potion -Pocion De Luz II +Pocion de Luz II Swim Potion -Pocion De Nadar +Pocion de Nadar xSwim Potion -Pocion De Nadar II +Pocion de Nadar II Energy Potion -Pocion De Energia +Pocion de Energia xEnergy Potion -Pocion De Energia II +Pocion de Energia II Regen Potion -Pocion De Curacion +Pocion de Curacion xRegen Potion -Pocion De Curacion II +Pocion de Curacion II Health Potion -Pocion De Vida +Pocion de Vida xHealth Potion -Pocion De Vida II +Pocion de Vida II Time Potion -Pocion De Tiempo +Pocion de Tiempo Lava Potion -Pocion De Lava +Pocion de Lava xLava Potion -Pocion De Lava II +Pocion de Lava II Shield Potion -Pocion De Escudo +Pocion de Escudo xShield Potion -Pocion De Escudo II +Pocion de Escudo II Haste Potion -Pocion De Prisa +Pocion de Prisa Escape Potion -Pocion De Escape - -Blindness Potion -Pocion De Ceguera +Pocion de Escape Potion Pocion @@ -562,13 +550,13 @@ Tijeras # StackableItem.java Oak Wood -Madera De Roble +Madera de Roble Spruce Wood -Madera De Abeto +Madera de Abeto Birch Wood -Madera De Abedul +Madera de Abedul Leaf Hoja @@ -637,7 +625,7 @@ Gray dye Tinte Gris Ink sac -Saco De Tinta +Saco de Tinta Lime dye Tinte Lima @@ -682,13 +670,13 @@ Coal Carbon Iron Ore -Mena De Hierro +Mena de Hierro Lapis Lapis Gold Ore -Mena De Oro +Mena de Oro Iron Hierro @@ -721,7 +709,7 @@ Scale Escama Shard -elitro +Fragmento Gear Engranaje @@ -732,30 +720,6 @@ Resorte Flint Pedernal -Flint and Steel -Mechero - -Protection I -Proteccion I - -Protection II -Proteccion II - -Protection III -Proteccion III - -Sharp I -Filo I - -Sharp II -Filo II - -Sharp III -Filo III - -Cordyceps essence -Esencia De Cordyceps - Sticky essence Esencia Pegajosa @@ -774,29 +738,28 @@ Rose Rosa Dandelion -Diente De Leon +Diente de Leon Poppy Amapola - Acorn Bellota Birch Cone -Piña De Abedul +Piña de Abedul Fir Cone -Piña De Abeto +Piña de Abeto Pine Cone -Piña De Pino +Piña de Pino Dirt Tierra Sky Grass -Cesped Del Cielo +Cesped del Cielo Ice Hielo @@ -814,40 +777,40 @@ Natural Hard Rock Piedra Natural Dura Oak Plank -Tablon De Roble +Tablon de Roble Spruce Plank -Tablon De Abeto +Tablon de Abeto Birch Plank -Tablon De Abedul +Tablon de Abedul Oak Wall -Muro De Roble +Muro de Roble Spruce Wall -Muro De Abeto +Muro de Abeto Birch Wall -Muro De Abedul +Muro de Abedul Oak Door -Puerta De Roble +Puerta de Roble Spruce Door -Puerta De Abeto +Puerta de Abeto Birch Door -Puerta De Abedul +Puerta de Abedul Stone Brick -Ladrillo De Piedra +Ladrillo de Piedra Stone Wall -Muro De Piedra +Muro de Piedra Stone Door -Puerta De Piedra +Puerta de Piedra Holy Brick Ladrillo Sagrado @@ -859,13 +822,13 @@ Holy Door Puerta Sagrada Obsidian Brick -Ladrillo De Obsidiana +Ladrillo de Obsidiana Obsidian Wall -Muro De Obsidiana +Muro de Obsidiana Obsidian Door -Puerta De Obsidiana +Puerta de Obsidiana Wool Lana @@ -937,19 +900,19 @@ Potato Patata Sky wart -Verruga Del Cielo +Verruga del Cielo Sky Seeds -Semillas Del Cielo +Semillas del Cielo Grass Seeds -Semillas De Cesped +Semillas de Cesped Bone Hueso Bone Powder -Polvo De Hueso +Polvo de Hueso Ferrosite Nube Rapida @@ -986,16 +949,16 @@ Caña de Pescar # FishingRodItem.java Wood Fishing rod -Caña De Pescar De Madera +Caña de Pescar de Madera Iron Fishing rod -Caña De Pescar De Hierro +Caña de Pescar de Hierro Gold Fishing rod -Caña De Pescar De Oro +Caña de Pescar de Oro Gem Fishing rod -Caña De Pescar De Gema +Caña de Pescar de Gema # ToolType.java @@ -1021,7 +984,7 @@ Bow Arco FishingRod -Caña De Pescar +Caña de Pescar Claymore Claymore @@ -1049,16 +1012,16 @@ Gem Ore Mena de Gema Oak Planks -Tablon De roble +Tablon de roble Spruce Planks -Tablon De abeto +Tablon de abeto Birch Planks -Tablon De abedul +Tablon de abedul Stone Bricks -Ladrillo De piedra +Ladrillo de piedra Obsidian Obsidiana @@ -1067,10 +1030,10 @@ Oak Wall Muro de roble Spruce Wall -Muro De abeto +Muro de abeto Birch Wall -Muro De abedul +Muro de abedul Grass Cesped @@ -1103,7 +1066,7 @@ Tree Arbol Tree Sapling -Brote De Arbol +Brote de Arbol Sand Arena @@ -1112,19 +1075,19 @@ Cactus Cactus Cactus Sapling -Brote De Cactus +Brote de Cactus Lava Lava Lava Brick -Ladrillo De Lava +Ladrillo de Lava Explode Explotar Farmland -Tierras De Cultivo +Tierras de Cultivo Wheat Trigo @@ -1181,6 +1144,9 @@ incapaz de obtener la direccion localhost # Save.java +Saving +Guardando + World Saved! Mundo guardado! @@ -1306,9 +1272,45 @@ ESC para Regresar al menú Loading Cargando +Starting +Iniciando + Generating Generando +Generating surface! +Generando superficie! + +Generating caves! +Generando cuevas! + +Generating the dungeon! +Generando el calabozo! + +Generating the heaven! +Generando el cielo! + +Generating forests +Generando bosques + +Generating meadow +Generando pradera + +Generating beaches +Generando playas + +Generating mountains +Generando montañas + +Generating mushrooms +Generando hongos + +Generating ores +Generando minerales + +Generating clouds +Generando nubes + Rendering Renderizando @@ -1435,6 +1437,9 @@ Paquetes de texturas Open Game Folder Abrir carpeta del juego +Open World Folder +Abrir carpeta del mundo + # PauseDisplay.java Return to Game @@ -1490,7 +1495,7 @@ Salir sin guardar Inventory Inventario -to search. +to search para buscar # TitleDisplay.java @@ -1504,9 +1509,6 @@ Cargar Mundo New World Nuevo Mundo -Multiplayer -Multijugador - Options Opciones @@ -1523,7 +1525,7 @@ Storyline Guide (for the weak) Guia de historias (para los debiles) About -Acerca de +Acerca Minicraft discord Discord de Minicraft @@ -1571,12 +1573,6 @@ Semilla Enter World Name 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 @@ -1683,27 +1679,12 @@ Sonido Autosave Autoguardado -Ambient -Ambiente - Particles Particulas Shadows Sombras -Bossbar type -Barra de vida - -On screen -En pantalla - -On entity -En entidad - -Percent -Porcentaje - World Size Tamaño del Mundo diff --git a/src/main/resources/resources/splashes.json b/src/main/resources/resources/splashes.json index fcebc597..bbd1d9b4 100644 --- a/src/main/resources/resources/splashes.json +++ b/src/main/resources/resources/splashes.json @@ -225,6 +225,8 @@ "Thanks, Rick May", "The Constant", "Just Monika!", + "Duke Nukem!", + "Aahhh... much better!", "Something cool is coming ;)", "Algorithms?, nah", "He was too redundant", diff --git a/src/main/resources/resources/textures/Legacy/gui.png b/src/main/resources/resources/textures/Legacy/gui.png index d26da6b7..18eb21f2 100644 Binary files a/src/main/resources/resources/textures/Legacy/gui.png and b/src/main/resources/resources/textures/Legacy/gui.png differ diff --git a/src/main/resources/resources/textures/Legacy/items.png b/src/main/resources/resources/textures/Legacy/items.png index 8bc68ba6..52c45b14 100644 Binary files a/src/main/resources/resources/textures/Legacy/items.png and b/src/main/resources/resources/textures/Legacy/items.png differ diff --git a/src/main/resources/resources/textures/default/font.png b/src/main/resources/resources/textures/default/font.png index e6d63076..e2cd06be 100644 Binary files a/src/main/resources/resources/textures/default/font.png and b/src/main/resources/resources/textures/default/font.png differ diff --git a/src/main/resources/resources/textures/default/gui.png b/src/main/resources/resources/textures/default/gui.png index 8b5910f7..0779c6ec 100644 Binary files a/src/main/resources/resources/textures/default/gui.png and b/src/main/resources/resources/textures/default/gui.png differ diff --git a/src/main/resources/resources/textures/default/items.png b/src/main/resources/resources/textures/default/items.png index 39fd802d..941c827e 100644 Binary files a/src/main/resources/resources/textures/default/items.png and b/src/main/resources/resources/textures/default/items.png differ diff --git a/src/main/resources/resources/textures/legacy/font.png b/src/main/resources/resources/textures/legacy/font.png index 3c1f7664..31f7fd6b 100644 Binary files a/src/main/resources/resources/textures/legacy/font.png and b/src/main/resources/resources/textures/legacy/font.png differ