25w20a
This commit is contained in:
1 parent
74e8a8d2ec
commit
52cf8c027a
11 files changed
+38
-38
No files matched your search
@@ -1,20 +1,24 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.commands.PermissionSource;
|
||||
import net.minecraft.server.commands.PerfCommand;
|
||||
import net.minecraft.server.commands.PermissionCheck;
|
||||
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;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(PerfCommand.class)
|
||||
public class PerfCommand_permissionMixin
|
||||
{
|
||||
@Inject(method = "method_37340", at = @At("HEAD"), cancellable = true, remap = false)
|
||||
private static void canRun(CommandSourceStack source, CallbackInfoReturnable<Boolean> cir)
|
||||
@Redirect(method = "register", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/commands/Commands;hasPermission(I)Lnet/minecraft/server/commands/PermissionCheck;"
|
||||
))
|
||||
private static PermissionCheck<PermissionSource> canRun(int i)
|
||||
{
|
||||
cir.setReturnValue(source.hasPermission(CarpetSettings.perfPermissionLevel));
|
||||
return Commands.hasPermission(CarpetSettings.perfPermissionLevel);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,9 +25,9 @@ public class SummonCommand_lightningMixin
|
||||
private static BlockPos addRiders(Entity entity)
|
||||
{
|
||||
// [CM] SummonNaturalLightning - if statement around
|
||||
if (CarpetSettings.summonNaturalLightning && entity instanceof LightningBolt && !entity.getCommandSenderWorld().isClientSide)
|
||||
if (CarpetSettings.summonNaturalLightning && entity instanceof LightningBolt && !entity.level().isClientSide)
|
||||
{
|
||||
ServerLevel world = (ServerLevel) entity.getCommandSenderWorld();
|
||||
ServerLevel world = (ServerLevel) entity.level();
|
||||
BlockPos at = entity.blockPosition();
|
||||
DifficultyInstance localDifficulty_1 = world.getCurrentDifficultyAt(at);
|
||||
boolean boolean_2 = world.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && world.random.nextDouble() < (double)localDifficulty_1.getEffectiveDifficulty() * 0.01D;
|
||||
|
||||
@@ -127,7 +127,7 @@ public abstract class Villager_aiMixin extends AbstractVillager
|
||||
if (bedPos == null || bedPos.dimension() != level().dimension()) // get Dimension
|
||||
{
|
||||
setUnhappy();
|
||||
((ServerLevel) getCommandSenderWorld()).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK_MARKER, Blocks.BARRIER.defaultBlockState()), getX(), getY() + getEyeHeight() + 1, getZ(), 1, 0.1, 0.1, 0.1, 0.0);
|
||||
((ServerLevel) level()).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK_MARKER, Blocks.BARRIER.defaultBlockState()), getX(), getY() + getEyeHeight() + 1, getZ(), 1, 0.1, 0.1, 0.1, 0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -142,7 +142,7 @@ public abstract class Villager_aiMixin extends AbstractVillager
|
||||
}
|
||||
else if (itemStack_1.getItem() instanceof BedItem)
|
||||
{
|
||||
List<PoiRecord> list_1 = ((ServerLevel) getCommandSenderWorld()).getPoiManager().getInRange(
|
||||
List<PoiRecord> list_1 = ((ServerLevel) level()).getPoiManager().getInRange(
|
||||
type -> type.is(PoiTypes.HOME),
|
||||
blockPosition(),
|
||||
48, PoiManager.Occupancy.ANY).toList();
|
||||
@@ -151,16 +151,16 @@ public abstract class Villager_aiMixin extends AbstractVillager
|
||||
Vec3 pv = Vec3.atCenterOf(poi.getPos());
|
||||
if (!poi.hasSpace())
|
||||
{
|
||||
((ServerLevel) getCommandSenderWorld()).sendParticles(ParticleTypes.HAPPY_VILLAGER,
|
||||
((ServerLevel) level()).sendParticles(ParticleTypes.HAPPY_VILLAGER,
|
||||
pv.x, pv.y+1.5, pv.z,
|
||||
50, 0.1, 0.3, 0.1, 0.0);
|
||||
}
|
||||
else if (canReachHome((Villager)(Object)this, poi.getPos(), poi))
|
||||
((ServerLevel) getCommandSenderWorld()).sendParticles(ParticleTypes.END_ROD,
|
||||
((ServerLevel) level()).sendParticles(ParticleTypes.END_ROD,
|
||||
pv.x, pv.y+1, pv.z,
|
||||
50, 0.1, 0.3, 0.1, 0.0);
|
||||
else
|
||||
((ServerLevel) getCommandSenderWorld()).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK_MARKER, Blocks.BARRIER.defaultBlockState()),
|
||||
((ServerLevel) level()).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK_MARKER, Blocks.BARRIER.defaultBlockState()),
|
||||
pv.x, pv.y+1, pv.z,
|
||||
1, 0.1, 0.1, 0.1, 0.0);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public abstract class Villager_aiMixin extends AbstractVillager
|
||||
{
|
||||
if (MobAI.isTracking(this, MobAI.TrackingType.IRON_GOLEM_SPAWNING))
|
||||
{
|
||||
((ServerLevel) getCommandSenderWorld()).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK_MARKER, Blocks.BARRIER.defaultBlockState()), getX(), getY()+3, getZ(), 1, 0.1, 0.1, 0.1, 0.0);
|
||||
((ServerLevel) level()).sendParticles(new BlockParticleOption(ParticleTypes.BLOCK_MARKER, Blocks.BARRIER.defaultBlockState()), getX(), getY()+3, getZ(), 1, 0.1, 0.1, 0.1, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user