1 parent
ad9c61cd1a
commit
42d59762a7
2 files changed
+67
-27
No files matched your search
+1
-18
@@ -1,6 +1,6 @@
|
||||
package com.github.zly2006.carpetslsaddition.mixin.entity;
|
||||
|
||||
import com.github.zly2006.carpetslsaddition.util.access.PlayerAccess;
|
||||
import com.github.zly2006.carpetslsaddition.PlayerAccess;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
@@ -8,7 +8,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.stat.Stat;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -23,10 +22,6 @@ public abstract class MixinPlayerEntity implements PlayerAccess {
|
||||
|
||||
@Shadow public abstract void resetStat(Stat<?> stat);
|
||||
|
||||
@Shadow public abstract Text getName();
|
||||
|
||||
private Text displayName = null;
|
||||
|
||||
@Override
|
||||
public boolean holdingObsidianPickaxe() {
|
||||
ItemStack itemStack = getEquippedStack(EquipmentSlot.MAINHAND);
|
||||
@@ -34,18 +29,6 @@ public abstract class MixinPlayerEntity implements PlayerAccess {
|
||||
return compound != null && compound.contains(ITEM_NAME) && compound.getString(ITEM_NAME).equals(OBSIDIAN_PICKAXE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisplayName(Text name) {
|
||||
this.displayName = name;
|
||||
}
|
||||
|
||||
@Inject(method = "getDisplayName", at = @At("HEAD"), cancellable = true)
|
||||
public void injectGetDisplayName(CallbackInfoReturnable<Text> cir) {
|
||||
if (this.displayName != null) {
|
||||
cir.setReturnValue(displayName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "getBlockBreakingSpeed", at = @At("HEAD"), cancellable = true)
|
||||
private void onGetBlockBreakingSpeed(BlockState block, CallbackInfoReturnable<Float> cir) {
|
||||
|
||||
Reference in new issue
Block a user