Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1128 and #2130 #1839

Open
wants to merge 3 commits into
base: 1.20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ dependencies {

mixin {
add sourceSets.main, "citadel.refmap.json"
add sourceSets.main, "alexsmobs.refmap.json"
config 'citadel.mixins.json'
config 'alexsmobs.mixins.json'
}

// Example for how to get properties into the manifest for reading by the runtime..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Play
ItemStack itemStack = player.getItemInHand(handIn);
int setContent = -1;
if(contents == 0){
if(itemStack.is(AMTagRegistry.HUMMINGNBIRD_FEEDER_SWEETENERS)){
if(itemStack.is(AMTagRegistry.HUMMINGBIRD_FEEDER_SWEETENERS)){
setContent = 2;
useItem(player, itemStack, false);
}else if(itemStack.getItem() == waterBottle.getItem() && ItemStack.isSameItemSameTags(waterBottle, itemStack)){
setContent = 1;
useItem(player, itemStack, true);
}
}else if(contents == 1){
if(itemStack.is(AMTagRegistry.HUMMINGNBIRD_FEEDER_SWEETENERS)){
if(itemStack.is(AMTagRegistry.HUMMINGBIRD_FEEDER_SWEETENERS)){
setContent = 3;
useItem(player, itemStack, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public class AMTagRegistry {
public static final TagKey<Item> GRIZZLY_BREEDABLES = registerItemTag("grizzly_breedables");
public static final TagKey<Item> GRIZZLY_TAMEABLES = registerItemTag("grizzly_tameables");
public static final TagKey<Item> HUMMINGBIRD_BREEDABLES = registerItemTag("hummingbird_breedables");
public static final TagKey<Item> HUMMINGNBIRD_FEEDER_SWEETENERS = registerItemTag("hummingnbird_feeder_sweeteners");
public static final TagKey<Item> HUMMINGBIRD_FEEDER_SWEETENERS = registerItemTag("hummingbird_feeder_sweeteners");
public static final TagKey<Item> JERBOA_BREEDABLES = registerItemTag("jerboa_breedables");
public static final TagKey<Item> JERBOA_BEGS_FOR = registerItemTag("jerboa_begs_for");
public static final TagKey<Item> KANGAROO_BREEDABLES = registerItemTag("kangaroo_breedables");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.github.alexthe666.alexsmobs.mixin.client;

import com.github.alexthe666.alexsmobs.item.AMItemRegistry;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.layers.CapeLayer;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.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(CapeLayer.class)
public class CapeLayerMixin {

@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/player/AbstractClientPlayer;FFFFFF)V",
remap = true,
cancellable = true,
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/player/AbstractClientPlayer;getItemBySlot(Lnet/minecraft/world/entity/EquipmentSlot;)Lnet/minecraft/world/item/ItemStack;"
)
)
private void am_render(PoseStack poseStack, MultiBufferSource buffer, int packedLight, AbstractClientPlayer livingEntity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, CallbackInfo ci) {
ItemStack itemstack = livingEntity.getItemBySlot(EquipmentSlot.CHEST);
if (itemstack.is(AMItemRegistry.TARANTULA_HAWK_ELYTRA.get())) ci.cancel();
}
}
15 changes: 15 additions & 0 deletions src/main/resources/alexsmobs.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"required": true,
"package": "com.github.alexthe666.alexsmobs.mixin",
"compatibilityLevel": "JAVA_17",
"target": "@env(DEFAULT)",
"refmap": "alexsmobs.refmap.json",
"mixins": [],
"client": [
"client.CapeLayerMixin"
],
"injectors": {
"defaultRequire": 1
},
"minVersion": "0.8"
}