Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ neoForge {
if (at.exists()) {
accessTransformers.from(at.absolutePath)
}
parchment {
minecraftVersion = parchment_game_version
mappingsVersion = parchment_version
}
}

dependencies {
Expand All @@ -48,4 +44,4 @@ configurations {
artifacts {
commonJava sourceSets.main.java.sourceDirectories.singleFile
commonResources sourceSets.main.resources.sourceDirectories.singleFile
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import com.mojang.serialization.DataResult;
import net.minecraft.commands.arguments.blocks.BlockStateParser;
import net.minecraft.commands.arguments.blocks.BlockStateParser.BlockResult;
import net.minecraft.commands.arguments.item.ItemInput;
import net.minecraft.commands.arguments.item.ItemParser;
import net.minecraft.commands.arguments.item.ItemParser.ItemResult;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
Expand All @@ -43,7 +43,7 @@ public class ModelOverride {
private BlockResult parsedBlock;
private Either<ItemStack, BlockState> renderObject;

private ModelOverride(String raw, BlockResult parsedBlock, Type type, Either<ItemResult, BlockResult> parsedRHS)
private ModelOverride(String raw, BlockResult parsedBlock, Type type, Either<ItemInput, BlockResult> parsedRHS)
{
this.parsedBlock = parsedBlock;

Expand Down Expand Up @@ -86,7 +86,7 @@ public static DataResult<ModelOverride> of(String str, HolderLookup.Provider pro
to = to.substring(to.indexOf(")") + 1);
}

Either<ItemResult, BlockResult> either;
Either<ItemInput, BlockResult> either;
try {
if(type == Type.ITEM)
either = Either.left(new ItemParser(provider).parse(new StringReader(to)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import net.minecraft.client.renderer.entity.state.EntityRenderState;
import net.minecraft.client.renderer.item.ItemStackRenderState;
import net.minecraft.client.renderer.rendertype.RenderTypes;
import net.minecraft.client.renderer.state.CameraRenderState;
import net.minecraft.client.renderer.state.level.CameraRenderState;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.HumanoidArm;
Expand Down Expand Up @@ -79,8 +78,6 @@ private static void drawBlock(Player player, PoseStack matrix, int light, BlockS
{
CarryOnData carry = CarryOnDataManager.getCarryData(player);
ItemStackRenderState renderState = new ItemStackRenderState();
var layer = renderState.newLayer();
layer.setRenderType(RenderTypes.glint());
Comment on lines -82 to -83

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just no longer needed? It seems like it would be a change in behavior.


matrix.pushPose();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static boolean doCheck(Entity entity, Set<String> regular, List<TagKey<E
if(regular.contains(name))
return true;
for(TagKey<EntityType<?>> tag : tags)
if(entity.getType().is(tag))
if(entity.getType().builtInRegistryHolder().is(tag))
return true;
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
public class InventoryMixin
{
@Unique
private static final ItemStack DUMMY_STACK = new ItemStack(Blocks.COBBLESTONE, 1);
private static ItemStack getDummyStack() {
return new ItemStack(Blocks.COBBLESTONE, 1);
}

@Shadow
public Player player;
Expand All @@ -56,7 +58,7 @@ private Object getFreeSlotEmptyCheck(NonNullList<Object> instance, int slot, Ope
{
if(slot == selected && CarryOnDataManager.getCarryData(player).isCarrying())
{
return DUMMY_STACK;
return getDummyStack();
}
else
return original.call(instance, slot);
Expand Down
2 changes: 1 addition & 1 deletion Common/src/main/resources/carryon.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "tschipp.carryon.mixin",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_25",
"mixins": [
"EntityMixin",
"InventoryMixin",
Expand Down
14 changes: 5 additions & 9 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'multiloader-loader'
id 'fabric-loom' version "${loom_version}"
id 'net.fabricmc.fabric-loom' version "${loom_version}"
}

repositories {
Expand All @@ -21,18 +21,14 @@ repositories {

dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchment_mappings_fabric}@zip")
}
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'

modApi("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}") {
compileOnly("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modApi "com.terraformersmc:modmenu:17.0.0-beta.1"
compileOnly "com.terraformersmc:modmenu:18.0.0-alpha.8"
}

loom {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package tschipp.carryon;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.world.entity.player.Player;
Expand All @@ -36,7 +36,7 @@ public class CarryOnFabricClientMod implements ClientModInitializer
@Override
public void onInitializeClient()
{
CarryOnKeybinds.registerKeybinds(KeyBindingHelper::registerKeyBinding);
CarryOnKeybinds.registerKeybinds(KeyMappingHelper::registerKeyMapping);
ClientEvents.registerEvents();
CarryOnCommon.registerClientPackets(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void registerConfig(BuiltConfig cfg) {
@Override
public <T extends PacketBase, B extends FriendlyByteBuf> void registerServerboundPacket(CustomPacketPayload.Type<T> type, Class<T> clazz, StreamCodec<B, T> codec, BiConsumer<T, Player> handler, Object... args)
{
PayloadTypeRegistry.playC2S().register(type, (StreamCodec<RegistryFriendlyByteBuf, T>)codec);
PayloadTypeRegistry.serverboundPlay().register(type, (StreamCodec<RegistryFriendlyByteBuf, T>)codec);

ServerPlayNetworking.registerGlobalReceiver(type, (T packet, ServerPlayNetworking.Context context) -> {
context.server().execute(() -> {
Expand All @@ -84,7 +84,7 @@ public <T extends PacketBase, B extends FriendlyByteBuf> void registerClientbou
boolean client = (boolean)args[0];

if(!client)
PayloadTypeRegistry.playS2C().register(type, (StreamCodec<RegistryFriendlyByteBuf, T>)codec);
PayloadTypeRegistry.clientboundPlay().register(type, (StreamCodec<RegistryFriendlyByteBuf, T>)codec);
else
CarryOnFabricClientMod.registerClientboundPacket(type, handler);
}
Expand Down
2 changes: 1 addition & 1 deletion Fabric/src/main/resources/carryon.fabric.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "tschipp.carryon.mixin",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_25",
"mixins": [
"PlayerMixinFabric"
],
Expand Down
127 changes: 1 addition & 126 deletions NeoForge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ neoForge {
if (at.exists()) {
accessTransformers.from(at.absolutePath)
}
parchment {
minecraftVersion = parchment_game_version
mappingsVersion = parchment_version
}
runs {
configureEach {
systemProperty('neoforge.enabledGameTestNamespaces', mod_id)
ideName = "NeoForge ${it.name.capitalize()} (${project.path})" // Unify the run config names with fabric
ideName = "NeoForge ${it.name.capitalize()} (${project.path})"
}
client {
client()
Expand All @@ -51,124 +47,3 @@ dependencies {
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

//plugins {
// id 'idea'
// id 'maven-publish'
// id 'net.neoforged.gradle.userdev' version '7.0.168'
// id 'java-library'
//}
//
//
//if (System.getenv('BUILD_NUMBER') != null) {
// version += "." + System.getenv('BUILD_NUMBER')
//}
//
//base {
// archivesName = "${mod_id}-neoforge-${minecraft_version}"
//}
//
////jarJar.enable()
//
////archivesBaseName = "${mod_id}-neoforge-${minecraft_version}"
//
///*
//mixin {
// add sourceSets.main, "${mod_id}.refmap.json"
//
// config "${mod_id}.mixins.json"
// config "${mod_id}.forge.mixins.json"
//}
//*/
//
//if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
// minecraft.accessTransformers.file file('src/main/resources/META-INF/accesstransformer.cfg')
//}
//
//runs {
// // applies to all the run configs below
// configureEach {
// systemProperty 'forge.logging.markers', 'REGISTRIES'
// systemProperty 'forge.logging.console.level', 'debug'
// modSource project.sourceSets.main
// }
//
// client {
// // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
// systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
// }
//
// server {
// systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
// programArgument '--nogui'
// }
//
// // This run config launches GameTestServer and runs all registered gametests, then exits.
// // By default, the server will crash when no gametests are provided.
// // The gametest system is also enabled by default for other run configs under the /test command.
// gameTestServer {
// systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
// }
//
// /*
// data {
// // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// // workingDirectory project.file('run-data')
//
// // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
// programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
// }*/
//}
//
//sourceSets.main.resources { srcDir 'src/generated/resources' }
//
//configurations {
// runtimeClasspath.extendsFrom localRuntime
//}
//
//
//tasks.named("test").configure {
// enabled = false
//}
//
//dependencies {
// implementation "net.neoforged:neoforge:${neoforge_version}"
// compileOnly project(":Common")
//
// api "me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}"
// //implementation fg.deobf("net.darkhax.gamestages:GameStages-Forge-1.19.2:11.0.2")
// //implementation fg.deobf("net.darkhax.bookshelf:Bookshelf-Forge-1.19.3:17.0.2")
//}
//
//// NeoGradle compiles the game, but we don't want to add our common code to the game's code
//Spec<Task> notNeoTask = { Task it -> !it.name.startsWith("neo") } as Spec<Task>
//
//tasks.withType(JavaCompile).matching(notNeoTask).configureEach {
// source(project(":Common").sourceSets.main.allSource)
//}
//
//tasks.withType(Javadoc).matching(notNeoTask).configureEach {
// source(project(":Common").sourceSets.main.allJava)
//}
//
//tasks.named("sourcesJar", Jar) {
// from(project(":Common").sourceSets.main.allSource)
//}
//
//tasks.withType(ProcessResources).matching(notNeoTask).configureEach {
// from project(":Common").sourceSets.main.resources
//}
//
//publishing {
// publications {
// mavenJava(MavenPublication) {
// artifactId base.archivesName.get()
// from components.java
// }
// }
// repositories {
// maven {
// url "file://" + System.getenv("local_maven")
// }
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import net.neoforged.neoforge.event.entity.player.PlayerEvent;
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
import net.neoforged.neoforge.event.level.BlockEvent;
import net.neoforged.neoforge.event.level.block.BreakBlockEvent;
import net.neoforged.neoforge.event.tick.ServerTickEvent;
import tschipp.carryon.CarryOnCommon;
import tschipp.carryon.Constants;
Expand Down Expand Up @@ -78,7 +79,7 @@ public static void onBlockClick(PlayerInteractEvent.RightClickBlock event)
CarryOnData carry = CarryOnDataManager.getCarryData(player);
if (!carry.isCarrying()) {
if (PickupHandler.tryPickUpBlock((ServerPlayer) player, pos, level, (pState, pPos) -> {
BlockEvent.BreakEvent breakEvent = new BlockEvent.BreakEvent(level, pPos, pState, player);
BreakBlockEvent breakEvent = new BreakBlockEvent(level, pPos, pState, player);
NeoForge.EVENT_BUS.post(breakEvent);
return !breakEvent.isCanceled();
})) {
Expand Down Expand Up @@ -201,7 +202,7 @@ public static void attackEntity(AttackEntityEvent event)
}

@SubscribeEvent
public static void onBreakBlock(BlockEvent.BreakEvent event)
public static void onBreakBlock(BreakBlockEvent event)
{
if (!CarryOnCommon.onTryBreakBlock(event.getPlayer())) {
event.setCanceled(true);
Expand Down
2 changes: 1 addition & 1 deletion NeoForge/src/main/resources/carryon.neoforge.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "tschipp.carryon.mixin",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_25",
"mixins": [
],
"client": [
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
// see https://fabricmc.net/develop/ for new versions
id 'fabric-loom' version "${loom_version}" apply false
id 'net.fabricmc.fabric-loom' version "${loom_version}" apply false
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
id 'net.neoforged.moddev' version "${mod_dev_version}" apply false
}
}
17 changes: 3 additions & 14 deletions buildSrc/src/main/groovy/multiloader-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,9 @@ repositories {
}
filter { includeGroupAndSubgroups('org.spongepowered') }
}
exclusiveContent {
forRepositories(
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org/'
},
maven {
name = "NeoForge"
url = 'https://maven.neoforged.net/releases'
}
)
filter { includeGroup('org.parchmentmc.data') }
maven {
name = "NeoForge"
url = 'https://maven.neoforged.net/releases'
}
maven {
name = 'BlameJared'
Expand Down Expand Up @@ -97,8 +88,6 @@ processResources {
'description' : project.description,
'neoforge_version' : neoforge_version,
'neoforge_loader_version_range': neoforge_loader_version_range,
"forge_version": forge_version,
"forge_loader_version_range": forge_loader_version_range,
'credits' : credits,
'java_version' : java_version,
'minecraft_version_range_fabric' : minecraft_version_range_fabric,
Expand Down
Loading