Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ maven_group = org.thinkingstudio
archives_base_name = ForgematicaPrinter

# Dependencies (mafglib / forgematica)
mafglib_version = 0.1.13-mc1.20.1
forgematica_version = 0.1.12-mc1.20.1
mafglib_version = 0.1.14-mc1.18.2
forgematica_version = 0.1.11-mc1.18.2

# Minecraft, NeoForge and mappings versions
minecraft_version = 1.20.1
mappings_version = 1.20.1+build.10
minecraft_version = 1.18.2
mappings_version = 1.18.2+build.4

forge_version = 1.20.1-47.3.5
forge_version = 1.18.2-40.3.0

curseforge_id=1223456
modrinth_id=oqw1j8E7
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private Optional<Direction> getValidSide(SchematicBlockState state) {
}

if (canBeClicked(neighborState.world, neighborState.blockPos) && // Handle unclickable grass for example
!neighborState.currentState.isReplaceable())
!neighborState.currentState.getMaterial().isReplaceable())
validSides.add(side);
}
}
Expand All @@ -79,7 +79,7 @@ private Optional<Direction> getValidSide(SchematicBlockState state) {
}
}

return validSides.isEmpty() ? Optional.empty() : Optional.of(validSides.getFirst());
return validSides.isEmpty() ? Optional.empty() : Optional.of(validSides.get(0));
}

protected boolean getUseShift(SchematicBlockState state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public PrinterPlacementContext getPlacementContext(ClientPlayerEntity player) {
boolean requiresShift = getRequiresExplicitShift() || isInteractive(neighborState.getBlock());

if (!canBeClicked(state.world, neighborPos) || // Handle unclickable grass for example
neighborState.isReplaceable())
neighborState.getMaterial().isReplaceable())
continue;

Vec3d hitVec = Vec3d.ofCenter(state.blockPos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private boolean canPlaceInWater(BlockState blockState) {
// return true;
// }
// TODO --> if this ever gets removed
return blockState.blocksMovement();
return blockState.getMaterial().blocksMovement();
}

return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package me.aleksilassila.litematica.printer.implementation;

import me.aleksilassila.litematica.printer.BlockHelper;
import net.minecraft.block.ButtonBlock;
import net.minecraft.block.AbstractButtonBlock;

public class BlockHelperImpl extends BlockHelper {
static {
interactiveBlocks.add(ButtonBlock.class);
interactiveBlocks.add(AbstractButtonBlock.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public Direction getVerticalPlayerLookDirection()
}

@Override
public Direction getHorizontalPlayerFacing()
public Direction getPlayerFacing()
{
if (lookDirection == null || !lookDirection.getAxis().isHorizontal())
{
return super.getHorizontalPlayerFacing();
return super.getPlayerFacing();
}

return lookDirection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public InteractActionImpl(PrinterPlacementContext context) {
@Override
protected void interact(MinecraftClient client, ClientPlayerEntity player, Hand hand, BlockHitResult hitResult) {
if (client.interactionManager != null) {
client.interactionManager.interactBlock(player, hand, hitResult);
client.interactionManager.interactItem(player, hand);
client.interactionManager.interactBlock(player, player.clientWorld, hand, hitResult);
client.interactionManager.interactItem(player, player.clientWorld, hand);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ public void tick(CallbackInfo ci) {
}

@Inject(method = "openEditSignScreen", at = @At("HEAD"), cancellable = true)
public void openEditSignScreen(SignBlockEntity sign, boolean front, CallbackInfo ci) {
getTargetSignEntity(sign).ifPresent(signBlockEntity ->
{
UpdateSignC2SPacket packet = new UpdateSignC2SPacket(sign.getPos(),
front,
signBlockEntity.getText(front).getMessage(0, false).getString(),
signBlockEntity.getText(front).getMessage(1, false).getString(),
signBlockEntity.getText(front).getMessage(2, false).getString(),
signBlockEntity.getText(front).getMessage(3, false).getString());
this.networkHandler.sendPacket(packet);
ci.cancel();
});
public void openEditSignScreen(SignBlockEntity sign, CallbackInfo ci) {
getTargetSignEntity(sign).ifPresent(signBlockEntity -> {
UpdateSignC2SPacket packet = new UpdateSignC2SPacket(
sign.getPos(),
signBlockEntity.getTextOnRow(0, false).getString(),
signBlockEntity.getTextOnRow(1, false).getString(),
signBlockEntity.getTextOnRow(2, false).getString(),
signBlockEntity.getTextOnRow(3, false).getString()
);
this.networkHandler.sendPacket(packet);
ci.cancel();
});
}

@Unique
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader = "javafml"
loaderVersion = "[46,)"
loaderVersion = "[40,)"
license = "AGPLv3"

[[mods]]
Expand All @@ -17,14 +17,14 @@ LitematicaPrinter unofficial (Neo)Forge port.
[[dependencies.forgematica_printer]]
modId = "forge"
mandatory = true
versionRange = "[46,)"
versionRange = "[40,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.forgematica_printer]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20,)"
versionRange = "[1.18.2,)"
ordering = "NONE"
side = "BOTH"

Expand All @@ -40,4 +40,4 @@ modId = "forgematica"
mandatory = true
versionRange = "[*,)"
ordering = "NONE"
side = "BOTH"
side = "BOTH"