Compare commits

..

No commits in common. "6050e5ad9465d89021d0145295bc569aa2b3e1b4" and "c8c0db6aa9c389f3f498c984117eca1c16d7e062" have entirely different histories.

5 changed files with 23 additions and 26 deletions

View file

@ -5,14 +5,7 @@ plugins {
id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'net.minecraftforge.gradle' version '[6.0,6.2)'
} }
// Enable the Jar-in-Jar system for your mod
jarJar.enable()
version = mod_version version = mod_version
if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}
group = mod_group_id group = mod_group_id
base { base {
@ -112,12 +105,23 @@ minecraft {
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
} }
all {
lazyToken('minecraft_classpath') {
configurations.embed.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
}
}
} }
} }
// Include resources generated by data generators. // Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' } sourceSets.main.resources { srcDir 'src/generated/resources' }
configurations {
embed
implementation.extendsFrom(embed)
}
repositories { repositories {
// Put repositories for dependencies here // Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you // ForgeGradle automatically adds the Forge maven and Maven Central for you
@ -146,12 +150,7 @@ dependencies {
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"], // If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository. // then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
embed "org.jgrapht:jgrapht-core:${jgt_version}"
minecraftLibrary "org.jgrapht:jgrapht-core:${jgt_version}"
jarJar(group: "org.jgrapht", name: "jgrapht-core", version: "[${jgt_version}]")
// for some reason jgrapht dependencies aren't auto-included in the metadata and i can't figure out how to make that happen
jarJar(group: "org.jheaps", name: "jheaps", version: "[${jheaps_version}]")
jarJar(group: "org.apfloat", name: "apfloat", version: "[${apfloat_version}]")
// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings // Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
@ -178,7 +177,7 @@ tasks.named('processResources', ProcessResources).configure {
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range, minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
forge_version : forge_version, forge_version_range: forge_version_range, forge_version : forge_version, forge_version_range: forge_version_range,
loader_version_range: loader_version_range, loader_version_range: loader_version_range,
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: version, mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors : mod_authors, mod_description: mod_description, mod_authors : mod_authors, mod_description: mod_description,
] ]
inputs.properties replaceProperties inputs.properties replaceProperties
@ -201,14 +200,14 @@ tasks.named('jar', Jar).configure {
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
]) ])
} }
// TODO figure out if leaving this out causes jgrapht to be left out of the jar
// from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }
// This is the preferred method to reobfuscate your jar file // This is the preferred method to reobfuscate your jar file
finalizedBy 'reobfJar' finalizedBy 'reobfJar'
} }
tasks.named('jarJar', Jar).configure {
finalizedBy 'reobfJarJar'
}
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing: // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing:
// tasks.named('publish').configure { // tasks.named('publish').configure {
// dependsOn 'reobfJar' // dependsOn 'reobfJar'
@ -218,8 +217,6 @@ tasks.named('jarJar', Jar).configure {
publishing { publishing {
publications { publications {
register('mavenJava', MavenPublication) { register('mavenJava', MavenPublication) {
groupId mod_group_id
artifactId mod_name
artifact jar artifact jar
pom.withXml { pom.withXml {
def node = asNode() def node = asNode()

View file

@ -38,8 +38,6 @@ mapping_channel=official
mapping_version=1.20.1 mapping_version=1.20.1
jei_version=15.2.0.22 jei_version=15.2.0.22
jgt_version=1.5.2 jgt_version=1.5.2
jheaps_version=0.14
apfloat_version=1.10.1
## Mod Properties ## Mod Properties

View file

@ -10,6 +10,7 @@ import java.util.function.Supplier;
public class ItemEquality { public class ItemEquality {
public static final ItemEquality DAMAGE = new ItemEquality((stack, filter) -> stack.getDamageValue() == filter.getDamageValue(), false, Type.DAMAGE); public static final ItemEquality DAMAGE = new ItemEquality((stack, filter) -> stack.getDamageValue() == filter.getDamageValue(), false, Type.DAMAGE);
// TODO see if this tagMatches replacement is good enough?
public static final ItemEquality NBT = new ItemEquality(ItemStack::areShareTagsEqual, false, Type.NBT); public static final ItemEquality NBT = new ItemEquality(ItemStack::areShareTagsEqual, false, Type.NBT);
public static final ItemEquality MOD = new ItemEquality((stack, filter) -> stack.getItem().getCreatorModId(stack).equals(filter.getItem().getCreatorModId(filter)), true, Type.MOD); public static final ItemEquality MOD = new ItemEquality((stack, filter) -> stack.getItem().getCreatorModId(stack).equals(filter.getItem().getCreatorModId(filter)), true, Type.MOD);

View file

@ -39,6 +39,8 @@ public class ItemTerminalWidget extends AbstractWidget {
@Override @Override
protected void renderWidget(GuiGraphics graphics, int p_268034_, int p_268009_, float p_268085_) { protected void renderWidget(GuiGraphics graphics, int p_268034_, int p_268009_, float p_268085_) {
var mc = this.screen.getMinecraft(); var mc = this.screen.getMinecraft();
var renderer = mc.getItemRenderer();
// TODO test this new blit offset replacement?
graphics.pose().translate(0, 0, 100); graphics.pose().translate(0, 0, 100);
if (this.selected) if (this.selected)
graphics.fill(this.getX(), this.getY(), this.getX() + 16, this.getY() + 16, -2130706433); graphics.fill(this.getX(), this.getY(), this.getX() + 16, this.getY() + 16, -2130706433);

View file

@ -28,7 +28,6 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
@ -225,9 +224,9 @@ public class PipeBlock extends BaseEntityBlock {
protected static boolean hasLegsTo(Level world, BlockState state, BlockPos pos, Direction direction) { protected static boolean hasLegsTo(Level world, BlockState state, BlockPos pos, Direction direction) {
if (state.getBlock() instanceof WallBlock || state.getBlock() instanceof FenceBlock) if (state.getBlock() instanceof WallBlock || state.getBlock() instanceof FenceBlock)
return direction == Direction.DOWN; return direction == Direction.DOWN;
var mapColor = state.getMapColor(world,pos); // TODO figure out new condition for legs now that materials are gone
if (mapColor == MapColor.STONE || mapColor == MapColor.METAL) /* if (state.getMaterial() == Material.STONE || state.getMaterial() == Material.METAL)
return Block.canSupportCenter(world, pos, direction.getOpposite()); return Block.canSupportCenter(world, pos, direction.getOpposite());*/
return false; return false;
} }