Fix #102
This commit is contained in:
parent
0dfcc950ca
commit
db2a555ae9
1 changed files with 16 additions and 14 deletions
|
@ -35,13 +35,14 @@ public abstract class AnvilScreenHandlerMixin extends ForgingScreenHandler imple
|
|||
private AnvilRecipe be_currentRecipe;
|
||||
private Property anvilLevel;
|
||||
|
||||
public AnvilScreenHandlerMixin(ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory,
|
||||
ScreenHandlerContext context) {
|
||||
super(type, syncId, playerInventory, context);
|
||||
public AnvilScreenHandlerMixin(int syncId, PlayerInventory playerInventory) {
|
||||
super(ScreenHandlerType.ANVIL, syncId, playerInventory, ScreenHandlerContext.EMPTY);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||
@Inject(method = "<init>(ILnet/minecraft/entity/player/PlayerInventory;Lnet/minecraft/screen/ScreenHandlerContext;)V",
|
||||
at = @At("TAIL"))
|
||||
public void be_initAnvilLevel(int syncId, PlayerInventory inventory, ScreenHandlerContext context, CallbackInfo info) {
|
||||
if (context != ScreenHandlerContext.EMPTY) {
|
||||
int anvLevel = context.run((world, blockPos) -> {
|
||||
Block anvilBlock = world.getBlockState(blockPos).getBlock();
|
||||
if (anvilBlock instanceof EndAnvilBlock) {
|
||||
|
@ -53,6 +54,7 @@ public abstract class AnvilScreenHandlerMixin extends ForgingScreenHandler imple
|
|||
anvilLevel.set(anvLevel);
|
||||
this.anvilLevel = addProperty(anvilLevel);
|
||||
}
|
||||
}
|
||||
|
||||
@Shadow
|
||||
public abstract void updateResult();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue