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

Avaritia Renders for MetaItems and Materials #2683

Open
wants to merge 170 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
867d96f
Add IControllable to creative energy emitter (#2248)
serenibyss Dec 4, 2023
a36667f
fix using client only method for harder bed recipe names (#2253)
TechLord22 Dec 5, 2023
012b56b
Fix plasma temps all being the default temp (#2256)
ALongStringOfNumbers Dec 6, 2023
c48d179
Update build script version to 1701739812 (#2257)
serenibyss Dec 6, 2023
7247805
Re-implement walking speed bonus (#2251)
Tictim Dec 7, 2023
ac46da2
Rework Generators 2.0 ™️ (#2255)
ghzdude Dec 7, 2023
625c296
Fix issues with ore byproduct page (#2262)
serenibyss Dec 7, 2023
d298380
Clean up and add particle effects for machines (#2249)
serenibyss Dec 7, 2023
4a4205c
Fix fluid output trim losing some fluids (#2268)
serenibyss Dec 8, 2023
a6f5057
fix crash with fluid filters with null delegate containers (#2273)
TechLord22 Dec 10, 2023
471ef1f
fix data stick entry removal from AL (#2279)
TechLord22 Dec 10, 2023
195d75e
Fix Large Gas Turbine not displaying Max Voltage when fully spun up (…
ghzdude Dec 11, 2023
bbf9b98
Update build script version to 1702244235 (#2282)
serenibyss Dec 11, 2023
d09b517
2.8.3
serenibyss Dec 12, 2023
34408eb
Fix addFluid expansion method for GrS/CT (#2287)
serenibyss Dec 12, 2023
62baffc
More tool compat (#2292)
serenibyss Dec 13, 2023
4690f2c
Fix silicon bee crash (#2299)
serenibyss Dec 15, 2023
9faa5c0
Fix using MV muffler in EBF JEI preview (#2298)
serenibyss Dec 15, 2023
26a9433
Allow specifying NBT matching on Research ItemStacks (#2294)
ALongStringOfNumbers Dec 15, 2023
b1f050b
Attempt to clarify tooltip (#2300)
ALongStringOfNumbers Dec 15, 2023
4322695
Chisel module (#2290)
serenibyss Dec 15, 2023
46b30c7
Fix pipe restrictor render on bottom face (#2302)
serenibyss Dec 16, 2023
025d469
Fix battery slot charge flickering (#2305)
serenibyss Dec 16, 2023
d2d4420
Tweak muffler effect API (#2286)
serenibyss Dec 16, 2023
c86e116
log incomplete packet reads in NetworkHandler (#2288)
TechLord22 Dec 16, 2023
d58a335
Fusion rebalancing (#2252)
serenibyss Dec 16, 2023
8f43bf1
Fix plasma temp NPE for plasma-only materials (#2306)
serenibyss Dec 17, 2023
028562c
Ore Dictionary Filter Update (#2296)
Tictim Dec 18, 2023
d41a036
invalidate pipenet routepaths on chunk unload (#2303)
TechLord22 Dec 18, 2023
af3454b
Allow electrolyzing more hydrocarbons (#2258)
serenibyss Dec 18, 2023
2bc744b
2.8.4
serenibyss Dec 18, 2023
b5ddb56
only access worldpipenet on server (#2310)
TechLord22 Dec 18, 2023
58c2613
2.8.5
serenibyss Dec 18, 2023
b08b88c
update GHA workflows (#2270)
TechLord22 Dec 29, 2023
0a772ff
Fix a couple incomplete recieveCustomData calls (#2322)
ALongStringOfNumbers Dec 29, 2023
b36f25e
fix test and formatting action concurrency groups
TechLord22 Dec 29, 2023
9e63c51
Add some GT items to ExtraBees alveary mutator (#2315)
serenibyss Dec 29, 2023
f1100a9
Update build script version to 1702805890 (#2309)
serenibyss Dec 29, 2023
1164855
Fix large turbine recipe selection (#2324)
josiah-roberts Dec 29, 2023
fb88041
Use locale formatting where possible in WAILA and The One Probe (#2327)
josiah-roberts Dec 29, 2023
230fc80
Use EU/t for digital interface (#2329)
josiah-roberts Dec 31, 2023
2e64d06
Update ru_ru.lang (#2307)
marisathewitch Jan 1, 2024
57b40a7
Improve Lighter Opening (#2323)
ALongStringOfNumbers Jan 3, 2024
8070829
Fix some JEI plugin issues (#2337)
TechLord22 Jan 5, 2024
c93d91c
Fix treated wood stick saw recipe (#2339)
serenibyss Jan 6, 2024
c7bf6d3
update zh_cn.lang (#2334)
iouter Jan 8, 2024
60b6ffe
Update build script version to 1704659416 (#2341)
serenibyss Jan 8, 2024
8c48186
prevent potential ThreadLocal memory leaks (#2320)
TechLord22 Jan 10, 2024
6e1a167
Make translation key of MetaItems modifiable (#2259)
Tictim Jan 11, 2024
fcee78a
Update build script version to 1705076830 (#2344)
serenibyss Jan 14, 2024
6d327ff
Overload AbstractRecipeLogic functions (#2311)
bruberu Jan 14, 2024
55090d7
Fix erroring material handlers when liquids don't exist (#2343)
bruberu Jan 14, 2024
b17be0d
Fix reservoir hatch issues (#2349)
serenibyss Jan 16, 2024
d1a5179
Fix LCE/ECE obstruction check (#2346)
serenibyss Jan 16, 2024
2f79ee8
Fix electric tool damage config innacuracy (#2350)
M-W-K Jan 16, 2024
688e537
weaken recipe logic type in WorkableTieredMetaTileEntity (#2342)
TechLord22 Jan 16, 2024
80aa0b0
Fix Issues with Fusion Reactor Overclocking (#2352)
ghzdude Jan 19, 2024
e682821
Separate PSS average IO into in and out (#2353)
serenibyss Jan 19, 2024
627d6f1
fix gt tile entities not rendering in AE2 pattern outputs (#2319)
TechLord22 Jan 20, 2024
4ab90cf
Cherrypick of #2325
serenibyss Jan 21, 2024
971d458
2.8.6
serenibyss Jan 21, 2024
9f96b73
Fix Player Unable to Climb Frames on Certain Pipes (#2359)
ghzdude Jan 29, 2024
c0615f1
Fix recipe properties offsetting info text too much (#2360)
loxoDev Jan 29, 2024
2957212
Fix central monitor jei page (#2364)
serenibyss Jan 30, 2024
5d3ef8a
Fix unlocalized name of GT fluids in drums (#2361)
ALongStringOfNumbers Jan 30, 2024
1cbc1aa
Add OpenComputers functions for maintenance problems (#2356)
serenibyss Jan 30, 2024
fb23072
Add Powderbarrel and ITNT (#2314)
serenibyss Jan 30, 2024
a74c7e9
Refactor other mod id handling (#2354)
serenibyss Jan 31, 2024
46411cf
Update zh_cn.lang (#2362)
iouter Jan 31, 2024
15043f9
Clean up MetaTileEntities class formatting (#2371)
serenibyss Feb 2, 2024
3865f22
Set Hardness and Resistance to LDP Blocks (#2370)
ghzdude Feb 4, 2024
e5f0194
Fix hasEnoughPower() check in ARL (#2365)
serenibyss Feb 4, 2024
f43a676
Use drain/extract for Recipe#matches (#2358)
serenibyss Feb 4, 2024
cf313f0
Fix part sharing tooltip missing on some parts (#2375)
serenibyss Feb 5, 2024
26c341e
re-enable sharing for laser hatches (#2376)
htmlcsjs Feb 8, 2024
0750ca5
Config and API for tick acceleration blocking (#2381)
serenibyss Feb 11, 2024
86dd52c
fix material tree crash (#2382)
TechLord22 Feb 12, 2024
d20820e
fix #2382 (#2386)
TechLord22 Feb 16, 2024
b816f00
Update build script version to 1707682661 (#2380)
serenibyss Feb 17, 2024
ee33811
Use GTCEu maven (#2379)
serenibyss Feb 17, 2024
4d18a9f
Fix parallel overclocks using the wrong voltage for multiblocks (#2390)
serenibyss Feb 19, 2024
4588f6d
Temporary hotfix for research ID lookup (#2391)
serenibyss Feb 19, 2024
f0c4ede
Use chestWood oredict for ULV and LV item buses (#2383)
TechLord22 Feb 19, 2024
c70615d
add maven to GHA publish action
serenibyss Feb 19, 2024
820d0bc
cherrypick fix
serenibyss Feb 19, 2024
fd74473
2.8.7
serenibyss Feb 19, 2024
f2a6d84
fix maven upload action
serenibyss Feb 19, 2024
8424777
fix quantum tank not always fully reading custom data (#2396)
TechLord22 Mar 3, 2024
8810f75
Fix NPE from facing being null when drawing grid overlays (#2401)
M-W-K Mar 3, 2024
d71f901
Drain Tricorder energy only when in survival (#2402)
YoungOnionMC Mar 3, 2024
a6ead71
Advanced Stocking Input Bus + Advanced Stocking Input Hatch (#2367)
serenibyss Mar 3, 2024
35b2ffb
Electric Wirecutter (#2404)
serenibyss Mar 3, 2024
91afeb2
Allow PSS to display on CM (#2405)
serenibyss Mar 7, 2024
43bf1a7
Fix server crashes with alarms (#2411)
bruberu Mar 10, 2024
bbf45f2
fix pipe capability retrieval logic (#2415)
TechLord22 Mar 16, 2024
6e5459d
fix solar panels not outputting to cables (#2416)
TechLord22 Mar 16, 2024
74197e8
Update GroovyScript & improve material API for groovy (#2389)
brachy84 Mar 17, 2024
d92e8e3
allow SMD diodes in low tier diode block recipes (#2423)
TechLord22 Mar 24, 2024
23c7ab6
check for a valid MTE before rendering (#2424)
TechLord22 Mar 25, 2024
d40521c
Fix link to GT IMPACT in readme (#2427)
kumquat-ir Mar 27, 2024
d44dcda
Fix fluid drilling rig display units (#2417)
M-W-K Mar 27, 2024
a718606
Update zh_cn.lang (#2413)
iouter Mar 27, 2024
68ff661
Allow Data Stick to copy-paste ME bus settings (#2419)
serenibyss Mar 28, 2024
132fc12
Fix LCE/ECE from parallelizing too much (#2426)
ghzdude Mar 28, 2024
a5a1543
add ItemStack inputNBT method (#2431)
TechLord22 Mar 28, 2024
8e5bb13
fix MTE block opacity (#2440)
TechLord22 Apr 4, 2024
7d4a243
minor allocation optimization for GTUtility#canSeeSunClearly (#2441)
TechLord22 Apr 4, 2024
902d75d
Fix potential MetaTileEntity NPE when calling a server side method on…
ghzdude Apr 4, 2024
95741c7
Add stairsRecipeName (#2435)
tier940 Apr 4, 2024
8830bfb
Improve the Quantum Storage Renderer (#2318)
ghzdude Apr 4, 2024
3fdf8b8
Allow ITNT and PowderBarrels to make AE singularities (#2442)
ALongStringOfNumbers Apr 4, 2024
e4aa94d
adjust recipe input expected cache size dynamically (#2331)
TechLord22 Apr 4, 2024
567d70d
GroovyScript 1.0.0 (#2425)
brachy84 Apr 4, 2024
e701f72
fix primitive multiblocks allowing automation through their controlle…
TechLord22 Apr 14, 2024
08fc0ee
Waila/Hwyla Provider Fixes (#2451)
TechLord22 Apr 14, 2024
92fba02
Fix blocks not being able to choose preferred meta values in previews…
bruberu Apr 14, 2024
2935824
Fix display of sifter byproducts for materials with no exquisite (#2444)
kumquat-ir Apr 14, 2024
2f8d115
Fix possible NPE from MultiblockDisplayText (#2453)
vrejhead Apr 24, 2024
71405be
fix NPE with null fluids in quantum tanks (#2443)
TechLord22 Apr 24, 2024
47d8185
Remove NuclearCraft ASM (#2467)
kumquat-ir May 4, 2024
1c62193
Update zh_cn.lang (#2445)
iouter May 5, 2024
9015d5d
Fusion bloom fix & other bloom effect API modifications (#2470)
Tictim May 7, 2024
ed99845
Inital Vintagium Support (#2463)
htmlcsjs May 7, 2024
1d30440
Fix Ore Dict Ingredients When Changing OreDicts with CT & GS (#2456)
IntegerLimit May 7, 2024
0cc4d80
Update ja_JP lang for 2.8.8 (#2459)
tier940 Apr 24, 2024
27cb163
2.8.8
ALongStringOfNumbers May 7, 2024
89b2359
spotless issue
kumquat-ir May 7, 2024
1ef997e
Fix the large turbine rotor texture (#2485)
M-W-K Jun 2, 2024
c56fd68
Small QoL Bee Update (#2458)
Rundas01 Jun 2, 2024
9ed5f86
Fix excessive packets & re-renders with AEHostable parts (#2487)
M-W-K Jun 2, 2024
066d3fb
Allow dynamic hatch placement on Distillation Tower (#2477)
M-W-K Jun 4, 2024
c273104
Add a faster recipe for drilling fluid with distilled water (#2484)
Zorbatron Jun 4, 2024
8485ac3
fix pyrolyse speed (#2449)
TechLord22 Jun 4, 2024
c70ac18
Brute-force Fix of RAM Usage Problem When Using Alfheim (#2475)
MCTian-mi Jun 4, 2024
e0d6dfd
Clean up AEHostable part fix (#2488)
M-W-K Jun 4, 2024
d96f4ab
Updating bees using the new Mutation Condition (#2486)
Rundas01 Jun 5, 2024
d0fe83d
dependency updates
serenibyss Jun 9, 2024
cef9180
Allow recipe logic to set EU/t and speed discounts (#2496)
serenibyss Jun 18, 2024
0e8f6d2
Glass tube recycling (#2509)
Zorbatron Jun 22, 2024
4b76678
Improve assembly line laser render (#2495)
M-W-K Jun 22, 2024
1dca2cb
Add Polybenzimidazole Block Conversion Recipes (#2511)
IntegerLimit Jun 29, 2024
cdf0e8b
GroovyScript 1.1.0 (#2506)
brachy84 Jul 2, 2024
ec6b70e
Fix liquid and gas registry key functions overlapping (#2514)
bruberu Jul 4, 2024
6734d8c
fix failing builds due to Vintagium (#2521)
TechLord22 Jul 6, 2024
0503694
2.8.9
ALongStringOfNumbers Jul 6, 2024
fecdfea
Improvement to DT hatch logic (#2524)
M-W-K Jul 7, 2024
e312c8b
Update ru_RU lang for 2.8.9 (#2523)
marisathewitch Jul 7, 2024
263620e
Update Gradle and related files (#2522)
ALongStringOfNumbers Jul 7, 2024
809a581
Fix the lighter behaviour (#2526)
MCTian-mi Jul 7, 2024
27a55e0
Fix EUt usage of HPCA with custom higher tier Components (#2512)
Synthitic Jul 7, 2024
af40e52
Update build script version to 1720106721 (#2503)
serenibyss Jul 4, 2024
7d5337d
bump GRS and CT versions in gradle (#2528)
TechLord22 Jul 7, 2024
135982d
Update and Fix ja_jp.lang for 2.8.10 (#2534)
MrKono Jul 8, 2024
071a3dc
Fix Miner Pipe Deleting TileEntities (#2529)
ghzdude Jul 7, 2024
950fcd8
Make drums no longer require a Material (#2527)
TechLord22 Jul 8, 2024
8f485c1
fix crash with Forestry integration (#2531)
TechLord22 Jul 8, 2024
9fe140f
2.8.10
TechLord22 Jul 10, 2024
bc251e4
Added Avaritia Cosmic Render for MetaItems
jude123412 Dec 8, 2024
7280648
MetaPrefixItem Cosmic Effects
jude123412 Dec 15, 2024
6c93acb
Merge branch 'GTHH-GregTech-2.8.10' of https://github.com/jude123412/…
jude123412 Dec 15, 2024
f095aae
Fix Dependencies Post Merge
jude123412 Dec 15, 2024
9b8ec4e
Update MetaItem.java
jude123412 Dec 19, 2024
00640d6
Update CosmicItemRenderer.java
jude123412 Dec 20, 2024
2bbcd6e
Added Api Files from Avaritia
jude123412 Dec 21, 2024
04f8246
SpotlessCheck and SpotlessApply
jude123412 Dec 21, 2024
ac70ac1
Update CosmicItemRenderer.java
jude123412 Dec 21, 2024
14abcab
Create permission5.png
jude123412 Dec 22, 2024
5fc8809
Remove CosmicItemRenderer Class
jude123412 Dec 28, 2024
1a6340d
Remove Avaritia Textures Import
jude123412 Dec 28, 2024
22d6eaa
Merge branch 'master' into GTHH-GregTech-2.8.10
jude123412 Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ dependencies {
compileOnly("curse.maven:journeymap-32274:5172461") // Journeymap 5.7.1p3
compileOnly("curse.maven:voxelmap-225179:3029445") // VoxelMap 1.9.28
compileOnly("curse.maven:xaeros-263420:5394758") // Xaero's Minimap 24.2.0
compileOnly rfg.deobf("curse.maven:avaritia-1-1x-unofficial-1165010:6029951") // Avaritia 3.3.0.39
compileOnly rfg.deobf("curse.maven:opencomputers-223008:5274236") // OpenComputers 1.8.5+179e1c3
compileOnly rfg.deobf("curse.maven:hwyla-253449:2568751") // HWYLA 1.8.26-B41
compileOnly rfg.deobf("curse.maven:baubles-227083:2518667") // Baubles 1.5.2
Expand All @@ -61,7 +62,7 @@ dependencies {

// Mods with Soft compat but which have no need to be in code, such as isModLoaded() checks and getModItem() recipes.
// Uncomment any of these to test them in-game.

// runtimeOnlyNonPublishable rfg.deobf("curse.maven:avaritia-1-1x-unofficial-1165010:6029951") // Avaritia 3.3.0.39
// runtimeOnlyNonPublishable rfg.deobf("curse.maven:beebetteratbees-244516:2627215") // BeeBetterAtBees 2.0.3 (recommended to enable when testing Forestry compat)
// runtimeOnlyNonPublishable rfg.deobf("curse.maven:jei-bees-248370:2490058") // JEIBees 0.9.0.5 (recommended to enable when testing Forestry compat)
// runtimeOnlyNonPublishable rfg.deobf("curse.maven:binnies-mods-223525:2916129") // Binnie 2.5.1.203
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ modGroup = gregtech

# Version of your mod.
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
modVersion = 2.8.7-beta
modVersion=2.8.10-beta

# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version)
includeMCVersionJar = true
Expand Down Expand Up @@ -51,6 +51,8 @@ gradleTokenVersion = VERSION
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage =
# If you want to keep your API code in src/api instead of src/main
useSrcApiPath=false

# If you want to keep your API code in src/api instead of src/main
useSrcApiPath=false
Expand Down Expand Up @@ -97,6 +99,7 @@ includeCommonDevEnvMods = true
stripForgeRequirements=false



# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
usesShadowedDependencies = false
Expand Down
Binary file added permission5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/api/java/morph/avaritia/api/ICosmicRenderItem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package morph.avaritia.api;

import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nullable;

/**
* Any item implementing this that also binds itself to TODO INPUT MODEL NAME HERE.
* Will automatically have the cosmic shader applied to the mask with the given opacity.
*/
public interface ICosmicRenderItem {

/**
* The mask where the cosmic overlay will be.
*
* @param stack The stack being rendered.
* @param player The entity holding the item, May be null, If null assume either inventory, or ground.
* @return The masked area where the cosmic overlay will be.
*/
@SideOnly (Side.CLIENT)
TextureAtlasSprite getMaskTexture(ItemStack stack, @Nullable EntityLivingBase player);

/**
* The opacity that the mask overlay will be rendered with.
*
* @param stack The stack being rendered.
* @param player The entity holding the item, May be null, If null assume either inventory, or ground.
* @return The opacity that the mask overlay will be rendered with.
*/
@SideOnly (Side.CLIENT)
float getMaskOpacity(ItemStack stack, @Nullable EntityLivingBase player);
}
25 changes: 25 additions & 0 deletions src/api/java/morph/avaritia/api/IHaloRenderItem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package morph.avaritia.api;

import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public interface IHaloRenderItem {

@SideOnly (Side.CLIENT)
boolean shouldDrawHalo(ItemStack stack);

@SideOnly (Side.CLIENT)
TextureAtlasSprite getHaloTexture(ItemStack stack);

@SideOnly (Side.CLIENT)
int getHaloColour(ItemStack stack);

@SideOnly (Side.CLIENT)
int getHaloSize(ItemStack stack);

@SideOnly (Side.CLIENT)
boolean shouldDrawPulse(ItemStack stack);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package morph.avaritia.api.registration;

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
* Implemented on an item for model registration, completely arbitrary.
*/
public interface IModelRegister {

/**
* Called when it is time to initialize models in preInit.
*/
@SideOnly (Side.CLIENT)
void registerModels();

}
13 changes: 13 additions & 0 deletions src/main/java/gregtech/GregTechMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import gregtech.api.GTValues;
import gregtech.api.GregTechAPI;
import gregtech.api.items.metaitem.MetaItem;
import gregtech.api.modules.ModuleContainerRegistryEvent;
import gregtech.api.persistence.PersistentData;
import gregtech.api.util.Mods;
import gregtech.client.utils.BloomEffectUtil;
import gregtech.client.utils.BloomEffectVintagiumUtil;
import gregtech.modules.GregTechModules;
import gregtech.modules.ModuleManager;

Expand All @@ -26,6 +29,10 @@
import net.minecraftforge.fml.common.event.FMLServerStoppedEvent;
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;

import codechicken.lib.texture.TextureUtils;

import static gregtech.api.util.Mods.Avaritia;

@Mod(modid = GTValues.MODID,
name = GTValues.MOD_NAME,
acceptedMinecraftVersions = "[1.12.2,1.13)",
Expand All @@ -46,6 +53,9 @@ public GregTechMod() {
FluidRegistry.enableUniversalBucket();
if (FMLCommonHandler.instance().getSide().isClient()) {
BloomEffectUtil.init();
if (Mods.Vintagium.isModLoaded()) {
BloomEffectVintagiumUtil.init();
}
}
}

Expand All @@ -63,6 +73,9 @@ public void onConstruction(FMLConstructionEvent event) {
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
moduleManager.onPreInit(event);
if (Avaritia.isModLoaded()) {
TextureUtils.addIconRegister(new MetaItem.MetaValueItem.CosmicTexture());
}
}

@EventHandler
Expand Down
159 changes: 151 additions & 8 deletions src/main/java/gregtech/api/items/materialitem/MetaPrefixItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,30 @@
import gregtech.api.GTValues;
import gregtech.api.damagesources.DamageSources;
import gregtech.api.items.armor.ArmorMetaItem;
import gregtech.api.items.metaitem.MetaItem.MetaValueItem.CosmicTexture;
import gregtech.api.items.metaitem.StandardMetaItem;
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.Materials;
import gregtech.api.unification.material.info.MaterialIconSet;
import gregtech.api.unification.material.properties.CosmicProperty;
import gregtech.api.unification.material.properties.DustProperty;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.api.unification.material.properties.ToolProperty;
import gregtech.api.unification.material.registry.MaterialRegistry;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.api.unification.stack.UnificationEntry;
import gregtech.api.util.Mods;
import gregtech.common.creativetab.GTCreativeTabs;

import morph.avaritia.client.render.item.CosmicHaloItemRender;

import net.minecraft.block.BlockCauldron;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
Expand All @@ -29,23 +36,41 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import codechicken.lib.model.ModelRegistryHelper;
import codechicken.lib.util.TransformUtils;
import it.unimi.dsi.fastutil.shorts.Short2ObjectOpenHashMap;
import morph.avaritia.api.ICosmicRenderItem;
import morph.avaritia.api.IHaloRenderItem;
import morph.avaritia.api.registration.IModelRegister;
import morph.avaritia.init.AvaritiaTextures;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

public class MetaPrefixItem extends StandardMetaItem {
import java.util.*;

import static gregtech.api.util.Mods.Avaritia;

@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.ICosmicRenderItem")
@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.IHaloRenderItem")
@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.api.registration.IModelRegister")
@Optional.Interface(
modid = Mods.Names.AVARITIA,
iface = "morph.avaritia.init.AvaritiaTextures")
public class MetaPrefixItem extends StandardMetaItem implements IHaloRenderItem, ICosmicRenderItem,
IModelRegister {

private final MaterialRegistry registry;
private final OrePrefix prefix;

public static final Map<OrePrefix, OrePrefix> purifyMap = new HashMap<>();

static {
Expand Down Expand Up @@ -120,13 +145,24 @@ public void registerModels() {
Map<Short, ModelResourceLocation> alreadyRegistered = new Short2ObjectOpenHashMap<>();
for (short metaItem : metaItems.keySet()) {
MaterialIconSet materialIconSet = getMaterial(metaItem).getMaterialIconSet();

short registrationKey = (short) (prefix.id + materialIconSet.id);
if (!alreadyRegistered.containsKey(registrationKey)) {
ResourceLocation resourceLocation = Objects.requireNonNull(prefix.materialIconType)
.getItemModelPath(materialIconSet);
ModelBakery.registerItemVariants(this, resourceLocation);
alreadyRegistered.put(registrationKey, new ModelResourceLocation(resourceLocation, "inventory"));

if (Avaritia.isModLoaded()) {
ModelResourceLocation location = new ModelResourceLocation(resourceLocation, "inventory");
IBakedModel wrapped = new CosmicHaloItemRender(TransformUtils.DEFAULT_ITEM,
(modelRegistry) -> modelRegistry.getObject(location));
ModelRegistryHelper.register(location, wrapped);

String processedLocation = resourceLocation.toString().replace("gregtech:", "gregtech:items/");
String processedIdentifier = resourceLocation.toString()
.replace("gregtech:material_sets", "identifier");
CosmicTexture.registerSpecialMaskIcon(processedIdentifier + "_mask", processedLocation + "_mask");
}
}
ModelResourceLocation resourceLocation = alreadyRegistered.get(registrationKey);
metaItemsModels.put(metaItem, resourceLocation);
Expand Down Expand Up @@ -273,4 +309,111 @@ protected void addMaterialTooltip(@NotNull List<String> lines, @NotNull ItemStac
lines.addAll(this.prefix.tooltipFunc.apply(getMaterial(itemStack)));
}
}

@Override
@SideOnly(Side.CLIENT)
public boolean shouldDrawHalo(ItemStack stack) {
Material material = getMaterial(stack);
assert material != null;

CosmicProperty prop = material.getProperty(PropertyKey.COSMIC);

if (material.hasProperty(PropertyKey.COSMIC) && prop.getShouldDrawHalo()) {
return prop.getShouldDrawHalo();
} else {
return false;
}
}

@Override
@SideOnly(Side.CLIENT)
public TextureAtlasSprite getHaloTexture(ItemStack stack) {
Material material = getMaterial(stack);
assert material != null;

CosmicProperty prop = material.getProperty(PropertyKey.COSMIC);

if (material.hasProperty(PropertyKey.COSMIC) && prop.getHaloTexture() != null) {
return CosmicTexture.haloTextures.get(prop.getHaloTexture());
} else {
return AvaritiaTextures.HALO;
}
}

@Override
@SideOnly(Side.CLIENT)
public int getHaloColour(ItemStack stack) {
Material material = getMaterial(stack);
assert material != null;

CosmicProperty prop = material.getProperty(PropertyKey.COSMIC);

if (material.hasProperty(PropertyKey.COSMIC) && prop.getHaloColour() != null) {
return Integer.decode("0x7F" + prop.getHaloColour());
} else {
return 0;
}
}

@Override
@SideOnly(Side.CLIENT)
public int getHaloSize(ItemStack stack) {
Material material = getMaterial(stack);
assert material != null;

CosmicProperty prop = material.getProperty(PropertyKey.COSMIC);

if (material.hasProperty(PropertyKey.COSMIC) && prop.getHaloSize() != 0) {
return prop.getHaloSize();
} else {
return 0;
}
}

@Override
@SideOnly(Side.CLIENT)
public boolean shouldDrawPulse(ItemStack stack) {
Material material = getMaterial(stack);
assert material != null;

CosmicProperty prop = material.getProperty(PropertyKey.COSMIC);

if (material.hasProperty(PropertyKey.COSMIC) && prop.getHaloPulse()) {
return prop.getHaloPulse();
} else {
return false;
}
}

@SideOnly(Side.CLIENT)
public TextureAtlasSprite getMaskTexture(ItemStack stack, EntityLivingBase player) {
Material material = getMaterial(stack);
assert material != null;
CosmicProperty prop = material.getProperty(PropertyKey.COSMIC);

if (material.hasProperty(PropertyKey.COSMIC) && prop.getMaskOpacity() != null) {
int meta = stack.getMetadata();
MaterialIconSet materialIconSet = getMaterial(meta).getMaterialIconSet();
ResourceLocation resourceLocation = Objects.requireNonNull(prefix.materialIconType)
.getItemModelPath(materialIconSet);
String identifier = resourceLocation.toString().replace("gregtech:material_sets", "identifier");
return CosmicTexture.specialMaskTextures.get(identifier + "_mask");
} else {
return CosmicTexture.specialMaskTextures.get("fallback");
}
}

@SideOnly(Side.CLIENT)
public float getMaskOpacity(ItemStack stack, EntityLivingBase player) {
Material material = getMaterial(stack);
assert material != null;

CosmicProperty prop = material.getProperty(PropertyKey.COSMIC);

if (material.hasProperty(PropertyKey.COSMIC) && prop.getMaskOpacity() != null) {
return prop.getMaskOpacity();
} else {
return 0.0f;
}
}
}
Loading