-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
75 additions
and
169 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
17 changes: 0 additions & 17 deletions
17
src/main/java/net/ludocrypt/limlib/access/BakedModelAccess.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
src/main/java/net/ludocrypt/limlib/access/ModelAccess.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,15 @@ | ||
package net.ludocrypt.limlib.access; | ||
|
||
import java.util.Optional; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import net.minecraft.util.Identifier; | ||
|
||
public interface ModelAccess { | ||
|
||
public Optional<Identifier> getLiminalQuadRenderer(); | ||
|
||
public void setLiminalQuadRenderer(@Nullable Identifier id); | ||
|
||
} |
18 changes: 0 additions & 18 deletions
18
src/main/java/net/ludocrypt/limlib/access/UnbakedModelAccess.java
This file was deleted.
Oops, something went wrong.
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
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
20 changes: 9 additions & 11 deletions
20
src/main/java/net/ludocrypt/limlib/mixin/client/render/model/BakedModelMixin.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 |
---|---|---|
@@ -1,26 +1,24 @@ | ||
package net.ludocrypt.limlib.mixin.client.render.model; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import com.google.common.collect.Maps; | ||
import com.mojang.datafixers.util.Pair; | ||
|
||
import net.ludocrypt.limlib.access.BakedModelAccess; | ||
import net.ludocrypt.limlib.access.ModelAccess; | ||
import net.minecraft.client.render.model.BakedModel; | ||
import net.minecraft.client.render.model.BakedQuad; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.math.Direction; | ||
|
||
@Mixin(BakedModel.class) | ||
public interface BakedModelMixin extends BakedModelAccess { | ||
public interface BakedModelMixin extends ModelAccess { | ||
|
||
@Override | ||
default Optional<Identifier> getLiminalQuadRenderer() { | ||
return Optional.empty(); | ||
} | ||
|
||
@Override | ||
default Map<Identifier, List<Pair<BakedQuad, Optional<Direction>>>> getSubQuads() { | ||
return Maps.newHashMap(); | ||
default void setLiminalQuadRenderer(@Nullable Identifier id) { | ||
} | ||
|
||
} |
22 changes: 10 additions & 12 deletions
22
src/main/java/net/ludocrypt/limlib/mixin/client/render/model/GeneralBakedModelMixin.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 |
---|---|---|
@@ -1,29 +1,27 @@ | ||
package net.ludocrypt.limlib.mixin.client.render.model; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
import com.google.common.collect.Maps; | ||
import com.mojang.datafixers.util.Pair; | ||
|
||
import net.ludocrypt.limlib.access.BakedModelAccess; | ||
import net.minecraft.client.render.model.BakedQuad; | ||
import net.ludocrypt.limlib.access.ModelAccess; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.math.Direction; | ||
|
||
@Mixin(targets = { "net/minecraft/client/render/model/BasicBakedModel", "net/minecraft/client/render/model/BuiltinBakedModel", "net/minecraft/client/render/model/MultipartBakedModel", "net/minecraft/client/render/model/WeightedBakedModel", "net/fabricmc/fabric/api/renderer/v1/model/ForwardingBakedModel" }) | ||
public class GeneralBakedModelMixin implements BakedModelAccess { | ||
public class GeneralBakedModelMixin implements ModelAccess { | ||
|
||
@Unique | ||
private Map<Identifier, List<Pair<BakedQuad, Optional<Direction>>>> subQuads = Maps.newHashMap(); | ||
private Optional<Identifier> liminalQuadRenderer = Optional.empty(); | ||
|
||
@Override | ||
public Optional<Identifier> getLiminalQuadRenderer() { | ||
return liminalQuadRenderer; | ||
} | ||
|
||
@Override | ||
public Map<Identifier, List<Pair<BakedQuad, Optional<Direction>>>> getSubQuads() { | ||
return subQuads; | ||
public void setLiminalQuadRenderer(Identifier id) { | ||
liminalQuadRenderer = Optional.ofNullable(id); | ||
} | ||
|
||
} |
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
Oops, something went wrong.