Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ changelog.txt

loader-neoforge/.cache
loader-neoforge/config

# ClientDevBridge session state (golden images are intentionally kept)
.clientdevbridge/*
!.clientdevbridge/golden/
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ plugins {
id 'com.diffplug.spotless' version '7.2.1' apply false
id 'com.modrinth.minotaur' version '2.+' apply false

id 'net.fabricmc.fabric-loom' version '1.17-SNAPSHOT' apply false
id 'net.neoforged.moddev' version '2.0.141' apply false
id 'net.fabricmc.fabric-loom' version '1.18.2' apply false
id 'net.neoforged.moddev' version '2.0.147' apply false
id 'net.minecraftforge.accesstransformers' version '5.0.3' apply false
id 'net.minecraftforge.gradle' version '[7.0.21,8.0)' apply false
}
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ group=org.cyclops.flopper
java_version=25

# Common
minecraft_version=26.2
minecraft_version=26.3
mod_name=Flopper
mod_author=rubensworks (aka kroeser)
mod_id=flopper
Expand All @@ -14,23 +14,23 @@ issue_tracker_url=https://github.com/CyclopsMC/Flopper/issues
display_url=https://www.curseforge.com/minecraft/mc-mods/flopper
description=The Flopper is an early-game block to move around fluids, just like the Hopper does for items.
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44
neo_form_version=26.2-1
neo_form_version=26.3-1
curseforge_project_id=290404
modrinth_project_id=aTMAqQMY

# Fabric
fabric_version=0.152.2+26.2
fabric_loader_version=0.19.3
fabric_version=0.161.0+26.3
fabric_loader_version=0.19.5
# Dependencies
fabric_forgeconfigapiport_version=26.2.0
fabric_forgeconfigapiport_version=26.3.0

# NeoForge
neoforge_version=26.2.0.6-beta
neoforge_version=26.3.0.7-beta
neoforge_loader_version_range=[4,)
neoforge_update_json_url=https://raw.githubusercontent.com/CyclopsMC/Versions/master/neoforge_update/flopper.json

# Forge
forge_version=65.0.0
forge_version=66.0.2
forge_loader_version_range=[2,)
forge_update_json_url=https://raw.githubusercontent.com/CyclopsMC/Versions/master/forge_update/flopper.json

Expand All @@ -42,4 +42,4 @@ org.gradle.configuration-cache=true
org.gradle.configureondemand=true

# Common dependencies
cyclopscore_version=1.30.0-1038
cyclopscore_version=1.30.0-1159
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cyclops.flopper.block;

import com.mojang.serialization.MapCodec;
import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant;
Expand All @@ -14,32 +13,22 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity;
import org.cyclops.cyclopscore.helper.IFluidHelpersFabric;
import org.cyclops.flopper.FlopperFabric;
import org.cyclops.flopper.blockentity.BlockEntityFlopperFabric;

import java.util.function.BiFunction;

/**
* @author rubensworks
*/
public class BlockFlopperFabric extends BlockFlopper {
public static final MapCodec<BlockFlopper> CODEC = BlockBehaviour.simpleCodec(properties -> new BlockFlopperFabric(properties, BlockEntityFlopperFabric::new));

public BlockFlopperFabric(Properties properties, BiFunction<BlockPos, BlockState, ? extends CyclopsBlockEntity> blockEntitySupplier) {
super(properties, blockEntitySupplier);
}

@Override
protected MapCodec<? extends BaseEntityBlock> codec() {
return CODEC;
}

@Override
protected InteractionResult useWithoutItem(BlockState blockState, Level level, BlockPos pos, Player player, BlockHitResult rayTraceResult) {
InteractionResult activatedSuper = super.useWithoutItem(blockState, level, pos, player, rayTraceResult);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected boolean pushFluidsToWorld() {
BlockPos targetPos = getBlockPos().relative(getFacing());
BlockState destBlockState = level.getBlockState(targetPos);
final boolean isDestNonSolid = !destBlockState.isSolid();
final boolean isDestReplaceable = destBlockState.getPistonPushReaction() == PushReaction.DESTROY;
final boolean isDestReplaceable = destBlockState.getPistonPushReaction() == PushReaction.POPPED;
if (level.isEmptyBlock(targetPos)
|| (isDestNonSolid && isDestReplaceable && !destBlockState.liquid())) {
return getFluidBlockHandler(level, targetPos, tank.variant)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cyclops.flopper.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvent;
Expand All @@ -11,8 +10,6 @@
import net.minecraft.world.item.BucketItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.common.SoundActions;
Expand All @@ -29,7 +26,6 @@
import net.minecraftforge.items.ItemHandlerHelper;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity;
import org.cyclops.flopper.FlopperForge;
import org.cyclops.flopper.blockentity.BlockEntityFlopperForge;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
Expand All @@ -40,18 +36,11 @@
* @author rubensworks
*/
public class BlockFlopperForge extends BlockFlopper {
public static final MapCodec<BlockFlopper> CODEC = BlockBehaviour.simpleCodec(properties -> new BlockFlopperForge(properties, BlockEntityFlopperForge::new));

public BlockFlopperForge(Properties properties, BiFunction<BlockPos, BlockState, ? extends CyclopsBlockEntity> blockEntitySupplier) {
super(properties, blockEntitySupplier);
PlayerInteractEvent.RightClickBlock.BUS.addListener(this::onRightClick);
}

@Override
protected MapCodec<? extends BaseEntityBlock> codec() {
return CODEC;
}

@Override
protected InteractionResult useWithoutItem(BlockState blockState, Level level, BlockPos pos, Player player, BlockHitResult rayTraceResult) {
InteractionResult activatedSuper = super.useWithoutItem(blockState, level, pos, player, rayTraceResult);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected boolean pushFluidsToWorld() {
BlockPos targetPos = getBlockPos().relative(getFacing());
BlockState destBlockState = level.getBlockState(targetPos);
final boolean isDestNonSolid = !destBlockState.isSolid();
final boolean isDestReplaceable = destBlockState.getPistonPushReaction() == PushReaction.DESTROY;
final boolean isDestReplaceable = destBlockState.getPistonPushReaction() == PushReaction.POPPED;
if (level.isEmptyBlock(targetPos)
|| (isDestNonSolid && isDestReplaceable && !destBlockState.liquid())) {
FluidStack fluidStack = tank.getFluid();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cyclops.flopper.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvent;
Expand All @@ -11,8 +10,6 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.neoforged.bus.api.SubscribeEvent;
Expand All @@ -28,26 +25,18 @@
import net.neoforged.neoforge.transfer.resource.ResourceStack;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity;
import org.cyclops.flopper.FlopperNeoForge;
import org.cyclops.flopper.blockentity.BlockEntityFlopperNeoForge;

import java.util.function.BiFunction;

/**
* @author rubensworks
*/
public class BlockFlopperNeoForge extends BlockFlopper {
public static final MapCodec<BlockFlopper> CODEC = BlockBehaviour.simpleCodec(properties -> new BlockFlopperNeoForge(properties, BlockEntityFlopperNeoForge::new));

public BlockFlopperNeoForge(Properties properties, BiFunction<BlockPos, BlockState, ? extends CyclopsBlockEntity> blockEntitySupplier) {
super(properties, blockEntitySupplier);
NeoForge.EVENT_BUS.register(this);
}

@Override
protected MapCodec<? extends BaseEntityBlock> codec() {
return CODEC;
}

@Override
protected InteractionResult useWithoutItem(BlockState blockState, Level level, BlockPos pos, Player player, BlockHitResult rayTraceResult) {
InteractionResult activatedSuper = super.useWithoutItem(blockState, level, pos, player, rayTraceResult);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected boolean pushFluidsToWorld() {
BlockPos targetPos = getBlockPos().relative(getFacing());
BlockState destBlockState = level.getBlockState(targetPos);
final boolean isDestNonSolid = !destBlockState.isSolid();
final boolean isDestReplaceable = destBlockState.getPistonPushReaction() == PushReaction.DESTROY;
final boolean isDestReplaceable = destBlockState.getPistonPushReaction() == PushReaction.POPPED;
if (level.isEmptyBlock(targetPos)
|| (isDestNonSolid && isDestReplaceable && !destBlockState.liquid())) {
FluidStack fluidStack = tank.getFluid();
Expand Down
Loading