24e18a
This commit is contained in:
1 parent
76b876446c
commit
0e799bbc3e
7 files changed
+18
-15
No files matched your search
@@ -20,8 +20,8 @@ public abstract class AbstractArrowMixin extends Entity
|
||||
private TrajectoryLogHelper logHelper;
|
||||
public AbstractArrowMixin(EntityType<?> entityType_1, Level world_1) { super(entityType_1, world_1); }
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/item/ItemStack;)V", at = @At("RETURN"))
|
||||
private void addLogger(final EntityType entityType, final Level level, final ItemStack itemStack, final CallbackInfo ci)
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemStack;)V", at = @At("RETURN"))
|
||||
private void addLogger(final EntityType entityType, final Level level, final ItemStack itemStack, final ItemStack weapon, final CallbackInfo ci)
|
||||
{
|
||||
if (LoggerRegistry.__projectiles && !level.isClientSide)
|
||||
logHelper = new TrajectoryLogHelper("projectiles");
|
||||
|
||||
@@ -2,6 +2,7 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
@@ -33,7 +34,7 @@ public class BuddingAmethystBlock_movableAmethystMixin extends Block {
|
||||
// drawback - not controlled via loottables, but hey
|
||||
if (CarpetSettings.movableAmethyst &&
|
||||
stack.getItem() instanceof PickaxeItem &&
|
||||
EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0
|
||||
EnchantmentHelper.getItemEnchantmentLevel(world.registryAccess().registryOrThrow(Registries.ENCHANTMENT).getHolderOrThrow(Enchantments.SILK_TOUCH), stack) > 0
|
||||
)
|
||||
popResource(world, pos, Items.BUDDING_AMETHYST.getDefaultInstance());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.ExperienceOrb;
|
||||
@@ -27,7 +28,7 @@ public abstract class ExperienceOrb_xpNoCooldownMixin extends Entity
|
||||
}
|
||||
|
||||
@Shadow
|
||||
protected abstract int repairPlayerItems(Player player, int amount);
|
||||
protected abstract int repairPlayerItems(ServerPlayer player, int amount);
|
||||
|
||||
@Inject(method = "playerTouch", at = @At("HEAD"))
|
||||
private void addXP(Player player, CallbackInfo ci) {
|
||||
@@ -35,7 +36,7 @@ public abstract class ExperienceOrb_xpNoCooldownMixin extends Entity
|
||||
player.takeXpDelay = 0;
|
||||
// reducing the count to 1 and leaving vanilla to deal with it
|
||||
while (this.count > 1) {
|
||||
int remainder = this.repairPlayerItems(player, this.value);
|
||||
int remainder = this.repairPlayerItems((ServerPlayer) player, this.value);
|
||||
if (remainder > 0) {
|
||||
player.giveExperiencePoints(remainder);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import carpet.fakes.EntityInterface;
|
||||
import carpet.script.EntityEventsGroup;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.decoration.BlockAttachedEntity;
|
||||
import net.minecraft.world.entity.decoration.HangingEntity;
|
||||
import net.minecraft.world.level.Level;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -11,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(HangingEntity.class)
|
||||
@Mixin(BlockAttachedEntity.class)
|
||||
public abstract class HangingEntity_scarpetEventsMixin extends Entity
|
||||
{
|
||||
public HangingEntity_scarpetEventsMixin(EntityType<?> type, Level world)
|
||||
|
||||
Reference in new issue
Block a user