Skip to content

Commit

Permalink
Fixed Neptunium Hoe compatibility issues with Ensorcellation. Closes #…
Browse files Browse the repository at this point in the history
…229

Updated to new FG
  • Loading branch information
GirafiStudios committed Apr 24, 2021
1 parent 41aaea3 commit 7c31177
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
Expand Down Expand Up @@ -67,8 +67,8 @@ minecraft {

dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly fg.deobf("mezz.jei:jei-1.16.4:${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.16.4:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")
compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-${minecraft_version}:${ct_version}")
}

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
minecraft_version=1.16.5
forge_version=36.0.43
forge_version=36.1.12
mappings=20201028-1.16.3
mod_version=2.1.16
jei_version=7.6.1.65
ct_version=7.1.0.121
jei_version=7.6.4.87
ct_version=7.1.0.235

org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public ActionResultType onBlockActivated(@Nonnull BlockState state, World world,
INamedContainerProvider container = this.getContainer(state, world, pos);
if (container != null && player instanceof ServerPlayerEntity) {
ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player;
if (player.isCrouching()) {
if (player.isSneaking()) {
TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity != null) {
StackHelper.giveItem(serverPlayer, StackHelper.storeTEInStack(new ItemStack(this), tileEntity));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ public ActionResultType onItemUse(ItemUseContext useContext) {
BlockPos pos = useContext.getPos();
int hook = ForgeEventFactory.onHoeUse(useContext);
if (hook != 0) {
return hook > 0 ? ActionResultType.SUCCESS : ActionResultType.FAIL;
if (hook >= 0) {
return ActionResultType.FAIL;
}
BlockState state = world.getBlockState(pos);
if (state != null) {
if (state == Blocks.FARMLAND.getDefaultState()) {
world.setBlockState(pos, AquaBlocks.FARMLAND.getDefaultState(), 11);
}
}
return ActionResultType.SUCCESS;
} else {
if (useContext.getFace() != Direction.DOWN && world.isAirBlock(pos.up())) {
BlockState state = HOE_LOOKUP.get(world.getBlockState(pos).getBlock());
Expand All @@ -41,7 +50,7 @@ public ActionResultType onItemUse(ItemUseContext useContext) {
world.playSound(player, pos, SoundEvents.ITEM_HOE_TILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
if (!world.isRemote) {
if (state == Blocks.FARMLAND.getDefaultState()) {
world.setBlockState(pos, AquaBlocks.FARMLAND.getDefaultState(), 11); //Inserted. Rest copied from HoeItem
world.setBlockState(pos, AquaBlocks.FARMLAND.getDefaultState(), 11);
} else {
world.setBlockState(pos, state, 11);
}
Expand Down

0 comments on commit 7c31177

Please sign in to comment.