From 06d641c65a91ca60fbdae631a21f56582e45966e Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:42:54 -0500 Subject: [PATCH] moved bear ticker to gt core --- .../trinsdar/gt4r/events/CommonEvents.java | 75 ------------------- .../gt4r/fabric/GT4ReimaginedFabric.java | 1 - .../events/forge/ForgeEventBusEvents.java | 7 -- 3 files changed, 83 deletions(-) diff --git a/common/src/main/java/trinsdar/gt4r/events/CommonEvents.java b/common/src/main/java/trinsdar/gt4r/events/CommonEvents.java index 16d52a78..009b7f6a 100644 --- a/common/src/main/java/trinsdar/gt4r/events/CommonEvents.java +++ b/common/src/main/java/trinsdar/gt4r/events/CommonEvents.java @@ -25,79 +25,4 @@ public static void onRightlickBlock(Player player, InteractionHand hand, boolean } } } - - private static int BEAR_INVENTORY_COOL_DOWN = 5; - - public static void onPlayerTick(Player player, boolean isServer){ - if (isServer && player.getUUID().equals(new UUID(0x1964e3d1650040e7L, 0x9ff2e6161d41a8c2L))){ - if (player.tickCount % 120 == 0) { - ItemStack tStack; - int tEmptySlots = 36; - int tFullSlots = 0; - for (int i = 0; i < 36; i++) { - tStack = player.getInventory().getItem(i); - - if (!tStack.isEmpty()) { - tEmptySlots--; - tFullSlots++; - } - } - - // This Code is to tell Bear and all the people around him that he should clean up his always cluttered Inventory. - if (--BEAR_INVENTORY_COOL_DOWN < 0 && tEmptySlots < 4) { - InventoryMenu playerContainer = player.inventoryMenu; - BEAR_INVENTORY_COOL_DOWN = 100; - for (int i = 0; i < player.level.players().size(); i++) { - Player player2 = player.level.players().get(i); - if (player2 == null) continue; - if (player2 == player) { - if (player2.blockPosition().getY() < 30) { - player2.sendMessage(new TextComponent("Stop making Holes in the Ground, Bear!"), player2.getUUID()); - } else { - // Bear does not like being called these names, so lets annoy him. XD - switch (tEmptySlots) { - case 0: - player2.sendMessage(new TextComponent("Alright Buttercup, your Inventory is full, time to go home."), player2.getUUID()); - break; - case 1: - player2.sendMessage(new TextComponent("Your Inventory is starting to get full, Buttercup"), player2.getUUID()); - break; - case 2: - player2.sendMessage(new TextComponent("Your Inventory is starting to get full, Bean989Sr"), player2.getUUID()); - break; - case 3: - player2.sendMessage(new TextComponent("Your Inventory is starting to get full, Mr. Bear"), player2.getUUID()); - break; - } - } - } else if (player2.getUUID().equals(new UUID(0x06c2928890db44c5L, 0xa642db906b52eb59L))) { - ItemStack cookie = new ItemStack(Items.COOKIE); - ListTag list = new ListTag(); - list.add(new CompoundTag()); - cookie.getOrCreateTag().put("Enchantments", list); - cookie.setHoverName(new TextComponent("Jr. Cookie")); - if (!player2.addItem(cookie)){ - player2.drop(cookie, true); - } - player2.sendMessage(new TextComponent("Have a Jr. Cookie. Please tell Fatass to clean his Inventory, or smack him with it."), player2.getUUID()); - } else if (player2.getUUID().equals(new UUID(0xd84f965487ea46a9L, 0x881fc6aa45dd5af8L))) { - player2.sendMessage(new TextComponent("I'm not trying to tell you what to do, but please don't hurt Bear."), player2.getUUID()); - } else if (player2.getUUID().equals(new UUID(0xf6728edb5a16449bL, 0xa8af8ae43bf79d63L))) { - player2.sendMessage(new TextComponent("Please moo at Bear989 to clean his inventory."), player2.getUUID()); - } else if (player2.getUUID().equals(new UUID(0xd8c0b6bd45504970L, 0xb7c00c4f8d8187c6L))) { - player2.sendMessage(new TextComponent("Could you tell Bear989Sr very gently, that his Inventory is a fucking mess again?"), player2.getUUID()); - } else if (player2.getUUID().equals(new UUID(0x91a59513e8ea45a4L, 0xb8afc275085b0451L))) { - player2.sendMessage(new TextComponent("Here is your special Message to make you tell Bear989Sr to clean his Inventory."), player2.getUUID()); - } else if (player2.getUUID().equals(new UUID(0x7c042366854c4582L, 0x8d2c6831646ba5c7L))) { - player2.sendMessage(new TextComponent("Let the mother fucker know he's full of shit."), player2.getUUID()); - } else { - if (player2.blockPosition().closerThan(player.blockPosition(), 100D)) { - player2.sendMessage(new TextComponent("There is this fella called Bear-Nine-Eight-Nine, needing be reminded of his Inventory being a major Pine."), player2.getUUID()); - } - } - } - } - } - } - } } diff --git a/fabric/src/main/java/trinsdar/gt4r/fabric/GT4ReimaginedFabric.java b/fabric/src/main/java/trinsdar/gt4r/fabric/GT4ReimaginedFabric.java index 8de8a1d4..2a41b388 100644 --- a/fabric/src/main/java/trinsdar/gt4r/fabric/GT4ReimaginedFabric.java +++ b/fabric/src/main/java/trinsdar/gt4r/fabric/GT4ReimaginedFabric.java @@ -19,7 +19,6 @@ public void onInitialize() { LoaderEvents.LOADER.register(AntimatterEvents::registerRecipeLoaders); CraftingEvents.CRAFTING.register(AntimatterEvents::registerCraftingLoaders); ProviderEvents.PROVIDERS.register(AntimatterEvents::onProviders); - PlayerTickEvents.END.register(player -> CommonEvents.onPlayerTick(player, AntimatterAPI.getSIDE().isServer())); UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> { CommonEvents.onRightlickBlock(player, hand, AntimatterAPI.getSIDE().isServer()); return InteractionResult.PASS; diff --git a/forge/src/main/java/trinsdar/gt4r/events/forge/ForgeEventBusEvents.java b/forge/src/main/java/trinsdar/gt4r/events/forge/ForgeEventBusEvents.java index 3730f641..085ed2e3 100644 --- a/forge/src/main/java/trinsdar/gt4r/events/forge/ForgeEventBusEvents.java +++ b/forge/src/main/java/trinsdar/gt4r/events/forge/ForgeEventBusEvents.java @@ -25,13 +25,6 @@ public static void onRightlickBlock(PlayerInteractEvent.RightClickBlock event){ CommonEvents.onRightlickBlock(player, hand, server); } - @SubscribeEvent - public static void onPlayerTick(TickEvent.PlayerTickEvent event){ - if (event.phase == TickEvent.Phase.END){ - CommonEvents.onPlayerTick(event.player, event.side.isServer()); - } - } - @SubscribeEvent public static void remapMissingBlocks(final RegistryEvent.MissingMappings event) { for (RegistryEvent.MissingMappings.Mapping map : event.getMappings(GT4RRef.ID)) {