-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 1.16.1-Trinkets
- Loading branch information
Showing
23 changed files
with
367 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#Thu Jul 23 21:34:18 PDT 2020 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip |
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,8 @@ | ||
## This file must *NOT* be checked into Version Control Systems, | ||
# as it contains information specific to your local configuration. | ||
# | ||
# Location of the SDK. This is only used by Gradle. | ||
# For customization when using a Version Control System, please read the | ||
# header note. | ||
#Thu Jul 23 21:07:26 PDT 2020 | ||
sdk.dir=C\:\\Users\\Alex Stedman\\AppData\\Local\\Android\\Sdk |
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/oroarmor/netherite_plus/item/NetheriteShieldItem.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,29 @@ | ||
package com.oroarmor.netherite_plus.item; | ||
|
||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.ShieldItem; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.TypedActionResult; | ||
import net.minecraft.util.UseAction; | ||
import net.minecraft.world.World; | ||
|
||
public class NetheriteShieldItem extends ShieldItem { | ||
public NetheriteShieldItem(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
@Override | ||
public UseAction getUseAction(ItemStack stack) { | ||
return UseAction.BLOCK; | ||
} | ||
|
||
@Override | ||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) { | ||
ItemStack itemStack = user.getStackInHand(hand); | ||
user.setCurrentHand(hand); | ||
System.out.println("used"); | ||
return TypedActionResult.consume(itemStack); | ||
} | ||
|
||
} |
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
20 changes: 20 additions & 0 deletions
20
src/main/java/com/oroarmor/netherite_plus/mixin/FishingBobberEntityRendererMixin.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,20 @@ | ||
package com.oroarmor.netherite_plus.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import com.oroarmor.util.item.UniqueItemRegistry; | ||
|
||
import net.minecraft.client.render.entity.FishingBobberEntityRenderer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
|
||
@Mixin(FishingBobberEntityRenderer.class) | ||
public class FishingBobberEntityRendererMixin { | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;")) | ||
private Item getItem(ItemStack stack) { | ||
return UniqueItemRegistry.FISHING_ROD.getDefaultItem(stack.getItem()); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/oroarmor/netherite_plus/mixin/ModelLoaderMixin.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,4 @@ | ||
package com.oroarmor.netherite_plus.mixin; | ||
|
||
public class ModelLoaderMixin { | ||
} |
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
96 changes: 96 additions & 0 deletions
96
src/main/java/com/oroarmor/netherite_plus/recipe/NetheriteShieldDecorationRecipe.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,96 @@ | ||
package com.oroarmor.netherite_plus.recipe; | ||
|
||
import com.oroarmor.netherite_plus.item.NetheritePlusModItems; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.inventory.CraftingInventory; | ||
import net.minecraft.item.BannerItem; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.recipe.RecipeSerializer; | ||
import net.minecraft.recipe.SpecialCraftingRecipe; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.world.World; | ||
|
||
public class NetheriteShieldDecorationRecipe extends SpecialCraftingRecipe { | ||
public NetheriteShieldDecorationRecipe(Identifier identifier) { | ||
super(identifier); | ||
} | ||
|
||
@Override | ||
public boolean matches(CraftingInventory craftingInventory, World world) { | ||
ItemStack itemStack = ItemStack.EMPTY; | ||
ItemStack itemStack2 = ItemStack.EMPTY; | ||
|
||
for (int i = 0; i < craftingInventory.size(); ++i) { | ||
ItemStack itemStack3 = craftingInventory.getStack(i); | ||
if (!itemStack3.isEmpty()) { | ||
if (itemStack3.getItem() instanceof BannerItem) { | ||
if (!itemStack2.isEmpty()) { | ||
return false; | ||
} | ||
|
||
itemStack2 = itemStack3; | ||
} else { | ||
if (itemStack3.getItem() != NetheritePlusModItems.NETHERITE_SHIELD) { | ||
return false; | ||
} | ||
|
||
if (!itemStack.isEmpty()) { | ||
return false; | ||
} | ||
|
||
if (itemStack3.getSubTag("BlockEntityTag") != null) { | ||
return false; | ||
} | ||
|
||
itemStack = itemStack3; | ||
} | ||
} | ||
} | ||
|
||
if (!itemStack.isEmpty() && !itemStack2.isEmpty()) { | ||
return true; | ||
} | ||
return false; | ||
|
||
} | ||
|
||
@Override | ||
public ItemStack craft(CraftingInventory craftingInventory) { | ||
ItemStack itemStack = ItemStack.EMPTY; | ||
ItemStack itemStack2 = ItemStack.EMPTY; | ||
|
||
for (int i = 0; i < craftingInventory.size(); ++i) { | ||
ItemStack itemStack3 = craftingInventory.getStack(i); | ||
if (!itemStack3.isEmpty()) { | ||
if (itemStack3.getItem() instanceof BannerItem) { | ||
itemStack = itemStack3; | ||
} else if (itemStack3.getItem() == NetheritePlusModItems.NETHERITE_SHIELD) { | ||
itemStack2 = itemStack3.copy(); | ||
} | ||
} | ||
} | ||
|
||
if (itemStack2.isEmpty()) { | ||
return itemStack2; | ||
} | ||
CompoundTag compoundTag = itemStack.getSubTag("BlockEntityTag"); | ||
CompoundTag compoundTag2 = compoundTag == null ? new CompoundTag() : compoundTag.copy(); | ||
compoundTag2.putInt("Base", ((BannerItem) itemStack.getItem()).getColor().getId()); | ||
itemStack2.putSubTag("BlockEntityTag", compoundTag2); | ||
return itemStack2; | ||
} | ||
|
||
@Override | ||
@Environment(EnvType.CLIENT) | ||
public boolean fits(int width, int height) { | ||
return width * height >= 2; | ||
} | ||
|
||
@Override | ||
public RecipeSerializer<?> getSerializer() { | ||
return RecipeSerializer.SHIELD_DECORATION; | ||
} | ||
} |
Oops, something went wrong.