Skip to content

Commit

Permalink
Fixed vanilla type casting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
UselessBullets committed Mar 9, 2024
1 parent 4d89e91 commit 7758d21
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bta_version=7.1-pre1a
loader_version=0.14.19-babric.3-bta

# Mod
mod_version=3.4.13
mod_version=3.4.14
mod_group=turniplabs
mod_name=halplibe

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package turniplabs.halplibe.mixin.mixins;

import net.minecraft.core.entity.EntityDispatcher;
import net.minecraft.core.entity.EntityLiving;
import net.minecraft.core.net.packet.Packet24MobSpawn;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(value = Packet24MobSpawn.class, remap = false)
public class PacketMobSpawnMixin {
@Shadow public short type;

@Inject(method = "<init>(Lnet/minecraft/core/entity/EntityLiving;)V", at = @At("TAIL"))
private void fixTypeValue(EntityLiving entityliving, CallbackInfo ci){
this.type = (short) EntityDispatcher.getEntityID(entityliving);
}
}
3 changes: 2 additions & 1 deletion src/main/resources/halplibe.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"mixins.I18nMixin",
"mixins.ItemJarMixin",
"mixins.ItemStackJsonAdapterMixin",
"mixins.PacketMobSpawnMixin",
"mixins.RegistryMixin",
"mixins.TileEntityBlastFurnaceMixin",
"mixins.TileEntityFurnaceMixin",
Expand All @@ -38,9 +39,9 @@
"mixins.EntityClientPlayerMPMixin",
"mixins.GuiIngameMenuMixin",
"mixins.GuiRenderItemMixin",
"mixins.GuiTooltipMixin",
"mixins.MinecraftMixin",
"mixins.MobPageMixin",
"mixins.GuiTooltipMixin",
"mixins.PlayerRendererMixin",
"mixins.RenderEngineMixin",
"mixins.RenderGlobalMixin",
Expand Down

0 comments on commit 7758d21

Please sign in to comment.