Runic Altar and Runic Anvil's items do not sync in multiplayer
LTCatt opened this issue ยท 2 comments
- Get two players into a multiplayer game
- Player A places items into the block
- Player B cannot see the item, but can take it away
- Then player A can still see the item, but can't take it away
import it.hurts.sskirillss.relics.tiles.RunicAnvilTile;
import it.hurts.sskirillss.relics.tiles.TileBase;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntityType;
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(RunicAnvilTile.class)
public abstract class FixRunicAnvilSync extends TileBase implements ITickableTileEntity {
public FixRunicAnvilSync(TileEntityType<?> tileEntityTypeIn) {super(tileEntityTypeIn);}
@Inject(method = "insertItem(Lnet/minecraft/item/ItemStack;)Z", at = @At("RETURN"), remap = false)
private void injectedInsert(ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 2);
}
@Inject(method = "takeItem(Lnet/minecraft/entity/LivingEntity;)Z", at = @At("RETURN"), remap = false)
private void injectedTake(LivingEntity entity, CallbackInfoReturnable<Boolean> cir) {
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 2);
}
}
package net.hexdragon.eoutils.mixin.relics;
import it.hurts.sskirillss.relics.tiles.RunicAltarTile;
import it.hurts.sskirillss.relics.tiles.TileBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
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;
@mixin(RunicAltarTile.class)
public abstract class FixRunicAltarSync extends TileBase implements ITickableTileEntity {
public FixRunicAltarSync(TileEntityType<?> tileEntityTypeIn) {super(tileEntityTypeIn);}
@Inject(method = "setStack(Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/Direction;)V", at = @At("RETURN"), remap = false)
private void injectedInsert(ItemStack stack, Direction direction, CallbackInfo ci) {
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 2);
}
}
Fixed in d477140