Skip to content

Commit

Permalink
Add more changelogs
Browse files Browse the repository at this point in the history
Also removed temporary controller support as said by @Litorom.
  • Loading branch information
BenCheung0422 committed Sep 18, 2022
1 parent 6733747 commit d205568
Show file tree
Hide file tree
Showing 23 changed files with 59 additions and 163 deletions.
13 changes: 11 additions & 2 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
Minicraft+ version 2.2.0

+ Added quests
+ Added quests and tutorial
+ Added obsidian knight as the second boss
+ Added controller support
+ Added limitation to inventories
+ Added limitation to stackable items
+ Added 4 new debug arguments
+ Added a toggle for HUD display
+ Added a toggle for simplified effect display
+ Added a new menu for creative mode
+ Added a few creative mode only items for tile placement
* Changed the display of world edit
* Changed the structure of resource pack
* Split the images of textures
* Changed the UI of crash popup
* Changed a better logging
* Fixed seed random problem
* Improved the localization support

Minicraft+ version 2.1.0

Expand Down
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ mainClassName = 'minicraft.core.Game'

repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://jitpack.io" }
}

dependencies {
Expand All @@ -29,11 +27,6 @@ dependencies {
implementation 'com.konghq:unirest-java:3.13.10'
implementation 'org.tinylog:tinylog-api:2.4.1'
implementation 'org.tinylog:tinylog-impl:2.4.1'
implementation 'com.badlogicgames.gdx:gdx:1.11.0'
implementation 'com.badlogicgames.gdx:gdx-box2d:1.11.0'
implementation 'com.badlogicgames.gdx:gdx-controllers:1.9.13'
implementation 'uk.co.electronstudio.sdl2gdx:sdl2gdx:1.0.4'
implementation 'com.github.WilliamAHartman:Jamepad:1.4.0'
}

java {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/minicraft/core/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ protected Game() {} // Can't instantiate the Game class.
public static final Version VERSION = new Version("2.2.0-dev1");

public static InputHandler input; // Input used in Game, Player, and just about all the *Menu classes.
public static final ControllerHandler controlInput = new ControllerHandler(); // controlInput used in Menu Classes for Controllers
public static Player player;

public static List<String> notifications = new ArrayList<>();
Expand Down
1 change: 0 additions & 1 deletion src/main/java/minicraft/core/Initializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import minicraft.util.Logging;
import minicraft.util.TinylogLoggingProvider;

import org.tinylog.Logger;
import org.tinylog.provider.ProviderRegistry;

public class Initializer extends Game {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/minicraft/core/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public static void tick() {
Tile.tickCount++;
}

if (display == null && input.getKey("toggleDebug").clicked) { // Shows debug info in upper-left
if (display == null && input.getKey("F3").clicked) { // Shows debug info in upper-left
Renderer.showDebugInfo = !Renderer.showDebugInfo;
}

Expand Down
77 changes: 0 additions & 77 deletions src/main/java/minicraft/core/io/ControllerHandler.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/java/minicraft/core/io/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ private void initKeyMap() {
keymap.put("SIMPPOTIONEFFECTS", "O"); // Whether to simplify the potion effect display
keymap.put("TOGGLEHUD", "F1"); // Whether to hide hide GUI
keymap.put("EXPANDQUESTDISPLAY", "L"); // Expands the quest display
keymap.put("TOGGLEDEBUG", "F3"); // Toggle fps display
keymap.put("INFO", "SHIFT-I"); // Toggle player stats display

keymap.put("FULLSCREEN", "F11");
Expand All @@ -152,24 +151,6 @@ public void tick() {
}
}

/**
* Check if key has been clicked.
* @param key The key to check.
* @return If it has been clicked.
*/
public boolean isClicked(String key) {
return Game.controlInput.isKeyPressed(key) || getKey(key).clicked;
}

/**
* Check if key is being held down.
* @param key The key being held down.
* @return If the key is being held down.
*/
public boolean isHeld(String key) {
return Game.controlInput.isKeyDown(key) || getKey(key).down;
}

// The Key class.
public class Key {
// presses = how many times the Key has been pressed.
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/minicraft/entity/mob/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ public void tick() {
if (cooldowninfo > 0) cooldowninfo--;
if (questExpanding > 0) questExpanding--;

if (input.getKey("potionEffects").clicked && cooldowninfo == 0) {
if (input.getKey("potionEffects").down && cooldowninfo == 0) {
cooldowninfo = 10;
showpotioneffects = !showpotioneffects;
}

if (input.getKey("simpPotionEffects").clicked) {
if (input.getKey("simpPotionEffects").down) {
simpPotionEffects = !simpPotionEffects;
}

if (input.getKey("toggleHUD").clicked) {
if (input.getKey("toggleHUD").down) {
renderGUI = !renderGUI;
}

if (input.getKey("expandQuestDisplay").clicked) {
if (input.getKey("expandQuestDisplay").down) {
questExpanding = 30;
}

Expand Down Expand Up @@ -359,10 +359,10 @@ public void tick() {
// Move while we are not falling.
if (onFallDelay <= 0) {
// controlInput.buttonPressed is used because otherwise the player will move one even if held down.
if (input.isHeld("move-up")) vec.y--;
if (input.isHeld("move-down")) vec.y++;
if (input.isHeld("move-left")) vec.x--;
if (input.isHeld("move-right")) vec.x++;
if (input.getKey("move-up").down) vec.y--;
if (input.getKey("move-down").down) vec.y++;
if (input.getKey("move-left").down) vec.x--;
if (input.getKey("move-right").down) vec.x++;


}
Expand All @@ -387,10 +387,10 @@ public void tick() {
else directHurt(1, Direction.NONE); // If no stamina, take damage.
}

if (activeItem != null && (input.isClicked("drop-one") || input.isClicked("drop-stack"))) {
if (activeItem != null && (input.getKey("drop-one").clicked || input.getKey("drop-stack").clicked)) {
Item drop = activeItem.clone();

if (input.isClicked("drop-one") && drop instanceof StackableItem && ((StackableItem)drop).count > 1) {
if (input.getKey("drop-one").clicked && drop instanceof StackableItem && ((StackableItem)drop).count > 1) {
// Drop one from stack
((StackableItem)activeItem).count--;
((StackableItem)drop).count = 1;
Expand All @@ -401,14 +401,14 @@ public void tick() {
level.dropItem(x, y, drop);
}

if ((activeItem == null || !activeItem.used_pending) && (input.isClicked("attack")) && stamina != 0 && onFallDelay <= 0) { // This only allows attacks when such action is possible.
if ((activeItem == null || !activeItem.used_pending) && (input.getKey("attack").clicked) && stamina != 0 && onFallDelay <= 0) { // This only allows attacks when such action is possible.
if (!potioneffects.containsKey(PotionType.Energy)) stamina--;
staminaRecharge = 0;

attack();
}

if (input.isClicked("menu") && activeItem != null) {
if (input.getKey("menu").clicked && activeItem != null) {
int returned = inventory.add(0, activeItem);
if (activeItem instanceof StackableItem) {
StackableItem stackable = (StackableItem)activeItem;
Expand All @@ -427,28 +427,28 @@ public void tick() {
}

if (Game.getDisplay() == null) {
if (input.isClicked("menu") && !use()) // !use() = no furniture in front of the player; this prevents player inventory from opening (will open furniture inventory instead)
if (input.getKey("menu").clicked && !use()) // !use() = no furniture in front of the player; this prevents player inventory from opening (will open furniture inventory instead)
Game.setDisplay(new PlayerInvDisplay(this));
if (input.isClicked("pause"))
if (input.getKey("pause").clicked)
Game.setDisplay(new PauseDisplay());
if (input.isClicked("craft") && !use())
if (input.getKey("craft").clicked && !use())
Game.setDisplay(new CraftingDisplay(Recipes.craftRecipes, "minicraft.displays.crafting", this, true));

if (input.getKey("info").clicked) Game.setDisplay(new InfoDisplay());
if (input.getKey("info").down) Game.setDisplay(new InfoDisplay());

if (input.getKey("quicksave").clicked && !Updater.saving) {
if (input.getKey("quicksave").down && !Updater.saving) {
Updater.saving = true;
LoadingDisplay.setPercentage(0);
new Save(WorldSelectDisplay.getWorldName());
}
//debug feature:
if (Game.debug && input.getKey("shift-p").clicked) { // Remove all potion effects
if (Game.debug && input.getKey("shift-p").down) { // Remove all potion effects
for (PotionType potionType : potioneffects.keySet()) {
PotionItem.applyPotion(this, potionType, false);
}
}

if (input.isClicked("pickup") && (activeItem == null || !activeItem.used_pending)) {
if (input.getKey("pickup").clicked && (activeItem == null || !activeItem.used_pending)) {
if (!(activeItem instanceof PowerGloveItem)) { // If you are not already holding a power glove (aka in the middle of a separate interaction)...
prevItem = activeItem; // Then save the current item...
activeItem = new PowerGloveItem(); // and replace it with a power glove.
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/minicraft/level/tile/Tiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import minicraft.level.tile.farming.WheatTile;
import minicraft.util.Logging;

import org.tinylog.Logger;

public final class Tiles {
/// Idea: to save tile names while saving space, I could encode the names in base 64 in the save file...^M
/// Then, maybe, I would just replace the id numbers with id names, make them all private, and then make a get(String) method, parameter is tile name.
Expand Down
1 change: 0 additions & 1 deletion src/main/java/minicraft/network/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import minicraft.util.Logging;

import org.json.JSONObject;
import org.tinylog.Logger;

public class Network extends Game {
private Network() {}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/minicraft/saveload/Load.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ private void loadGame(String filename) {

if (worldVer.compareTo(new Version("2.2.0-dev1")) >= 0)
World.setWorldSeed(Long.parseLong(data.remove(0)));
else
World.setWorldSeed(0);

if (worldVer.compareTo(new Version("2.0.4-dev8")) >= 0)
loadMode(data.remove(0));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/minicraft/screen/BookDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ private void turnPage(int dir) {

@Override
public void tick(InputHandler input) {
if (input.isClicked("menu") || input.isClicked("exit")) Game.exitDisplay(); // Close the menu.
if (input.isClicked("cursor-left")) turnPage(-1); // This is what turns the page back
if (input.isClicked("cursor-right")) turnPage(1); // This is what turns the page forward
if (input.getKey("menu").clicked || input.getKey("exit").clicked) Game.exitDisplay(); // Close the menu.
if (input.getKey("cursor-left").clicked) turnPage(-1); // This is what turns the page back
if (input.getKey("cursor-right").clicked) turnPage(1); // This is what turns the page forward
}
}
4 changes: 2 additions & 2 deletions src/main/java/minicraft/screen/ContainerDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ protected void onSelectionChange(int oldSel, int newSel) {
public void tick(InputHandler input) {
super.tick(input);

if(input.isClicked("menu") || chest.isRemoved()) {
if(input.getKey("menu").clicked || chest.isRemoved()) {
Game.setDisplay(null);
return;
}

Menu curMenu = menus[selection];
int otherIdx = getOtherIdx();

if((input.isClicked("attack")) || input.getKey("shift-enter").clicked) {
if((input.getKey("attack").clicked) || input.getKey("shift-enter").clicked) {
if (curMenu.getEntries().length == 0) return;
// switch inventories
Inventory from, to;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/minicraft/screen/CraftingDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public void tick(InputHandler input) {
refreshData();
}

if (input.isClicked("menu") || (isPersonalCrafter && input.isClicked("craft"))) {
if (input.getKey("menu").clicked || (isPersonalCrafter && input.getKey("craft").clicked)) {
Game.exitDisplay();
return;
}

if ((input.isClicked("select") || input.isClicked("attack")) && recipeMenu.getSelection() >= 0) {
if ((input.getKey("select").clicked || input.getKey("attack").clicked) && recipeMenu.getSelection() >= 0) {
// check the selected recipe
if (recipes.length == 0) return;
Recipe selectedRecipe = recipes[recipeMenu.getSelection()];
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/minicraft/screen/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void onExit() {}

public void tick(InputHandler input) {

if (canExit && input.isClicked("exit")) {
if (canExit && input.getKey("exit").clicked) {
Game.exitDisplay();
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/minicraft/screen/InventoryMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class InventoryMenu extends ItemListMenu {
public void tick(InputHandler input) {
super.tick(input);

boolean dropOne = input.isClicked("drop-one");
boolean dropOne = input.getKey("drop-one").clicked;

if(getNumOptions() > 0 && (dropOne || input.isClicked("drop-stack"))) {
if(getNumOptions() > 0 && (dropOne || input.getKey("drop-stack").clicked)) {
ItemEntry entry = ((ItemEntry)getCurEntry());
if(entry == null) return;
Item invItem = entry.getItem();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/minicraft/screen/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public void tick(InputHandler input) {
if(!selectable || entries.size() == 0) return;

int prevSel = selection;
if (input.isClicked("cursor-up")) selection--;
if (input.isClicked("cursor-down")) selection++;
if (input.getKey("cursor-up").clicked) selection--;
if (input.getKey("cursor-down").clicked) selection++;
if (input.getKey("shift-cursor-up").clicked && selectionSearcher == 0) selectionSearcher -= 2;
if (input.getKey("shift-cursor-down").clicked && selectionSearcher == 0) selectionSearcher += 2;
if (prevSel != selection && selectionSearcher != 0) selection = prevSel;
Expand Down
Loading

0 comments on commit d205568

Please sign in to comment.