Skip to content

Commit

Permalink
Update to MC 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jul 12, 2024
1 parent c27e34c commit 68687b2
Show file tree
Hide file tree
Showing 27 changed files with 56 additions and 48 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'net.neoforged.gradle.userdev' version '7.0.97'
id 'net.neoforged.gradle.userdev' version '7.0.145'
id 'com.diffplug.spotless' version '5.14.3'
}

Expand Down Expand Up @@ -27,7 +27,7 @@ base {
}

// Set Java details
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
compileJava.options.compilerArgs << "-Xmaxerrs" << "9999"
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

Expand Down Expand Up @@ -252,6 +252,8 @@ publishing {

idea {
module {
downloadSources = true
downloadJavadoc = true
for (String excludeDirName in ["run", "out", "logs", "gradle"]) {
File excludeDir = new File(projectDir, excludeDirName)
excludeDirs.add(excludeDir)
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
mod_id=integrateddynamics-compat
mod_version=1.0.0
minecraft_version=1.20.4
neoforge_version=20.4.160-beta
cyclopscore_version=1.19.0-423
integrateddynamics_version=1.21.2-736
minecraft_version=1.21
neoforge_version=21.0.43-beta
cyclopscore_version=1.19.1-452
integrateddynamics_version=1.21.4-770
release_type=release

commoncapabilities_version=2.9.1-114
commoncapabilities_version=2.9.1-126
mcmultipart_version=1.2.1_78
waila_version=1.10.8:B72_1.15.2
jei_version=17.3.0.52
jei_version=19.5.0.31
rfapi_version=1.8.9R1.2.0B1.1
teslaapi_version=1.12.2:1.0.63
mantle_version=1.12-1.3.1.22
tconstruct_version=1.12-2.7.4.37
forestry_version=1.12:5.4.3.129
charset_version=0.4.0-pre10
IC2_version=2.8.7-ex112
theoneprobe_version=1.20.0-9.0.0-1
theoneprobe_version=1.21_neo-12.0.3-5
refinedstorage_version=1.10.2
ie_version=0.12-90-521
crafttweakerapi_version=4.1.6.457
Expand Down
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.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void registerGuiHandlers(IGuiHandlerRegistration registry) {

@Override
public ResourceLocation getPluginUid() {
return new ResourceLocation(Reference.MOD_ID, "main");
return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "main");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class DryingBasinRecipeCategory implements IRecipeCategory<DryingBasinRec
private final IDrawableAnimated arrow;

public DryingBasinRecipeCategory(IGuiHelper guiHelper) {
ResourceLocation resourceLocation = new ResourceLocation(Reference.MOD_ID, "textures/gui/drying_basin_gui_jei.png");
ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/drying_basin_gui_jei.png");
this.background = guiHelper.createDrawable(resourceLocation, 0, 0, 93, 53);
this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(RegistryEntries.BLOCK_DRYING_BASIN.get()));
IDrawableStatic arrowDrawable = guiHelper.createDrawable(resourceLocation, 94, 0, 11, 28);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class MechanicalDryingBasinRecipeCategory implements IRecipeCategory<Mech
private final IDrawableAnimated arrow;

public MechanicalDryingBasinRecipeCategory(IGuiHelper guiHelper) {
ResourceLocation resourceLocation = new ResourceLocation(Reference.MOD_ID, "textures/gui/drying_basin_gui_jei.png");
ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/drying_basin_gui_jei.png");
this.background = guiHelper.createDrawable(resourceLocation, 0, 0, 93, 53);
this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(RegistryEntries.BLOCK_MECHANICAL_DRYING_BASIN.get()));
IDrawableStatic arrowDrawable = guiHelper.createDrawable(resourceLocation, 94, 0, 11, 28);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class MechanicalSqueezerRecipeCategory implements IRecipeCategory<Mechani
private final IDrawableAnimated arrowDrawable;

public MechanicalSqueezerRecipeCategory(IGuiHelper guiHelper) {
ResourceLocation resourceLocation = new ResourceLocation(Reference.MOD_ID, "textures/gui/mechanical_squeezer_gui_jei.png");
ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/mechanical_squeezer_gui_jei.png");
this.background = guiHelper.createDrawable(resourceLocation, 0, 0, 116, 53);
this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(RegistryEntries.BLOCK_MECHANICAL_SQUEEZER.get()));
this.arrowDrawable = guiHelper.createAnimatedDrawable(guiHelper.createDrawable(resourceLocation, 116, 0, 4, 11), 20, IDrawableAnimated.StartDirection.TOP, false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.cyclops.integrateddynamicscompat.modcompat.jei.mechanicalsqueezer;

import com.google.common.collect.Lists;
import net.minecraft.core.NonNullList;
import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.CraftingInput;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.item.crafting.RecipeType;
import net.neoforged.neoforge.fluids.FluidStack;
import com.google.common.collect.Lists;
import org.cyclops.cyclopscore.modcompat.jei.RecipeRegistryJeiRecipeWrapper;
import org.cyclops.integrateddynamics.RegistryEntries;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeMechanicalSqueezer;
Expand All @@ -21,7 +21,7 @@
* Recipe wrapper for MechanicalSqueezer recipes
* @author rubensworks
*/
public class MechanicalSqueezerRecipeJEI extends RecipeRegistryJeiRecipeWrapper<Container, RecipeMechanicalSqueezer, MechanicalSqueezerRecipeJEI> {
public class MechanicalSqueezerRecipeJEI extends RecipeRegistryJeiRecipeWrapper<CraftingInput, RecipeMechanicalSqueezer, MechanicalSqueezerRecipeJEI> {

private final List<ItemStack> inputItem;
private final NonNullList<RecipeSqueezer.IngredientChance> outputItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SqueezerRecipeCategory implements IRecipeCategory<SqueezerRecipeJEI
private final IDrawableStatic arrowDrawable;

public SqueezerRecipeCategory(IGuiHelper guiHelper) {
ResourceLocation resourceLocation = new ResourceLocation(Reference.MOD_ID, "textures/gui/squeezer_gui_jei.png");
ResourceLocation resourceLocation = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/squeezer_gui_jei.png");
this.background = guiHelper.createDrawable(resourceLocation, 0, 0, 116, 53);
this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(RegistryEntries.BLOCK_SQUEEZER.get()));
this.arrowDrawable = guiHelper.createDrawable(resourceLocation, 41, 32, 12, 2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.cyclops.integrateddynamicscompat.modcompat.jei.squeezer;

import com.google.common.collect.Lists;
import net.minecraft.core.NonNullList;
import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.CraftingInput;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.item.crafting.RecipeType;
import net.neoforged.neoforge.fluids.FluidStack;
import com.google.common.collect.Lists;
import org.cyclops.cyclopscore.modcompat.jei.RecipeRegistryJeiRecipeWrapper;
import org.cyclops.integrateddynamics.RegistryEntries;
import org.cyclops.integrateddynamics.core.recipe.type.RecipeSqueezer;
Expand All @@ -20,7 +20,7 @@
* Recipe wrapper for Squeezer recipes
* @author rubensworks
*/
public class SqueezerRecipeJEI extends RecipeRegistryJeiRecipeWrapper<Container, RecipeSqueezer, SqueezerRecipeJEI> {
public class SqueezerRecipeJEI extends RecipeRegistryJeiRecipeWrapper<CraftingInput, RecipeSqueezer, SqueezerRecipeJEI> {

private final List<ItemStack> inputItem;
private final NonNullList<RecipeSqueezer.IngredientChance> outputItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public boolean canRenderInLayer(BlockRenderLayer layer) {

@Override
public ResourceLocation getModelPath() {
return new ResourceLocation(IntegratedDynamics._instance.getModId(), BlockCableConfig._instance.getNamedId());
return ResourceLocation.parse(IntegratedDynamics._instance.getModId(), BlockCableConfig._instance.getNamedId());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ protected void setup(FMLCommonSetupEvent event) {
));

POSITIONED_MASTERITEMINVENTORY = ValueTypeListProxyFactories.REGISTRY.register(
new ValueTypeListProxyNBTFactory<>(new ResourceLocation(Reference.MOD_REFINEDSTORAGE, "positioned_item_inventory"),
new ValueTypeListProxyNBTFactory<>(ResourceLocation.parse(Reference.MOD_REFINEDSTORAGE, "positioned_item_inventory"),
ValueTypeListProxyPositionedNetworkMasterItemInventory.class));
POSITIONED_MASTERFLUIDINVENTORY = ValueTypeListProxyFactories.REGISTRY.register(
new ValueTypeListProxyNBTFactory<>(new ResourceLocation(Reference.MOD_REFINEDSTORAGE, "positioned_fluid_inventory"),
new ValueTypeListProxyNBTFactory<>(ResourceLocation.parse(Reference.MOD_REFINEDSTORAGE, "positioned_fluid_inventory"),
ValueTypeListProxyPositionedNetworkMasterFluidInventory.class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class TopDryingBasinData implements IProbeInfoProvider {
@Override
public ResourceLocation getID() {
return new ResourceLocation(Reference.MOD_ID, "drying_basin_data");
return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "drying_basin_data");
}

@Override
Expand All @@ -32,7 +32,7 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Le
}
if (!tile.getTank().isEmpty()) {
probeInfo.horizontal()
.text(tile.getTank().getFluid().getDisplayName())
.text(tile.getTank().getFluid().getHoverName())
.progress(tile.getTank().getFluidAmount(), tile.getTank().getCapacity());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class TopMechanicalMachineData implements IProbeInfoProvider {
@Override
public ResourceLocation getID() {
return new ResourceLocation(Reference.MOD_ID, "mechanical_machine_data");
return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "mechanical_machine_data");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TopPartData implements IProbeInfoProvider {

@Override
public ResourceLocation getID() {
return new ResourceLocation(Reference.MOD_ID, "part_data");
return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "part_data");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class TopProxyData implements IProbeInfoProvider {
@Override
public ResourceLocation getID() {
return new ResourceLocation(Reference.MOD_ID, "proxy_data");
return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "proxy_data");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class TopSqueezerData implements IProbeInfoProvider {
@Override
public ResourceLocation getID() {
return new ResourceLocation(Reference.MOD_ID, "squeezer_data");
return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "squeezer_data");
}

@Override
Expand All @@ -32,7 +32,7 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, Player player, Le
}
if (!tile.getTank().isEmpty()) {
probeInfo.horizontal()
.text(tile.getTank().getFluid().getDisplayName())
.text(tile.getTank().getFluid().getHoverName())
.progress(tile.getTank().getFluidAmount(), tile.getTank().getCapacity());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class DryingBasinDataProvider implements IComponentProvider, IServerDataProvider<BlockEntityEntity> {

public static final ResourceLocation ID = new ResourceLocation(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "drying_basin");
public static final ResourceLocation ID = ResourceLocation.parse(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "drying_basin");

@Override
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class MechanicalDryingBasinDataProvider extends SqueezerDataProvider implements IComponentProvider, IServerDataProvider<BlockEntityEntity> {

public static final ResourceLocation ID = new ResourceLocation(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "mechanical_drying_basin");
public static final ResourceLocation ID = ResourceLocation.parse(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "mechanical_drying_basin");

@Override
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class MechanicalSqueezerDataProvider extends SqueezerDataProvider implements IComponentProvider, IServerDataProvider<BlockEntityEntity> {

public static final ResourceLocation ID = new ResourceLocation(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "mechanical_squeezer");
public static final ResourceLocation ID = ResourceLocation.parse(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "mechanical_squeezer");

@Override
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public class PartDataProvider implements IComponentProvider, IServerDataProvider<BlockEntityEntity> {

public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "part");
public static final ResourceLocation ID = ResourceLocation.parse(Reference.MOD_ID, "part");

@Override
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public class ProxyDataProvider implements IComponentProvider, IServerDataProvider<BlockEntityEntity> {

public static final ResourceLocation ID = new ResourceLocation(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "proxy");
public static final ResourceLocation ID = ResourceLocation.parse(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "proxy");

@Override
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
public class SqueezerDataProvider implements IComponentProvider, IServerDataProvider<BlockEntityEntity> {

public static final ResourceLocation ID = new ResourceLocation(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "squeezer");
public static final ResourceLocation ID = ResourceLocation.parse(org.cyclops.integrateddynamicscompat.Reference.MOD_ID, "squeezer");

@Override
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.cyclops.integrateddynamicscompat.network.packet;

import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
Expand All @@ -17,9 +19,10 @@
/**
* @author rubensworks
*/
public class CPacketSetSlot extends PacketCodec {
public class CPacketSetSlot extends PacketCodec<CPacketSetSlot> {

public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "set_slot");
public static final Type<CPacketSetSlot> ID = new Type<>(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "set_slot"));
public static final StreamCodec<RegistryFriendlyByteBuf, CPacketSetSlot> CODEC = getCodec(CPacketSetSlot::new);

@CodecField
private int windowId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.cyclops.integrateddynamicscompat.network.packet;

import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.neoforged.api.distmarker.Dist;
Expand All @@ -20,9 +22,10 @@
/**
* @author rubensworks
*/
public class CPacketValueTypeRecipeLPElementSetRecipe extends PacketCodec {
public class CPacketValueTypeRecipeLPElementSetRecipe extends PacketCodec<CPacketValueTypeRecipeLPElementSetRecipe> {

public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "value_type_recipe_lp_element_set_recipe");
public static final Type<CPacketValueTypeRecipeLPElementSetRecipe> ID = new Type<>(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "value_type_recipe_lp_element_set_recipe"));
public static final StreamCodec<RegistryFriendlyByteBuf, CPacketValueTypeRecipeLPElementSetRecipe> CODEC = getCodec(CPacketValueTypeRecipeLPElementSetRecipe::new);

@CodecField
private int windowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.cyclops.cyclopscore.network.PacketHandler;
import org.cyclops.cyclopscore.proxy.CommonProxyComponent;
import org.cyclops.integrateddynamicscompat.IntegratedDynamicsCompat;
import org.cyclops.integrateddynamicscompat.network.packet.CPacketValueTypeRecipeLPElementSetRecipe;
import org.cyclops.integrateddynamicscompat.network.packet.CPacketSetSlot;
import org.cyclops.integrateddynamicscompat.network.packet.CPacketValueTypeRecipeLPElementSetRecipe;

/**
* Proxy for server and client side.
Expand All @@ -24,8 +24,8 @@ public void registerPacketHandlers(PacketHandler packetHandler) {
super.registerPacketHandlers(packetHandler);

// Register packets.
packetHandler.register(CPacketSetSlot.ID, CPacketSetSlot::new);
packetHandler.register(CPacketValueTypeRecipeLPElementSetRecipe.ID, CPacketValueTypeRecipeLPElementSetRecipe::new);
packetHandler.register(CPacketSetSlot.ID, CPacketSetSlot.CODEC);
packetHandler.register(CPacketValueTypeRecipeLPElementSetRecipe.ID, CPacketValueTypeRecipeLPElementSetRecipe.CODEC);

IntegratedDynamicsCompat.clog("Registered packet handler.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ Integrated Dynamics compatibility with other mods.
[[dependencies.integrateddynamicscompat]]
modId="cyclopscore"
type="required"
versionRange="[1.19.0,)"
versionRange="[1.19.1,)"
ordering="NONE"
side="BOTH"
[[dependencies.integrateddynamicscompat]]
modId="neoforge"
type="required"
versionRange="[20.4,)"
versionRange="[21.0.43-beta,)"
ordering="NONE"
side="BOTH"
[[dependencies.integrateddynamicscompat]]
modId="minecraft"
type="required"
versionRange="[1.20.4,]"
versionRange="[1.21,]"
ordering="NONE"
side="BOTH"
[[dependencies.integrateddynamicscompat]]
Expand Down

0 comments on commit 68687b2

Please sign in to comment.