-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated BlockStates to use directory structure
Fixed player render layers loading order Removed DirectionTransformers, remainder of TMT Improved TMT's performance by removing unused features
- Loading branch information
Showing
61 changed files
with
397 additions
and
1,436 deletions.
There are no files selected for viewing
160 changes: 99 additions & 61 deletions
160
src/main/java/pl/pabilo8/immersiveintelligence/client/ClientProxy.java
Large diffs are not rendered by default.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
src/main/java/pl/pabilo8/immersiveintelligence/client/util/IICustomStateMapper.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,46 @@ | ||
package pl.pabilo8.immersiveintelligence.client.util; | ||
|
||
import blusunrize.immersiveengineering.client.IECustomStateMapper; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.client.renderer.block.model.ModelResourceLocation; | ||
import net.minecraft.client.renderer.block.statemap.StateMapperBase; | ||
import net.minecraft.util.ResourceLocation; | ||
import pl.pabilo8.immersiveintelligence.common.IILogger; | ||
import pl.pabilo8.immersiveintelligence.common.util.block.IIIStateMappings; | ||
|
||
/** | ||
* Custom {@link IBlockState} location mapper that allows to use meta-IDs | ||
* | ||
* @param <E> | ||
*/ | ||
public class IICustomStateMapper<E extends Enum<E>> extends IECustomStateMapper | ||
{ | ||
public static <E extends Enum<E>> StateMapperBase getStateMapper(IIIStateMappings<E> mappings) | ||
{ | ||
return stateMappers.computeIfAbsent("ii_"+mappings.getMappingsName(), s -> new IICustomStateMapper<E>()); | ||
} | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) | ||
{ | ||
try | ||
{ | ||
assert state.getBlock() instanceof IIIStateMappings; | ||
IIIStateMappings<E> mappings = (IIIStateMappings<E>)state.getBlock(); | ||
ResourceLocation rl = new ResourceLocation(Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain(), | ||
mappings.getMappingsName()); | ||
|
||
String custom = mappings.getMappingsExtension(state.getBlock().getMetaFromState(state), false); | ||
if(custom!=null) | ||
rl = new ResourceLocation(rl+"/"+custom); | ||
return new ModelResourceLocation(rl, this.getPropertyString(state.getProperties())); | ||
} catch(Exception e) | ||
{ | ||
IILogger.error("Failed to get ModelResourceLocation for state %s, cause: %s", state, e); | ||
ResourceLocation rl = Block.REGISTRY.getNameForObject(state.getBlock()); | ||
return new ModelResourceLocation(rl, this.getPropertyString(state.getProperties())); | ||
} | ||
} | ||
} |
64 changes: 0 additions & 64 deletions
64
src/main/java/pl/pabilo8/immersiveintelligence/client/util/tmt/DirectionTransformer.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.