Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mworzala committed Sep 17, 2022
1 parent 9097194 commit 406d0cc
Show file tree
Hide file tree
Showing 71 changed files with 171 additions and 440 deletions.
105 changes: 3 additions & 102 deletions modules/development/src/main/java/net/hollowcube/server/dev/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,23 @@

import net.hollowcube.item.crafting.RecipeList;
import net.hollowcube.item.crafting.ToolCraftingInventory;
import net.hollowcube.player.PlayerImpl;
import net.hollowcube.server.dev.tool.DebugToolManager;
import net.hollowcube.server.instance.TickTrackingInstance;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.mattworzala.debug.DebugMessage;
import com.mattworzala.debug.Layer;
import com.mattworzala.debug.shape.Line;
import com.mattworzala.debug.shape.Text;
import com.mojang.serialization.JsonOps;
import net.kyori.adventure.audience.Audience;
import net.minestom.server.MinecraftServer;
import net.minestom.server.ServerProcess;
import net.minestom.server.command.builder.Command;
import net.minestom.server.adventure.MinestomAdventure;
import net.minestom.server.command.builder.Command;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.GameMode;
import net.minestom.server.entity.Player;
import net.minestom.server.event.EventNode;
import net.minestom.server.event.GlobalEventHandler;
import net.minestom.server.event.player.PlayerLoginEvent;
import net.minestom.server.event.player.PlayerPacketOutEvent;
import net.minestom.server.event.player.PlayerSpawnEvent;
import net.minestom.server.instance.Instance;
import net.minestom.server.instance.InstanceManager;
import net.minestom.server.instance.block.Block;
import net.minestom.server.network.packet.server.CachedPacket;
import net.minestom.server.network.packet.server.FramedPacket;
import net.minestom.server.network.packet.server.LazyPacket;
import net.minestom.server.network.packet.server.SendablePacket;
import net.minestom.server.instance.block.BlockHandler;
import net.minestom.server.network.packet.server.*;
import net.minestom.server.network.packet.server.play.EntityHeadLookPacket;
import net.minestom.server.network.packet.server.play.EntityPositionAndRotationPacket;
import net.minestom.server.network.packet.server.play.EntityRotationPacket;
import net.minestom.server.potion.Potion;
import net.minestom.server.potion.PotionEffect;
import net.minestom.server.utils.NamespaceID;
import net.minestom.server.world.DimensionType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import net.hollowcube.blocks.BlockInteracter;
Expand All @@ -48,35 +27,11 @@
import net.hollowcube.server.Facet;
import net.hollowcube.server.ServerWrapper;
import net.hollowcube.server.dev.command.BaseCommandRegister;
import unnamed.mmo.blocks.BlockInteracter;
import unnamed.mmo.blocks.ore.Ore;
import unnamed.mmo.chat.ChatManager;
import unnamed.mmo.chat.storage.ChatStorage;
import unnamed.mmo.command.BaseCommandRegister;
import unnamed.mmo.damage.DamageProcessor;
import unnamed.mmo.data.number.NumberProvider;
import unnamed.mmo.entity.HeadRotationZombie;
import unnamed.mmo.logging.LoggerFactory;
import unnamed.mmo.entity.UnnamedEntity;
import unnamed.mmo.entity.brain.task.*;
import unnamed.mmo.item.Item;
import unnamed.mmo.damage.DamageProcessor;
import unnamed.mmo.item.Item;
import unnamed.mmo.item.ItemManager;
import unnamed.mmo.mql.MqlScript;
import unnamed.mmo.item.entity.OwnedItemEntity;
import unnamed.mmo.player.PlayerImpl;
import unnamed.mmo.quest.QuestFacet;
import unnamed.mmo.server.dev.tool.DebugToolManager;
import unnamed.mmo.server.instance.TickTrackingInstance;

import java.util.List;

import java.util.HashMap;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.UUID;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

