Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-03-11 00:18:48 -03:00
commit b50e6772ce
1 file changed
+10 -9
@@ -18,6 +18,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Iterator;
import java.util.Set;
@@ -41,13 +42,6 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa
@Shadow
private BlockState update(World world_1, BlockPos blockPos_1, BlockState blockState_1) { return null; }
// =
@Override
public BlockState updateLogicPublic(World world_1, BlockPos blockPos_1, BlockState blockState_1) {
return updateLogic(world_1, blockPos_1, blockState_1);
}
@Override
@Accessor("wiresGivePower")
public abstract void setWiresGivePower(boolean wiresGivePower);
@@ -79,8 +73,15 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa
/**
* @author theosib, soykaf, gnembon
*/
@Overwrite
private BlockState updateLogic(World world_1, BlockPos blockPos_1, BlockState blockState_1) {
@Inject(method = "updateLogic", at = @At("HEAD"), cancellable = true)
private void updateLogicAlternative(World world, BlockPos pos, BlockState state, CallbackInfoReturnable<BlockState> cir)
{
if (CarpetSettings.fastRedstoneDust)
cir.setReturnValue(updateLogicPublic(world, pos, state));
}
@Override
public BlockState updateLogicPublic(World world_1, BlockPos blockPos_1, BlockState blockState_1) {
BlockState blockState_2 = blockState_1;
int int_1 = (Integer)blockState_1.get(POWER); // i
this.wiresGivePower = false;