-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Hendrix-Shen/master
rule `shulkerTeleportFix`
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/carpetfixes/mixins/entityFixes/ShulkerEntity_CustomDataMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package carpetfixes.mixins.entityFixes; | ||
|
||
import carpetfixes.CarpetFixesSettings; | ||
import net.minecraft.entity.mob.ShulkerEntity; | ||
import net.minecraft.nbt.CompoundTag; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ShulkerEntity.class) | ||
public class ShulkerEntity_CustomDataMixin { | ||
@Inject( | ||
method = "writeCustomDataToTag", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/entity/mob/ShulkerEntity;getAttachedBlock()Lnet/minecraft/util/math/BlockPos;" | ||
), | ||
cancellable = true | ||
) | ||
private void onWriteCustomDataToTag(CompoundTag tag, CallbackInfo ci) { | ||
if (CarpetFixesSettings.shulkerTeleportFix) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters