diff options
| author | Roman / Nea <roman.graef@gmail.com> | 2022-04-18 17:33:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-18 17:33:32 +0200 |
| commit | 2692193e54e4dd6c0117dcdb85368dc83bb04f1a (patch) | |
| tree | 96f01454c404ac04a46ea0d9bf684c7dc5619a57 /src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java | |
| parent | 9fe86ccb4d30b78826e513a6576027ca6e4c1600 (diff) | |
| download | notenoughupdates-2692193e54e4dd6c0117dcdb85368dc83bb04f1a.tar.gz notenoughupdates-2692193e54e4dd6c0117dcdb85368dc83bb04f1a.tar.bz2 notenoughupdates-2692193e54e4dd6c0117dcdb85368dc83bb04f1a.zip | |
Mob loot recipe PR (#81)
* entity renderer (somewhat functionaL)
* more modifiers and entities
* Fix cookie fuckup
* add neu repo as resource pack, cause why not at this point
* add tabs, because i can
* add extra skin parts and make less tabs
* hot tall men
* fix texture offsets and also parts:true
* some untested changes
* still broken, but better (just like me (stop being edgy nea ( no u ))))
* stuff (with er skeletons
* niceities
* skytils interop
* horseys
* horseys ouch
* panos
* stupid tests :angery:
* NPE
* add drop chance
* colored leather armo
* finish off
* move shit into hover cause items look pretty terrible
* Update 2.1.md
* better recipe display name
* always show mobs toggle
* moving parts
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index 31499f7f..5fac9208 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -9,6 +9,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.entity.EntityPlayerSP; @@ -175,8 +176,13 @@ public class Utils { } public static void drawItemStackWithText(ItemStack stack, int x, int y, String text) { - if (stack == null) return; + drawItemStackWithText(stack, x, y, text, false); + } + public static void drawItemStackWithText(ItemStack stack, int x, int y, String text, boolean skytilsRarity) { + if (stack == null) return; + if (skytilsRarity) + SkytilsCompat.renderSkytilsRarity(stack, x, y); RenderItem itemRender = Minecraft.getMinecraft().getRenderItem(); disableCustomDungColours = true; @@ -190,11 +196,13 @@ public class Utils { } public static void drawItemStack(ItemStack stack, int x, int y) { - if (stack == null) return; - drawItemStackWithText(stack, x, y, null); } + public static void drawItemStack(ItemStack stack, int x, int y, boolean skytilsRarity) { + drawItemStackWithText(stack, x, y, null, skytilsRarity); + } + private static final EnumChatFormatting[] rainbow = new EnumChatFormatting[]{ EnumChatFormatting.RED, EnumChatFormatting.GOLD, @@ -767,6 +775,9 @@ public class Utils { public static ItemStack createItemStack(Item item, String displayname, String... lore) { return createItemStack(item, displayname, 0, lore); } + public static ItemStack createItemStack(Block item, String displayname, String... lore) { + return createItemStack(Item.getItemFromBlock(item), displayname, lore); + } public static ItemStack createItemStack(Item item, String displayname, int damage, String... lore) { ItemStack stack = new ItemStack(item, 1, damage); |
