Skip to content

Commit

Permalink
Fixed rotation feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Uraneptus committed Aug 7, 2024
1 parent da364cf commit f58cc8c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ repositories {

dependencies {
minecraft "net.minecraftforge:forge:${config.mc_version}-${config.forge_version}"

implementation fg.deobf("curse.maven:create-328085:4625535")
}

spotless {
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mapping_channel=parchment
forge_version=47.1.3
mod_id=morphtool
dir_repo=./
build_number=36
build_number=37
dir_output=../Build Output/Morphtool/
mapping_version=2023.09.03-1.20.1
version=1.7
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/vazkii/morphtool/MorphToolItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package vazkii.morphtool;

import net.minecraft.client.gui.screens.Screen;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
Expand All @@ -9,6 +10,9 @@
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockState;

import javax.annotation.Nullable;
import java.util.List;
Expand All @@ -21,11 +25,13 @@ public MorphToolItem() {

@Override
public InteractionResult useOn(UseOnContext context) {
/*TODO decide if this feature should be kept. The below code doesn't work since 1.19, no one has complained so far tho.
Level level = context.getLevel();
BlockPos pos = context.getClickedPos();
BlockState block = context.getLevel().getBlockState(context.getClickedPos());
block.rotate(context.getLevel(), context.getClickedPos(), Rotation.CLOCKWISE_90);
if (level.setBlock(pos, block.rotate(level, pos, Rotation.CLOCKWISE_90), Block.UPDATE_ALL)) {
return InteractionResult.sidedSuccess(level.isClientSide);
}

*/
return super.useOn(context);
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ modId="morphtool"
displayName="Morph-o-Tool"
version="${file.jarVersion}"
authors="Vazkii, MoreThanHidden, Uraneptus"
description='''
The wrench to end all wrenches.'''
description='''The wrench to end all wrenches.'''

[[dependencies.morphtool]]
modId="forge"
Expand Down

0 comments on commit f58cc8c

Please sign in to comment.