Skip to content

Commit

Permalink
Update to MC 1.12.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Dec 26, 2024
1 parent 45a5a03 commit 61615a6
Show file tree
Hide file tree
Showing 30 changed files with 102 additions and 137 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ plugins {
id 'com.diffplug.spotless' version '6.25.0' apply false
id 'com.modrinth.minotaur' version '2.+' apply false

id 'fabric-loom' version '1.7-SNAPSHOT' apply false
id 'net.neoforged.moddev' version '0.1.110' apply false
id 'net.neoforged.gradle.userdev' version '7.0.145' apply false
id 'fabric-loom' version '1.9-SNAPSHOT' apply false
id 'net.neoforged.moddev' version '2.0.61-beta' apply false
id 'net.neoforged.gradle.userdev' version '7.0.171' apply false
// id 'net.minecraftforge.gradle' version '[6.0.24,6.2)' apply false // Don't load yet to fix DiffPatch conflict issue between FG and NG
}

1 change: 1 addition & 0 deletions buildSrc/src/main/groovy/multiloader-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ java {
withSourcesJar()
withJavadocJar()
}
compileJava.options.compilerArgs << "-Xmaxerrs" << "9999"

repositories {
mavenLocal()
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/multiloader-loader-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ neoForge {
// Automatically enable AccessTransformers if the file exists
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
if (at.exists()) {
accessTransformers.add(at.absolutePath)
accessTransformers.from(at.absolutePath)
}
parchment {
minecraftVersion = parchment_minecraft_version
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/groovy/multiloader-loader-neoforge.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ runs {

server {
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
programArgument '--nogui'
argument '--nogui'
}

gameTestServer {
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
}

data {
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
clientData {
arguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}

Expand Down
20 changes: 10 additions & 10 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=21

# Common
minecraft_version=1.21.1
minecraft_version=1.21.4
mod_name=Flopper
mod_author=rubensworks (aka kroeser)
mod_id=flopper
Expand All @@ -14,25 +14,25 @@ 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=1.21-20240613.152323
parchment_version=2024.06.23
parchment_minecraft_version=1.21
neo_form_version=1.21.4-20241203.161809
parchment_version=2024.12.07
parchment_minecraft_version=1.21.4
curseforge_project_id=290404
modrinth_project_id=aTMAqQMY

# Fabric
fabric_version=0.102.1+1.21.1
fabric_loader_version=0.15.11
fabric_version=0.112.2+1.21.4
fabric_loader_version=0.16.9
# Dependencies
fabric_forgeconfigapiport_version=21.1.0
fabric_forgeconfigapiport_version=21.4.1

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

# Forge
forge_version=52.0.24
forge_version=54.0.7
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.daemon=false
org.gradle.caching=true

# Common dependencies
cyclopscore_version=1.25.2-634
cyclopscore_version=1.25.5-689
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-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
Expand All @@ -18,14 +14,15 @@
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.level.redstone.Orientation;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.cyclops.cyclopscore.block.BlockWithEntityCommon;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntityCommon;
import org.cyclops.cyclopscore.block.BlockWithEntity;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity;
import org.cyclops.cyclopscore.helper.IModHelpers;
import org.cyclops.flopper.RegistryEntries;
import org.cyclops.flopper.blockentity.BlockEntityFlopper;
Expand All @@ -37,9 +34,9 @@
* Fluid hopper block.
* @author rubensworks
*/
public abstract class BlockFlopper extends BlockWithEntityCommon {
public abstract class BlockFlopper extends BlockWithEntity {

public static final DirectionProperty FACING = BlockStateProperties.FACING_HOPPER;
public static final EnumProperty<Direction> FACING = BlockStateProperties.FACING_HOPPER;
public static final BooleanProperty ENABLED = BlockStateProperties.ENABLED;

// Copied from HopperBlock, to avoid conflicts with other mods messing with the hopper
Expand All @@ -59,7 +56,7 @@ public abstract class BlockFlopper extends BlockWithEntityCommon {
private static final VoxelShape SOUTH_INTERACTION_SHAPE = Shapes.or(INSIDE, Block.box(6.0, 8.0, 12.0, 10.0, 10.0, 16.0));
private static final VoxelShape WEST_INTERACTION_SHAPE = Shapes.or(INSIDE, Block.box(0.0, 8.0, 6.0, 4.0, 10.0, 10.0));

public BlockFlopper(BlockBehaviour.Properties properties, BiFunction<BlockPos, BlockState, ? extends CyclopsBlockEntityCommon> blockEntitySupplier) {
public BlockFlopper(BlockBehaviour.Properties properties, BiFunction<BlockPos, BlockState, ? extends CyclopsBlockEntity> blockEntitySupplier) {
super(properties, blockEntitySupplier);
this.registerDefaultState(this.stateDefinition.any()
.setValue(FACING, Direction.DOWN)
Expand Down Expand Up @@ -135,8 +132,8 @@ public void onPlace(BlockState state, Level worldIn, BlockPos pos, BlockState ol
}

@Override
public void neighborChanged(BlockState state, Level worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) {
super.neighborChanged(state, worldIn, pos, blockIn, fromPos, isMoving);
public void neighborChanged(BlockState state, Level worldIn, BlockPos pos, Block neighbourBlock, @Nullable Orientation orientation, boolean isMoving) {
super.neighborChanged(state, worldIn, pos, neighbourBlock, orientation, isMoving);
this.updateState(worldIn, pos, state);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package org.cyclops.flopper.block;

import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import org.cyclops.cyclopscore.config.ConfigurablePropertyCommon;
import org.cyclops.cyclopscore.config.ModConfigLocation;
import org.cyclops.cyclopscore.config.extendedconfig.BlockConfigCommon;
import org.cyclops.cyclopscore.init.IModBase;

import java.util.function.Function;
import java.util.function.BiFunction;

/**
* Config for the {@link BlockFlopper}.
Expand Down Expand Up @@ -48,7 +49,7 @@ public class BlockFlopperConfig<M extends IModBase> extends BlockConfigCommon<M>
@ConfigurablePropertyCommon(category = "machine", comment = "If a status message with the flopper contents should be shown to the player on right click without an item.", isCommandable = true)
public static boolean showContentsStatusMessageOnClick = true;

public BlockFlopperConfig(M mod, Function<BlockConfigCommon<M>, ? extends Block> blockConstructor) {
public BlockFlopperConfig(M mod, BiFunction<BlockConfigCommon<M>, BlockBehaviour.Properties, ? extends Block> blockConstructor) {
super(
mod,
"flopper",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import org.cyclops.cyclopscore.blockentity.BlockEntityTickerDelayed;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntityCommon;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity;
import org.cyclops.cyclopscore.helper.IModHelpers;
import org.cyclops.cyclopscore.persist.nbt.NBTPersist;
import org.cyclops.flopper.RegistryEntries;
Expand All @@ -16,7 +16,7 @@
* Fluid hopper tile.
* @author rubensworks
*/
public abstract class BlockEntityFlopper extends CyclopsBlockEntityCommon {
public abstract class BlockEntityFlopper extends CyclopsBlockEntity {

@NBTPersist
private int transferCooldown = -1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "flopper:item/flopper"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
" I "
],
"key": {
"I": {
"tag": "c:ingots/iron"
},
"B": {
"item": "minecraft:bucket"
}
"I": "#c:ingots/iron",
"B": "minecraft:bucket"
},
"result": {
"count": 1,
"id": "flopper:flopper"
}
}
5 changes: 5 additions & 0 deletions loader-common/src/main/resources/flopper.accesswidener
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
accessWidener v1 named

# BlockEntityType
accessible class net/minecraft/world/level/block/entity/BlockEntityType
accessible method net/minecraft/world/level/block/entity/BlockEntityType <init> (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V
accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier

# ArgumentTypeInfos
accessible field net/minecraft/world/level/block/LiquidBlock fluid Lnet/minecraft/world/level/material/FlowingFluid;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.cyclops.flopper.block;

import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.MapColor;
import org.cyclops.cyclopscore.config.ConfigurablePropertyCommon;
Expand Down Expand Up @@ -29,7 +28,7 @@ public class BlockFlopperConfigFabric extends BlockFlopperConfig<ModBaseFabric<?
public BlockFlopperConfigFabric() {
super(
FlopperFabric._instance,
eConfig -> new BlockFlopperFabric(Block.Properties.of()
(eConfig, properties) -> new BlockFlopperFabric(properties
.mapColor(MapColor.STONE)
.strength(3.0F, 4.8F)
.sound(SoundType.METAL), BlockEntityFlopperFabric::new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.ItemInteractionResult;
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.CyclopsBlockEntityCommon;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity;
import org.cyclops.cyclopscore.helper.IFluidHelpersFabric;
import org.cyclops.flopper.FlopperFabric;
import org.cyclops.flopper.blockentity.BlockEntityFlopperFabric;
Expand All @@ -32,7 +31,7 @@
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 CyclopsBlockEntityCommon> blockEntitySupplier) {
public BlockFlopperFabric(Properties properties, BiFunction<BlockPos, BlockState, ? extends CyclopsBlockEntity> blockEntitySupplier) {
super(properties, blockEntitySupplier);
}

Expand Down Expand Up @@ -68,8 +67,8 @@ protected InteractionResult useWithoutItem(BlockState blockState, Level level, B
}

@Override
protected ItemInteractionResult useItemOn(ItemStack itemStack, BlockState blockState, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult rayTraceResult) {
ItemInteractionResult activatedSuper = super.useItemOn(itemStack, blockState, level, pos, player, hand, rayTraceResult);
protected InteractionResult useItemOn(ItemStack itemStack, BlockState blockState, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult rayTraceResult) {
InteractionResult activatedSuper = super.useItemOn(itemStack, blockState, level, pos, player, hand, rayTraceResult);
if (activatedSuper.consumesAction()) {
return activatedSuper;
}
Expand All @@ -84,15 +83,15 @@ protected ItemInteractionResult useItemOn(ItemStack itemStack, BlockState blockS
&& (movedSimulate = fh.moveFluid(storageItem, storageFlopper, fh.getBucketVolume(), player, true)) > 0) {
// Move fluid from the item into the tank if not sneaking
fh.moveFluid(storageItem, storageFlopper, movedSimulate, player, false);
return ItemInteractionResult.SUCCESS;
return InteractionResult.SUCCESS;
} else if (player.isCrouching()
&& (movedSimulate = fh.moveFluid(storageFlopper, storageItem, fh.getBucketVolume(), player, true)) > 0) {
// Move fluid from the tank into the item if sneaking
fh.moveFluid(storageFlopper, storageItem, movedSimulate, player, false);
return ItemInteractionResult.SUCCESS;
return InteractionResult.SUCCESS;
}
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
return InteractionResult.PASS;
}
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
return InteractionResult.PASS;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public BlockEntityFlopperConfigFabric() {
super(
FlopperFabric._instance,
(eConfig) -> new BlockEntityType<>(BlockEntityFlopperFabric::new,
Sets.newHashSet(RegistryEntries.BLOCK_FLOPPER.value()), null)
Sets.newHashSet(RegistryEntries.BLOCK_FLOPPER.value()))
);
}

@Override
public void onForgeRegistered() {
super.onForgeRegistered();
public void onRegistryRegistered() {
super.onRegistryRegistered();

// Fluid capability
FluidStorage.SIDED.registerForBlockEntity((blockEntity, direction) -> blockEntity.getTank(), getInstance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected boolean pushFluidsToWorld() {
}
}
if (BlockFlopperConfig.worldPullPushNeighbourEvents) {
level.neighborChanged(worldPosition, Blocks.AIR, worldPosition);
level.neighborChanged(worldPosition, Blocks.AIR, null);
}
return true;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ protected boolean pullFluidsFromWorld() {
}
}
if (BlockFlopperConfig.worldPullPushNeighbourEvents) {
level.neighborChanged(worldPosition, Blocks.AIR, worldPosition);
level.neighborChanged(worldPosition, Blocks.AIR, null);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.cyclops.cyclopscore.config.ConfigHandlerCommon;
import org.cyclops.cyclopscore.init.ModBaseForge;
import org.cyclops.cyclopscore.proxy.CommonProxyForge;
Expand All @@ -25,8 +26,8 @@ public class FlopperForge extends ModBaseForge<FlopperForge> {
*/
public static FlopperForge _instance;

public FlopperForge() {
super(Reference.MOD_ID, (instance) -> _instance = instance);
public FlopperForge(FMLJavaModLoadingContext context) {
super(Reference.MOD_ID, (instance) -> _instance = instance, context);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cyclops.flopper.block;

import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.MapColor;
import org.cyclops.cyclopscore.init.ModBaseForge;
Expand All @@ -17,7 +16,7 @@ public class BlockFlopperConfigForge extends BlockFlopperConfig<ModBaseForge<?>>
public BlockFlopperConfigForge() {
super(
FlopperForge._instance,
eConfig -> new BlockFlopperForge(Block.Properties.of()
(eConfig, properties) -> new BlockFlopperForge(properties
.mapColor(MapColor.STONE)
.strength(3.0F, 4.8F)
.sound(SoundType.METAL), BlockEntityFlopperForge::new)
Expand Down
Loading

0 comments on commit 61615a6

Please sign in to comment.