mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-28 12:56:51 +01:00
More fixes
This commit is contained in:
parent
02136f09a9
commit
4df5265a2b
@ -109,19 +109,20 @@ public final class RecipeInfo {
|
||||
}
|
||||
|
||||
final int height = shape.size();
|
||||
final DefaultedList<Ingredient> ingredients = DefaultedList.of();
|
||||
final DefaultedList<Optional<Ingredient>> ingredients = DefaultedList.of();
|
||||
for (String row : shape) {
|
||||
for (int x = 0; x < width; x++) {
|
||||
final char key = row.charAt(x);
|
||||
Ingredient ingredient = legend.get(key);
|
||||
if (ingredient == null) {
|
||||
if (key == ' ') {
|
||||
ingredient = Ingredient.EMPTY;
|
||||
ingredients.add(Optional.empty());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown character in shape: " + key);
|
||||
}
|
||||
} else {
|
||||
ingredients.add(Optional.of(ingredient));
|
||||
}
|
||||
ingredients.add(ingredient);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class EnchantmentAttributesEmulation1_20_6 {
|
||||
// Update generic attributes for all entities
|
||||
for (Entity entity : world.getEntities()) {
|
||||
if (entity.isLogicalSideForUpdatingMovement() && entity instanceof LivingEntity livingEntity) {
|
||||
livingEntity.getAttributeInstance(EntityAttributes.GENERIC_WATER_MOVEMENT_EFFICIENCY).setBaseValue(getEquipmentLevel(Enchantments.DEPTH_STRIDER, livingEntity) / 3F);
|
||||
livingEntity.getAttributeInstance(EntityAttributes.WATER_MOVEMENT_EFFICIENCY).setBaseValue(getEquipmentLevel(Enchantments.DEPTH_STRIDER, livingEntity) / 3F);
|
||||
setGenericMovementEfficiencyAttribute(livingEntity);
|
||||
}
|
||||
}
|
||||
|
@ -34,9 +34,9 @@ public abstract class MixinKeyboardInput extends Input {
|
||||
@ModifyVariable(method = "tick", at = @At(value = "LOAD", ordinal = 0), argsOnly = true)
|
||||
private boolean changeSneakSlowdownCondition(boolean slowDown) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_13_2)) {
|
||||
return this.sneaking;
|
||||
return this.playerInput.sneak();
|
||||
} else if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_14_4)) {
|
||||
return !MinecraftClient.getInstance().player.isSpectator() && (this.sneaking || slowDown);
|
||||
return !MinecraftClient.getInstance().player.isSpectator() && (this.playerInput.sneak() || slowDown);
|
||||
} else {
|
||||
return slowDown;
|
||||
}
|
||||
|
@ -147,10 +147,10 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
|
||||
@Inject(method = "tickMovement()V",
|
||||
slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isCamera()Z")),
|
||||
at = @At(value = "FIELD", target = "Lnet/minecraft/client/input/Input;sneaking:Z", ordinal = 0))
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/util/PlayerInput;sneak()Z", ordinal = 0))
|
||||
private void injectTickMovement(CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_14_4)) {
|
||||
if (this.input.sneaking) {
|
||||
if (this.input.playerInput.sneak()) {
|
||||
this.input.movementSideways = (float) ((double) this.input.movementSideways / 0.3D);
|
||||
this.input.movementForward = (float) ((double) this.input.movementForward / 0.3D);
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@Mixin(FireworkRocketItem.class)
|
||||
public abstract class MixinFireworkRocketItem {
|
||||
|
||||
@Redirect(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isFallFlying()Z", ordinal = 0))
|
||||
@Redirect(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isGliding()Z", ordinal = 0))
|
||||
private boolean disableFireworkElytraBoost(PlayerEntity player) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThan(ProtocolVersion.v1_11) && player.isFallFlying();
|
||||
return ProtocolTranslator.getTargetVersion().newerThan(ProtocolVersion.v1_11) && player.isGliding();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public abstract class MixinItemRenderer {
|
||||
@Inject(method = "getModel(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)Lnet/minecraft/client/render/model/BakedModel;", at = @At("HEAD"), cancellable = true)
|
||||
private void removeModel(ItemStack stack, World world, LivingEntity entity, int seed, CallbackInfoReturnable<BakedModel> cir) {
|
||||
if (VisualSettings.global().replacePetrifiedOakSlab.isEnabled() && world != null /* world is null in gui rendering */ && stack.isOf(Items.PETRIFIED_OAK_SLAB)) {
|
||||
cir.setReturnValue(this.models.getModelManager().getMissingModel());
|
||||
cir.setReturnValue(this.models.getModel(ItemStack.EMPTY));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.attribute.AttributeContainer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.vehicle.BoatEntity;
|
||||
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
@ -222,7 +222,7 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
|
||||
}
|
||||
|
||||
@SuppressWarnings({"InvalidInjectorMethodSignature"})
|
||||
@ModifyConstant(method = "onEntityPassengersSet", constant = @Constant(classValue = BoatEntity.class))
|
||||
@ModifyConstant(method = "onEntityPassengersSet", constant = @Constant(classValue = AbstractBoatEntity.class))
|
||||
private Class<?> dontChangeYawWhenMountingBoats(Object entity, Class<?> boatClass) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_18)) {
|
||||
return Integer.class; // Dummy class file to false the instanceof check
|
||||
|
Loading…
Reference in New Issue
Block a user