Expand Down Expand Up @@ -115,60 +70,6 @@ public static void main(String[] args) {
//todo a command for this
player.getInventory().addItemStack(DebugToolManager.createTool("unnamed:hello"));


//todo test entity
// JsonElement json = JsonParser.parseString("""
// {
// "type": "unnamed:selector",
// "children": {
// "q.has_target": {
// "type": "unnamed:follow_target"
// },
// "": {
// "type": "unnamed:sequence",
// "children": [
// {
// "type": "unnamed:wander_in_region"
// },
// {
// "type": "unnamed:idle",
// "time": 5
// }
// ],
//
// "canInterrupt": true
// }
// }
// }""");
// JsonElement json = JsonParser.parseString("""
// {
// "type": "unnamed:sequence",
// "children": [
// {
// "type": "unnamed:wander_in_region"
// },
// {
// "type": "unnamed:idle",
// "time": 20
// }
// ]
// }""");
// Task task = JsonOps.INSTANCE.withDecoder(Task.Spec.CODEC)
// .apply(json).getOrThrow(false, System.err::println).getFirst().create();
// UnnamedEntity entity = new UnnamedEntity(task);
// entity.setInstance(instance, new Pos(0, 40, 0))
// .thenAccept(unused -> System.out.println("Spawned"));

// Entity entity = new Entity(EntityType.ZOMBIE) {
// @Override
// public void tick(long time) {
// super.tick(time);
//
// lookAt(player);
// }
// };
Entity entity = new HeadRotationZombie();
entity.setInstance(instance, new Pos(0, 40, 0));
});

BaseCommandRegister.registerCommands(); //todo this should be in a facet?
Expand Down
164 changes: 0 additions & 164 deletions modules/development/src/main/java/unnamed/mmo/server/dev/Main.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package unnamed.mmo.entity;
package net.hollowcube.entity;

import net.minestom.server.entity.Entity;
import net.minestom.server.entity.LivingEntity;
import net.hollowcube.mql.runtime.MqlRuntimeError;
import net.hollowcube.mql.runtime.MqlScope;
import net.hollowcube.mql.value.MqlHolder;
import org.jetbrains.annotations.NotNull;
import unnamed.mmo.mql.runtime.MqlRuntimeError;
import unnamed.mmo.mql.runtime.MqlScope;
import unnamed.mmo.mql.value.MqlHolder;
import unnamed.mmo.mql.value.MqlValue;
import net.hollowcube.mql.value.MqlValue;

//todo this whole class sucks, need to work out mql querying better
public record EntityMqlQueryContext(@NotNull UnnamedEntity entity) implements MqlScope {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package unnamed.mmo.entity;
package net.hollowcube.entity;

import net.minestom.server.collision.CollisionUtils;
import net.minestom.server.coordinate.Point;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package unnamed.mmo.entity;
package net.hollowcube.entity;

import net.hollowcube.entity.brain.Brain;
import net.hollowcube.entity.brain.SingleTaskBrain;
import net.hollowcube.entity.brain.task.Task;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.Entity;
import net.minestom.server.entity.EntityType;
Expand All @@ -9,9 +12,6 @@
import net.minestom.server.event.entity.EntityAttackEvent;
import net.minestom.server.instance.Instance;
import org.jetbrains.annotations.NotNull;
import unnamed.mmo.entity.brain.Brain;
import unnamed.mmo.entity.brain.SingleTaskBrain;
import unnamed.mmo.entity.brain.task.Task;

import java.util.concurrent.CompletableFuture;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package unnamed.mmo.entity.brain;
package net.hollowcube.entity.brain;

import net.hollowcube.entity.brain.navigator.Navigator;
import net.minestom.server.coordinate.Point;
import net.minestom.server.entity.Entity;
import net.minestom.server.instance.Instance;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import unnamed.mmo.entity.brain.navigator.Navigator;

public interface Brain {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package unnamed.mmo.entity.brain;
package net.hollowcube.entity.brain;

import net.hollowcube.entity.brain.navigator.Navigator;
import net.hollowcube.entity.brain.task.Task;
import net.minestom.server.coordinate.Point;
import net.minestom.server.entity.Entity;
import net.minestom.server.instance.Instance;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import unnamed.mmo.entity.brain.navigator.Navigator;
import unnamed.mmo.entity.brain.task.Task;

public class SingleTaskBrain implements Brain {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package unnamed.mmo.entity.brain.navigator;
package net.hollowcube.entity.brain.navigator;

import net.minestom.server.coordinate.Point;
import net.minestom.server.entity.Entity;
import org.jetbrains.annotations.NotNull;
import unnamed.mmo.entity.pathfinding.PFNavigator;
import net.hollowcube.entity.pathfinding.PFNavigator;

final class CustomNavigator implements Navigator {
private final PFNavigator navigator;
Expand Down
Loading

0 comments on commit 406d0cc

Please sign in to comment.