Merge branch 'master' into future
This commit is contained in:
commit
6a03675b4f
16 files changed
+161
-36
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.fluid.FlowableFluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
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(FlowableFluid.class)
|
||||
public class FlowableFluid_liquidDamageDisabledMixin
|
||||
{
|
||||
@Inject(
|
||||
method = "canFill",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/block/Material;blocksMovement()Z"
|
||||
),
|
||||
cancellable = true
|
||||
)
|
||||
private void stopBreakingBlock(BlockView world, BlockPos pos, BlockState state, Fluid fluid, CallbackInfoReturnable<Boolean> cir)
|
||||
{
|
||||
if (CarpetSettings.liquidDamageDisabled)
|
||||
{
|
||||
Material material = state.getMaterial();
|
||||
cir.setReturnValue(material == Material.AIR || material.isLiquid());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import carpet.helpers.EntityPlayerActionPack;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerInteractionManager;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@@ -16,7 +16,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(ServerPlayerEntity.class)
|
||||
public abstract class ServerPlayerEntityMixin implements ServerPlayerEntityInterface
|
||||
{
|
||||
@Unique
|
||||
public EntityPlayerActionPack actionPack;
|
||||
@Override
|
||||
public EntityPlayerActionPack getActionPack()
|
||||
{
|
||||
return actionPack;
|
||||
@@ -41,15 +43,11 @@ public abstract class ServerPlayerEntityMixin implements ServerPlayerEntityInter
|
||||
}
|
||||
catch (StackOverflowError soe)
|
||||
{
|
||||
CarpetSettings.LOG.fatal("Caused stack overflow when performing player action");
|
||||
CarpetSettings.LOG.fatal("Caused stack overflow when performing player action", soe);
|
||||
}
|
||||
catch (Throwable exc)
|
||||
{
|
||||
CarpetSettings.LOG.fatal("Error executing player tasks "+ exc.getMessage());
|
||||
exc.printStackTrace();
|
||||
CarpetSettings.LOG.fatal("Error executing player tasks", exc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -96,8 +96,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
||||
}
|
||||
catch (Exception booboo)
|
||||
{
|
||||
CarpetSettings.LOG.error("Unknown Exception while plopping structure: "+booboo);
|
||||
booboo.printStackTrace();
|
||||
CarpetSettings.LOG.error("Unknown Exception while plopping structure: "+booboo, booboo);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in new issue
Block a user