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 11, 2024
1 parent a478786 commit 5f9e8a8
Show file tree
Hide file tree
Showing 730 changed files with 2,865 additions and 2,870 deletions.
35 changes: 19 additions & 16 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 'net.neoforged.gradle.mixin' version '7.0.97'
id 'net.darkhax.curseforgegradle' version '1.0.8'
id 'com.github.kt3k.coveralls' version '2.12.0'
Expand Down Expand Up @@ -35,7 +35,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 @@ -96,19 +96,20 @@ dependencies {
if(secrets.cyclopscore_version_local) {
implementation "org.cyclops.cyclopscore:cyclopscore-${project.minecraft_version}-neoforge:${secrets.cyclopscore_version_local}:deobf"
} else {
implementation "org.cyclops.cyclopscore:cyclopscore-${project.minecraft_version}-neoforge:${project.cyclopscore_version}:deobf"
implementation "org.cyclops.cyclopscore:cyclopscore-${project.minecraft_version}-neoforge:${project.cyclopscore_version}:deobf"
}

// Add something like 'integrateddynamicscompat_version_local=0.1.0-DEV' to your secrets.properties if you want to use a custom local Integrated Dynamics Compat version.
if(secrets.integrateddynamicscompat_version_local) {
shadow("org.cyclops.integrateddynamicscompat:integrateddynamicscompat-${project.minecraft_version}-neoforge:${secrets.integrateddynamicscompat_version_local}") {
transitive = false
}
} else {
shadow("org.cyclops.integrateddynamicscompat:integrateddynamicscompat-${project.minecraft_version}-neoforge:${project.integrateddynamicscompat_version}") {
transitive = false
}
}
// TODO
// if(secrets.integrateddynamicscompat_version_local) {
// shadow("org.cyclops.integrateddynamicscompat:integrateddynamicscompat-${project.minecraft_version}-neoforge:${secrets.integrateddynamicscompat_version_local}") {
// transitive = false
// }
// } else {
// shadow("org.cyclops.integrateddynamicscompat:integrateddynamicscompat-${project.minecraft_version}-neoforge:${project.integrateddynamicscompat_version}") {
// transitive = false
// }
// }

if(secrets.commoncapabilities_version_local) {
implementation "org.cyclops.commoncapabilities:commoncapabilities-${project.minecraft_version}-neoforge:${secrets.commoncapabilities_version_local}:deobf"
Expand All @@ -127,10 +128,10 @@ dependencies {
shadow "io.netty:netty-codec-http:4.1.77.Final"

// Project lombok
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'

testImplementation "junit:junit:4.12"
}
Expand Down Expand Up @@ -361,6 +362,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
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
mod_id=integrateddynamics
mod_version=1.21.4
minecraft_version=1.20.4
neoforge_version=20.4.160-beta
cyclopscore_version=1.19.0-429
minecraft_version=1.21
neoforge_version=21.0.43-beta
cyclopscore_version=1.19.1-462
integrateddynamicscompat_version=1.0.0-63
release_type=release
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44

commoncapabilities_version=2.9.1-114
commoncapabilities_version=2.9.1-125

# Workaround for Spotless bug
# https://github.com/diffplug/spotless/issues/834
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 @@ -80,7 +80,7 @@ public boolean correspondsTo(IValueType valueType) {
}

@Override
public Tag serialize(DummyValue value) {
public Tag serialize(ValueDeseralizationContext valueDeseralizationContext, DummyValue value) {
return EndTag.INSTANCE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,93 +234,6 @@ public void testInvalidInputTypeIsShearable() throws EvaluationException {
Operators.OBJECT_BLOCK_ISSHEARABLE.evaluate(new IVariable[]{DUMMY_VARIABLE});
}

/**
* ----------------------------------- ISPLANTABLE -----------------------------------
*/

@IntegrationTest
public void testBlockIsPlantable() throws EvaluationException {
IValue res1 = Operators.OBJECT_BLOCK_ISPLANTABLE.evaluate(new IVariable[]{bAir});
Asserts.check(res1 instanceof ValueTypeBoolean.ValueBoolean, "result is a boolean");
TestHelpers.assertEqual(((ValueTypeBoolean.ValueBoolean) res1).getRawValue(), false, "isplantable(air) = false");

IValue res2 = Operators.OBJECT_BLOCK_ISPLANTABLE.evaluate(new IVariable[]{bReed});
TestHelpers.assertEqual(((ValueTypeBoolean.ValueBoolean) res2).getRawValue(), true, "isplantable(reed) = true");
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizeIsPlantableLarge() throws EvaluationException {
Operators.OBJECT_BLOCK_ISPLANTABLE.evaluate(new IVariable[]{bAir, bAir});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizeIsPlantableSmall() throws EvaluationException {
Operators.OBJECT_BLOCK_ISPLANTABLE.evaluate(new IVariable[]{});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputTypeIsPlantable() throws EvaluationException {
Operators.OBJECT_BLOCK_ISPLANTABLE.evaluate(new IVariable[]{DUMMY_VARIABLE});
}

/**
* ----------------------------------- PLANTTYPE -----------------------------------
*/

@IntegrationTest
public void testBlockPlantType() throws EvaluationException {
IValue res1 = Operators.OBJECT_BLOCK_PLANTTYPE.evaluate(new IVariable[]{bAir});
Asserts.check(res1 instanceof ValueTypeString.ValueString, "result is a string");
TestHelpers.assertEqual(((ValueTypeString.ValueString) res1).getRawValue(), "none", "planttype(air) = none");

IValue res2 = Operators.OBJECT_BLOCK_PLANTTYPE.evaluate(new IVariable[]{bReed});
TestHelpers.assertEqual(((ValueTypeString.ValueString) res2).getRawValue(), "beach", "planttype(reed) = beach");
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizePlantTypeLarge() throws EvaluationException {
Operators.OBJECT_BLOCK_PLANTTYPE.evaluate(new IVariable[]{bAir, bAir});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizePlantTypeSmall() throws EvaluationException {
Operators.OBJECT_BLOCK_PLANTTYPE.evaluate(new IVariable[]{});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputTypePlantType() throws EvaluationException {
Operators.OBJECT_BLOCK_PLANTTYPE.evaluate(new IVariable[]{DUMMY_VARIABLE});
}

/**
* ----------------------------------- PLANT -----------------------------------
*/

@IntegrationTest
public void testBlockPlant() throws EvaluationException {
IValue res1 = Operators.OBJECT_BLOCK_PLANT.evaluate(new IVariable[]{bAir});
Asserts.check(res1 instanceof ValueObjectTypeBlock.ValueBlock, "result is a block");
TestHelpers.assertEqual(((ValueObjectTypeBlock.ValueBlock) res1).getRawValue().isPresent(), false, "plant(air) = null");

IValue res2 = Operators.OBJECT_BLOCK_PLANT.evaluate(new IVariable[]{bReed});
TestHelpers.assertEqual(((ValueObjectTypeBlock.ValueBlock) res2).getRawValue().get().getBlock() == Blocks.SUGAR_CANE, true, "plant(reed) = reed");
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizePlantLarge() throws EvaluationException {
Operators.OBJECT_BLOCK_PLANT.evaluate(new IVariable[]{bAir, bAir});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizePlantSmall() throws EvaluationException {
Operators.OBJECT_BLOCK_PLANT.evaluate(new IVariable[]{});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputTypePlant() throws EvaluationException {
Operators.OBJECT_BLOCK_PLANT.evaluate(new IVariable[]{DUMMY_VARIABLE});
}

/**
* ----------------------------------- PLANTAGE -----------------------------------
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void before() {
Level world = ServerLifecycleHooks.getCurrentServer().getLevel(Level.OVERWORLD);
eZombie = new DummyVariableEntity(makeEntity(new Zombie(world)));
Zombie zombieBurning = new Zombie(world);
zombieBurning.setSecondsOnFire(10);
zombieBurning.setRemainingFireTicks(10);
eZombieBurning = new DummyVariableEntity(makeEntity(zombieBurning));
Zombie zombieWet = new Zombie(world) {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cyclops.integrateddynamics.core.evaluate.variable.integration;

import net.minecraft.core.component.DataComponents;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.item.Items;
Expand Down Expand Up @@ -46,8 +47,7 @@ public void before() {
eBucketWater = new DummyVariableFluidStack(ValueObjectTypeFluidStack.ValueFluidStack.of(new FluidStack(Fluids.WATER, FluidHelpers.BUCKET_VOLUME)));
eWater100 = new DummyVariableFluidStack(ValueObjectTypeFluidStack.ValueFluidStack.of(new FluidStack(Fluids.WATER, 100)));
eWater100Tag = new DummyVariableFluidStack(ValueObjectTypeFluidStack.ValueFluidStack.of(new FluidStack(Fluids.WATER, 100)));
eWater100Tag.getValue().getRawValue().setTag(new CompoundTag());
eWater100Tag.getValue().getRawValue().getTag().putString("a", "abc");
eWater100Tag.getValue().getRawValue().set(DataComponents.DAMAGE, 3);
i99 = new DummyVariable<>(ValueTypes.INTEGER, ValueTypeInteger.ValueInteger.of(99));
}

Expand Down Expand Up @@ -461,34 +461,34 @@ public void testInvalidInputTypeModName() throws EvaluationException {
}

/**
* ----------------------------------- NBT -----------------------------------
* ----------------------------------- DATA -----------------------------------
*/

@IntegrationTest
public void testFluidNbt() throws EvaluationException {
IValue res1 = Operators.OBJECT_FLUIDSTACK_NBT.evaluate(new IVariable[]{eBucketLava});
IValue res1 = Operators.OBJECT_FLUIDSTACK_DATA.evaluate(new IVariable[]{eBucketLava});
Asserts.check(res1 instanceof ValueTypeNbt.ValueNbt, "result is an nbt tag");
TestHelpers.assertEqual(((ValueTypeNbt.ValueNbt) res1).getRawValue().isPresent(), false, "nbt(lava) = null");
TestHelpers.assertEqual(((ValueTypeNbt.ValueNbt) res1).getRawValue().isPresent(), false, "data(lava) = null");

IValue res2 = Operators.OBJECT_FLUIDSTACK_NBT.evaluate(new IVariable[]{eWater100Tag});
IValue res2 = Operators.OBJECT_FLUIDSTACK_DATA.evaluate(new IVariable[]{eWater100Tag});
CompoundTag tag = new CompoundTag();
tag.putString("a", "abc");
tag.putInt("minecraft:damage", 3);
TestHelpers.assertEqual(((ValueTypeNbt.ValueNbt) res2).getRawValue().get(), tag, "nbt(watertag) != null");
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizeNbtLarge() throws EvaluationException {
Operators.OBJECT_FLUIDSTACK_NBT.evaluate(new IVariable[]{eBucketLava, eBucketLava});
Operators.OBJECT_FLUIDSTACK_DATA.evaluate(new IVariable[]{eBucketLava, eBucketLava});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputSizeNbtSmall() throws EvaluationException {
Operators.OBJECT_FLUIDSTACK_NBT.evaluate(new IVariable[]{});
Operators.OBJECT_FLUIDSTACK_DATA.evaluate(new IVariable[]{});
}

@IntegrationTest(expected = EvaluationException.class)
public void testInvalidInputTypeNbt() throws EvaluationException {
Operators.OBJECT_FLUIDSTACK_NBT.evaluate(new IVariable[]{DUMMY_VARIABLE});
Operators.OBJECT_FLUIDSTACK_DATA.evaluate(new IVariable[]{DUMMY_VARIABLE});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public void testWithFluid() throws EvaluationException {
IMixedIngredients outputIngredients1 = ((ValueObjectTypeIngredients.ValueIngredients) res1).getRawValue().get();
List<FluidStack> outputList1 = outputIngredients1.getInstances(IngredientComponent.FLUIDSTACK);
TestHelpers.assertEqual(outputList1.size(), 1, "with_fluids(mix, 0, fluids)[0]size = 1");
TestHelpers.assertEqual(outputList1.get(0), new FluidStack(Fluids.WATER, 123),
TestHelpers.assertEqual(FluidStack.matches(outputList1.get(0), new FluidStack(Fluids.WATER, 123)), true,
"with_fluids(mix, 0, fluids)[0] = fluids[0]");

TestHelpers.assertEqual(outputIngredients1.getInstances(IngredientComponent.FLUIDSTACK).size(), inputIngredients.getInstances(IngredientComponent.FLUIDSTACK).size(), "Fluids size remains the same");
Expand All @@ -295,11 +295,11 @@ public void testWithFluid() throws EvaluationException {
IMixedIngredients outputIngredients2 = ((ValueObjectTypeIngredients.ValueIngredients) res2).getRawValue().get();
List<FluidStack> outputList2 = outputIngredients2.getInstances(IngredientComponent.FLUIDSTACK);
TestHelpers.assertEqual(outputList2.size(), 3, "with_fluids(mix, 3, fluids)[0]size = 2");
TestHelpers.assertEqual(outputList2.get(0), new FluidStack(Fluids.WATER, 125),
TestHelpers.assertEqual(FluidStack.matches(outputList2.get(0), new FluidStack(Fluids.WATER, 125)), true,
"with_fluids(mix, 2, fluids)[0] = fluids[0]");
TestHelpers.assertEqual(outputList2.get(1), FluidStack.EMPTY,
TestHelpers.assertEqual(FluidStack.matches(outputList2.get(1), FluidStack.EMPTY), true,
"with_fluids(mix, 2, fluids)[1] = fluids[1]");
TestHelpers.assertEqual(outputList2.get(2), new FluidStack(Fluids.WATER, 123),
TestHelpers.assertEqual(FluidStack.matches(outputList2.get(2), new FluidStack(Fluids.WATER, 123)), true,
"with_fluids(mix, 2, fluids)[2] = fluids[2]");

TestHelpers.assertNonEqual(outputIngredients2.getInstances(IngredientComponent.FLUIDSTACK).size(), inputIngredients.getInstances(IngredientComponent.FLUIDSTACK).size(), "Fluids size changes");
Expand Down Expand Up @@ -421,9 +421,9 @@ public void testWithFluids() throws EvaluationException {
IMixedIngredients outputIngredients1 = ((ValueObjectTypeIngredients.ValueIngredients) res1).getRawValue().get();
List<FluidStack> outputList1 = outputIngredients1.getInstances(IngredientComponent.FLUIDSTACK);
TestHelpers.assertEqual(outputList1.size(), 2, "with_fluids(mix, fluids)[0]size = 2");
TestHelpers.assertEqual(outputList1.get(0), new FluidStack(Fluids.LAVA, 1000),
TestHelpers.assertEqual(FluidStack.matches(outputList1.get(0), new FluidStack(Fluids.LAVA, 1000)), true,
"with_fluids(mix, fluids)[0] = fluids[0]");
TestHelpers.assertEqual(outputList1.get(1), new FluidStack(Fluids.WATER, 125),
TestHelpers.assertEqual(FluidStack.matches(outputList1.get(1), new FluidStack(Fluids.WATER, 125)), true,
"with_fluids(mix, fluids)[1] = fluids[1]");

TestHelpers.assertEqual(outputIngredients1.getInstances(IngredientComponent.ITEMSTACK), inputIngredients.getInstances(IngredientComponent.ITEMSTACK), "Item remains the same");
Expand Down
Loading

0 comments on commit 5f9e8a8

Please sign in to comment.