Huge update:

include all licenses into the jar file
added old chest model and bounding box in <= b1.7.3
added old furnace bounding box in <= b1.8.1
refactored license management
cleaned up some mixin classes
added old hurt sound in <= b1.7.3
This commit is contained in:
FlorianMichael 2023-03-05 20:34:51 +01:00
parent b1828ba168
commit 54494b4362
51 changed files with 329 additions and 99 deletions

21
LICENSE_GENERAL_MIT Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2023
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -85,7 +85,7 @@ jar {
} {
exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA"
}
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
from("LICENSE") { rename { "${it}_${project.archivesBaseName}" } }
from("LICENSE_multiconnect") { rename { "${it}_${project.archivesBaseName}" } }
from("LICENSE_GENERAL_MIT") { rename { "${it}_${project.archivesBaseName}" } }
}

View File

@ -8,7 +8,7 @@ yarn_mappings=1.19.3+build.5
loader_version=0.14.14
# viafabricplus
mod_version=1.6.1
mod_version=1.7.1
maven_group=de.florianmichael
archives_base_name=viafabricplus
@ -22,7 +22,7 @@ snake_yml_version=2.0
# raphimc libs
vialegacy_version=2.2.8
viaaprilfools_version=2.0.5
viaaprilfools_version=2.0.6
# lenni0451 libs
mcstructs_text_version=2.2.0

View File

@ -0,0 +1,10 @@
package de.florianmichael.viafabricplus.definition;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
public class LegacySounds {
public static final Identifier RANDOM_HURT_ID = new Identifier("viafabricplus", "random.hurt");
public static final SoundEvent RANDOM_HURT = SoundEvent.of(RANDOM_HURT_ID);
}

View File

@ -23,7 +23,7 @@ import java.util.BitSet;
import java.util.List;
@SuppressWarnings("DataFlowIssue")
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
public class ClassicWorldHeightInjection {
public static PacketHandler handleJoinGame(final PacketHandler parentRemapper) {

View File

@ -1,4 +1,4 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
package de.florianmichael.viafabricplus.injection.mixin.fixes;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.client.model.ModelPart;

View File

@ -0,0 +1,25 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.LidOpenable;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.ChestBlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
// Copyright Gaming32 - LICENSE_GENERAL_MIT file
@Mixin(ChestBlockEntityRenderer.class)
public class MixinChestBlockEntityRenderer<T extends BlockEntity & LidOpenable> {
@Inject(method = "render(Lnet/minecraft/block/entity/BlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", at = @At("HEAD"), cancellable = true)
public void dontRender(T entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo ci) {
if (tickDelta != 0 && ViaLoadingBase.getClassWrapper().getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.b1_7tob1_7_3)) {
ci.cancel();
}
}
}

View File

@ -2,6 +2,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes;
import com.mojang.authlib.GameProfile;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
@ -127,4 +128,9 @@ public abstract class MixinClientPlayNetworkHandler {
instance.warn(s, o);
}
}
@Redirect(method = "onServerMetadata", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/s2c/play/ServerMetadataS2CPacket;isSecureChatEnforced()Z"))
public boolean removeSecureChatWarning(ServerMetadataS2CPacket instance) {
return instance.isSecureChatEnforced() || VisualSettings.getClassWrapper().disableSecureChatWarning.getValue();
}
}

View File

@ -1,4 +1,4 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
package de.florianmichael.viafabricplus.injection.mixin.fixes;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.client.render.item.ItemModels;

View File

