Skip to content

Commit

Permalink
moved bear ticker to gt core
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Dec 13, 2023
1 parent 00446e6 commit 06d641c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 83 deletions.
75 changes: 0 additions & 75 deletions common/src/main/java/trinsdar/gt4r/events/CommonEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block> event) {
for (RegistryEvent.MissingMappings.Mapping<Block> map : event.getMappings(GT4RRef.ID)) {
Expand Down

0 comments on commit 06d641c

Please sign in to comment.