Start of new texturesm, again

This commit is contained in:
modmuss50 2016-11-28 12:54:44 +00:00
parent 360d9c2756
commit 83ef3e7577
1733 changed files with 3934 additions and 2931 deletions

View file

@ -146,9 +146,9 @@ public class ClientProxy extends CommonProxy {
}
@Override
public void registerCustomBlockSateLocation(Block block, String resourceLocation) {
public void registerCustomBlockStateLocation(Block block, String resourceLocation) {
resourceLocation = resourceLocation.toLowerCase();
super.registerCustomBlockSateLocation(block, resourceLocation);
super.registerCustomBlockStateLocation(block, resourceLocation);
String finalResourceLocation = resourceLocation;
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
@Override
@ -161,4 +161,30 @@ public class ClientProxy extends CommonProxy {
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
}
@Override
public void registerCustomBlockStateLocation(Block block, String resourceLocation, boolean item) {
resourceLocation = resourceLocation.toLowerCase();
super.registerCustomBlockStateLocation(block, resourceLocation, item);
String finalResourceLocation = resourceLocation;
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
String propertyString = getPropertyString(state.getProperties());
return new ModelResourceLocation(resourceDomain + ':' + finalResourceLocation, propertyString);
}
});
if (item) {
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
}
}
@Override
public boolean isCTMAvailable() {
return isChiselAround;
}
}

View file

@ -1,17 +1,24 @@
package techreborn.proxies;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import techreborn.Core;
import techreborn.compat.ICompatModule;
public class CommonProxy implements ICompatModule {
public static boolean isChiselAround;
@Override
public void preInit(FMLPreInitializationEvent event) {
isChiselAround = Loader.isModLoaded("chisel");
if (isChiselAround) {
Core.logHelper.info("Hello chisel, shiny things will be enabled in techreborn");
}
}
@Override
@ -33,8 +40,25 @@ public class CommonProxy implements ICompatModule {
}
public void registerCustomBlockSateLocation(Block block, String name) {
public void registerCustomBlockStateLocation(Block block, String name) {
}
public void registerCustomBlockStateLocation(Block block, String name, boolean item) {
}
public void registerSubItemInventoryLocation(Item item, int meta, String location, String name) {
}
public void registerSubBlockInventoryLocation(Block block, int meta, String location, String name) {
registerSubItemInventoryLocation(Item.getItemFromBlock(block), meta, location, name);
}
public boolean isCTMAvailable() {
return false;
}
}