@ -0,0 +1,39 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.block;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.entity.ChestBlockEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.function.Supplier;
@Mixin(ChestBlock.class)
public abstract class MixinChestBlock extends AbstractChestBlock<ChestBlockEntity> {
protected MixinChestBlock(Settings settings, Supplier<BlockEntityType<? extends ChestBlockEntity>> blockEntityTypeSupplier) {
super(settings, blockEntityTypeSupplier);
}
@Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true)
public void changeShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable<VoxelShape> cir) {
if (ViaLoadingBase.getClassWrapper().getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.r1_4_2)) {
cir.setReturnValue(VoxelShapes.fullCube());
}
}
@Inject(method = "getRenderType", at = @At("HEAD"), cancellable = true)
public void changeRenderType(BlockState state, CallbackInfoReturnable<BlockRenderType> cir) {
if (ViaLoadingBase.getClassWrapper().getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.b1_7tob1_7_3)) {
cir.setReturnValue(BlockRenderType.MODEL);
}
}
}

View File

@ -2,15 +2,24 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.block;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import net.minecraft.block.FenceBlock;
import net.minecraft.block.*;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(FenceBlock.class)
public class MixinFenceBlock {
public class MixinFenceBlock extends HorizontalConnectingBlock {
protected MixinFenceBlock(float radius1, float radius2, float boundingHeight1, float boundingHeight2, float collisionHeight, Settings settings) {
super(radius1, radius2, boundingHeight1, boundingHeight2, collisionHeight, settings);
}
@Inject(method = "onUse", at = @At("HEAD"), cancellable = true)
private void injectOnUse(CallbackInfoReturnable<ActionResult> ci) {
@ -18,4 +27,15 @@ public class MixinFenceBlock {
ci.setReturnValue(ActionResult.SUCCESS);
}
}
@Unique
private static final VoxelShape viafabricplus_fence_shape_b1_8_1 = Block.createCuboidShape(0, 0, 0, 16, 32, 16);
@Override
public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
if (ViaLoadingBase.getClassWrapper().getTargetVersion().isOlderThan(LegacyProtocolVersion.r1_0_0tor1_0_1)) {
return viafabricplus_fence_shape_b1_8_1;
}
return super.getCollisionShape(state, world, pos, context);
}
}

View File

@ -2,9 +2,11 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.entity;
import com.mojang.authlib.GameProfile;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.viafabricplus.definition.v1_8_x.ArmorPointsDefinition;
import de.florianmichael.viafabricplus.definition.v1_8_x.IdlePacketExecutor;
import de.florianmichael.viafabricplus.injection.access.IClientPlayerEntity;
import de.florianmichael.viafabricplus.settings.groups.DebugSettings;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.input.Input;
@ -186,6 +188,14 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
}
}
@Override
public int getArmor() {
if (VisualSettings.getClassWrapper().emulateArmorHud.getValue()) {
return ArmorPointsDefinition.sum();
}
return super.getArmor();
}
@Override
public void viafabricplus_cancelSwingOnce() {
protocolhack_areSwingCanceledThisTick = true;

View File

@ -1,13 +1,17 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.entity;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.viafabricplus.definition.LegacySounds;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityPose;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.sound.SoundEvent;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@ -80,4 +84,12 @@ public abstract class MixinPlayerEntity extends LivingEntity {
ci.setReturnValue(1f);
}
}
// Copyright Gaming32 - LICENSE_GENERAL_MIT file
@Inject(method = "getHurtSound", at = @At("HEAD"), cancellable = true)
public void replaceSound(DamageSource source, CallbackInfoReturnable<SoundEvent> cir) {
if (VisualSettings.getClassWrapper().replaceHurtSoundWithOOFSound.getValue()) {
cir.setReturnValue(LegacySounds.RANDOM_HURT);
}
}
}

View File

