Skip to content

Commit

Permalink
Textures
Browse files Browse the repository at this point in the history
  • Loading branch information
M-W-K committed Aug 5, 2024
1 parent 290f21a commit e90db17
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 37 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// 1.20.1 2024-05-01T23:25:16.515952 Item Models: amethystwings
13f817085430cbe2fd48d2729bd6198b5ba65ee0 assets/amethystwings/models/entity/auric_crystal.json
fc48959c4c50c9da4834ea7265cc5e8d269be340 assets/amethystwings/models/entity/energetic_crystal.json
76982afddfe3d384d03932aaffcd8bc8b39dd485 assets/amethystwings/models/entity/hardened_crystal.json
f134a090f95d540dcbdbd773822261b0c2ab0080 assets/amethystwings/models/entity/resonant_crystal.json
b2c8a3e2731c0daec863c6c8ed972fbac2efb32a assets/amethystwings/models/entity/shaped_crystal.json
// 1.20.1 2024-08-04T19:47:48.592347 Item Models: amethystwings
afe33470394890069fac34519a737d27ed03c6d4 assets/amethystwings/models/entity/auric_crystal.json
c83ef7b5c603249b7dacbbe18e513f0c9b792851 assets/amethystwings/models/entity/energetic_crystal.json
abf1f5de82c467c06bd25ef521aa4b7c4e1d1f53 assets/amethystwings/models/entity/hardened_crystal.json
cb223eb758d9a44ea0fed00cdd64652c17b2c0e4 assets/amethystwings/models/entity/resonant_crystal.json
7c5216474e90349e5f63945bf5060b30f3e1e224 assets/amethystwings/models/entity/shaped_crystal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "amethystwings:entity/crystal",
"textures": {
"layer0": "amethystwings:entity/auric_crystal"
"layer0": "amethystwings:block/auric_crystal"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "amethystwings:entity/crystal",
"textures": {
"layer0": "amethystwings:entity/energetic_crystal"
"layer0": "amethystwings:block/energetic_crystal"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "amethystwings:entity/crystal",
"textures": {
"layer0": "amethystwings:entity/hardened_crystal"
"layer0": "amethystwings:block/hardened_crystal"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "amethystwings:entity/crystal",
"textures": {
"layer0": "amethystwings:entity/resonant_crystal"
"layer0": "amethystwings:block/resonant_crystal"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "amethystwings:entity/crystal",
"textures": {
"layer0": "amethystwings:entity/shaped_crystal"
"layer0": "amethystwings:block/shaped_crystal"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Pose;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.Vec3;
Expand All @@ -33,7 +31,7 @@
public class WingsItemStackRenderer extends BlockEntityWithoutLevelRenderer {
public static final WingsModel WINGS_MODEL = new WingsModel(WingsModel.createLayer().bakeRoot());
public static final ModelResourceLocation WINGS_INVENTORY_MODEL = new ModelResourceLocation(MODID, "wings_controller_inventory", "inventory");
public static final ResourceLocation WINGS_TEXTURE = new ResourceLocation(MODID, "textures/entity/wings_controller.png");
public static final ResourceLocation WINGS_TEXTURE = new ResourceLocation(MODID, "textures/block/wings_controller.png");

private final static PoseStack ELYTRA_HELPER = new PoseStack();
private final static ModelPart RIGHT_FAKE_WING = new ModelPart(null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@ protected static ResourceLocation rl(String loc) {

@Override
protected void registerModels() {
crystalModel(RESONANT);
crystalModel(HARDENED);
crystalModel(ENERGETIC);
crystalModel(SHAPED);
crystalModel(AURIC);
}

protected void crystalModel(ResourceLocation loc) {
crystalModel(loc, loc);
crystalModel(RESONANT, rl("block/resonant_crystal"));
crystalModel(HARDENED, rl("block/hardened_crystal"));
crystalModel(ENERGETIC, rl("block/energetic_crystal"));
crystalModel(SHAPED, rl("block/shaped_crystal"));
crystalModel(AURIC, rl("block/auric_crystal"));
}

protected void crystalModel(ResourceLocation destLoc, ResourceLocation texLoc) {
Expand Down
17 changes: 14 additions & 3 deletions src/main/java/com/m_w_k/amethystwings/mixin/PlayerMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
Expand All @@ -22,19 +24,28 @@ private PlayerMixin(EntityType<? extends LivingEntity> p_20966_, Level p_20967_)
super(p_20966_, p_20967_);
}

@Shadow public abstract ItemStack getItemBySlot(EquipmentSlot p_36257_);
@Shadow public abstract @NotNull ItemStack getItemBySlot(@NotNull EquipmentSlot p_36257_);

@Shadow public abstract void startFallFlying();

@Inject(method = "tryToStartFallFlying", at = @At(value = "JUMP", opcode = Opcodes.IFEQ), cancellable = true)
private void extendedElytraCheck(CallbackInfoReturnable<Boolean> cir) {
ItemStack itemStack = this.getItemBySlot(EquipmentSlot.OFFHAND);
if (amethystWings$tryFlyWithStack(EquipmentSlot.MAINHAND) ||
amethystWings$tryFlyWithStack(EquipmentSlot.OFFHAND)) {
cir.setReturnValue(true);
}
}

@Unique
private boolean amethystWings$tryFlyWithStack(EquipmentSlot slot) {
ItemStack itemStack = this.getItemBySlot(slot);
if (itemStack.getItem() instanceof WingsItem item) {
WingsCapability cap = item.getCapability(itemStack);
if (cap.canElytra()) {
this.startFallFlying();
cir.setReturnValue(true);
return true;
}
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"parent": "builtin/entity"
"parent": "builtin/entity",
"gui_light": "front"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions src/main/resources/assets/minecraft/atlases/blocks.json

This file was deleted.

0 comments on commit e90db17

Please sign in to comment.