Skip to content

Commit

Permalink
refactor: move loottable back to server module
Browse files Browse the repository at this point in the history
This is because we do not have a plan to add support for data-driven things like loot table. The reason why I implement block loot table is to speed up the development of vanilla blocks.
  • Loading branch information
smartcmd committed Nov 6, 2024
1 parent b6b9f56 commit 516e76d
Show file tree
Hide file tree
Showing 26 changed files with 51 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import com.google.gson.JsonParser;
import lombok.extern.slf4j.Slf4j;
import org.allaymc.api.block.data.BlockId;
import org.allaymc.api.loottable.LootTableType;
import org.allaymc.api.loottable.Rolls;
import org.allaymc.api.loottable.condition.Condition;
import org.allaymc.api.loottable.condition.Conditions;
import org.allaymc.api.loottable.entry.Entries;
import org.allaymc.api.loottable.entry.Entry;
import org.allaymc.server.loottable.LootTableType;
import org.allaymc.server.loottable.Rolls;
import org.allaymc.server.loottable.condition.Condition;
import org.allaymc.server.loottable.condition.Conditions;
import org.allaymc.server.loottable.entry.Entries;
import org.allaymc.server.loottable.entry.Entry;
import org.allaymc.api.utils.Utils;
import org.allaymc.server.loottable.LootTable;
import org.allaymc.server.loottable.Pool;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.allaymc.server.loottable;

import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.LootTableType;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.server.loottable.context.Context;

import java.util.List;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.allaymc.api.loottable;
package org.allaymc.server.loottable;

import com.google.gson.JsonObject;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.allaymc.api.loottable.condition.Condition;
import org.allaymc.api.loottable.condition.ConditionDeserializer;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.api.loottable.entry.Entry;
import org.allaymc.api.loottable.entry.EntryDeserializer;
import org.allaymc.api.loottable.function.Function;
import org.allaymc.api.loottable.function.FunctionDeserializer;
import org.allaymc.server.loottable.condition.Condition;
import org.allaymc.server.loottable.condition.ConditionDeserializer;
import org.allaymc.server.loottable.context.Context;
import org.allaymc.server.loottable.entry.Entry;
import org.allaymc.server.loottable.entry.EntryDeserializer;
import org.allaymc.server.loottable.function.Function;
import org.allaymc.server.loottable.function.FunctionDeserializer;

import java.util.HashMap;
import java.util.Map;
Expand Down
7 changes: 3 additions & 4 deletions server/src/main/java/org/allaymc/server/loottable/Pool.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package org.allaymc.server.loottable;

import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.Rolls;
import org.allaymc.api.loottable.condition.Conditions;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.api.loottable.entry.Entries;
import org.allaymc.server.loottable.condition.Conditions;
import org.allaymc.server.loottable.context.Context;
import org.allaymc.server.loottable.entry.Entries;

import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.allaymc.api.loottable;
package org.allaymc.server.loottable;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.allaymc.api.loottable.condition;
package org.allaymc.server.loottable.condition;

import org.allaymc.api.loottable.context.Context;
import org.allaymc.server.loottable.context.Context;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.allaymc.api.loottable.condition;
package org.allaymc.server.loottable.condition;

import com.google.gson.JsonObject;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.server.loottable.context.Context;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.allaymc.api.loottable.condition;
package org.allaymc.server.loottable.condition;

import org.allaymc.api.loottable.context.Context;
import org.allaymc.server.loottable.context.Context;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import lombok.AllArgsConstructor;
import org.allaymc.api.item.enchantment.EnchantmentType;
import org.allaymc.api.item.type.ItemType;
import org.allaymc.api.loottable.condition.Condition;
import org.allaymc.api.loottable.condition.ConditionDeserializer;
import org.allaymc.api.registry.Registries;
import org.allaymc.api.utils.Identifier;
import org.allaymc.server.loottable.context.BreakBlockContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import lombok.Getter;
import org.allaymc.api.entity.Entity;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.context.Context;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.allaymc.api.loottable.context;
package org.allaymc.server.loottable.context;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.allaymc.api.loottable.LootTableType;
import org.allaymc.api.loottable.condition.Condition;
import org.allaymc.api.loottable.condition.Conditions;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.api.loottable.entry.Entry;
import org.allaymc.server.loottable.LootTableType;
import org.allaymc.server.loottable.condition.Condition;
import org.allaymc.server.loottable.condition.Conditions;
import org.allaymc.server.loottable.context.Context;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import com.google.gson.JsonObject;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.LootTableType;
import org.allaymc.api.loottable.condition.Conditions;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.api.loottable.entry.Entry;
import org.allaymc.api.loottable.entry.EntryDeserializer;
import org.allaymc.server.loottable.LootTableType;
import org.allaymc.server.loottable.condition.Conditions;
import org.allaymc.server.loottable.context.Context;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.allaymc.api.loottable.entry;
package org.allaymc.server.loottable.entry;

import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.server.loottable.context.Context;

import java.util.List;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.allaymc.api.loottable.entry;
package org.allaymc.server.loottable.entry;

import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.condition.Conditions;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.server.loottable.condition.Conditions;
import org.allaymc.server.loottable.context.Context;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.allaymc.api.loottable.entry;
package org.allaymc.server.loottable.entry;

import com.google.gson.JsonObject;
import org.allaymc.api.loottable.LootTableType;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.server.loottable.LootTableType;
import org.allaymc.server.loottable.context.Context;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import com.google.gson.JsonObject;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.item.type.ItemType;
import org.allaymc.api.loottable.LootTableType;
import org.allaymc.api.loottable.condition.Conditions;
import org.allaymc.api.loottable.context.Context;
import org.allaymc.api.loottable.entry.EntryDeserializer;
import org.allaymc.api.loottable.function.Function;
import org.allaymc.api.loottable.function.Functions;
import org.allaymc.server.loottable.LootTableType;
import org.allaymc.server.loottable.condition.Conditions;
import org.allaymc.server.loottable.context.Context;
import org.allaymc.server.loottable.function.Function;
import org.allaymc.server.loottable.function.Functions;
import org.allaymc.api.registry.Registries;
import org.allaymc.api.utils.Identifier;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.allaymc.api.loottable.function;
package org.allaymc.server.loottable.function;

import org.allaymc.api.item.ItemStack;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.allaymc.api.loottable.function;
package org.allaymc.server.loottable.function;

import com.google.gson.JsonObject;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.allaymc.api.loottable.function;
package org.allaymc.server.loottable.function;

import org.allaymc.api.item.ItemStack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.function.Function;
import org.allaymc.api.loottable.function.FunctionDeserializer;

import java.util.concurrent.ThreadLocalRandom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.function.Function;
import org.allaymc.api.loottable.function.FunctionDeserializer;

import java.util.concurrent.ThreadLocalRandom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.function.Function;
import org.allaymc.api.loottable.function.FunctionDeserializer;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
import org.allaymc.api.item.ItemStack;
import org.allaymc.api.loottable.function.Function;
import org.allaymc.api.loottable.function.FunctionDeserializer;

/**
* @author daoge_cmd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.allaymc.server.loottable.roll;

import lombok.AllArgsConstructor;
import org.allaymc.api.loottable.Rolls;
import org.allaymc.server.loottable.Rolls;

import java.util.concurrent.ThreadLocalRandom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.allaymc.api.loottable.Rolls;
import org.allaymc.server.loottable.Rolls;

/**
* @author daoge_cmd
Expand Down

0 comments on commit 516e76d

Please sign in to comment.