Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.21.4] Allow modded BE and Entity types to declare that they have NBT data only OPs can set #1730

Merged
merged 4 commits into from
Dec 21, 2024

Conversation

XFactHD
Copy link
Member

@XFactHD XFactHD commented Dec 4, 2024

In 1.21.4, onlyOpsCanSetNbt() was moved from BlockEntity and Entity to BlockEntityType and EntityType respectively and changed to check a hard-coded set.
This PR allows modded BE and Entity types to declare that they have op-only NBT data (such as signs) without having to modify the set. Instead the flag can be provided through the constructor or builder respectively.

@XFactHD XFactHD added enhancement New (or improvement to existing) feature or request 1.21.4 Targeted at Minecraft 1.21.4 labels Dec 4, 2024
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Dec 4, 2024

  • Publish PR to GitHub Packages

Last commit published: 526c2adf3342f8ee467b4548f244f173f92c3978.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #1730' // https://github.com/neoforged/NeoForge/pull/1730
        url 'https://prmaven.neoforged.net/NeoForge/pr1730'
        content {
            includeModule('net.neoforged', 'testframework')
            includeModule('net.neoforged', 'neoforge')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1730.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1730
cd NeoForge-pr1730
curl -L https://prmaven.neoforged.net/NeoForge/pr1730/net/neoforged/neoforge/21.4.35-beta-pr-1730-op_only_blockentities/mdk-pr1730.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@XFactHD XFactHD requested a review from embeddedt December 9, 2024 02:22
Copy link
Member

@embeddedt embeddedt left a comment

Choose a reason for hiding this comment

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

Actually thinking about it again, the adjustment of our patched-in constructor, while cleaner, is technically a BC we might have to announce... requesting changes on this to block a merge until we decide what to do about that.

@XFactHD XFactHD changed the title [1.21.4] Allow modded BE types to declare that they have NBT data only OPs can set [1.21.4] Allow modded BE and Entity types to declare that they have NBT data only OPs can set Dec 17, 2024
@neoforged-compatibility-checks

@XFactHD, this PR introduces breaking changes.
Fortunately, this project is currently accepting breaking changes, but if they are not intentional, please revert them.
Last checked commit: 526c2adf3342f8ee467b4548f244f173f92c3978.

neoforge (:neoforge)

  • net/minecraft/world/entity/EntityType
    • <init>(Lnet/minecraft/world/entity/EntityType$EntityFactory;Lnet/minecraft/world/entity/MobCategory;ZZZZLcom/google/common/collect/ImmutableSet;Lnet/minecraft/world/entity/EntityDimensions;FIILjava/lang/String;Ljava/util/Optional;Lnet/minecraft/world/flag/FeatureFlagSet;Ljava/util/function/Predicate;Ljava/util/function/ToIntFunction;Ljava/util/function/ToIntFunction;)V: ❗ API method was removed

@marchermans marchermans merged commit 56ca361 into neoforged:1.21.x Dec 21, 2024
6 checks passed
@XFactHD XFactHD deleted the op_only_blockentities branch December 21, 2024 19:16
@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.4.36-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.4 Targeted at Minecraft 1.21.4 enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants