本文整理汇总了Java中net.minecraft.client.renderer.block.statemap.StateMap类的典型用法代码示例。如果您正苦于以下问题:Java StateMap类的具体用法?Java StateMap怎么用?Java StateMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StateMap类属于net.minecraft.client.renderer.block.statemap包,在下文中一共展示了StateMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerModels
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
public void registerModels()
{
ItemModels.register();
//BlockModels.register();
ModelLoader.setCustomStateMapper(ModBlocks.thorns,new StateMap.Builder().ignore(BlockThorns.FACING).build());
ModelLoader.setCustomStateMapper(ModBlocks.brine, new BrineStateMapper());
ModelLoader.setCustomStateMapper(ModBlocks.aqueductWater, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return aqueductWaterLocation;
}
});
RenderingRegistry.registerEntityRenderingHandler(EntityGreatarrow.class, RenderGreatarrow.GREATARROW_RENDER);
RenderingRegistry.registerEntityRenderingHandler(EntityYa.class, RenderYa.YA_RENDER);
RenderingRegistry.registerEntityRenderingHandler(EntitySpirit.class, manager -> new RenderSpirit(manager));
RenderingRegistry.registerEntityRenderingHandler(EntityAncestryBottle.class, manager -> new RenderSnowball<>(manager,ModItems.ancestryBottle,Minecraft.getMinecraft().getRenderItem()));
RenderingRegistry.registerEntityRenderingHandler(EntityArtifactFrame.class, RenderArtifactFrame.ARTIFACEFRAME_RENDER);
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAlchDragon.class, new RenderAlchDragon());
}
示例2: registerItemRenders
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static void registerItemRenders() {
rmm(skeleton_maker);
rmm(baby_skeleton_maker);
rmm(overlords_seal);
rmm(overlords_stamp);
rmm(squad_editor);
rmm(sans_mask);
rmm(skinsuit);
rmm(skinsuit_mummy);
rmm(warrior_spawner);
rmm(baby_spawner);
rmm(converted_spawner);
rmm(milk_bottle);
rmm(keychain);
rmm(keychain_occupied);
rmm(crown);
rmm(rallying_horn);
IStateMapper skeleton_maker_mapper = new StateMap.Builder().ignore(BlockSkeletonMaker.TRIGGERED).build();
ModelLoader.setCustomStateMapper(skeleton_maker, skeleton_maker_mapper);
ModelLoader.setCustomStateMapper(baby_skeleton_maker, skeleton_maker_mapper);
}
示例3: registerVariantBlocks
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
private void registerVariantBlocks(ProxyModBase proxy) {
for (InfoBlock block : proxy.blocks) {
if (!(block instanceof InfoBlockVariant))
continue;
InfoBlockVariant blockVar = (InfoBlockVariant) block;
List<String> variants = Lists.newArrayList();
for (Object metalObj : blockVar.getVariantProp().getAllowedValues()) {
IStringSerializable value = (IStringSerializable) metalObj;
String name = proxy.getModId() + ":" + value.getName() + blockVar.getVariantSuffix();
variants.add(name);
}
ModelBakery.registerItemVariants(Item.getItemFromBlock(block.getBlock()),
variants.stream().map(ResourceLocation::new).toArray(ResourceLocation[]::new));
ModelLoader.setCustomStateMapper(block.getBlock(),
(new StateMap.Builder()).withName(blockVar.getVariantProp())
.withSuffix(blockVar.getVariantSuffix())
.build());
}
}
示例4: init
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
public static void init()
{
butcherBench = new BlockButchersBench();
registerBlock(butcherBench);
GameRegistry.registerTileEntity(TileEntityButchersBench.class, "tileEntityButchersBench");
gallows = new BlockGallows();
registerBlockWithCustomItemBlock(gallows, ItemGallows.class);
GameRegistry.registerTileEntity(TileEntityGallows.class, "tileEntityGallows");
quebrachoSapling = new BlockSaplingQuebracho();
registerBlockWithStateBuilder(quebrachoSapling,
new StateMap.Builder().addPropertiesToIgnore(BlockSaplingQuebracho.TYPE, BlockSaplingQuebracho.STAGE));
quebrachoLog = new BlockLogQuebracho();
registerBlockWithStateBuilder(quebrachoLog, new StateMap.Builder().addPropertiesToIgnore(BlockLogQuebracho.VARIANT));
quebrachoLeaves = new BlockLeavesQuebracho();
registerBlock(quebrachoLeaves);
}
示例5: registerNonRenderingProperties
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@Override
public void registerNonRenderingProperties(Block block)
{
if (block instanceof IHSHBlock)
{
IHSHBlock hshBlock = (IHSHBlock)block;
IProperty[] nonRenderingProperties = hshBlock.getNonRenderingProperties();
if (nonRenderingProperties != null)
{
// use a custom state mapper which will ignore the properties specified in the block as being non-rendering
IStateMapper custom_mapper = (new StateMap.Builder()).ignore(nonRenderingProperties).build();
ModelLoader.setCustomStateMapper(block, custom_mapper);
}
}
}
示例6: loadBlockModels
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
public static void loadBlockModels() {
registerBlockModel(PLBlocks.oreIridium);
registerBlockModel(PLBlocks.airBrakeCasing);
registerBlockModel(PLBlocks.compressedWaterHyacinth);
registerBlockModel(PLBlocks.dehydratedWaterHyacinthblock);
ModelLoader.setCustomStateMapper(PLBlocks.machine, new StateMap.Builder().withName(BlockMachine.PROPERTY_TYPE).build());
registerBlockModel(PLBlocks.carbonizeFurnace);
registerBlockModel(PLBlocks.heatDryer);
registerBlockModel(PLBlocks.evsu);
registerBlockModel(PLBlocks.cseu);
registerBlockModel(PLBlocks.parallelSpaceSU);
registerBlockModel(PLBlocks.advSolar);
registerBlockModel(PLBlocks.fluidKineticGenerator);
registerBlockModel(PLBlocks.packager);
}
示例7: preInit
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@Override
public void preInit() {
registerBlockModelAsItem(ModBlocks.blockElectricLight, 0 , Names.Blocks.ELECTRIC_FLOODLIGHT);
registerBlockModelAsItem(ModBlocks.blockCarbonLight, 0 , Names.Blocks.CARBON_FLOODLIGHT);
registerBlockModelAsItem(ModBlocks.blockUVLight, 0 , Names.Blocks.UV_FLOODLIGHT);
registerBlockModelAsItem(ModBlocks.blockGrowLight, 0 , Names.Blocks.GROW_LIGHT);
registerBlockModelAsItem(ModBlocks.blockSmallElectricLight, 0 , Names.Blocks.SMALL_ELECTRIC_FLOODLIGHT,"inventory_strip");
registerBlockModelAsItem(ModBlocks.blockSmallElectricLight, 1 , Names.Blocks.SMALL_ELECTRIC_FLOODLIGHT,"inventory_square");
registerItemModel(ModItems.carbonDissolver, 0);
registerItemModel(ModItems.carbonLantern, 0);
registerItemModel(ModItems.glowingFilament, 0);
registerItemModel(ModItems.lightBulb, 0);
registerItemModel(ModItems.lightDebugTool, 0);
registerItemModel(ModItems.mantle, 0);
registerItemModel(ModItems.rawFilament, 0);
StateMap ignoreColor = new StateMap.Builder().ignore(BlockFLColorableMachine.COLOR).build();
ModelLoader.setCustomStateMapper(ModBlocks.blockCarbonLight,ignoreColor);
ModelLoader.setCustomStateMapper(ModBlocks.blockElectricLight,ignoreColor);
ModelLoader.setCustomStateMapper(ModBlocks.blockUVLight,ignoreColor);
ModelLoader.setCustomStateMapper(ModBlocks.blockSmallElectricLight, new StateMap.Builder().withName(BlockSmallElectricFloodlight.MODEL).ignore(BlockFLColorableMachine.COLOR).build());
ModelLoader.setCustomStateMapper(ModBlocks.blockGrowLight, new StateMap.Builder().ignore(BlockFLColorableMachine.COLOR).ignore(BlockFLColorableMachine.FACING).build());
ModelLoader.setCustomStateMapper(ModBlocks.blockPhantomLight, new StateMap.Builder().ignore(BlockPhantomLight.UPDATE).build());
ModelLoader.setCustomStateMapper(ModBlocks.blockUVLightBlock, new StateMap.Builder().ignore(BlockPhantomLight.UPDATE).build());
}
示例8: registerModels
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void registerModels (ModelRegistryEvent event) {
ModelRegistry modelRegistry = Chameleon.instance.modelRegistry;
modelRegistry.registerItemVariants(stoneMaterial);
modelRegistry.registerItemVariants(metalMaterial);
modelRegistry.registerItemVariants(bloomeryFurnace);
modelRegistry.registerItemVariants(metalFence);
modelRegistry.registerItemVariants(candelabra);
modelRegistry.registerItemVariants(candelilla);
ModelLoader.setCustomStateMapper(metalFence, (new StateMap.Builder()).withName(BlockFence.VARIANT).withSuffix("_wrought_iron_fence").build());
ModelLoader.setCustomStateMapper(metalLattice, (new StateMap.Builder()).withName(BlockLattice.VARIANT).withSuffix("_lattice").build());
ModelLoader.setCustomStateMapper(candelabra, (new StateMap.Builder()).withName(BlockCandelabra.VARIANT).withSuffix("_candelabra").build());
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 0, new ModelResourceLocation("gardenstuff:metal_fence_0", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 1, new ModelResourceLocation("gardenstuff:metal_fence_1", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 2, new ModelResourceLocation("gardenstuff:metal_fence_2", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalFence), 3, new ModelResourceLocation("gardenstuff:metal_fence_3", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 0, new ModelResourceLocation("gardenstuff:lattice_iron", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 1, new ModelResourceLocation("gardenstuff:lattice_wrought_iron", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 2, new ModelResourceLocation("gardenstuff:lattice_rust", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 3, new ModelResourceLocation("gardenstuff:lattice_aged", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(metalLattice), 4, new ModelResourceLocation("gardenstuff:lattice_moss", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 0, new ModelResourceLocation("gardenstuff:candelabra_level0", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 1, new ModelResourceLocation("gardenstuff:candelabra_level1", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 2, new ModelResourceLocation("gardenstuff:candelabra_level2", "inventory"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(candelabra), 3, new ModelResourceLocation("gardenstuff:candelabra_level3", "inventory"));
}
示例9: registerModels
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void registerModels(final ModelRegistryEvent event) {
for (final Item item : ITEMS) {
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
for (final Block block : BLOCKS) {
if (block instanceof BlockLeaves) {
ModelLoader.setCustomStateMapper(block, new StateMap.Builder().ignore(BlockLeaves.CHECK_DECAY, BlockLeaves.DECAYABLE).build());
}
}
}
示例10: initModel
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void initModel(){
IStateMapper stateMapper = new StateMap.Builder().build();
ModelLoader.setCustomStateMapper(this, stateMapper);
for(WoodType type : WoodType.values()){
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), new ModelResourceLocation(getRegistryName()+"_"+type.getName(), "inventory"));
}
}
示例11: initModel
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
IStateMapper stateMapper = new StateMap.Builder().ignore(new IProperty[] {BlockDoor.POWERED}).build();
ModelLoader.setCustomStateMapper(this, stateMapper);
ModBlocks.initBasicModel(this);
}
示例12: initModel
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void initModel(){
IStateMapper stateMapper = new StateMap.Builder().build();
ModelLoader.setCustomStateMapper(this, stateMapper);
for(FancyLadderType2 type : FancyLadderType2.values()){
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), new ModelResourceLocation(getRegistryName()+"_"+type.getName(), "inventory"));
}
}
示例13: initModel
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void initModel(){
IStateMapper stateMapper = new StateMap.Builder().build();
ModelLoader.setCustomStateMapper(this, stateMapper);
for(FancyLadderType type : FancyLadderType.values()){
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), new ModelResourceLocation(getRegistryName()+"_"+type.getName(), "inventory"));
}
}
示例14: initModel
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
StateMap.Builder ignorePower = new StateMap.Builder();
ModelLoader.setCustomStateMapper(this, ignorePower.build());
}
示例15: registerModel
import net.minecraft.client.renderer.block.statemap.StateMap; //导入依赖的package包/类
public static void registerModel(Item item,String[] variants)
{
if(item instanceof ItemBlock && ((ItemBlock)item).getBlock() instanceof IDFABlock)
{
IDFABlock block = (IDFABlock) ((ItemBlock)item).getBlock();
Class clazz = block.getVariantEnum();
IProperty[] ignored = block.getIgnoredProperties();
if(ignored != null && ignored.length > 0)
{
StateMap.Builder builder = new StateMap.Builder();
for(IProperty p : ignored)
builder.ignore(p);
ModelLoader.setCustomStateMapper((Block)block,builder.build());
}
if(clazz != null)
{
//TODO:register the variants
return;
}
}
for(int i = 0; i < variants.length; i++)
{
String name = LibResources.PREFIX+variants[i];
ModelResourceLocation loc = new ModelResourceLocation(name,"inventory");
System.out.println(loc);
ModelLoader.setCustomModelResourceLocation(item,i,loc);
}
}