mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-25 06:27:41 +01:00
Bringing the Cheat
- Clipboards now validate their data item #6928 - Backport #6911
This commit is contained in:
parent
4d466efe80
commit
5905e8bc93
4 changed files with 5 additions and 3 deletions
|
@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
|
|||
org.gradle.daemon = false
|
||||
|
||||
# mod version info
|
||||
mod_version = 0.5.1.h
|
||||
mod_version = 0.5.1.i
|
||||
artifact_minecraft_version = 1.18.2
|
||||
|
||||
minecraft_version = 1.18.2
|
||||
|
|
|
@ -61,7 +61,7 @@ public class Create {
|
|||
|
||||
public static final String ID = "create";
|
||||
public static final String NAME = "Create";
|
||||
public static final String VERSION = "0.5.1h";
|
||||
public static final String VERSION = "0.5.1i";
|
||||
|
||||
public static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
|
|
|
@ -68,6 +68,8 @@ public class ClipboardBlockEntity extends SmartBlockEntity {
|
|||
protected void read(CompoundTag tag, boolean clientPacket) {
|
||||
super.read(tag, clientPacket);
|
||||
dataContainer = ItemStack.of(tag.getCompound("Item"));
|
||||
if (!AllBlocks.CLIPBOARD.isIn(dataContainer))
|
||||
dataContainer = AllBlocks.CLIPBOARD.asStack();
|
||||
|
||||
if (clientPacket)
|
||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> readClientSide(tag));
|
||||
|
|
|
@ -21,7 +21,7 @@ public class BlockItemMixin {
|
|||
@Inject(method = "place", at = @At("HEAD"), cancellable = true)
|
||||
private void create$fixDeployerPlacement(BlockPlaceContext pContext, CallbackInfoReturnable<InteractionResult> cir) {
|
||||
BlockState state = pContext.getLevel().getBlockState(((UseOnContextAccessor) pContext).create$getHitResult().getBlockPos());
|
||||
if (!state.canBeReplaced() && pContext.getPlayer() instanceof DeployerFakePlayer) {
|
||||
if (!state.getMaterial().isReplaceable() && pContext.getPlayer() instanceof DeployerFakePlayer) {
|
||||
cir.setReturnValue(InteractionResult.PASS);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue