Initial work on 1.21.9
This commit is contained in:
parent
ece3ed7ff2
commit
8d8e0dad82
|
|
@ -108,6 +108,8 @@ public class CarryOnCommon
|
||||||
|
|
||||||
public static void onCarryTick(ServerPlayer player)
|
public static void onCarryTick(ServerPlayer player)
|
||||||
{
|
{
|
||||||
|
//TODO: Remove
|
||||||
|
System.out.println(player.getGameProfile());
|
||||||
CarryOnData carry = CarryOnDataManager.getCarryData(player);
|
CarryOnData carry = CarryOnDataManager.getCarryData(player);
|
||||||
if(carry.isCarrying())
|
if(carry.isCarrying())
|
||||||
{
|
{
|
||||||
|
|
@ -115,7 +117,7 @@ public class CarryOnCommon
|
||||||
{
|
{
|
||||||
String cmd = carry.getActiveScript().get().scriptEffects().commandLoop();
|
String cmd = carry.getActiveScript().get().scriptEffects().commandLoop();
|
||||||
if(!cmd.isEmpty())
|
if(!cmd.isEmpty())
|
||||||
player.getServer().getCommands().performPrefixedCommand(player.getServer().createCommandSourceStack(), "/execute as " + player.getGameProfile().getName() + " run " + cmd);
|
player.level().getServer().getCommands().performPrefixedCommand(player.level().getServer().createCommandSourceStack(), "/execute as " + player.getGameProfile() + " run " + cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
Inventory inv = player.getInventory();
|
Inventory inv = player.getInventory();
|
||||||
|
|
@ -153,7 +155,7 @@ public class CarryOnCommon
|
||||||
|
|
||||||
public static void onPlayerAttacked(Player player)
|
public static void onPlayerAttacked(Player player)
|
||||||
{
|
{
|
||||||
if (Constants.COMMON_CONFIG.settings.dropCarriedWhenHit && !player.level().isClientSide)
|
if (Constants.COMMON_CONFIG.settings.dropCarriedWhenHit && !player.level().isClientSide())
|
||||||
{
|
{
|
||||||
CarryOnData carry = CarryOnDataManager.getCarryData(player);
|
CarryOnData carry = CarryOnDataManager.getCarryData(player);
|
||||||
if (carry.isCarrying())
|
if (carry.isCarrying())
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@
|
||||||
package tschipp.carryon;
|
package tschipp.carryon;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.input.MouseButtonEvent;
|
||||||
|
import net.minecraft.client.input.MouseButtonInfo;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||||
import tschipp.carryon.common.carry.CarryOnData;
|
import tschipp.carryon.common.carry.CarryOnData;
|
||||||
|
|
@ -49,7 +51,7 @@ public class CarryOnCommonClient
|
||||||
private static boolean checkMouse()
|
private static boolean checkMouse()
|
||||||
{
|
{
|
||||||
Minecraft mc = Minecraft.getInstance();
|
Minecraft mc = Minecraft.getInstance();
|
||||||
return (CarryOnKeybinds.carryKey.matchesMouse(0) && mc.mouseHandler.isLeftPressed()) || (CarryOnKeybinds.carryKey.matchesMouse(1) && mc.mouseHandler.isRightPressed()) || (CarryOnKeybinds.carryKey.matchesMouse(3) && mc.mouseHandler.isMiddlePressed());
|
return (CarryOnKeybinds.carryKey.matchesMouse(new MouseButtonEvent(0,0, new MouseButtonInfo(0,0))) && mc.mouseHandler.isLeftPressed()) || (CarryOnKeybinds.carryKey.matchesMouse(new MouseButtonEvent(0,0, new MouseButtonInfo(1,0))) || CarryOnKeybinds.carryKey.matchesMouse(new MouseButtonEvent(0,0, new MouseButtonInfo(3,0))) && mc.mouseHandler.isMiddlePressed());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onCarryClientTick()
|
public static void onCarryClientTick()
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,12 @@ import net.minecraft.client.KeyMapping;
|
||||||
|
|
||||||
public class ConflictFreeKeyMapping extends KeyMapping
|
public class ConflictFreeKeyMapping extends KeyMapping
|
||||||
{
|
{
|
||||||
public ConflictFreeKeyMapping(String $$0, int $$1, String $$2)
|
public ConflictFreeKeyMapping(String $$0, int $$1, Category $$2)
|
||||||
{
|
{
|
||||||
super($$0, $$1, $$2);
|
super($$0, $$1, $$2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConflictFreeKeyMapping(String $$0, Type $$1, int $$2, String $$3)
|
public ConflictFreeKeyMapping(String $$0, Type $$1, int $$2, Category $$3)
|
||||||
{
|
{
|
||||||
super($$0, $$1, $$2, $$3);
|
super($$0, $$1, $$2, $$3);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ public class CarriedObjectRender
|
||||||
|
|
||||||
ItemStack renderStack = CarryRenderHelper.getRenderItemStack(player);
|
ItemStack renderStack = CarryRenderHelper.getRenderItemStack(player);
|
||||||
Minecraft.getInstance().getItemModelResolver().updateForTopItem(renderState, renderStack, ItemDisplayContext.NONE, player.level(), null, 0);
|
Minecraft.getInstance().getItemModelResolver().updateForTopItem(renderState, renderStack, ItemDisplayContext.NONE, player.level(), null, 0);
|
||||||
renderState.render(matrix, buffer, light, OverlayTexture.NO_OVERLAY);
|
renderState.submit(matrix, buffer, light, OverlayTexture.NO_OVERLAY);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ public final class Matchables
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(ServerPlayer player)
|
public boolean matches(ServerPlayer player)
|
||||||
{
|
{
|
||||||
ServerAdvancementManager manager = player.getServer().getAdvancements();
|
ServerAdvancementManager manager = player.level().getServer().getAdvancements();
|
||||||
AdvancementHolder adv = manager.get(ResourceLocation.parse(advancement.isEmpty() ? "" : advancement));
|
AdvancementHolder adv = manager.get(ResourceLocation.parse(advancement.isEmpty() ? "" : advancement));
|
||||||
|
|
||||||
boolean achievement = adv == null ? true : player.getAdvancements().getOrStartProgress(adv).isDone();
|
boolean achievement = adv == null ? true : player.getAdvancements().getOrStartProgress(adv).isDone();
|
||||||
|
|
@ -167,7 +167,7 @@ public final class Matchables
|
||||||
if (cond == null || cond.isEmpty())
|
if (cond == null || cond.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Scoreboard score = player.getScoreboard();
|
Scoreboard score = player.level().getScoreboard();
|
||||||
String numb;
|
String numb;
|
||||||
String scorename;
|
String scorename;
|
||||||
int iE = cond.indexOf("=");
|
int iE = cond.indexOf("=");
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
package tschipp.carryon.mixin;
|
package tschipp.carryon.mixin;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.state.PlayerRenderState;
|
import net.minecraft.client.renderer.entity.state.AvatarRenderState;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import tschipp.carryon.client.render.ICarryOnRenderState;
|
import tschipp.carryon.client.render.ICarryOnRenderState;
|
||||||
import tschipp.carryon.common.carry.CarryOnData;
|
import tschipp.carryon.common.carry.CarryOnData;
|
||||||
|
|
||||||
@Mixin(PlayerRenderState.class)
|
@Mixin(AvatarRenderState.class)
|
||||||
public class PlayerRenderStateMixin implements ICarryOnRenderState {
|
public class AvatarRenderStateMixin implements ICarryOnRenderState {
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
public CarryOnData carryOnData = null;
|
public CarryOnData carryOnData = null;
|
||||||
|
|
@ -23,7 +23,7 @@ package tschipp.carryon.mixin;
|
||||||
import net.minecraft.client.model.HumanoidModel;
|
import net.minecraft.client.model.HumanoidModel;
|
||||||
import net.minecraft.client.model.geom.ModelPart;
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
import net.minecraft.client.renderer.entity.state.HumanoidRenderState;
|
import net.minecraft.client.renderer.entity.state.HumanoidRenderState;
|
||||||
import net.minecraft.client.renderer.entity.state.PlayerRenderState;
|
import net.minecraft.client.renderer.entity.state.AvatarRenderState;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
"client": [
|
"client": [
|
||||||
"HumanoidModelMixin",
|
"HumanoidModelMixin",
|
||||||
"MinecraftMixin",
|
"MinecraftMixin",
|
||||||
"PlayerRenderStateMixin",
|
"AvatarRenderStateMixin",
|
||||||
"EntityRendererMixin"
|
"EntityRendererMixin"
|
||||||
],
|
],
|
||||||
"server": [
|
"server": [
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'multiloader-loader'
|
id 'multiloader-loader'
|
||||||
id 'fabric-loom' version '1.10-SNAPSHOT'
|
id 'fabric-loom' version '1.11-SNAPSHOT'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
// see https://fabricmc.net/develop/ for new versions
|
// see https://fabricmc.net/develop/ for new versions
|
||||||
id 'fabric-loom' version '1.10-SNAPSHOT' apply false
|
id 'fabric-loom' version '1.11-SNAPSHOT' apply false
|
||||||
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
|
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
|
||||||
id 'net.neoforged.moddev' version "${mod_dev_version}" apply false
|
id 'net.neoforged.moddev' version "${mod_dev_version}" apply false
|
||||||
}
|
}
|
||||||
|
|
@ -1,36 +1,36 @@
|
||||||
# Project
|
# Project
|
||||||
version=2.7.0
|
version=2.8.0
|
||||||
group=tschipp.carryon
|
group=tschipp.carryon
|
||||||
|
|
||||||
# Common
|
# Common
|
||||||
minecraft_version=1.21.8
|
minecraft_version=1.21.9
|
||||||
mod_name=Carry On
|
mod_name=Carry On
|
||||||
mod_author=Tschipp, PurpliciousCow
|
mod_author=Tschipp, PurpliciousCow
|
||||||
mod_id=carryon
|
mod_id=carryon
|
||||||
license=GNU LGPLv3
|
license=GNU LGPLv3
|
||||||
credits=
|
credits=
|
||||||
description=Carry On is a simple mod that improves game interaction by allowing players to pick up, carry, and place single block Tile Entities using only their empty hands.
|
description=Carry On is a simple mod that improves game interaction by allowing players to pick up, carry, and place single block Tile Entities using only their empty hands.
|
||||||
minecraft_version_range=[1.21.8, 1.22)
|
minecraft_version_range=[1.21.9, 1.22)
|
||||||
neo_form_version=1.21.8-20250717.133445
|
neo_form_version=1.21.9-20250930.151910
|
||||||
java_version=21
|
java_version=21
|
||||||
parchment_version=2025.07.20
|
parchment_version=2025.10.05
|
||||||
mod_dev_version=2.0.107
|
mod_dev_version=2.0.115
|
||||||
# Forge
|
# Forge
|
||||||
forge_version=58.0.10
|
forge_version= 59.0.5
|
||||||
forge_loader_version_range=[57,)
|
forge_loader_version_range=[59,)
|
||||||
parchment_mappings=2025.07.20-1.21.8
|
parchment_mappings=2025.10.05-1.21.9
|
||||||
//forge_ats_enabled=true
|
//forge_ats_enabled=true
|
||||||
|
|
||||||
# Fabric
|
# Fabric
|
||||||
fabric_version=0.132.0+1.21.8
|
fabric_version=0.134.0+1.21.9
|
||||||
fabric_loader_version=0.17.2
|
fabric_loader_version=0.17.3
|
||||||
parchment_mappings_fabric=1.21.8:2025.07.20
|
parchment_mappings_fabric=1.21.9:2025.10.05
|
||||||
|
|
||||||
# Neoforge
|
# Neoforge
|
||||||
neoforge_version=21.8.36
|
neoforge_version=21.9.16-beta
|
||||||
neoforge_loader_version_range=[4,)
|
neoforge_loader_version_range=[4,)
|
||||||
neogradle.subsystems.parchment.minecraftVersion=1.21.8
|
neogradle.subsystems.parchment.minecraftVersion=1.21.9
|
||||||
neogradle.subsystems.parchment.mappingsVersion=2025.07.20
|
neogradle.subsystems.parchment.mappingsVersion=2025.10.05
|
||||||
|
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
|
|
@ -38,4 +38,4 @@ org.gradle.jvmargs=-Xmx3G
|
||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
|
|
||||||
mixinextras_version=0.3.6
|
mixinextras_version=0.3.6
|
||||||
cloth_config_version=19.0.147
|
cloth_config_version=20.0.149
|
||||||
|
|
@ -13,6 +13,7 @@ pluginManagement {
|
||||||
filter {
|
filter {
|
||||||
includeGroup('net.fabricmc')
|
includeGroup('net.fabricmc')
|
||||||
includeGroup('fabric-loom')
|
includeGroup('fabric-loom')
|
||||||
|
includeGroup('net.fabricmc.unpick')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exclusiveContent {
|
exclusiveContent {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user