added missing licenses and fixed namings

This commit is contained in:
FlorianMichael 2023-02-20 01:57:03 +01:00
parent b717818911
commit c5461964be
51 changed files with 616 additions and 125 deletions

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition;
import com.mojang.bridge.game.PackType;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_14_4;
import com.viaversion.viaversion.api.connection.StoredObject;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_0;
public record MessageMetadataModel(String plain, long timestamp, long salt) {

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_0;
import de.florianmichael.viafabricplus.definition.v1_19_0.model.SignatureUpdatableModel;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_0.model;
public interface SignatureUpdatableModel {

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_0.model;
public interface SignatureUpdaterModel {

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_0.provider;
import com.viaversion.viaversion.api.platform.providers.Provider;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_0.storage;
import com.viaversion.viaversion.api.connection.StoredObject;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_0.storage;
import com.viaversion.viaversion.api.connection.UserConnection;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_2;
import com.google.common.hash.Hashing;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_2;
import de.florianmichael.viafabricplus.definition.v1_19_0.model.SignatureUpdaterModel;
@ -6,14 +27,7 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.UUID;
public class MessageHeaderModel {
private final UUID sender;
private final byte[] precedingSignature;
public MessageHeaderModel(UUID sender, byte[] precedingSignature) {
this.sender = sender;
this.precedingSignature = precedingSignature;
}
public record MessageHeaderModel(UUID sender, byte[] precedingSignature) {
public byte[] toByteArray(final UUID uuid) {
final byte[] data = new byte[16];
@ -30,15 +44,7 @@ public class MessageHeaderModel {
updater.update(precedingSignature);
}
updater.update(toByteArray(getSender()));
updater.update(toByteArray(sender()));
updater.update(bodyDigest);
}
public UUID getSender() {
return sender;
}
public byte[] getPrecedingSignature() {
return precedingSignature;
}
}

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.definition.v1_19_2.storage;
import com.viaversion.viaversion.api.connection.UserConnection;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.injection.access;
public interface IClientConnection {

View File

@ -1,6 +1,27 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.injection.access;
public interface IClientPlayerEntity {
void protocolhack_cancelSwingOnce();
void viafabricplus_cancelSwingOnce();
}

View File

@ -1,7 +1,28 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.injection.access;
public interface IMinecraftClient {
void protocolhack_trackKeyboardInteraction(final Runnable interaction);
void protocolhack_trackMouseInteraction(final Runnable interaction);
void viafabricplus_trackKeyboardInteraction(final Runnable interaction);
void viafabricplus_trackMouseInteraction(final Runnable interaction);
}

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.injection.access;
import com.viaversion.viaversion.api.type.Type;
@ -7,5 +28,5 @@ import java.util.Deque;
public interface IPacketWrapperImpl {
Deque<Pair<Type<?>, Object>> ep$readableObjects();
Deque<Pair<Type<?>, Object>> viafabricplus_readableObjects();
}

View File

@ -1,10 +1,30 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.injection.access;
import java.nio.ByteBuffer;
public interface IPublicKeyData {
ByteBuffer protocolhack_get1_19_0Key();
void protocolhack_set1_19_0Key(final ByteBuffer oldKey);
ByteBuffer viafabricplus_get1_19_0Key();
void viafabricplus_set1_19_0Key(final ByteBuffer oldKey);
}

View File

@ -1,6 +1,27 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.injection.access;
public interface IScreenHandler {
short protocolhack_getAndIncrementLastActionId();
short viafabricplus_getAndIncrementLastActionId();
}

View File

@ -24,6 +24,7 @@ package de.florianmichael.viafabricplus.injection.mixin.base;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.connection.UserConnectionImpl;
import com.viaversion.viaversion.protocol.ProtocolPipelineImpl;
import de.florianmichael.viafabricplus.ViaFabricPlus;
import de.florianmichael.vialoadingbase.netty.CustomViaDecodeHandler;
import de.florianmichael.vialoadingbase.netty.CustomViaEncodeHandler;
import de.florianmichael.vialoadingbase.netty.NettyConstants;
@ -49,6 +50,7 @@ public class MixinClientConnection_1 {
if (channel instanceof SocketChannel) {
// Creating the user connection
final UserConnection user = new UserConnectionImpl(channel, true);
channel.attr(ViaFabricPlus.LOCAL_USER_CONNECTION).set(user);
// Creating the pipeline
new ProtocolPipelineImpl(user);

View File

@ -76,7 +76,7 @@ public abstract class MixinClientPlayerInteractionManager {
private void injectAttackEntity(PlayerEntity player, Entity target, CallbackInfo ci) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && player instanceof IClientPlayerEntity) {
player.swingHand(Hand.MAIN_HAND);
((IClientPlayerEntity) player).protocolhack_cancelSwingOnce();
((IClientPlayerEntity) player).viafabricplus_cancelSwingOnce();
}
}
@ -119,7 +119,7 @@ public abstract class MixinClientPlayerInteractionManager {
clickSlotPacket.write(Type.SHORT, (short) clickSlot.getSlot());
clickSlotPacket.write(Type.BYTE, (byte) clickSlot.getButton());
assert client.player != null;
clickSlotPacket.write(Type.SHORT, ((IScreenHandler) client.player.currentScreenHandler).protocolhack_getAndIncrementLastActionId());
clickSlotPacket.write(Type.SHORT, ((IScreenHandler) client.player.currentScreenHandler).viafabricplus_getAndIncrementLastActionId());
clickSlotPacket.write(Type.VAR_INT, clickSlot.getActionType().ordinal());
clickSlotPacket.write(Type.FLAT_VAR_INT_ITEM, ItemTranslator.minecraftToViaVersion(clickSlotPacket.user(), slotItemBeforeModification, ProtocolVersion.v1_16.getVersion()));

View File

@ -138,12 +138,12 @@ public abstract class MixinMinecraftClient implements IMinecraftClient {
}
@Override
public void protocolhack_trackKeyboardInteraction(Runnable interaction) {
public void viafabricplus_trackKeyboardInteraction(Runnable interaction) {
this.protocolhack_keyboardInteractions.add(interaction);
}
@Override
public void protocolhack_trackMouseInteraction(Runnable interaction) {
public void viafabricplus_trackMouseInteraction(Runnable interaction) {
this.protocolhack_mouseInteractions.add(interaction);
}
}

View File

@ -35,12 +35,12 @@ public class MixinPlayerPublicKey_PublicKeyData implements IPublicKeyData {
private ByteBuffer protocolhack_1_19_0Key;
@Override
public ByteBuffer protocolhack_get1_19_0Key() {
public ByteBuffer viafabricplus_get1_19_0Key() {
return protocolhack_1_19_0Key;
}
@Override
public void protocolhack_set1_19_0Key(ByteBuffer byteBuffer) {
public void viafabricplus_set1_19_0Key(ByteBuffer byteBuffer) {
this.protocolhack_1_19_0Key = byteBuffer;
}
}

View File

@ -35,6 +35,6 @@ public class MixinProfileKeysImpl {
@Inject(method = "decodeKeyPairResponse", at = @At("RETURN"))
private static void trackLegacyKey(KeyPairResponse keyPairResponse, CallbackInfoReturnable<PlayerPublicKey.PublicKeyData> cir) {
((IPublicKeyData) (Object) cir.getReturnValue()).protocolhack_set1_19_0Key(keyPairResponse.getLegacyPublicKeySignature());
((IPublicKeyData) (Object) cir.getReturnValue()).viafabricplus_set1_19_0Key(keyPairResponse.getLegacyPublicKeySignature());
}
}

View File

@ -42,7 +42,7 @@ public abstract class MixinAbstractBlock_AbstractBlockState {
protected abstract BlockState asBlockState();
@Inject(method = "getHardness", at = @At("RETURN"), cancellable = true)
public void injectGetHardness(BlockView world, BlockPos pos, CallbackInfoReturnable<Float> cir) {
public void changeHardness(BlockView world, BlockPos pos, CallbackInfoReturnable<Float> cir) {
final BlockState state = this.asBlockState();
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {

View File

@ -44,9 +44,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinAnvilBlock {
@Unique
private static final VoxelShape protocolhack_X_AXIS_SHAPE_1_12_2 = Block.createCuboidShape(0, 0, 2, 16, 16, 14);
private static final VoxelShape viafabricplus_x_axis_shape_v1_12_2 = Block.createCuboidShape(0, 0, 2, 16, 16, 14);
@Unique
private static final VoxelShape protocolhack_Z_AXIS_SHAPE_1_12_2 = Block.createCuboidShape(2, 0, 0, 14, 16, 16);
private static final VoxelShape viafabricplus_z_axis_shape_v1_12_2 = Block.createCuboidShape(2, 0, 0, 14, 16, 16);
@Shadow
@Final
public static DirectionProperty FACING;
@ -54,7 +56,7 @@ public class MixinAnvilBlock {
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
cir.setReturnValue(state.get(FACING).getAxis() == Direction.Axis.X ? protocolhack_X_AXIS_SHAPE_1_12_2 : protocolhack_Z_AXIS_SHAPE_1_12_2);
cir.setReturnValue(state.get(FACING).getAxis() == Direction.Axis.X ? viafabricplus_x_axis_shape_v1_12_2 : viafabricplus_z_axis_shape_v1_12_2);
}
}
}

View File

@ -42,7 +42,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinBedBlock {
@Unique
private final static VoxelShape protocolhack_BED_SHAPE_1_13_2 = Block.createCuboidShape(0, 0, 0, 16, 9, 16);
private final static VoxelShape viafabricplus_bed_shape_v1_13_2 = Block.createCuboidShape(0, 0, 0, 16, 9, 16);
@Inject(method = "bounceEntity", at = @At("HEAD"), cancellable = true)
public void injectBounceEntity(Entity entity, CallbackInfo ci) {
@ -55,7 +55,7 @@ public class MixinBedBlock {
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getClassWrapper() != null) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) {
cir.setReturnValue(protocolhack_BED_SHAPE_1_13_2);
cir.setReturnValue(viafabricplus_bed_shape_v1_13_2);
}
}
}

View File

@ -41,7 +41,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinBrewingStandBlock {
@Unique
private static final VoxelShape protocolhack_BASE_SHAPE_1_12_2 = VoxelShapes.union(
private static final VoxelShape viafabricplus_base_shape_v1_12_2 = VoxelShapes.union(
Block.createCuboidShape(0, 0, 0, 16, 2, 16) /* Base */,
Block.createCuboidShape(7, 0, 7, 9, 14, 9) /* Stick */
);
@ -49,7 +49,7 @@ public class MixinBrewingStandBlock {
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
cir.setReturnValue(protocolhack_BASE_SHAPE_1_12_2);
cir.setReturnValue(viafabricplus_base_shape_v1_12_2);
}
}
}

View File

@ -40,7 +40,7 @@ import java.util.Map;
public abstract class MixinCauldronBlock extends AbstractCauldronBlock {
@Unique
private final static VoxelShape protocolhack_CAULDRON_SHAPE_1_12_2 = VoxelShapes.combineAndSimplify(
private final static VoxelShape viafabricplus_cauldron_shape_v1_12_2 = VoxelShapes.combineAndSimplify(
VoxelShapes.fullCube(),
Block.createCuboidShape(2.0D, 5.0D, 2.0D, 14.0D, 16.0D, 14.0D),
BooleanBiFunction.ONLY_FIRST
@ -53,7 +53,7 @@ public abstract class MixinCauldronBlock extends AbstractCauldronBlock {
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
return protocolhack_CAULDRON_SHAPE_1_12_2;
return viafabricplus_cauldron_shape_v1_12_2;
}
return super.getOutlineShape(state, world, pos, context);
}

View File

@ -43,10 +43,10 @@ public abstract class MixinEndPortalBlock extends BlockWithEntity {
@Final
protected static VoxelShape SHAPE;
@Unique
private final VoxelShape protocolhack_SHAPE_1_8 = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 1.0, 16.0);
private final VoxelShape viafabricplus_shape_v1_8_x = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 1.0, 16.0);
@Unique
private final VoxelShape protocolhack_SHAPE_1_16_5 = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 12.0, 16.0);
private final VoxelShape viafabricplus_shape_v1_16_5 = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 12.0, 16.0);
protected MixinEndPortalBlock(Settings settings) {
super(settings);
@ -57,10 +57,10 @@ public abstract class MixinEndPortalBlock extends BlockWithEntity {
if (MinecraftClient.getInstance() == null || MinecraftClient.getInstance().world == null) return;
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) {
cir.setReturnValue(protocolhack_SHAPE_1_8);
cir.setReturnValue(viafabricplus_shape_v1_8_x);
}
else if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) {
cir.setReturnValue(protocolhack_SHAPE_1_16_5);
cir.setReturnValue(viafabricplus_shape_v1_16_5);
}
}

View File

@ -44,12 +44,12 @@ public class MixinEndPortalFrameBlock {
@Final
protected static VoxelShape FRAME_WITH_EYE_SHAPE;
@Unique
private final VoxelShape protocolhack_EYE_SHAPE_1_12_2 = Block.createCuboidShape(5.0, 13.0, 5.0, 11.0, 16.0, 11.0);
private final VoxelShape viafabricplus_eye_shape_v1_12_2 = Block.createCuboidShape(5.0, 13.0, 5.0, 11.0, 16.0, 11.0);
@Redirect(method = "getOutlineShape", at = @At(value = "FIELD", target = "Lnet/minecraft/block/EndPortalFrameBlock;FRAME_WITH_EYE_SHAPE:Lnet/minecraft/util/shape/VoxelShape;"))
public VoxelShape redirectGetOutlineShape() {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
return VoxelShapes.union(FRAME_SHAPE, protocolhack_EYE_SHAPE_1_12_2);
return VoxelShapes.union(FRAME_SHAPE, viafabricplus_eye_shape_v1_12_2);
}
return FRAME_WITH_EYE_SHAPE;
}

View File

@ -43,7 +43,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinFarmlandBlock extends Block {
@Unique
private static final VoxelShape protocolhack_SHAPE_1_9_4 = VoxelShapes.fullCube();
private static final VoxelShape viafabricplus_shape_v1_9_4 = VoxelShapes.fullCube();
@Shadow
@Final
protected static VoxelShape SHAPE;
@ -55,7 +55,7 @@ public class MixinFarmlandBlock extends Block {
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_9_3)) {
cir.setReturnValue(protocolhack_SHAPE_1_9_4);
cir.setReturnValue(viafabricplus_shape_v1_9_4);
}
}

View File

@ -42,25 +42,25 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinHopperBlock {
@Unique
private final static VoxelShape protocolhack_INSIDE_SHAPE_1_12_2 = Block.createCuboidShape(2, 10, 2, 14, 16, 14);
private final static VoxelShape viafabricplus_inside_shape_v1_12_2 = Block.createCuboidShape(2, 10, 2, 14, 16, 14);
@Unique
private final static VoxelShape protocolhack_HOPPER_SHAPE_1_12_2 = VoxelShapes.combineAndSimplify(
private final static VoxelShape viafabricplus_hopper_shape_v1_12_2 = VoxelShapes.combineAndSimplify(
VoxelShapes.fullCube(),
protocolhack_INSIDE_SHAPE_1_12_2,
viafabricplus_inside_shape_v1_12_2,
BooleanBiFunction.ONLY_FIRST);
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
cir.setReturnValue(protocolhack_HOPPER_SHAPE_1_12_2);
cir.setReturnValue(viafabricplus_hopper_shape_v1_12_2);
}
}
@Inject(method = "getRaycastShape", at = @At("HEAD"), cancellable = true)
public void injectGetRaycastShape(BlockState state, BlockView world, BlockPos pos, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
cir.setReturnValue(protocolhack_INSIDE_SHAPE_1_12_2);
cir.setReturnValue(viafabricplus_inside_shape_v1_12_2);
}
}
}

View File

@ -40,25 +40,25 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinLadderBlock {
@Unique
private static final VoxelShape protocolhack_EAST_SHAPE_1_8 = Block.createCuboidShape(0, 0, 0, 2, 16, 16);
private static final VoxelShape viafabricplus_east_shape_v1_8_x = Block.createCuboidShape(0, 0, 0, 2, 16, 16);
@Unique
private static final VoxelShape protocolhack_WEST_SHAPE_1_8 = Block.createCuboidShape(14, 0, 0, 16, 16, 16);
private static final VoxelShape viafabricplus_west_shape_v1_8_x = Block.createCuboidShape(14, 0, 0, 16, 16, 16);
@Unique
private static final VoxelShape protocolhack_SOUTH_SHAPE_1_8 = Block.createCuboidShape(0, 0, 0, 16, 16, 2);
private static final VoxelShape viafabricplus_south_shape_v1_8_x = Block.createCuboidShape(0, 0, 0, 16, 16, 2);
@Unique
private static final VoxelShape protocolhack_NORTH_SHAPE_1_8 = Block.createCuboidShape(0, 0, 14, 16, 16, 16);
private static final VoxelShape viafabricplus_north_shape_v1_8_x = Block.createCuboidShape(0, 0, 14, 16, 16, 16);
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
private void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> ci) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) {
switch (state.get(LadderBlock.FACING)) {
case NORTH -> ci.setReturnValue(protocolhack_NORTH_SHAPE_1_8);
case SOUTH -> ci.setReturnValue(protocolhack_SOUTH_SHAPE_1_8);
case WEST -> ci.setReturnValue(protocolhack_WEST_SHAPE_1_8);
default -> ci.setReturnValue(protocolhack_EAST_SHAPE_1_8);
case NORTH -> ci.setReturnValue(viafabricplus_north_shape_v1_8_x);
case SOUTH -> ci.setReturnValue(viafabricplus_south_shape_v1_8_x);
case WEST -> ci.setReturnValue(viafabricplus_west_shape_v1_8_x);
default -> ci.setReturnValue(viafabricplus_east_shape_v1_8_x);
}
}
}

View File

@ -40,12 +40,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinLilyPadBlock {
@Unique
private static final VoxelShape protocolhack_SHAPE_1_8 = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 0.015625D /* 1 / 64 */ * 16, 16.0D);
private static final VoxelShape viafabricplus_shape_v1_8_x = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 0.015625D /* 1 / 64 */ * 16, 16.0D);
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void changeBoundingBox(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) {
cir.setReturnValue(protocolhack_SHAPE_1_8);
cir.setReturnValue(viafabricplus_shape_v1_8_x);
}
}
}

View File

@ -55,22 +55,22 @@ public class MixinPaneBlock extends HorizontalConnectingBlock {
}
@Unique
private final VoxelShape protocolhack_WEST_SHAPE_1_8 = Block.createCuboidShape(0, 0, 7, 8, 16, 9);
private final VoxelShape viafabricplus_west_shape_v1_8_x = Block.createCuboidShape(0, 0, 7, 8, 16, 9);
@Unique
private final VoxelShape protocolhack_EAST_SHAPE_1_8 = Block.createCuboidShape(8, 0, 7, 16, 16, 9);
private final VoxelShape viafabricplus_east_shape_v1_8_x = Block.createCuboidShape(8, 0, 7, 16, 16, 9);
@Unique
private final VoxelShape protocolhack_WEST_EAST_COMBINED_SHAPE_1_8 = Block.createCuboidShape(0, 0, 7, 16, 16, 9);
private final VoxelShape viafabricplus_west_east_combined_shape_v1_8_x = Block.createCuboidShape(0, 0, 7, 16, 16, 9);
@Unique
private final VoxelShape protocolhack_NORTH_SHAPE_1_8 = Block.createCuboidShape(7, 0, 0, 9, 16, 8);
private final VoxelShape viafabricplus_north_shape_v1_8_x = Block.createCuboidShape(7, 0, 0, 9, 16, 8);
@Unique
private final VoxelShape protocolhack_SOUTH_SHAPE_1_8 = Block.createCuboidShape(7, 0, 8, 9, 16, 16);
private final VoxelShape viafabricplus_south_shape_v1_8_x = Block.createCuboidShape(7, 0, 8, 9, 16, 16);
@Unique
private final VoxelShape protocolhack_NORTH_SOUTH_COMBINED_SHAPE_1_8 = Block.createCuboidShape(7, 0, 0, 9, 16, 16);
private final VoxelShape viafabricplus_north_south_combined_shape_v1_8_x = Block.createCuboidShape(7, 0, 0, 9, 16, 16);
@Unique
public VoxelShape protocolhack_get1_8Shape(BlockState state) {
@ -83,19 +83,19 @@ public class MixinPaneBlock extends HorizontalConnectingBlock {
if ((!isWestFacing || !isEastFacing) && (isWestFacing || isEastFacing || isNorthFacing || isSouthFacing)) {
if (isWestFacing)
finalShape = VoxelShapes.union(finalShape, protocolhack_WEST_SHAPE_1_8);
finalShape = VoxelShapes.union(finalShape, viafabricplus_west_shape_v1_8_x);
else if (isEastFacing)
finalShape = VoxelShapes.union(finalShape, protocolhack_EAST_SHAPE_1_8);
finalShape = VoxelShapes.union(finalShape, viafabricplus_east_shape_v1_8_x);
} else
finalShape = VoxelShapes.union(finalShape, protocolhack_WEST_EAST_COMBINED_SHAPE_1_8);
finalShape = VoxelShapes.union(finalShape, viafabricplus_west_east_combined_shape_v1_8_x);
if ((!isNorthFacing || !isSouthFacing) && (isWestFacing || isEastFacing || isNorthFacing || isSouthFacing)) {
if (isNorthFacing)
finalShape = VoxelShapes.union(finalShape, protocolhack_NORTH_SHAPE_1_8);
finalShape = VoxelShapes.union(finalShape, viafabricplus_north_shape_v1_8_x);
else if (isSouthFacing)
finalShape = VoxelShapes.union(finalShape, protocolhack_SOUTH_SHAPE_1_8);
finalShape = VoxelShapes.union(finalShape, viafabricplus_south_shape_v1_8_x);
} else
finalShape = VoxelShapes.union(finalShape, protocolhack_NORTH_SOUTH_COMBINED_SHAPE_1_8);
finalShape = VoxelShapes.union(finalShape, viafabricplus_north_south_combined_shape_v1_8_x);
return finalShape;
}

View File

@ -45,78 +45,76 @@ public class MixinPistonHeadBlock extends FacingBlock {
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2))
cir.setReturnValue(getCoreShape_1_8(state));
cir.setReturnValue(viafabricplus_getCoreShape_v1_8_x(state));
}
@Override
public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8))
return VoxelShapes.union(getHeadShape_1_8(state), getCoreShape_1_8(state));
return VoxelShapes.union(viafabricplus_getHeadShape_v1_8_x(state), viafabricplus_getCoreShape_v1_8_x(state));
return super.getCollisionShape(state, world, pos, context);
}
@Unique
private final VoxelShape protocolhack_CORE_DOWN_SHAPE_1_8 = Block.createCuboidShape(6, 4, 6, 10, 16, 10);
private final VoxelShape viafabricplus_core_down_shape_v1_8_x = Block.createCuboidShape(6, 4, 6, 10, 16, 10);
@Unique
private final VoxelShape protocolhack_CORE_UP_SHAPE_1_8 = Block.createCuboidShape(6, 0, 6, 10, 12, 10);
private final VoxelShape viafabricplus_core_up_shape_v1_8_x = Block.createCuboidShape(6, 0, 6, 10, 12, 10);
@Unique
private final VoxelShape protocolhack_CORE_NORTH_SHAPE_1_8 = Block.createCuboidShape(4, 6, 4, 12, 10, 16);
private final VoxelShape viafabricplus_core_north_shape_v1_8_x = Block.createCuboidShape(4, 6, 4, 12, 10, 16);
@Unique
private final VoxelShape protocolhack_CORE_SOUTH_SHAPE_1_8 = Block.createCuboidShape(4, 6, 0, 12, 10, 12);
private final VoxelShape viafabricplus_core_south_shape_v1_8_x = Block.createCuboidShape(4, 6, 0, 12, 10, 12);
@Unique
private final VoxelShape protocolhack_CORE_WEST_SHAPE_1_8 = Block.createCuboidShape(6, 4, 4, 10, 12, 16);
private final VoxelShape viafabricplus_core_west_shape_v1_8_x = Block.createCuboidShape(6, 4, 4, 10, 12, 16);
@Unique
private final VoxelShape protocolhack_CORE_EAST_SHAPE_1_8 = Block.createCuboidShape(0, 6, 4, 12, 10, 12);
private final VoxelShape viafabricplus_core_east_shape_v1_8_x = Block.createCuboidShape(0, 6, 4, 12, 10, 12);
@Unique
private VoxelShape getCoreShape_1_8(BlockState state) {
private VoxelShape viafabricplus_getCoreShape_v1_8_x(BlockState state) {
final Direction direction = state.get(FACING);
return switch (direction) {
case DOWN -> protocolhack_CORE_DOWN_SHAPE_1_8;
case UP -> protocolhack_CORE_UP_SHAPE_1_8;
case NORTH -> protocolhack_CORE_NORTH_SHAPE_1_8;
case SOUTH -> protocolhack_CORE_SOUTH_SHAPE_1_8;
case WEST -> protocolhack_CORE_WEST_SHAPE_1_8;
case EAST -> protocolhack_CORE_EAST_SHAPE_1_8;
case DOWN -> viafabricplus_core_down_shape_v1_8_x;
case UP -> viafabricplus_core_up_shape_v1_8_x;
case NORTH -> viafabricplus_core_north_shape_v1_8_x;
case SOUTH -> viafabricplus_core_south_shape_v1_8_x;
case WEST -> viafabricplus_core_west_shape_v1_8_x;
case EAST -> viafabricplus_core_east_shape_v1_8_x;
};
}
@Unique
private final VoxelShape protocolhack_HEAD_DOWN_SHAPE_1_8 = Block.createCuboidShape(0, 0, 0, 16, 4, 16);
private final VoxelShape viafabricplus_head_down_shape_v1_8_x = Block.createCuboidShape(0, 0, 0, 16, 4, 16);
@Unique
private final VoxelShape protocolhack_HEAD_UP_SHAPE_1_8 = Block.createCuboidShape(0, 12, 0, 16, 16, 16);
private final VoxelShape viafabricplus_head_up_shape_v1_8_x = Block.createCuboidShape(0, 12, 0, 16, 16, 16);
@Unique
private final VoxelShape protocolhack_HEAD_NORTH_SHAPE_1_8 = Block.createCuboidShape(0, 0, 0, 16, 16, 4);
private final VoxelShape viafabricplus_head_north_shape_v1_8_x = Block.createCuboidShape(0, 0, 0, 16, 16, 4);
@Unique
private final VoxelShape protocolhack_HEAD_SOUTH_SHAPE_1_8 = Block.createCuboidShape(0, 0, 12, 16, 16, 16);
private final VoxelShape viafabricplus_head_south_shape_v1_8_x = Block.createCuboidShape(0, 0, 12, 16, 16, 16);
@Unique
private final VoxelShape protocolhack_HEAD_WEST_SHAPE_1_8 = Block.createCuboidShape(0, 0, 0, 4, 16, 16);
private final VoxelShape viafabricplus_head_west_shape_v1_8_x = Block.createCuboidShape(0, 0, 0, 4, 16, 16);
@Unique
private final VoxelShape protocolhack_HEAD_EAST_SHAPE_1_8 = Block.createCuboidShape(12, 0, 0, 16, 16, 16);
private final VoxelShape viafabricplus_head_east_shape_v1_8_x = Block.createCuboidShape(12, 0, 0, 16, 16, 16);
@Unique
private VoxelShape getHeadShape_1_8(BlockState state) {
final Direction direction = state.get(FACING);
return switch (direction) {
case DOWN -> protocolhack_HEAD_DOWN_SHAPE_1_8;
case UP -> protocolhack_HEAD_UP_SHAPE_1_8;
case NORTH -> protocolhack_HEAD_NORTH_SHAPE_1_8;
case SOUTH -> protocolhack_HEAD_SOUTH_SHAPE_1_8;
case WEST -> protocolhack_HEAD_WEST_SHAPE_1_8;
case EAST -> protocolhack_HEAD_EAST_SHAPE_1_8;
private VoxelShape viafabricplus_getHeadShape_v1_8_x(BlockState state) {
return switch (state.get(FACING)) {
case DOWN -> viafabricplus_head_down_shape_v1_8_x;
case UP -> viafabricplus_head_up_shape_v1_8_x;
case NORTH -> viafabricplus_head_north_shape_v1_8_x;
case SOUTH -> viafabricplus_head_south_shape_v1_8_x;
case WEST -> viafabricplus_head_west_shape_v1_8_x;
case EAST -> viafabricplus_head_east_shape_v1_8_x;
};
}
}

View File

@ -43,7 +43,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinSnowBlock {
@Unique
private static final VoxelShape[] protocolhack_LAYERS_TO_SHAPE_1_12_2 = new VoxelShape[]{
private static final VoxelShape[] viafabricplus_layers_to_shape_v1_12_2 = new VoxelShape[]{
Block.createCuboidShape(0, -0.00001 /* Bypass for Minecraft-Fixes */, 0, 16, 0, 16),
Block.createCuboidShape(0, 0, 0, 16, 2, 16),
Block.createCuboidShape(0, 0, 0, 16, 4, 16),
@ -61,7 +61,7 @@ public class MixinSnowBlock {
@Inject(method = "getCollisionShape", at = @At("HEAD"), cancellable = true)
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
cir.setReturnValue(protocolhack_LAYERS_TO_SHAPE_1_12_2[state.get(LAYERS) - 1]);
cir.setReturnValue(viafabricplus_layers_to_shape_v1_12_2[state.get(LAYERS) - 1]);
}
}
}

View File

@ -47,7 +47,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class MixinWallBlock extends Block {
@Unique
private static final VoxelShape[] protocolhack_SHAPE_BY_INDEX_1_12_2 = new VoxelShape[]{
private static final VoxelShape[] viafabricplus_shape_by_index_v1_12_2 = new VoxelShape[]{
Block.createCuboidShape(4, 0, 4, 12, 16, 12),
Block.createCuboidShape(4, 0, 4, 12, 16, 16),
Block.createCuboidShape(0, 0, 4, 12, 16, 12),
@ -69,8 +69,9 @@ public class MixinWallBlock extends Block {
Block.createCuboidShape(0, 0, 0, 16, 16, 12),
Block.createCuboidShape(0, 0, 0, 16, 16, 16)
};
@Unique
private static final VoxelShape[] protocolhack_CLIP_SHAPE_BY_INDEX_1_12_2 = new VoxelShape[]{
private static final VoxelShape[] viafabricplus_cip_shape_by_index_v1_12_2 = new VoxelShape[]{
Block.createCuboidShape(4, 0, 4, 12, 24, 12),
Block.createCuboidShape(4, 0, 4, 12, 24, 16),
Block.createCuboidShape(0, 0, 4, 12, 24, 12),
@ -109,7 +110,7 @@ public class MixinWallBlock extends Block {
}
@Unique
private static BlockState protocolhack_oldWallPlacementLogic(BlockState state) {
private static BlockState viafabricplus_oldWallPlacementLogic(BlockState state) {
boolean addUp = false;
if (state.get(WallBlock.NORTH_SHAPE) == WallShape.TALL) {
state = state.with(WallBlock.NORTH_SHAPE, WallShape.LOW);
@ -134,7 +135,7 @@ public class MixinWallBlock extends Block {
}
@Unique
private static int protocolhack_getShapeIndex_1122(BlockState state) {
private static int viafabricplus_getShapeIndex_v1_12_2(BlockState state) {
int i = 0;
if (state.get(NORTH_SHAPE) != WallShape.NONE) i |= 1 << Direction.NORTH.getHorizontal();
@ -148,28 +149,28 @@ public class MixinWallBlock extends Block {
@Inject(method = "getPlacementState", at = @At("RETURN"), cancellable = true)
public void injectGetPlacementState(ItemPlacementContext ctx, CallbackInfoReturnable<BlockState> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
cir.setReturnValue(protocolhack_oldWallPlacementLogic(cir.getReturnValue()));
cir.setReturnValue(viafabricplus_oldWallPlacementLogic(cir.getReturnValue()));
}
}
@Inject(method = "getStateForNeighborUpdate", at = @At("RETURN"), cancellable = true)
public void injectGetStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos, CallbackInfoReturnable<BlockState> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
cir.setReturnValue(protocolhack_oldWallPlacementLogic(cir.getReturnValue()));
cir.setReturnValue(viafabricplus_oldWallPlacementLogic(cir.getReturnValue()));
}
}
@Inject(method = "getCollisionShape", at = @At("HEAD"), cancellable = true)
public void injectGetCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
cir.setReturnValue(protocolhack_CLIP_SHAPE_BY_INDEX_1_12_2[protocolhack_getShapeIndex_1122(state)]);
cir.setReturnValue(viafabricplus_cip_shape_by_index_v1_12_2[viafabricplus_getShapeIndex_v1_12_2(state)]);
}
}
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
cir.setReturnValue(protocolhack_SHAPE_BY_INDEX_1_12_2[protocolhack_getShapeIndex_1122(state)]);
cir.setReturnValue(viafabricplus_shape_by_index_v1_12_2[viafabricplus_getShapeIndex_v1_12_2(state)]);
}
}
}

View File

@ -205,7 +205,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
}
@Override
public void protocolhack_cancelSwingOnce() {
public void viafabricplus_cancelSwingOnce() {
protocolhack_areSwingCanceledThisTick = true;
}
}

View File

@ -42,7 +42,7 @@ public class MixinKeyboard {
@Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;execute(Ljava/lang/Runnable;)V"))
public void redirectSync(MinecraftClient instance, Runnable runnable) {
if (ValueHolder.executeInputsInSync.getValue()) {
((IMinecraftClient) client).protocolhack_trackKeyboardInteraction(runnable);
((IMinecraftClient) client).viafabricplus_trackKeyboardInteraction(runnable);
return;
}

View File

@ -39,7 +39,7 @@ public class MixinMouse {
@Redirect(method = { "method_29615", "method_22685", "method_22684" }, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;execute(Ljava/lang/Runnable;)V"))
public void redirectSync(MinecraftClient instance, Runnable runnable) {
if (ValueHolder.executeInputsInSync.getValue()) {
((IMinecraftClient) client).protocolhack_trackMouseInteraction(runnable);
((IMinecraftClient) client).viafabricplus_trackMouseInteraction(runnable);
return;
}

View File

@ -94,7 +94,7 @@ public class MixinConnectScreen_1 {
userConnection.put(new ChatSession1_19_2(userConnection, profileKey, playerKeyPair.privateKey()));
if (ViaLoadingBase.getTargetVersion() == ProtocolVersion.v1_19) {
final byte[] legacyKey = ((IPublicKeyData) (Object) publicKeyData).protocolhack_get1_19_0Key().array();
final byte[] legacyKey = ((IPublicKeyData) (Object) publicKeyData).viafabricplus_get1_19_0Key().array();
if (legacyKey != null) {
userConnection.put(new ChatSession1_19_0(userConnection, profileKey, playerKeyPair.privateKey(), legacyKey));
} else {

View File

@ -60,7 +60,7 @@ public class MixinScreenHandler implements IScreenHandler {
}
@Override
public short protocolhack_getAndIncrementLastActionId() {
public short viafabricplus_getAndIncrementLastActionId() {
return ++protocolhack_lastActionId;
}
}

View File

@ -15,7 +15,7 @@ public class MixinPacketWrapperImpl implements IPacketWrapperImpl {
@Shadow @Final private Deque<Pair<Type<?>, Object>> readableObjects;
@Override
public Deque<Pair<Type<?>, Object>> ep$readableObjects() {
public Deque<Pair<Type<?>, Object>> viafabricplus_readableObjects() {
return this.readableObjects;
}
}

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.platform;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;

View File

@ -61,6 +61,6 @@ public class ItemTranslator {
throw new RuntimeException(e);
}
return (Item) ((IPacketWrapperImpl) wrapper).ep$readableObjects().stream().filter(typeObjectPair -> Item.class.equals(typeObjectPair.key().getOutputClass())).findFirst().orElse(null).value();
return (Item) ((IPacketWrapperImpl) wrapper).viafabricplus_readableObjects().stream().filter(typeObjectPair -> Item.class.equals(typeObjectPair.key().getOutputClass())).findFirst().orElse(null).value();
}
}

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.value;
public abstract class AbstractValue<T> {

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.value;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.value.impl;
import de.florianmichael.viafabricplus.value.AbstractValue;

View File

@ -1,3 +1,24 @@
/**
* --FLORIAN MICHAEL PRIVATE LICENCE v1.2--
*
* This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD),
* any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this
* file / project is prohibited. It requires in that use a written permission with official signature of the owner
* "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not
* cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected.
* The owner "Florian Michael" is free to change this license. The creator assumes no responsibility for any infringements
* that have arisen, are arising or will arise from this project / file. If this licence is used anywhere,
* the latest version published by the author Florian Michael (aka EnZaXD) always applies automatically.
*
* Changelog:
* v1.0:
* Added License
* v1.1:
* Ownership withdrawn
* v1.2:
* Version-independent validity and automatic renewal
*/
package de.florianmichael.viafabricplus.value.impl;
import de.florianmichael.viafabricplus.platform.ProtocolRange;