Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
cakeGit committed Aug 13, 2024
1 parent 536bd82 commit 322772a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
1.20.1-1.1.9: |
- Reduced visual clutter on schematic clone highlights [Example of new system](https://media.discordapp.net/attachments/1267781614591676426/1272539875136114820/2024-08-12_13.56.54.png?ex=66bb589c&is=66ba071c&hm=7870a62f2b19ea94babd9fd1c250ee8eaecfb8827f0b1c4dfaa08f7d3080d299&=&format=webp&quality=lossless&width=1168&height=614)
- This also should help to improve performance
1.20.1-1.1.10: |
- Fixed signal placement bug
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.cak.pattern_schematics.mixin;

import com.simibubi.create.content.trains.track.TrackTargetingBehaviour;
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
import com.simibubi.create.foundation.utility.BlockHelper;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
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.CallbackInfoReturnable;

@Mixin(BlockHelper.class)
public class BlockHelperMixin {

/**Fix to issue, thanks to @zetttabyte on Discord*/
@Inject(method = "prepareBlockEntityData", at = @At(value = "RETURN"), remap = false, cancellable = true)
private static void trainTargeting_prepareBlockEntityData(BlockState blockState, BlockEntity blockEntity, CallbackInfoReturnable<CompoundTag> cir) {
if (blockEntity instanceof SmartBlockEntity smartBlockEntity) {
if (smartBlockEntity.getBehaviour(TrackTargetingBehaviour.TYPE) != null) {
CompoundTag tag = cir.getReturnValue();
tag.remove("Id");
cir.setReturnValue(tag);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
],
"mixins": [
"AbstractContraptionEntityMixin",
"BlockHelperMixin",
"CreateClientMixin",
"DeployBaseMixin",
"DeployerMovementBehaviorMixin",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.jvmargs = -Xmx2G

# Mod Info
archives_base_name = pattern_schematics
mod_version = 1.1.9
mod_version = 1.1.10
maven_group = com.cak.pattern_schematics

minecraft_version = 1.20.1
Expand Down

0 comments on commit 322772a

Please sign in to comment.