detect wandering trader

This commit is contained in:
sebseb7
2023-12-26 04:44:31 +01:00
parent 3b8129427d
commit 140aae7f4a
2 changed files with 8 additions and 2 deletions

View File

@@ -32,7 +32,12 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
with: with:
files: build/libs/*.jar files: build/libs/*.jar
- name: Test - name: Modrinth Readme Sync
env: env:
MODRINTH_TOKEN: ${{ vars.MODRINTH_TOKEN }} MODRINTH_TOKEN: ${{ vars.MODRINTH_TOKEN }}
run: ./gradlew modrinthSyncBody run: ./gradlew modrinthSyncBody
- name: Modrinth Release
if: startsWith(github.ref, 'refs/tags/')
env:
MODRINTH_TOKEN: ${{ vars.MODRINTH_TOKEN }}
run: ./gradlew modrinth

View File

@@ -22,6 +22,7 @@ import net.minecraft.client.gui.screen.ingame.MerchantScreen;
import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen; import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.entity.passive.WanderingTraderEntity;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket; import net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket;
@@ -293,7 +294,7 @@ public class KeybindCallbacks implements IHotkeyCallback, IClientTickHandler {
Vector<Entity> newVillagersInRange = new Vector<Entity>(villagersInRange); Vector<Entity> newVillagersInRange = new Vector<Entity>(villagersInRange);
for (Entity entity : mc.player.clientWorld.getEntities()) { for (Entity entity : mc.player.clientWorld.getEntities()) {
if (entity instanceof VillagerEntity) { if (entity instanceof VillagerEntity || entity instanceof WanderingTraderEntity) {
if (entity.getPos().distanceTo(mc.player.getPos()) < 2.5f) { if (entity.getPos().distanceTo(mc.player.getPos()) < 2.5f) {
if (found == false) { if (found == false) {
if (newVillagersInRange.contains(entity) == false) { if (newVillagersInRange.contains(entity) == false) {