Skip to content

Commit

Permalink
misc: 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Dec 4, 2024
1 parent c77b876 commit 93ad429
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
project_version=1.4.0.beta1
project_version=1.5.0.beta1

# FM Protocols
protocols_version=b15c1841
protocols_use_local_build=false
protocols_local_version=1.1.5

mc_version=1.21.3
minecraft_version=1.21.3-R0.1-SNAPSHOT
mc_version=1.21.4
minecraft_version=1.21.4-R0.1-SNAPSHOT

# Dependencies
protocollib_version=5.3.0
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/xyz/nifeather/morph/MorphPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void onEnable()
pluginManager = Bukkit.getPluginManager();
var bukkitVersion = Bukkit.getMinecraftVersion();

String primaryVersion = "1.21.3";
String primaryVersion = "1.21.4";
String[] compatVersions = new String[] { primaryVersion };
if (Arrays.stream(compatVersions).noneMatch(bukkitVersion::equals))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public List<Packet<?>> buildPlayerInfoPackets(SingleWatcher watcher)
spawnUUID, watcher.readEntryOrThrow(CustomEntries.PROFILE),
watcher.readEntryOrDefault(CustomEntries.PROFILE_LISTED, false),
114514, GameType.DEFAULT_MODE,
null, 0, null
null, true, 0, null
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ private ClientboundSoundPacket getClientboundSoundPacket(PacketEvent event, Pack
|| path.endsWith(".hurt_freeze")
|| path.endsWith(".hurt_sweet_berry_bush"))
{
var soundId = EntityTypeUtils.getDamageSound(watcher.getEntityType());
if (soundId == null) return null;
var soundId = EntityTypeUtils.getDamageSoundKey(watcher.getEntityType());

ResourceLocation rL = ResourceLocation.tryParse(soundId);
if (rL == null) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ public void onAdvancement(BlockBreakEvent event)
if (!(block.getBlockData() instanceof CreakingHeart creakingHeart))
return;

if (creakingHeart.getCreaking() != CreakingHeart.Creaking.ACTIVE)
if (!creakingHeart.isActive())
return;

morphs.grantMorphToPlayer(event.getPlayer(), EntityType.CREAKING.getKey().asString());
Expand All @@ -638,9 +638,6 @@ private void onPlayerKillEntity(Player player, Entity entity)
else
{
var type = entity.getType();
if (type == EntityType.CREAKING_TRANSIENT)
type = EntityType.CREAKING;

morphs.grantMorphToPlayer(player, type.getKey().asString());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void showFakePlayer(UUID disguiseUUID, GameProfile profile)
disguiseUUID, profile,
true,
114514, GameType.DEFAULT_MODE,
null, 0, null
null, true, 0, null
)
);

Expand Down Expand Up @@ -166,7 +166,7 @@ public void handle(Player player)
disguiseUUID, profile,
true,
114514, GameType.DEFAULT_MODE,
null, 0, null
null, true, 0, null
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public VanillaDisguiseProvider()

for (var eT : EntityType.values())
{
if (eT == EntityType.UNKNOWN || eT == EntityType.CREAKING_TRANSIENT || !eT.isAlive()) continue;
if (eT == EntityType.UNKNOWN || !eT.isAlive()) continue;

list.add(eT.getKey().getKey());
}
Expand Down Expand Up @@ -255,7 +255,7 @@ private void tryAddModifier(DisguiseState state)
var mobMaxHealth = craftLiving.craftAttributes.getAttribute(Attribute.MAX_HEALTH).getBaseValue();

// patch: CREAKING only have half heart, and we don't want that.
if (state.getEntityType() == EntityType.CREAKING || state.getEntityType() == EntityType.CREAKING_TRANSIENT)
if (state.getEntityType() == EntityType.CREAKING)
mobMaxHealth = 20;

var playerAttribute = player.getAttribute(Attribute.MAX_HEALTH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectSet;
import net.kyori.adventure.key.Key;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
Expand All @@ -12,12 +13,14 @@
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.player.Player;
import org.bukkit.Location;
import org.bukkit.Registry;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.Enemy;
import org.bukkit.entity.EntityType;
import org.checkerframework.checker.units.qual.K;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import xyz.nifeather.morph.MorphPlugin;
Expand Down Expand Up @@ -405,15 +408,15 @@ public static String getStepSound(EntityType type)
}

@Nullable
public static String getDamageSound(EntityType type)
public static String getDamageSoundKey(EntityType type)
{
if (type == EntityType.PLAYER) return null;

if (type == EntityType.ARMOR_STAND)
return Sound.ENTITY_ARMOR_STAND_HIT.key().asString();
return "entity.armor_stand.hit";

if (type == EntityType.TRADER_LLAMA)
return Sound.ENTITY_LLAMA_HURT.key().asString();
return "entity.llama.hurt";

return "entity.%s.hurt".formatted(type.getKey().getKey());
}
Expand Down

0 comments on commit 93ad429

Please sign in to comment.