@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
// Copyright Earthcomputer - MIT LICENSE
// Copyright (c) 2019 Joseph Burton (Earthcomputer) - LICENSE_multiconnect file
@Mixin(BlockItem.class)
public class MixinBlockItem {

View File

@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
// Copyright Earthcomputer - MIT LICENSE
// Copyright (c) 2019 Joseph Burton (Earthcomputer) - LICENSE_multiconnect file
@Mixin(HeldItemRenderer.class)
public class MixinHeldItemRenderer {

View File

@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
// Copyright Earthcomputer - MIT LICENSE
// Copyright (c) 2019 Joseph Burton (Earthcomputer) - LICENSE_multiconnect file
@Mixin(ItemPlacementContext.class)
public class MixinItemPlacementContext {

View File

@ -13,7 +13,7 @@ import net.minecraft.util.UseAction;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
// Copyright Earthcomputer - MIT LICENSE
// Copyright (c) 2019 Joseph Burton (Earthcomputer) - LICENSE_multiconnect file
@Mixin(SwordItem.class)
public class MixinSwordItem extends ToolItem {

View File

@ -1,12 +1,16 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.screen;
import de.florianmichael.viafabricplus.definition.ChatLengthDefinition;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.gui.hud.MessageIndicator;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.gui.widget.TextFieldWidget;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ChatScreen.class)
@ -18,4 +22,12 @@ public class MixinChatScreen {
public void changeChatLength(CallbackInfo ci) {
this.chatField.setMaxLength(ChatLengthDefinition.getMaxLength());
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;getIndicatorAt(DD)Lnet/minecraft/client/gui/hud/MessageIndicator;"))
public MessageIndicator removeIndicator(ChatHud instance, double mouseX, double mouseY) {
if (VisualSettings.getClassWrapper().hideSignatureIndicator.getValue()) {
return null;
}
return instance.getIndicatorAt(mouseX, mouseY);
}
}

View File

@ -1,4 +1,4 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
package de.florianmichael.viafabricplus.injection.mixin.fixes.screen;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.block.entity.CommandBlockBlockEntity;

View File

@ -1,4 +1,4 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
package de.florianmichael.viafabricplus.injection.mixin.fixes.screen;
import de.florianmichael.viafabricplus.definition.c0_30.ClassicItemSelectionScreen;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;

View File

@ -1,4 +1,4 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
package de.florianmichael.viafabricplus.injection.mixin.fixes.screen;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.block.entity.JigsawBlockEntity;

View File

@ -1,4 +1,4 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
package de.florianmichael.viafabricplus.injection.mixin.fixes.screen.hud;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.client.gui.hud.ChatHud;

View File

@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.HashMap;
import java.util.Map;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = ProtocolVersion.class, remap = false)
public abstract class MixinProtocolVersion {

View File

@ -13,7 +13,7 @@ import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = ChatItemRewriter.class, remap = false)
public abstract class MixinChatItemRewriter {

View File

@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = WorldPackets.class, remap = false)
public abstract class MixinWorldPackets1_13 {

View File

@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = WorldPackets.class, remap = false)
public abstract class MixinWorldPackets_2 {

View File

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@SuppressWarnings({"unchecked", "rawtypes"})
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = EntityPackets.class, remap = false)
public abstract class MixinEntityPackets1_17 {

View File

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@SuppressWarnings({"unchecked", "rawtypes"})
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = WorldPackets.class, remap = false)
public abstract class MixinWorldPackets1_17 {

View File

@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@SuppressWarnings("DataFlowIssue")
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = Protocol1_18_2To1_18.class, remap = false)
public class MixinProtocol1_18_2To1_18 extends AbstractProtocol<ClientboundPackets1_18, ClientboundPackets1_18, ServerboundPackets1_17, ServerboundPackets1_17> {

View File

@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.ArrayList;
import java.util.logging.Level;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = Chunk1_8Type.class, remap = false)
public abstract class MixinChunk1_8Type {

View File

@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(targets = "com.viaversion.viaversion.protocols.protocol1_9to1_8.packets.EntityPackets$6$1", remap = false)
public abstract class MixinEntityPackets_6_1 {

View File

@ -7,7 +7,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = EntityTracker1_9.class, remap = false)
public abstract class MixinEntityTracker1_9 {

View File

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
// Copyright RaphiMC/RK_01 - GPL v3 LICENSE
// Copyright RaphiMC/RK_01 - LICENSE file
@Mixin(value = MetadataRewriter1_9To1_8.class, remap = false)
public abstract class MixinMetadataRewriter1_9To1_8 {

View File

@ -1,21 +0,0 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.gui.hud.MessageIndicator;
import net.minecraft.client.gui.screen.ChatScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ChatScreen.class)
public class MixinChatScreen {
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;getIndicatorAt(DD)Lnet/minecraft/client/gui/hud/MessageIndicator;"))
public MessageIndicator removeIndicator(ChatHud instance, double mouseX, double mouseY) {
if (VisualSettings.getClassWrapper().hideSignatureIndicator.getValue()) {
return null;
}
return instance.getIndicatorAt(mouseX, mouseY);
}
}

View File

@ -1,17 +0,0 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.packet.s2c.play.ServerMetadataS2CPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ClientPlayNetworkHandler.class)
public class MixinClientPlayNetworkHandler {
@Redirect(method = "onServerMetadata", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/s2c/play/ServerMetadataS2CPacket;isSecureChatEnforced()Z"))
public boolean removeSecureChatWarning(ServerMetadataS2CPacket instance) {
return instance.isSecureChatEnforced() || VisualSettings.getClassWrapper().disableSecureChatWarning.getValue();
}
}

View File

@ -1,25 +0,0 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.visual;
import com.mojang.authlib.GameProfile;
import de.florianmichael.viafabricplus.definition.v1_8_x.ArmorPointsDefinition;
import de.florianmichael.viafabricplus.settings.groups.VisualSettings;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.world.ClientWorld;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(ClientPlayerEntity.class)
public class MixinClientPlayerEntity extends AbstractClientPlayerEntity {
public MixinClientPlayerEntity(ClientWorld world, GameProfile profile) {
super(world, profile);
}
@Override
public int getArmor() {
if (VisualSettings.getClassWrapper().emulateArmorHud.getValue()) {
return ArmorPointsDefinition.sum();
}
return super.getArmor();
}
}

View File

@ -25,6 +25,9 @@ public class VisualSettings extends SettingGroup {
public final ProtocolSyncBooleanSetting emulateArmorHud = new ProtocolSyncBooleanSetting(this, "Emulate Armor hud", ProtocolRange.andOlder(ProtocolVersion.v1_8));
public final ProtocolSyncBooleanSetting removeNewerFeaturesFromCommandBlockScreen = new ProtocolSyncBooleanSetting(this, "Remove newer features from Command block screen", ProtocolRange.andOlder(ProtocolVersion.v1_8));
// r1_0_0tor1_0_1 -> b1_8tob1_8_1
public final ProtocolSyncBooleanSetting replaceHurtSoundWithOOFSound = new ProtocolSyncBooleanSetting(this, "Replace hurt sound with OOF sound", ProtocolRange.andOlder(LegacyProtocolVersion.b1_8tob1_8_1));
// a1_0_15 -> c0_28toc0_30
public final ProtocolSyncBooleanSetting replaceCreativeInventory = new ProtocolSyncBooleanSetting(this, "Replace creative inventory", ProtocolRange.andOlder(LegacyProtocolVersion.c0_28toc0_30));
public final ProtocolSyncBooleanSetting oldWalkingAnimation = new ProtocolSyncBooleanSetting(this, "Old walking animation", ProtocolRange.andOlder(LegacyProtocolVersion.c0_28toc0_30));

View File

@ -0,0 +1,55 @@
{
"variants": {
"type=single": {
"model": "viafabricplus:block/chest_single"
},
"type=left,facing=south": {
"model": "viafabricplus:block/chest_right",
"rotation": {
"y": -90
}
},
"type=left,facing=east": {
"model": "viafabricplus:block/chest_right",
"rotation": {
"y": -90
}
},
"type=left,facing=north": {
"model": "viafabricplus:block/chest_right",
"rotation": {
"y": 180
}
},
"type=left,facing=west": {
"model": "viafabricplus:block/chest_right",
"rotation": {
"y": 90
}
},
"type=right,facing=south": {
"model": "viafabricplus:block/chest_left",
"rotation": {
"y": -90
}
},
"type=right,facing=east": {
"model": "viafabricplus:block/chest_left",
"rotation": {
"y": -90
}
},
"type=right,facing=north": {
"model": "viafabricplus:block/chest_left",
"rotation": {
"y": 180
}
},
"type=right,facing=west": {
"model": "viafabricplus:block/chest_left",
"rotation": {
"y": 90
}
}
}
}

View File

@ -0,0 +1,24 @@
{
"credit": "Gaming32",
"textures": {
"0": "viafabricplus:block/chest_end",
"1": "viafabricplus:block/chest_left_front",
"2": "viafabricplus:block/chest_single_side",
"3": "viafabricplus:block/chest_left_back",
"particle": "viafabricplus:block/chest_end"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#3"},
"east": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"south": {"uv": [0, 0, 16, 16], "texture": "#1"},
"west": {"uv": [0, 0, 16, 16], "texture": "#2"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,24 @@
{
"credit": "Gaming32",
"textures": {
"0": "viafabricplus:block/chest_right_front",
"1": "viafabricplus:block/chest_end",
"2": "viafabricplus:block/chest_single_side",
"3": "viafabricplus:block/chest_right_back",
"particle": "viafabricplus:block/chest_end"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#3"},
"east": {"uv": [0, 0, 16, 16], "texture": "#2"},
"south": {"uv": [0, 0, 16, 16], "texture": "#0"},
"west": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
}
}
]
}

View File

@ -0,0 +1,23 @@
{
"credit": "Gaming32",
"textures": {
"0": "viafabricplus:block/chest_end",
"1": "viafabricplus:block/chest_single_front",
"2": "viafabricplus:block/chest_single_side",
"particle": "viafabricplus:block/chest_end"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#2"},
"east": {"uv": [0, 0, 16, 16], "texture": "#2"},
"south": {"uv": [0, 0, 16, 16], "texture": "#1"},
"west": {"uv": [0, 0, 16, 16], "texture": "#2"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,7 @@
{
"random.hurt": {
"sounds": [
"viafabricplus:random/hurt"
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

View File

@ -30,6 +30,7 @@
"fixes.block.MixinBlockView",
"fixes.block.MixinBrewingStandBlock",
"fixes.block.MixinCauldronBlock",
"fixes.block.MixinChestBlock",
"fixes.block.MixinEndPortalBlock",
"fixes.block.MixinEndPortalFrameBlock",
"fixes.block.MixinFarmlandBlock",
@ -129,18 +130,19 @@
"defaultRequire": 1
},
"client": [
"bridge.MixinOptionsScreen",
"bridge.MixinConnectScreen",
"bridge.MixinDownloadingTerrainScreen",
"bridge.MixinOptionsScreen",
"fixes.MixinChestBlockEntityRenderer",
"fixes.screen.MixinChatScreen",
"fixes.visual.MixinBipedEntityModel",
"fixes.visual.MixinChatHud",
"fixes.MixinBipedEntityModel",
"fixes.screen.hud.MixinChatHud",
"fixes.visual.MixinChatScreen",
"fixes.visual.MixinClientPlayerEntity",
"fixes.visual.MixinClientPlayNetworkHandler",
"fixes.visual.MixinCommandBlockScreen",
"fixes.visual.MixinCreativeInventoryScreen",
"fixes.visual.MixinItemRenderer",
"fixes.visual.MixinJigsawBlockScreen"
"fixes.screen.MixinCommandBlockScreen",
"fixes.screen.MixinCreativeInventoryScreen",
"fixes.MixinItemRenderer",
"fixes.screen.MixinJigsawBlockScreen"
]
}