23w51b
This commit is contained in:
1 parent
ab79e76b51
commit
d76d013acb
9 files changed
+57
-55
No files matched your search
+4
-4
@@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check https://fabricmc.net/develop/
|
# check https://fabricmc.net/develop/
|
||||||
minecraft_version=1.20.3
|
minecraft_version=23w51b
|
||||||
loader_version=0.14.24
|
loader_version=0.15.3
|
||||||
jsr305_version=3.0.2
|
jsr305_version=3.0.2
|
||||||
fabric_version=0.90.11+1.20.3
|
fabric_version=0.91.1+1.20.3
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.128
|
mod_version = 1.4.128
|
||||||
@@ -17,7 +17,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
# The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5)
|
# The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5)
|
||||||
# This is needed because CF uses too vague names for prereleases and release candidates
|
# This is needed because CF uses too vague names for prereleases and release candidates
|
||||||
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
|
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
|
||||||
release-curse-versions = Minecraft 1.20:1.20.3
|
release-curse-versions = Minecraft 1.20:1.20.5-Snapshot
|
||||||
# Whether or not to build another branch on release
|
# Whether or not to build another branch on release
|
||||||
release-extra-branch = false
|
release-extra-branch = false
|
||||||
# The name of the second branch to release
|
# The name of the second branch to release
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import static carpet.api.settings.RuleCategory.CLIENT;
|
|||||||
public class CarpetSettings
|
public class CarpetSettings
|
||||||
{
|
{
|
||||||
public static final String carpetVersion = FabricLoader.getInstance().getModContainer("carpet").orElseThrow().getMetadata().getVersion().toString();
|
public static final String carpetVersion = FabricLoader.getInstance().getModContainer("carpet").orElseThrow().getMetadata().getVersion().toString();
|
||||||
public static final String releaseTarget = "1.20.3";
|
public static final String releaseTarget = "1.20.5";
|
||||||
public static final Logger LOG = LoggerFactory.getLogger("carpet");
|
public static final Logger LOG = LoggerFactory.getLogger("carpet");
|
||||||
public static final ThreadLocal<Boolean> skipGenerationChecks = ThreadLocal.withInitial(() -> false);
|
public static final ThreadLocal<Boolean> skipGenerationChecks = ThreadLocal.withInitial(() -> false);
|
||||||
public static final ThreadLocal<Boolean> impendingFillSkipUpdates = ThreadLocal.withInitial(() -> false);
|
public static final ThreadLocal<Boolean> impendingFillSkipUpdates = ThreadLocal.withInitial(() -> false);
|
||||||
|
|||||||
@@ -291,7 +291,8 @@ public class HopperCounter
|
|||||||
entry(Items.POISONOUS_POTATO,Blocks.SLIME_BLOCK),
|
entry(Items.POISONOUS_POTATO,Blocks.SLIME_BLOCK),
|
||||||
entry(Items.SPIDER_EYE,Blocks.NETHERRACK),
|
entry(Items.SPIDER_EYE,Blocks.NETHERRACK),
|
||||||
entry(Items.GUNPOWDER,Blocks.GRAY_WOOL),
|
entry(Items.GUNPOWDER,Blocks.GRAY_WOOL),
|
||||||
entry(Items.SCUTE,Blocks.LIME_WOOL),
|
entry(Items.TURTLE_SCUTE,Blocks.LIME_WOOL),
|
||||||
|
entry(Items.ARMADILLO_SCUTE,Blocks.ANCIENT_DEBRIS),
|
||||||
entry(Items.FEATHER,Blocks.WHITE_WOOL),
|
entry(Items.FEATHER,Blocks.WHITE_WOOL),
|
||||||
entry(Items.FLINT,Blocks.BLACK_WOOL),
|
entry(Items.FLINT,Blocks.BLACK_WOOL),
|
||||||
entry(Items.LEATHER,Blocks.SPRUCE_PLANKS),
|
entry(Items.LEATHER,Blocks.SPRUCE_PLANKS),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import carpet.CarpetSettings;
|
|||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.cauldron.CauldronInteraction;
|
import net.minecraft.core.cauldron.CauldronInteraction;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResult;
|
import net.minecraft.world.ItemInteractionResult;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
@@ -19,13 +19,16 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||||||
@Mixin(AbstractCauldronBlock.class)
|
@Mixin(AbstractCauldronBlock.class)
|
||||||
public class AbstractCauldronBlock_stackableSBoxesMixin
|
public class AbstractCauldronBlock_stackableSBoxesMixin
|
||||||
{
|
{
|
||||||
@Redirect(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/cauldron/CauldronInteraction;interact(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/item/ItemStack;)Lnet/minecraft/world/InteractionResult;"))
|
@Redirect(method = "useItemOn", at = @At(
|
||||||
private InteractionResult wrapInteractor(CauldronInteraction cauldronBehavior, BlockState blockState, Level world, BlockPos blockPos, Player playerEntity, InteractionHand hand, ItemStack itemStack)
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/core/cauldron/CauldronInteraction;interact(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/item/ItemStack;)Lnet/minecraft/world/ItemInteractionResult;"
|
||||||
|
))
|
||||||
|
private ItemInteractionResult wrapInteractor(final CauldronInteraction cauldronBehavior, final BlockState blockState, final Level world, final BlockPos blockPos, final Player playerEntity, final InteractionHand hand, final ItemStack itemStack)
|
||||||
{
|
{
|
||||||
int count = -1;
|
int count = -1;
|
||||||
if (CarpetSettings.shulkerBoxStackSize > 1 && itemStack.getItem() instanceof BlockItem && ((BlockItem)itemStack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
if (CarpetSettings.shulkerBoxStackSize > 1 && itemStack.getItem() instanceof BlockItem && ((BlockItem)itemStack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
||||||
count = itemStack.getCount();
|
count = itemStack.getCount();
|
||||||
InteractionResult result = cauldronBehavior.interact(blockState, world, blockPos, playerEntity, hand, itemStack);
|
ItemInteractionResult result = cauldronBehavior.interact(blockState, world, blockPos, playerEntity, hand, itemStack);
|
||||||
if (count > 0 && result.consumesAction())
|
if (count > 0 && result.consumesAction())
|
||||||
{
|
{
|
||||||
ItemStack current = playerEntity.getItemInHand(hand);
|
ItemStack current = playerEntity.getItemInHand(hand);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public abstract class Gui_tablistMixin
|
|||||||
|
|
||||||
@Shadow @Final private PlayerTabOverlay tabList;
|
@Shadow @Final private PlayerTabOverlay tabList;
|
||||||
|
|
||||||
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;isLocalServer()Z"))
|
@Redirect(method = "renderTabList", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;isLocalServer()Z"))
|
||||||
private boolean onDraw(Minecraft minecraftClient)
|
private boolean onDraw(Minecraft minecraftClient)
|
||||||
{
|
{
|
||||||
return this.minecraft.isLocalServer() && !((PlayerListHudInterface) tabList).hasFooterOrHeader();
|
return this.minecraft.isLocalServer() && !((PlayerListHudInterface) tabList).hasFooterOrHeader();
|
||||||
|
|||||||
@@ -1,32 +1,39 @@
|
|||||||
package carpet.mixins;
|
package carpet.mixins;
|
||||||
|
|
||||||
import carpet.CarpetSettings;
|
import carpet.CarpetSettings;
|
||||||
|
import com.mojang.authlib.GameProfile;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
|
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.level.ServerPlayerGameMode;
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(value = ServerPlayerGameMode.class, priority = 69420) // not that important for carpet
|
@Mixin(value = ServerPlayer.class)
|
||||||
public class ServerPlayerGameMode_antiCheatMixin
|
public abstract class ServerPlayerGameMode_antiCheatMixin extends Player
|
||||||
{
|
{
|
||||||
// that shoudn't've been a constant at the first place
|
public ServerPlayerGameMode_antiCheatMixin(final Level level, final BlockPos blockPos, final float f, final GameProfile gameProfile)
|
||||||
// resolves problems with mobs using reach entity attributes.
|
{
|
||||||
|
super(level, blockPos, f, gameProfile);
|
||||||
|
}
|
||||||
|
|
||||||
@Redirect(method = "handleBlockBreakAction", at = @At(
|
@Inject(method = "canInteractWithBlock", at = @At("HEAD"), cancellable = true)
|
||||||
value = "INVOKE",
|
private void canInteractLongRangeBlock(BlockPos pos, CallbackInfoReturnable<Boolean> cir)
|
||||||
target = "Lnet/minecraft/server/level/ServerPlayer;getEyePosition()Lnet/minecraft/world/phys/Vec3;"
|
|
||||||
))
|
|
||||||
private Vec3 getEyePos(ServerPlayer instance,
|
|
||||||
final BlockPos pos, final ServerboundPlayerActionPacket.Action action, final Direction direction, final int maxBuildHeight, final int sequence)
|
|
||||||
{
|
{
|
||||||
if (CarpetSettings.antiCheatDisabled &&
|
double maxRange = blockInteractionRange() + 1.0;
|
||||||
instance.getEyePosition().distanceToSqr(Vec3.atCenterOf(pos)) < 1024
|
maxRange = maxRange * maxRange;
|
||||||
) return Vec3.atCenterOf(pos);
|
if (CarpetSettings.antiCheatDisabled && maxRange < 1024 && getEyePosition().distanceToSqr(Vec3.atCenterOf(pos)) < 1024) cir.setReturnValue(true);
|
||||||
return instance.getEyePosition();
|
}
|
||||||
|
|
||||||
|
@Inject(method = "canInteractWithEntity", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void canInteractLongRangeEntity(AABB aabb, CallbackInfoReturnable<Boolean> cir)
|
||||||
|
{
|
||||||
|
double maxRange = entityInteractionRange() + 1.0;
|
||||||
|
maxRange = maxRange * maxRange;
|
||||||
|
if (CarpetSettings.antiCheatDisabled && maxRange < 1024 && aabb.distanceToSqr(getEyePosition()) < 1024) cir.setReturnValue(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,9 @@ package carpet.mixins;
|
|||||||
import carpet.helpers.BlockRotator;
|
import carpet.helpers.BlockRotator;
|
||||||
import net.minecraft.server.level.ServerPlayerGameMode;
|
import net.minecraft.server.level.ServerPlayerGameMode;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResult;
|
import net.minecraft.world.ItemInteractionResult;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
@@ -18,14 +19,14 @@ public class ServerPlayerGameMode_cactusMixin
|
|||||||
|
|
||||||
@Redirect(method = "useItemOn", at = @At(
|
@Redirect(method = "useItemOn", at = @At(
|
||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lnet/minecraft/world/level/block/state/BlockState;use(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/phys/BlockHitResult;)Lnet/minecraft/world/InteractionResult;"
|
target = "Lnet/minecraft/world/level/block/state/BlockState;useItemOn(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/phys/BlockHitResult;)Lnet/minecraft/world/ItemInteractionResult;"
|
||||||
))
|
))
|
||||||
private InteractionResult activateWithOptionalCactus(BlockState blockState, Level world_1, Player playerEntity_1, InteractionHand hand_1, BlockHitResult blockHitResult_1)
|
private ItemInteractionResult activateWithOptionalCactus(final BlockState blockState, final ItemStack itemStack, final Level world_1, final Player playerEntity_1, final InteractionHand hand_1, final BlockHitResult blockHitResult_1)
|
||||||
{
|
{
|
||||||
boolean flipped = BlockRotator.flipBlockWithCactus(blockState, world_1, playerEntity_1, hand_1, blockHitResult_1);
|
boolean flipped = BlockRotator.flipBlockWithCactus(blockState, world_1, playerEntity_1, hand_1, blockHitResult_1);
|
||||||
if (flipped)
|
if (flipped)
|
||||||
return InteractionResult.SUCCESS;
|
return ItemInteractionResult.SUCCESS;
|
||||||
|
|
||||||
return blockState.use(world_1, playerEntity_1, hand_1, blockHitResult_1);
|
return blockState.useItemOn(itemStack, world_1, playerEntity_1, hand_1, blockHitResult_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@ import net.minecraft.server.players.GameProfileCache;
|
|||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.EquipmentSlot;
|
import net.minecraft.world.entity.EquipmentSlot;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.food.FoodData;
|
import net.minecraft.world.food.FoodData;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
@@ -77,7 +78,7 @@ public class EntityPlayerMPFake extends ServerPlayer
|
|||||||
instance.teleportTo(worldIn, pos.x, pos.y, pos.z, (float) yaw, (float) pitch);
|
instance.teleportTo(worldIn, pos.x, pos.y, pos.z, (float) yaw, (float) pitch);
|
||||||
instance.setHealth(20.0F);
|
instance.setHealth(20.0F);
|
||||||
instance.unsetRemoved();
|
instance.unsetRemoved();
|
||||||
instance.setMaxUpStep(0.6F);
|
instance.getAttribute(Attributes.STEP_HEIGHT).setBaseValue(0.6F);
|
||||||
instance.gameMode.changeGameModeForPlayer(gamemode);
|
instance.gameMode.changeGameModeForPlayer(gamemode);
|
||||||
server.getPlayerList().broadcastAll(new ClientboundRotateHeadPacket(instance, (byte) (instance.yHeadRot * 256 / 360)), dimensionId);//instance.dimension);
|
server.getPlayerList().broadcastAll(new ClientboundRotateHeadPacket(instance, (byte) (instance.yHeadRot * 256 / 360)), dimensionId);//instance.dimension);
|
||||||
server.getPlayerList().broadcastAll(new ClientboundTeleportEntityPacket(instance), dimensionId);//instance.dimension);
|
server.getPlayerList().broadcastAll(new ClientboundTeleportEntityPacket(instance), dimensionId);//instance.dimension);
|
||||||
@@ -106,7 +107,8 @@ public class EntityPlayerMPFake extends ServerPlayer
|
|||||||
playerShadow.connection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
|
playerShadow.connection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
|
||||||
playerShadow.gameMode.changeGameModeForPlayer(player.gameMode.getGameModeForPlayer());
|
playerShadow.gameMode.changeGameModeForPlayer(player.gameMode.getGameModeForPlayer());
|
||||||
((ServerPlayerInterface) playerShadow).getActionPack().copyFrom(((ServerPlayerInterface) player).getActionPack());
|
((ServerPlayerInterface) playerShadow).getActionPack().copyFrom(((ServerPlayerInterface) player).getActionPack());
|
||||||
playerShadow.setMaxUpStep(0.6F);
|
// this might create problems if a player logs back in...
|
||||||
|
playerShadow.getAttribute(Attributes.STEP_HEIGHT).setBaseValue(0.6F);
|
||||||
playerShadow.entityData.set(DATA_PLAYER_MODE_CUSTOMISATION, player.getEntityData().get(DATA_PLAYER_MODE_CUSTOMISATION));
|
playerShadow.entityData.set(DATA_PLAYER_MODE_CUSTOMISATION, player.getEntityData().get(DATA_PLAYER_MODE_CUSTOMISATION));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -490,8 +490,8 @@ public class EntityValue extends Value
|
|||||||
|
|
||||||
put("invulnerable", (e, a) -> BooleanValue.of(e.isInvulnerable()));
|
put("invulnerable", (e, a) -> BooleanValue.of(e.isInvulnerable()));
|
||||||
put("dimension", (e, a) -> nameFromRegistryId(e.level().dimension().location())); // getDimId
|
put("dimension", (e, a) -> nameFromRegistryId(e.level().dimension().location())); // getDimId
|
||||||
put("height", (e, a) -> new NumericValue(e.getDimensions(Pose.STANDING).height));
|
put("height", (e, a) -> new NumericValue(e.getDimensions(Pose.STANDING).height()));
|
||||||
put("width", (e, a) -> new NumericValue(e.getDimensions(Pose.STANDING).width));
|
put("width", (e, a) -> new NumericValue(e.getDimensions(Pose.STANDING).width()));
|
||||||
put("eye_height", (e, a) -> new NumericValue(e.getEyeHeight()));
|
put("eye_height", (e, a) -> new NumericValue(e.getEyeHeight()));
|
||||||
put("age", (e, a) -> new NumericValue(e.tickCount));
|
put("age", (e, a) -> new NumericValue(e.tickCount));
|
||||||
put("breeding_age", (e, a) -> e instanceof final AgeableMob am ? new NumericValue(am.getAge()) : Value.NULL);
|
put("breeding_age", (e, a) -> e instanceof final AgeableMob am ? new NumericValue(am.getAge()) : Value.NULL);
|
||||||
@@ -657,11 +657,7 @@ public class EntityValue extends Value
|
|||||||
return ListValue.wrap(effects);
|
return ListValue.wrap(effects);
|
||||||
}
|
}
|
||||||
String effectName = a.getString();
|
String effectName = a.getString();
|
||||||
MobEffect potion = BuiltInRegistries.MOB_EFFECT.get(InputValidator.identifierOf(effectName));
|
Holder<MobEffect> potion = BuiltInRegistries.MOB_EFFECT.getHolder(ResourceKey.create(Registries.MOB_EFFECT, InputValidator.identifierOf(effectName))).orElseThrow( () -> new InternalExpressionException("No such an effect: " + effectName));
|
||||||
if (potion == null)
|
|
||||||
{
|
|
||||||
throw new InternalExpressionException("No such an effect: " + effectName);
|
|
||||||
}
|
|
||||||
if (!le.hasEffect(potion))
|
if (!le.hasEffect(potion))
|
||||||
{
|
{
|
||||||
return Value.NULL;
|
return Value.NULL;
|
||||||
@@ -835,10 +831,10 @@ public class EntityValue extends Value
|
|||||||
if (a == null)
|
if (a == null)
|
||||||
{
|
{
|
||||||
AttributeMap container = el.getAttributes();
|
AttributeMap container = el.getAttributes();
|
||||||
return MapValue.wrap(attributes.stream().filter(container::hasAttribute).collect(Collectors.toMap(aa -> ValueConversions.of(attributes.getKey(aa)), aa -> NumericValue.of(container.getValue(aa)))));
|
return MapValue.wrap(attributes.holders().filter(container::hasAttribute).collect(Collectors.toMap(aa -> ValueConversions.of(aa.key()), aa -> NumericValue.of(container.getValue(aa)))));
|
||||||
}
|
}
|
||||||
ResourceLocation id = InputValidator.identifierOf(a.getString());
|
ResourceLocation id = InputValidator.identifierOf(a.getString());
|
||||||
Attribute attrib = attributes.getOptional(id).orElseThrow(
|
Holder<Attribute> attrib = attributes.getHolder(id).orElseThrow(
|
||||||
() -> new InternalExpressionException("Unknown attribute: " + a.getString())
|
() -> new InternalExpressionException("Unknown attribute: " + a.getString())
|
||||||
);
|
);
|
||||||
if (!el.getAttributes().hasAttribute(attrib))
|
if (!el.getAttributes().hasAttribute(attrib))
|
||||||
@@ -1472,11 +1468,7 @@ public class EntityValue extends Value
|
|||||||
if (list.size() >= 1 && list.size() <= 6)
|
if (list.size() >= 1 && list.size() <= 6)
|
||||||
{
|
{
|
||||||
String effectName = list.get(0).getString();
|
String effectName = list.get(0).getString();
|
||||||
MobEffect effect = BuiltInRegistries.MOB_EFFECT.get(InputValidator.identifierOf(effectName));
|
Holder<MobEffect> effect = BuiltInRegistries.MOB_EFFECT.getHolder(InputValidator.identifierOf(effectName)).orElseThrow( () -> new InternalExpressionException("No such an effect: " + effectName));
|
||||||
if (effect == null)
|
|
||||||
{
|
|
||||||
throw new InternalExpressionException("Wrong effect name: " + effectName);
|
|
||||||
}
|
|
||||||
if (list.size() == 1)
|
if (list.size() == 1)
|
||||||
{
|
{
|
||||||
le.removeEffect(effect);
|
le.removeEffect(effect);
|
||||||
@@ -1518,11 +1510,7 @@ public class EntityValue extends Value
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
String effectName = v.getString();
|
String effectName = v.getString();
|
||||||
MobEffect effect = BuiltInRegistries.MOB_EFFECT.get(InputValidator.identifierOf(effectName));
|
Holder<MobEffect> effect = BuiltInRegistries.MOB_EFFECT.getHolder(InputValidator.identifierOf(effectName)).orElseThrow( () -> new InternalExpressionException("No such an effect: " + effectName));
|
||||||
if (effect == null)
|
|
||||||
{
|
|
||||||
throw new InternalExpressionException("Wrong effect name: " + effectName);
|
|
||||||
}
|
|
||||||
le.removeEffect(effect);
|
le.removeEffect(effect);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user