-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from auxves/1.19
Update to 1.19
- Loading branch information
Showing
56 changed files
with
581 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...ixin/AbstractFurnaceBlockEntityMixin.java → ...ixin/AbstractFurnaceBlockEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
package io.glossnyx.vibes.mixin; | ||
package io.auxves.vibes.mixin; | ||
|
||
import io.glossnyx.vibes.network.ServerNetworking; | ||
import io.auxves.vibes.server.BridgesKt; | ||
import net.minecraft.block.entity.AbstractFurnaceBlockEntity; | ||
import net.minecraft.item.ItemStack; | ||
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.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(AbstractFurnaceBlockEntity.class) | ||
class AbstractFurnaceBlockEntityMixin { | ||
AbstractFurnaceBlockEntity that = AbstractFurnaceBlockEntity.class.cast(this); | ||
|
||
@Inject(method = "setStack", at = @At("HEAD")) | ||
private void onSetStack(int slot, ItemStack stack, CallbackInfo ci) { | ||
ServerNetworking.INSTANCE.changePositionProvider(stack, that); | ||
BridgesKt.changePosition(stack, that); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/mixin/EnderChestInventoryAccessor.java → ...es/mixin/EnderChestInventoryAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/io/auxves/vibes/mixin/HopperBlockEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.auxves.vibes.mixin; | ||
|
||
import io.auxves.vibes.server.BridgesKt; | ||
import net.minecraft.block.entity.HopperBlockEntity; | ||
import net.minecraft.item.ItemStack; | ||
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.CallbackInfo; | ||
|
||
@Mixin(HopperBlockEntity.class) | ||
class HopperBlockEntityMixin { | ||
HopperBlockEntity that = HopperBlockEntity.class.cast(this); | ||
|
||
@Inject(method = "setStack", at = @At("HEAD")) | ||
private void onSetStack(int slot, ItemStack stack, CallbackInfo ci) { | ||
BridgesKt.changePosition(stack, that); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.auxves.vibes.mixin; | ||
|
||
import io.auxves.vibes.server.BridgesKt; | ||
import io.auxves.vibes.util.ItemsKt; | ||
import net.minecraft.entity.ItemEntity; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ItemEntity.class) | ||
class ItemEntityMixin { | ||
@Shadow private int itemAge; | ||
|
||
@Redirect(method = "onPlayerCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/ItemEntity;getStack()Lnet/minecraft/item/ItemStack;")) | ||
private ItemStack onGetStack(ItemEntity entity) { | ||
if (ItemsKt.isPlaying(entity.getStack())) return entity.getStack().copy(); | ||
return entity.getStack(); | ||
} | ||
|
||
@Redirect(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/ItemEntity;discard()V")) | ||
private void stopPlayingWhenKilled(ItemEntity entity) { | ||
BridgesKt.stopPlaying(entity.getStack(), entity.world); | ||
entity.discard(); | ||
} | ||
|
||
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/ItemEntity;discard()V")) | ||
private void keepAlive(ItemEntity entity) { | ||
if (!ItemsKt.isPlaying(entity.getStack())) entity.discard(); | ||
else itemAge = 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/io/auxves/vibes/mixin/JukeboxBlockMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.auxves.vibes.mixin; | ||
|
||
import io.auxves.vibes.network.packet.ChangeDistance; | ||
import io.auxves.vibes.server.BridgesKt; | ||
import net.minecraft.block.JukeboxBlock; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.ItemEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(JukeboxBlock.class) | ||
class JukeboxBlockMixin { | ||
@Redirect(method = "removeRecord", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnEntity(Lnet/minecraft/entity/Entity;)Z")) | ||
private boolean onSpawnEntity(World world, Entity entity) { | ||
ItemEntity itemEntity = (ItemEntity) entity; | ||
ItemStack stack = itemEntity.getStack(); | ||
BridgesKt.changePosition(stack, entity); | ||
BridgesKt.setDistance(entity.world, stack, ChangeDistance.Normal); | ||
return world.spawnEntity(entity); | ||
} | ||
} |
10 changes: 3 additions & 7 deletions
10
...in/LootableContainerBlockEntityMixin.java → ...in/LootableContainerBlockEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
package io.glossnyx.vibes.mixin; | ||
package io.auxves.vibes.mixin; | ||
|
||
import io.glossnyx.vibes.network.ServerNetworking; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.block.entity.BlockEntityType; | ||
import io.auxves.vibes.server.BridgesKt; | ||
import net.minecraft.block.entity.LootableContainerBlockEntity; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(LootableContainerBlockEntity.class) | ||
class LootableContainerBlockEntityMixin { | ||
LootableContainerBlockEntity that = LootableContainerBlockEntity.class.cast(this); | ||
|
||
@Inject(method = "setStack", at = @At("HEAD")) | ||
private void onSetStack(int slot, ItemStack stack, CallbackInfo ci) { | ||
ServerNetworking.INSTANCE.changePositionProvider(stack, that); | ||
BridgesKt.changePosition(stack, that); | ||
} | ||
} |
9 changes: 4 additions & 5 deletions
9
...ossnyx/vibes/mixin/PlayerEntityMixin.java → ...auxves/vibes/mixin/PlayerEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
package io.glossnyx.vibes.mixin; | ||
package io.auxves.vibes.mixin; | ||
|
||
import io.glossnyx.vibes.network.ServerNetworking; | ||
import io.auxves.vibes.server.BridgesKt; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.ItemEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
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.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(PlayerEntity.class) | ||
class PlayerEntityMixin { | ||
@Inject(method = "dropItem(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/ItemEntity;", at = @At("RETURN")) | ||
private void onDropItem(ItemStack stack, boolean throwRandomly, boolean retainOwnership, CallbackInfoReturnable<ItemEntity> cir) { | ||
ServerNetworking.INSTANCE.changePositionProvider(stack, cir.getReturnValue()); | ||
Entity entity = cir.getReturnValue(); | ||
if (entity != null) BridgesKt.changePosition(stack, entity); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.