Skip to content

Commit e1b7bd7

Browse files
authored
Fix for #9039 (#9293)
* rotate table entity facing * missing mirroring and lock to Y rotation
1 parent 5b29fd2 commit e1b7bd7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/java/com/simibubi/create/content/logistics/tableCloth/TableClothBlockEntity.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
import com.simibubi.create.AllPackets;
1111
import com.simibubi.create.AllSoundEvents;
1212
import com.simibubi.create.AllTags.AllBlockTags;
13+
import com.simibubi.create.api.contraption.transformable.TransformableBlockEntity;
1314
import com.simibubi.create.compat.computercraft.AbstractComputerBehaviour;
1415
import com.simibubi.create.compat.computercraft.ComputerCraftProxy;
16+
import com.simibubi.create.content.contraptions.StructureTransform;
1517
import com.simibubi.create.content.logistics.BigItemStack;
1618
import com.simibubi.create.content.logistics.packager.InventorySummary;
1719
import com.simibubi.create.content.logistics.redstoneRequester.AutoRequestData;
@@ -39,6 +41,7 @@
3941
import net.minecraft.world.entity.player.Player;
4042
import net.minecraft.world.item.ItemStack;
4143
import net.minecraft.world.level.block.Block;
44+
import net.minecraft.world.level.block.entity.BlockEntity;
4245
import net.minecraft.world.level.block.entity.BlockEntityType;
4346
import net.minecraft.world.level.block.state.BlockState;
4447
import net.minecraft.world.phys.AABB;
@@ -50,7 +53,7 @@
5053

5154
import org.jetbrains.annotations.NotNull;
5255

53-
public class TableClothBlockEntity extends SmartBlockEntity {
56+
public class TableClothBlockEntity extends SmartBlockEntity implements TransformableBlockEntity {
5457

5558
public AbstractComputerBehaviour computerBehaviour;
5659

@@ -347,4 +350,11 @@ public int getPaymentAmount() {
347350
.isEmpty() ? 1 : priceTag.count;
348351
}
349352

353+
public void transform(BlockEntity blockEntity, StructureTransform transform){
354+
facing = transform.mirrorFacing(facing);
355+
if (transform.rotationAxis == Direction.Axis.Y)
356+
facing = transform.rotateFacing(facing);
357+
notifyUpdate();
358+
}
359+
350360
}

0 commit comments

Comments
 (0)