Commit 0c61d35a by Jonathan Thomas

Ridable best friends now ignore Tameable entities (dogs, cats, etc... so you can…

Ridable best friends now ignore Tameable entities (dogs, cats, etc... so you can right-click and sit them)
parent f8a4d053
Pipeline #12718 passed with stages
in 2 minutes 20 seconds
......@@ -8,7 +8,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
### Added
- New LEAD behavior, to guide a player to a random location (and show message when destination is reached)
- Best friends are now rideable! Right click with an empty hand.
- Best friends are now rideable! Right click with an empty hand. Excludes tameable entities (dogs, cats, etc...)
- Villager trades are now affected by friendship! Be nice!
### Changed
......
......@@ -3,6 +3,7 @@ package com.owlmaddie.mixin;
import com.owlmaddie.chat.ChatDataManager;
import com.owlmaddie.network.ServerPackets;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
......@@ -27,8 +28,8 @@ public class MixinMobEntity {
ItemStack itemStack = player.getStackInHand(hand);
MobEntity thisEntity = (MobEntity) (Object) this;
// Don't interact with Villagers (avoid issues with trade system)
if (thisEntity instanceof VillagerEntity) {
// Don't interact with Villagers (avoid issues with trade UI) OR Tameable (i.e. sit / no-sit)
if (thisEntity instanceof VillagerEntity || thisEntity instanceof TameableEntity) {
return;
}
......@@ -75,12 +76,9 @@ public class MixinMobEntity {
ServerPackets.generate_chat("N/A", chatData, serverPlayer, thisEntity, giveItemMessage, true);
}
} else if (itemStack.isEmpty()) {
// Player's hand is empty
if (chatData.friendship == 3) {
// Ride your best friend!
player.startRiding(thisEntity, true);
}
} else if (itemStack.isEmpty() && chatData.friendship == 3) {
// Player's hand is empty, Ride your best friend!
player.startRiding(thisEntity, true);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment