Skip to content

Commit

Permalink
Update to 24w14potato
Browse files Browse the repository at this point in the history
Signed-off-by: shedaniel <[email protected]>
  • Loading branch information
shedaniel committed Apr 1, 2024
1 parent d4f399c commit 25aa6dc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/1.20.3_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- '**/src/**'
branches:
- "1.20.5"
- "1.20.5-24w14potato"
workflow_dispatch:
inputs:
norelease:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public interface LootEvent {
*
* @see ModifyLootTable#modifyLootTable(ResourceKey, LootTableModificationContext, boolean)
*/
// Event<ModifyLootTable> MODIFY_LOOT_TABLE = EventFactory.createLoop();
Event<ModifyLootTable> MODIFY_LOOT_TABLE = EventFactory.createLoop();

@FunctionalInterface
interface ModifyLootTable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
import net.fabricmc.fabric.api.event.player.UseItemCallback;
// import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
import net.fabricmc.fabric.api.message.v1.ServerMessageDecoratorEvent;
import net.fabricmc.fabric.api.message.v1.ServerMessageEvents;

Expand Down Expand Up @@ -83,7 +83,7 @@ public static void registerCommon() {
AttackBlockCallback.EVENT.register((player, world, hand, pos, face) -> InteractionEvent.LEFT_CLICK_BLOCK.invoker().click(player, hand, pos, face).asMinecraft());
AttackEntityCallback.EVENT.register((player, world, hand, entity, hitResult) -> PlayerEvent.ATTACK_ENTITY.invoker().attack(player, world, entity, hand, hitResult).asMinecraft());

// LootTableEvents.MODIFY.register((key, tableBuilder, source) -> LootEvent.MODIFY_LOOT_TABLE.invoker().modifyLootTable(lootManager, id, new LootTableModificationContextImpl(tableBuilder), source.isBuiltin()));
LootTableEvents.MODIFY.register((key, tableBuilder, source) -> LootEvent.MODIFY_LOOT_TABLE.invoker().modifyLootTable(key, new LootTableModificationContextImpl(tableBuilder), source.isBuiltin()));

ServerMessageDecoratorEvent.EVENT.register(ServerMessageDecoratorEvent.CONTENT_PHASE, (player, component) -> {
ChatEvent.ChatComponent chatComponent = new ChatComponentImpl(component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
package dev.architectury.mixin.fabric;

import dev.architectury.event.events.common.EntityEvent;
import dev.architectury.event.events.common.PlayerEvent;
import dev.architectury.extensions.ItemExtension;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -33,6 +35,13 @@

@Mixin(LivingEntity.class)
public class MixinLivingEntity {
@Inject(method = "drop(Lnet/minecraft/world/item/ItemStack;ZZ)Lnet/minecraft/world/entity/item/ItemEntity;", at = @At("RETURN"), cancellable = true)
private void drop(ItemStack itemStack, boolean bl, boolean bl2, CallbackInfoReturnable<ItemEntity> cir) {
if ((Object) this instanceof Player player && cir.getReturnValue() != null && PlayerEvent.DROP_ITEM.invoker().drop(player, cir.getReturnValue()).isFalse()) {
cir.setReturnValue(null);
}
}

@Inject(method = "hurt", at = @At("HEAD"), cancellable = true)
private void hurt(DamageSource damageSource, float f, CallbackInfoReturnable<Boolean> cir) {
if ((Object) this instanceof Player) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ private void postTick(CallbackInfo ci) {
TickEvent.PLAYER_POST.invoker().tick((Player) (Object) this);
}

@Inject(method = "drop(Lnet/minecraft/world/item/ItemStack;ZZ)Lnet/minecraft/world/entity/item/ItemEntity;", at = @At("RETURN"), cancellable = true)
private void drop(ItemStack itemStack, boolean bl, boolean bl2, CallbackInfoReturnable<ItemEntity> cir) {
if (cir.getReturnValue() != null && PlayerEvent.DROP_ITEM.invoker().drop((Player) (Object) this, cir.getReturnValue()).isFalse()) {
cir.setReturnValue(null);
}
}

@Inject(method = "interactOn", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/entity/player/Player;getItemInHand(Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/item/ItemStack;",
ordinal = 0),
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ org.gradle.daemon=false

platforms=fabric

minecraft_version=24w12a
supported_version=1.20.5 (24w12a)
minecraft_version=24w14potato
supported_version=April Fools (24w14potato)

artifact_type=beta

Expand All @@ -13,8 +13,8 @@ archives_base_name_snapshot=architectury-snapshot
base_version=12.0
maven_group=dev.architectury

fabric_loader_version=0.15.7
fabric_api_version=0.96.12+1.20.5
fabric_loader_version=0.15.9
fabric_api_version=0.96.14+24w14potato
mod_menu_version=9.0.0

forge_version=49.0.14
Expand Down

0 comments on commit 25aa6dc

Please sign in to comment.