Skip to content

Commit

Permalink
Update to MC 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 17, 2023
1 parent 07d35c9 commit 2612f3c
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 41 deletions.
14 changes: 2 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
// For those who want the bleeding edge
buildscript {
repositories {
mavenCentral()
maven { url = 'https://maven.minecraftforge.net' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}

plugins {
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.diffplug.spotless' version '5.14.3'
id 'com.modrinth.minotaur' version '2.+'
Expand Down Expand Up @@ -170,7 +160,7 @@ build.dependsOn signJar

task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
archiveClassifier.set('deobf')
manifest {
attributes([
"Specification-Title": "${project.name}",
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod_version=1.1.4
minecraft_version=1.19.4
forge_version=45.0.50
cyclopscore_version=1.18.2-309
minecraft_version=1.20.1
forge_version=47.0.1
cyclopscore_version=1.18.4-340
release_type=release
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44

Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 13 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
10 changes: 5 additions & 5 deletions src/main/java/org/cyclops/flopper/block/BlockFlopper.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.SoundActions;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fluids.FluidActionResult;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.common.SoundActions;
import org.cyclops.cyclopscore.block.BlockWithEntity;
import org.cyclops.cyclopscore.blockentity.CyclopsBlockEntity;
import org.cyclops.cyclopscore.helper.BlockEntityHelpers;
Expand Down Expand Up @@ -193,7 +193,7 @@ public InteractionResult use(BlockState blockState, Level world, BlockPos blockP
if (activatedSuper.consumesAction()) {
return activatedSuper;
}
return BlockEntityHelpers.getCapability(world, blockPos, CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
return BlockEntityHelpers.getCapability(world, blockPos, ForgeCapabilities.FLUID_HANDLER)
.map(fluidHandler -> {
ItemStack itemStack = player.getItemInHand(hand);
if (itemStack.isEmpty()) {
Expand Down Expand Up @@ -256,7 +256,7 @@ public static FluidActionResult tryEmptyContainer(@Nonnull ItemStack container,
if (doDrain && player != null)
{
SoundEvent soundevent = transfer.getFluid().getFluidType().getSound(SoundActions.BUCKET_EMPTY);
player.level.playSound(null, player.getX(), player.getY() + 0.5, player.getZ(), soundevent, SoundSource.BLOCKS, 1.0F, 1.0F);
player.level().playSound(null, player.getX(), player.getY() + 0.5, player.getZ(), soundevent, SoundSource.BLOCKS, 1.0F, 1.0F);
}

ItemStack resultContainer = containerFluidHandler.getContainer();
Expand All @@ -282,7 +282,7 @@ public void onRightClick(PlayerInteractEvent.RightClickBlock event) {
// Force allow shift-right clicking with a fluid container passing through to this block
if (!event.getItemStack().isEmpty()
&& event.getLevel().getBlockState(event.getPos()).getBlock() == this
&& event.getItemStack().getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY).isPresent()) {
&& event.getItemStack().getCapability(ForgeCapabilities.FLUID_HANDLER).isPresent()) {
event.setUseBlock(Event.Result.ALLOW);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.fml.config.ModConfig;
import org.cyclops.cyclopscore.config.ConfigurableProperty;
import org.cyclops.cyclopscore.config.extendedconfig.BlockConfig;
Expand Down Expand Up @@ -54,8 +53,8 @@ public BlockFlopperConfig() {
super(
Flopper._instance,
"flopper",
eConfig -> new BlockFlopper(Block.Properties
.of(Material.METAL, MaterialColor.STONE)
eConfig -> new BlockFlopper(Block.Properties.of()
.mapColor(MapColor.STONE)
.strength(3.0F, 4.8F)
.sound(SoundType.METAL), BlockEntityFlopper::new),
getDefaultItemConstructor(Flopper._instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.PushReaction;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fluids.capability.wrappers.BlockWrapper;
import net.minecraftforge.common.SoundActions;
Expand Down Expand Up @@ -52,7 +52,7 @@ protected void sendUpdate() {
BlockEntityFlopper.this.sendUpdate();
}
};
addCapabilityInternal(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, LazyOptional.of(this::getTank));
addCapabilityInternal(ForgeCapabilities.FLUID_HANDLER, LazyOptional.of(this::getTank));
}

public Tank getTank() {
Expand Down Expand Up @@ -92,7 +92,7 @@ protected Direction getFacing() {
protected boolean pushFluidsToTank() {
Direction targetSide = getFacing().getOpposite();
BlockPos targetPos = getBlockPos().relative(getFacing());
return BlockEntityHelpers.getCapability(level, targetPos, targetSide, CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
return BlockEntityHelpers.getCapability(level, targetPos, targetSide, ForgeCapabilities.FLUID_HANDLER)
.map(fluidHandler -> !FluidUtil.tryFluidTransfer(fluidHandler, tank, BlockFlopperConfig.pushFluidRate, true).isEmpty())
.orElse(false);
}
Expand All @@ -103,7 +103,7 @@ protected boolean pushFluidsToTank() {
*/
protected boolean pullFluidsFromTank() {
BlockPos targetPos = getBlockPos().relative(Direction.UP);
return BlockEntityHelpers.getCapability(level, targetPos, Direction.DOWN, CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
return BlockEntityHelpers.getCapability(level, targetPos, Direction.DOWN, ForgeCapabilities.FLUID_HANDLER)
.map(fluidHandler -> !FluidUtil.tryFluidTransfer(tank, fluidHandler, BlockFlopperConfig.pullFluidRate, true).isEmpty())
.orElse(false);
}
Expand All @@ -115,11 +115,10 @@ protected boolean pullFluidsFromTank() {
protected boolean pushFluidsToWorld() {
BlockPos targetPos = getBlockPos().relative(getFacing());
BlockState destBlockState = level.getBlockState(targetPos);
final Material destMaterial = destBlockState.getMaterial();
final boolean isDestNonSolid = !destMaterial.isSolid();
final boolean isDestReplaceable = destBlockState.getMaterial().isReplaceable();
final boolean isDestNonSolid = !destBlockState.isSolid();
final boolean isDestReplaceable = destBlockState.getPistonPushReaction() == PushReaction.DESTROY;
if (level.isEmptyBlock(targetPos)
|| (isDestNonSolid && isDestReplaceable && !destMaterial.isLiquid())) {
|| (isDestNonSolid && isDestReplaceable && !destBlockState.liquid())) {
FluidStack fluidStack = tank.getFluid();

if (!level.dimensionType().ultraWarm() || !fluidStack.getFluid().getFluidType().isVaporizedOnPlacement(level, worldPosition, fluidStack)) {
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="[45,)"
loaderVersion="[47,)"
issueTrackerURL="https://github.com/CyclopsMC/Flopper/issues"
displayURL="https://www.curseforge.com/minecraft/mc-mods/flopper"
license="MIT"
Expand All @@ -16,18 +16,18 @@ Discover, share and conquer abilities that stick.
[[dependencies.flopper]]
modId="cyclopscore"
mandatory=true
versionRange="[1.18.2,)"
versionRange="[1.18.4,)"
ordering="NONE"
side="BOTH"
[[dependencies.flopper]]
modId="forge"
mandatory=true
versionRange="[45.0.50,)"
versionRange="[47.0.1,)"
ordering="NONE"
side="BOTH"
[[dependencies.flopper]]
modId="minecraft"
mandatory=true
versionRange="[1.19.4,]"
versionRange="[1.20.1,]"
ordering="NONE"
side="BOTH"
6 changes: 3 additions & 3 deletions src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"pack": {
"description": "flopper resources",
"pack_format": 12,
"forge:resource_pack_format": 12,
"forge:data_pack_format": 10
"pack_format": 15,
"forge:resource_pack_format": 15,
"forge:data_pack_format": 15
}
}

0 comments on commit 2612f3c

Please sign in to comment.