aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/los/numeros/HidersAndDiggers
diff options
context:
space:
mode:
authorFrog-That-code <max@kawallski.localdomain>2024-06-05 15:57:34 -0400
committerFrog-That-code <max@kawallski.localdomain>2024-06-05 15:57:34 -0400
commit0183d252c2bfe58667ff3e6a3b23f3cad27b29ca (patch)
tree547a78ef4f959ca1986f414b34edcce4b9005f50 /src/main/java/los/numeros/HidersAndDiggers
parent16a59696e8cca775d17327bddac8b36ecab6e729 (diff)
downloadlnm-0183d252c2bfe58667ff3e6a3b23f3cad27b29ca.tar.gz
lnm-0183d252c2bfe58667ff3e6a3b23f3cad27b29ca.tar.bz2
lnm-0183d252c2bfe58667ff3e6a3b23f3cad27b29ca.zip
add giving item to players in main module
Diffstat (limited to '')
-rw-r--r--src/main/java/los/numeros/HidersAndDiggers/modules/MainModule.java70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/main/java/los/numeros/HidersAndDiggers/modules/MainModule.java b/src/main/java/los/numeros/HidersAndDiggers/modules/MainModule.java
new file mode 100644
index 0000000..8c1b2b3
--- /dev/null
+++ b/src/main/java/los/numeros/HidersAndDiggers/modules/MainModule.java
@@ -0,0 +1,70 @@
+package los.numeros.HidersAndDiggers.modules;
+
+import los.numeros.GameEngine.Module;
+import los.numeros.utils.GiveItem;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.enchantment.Enchantments;
+import net.minecraft.entity.effect.StatusEffectInstance;
+import net.minecraft.entity.effect.StatusEffects;
+import net.minecraft.item.ItemStack;
+import net.minecraft.server.network.ServerPlayerEntity;
+import net.minecraft.world.GameMode;
+
+public class MainModule implements Module {
+ ServerPlayerEntity[] diggers, hidders, players;
+
+ public MainModule(ServerPlayerEntity[] diggers, ServerPlayerEntity[] hidders, ServerPlayerEntity[] players) {
+ this.diggers = diggers;
+ this.hidders = hidders;
+ this.players = players;
+ }
+
+ public void giveDiggerItems(ServerPlayerEntity[] diggers) {
+ for (ServerPlayerEntity p : diggers) {
+ GiveItem.setPlayerSlot(p, "diamond_helmet", GiveItem.ARMOR_HEAD);
+ GiveItem.setPlayerSlot(p, "diamond_leggings", GiveItem.ARMOR_LEGS);
+ GiveItem.setPlayerSlot(p, "diamond_chestplate", GiveItem.ARMOR_CHEST);
+ GiveItem.setPlayerSlot(p, "diamond_boots", GiveItem.ARMOR_BOOTS);
+ GiveItem.setPlayerSlot(p, "iron_sword", 0);
+ ItemStack pickaxe = GiveItem.givePlayerSpecialItem(p, "diamond_pickaxe");
+ pickaxe.addEnchantment(Enchantments.EFFICIENCY, 3);
+ pickaxe.addEnchantment(Enchantments.UNBREAKING, 255); // TODO: add item attribute unbreakable
+ p.equip(1, pickaxe);
+ }
+ }
+
+ public void giveHidersItems(ServerPlayerEntity[] hidders) {
+ for (ServerPlayerEntity p : hidders) {
+ ItemStack pickaxe = GiveItem.givePlayerSpecialItem(p, "diamond_pickaxe");
+ pickaxe.addEnchantment(Enchantments.SILK_TOUCH, 1);
+ pickaxe.addEnchantment(Enchantments.UNBREAKING, 255); // TODO: add item attribute unbreakable
+ p.equip(0, pickaxe);
+ GiveItem.setPlayerSlot(p, "minecraft:stone", 1);
+ }
+ }
+
+ @Override
+ public int init()
+ {
+ giveHidersItems(hidders);
+ giveDiggerItems(diggers);
+ for (ServerPlayerEntity p : players) {
+ p.addStatusEffect(new StatusEffectInstance(StatusEffects.NIGHT_VISION, 200000000, 3, false, false));
+ p.addStatusEffect(new StatusEffectInstance(StatusEffects.HASTE, 200000000, 1, false, false));
+ p.addStatusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 300, 100, false, false)); // TODO: Rplace with jsut setting health/hunger
+ p.addStatusEffect(new StatusEffectInstance(StatusEffects.SATURATION, 300, 100, false, false));
+ // TODO: add haste
+ // TODO: add beef x64
+ p.setGameMode(GameMode.SURVIVAL);
+ }
+ // TODO: FILL AND TP PLAYERS AND CLEAR ALL ITEMS
+ return 0;
+ }
+
+ @Override
+ public int end()
+ {
+
+ return 0;
+ }
+} \ No newline at end of file