mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-02 08:59:31 +01:00
removed unused Code
This commit is contained in:
parent
42d8a36990
commit
dc769fe3d8
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
|
||||
* Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.mob.PathAwareEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.raphimc.vialoader.util.VersionEnum;
|
||||
import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
|
||||
import net.minecraft.entity.passive.AllayEntity;
|
||||
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;
|
||||
|
||||
@Mixin(AllayEntity.class)
|
||||
public abstract class MixinAllayEntity extends PathAwareEntity {
|
||||
|
||||
protected MixinAllayEntity(EntityType<? extends PathAwareEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
@Inject(method = "getUnscaledRidingOffset", at = @At("HEAD"), cancellable = true)
|
||||
public void changeHeightOffset(CallbackInfoReturnable<Float> cir) {
|
||||
final var ver = ProtocolHack.getTargetVersion();
|
||||
|
||||
if (ver.isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) {
|
||||
cir.setReturnValue(ver.isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2) ? 0.0F : 0.4F);
|
||||
}
|
||||
}
|
||||
}
|
@ -133,11 +133,4 @@ public abstract class MixinPlayerEntity extends LivingEntity {
|
||||
}
|
||||
return instance.isSprinting();
|
||||
}
|
||||
|
||||
@Inject(method = "getUnscaledRidingOffset", at = @At("HEAD"), cancellable = true)
|
||||
public void setStaticScale(Entity vehicle, CallbackInfoReturnable<Float> cir) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) {
|
||||
cir.setReturnValue(-0.35F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,6 @@
|
||||
"fixes.minecraft.block.MixinSugarCaneBlock",
|
||||
"fixes.minecraft.block.MixinWallBlock",
|
||||
"fixes.minecraft.entity.MixinAbstractDonkeyEntity",
|
||||
"fixes.minecraft.entity.MixinAllayEntity",
|
||||
"fixes.minecraft.entity.MixinAnimalEntity",
|
||||
"fixes.minecraft.entity.MixinBoatEntity",
|
||||
"fixes.minecraft.entity.MixinCamelEntity",
|
||||
|
Loading…
Reference in New Issue
Block a user