Compare commits
9 Commits
c2f895bc8b
...
main
Author | SHA1 | Date | |
---|---|---|---|
61dee148e4
|
|||
9727ad732f
|
|||
069183e5c1
|
|||
418117c7fe
|
|||
d09209848e
|
|||
2e2f4b00f7 | |||
f09519773b
|
|||
1d29972087
|
|||
10b81d018c
|
50
normalize.js
Normal file
50
normalize.js
Normal file
@ -0,0 +1,50 @@
|
||||
const fs = require("fs");
|
||||
|
||||
if (process.argv.length < 4) {
|
||||
console.error("Usage: node script.js <inputFile> <outputFile>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const inputFile = process.argv[2];
|
||||
const outputFile = process.argv[3];
|
||||
|
||||
const file = fs.readFileSync(inputFile, "utf8");
|
||||
const lines = file.split("\n");
|
||||
|
||||
const final = [];
|
||||
|
||||
for (const line of lines) {
|
||||
let str = "";
|
||||
const chars = line.split("");
|
||||
|
||||
function testSpace(index) {
|
||||
if (chars[index - 2] == " ") {
|
||||
return testSpace(index - 1);
|
||||
} else if (chars[index - 2] == "m") {
|
||||
if (chars.join("").substring(index - 5, index - 1) == "[49m") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < chars.length; i++) {
|
||||
const char = chars[i];
|
||||
if (char === " ") {
|
||||
if (testSpace(i)) {
|
||||
str += "\x1b[49m ";
|
||||
} else {
|
||||
str += char;
|
||||
}
|
||||
} else {
|
||||
str += char;
|
||||
}
|
||||
}
|
||||
|
||||
final.push(str);
|
||||
}
|
||||
|
||||
fs.writeFileSync(outputFile, final.join("\n"), "utf8");
|
||||
console.log(`Processed file saved as: ${outputFile}`);
|
21
pom.xml
21
pom.xml
@ -19,13 +19,13 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
<version>1.18.38</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
@ -77,7 +77,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
<version>1.18.38</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -128,11 +128,16 @@
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.5.18</version> <!-- latest at the time -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.trilarion</groupId>
|
||||
<artifactId>java-vorbis-support</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.trilarion</groupId>
|
||||
<artifactId>java-vorbis-support</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.esotericsoftware</groupId>
|
||||
<artifactId>kryo</artifactId>
|
||||
<version>5.6.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -14,6 +14,10 @@ import org.jline.terminal.TerminalBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* The main class that starts the whole game. It initializes providers and sets
|
||||
* up a terminal and creates the main game loop.
|
||||
*/
|
||||
@Slf4j
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
@ -31,7 +35,8 @@ public class Main {
|
||||
|
||||
var spriteList = SpriteLoader.load();
|
||||
var screenRenderer = new ScreenRenderer(spriteList, terminal);
|
||||
var game = GameSaver.load();
|
||||
var gameSaver = new GameSaver();
|
||||
var game = gameSaver.load();
|
||||
|
||||
final boolean[] isRunning = { true };
|
||||
|
||||
|
@ -11,7 +11,6 @@ import cz.jzitnik.game.handlers.place.CustomPlaceHandler;
|
||||
import cz.jzitnik.game.mobs.EntitySpawnProvider;
|
||||
import cz.jzitnik.game.sprites.Breaking;
|
||||
import cz.jzitnik.game.sprites.Steve.SteveState;
|
||||
import cz.jzitnik.game.annotations.AutoTransient;
|
||||
import cz.jzitnik.game.annotations.WalkSound;
|
||||
import cz.jzitnik.game.annotations.BreaksByPlace;
|
||||
import cz.jzitnik.game.annotations.MineSound;
|
||||
@ -20,15 +19,13 @@ import cz.jzitnik.game.annotations.PlaceSound;
|
||||
import cz.jzitnik.game.blocks.Chest;
|
||||
import cz.jzitnik.game.blocks.Furnace;
|
||||
import cz.jzitnik.game.config.Configuration;
|
||||
import cz.jzitnik.game.core.autotransient.AutoTransientSupport;
|
||||
import cz.jzitnik.game.core.autotransient.initilizers.GameMiningInitializer;
|
||||
import cz.jzitnik.game.core.autotransient.initilizers.GameWindowInitializer;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.ui.Window;
|
||||
import cz.jzitnik.game.ui.Inventory;
|
||||
import cz.jzitnik.game.handlers.rightclick.RightClickHandlerProvider;
|
||||
import cz.jzitnik.tui.ScreenMovingCalculationProvider;
|
||||
import cz.jzitnik.tui.ScreenRenderer;
|
||||
import cz.jzitnik.game.stats.Stats;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@ -38,29 +35,46 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* Main class representing the game world and core logic.
|
||||
* <p>
|
||||
* Manages the game state, player actions, world updates and interactions.
|
||||
*/
|
||||
@Getter
|
||||
public class Game extends AutoTransientSupport {
|
||||
public class Game {
|
||||
/**
|
||||
* The 2D world grid consisting of block lists for each coordinate.
|
||||
* Dimensions: [height][width] = [256][512].
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private final List<Block>[][] world = (List<Block>[][]) new CopyOnWriteArrayList[256][512];
|
||||
private final Player player = new Player();
|
||||
@AutoTransient(initializer = GameMiningInitializer.class)
|
||||
private transient boolean mining = false;
|
||||
@Setter
|
||||
@AutoTransient(initializer = GameWindowInitializer.class)
|
||||
private transient Window window = Window.WORLD;
|
||||
private final Inventory inventory = new Inventory();
|
||||
@AutoTransient
|
||||
private transient EntitySpawnProvider entitySpawnProvider = new EntitySpawnProvider();
|
||||
@AutoTransient
|
||||
private transient GameStates gameStates = new GameStates(this);
|
||||
private Stats stats = new Stats();
|
||||
|
||||
/** Current time of day in the game (0–600 range). */
|
||||
@Setter
|
||||
private int daytime = 0; // 0-600
|
||||
private int daytime = 0;
|
||||
//
|
||||
private Configuration configuration = new Configuration();
|
||||
|
||||
/**
|
||||
* Constructs the game instance and generates the initial world.
|
||||
*/
|
||||
public Game() {
|
||||
Generation.generateWorld(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current coordinates of the player (bottom half).
|
||||
*
|
||||
* @return int array with x and y coordinates, or null if not found.
|
||||
*/
|
||||
public int[] getPlayerCords() {
|
||||
for (int i = 0; i < world.length; i++) {
|
||||
for (int j = 0; j < world[i].length; j++) {
|
||||
@ -80,6 +94,12 @@ public class Game extends AutoTransientSupport {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the player one block to the right if possible.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
* @param terminal the terminal instance used for layout.
|
||||
*/
|
||||
public void movePlayerRight(ScreenRenderer screenRenderer, Terminal terminal) {
|
||||
if (window != Window.WORLD) {
|
||||
return;
|
||||
@ -96,6 +116,8 @@ public class Game extends AutoTransientSupport {
|
||||
world[cords[1] - 1][cords[0]].remove(player.getPlayerBlock1());
|
||||
screenRenderer.render(this);
|
||||
|
||||
stats.setBlocksTraveled(stats.getBlocksTraveled() + 1);
|
||||
|
||||
entitySpawnProvider.update(this, terminal);
|
||||
|
||||
playMovePlayerSound(cords[0] + 1, cords[1]);
|
||||
@ -103,6 +125,12 @@ public class Game extends AutoTransientSupport {
|
||||
update(screenRenderer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the player one block to the left if possible.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
* @param terminal the terminal instance used for layout.
|
||||
*/
|
||||
public void movePlayerLeft(ScreenRenderer screenRenderer, Terminal terminal) {
|
||||
if (window != Window.WORLD) {
|
||||
return;
|
||||
@ -119,6 +147,8 @@ public class Game extends AutoTransientSupport {
|
||||
world[cords[1] - 1][cords[0]].remove(player.getPlayerBlock1());
|
||||
screenRenderer.render(this);
|
||||
|
||||
stats.setBlocksTraveled(stats.getBlocksTraveled() + 1);
|
||||
|
||||
entitySpawnProvider.update(this, terminal);
|
||||
|
||||
playMovePlayerSound(cords[0] - 1, cords[1]);
|
||||
@ -126,6 +156,11 @@ public class Game extends AutoTransientSupport {
|
||||
update(screenRenderer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the player upward by one block, if jumping is valid.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
*/
|
||||
public void movePlayerUp(ScreenRenderer screenRenderer) {
|
||||
if (window != Window.WORLD) {
|
||||
return;
|
||||
@ -141,6 +176,8 @@ public class Game extends AutoTransientSupport {
|
||||
world[cords[1] - 2][cords[0]].add(player.getPlayerBlock1());
|
||||
world[cords[1]][cords[0]].remove(player.getPlayerBlock2());
|
||||
|
||||
stats.setBlocksTraveled(stats.getBlocksTraveled() + 1);
|
||||
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(400);
|
||||
@ -152,6 +189,13 @@ public class Game extends AutoTransientSupport {
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Attacks mobs at a specified location.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
* @param x x-coordinate.
|
||||
* @param y y-coordinate.
|
||||
*/
|
||||
public void hit(ScreenRenderer screenRenderer, int x, int y) {
|
||||
if (mining || window != Window.WORLD) {
|
||||
return;
|
||||
@ -189,6 +233,13 @@ public class Game extends AutoTransientSupport {
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the mining process at a given location.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
* @param x x-coordinate.
|
||||
* @param y y-coordinate.
|
||||
*/
|
||||
public void mine(ScreenRenderer screenRenderer, int x, int y) {
|
||||
if (mining || window != Window.WORLD) {
|
||||
return;
|
||||
@ -257,6 +308,14 @@ public class Game extends AutoTransientSupport {
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantly mines a block without animation delay.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
* @param x x-coordinate.
|
||||
* @param y y-coordinate.
|
||||
* @param minedDirectly whether the block was mined directly by player.
|
||||
*/
|
||||
public void mineInstant(ScreenRenderer screenRenderer, int x, int y, boolean minedDirectly) {
|
||||
var blocks = world[y][x];
|
||||
var blocksCopy = new ArrayList<>(blocks);
|
||||
@ -318,11 +377,21 @@ public class Game extends AutoTransientSupport {
|
||||
}
|
||||
}
|
||||
|
||||
stats.setBlocksMined(stats.getBlocksMined() + 1);
|
||||
|
||||
screenRenderer.render(this);
|
||||
|
||||
update(screenRenderer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a block is valid for mining based on proximity and visibility.
|
||||
*
|
||||
* @param x x-coordinate.
|
||||
* @param y y-coordinate.
|
||||
* @param terminal terminal context used to determine screen bounds.
|
||||
* @return true if mineable, false otherwise.
|
||||
*/
|
||||
public boolean isMineable(int x, int y, Terminal terminal) {
|
||||
List<Block> blocks = world[y][x];
|
||||
|
||||
@ -347,6 +416,15 @@ public class Game extends AutoTransientSupport {
|
||||
&& blocks.stream().anyMatch(Block::isMineable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether a block is valid for hitting (attacking).
|
||||
*
|
||||
* @param x x-coordinate.
|
||||
* @param y y-coordinate.
|
||||
* @param terminal terminal context used to determine screen bounds.
|
||||
* @return true if a mob can be hit at the given location.
|
||||
*/
|
||||
public boolean isHitable(int x, int y, Terminal terminal) {
|
||||
List<Block> blocks = world[y][x];
|
||||
|
||||
@ -371,6 +449,11 @@ public class Game extends AutoTransientSupport {
|
||||
&& blocks.stream().anyMatch(Block::isMob);
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodically checks and updates the player’s falling state due to gravity.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
*/
|
||||
public void update(ScreenRenderer screenRenderer) {
|
||||
while (true) {
|
||||
try {
|
||||
@ -387,6 +470,8 @@ public class Game extends AutoTransientSupport {
|
||||
world[cords2[1]][cords2[0]].remove(player.getPlayerBlock2());
|
||||
player.addFalling();
|
||||
|
||||
stats.setBlocksTraveled(stats.getBlocksTraveled() + 1);
|
||||
|
||||
screenRenderer.render(this);
|
||||
} else {
|
||||
ArrayList<Block> combinedList = new ArrayList<>();
|
||||
@ -402,6 +487,14 @@ public class Game extends AutoTransientSupport {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to place a block or interact with the environment at a given location.
|
||||
* Also handles eating and tool usage.
|
||||
*
|
||||
* @param x x-coordinate.
|
||||
* @param y y-coordinate.
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
*/
|
||||
public void build(int x, int y, ScreenRenderer screenRenderer) {
|
||||
if (window != Window.WORLD) {
|
||||
return;
|
||||
@ -479,10 +572,17 @@ public class Game extends AutoTransientSupport {
|
||||
}
|
||||
}
|
||||
gameStates.dependencies.eventHandlerProvider.handlePlace(screenRenderer, this, x, y);
|
||||
stats.setBlocksPlaced(stats.getBlocksPlaced() + 1);
|
||||
screenRenderer.render(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches the selected inventory slot (hotbar).
|
||||
*
|
||||
* @param slot the slot index to switch to.
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
*/
|
||||
public void changeSlot(int slot, ScreenRenderer screenRenderer) {
|
||||
if (window != Window.WORLD) {
|
||||
return;
|
||||
@ -492,10 +592,21 @@ public class Game extends AutoTransientSupport {
|
||||
screenRenderer.render(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a block list represents a solid space (i.e., not all ghost blocks).
|
||||
*
|
||||
* @param blocks list of blocks at a coordinate.
|
||||
* @return true if any block is not a ghost block.
|
||||
*/
|
||||
public boolean isSolid(List<Block> blocks) {
|
||||
return !blocks.stream().allMatch(Block::isGhost);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visually and logically triggers the player "hit" (damage) animation.
|
||||
*
|
||||
* @param screenRenderer the renderer used to refresh the screen.
|
||||
*/
|
||||
public void playerHit(ScreenRenderer screenRenderer) {
|
||||
player.getPlayerBlock1().setSpriteState(SteveState.FIRST_HURT);
|
||||
player.getPlayerBlock2().setSpriteState(SteveState.SECOND_HURT);
|
||||
|
@ -1,46 +1,66 @@
|
||||
package cz.jzitnik.game;
|
||||
|
||||
import com.esotericsoftware.kryo.Kryo;
|
||||
import com.esotericsoftware.kryo.io.Input;
|
||||
import com.esotericsoftware.kryo.io.Output;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Handles saving and loading the game state using Kryo serialization.
|
||||
*/
|
||||
@Slf4j
|
||||
public class GameSaver {
|
||||
|
||||
private static final String SAVE_FILE = "world.ser";
|
||||
|
||||
private final Kryo kryo;
|
||||
|
||||
/**
|
||||
* Initializes the GameSaver with Kryo serialization setup.
|
||||
*/
|
||||
public GameSaver() {
|
||||
this.kryo = new Kryo();
|
||||
kryo.setRegistrationRequired(false);
|
||||
kryo.setReferences(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the current game state to a file.
|
||||
*
|
||||
* @param game the game instance to be saved
|
||||
*/
|
||||
public void save(Game game) {
|
||||
try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("world.ser"))) {
|
||||
out.writeObject(game);
|
||||
try (Output output = new Output(new FileOutputStream(SAVE_FILE))) {
|
||||
kryo.writeClassAndObject(output, game);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("Failed to save game", e);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: This will need rewrite
|
||||
public static Game load() {
|
||||
/**
|
||||
* Loads the game state from a file. If the save file does not exist,
|
||||
* a new game instance is returned.
|
||||
*
|
||||
* @return the loaded game instance or a new game if no save is found
|
||||
*/
|
||||
public Game load() {
|
||||
log.info("Loading game");
|
||||
File file = new File("world.ser");
|
||||
|
||||
File file = new File(SAVE_FILE);
|
||||
if (!file.isFile()) {
|
||||
log.info("No save file found, creating new game");
|
||||
return new Game();
|
||||
}
|
||||
|
||||
try {
|
||||
try (Input input = new Input(new FileInputStream(SAVE_FILE))) {
|
||||
log.info("Loading game from save file");
|
||||
FileInputStream fileIn = new FileInputStream("world.ser");
|
||||
|
||||
ObjectInputStream in = new ObjectInputStream(fileIn);
|
||||
|
||||
// Read the object from the file
|
||||
Object object = in.readObject();
|
||||
|
||||
Game game = (Game) object;
|
||||
|
||||
in.close();
|
||||
fileIn.close();
|
||||
|
||||
return game;
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
Object object = kryo.readClassAndObject(input);
|
||||
return (Game) object;
|
||||
} catch (IOException e) {
|
||||
log.error("Failed to load game", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ public class SpriteLoader {
|
||||
PIG,
|
||||
SHEEP,
|
||||
COW,
|
||||
ZOMBIE,
|
||||
|
||||
// UI
|
||||
BREAKING,
|
||||
@ -267,6 +268,7 @@ public class SpriteLoader {
|
||||
SPRITES_MAP.put(SPRITES.PIG, new Pig());
|
||||
SPRITES_MAP.put(SPRITES.SHEEP, new Sheep());
|
||||
SPRITES_MAP.put(SPRITES.COW, new Cow());
|
||||
SPRITES_MAP.put(SPRITES.ZOMBIE, new Zombie());
|
||||
|
||||
// UI
|
||||
SPRITES_MAP.put(SPRITES.BREAKING, new Breaking());
|
||||
|
@ -1,16 +0,0 @@
|
||||
package cz.jzitnik.game.annotations;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import cz.jzitnik.game.core.autotransient.AutoTransientInitializer;
|
||||
import cz.jzitnik.game.core.autotransient.DefaultInitializer;
|
||||
|
||||
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface AutoTransient {
|
||||
Class<? extends AutoTransientInitializer<?>> initializer() default DefaultInitializer.class;
|
||||
}
|
@ -1,12 +1,10 @@
|
||||
package cz.jzitnik.game.config;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class Configuration implements Serializable {
|
||||
public class Configuration {
|
||||
private int soundVolume = 100; // 0-100
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
package cz.jzitnik.game.core.autotransient;
|
||||
|
||||
public interface AutoTransientInitializer<T> {
|
||||
T initialize(Object parent);
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package cz.jzitnik.game.core.autotransient;
|
||||
|
||||
import cz.jzitnik.game.annotations.AutoTransient;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public abstract class AutoTransientSupport implements Serializable {
|
||||
|
||||
@Serial
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
reinitializeAutoTransients();
|
||||
}
|
||||
|
||||
protected void reinitializeAutoTransients() {
|
||||
for (Field field : this.getClass().getDeclaredFields()) {
|
||||
if (field.isAnnotationPresent(AutoTransient.class)) {
|
||||
field.setAccessible(true);
|
||||
AutoTransient annotation = field.getAnnotation(AutoTransient.class);
|
||||
try {
|
||||
Object value;
|
||||
|
||||
// Use initializer if provided
|
||||
Class<? extends AutoTransientInitializer<?>> initializerClass = annotation.initializer();
|
||||
if (!initializerClass.equals(DefaultInitializer.class)) {
|
||||
AutoTransientInitializer<?> initializer = initializerClass.getDeclaredConstructor().newInstance();
|
||||
value = initializer.initialize(this);
|
||||
} else {
|
||||
// Fallback to default instantiation
|
||||
value = instantiateField(field.getType());
|
||||
}
|
||||
|
||||
if (value != null) {
|
||||
field.set(this, value);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to reinitialize @AutoTransient field: " + field.getName(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected Object instantiateField(Class<?> clazz) {
|
||||
try {
|
||||
// Try constructor with (this) reference first
|
||||
Constructor<?> constructor = clazz.getDeclaredConstructor(this.getClass());
|
||||
return constructor.newInstance(this);
|
||||
} catch (NoSuchMethodException e) {
|
||||
// Fallback to default constructor
|
||||
try {
|
||||
return clazz.getDeclaredConstructor().newInstance();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package cz.jzitnik.game.core.autotransient;
|
||||
|
||||
public class DefaultInitializer implements AutoTransientInitializer<Object> {
|
||||
@Override
|
||||
public Object initialize(Object parent) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package cz.jzitnik.game.core.autotransient.initilizers;
|
||||
|
||||
import cz.jzitnik.game.core.autotransient.AutoTransientInitializer;
|
||||
|
||||
public class GameMiningInitializer implements AutoTransientInitializer<Boolean> {
|
||||
@Override
|
||||
public Boolean initialize(Object parent) {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package cz.jzitnik.game.core.autotransient.initilizers;
|
||||
|
||||
import cz.jzitnik.game.core.autotransient.AutoTransientInitializer;
|
||||
import cz.jzitnik.game.ui.Window;
|
||||
|
||||
public class GameWindowInitializer implements AutoTransientInitializer<Window> {
|
||||
@Override
|
||||
public Window initialize(Object parent) {
|
||||
return Window.WORLD;
|
||||
}
|
||||
}
|
@ -3,12 +3,29 @@ package cz.jzitnik.game.core.sound;
|
||||
public enum SoundKey {
|
||||
GRASS,
|
||||
GRASS_WALKING,
|
||||
GRASS_MINING,
|
||||
|
||||
GRAVEL,
|
||||
GRAVEL_WALKING,
|
||||
|
||||
WOOD,
|
||||
WOOD_DIG,
|
||||
WOOD_WALKING,
|
||||
WOOD_MINING,
|
||||
|
||||
HURT,
|
||||
HIT,
|
||||
|
||||
SAND_DIG,
|
||||
SAND_MINING,
|
||||
SAND_WALKING,
|
||||
|
||||
STONE_DIG,
|
||||
STONE_WALKING,
|
||||
STONE_MINING,
|
||||
|
||||
WOOL_DIG,
|
||||
|
||||
METAL_DIG,
|
||||
METAL_WALKING,
|
||||
METAL_MINING,
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ import cz.jzitnik.game.core.sound.SoundKey;
|
||||
"grass/grass3.ogg",
|
||||
"grass/grass4.ogg"
|
||||
})
|
||||
public class GrassSound {
|
||||
public class GrassDigSound {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.GRASS_MINING, resourceLocation = {
|
||||
"grass/mining1.ogg",
|
||||
"grass/mining2.ogg",
|
||||
"grass/mining3.ogg",
|
||||
"grass/mining4.ogg",
|
||||
"grass/mining5.ogg",
|
||||
"grass/mining6.ogg"
|
||||
})
|
||||
public class GrassMiningSound {
|
||||
}
|
@ -9,5 +9,5 @@ import cz.jzitnik.game.core.sound.SoundKey;
|
||||
"gravel/gravel3.ogg",
|
||||
"gravel/gravel4.ogg"
|
||||
})
|
||||
public class GravelSound {
|
||||
public class GravelDigSound {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.METAL_DIG, resourceLocation = {
|
||||
"metal/dig1.ogg",
|
||||
"metal/dig2.ogg",
|
||||
"metal/dig3.ogg",
|
||||
"metal/dig4.ogg"
|
||||
})
|
||||
public class MetalDigSound {
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.METAL_MINING, resourceLocation = {
|
||||
"metal/mining1.ogg",
|
||||
"metal/mining2.ogg",
|
||||
"metal/mining3.ogg",
|
||||
"metal/mining4.ogg",
|
||||
"metal/mining5.ogg",
|
||||
"metal/mining6.ogg"
|
||||
|
||||
})
|
||||
public class MetalMiningSound {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.METAL_WALKING, resourceLocation = {
|
||||
"metal/step1.ogg",
|
||||
"metal/step2.ogg",
|
||||
"metal/step3.ogg",
|
||||
"metal/step4.ogg",
|
||||
"metal/step5.ogg",
|
||||
"metal/step6.ogg"
|
||||
})
|
||||
public class MetalWalkingSound {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.SAND_DIG, resourceLocation = {
|
||||
"sand/dig1.ogg",
|
||||
"sand/dig2.ogg",
|
||||
"sand/dig3.ogg",
|
||||
"sand/dig4.ogg"
|
||||
})
|
||||
public class SandDigSound {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.SAND_MINING, resourceLocation = {
|
||||
"sand/mining1.ogg",
|
||||
"sand/mining2.ogg",
|
||||
"sand/mining3.ogg",
|
||||
"sand/mining4.ogg",
|
||||
"sand/mining5.ogg",
|
||||
|
||||
})
|
||||
public class SandMiningSound {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.SAND_WALKING, resourceLocation = {
|
||||
"sand/step1.ogg",
|
||||
"sand/step2.ogg",
|
||||
"sand/step3.ogg",
|
||||
"sand/step4.ogg",
|
||||
"sand/step5.ogg",
|
||||
"sand/step6.ogg"
|
||||
})
|
||||
public class SandWalkingSound {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.STONE_DIG, resourceLocation = {
|
||||
"stone/dig1.ogg",
|
||||
"stone/dig2.ogg",
|
||||
"stone/dig3.ogg",
|
||||
"stone/dig4.ogg"
|
||||
})
|
||||
public class StoneDigSound {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.STONE_MINING, resourceLocation = {
|
||||
"stone/mine1.ogg",
|
||||
"stone/mine2.ogg",
|
||||
"stone/mine3.ogg",
|
||||
"stone/mine4.ogg",
|
||||
"stone/mine5.ogg",
|
||||
"stone/mine6.ogg"
|
||||
})
|
||||
public class StoneMiningSound {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.STONE_WALKING, resourceLocation = {
|
||||
"stone/step1.ogg",
|
||||
"stone/step2.ogg",
|
||||
"stone/step3.ogg",
|
||||
"stone/step4.ogg",
|
||||
"stone/step5.ogg",
|
||||
"stone/step6.ogg"
|
||||
})
|
||||
public class StoneWalkingSound {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.WOOD_DIG, resourceLocation = {
|
||||
"wood/dig1.ogg",
|
||||
"wood/dig2.ogg",
|
||||
"wood/dig3.ogg",
|
||||
"wood/dig4.ogg",
|
||||
})
|
||||
public class WoodDigSound {
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.WOOD_MINING, resourceLocation = {
|
||||
"wood/mining1.ogg",
|
||||
"wood/mining2.ogg",
|
||||
"wood/mining3.ogg",
|
||||
"wood/mining4.ogg",
|
||||
"wood/mining5.ogg",
|
||||
"wood/mining6.ogg"
|
||||
|
||||
})
|
||||
public class WoodMiningSound {
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.WOOD, resourceLocation = {
|
||||
"wood/wood1.ogg",
|
||||
})
|
||||
public class WoodSound {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.WOOD_WALKING, resourceLocation = {
|
||||
"wood/step1.ogg",
|
||||
"wood/step2.ogg",
|
||||
"wood/step3.ogg",
|
||||
"wood/step4.ogg",
|
||||
"wood/step5.ogg",
|
||||
"wood/step6.ogg"
|
||||
})
|
||||
public class WoodWalkingSound {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.WOOL_DIG, resourceLocation = {
|
||||
"wool/dig1.ogg",
|
||||
"wool/dig2.ogg",
|
||||
"wool/dig3.ogg",
|
||||
"wool/dig4.ogg"
|
||||
})
|
||||
public class WoolDigSound {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.WOOL_DIG, resourceLocation = {
|
||||
"wool/dig1.ogg",
|
||||
"wool/dig2.ogg",
|
||||
"wool/dig3.ogg",
|
||||
"wool/dig4.ogg"
|
||||
})
|
||||
public class WoolMiningSound {
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cz.jzitnik.game.core.sound.registry;
|
||||
|
||||
import cz.jzitnik.game.annotations.SoundRegistry;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
|
||||
@SoundRegistry(key = SoundKey.WOOL_DIG, resourceLocation = {
|
||||
"wool/dig1.ogg",
|
||||
"wool/dig2.ogg",
|
||||
"wool/dig3.ogg",
|
||||
"wool/dig4.ogg"
|
||||
})
|
||||
public class WoolWalkingSound {
|
||||
}
|
@ -6,15 +6,16 @@ import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
import cz.jzitnik.game.ui.Inventory;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class Block implements Serializable {
|
||||
@NoArgsConstructor
|
||||
public class Block {
|
||||
private String blockId;
|
||||
private SpriteLoader.SPRITES sprite;
|
||||
private MyOptional<Enum> spriteState = MyOptional.empty();
|
||||
|
@ -11,7 +11,9 @@ import cz.jzitnik.game.mobs.EntityHurtAnimation;
|
||||
import cz.jzitnik.game.mobs.EntityKill;
|
||||
import cz.jzitnik.game.smelting.Smelting;
|
||||
import cz.jzitnik.game.sprites.ui.Font;
|
||||
import cz.jzitnik.game.ui.DeathScreen;
|
||||
import cz.jzitnik.game.ui.Escape;
|
||||
import cz.jzitnik.game.ui.Options;
|
||||
|
||||
public class Dependencies {
|
||||
public PlaceHandler placeHandler = new PlaceHandler();
|
||||
@ -25,8 +27,11 @@ public class Dependencies {
|
||||
public Sound sound = new Sound();
|
||||
public Font font = new Font();
|
||||
public Escape escape;
|
||||
public Options options;
|
||||
public DeathScreen deathScreen = new DeathScreen();
|
||||
|
||||
public Dependencies(Game game) {
|
||||
escape = new Escape(game);
|
||||
options = new Options(game);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
package cz.jzitnik.game.entities;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.function.*;
|
||||
|
||||
public class MyOptional<T> implements Serializable {
|
||||
public class MyOptional<T> {
|
||||
private T value;
|
||||
private boolean isPresent;
|
||||
|
||||
@ -64,22 +63,6 @@ public class MyOptional<T> implements Serializable {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Serial
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.writeBoolean(isPresent);
|
||||
if (isPresent) {
|
||||
out.writeObject(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Serial
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
isPresent = in.readBoolean();
|
||||
if (isPresent) {
|
||||
value = (T) in.readObject();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return isPresent ? "SerializableOptional[" + value + "]" : "SerializableOptional.empty";
|
||||
@ -100,4 +83,4 @@ public class MyOptional<T> implements Serializable {
|
||||
public boolean isEmpty() {
|
||||
return !isPresent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package cz.jzitnik.game.entities;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
@ -11,11 +10,12 @@ import cz.jzitnik.game.Game;
|
||||
import cz.jzitnik.game.annotations.ReduceFallDamage;
|
||||
import cz.jzitnik.game.core.reducefalldamage.Reducer;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.ui.Window;
|
||||
import cz.jzitnik.tui.ScreenRenderer;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class Player implements Serializable {
|
||||
public class Player {
|
||||
private int health = 10;
|
||||
private int hunger = 10;
|
||||
private int fallDistance = 0;
|
||||
@ -42,18 +42,19 @@ public class Player implements Serializable {
|
||||
}
|
||||
|
||||
public void fell(List<Block> fallblock, Game game, ScreenRenderer screenRenderer) {
|
||||
var block = fallblock.stream().filter(b -> b.getClass().isAnnotationPresent(ReduceFallDamage.class)).findFirst();
|
||||
var block = fallblock.stream().filter(b -> b.getClass().isAnnotationPresent(ReduceFallDamage.class))
|
||||
.findFirst();
|
||||
int damage = Math.max(fallDistance - 3, 0);
|
||||
if (block.isPresent()) {
|
||||
var reducerClass = block.get().getClass().getAnnotation(ReduceFallDamage.class).value();
|
||||
try {
|
||||
Reducer reducer = reducerClass.getDeclaredConstructor().newInstance();
|
||||
Reducer reducer = reducerClass.getDeclaredConstructor().newInstance();
|
||||
damage = reducer.reduce(damage);
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
|
||||
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
|
||||
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
|
||||
e.printStackTrace();
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
dealDamage(damage, game, screenRenderer);
|
||||
fallDistance = 0;
|
||||
@ -66,8 +67,9 @@ public class Player implements Serializable {
|
||||
game.getGameStates().dependencies.sound.playSound(game.getConfiguration(), SoundKey.HURT, null);
|
||||
}
|
||||
|
||||
if (health == 0) {
|
||||
// TODO: Implement dead
|
||||
if (health <= 0) {
|
||||
game.setWindow(Window.DEATH_SCREEN);
|
||||
screenRenderer.render(game);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
package cz.jzitnik.game.entities;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -9,6 +7,6 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class SteveData implements Serializable {
|
||||
public class SteveData {
|
||||
private boolean top = false;
|
||||
}
|
||||
|
@ -3,13 +3,12 @@ package cz.jzitnik.game.entities.items;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class InventoryItem implements Serializable {
|
||||
public class InventoryItem {
|
||||
private int amount;
|
||||
private final List<Item> item;
|
||||
|
||||
|
@ -7,12 +7,10 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class Item implements Serializable {
|
||||
public class Item {
|
||||
private String id;
|
||||
private String name;
|
||||
private ItemType type;
|
||||
|
@ -1,13 +1,17 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry("cobblestone")
|
||||
public class CobblestoneBlock extends Block {
|
||||
public CobblestoneBlock() {
|
||||
|
@ -1,14 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.ResetDataOnMine;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.logic.services.farmland.FarmlandData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@PlaceSound(SoundKey.GRAVEL)
|
||||
@MineSound(SoundKey.GRAVEL)
|
||||
@WalkSound(SoundKey.GRAVEL_WALKING)
|
||||
@MiningSound(SoundKey.GRAVEL_WALKING)
|
||||
@ResetDataOnMine
|
||||
@BlockRegistry(value = "farmland", drops = "dirt")
|
||||
public class FarmlandBlock extends Block {
|
||||
|
@ -1,15 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.ReduceFallDamage;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.reducefalldamage.HaybaleFallDamageReducer;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@Flamable
|
||||
@BlockRegistry("haybale")
|
||||
@ReduceFallDamage(HaybaleFallDamageReducer.class)
|
||||
|
@ -7,6 +7,7 @@ import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.logic.services.flowing.FlowingData;
|
||||
import cz.jzitnik.game.sprites.Water;
|
||||
|
||||
|
||||
@Burning
|
||||
@BlockRegistry(value = "lava", drops = "lava_bucket")
|
||||
public class LavaBlock extends Block {
|
||||
|
@ -1,15 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolidNoHandler;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.blocks.OakDoorData;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.WOOD_DIG)
|
||||
@PlaceSound(SoundKey.WOOD_DIG)
|
||||
@MiningSound(SoundKey.WOOD_MINING)
|
||||
@WalkSound(SoundKey.WOOD_WALKING)
|
||||
@Flamable
|
||||
@PlaceOnSolidNoHandler
|
||||
@BlockRegistry("oak_door")
|
||||
|
@ -1,13 +1,17 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@Flamable
|
||||
@BlockRegistry("oak_leaves")
|
||||
public class OakLeavesBlock extends Block {
|
||||
|
@ -1,18 +1,17 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.MineSound;
|
||||
import cz.jzitnik.game.annotations.PlaceSound;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.WOOD)
|
||||
@PlaceSound(SoundKey.WOOD)
|
||||
@MineSound(SoundKey.WOOD_DIG)
|
||||
@PlaceSound(SoundKey.WOOD_DIG)
|
||||
@MiningSound(SoundKey.WOOD_MINING)
|
||||
@WalkSound(SoundKey.WOOD_WALKING)
|
||||
@Flamable
|
||||
@BlockRegistry("oak_log")
|
||||
public class OakLogBlock extends Block {
|
||||
|
@ -1,13 +1,17 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.WOOD_DIG)
|
||||
@PlaceSound(SoundKey.WOOD_DIG)
|
||||
@MiningSound(SoundKey.WOOD_MINING)
|
||||
@WalkSound(SoundKey.WOOD_WALKING)
|
||||
@Flamable
|
||||
@BlockRegistry("oak_planks")
|
||||
public class OakPlanksBlock extends Block {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry("obsidian")
|
||||
public class ObsidianBlock extends Block {
|
||||
public ObsidianBlock() {
|
||||
|
@ -1,13 +1,17 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.FallingBlock;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.SAND_DIG)
|
||||
@PlaceSound(SoundKey.SAND_DIG)
|
||||
@MiningSound(SoundKey.SAND_MINING)
|
||||
@WalkSound(SoundKey.SAND_WALKING)
|
||||
@FallingBlock
|
||||
@BlockRegistry("sand")
|
||||
public class SandBlock extends Block {
|
||||
|
@ -1,13 +1,17 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.blocks;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry(value = "stone", drops = "cobblestone")
|
||||
public class StoneBlock extends Block {
|
||||
public StoneBlock() {
|
||||
|
@ -1,20 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockDropPercentage;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksByPlace;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.CustomDrop;
|
||||
import cz.jzitnik.game.annotations.MineSound;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.PlaceSound;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,13 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.ResetDataOnMine;
|
||||
import cz.jzitnik.game.annotations.Sapling;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.logic.services.saplings.SaplingData;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@Sapling
|
||||
@PlaceOnSolid
|
||||
@ResetDataOnMine
|
||||
|
@ -1,14 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Farmable;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolidNoHandler;
|
||||
import cz.jzitnik.game.annotations.ResetDataOnMine;
|
||||
import cz.jzitnik.game.annotations.ResetSpriteStateOnMine;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.logic.services.farmable.FarmableData;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@Farmable("wheat")
|
||||
@PlaceOnSolidNoHandler
|
||||
@ResetDataOnMine
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,13 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.TwoblockBlock;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,13 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.TwoblockBlock;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,13 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.TwoblockBlock;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,13 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.TwoblockBlock;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.grassy.flowers;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.BreakableByWater;
|
||||
import cz.jzitnik.game.annotations.BreaksFalling;
|
||||
import cz.jzitnik.game.annotations.PlaceOnSolid;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
|
||||
@MineSound(SoundKey.GRASS)
|
||||
@PlaceSound(SoundKey.GRASS)
|
||||
@WalkSound(SoundKey.GRASS_WALKING)
|
||||
@MiningSound(SoundKey.GRASS_MINING)
|
||||
@PlaceOnSolid
|
||||
@BreakableByWater
|
||||
@BreaksFalling
|
||||
|
@ -1,14 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.coal;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@Flamable
|
||||
@BlockRegistry("coal_block")
|
||||
public class CoalBlock extends Block {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.coal;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry("coal_ore")
|
||||
public class CoalOreBlock extends Block {
|
||||
public CoalOreBlock() {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.diamond;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@WalkSound(SoundKey.METAL_WALKING)
|
||||
@MiningSound(SoundKey.METAL_MINING)
|
||||
@PlaceSound(SoundKey.METAL_DIG)
|
||||
@MineSound(SoundKey.METAL_DIG)
|
||||
@BlockRegistry("diamond_block")
|
||||
public class DiamondBlock extends Block {
|
||||
public DiamondBlock() {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.diamond;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry("diamond_ore")
|
||||
public class DiamondOreBlock extends Block {
|
||||
public DiamondOreBlock() {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.gold;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@WalkSound(SoundKey.METAL_WALKING)
|
||||
@MiningSound(SoundKey.METAL_MINING)
|
||||
@PlaceSound(SoundKey.METAL_DIG)
|
||||
@MineSound(SoundKey.METAL_DIG)
|
||||
@BlockRegistry("gold_block")
|
||||
public class GoldBlock extends Block {
|
||||
public GoldBlock() {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.gold;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry("gold_ore")
|
||||
public class GoldOreBlock extends Block {
|
||||
public GoldOreBlock() {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.iron;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@WalkSound(SoundKey.METAL_WALKING)
|
||||
@MiningSound(SoundKey.METAL_MINING)
|
||||
@PlaceSound(SoundKey.METAL_DIG)
|
||||
@MineSound(SoundKey.METAL_DIG)
|
||||
@BlockRegistry("iron_block")
|
||||
public class IronBlock extends Block {
|
||||
public IronBlock() {
|
||||
|
@ -1,13 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.ores.iron;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry("iron_ore")
|
||||
public class IronOreBlock extends Block {
|
||||
public IronOreBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("black_wool")
|
||||
public class BlackWoolBlock extends Block {
|
||||
public BlackWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("blue_wool")
|
||||
public class BlueWoolBlock extends Block {
|
||||
public BlueWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("brown_wool")
|
||||
public class BrownWoolBlock extends Block {
|
||||
public BrownWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("cyan_wool")
|
||||
public class CyanWoolBlock extends Block {
|
||||
public CyanWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("gray_wool")
|
||||
public class GrayWoolBlock extends Block {
|
||||
public GrayWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("green_wool")
|
||||
public class GreenWoolBlock extends Block {
|
||||
public GreenWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("light_blue_wool")
|
||||
public class LightBlueWoolBlock extends Block {
|
||||
public LightBlueWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("light_gray_wool")
|
||||
public class LightGrayWoolBlock extends Block {
|
||||
public LightGrayWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("lime_wool")
|
||||
public class LimeWoolBlock extends Block {
|
||||
public LimeWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("magenta_wool")
|
||||
public class MagentaWoolBlock extends Block {
|
||||
public MagentaWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("orange_wool")
|
||||
public class OrangeWoolBlock extends Block {
|
||||
public OrangeWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("pink_wool")
|
||||
public class PinkWoolBlock extends Block {
|
||||
public PinkWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("purple_wool")
|
||||
public class PurpleWoolBlock extends Block {
|
||||
public PurpleWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("red_wool")
|
||||
public class RedWoolBlock extends Block {
|
||||
public RedWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("white_wool")
|
||||
public class WhiteWoolBlock extends Block {
|
||||
public WhiteWoolBlock() {
|
||||
|
@ -1,10 +1,15 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.wools;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Wool;
|
||||
|
||||
@PlaceSound(SoundKey.WOOL_DIG)
|
||||
@MineSound(SoundKey.WOOL_DIG)
|
||||
@WalkSound(SoundKey.WOOL_DIG)
|
||||
@MiningSound(SoundKey.WOOL_DIG)
|
||||
@BlockRegistry("yellow_wool")
|
||||
public class YellowWoolBlock extends Block {
|
||||
public YellowWoolBlock() {
|
||||
|
@ -1,12 +1,16 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.work;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.ReduceFallDamage;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.reducefalldamage.BedFallDamageReducer;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.sprites.Bed;
|
||||
|
||||
@MineSound(SoundKey.WOOD_DIG)
|
||||
@PlaceSound(SoundKey.WOOD_DIG)
|
||||
@MiningSound(SoundKey.WOOD_MINING)
|
||||
@WalkSound(SoundKey.WOOD_WALKING)
|
||||
@ReduceFallDamage(BedFallDamageReducer.class)
|
||||
@BlockRegistry("bed")
|
||||
public class BedBlock extends Block {
|
||||
|
@ -1,14 +1,18 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.work;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.blocks.Chest;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.WOOD_DIG)
|
||||
@PlaceSound(SoundKey.WOOD_DIG)
|
||||
@MiningSound(SoundKey.WOOD_MINING)
|
||||
@WalkSound(SoundKey.WOOD_WALKING)
|
||||
@Flamable(false)
|
||||
@BlockRegistry("chest")
|
||||
public class ChestBlock extends Block {
|
||||
|
@ -1,13 +1,17 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.work;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.Flamable;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@MineSound(SoundKey.WOOD_DIG)
|
||||
@PlaceSound(SoundKey.WOOD_DIG)
|
||||
@MiningSound(SoundKey.WOOD_MINING)
|
||||
@WalkSound(SoundKey.WOOD_WALKING)
|
||||
@Flamable(false)
|
||||
@BlockRegistry("crafting_table")
|
||||
public class CraftingTableBlock extends Block {
|
||||
|
@ -1,14 +1,19 @@
|
||||
package cz.jzitnik.game.entities.items.registry.blocks.work;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.BlockRegistry;
|
||||
import cz.jzitnik.game.annotations.*;
|
||||
import cz.jzitnik.game.blocks.Furnace;
|
||||
import cz.jzitnik.game.core.sound.SoundKey;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.entities.items.ToolVariant;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@PlaceSound(SoundKey.STONE_DIG)
|
||||
@MineSound(SoundKey.STONE_DIG)
|
||||
@WalkSound(SoundKey.STONE_WALKING)
|
||||
@MiningSound(SoundKey.STONE_MINING)
|
||||
@BlockRegistry("furnace")
|
||||
public class FurnaceBlock extends Block {
|
||||
public FurnaceBlock() {
|
||||
|
@ -6,7 +6,6 @@ import cz.jzitnik.game.annotations.ItemRegistry;
|
||||
import cz.jzitnik.game.entities.items.Item;
|
||||
import cz.jzitnik.game.entities.items.ItemType;
|
||||
import cz.jzitnik.game.sprites.Dye;
|
||||
import cz.jzitnik.game.sprites.WoolItem;
|
||||
|
||||
@Fuel(0.5)
|
||||
@ItemRegistry("black_dye")
|
||||
|
@ -0,0 +1,19 @@
|
||||
package cz.jzitnik.game.entities.items.registry.mobs;
|
||||
|
||||
import cz.jzitnik.game.SpriteLoader;
|
||||
import cz.jzitnik.game.annotations.EntityRegistry;
|
||||
import cz.jzitnik.game.entities.Block;
|
||||
import cz.jzitnik.game.mobs.services.zombie.ZombieData;
|
||||
|
||||
@EntityRegistry("zombie")
|
||||
public class Zombie extends Block {
|
||||
public Zombie() {
|
||||
super("zombie", SpriteLoader.SPRITES.ZOMBIE);
|
||||
setMob(true);
|
||||
setGhost(true);
|
||||
setSpriteState(cz.jzitnik.game.sprites.Zombie.ZombieState.TOP);
|
||||
setMineable(false);
|
||||
setData(new ZombieData());
|
||||
setHp(10);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user