mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-18 03:25:17 +00:00
Co-authored-by: Eclipse-Sol <[email protected]>
This commit is contained in:
1 parent
ea4a3cdf0b
commit
362724610c
22 files changed
+785
-96
No files matched your search
@@ -1,8 +1,9 @@
|
||||
package net.coderbot.iris.block_rendering;
|
||||
|
||||
import com.gtnewhorizons.angelica.compat.toremove.RenderLayer;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntFunction;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
|
||||
import lombok.Getter;
|
||||
import net.coderbot.iris.shaderpack.materialmap.NamespacedId;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -16,9 +17,10 @@ public class BlockRenderingSettings {
|
||||
|
||||
@Getter
|
||||
private boolean reloadRequired;
|
||||
private Object2IntMap<Block> blockMatches;
|
||||
private Reference2ObjectMap<Block, Int2IntMap> blockMetaMatches;
|
||||
private Map<Block, RenderLayer> blockTypeIds;
|
||||
private Object2IntFunction<NamespacedId> entityIds;
|
||||
private Object2IntFunction<NamespacedId> itemIds;
|
||||
private float ambientOcclusionLevel;
|
||||
private boolean disableDirectionalShading;
|
||||
private boolean useSeparateAo;
|
||||
@@ -26,7 +28,7 @@ public class BlockRenderingSettings {
|
||||
|
||||
public BlockRenderingSettings() {
|
||||
reloadRequired = false;
|
||||
blockMatches = null;
|
||||
blockMetaMatches = null;
|
||||
blockTypeIds = null;
|
||||
ambientOcclusionLevel = 1.0F;
|
||||
disableDirectionalShading = false;
|
||||
@@ -48,8 +50,8 @@ public class BlockRenderingSettings {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object2IntMap<Block> getBlockMatches() {
|
||||
return blockMatches;
|
||||
public Reference2ObjectMap<Block, Int2IntMap> getBlockMetaMatches() {
|
||||
return blockMetaMatches;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -62,13 +64,14 @@ public class BlockRenderingSettings {
|
||||
return entityIds;
|
||||
}
|
||||
|
||||
public void setBlockMatches(Object2IntMap<Block> blockIds) {
|
||||
if (this.blockMatches != null && this.blockMatches.equals(blockIds)) {
|
||||
return;
|
||||
}
|
||||
@Nullable
|
||||
public Object2IntFunction<NamespacedId> getItemIds() {
|
||||
return itemIds;
|
||||
}
|
||||
|
||||
public void setBlockMetaMatches(Reference2ObjectMap<Block, Int2IntMap> blockMetaIds) {
|
||||
this.reloadRequired = true;
|
||||
this.blockMatches = blockIds;
|
||||
this.blockMetaMatches = blockMetaIds;
|
||||
}
|
||||
|
||||
public void setBlockTypeIds(Map<Block, RenderLayer> blockTypeIds) {
|
||||
@@ -85,6 +88,11 @@ public class BlockRenderingSettings {
|
||||
this.entityIds = entityIds;
|
||||
}
|
||||
|
||||
public void setItemIds(Object2IntFunction<NamespacedId> itemIds) {
|
||||
// note: no reload needed, items are rendered every frame.
|
||||
this.itemIds = itemIds;
|
||||
}
|
||||
|
||||
public float getAmbientOcclusionLevel() {
|
||||
return ambientOcclusionLevel;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user