aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anthonyhilyard/iceberg/mixin
diff options
context:
space:
mode:
authorAnthony Hilyard <anthony.hilyard@gmail.com>2021-10-13 22:51:23 -0700
committerAnthony Hilyard <anthony.hilyard@gmail.com>2021-10-13 22:51:23 -0700
commit407a3cfabed3869b38527153e8b3322a824f1263 (patch)
tree06909dc024d048e999354a0c7102a57bccf32ef8 /src/main/java/com/anthonyhilyard/iceberg/mixin
parent0eb0e8504684ad9e7bdae99a54de618809cee8d4 (diff)
downloadIceberg-407a3cfabed3869b38527153e8b3322a824f1263.tar.gz
Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.tar.bz2
Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.zip
Initial commit for 1.17.1 version.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/mixin')
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java10
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java16
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java6
3 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java
index f4ca091..ba3a69e 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java
@@ -11,9 +11,9 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.At.Shift;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import net.minecraft.entity.Entity;
-import net.minecraft.fluid.Fluid;
-import net.minecraft.tags.ITag;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.level.material.Fluid;
+import net.minecraft.tags.Tag;
import net.minecraftforge.common.MinecraftForge;
@Mixin(Entity.class)
@@ -22,7 +22,7 @@ public class EntityMixin extends net.minecraftforge.common.capabilities.Capabili
private Fluid previousFluidOnEyes = null;
@Shadow
- protected ITag<Fluid> fluidOnEyes;
+ protected Tag<Fluid> fluidOnEyes;
protected EntityMixin(Class<Entity> baseClass) { super(baseClass); }
@@ -45,7 +45,7 @@ public class EntityMixin extends net.minecraftforge.common.capabilities.Capabili
}
@Inject(method = "updateFluidOnEyes",
- at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;fluidOnEyes:Lnet/minecraft/tags/ITag;", ordinal = 1, shift = Shift.AFTER))
+ at = @At(value = "FIELD", target = "Lnet/minecraft/world/entity/Entity;fluidOnEyes:Lnet/minecraft/tags/Tag;", ordinal = 1, shift = Shift.AFTER))
public void onUpdateFluidOnEyeAssign(CallbackInfo callbackInfo)
{
Fluid currentFluid = null;
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java
index a530465..2dbc247 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java
@@ -3,12 +3,12 @@ package com.anthonyhilyard.iceberg.mixin;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-import net.minecraft.entity.item.ItemEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.world.entity.item.ItemEntity;
+import net.minecraft.world.entity.player.Player;
+import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fml.loading.FMLEnvironment;
-import net.minecraftforge.fml.network.PacketDistributor;
+import net.minecraftforge.fmllegacy.network.PacketDistributor;
import com.anthonyhilyard.iceberg.network.IcebergNetworkProtocol;
import com.anthonyhilyard.iceberg.network.NewItemPickupEventPacket;
@@ -19,13 +19,13 @@ import org.spongepowered.asm.mixin.injection.At;
@Mixin(ForgeEventFactory.class)
public class ForgeEventFactoryMixin
{
- @Inject(method = { "onItemPickup(Lnet/minecraft/entity/item/ItemEntity;Lnet/minecraft/entity/player/PlayerEntity;)I" },
+ @Inject(method = { "onItemPickup(Lnet/minecraft/world/entity/item/ItemEntity;Lnet/minecraft/world/entity/player/Player;)I" },
at = { @At("HEAD") }, remap = false)
- private static void onItemPickup(ItemEntity entityItem, PlayerEntity player, CallbackInfoReturnable<Integer> info)
+ private static void onItemPickup(ItemEntity entityItem, Player player, CallbackInfoReturnable<Integer> info)
{
- if (player instanceof ServerPlayerEntity && FMLEnvironment.dist.isDedicatedServer())
+ if (player instanceof ServerPlayer && FMLEnvironment.dist.isDedicatedServer())
{
- IcebergNetworkProtocol.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity)player), new NewItemPickupEventPacket(player.getUUID(), entityItem.getItem()));
+ IcebergNetworkProtocol.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer)player), new NewItemPickupEventPacket(player.getUUID(), entityItem.getItem()));
}
}
}
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java
index b27b219..ad52b94 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java
@@ -10,15 +10,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.advancements.Advancement;
-import net.minecraft.advancements.PlayerAdvancements;
-import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.server.PlayerAdvancements;
+import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.common.MinecraftForge;
@Mixin(PlayerAdvancements.class)
public class PlayerAdvancementsMixin
{
@Shadow
- private ServerPlayerEntity player;
+ private ServerPlayer player;
@Inject(method = "award", at = @At(value = "TAIL"), locals = LocalCapture.CAPTURE_FAILEXCEPTION)
public void onAward(Advancement advancement, String criterionKey, CallbackInfoReturnable<Boolean> callbackInfo, boolean success)