net.minecraft.block.Block.setRegistryName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中net.minecraft.block.Block.setRegistryName()方法的一些代码示例,展示了Block.setRegistryName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.setRegistryName()方法的具体详情如下:
包路径:net.minecraft.block.Block
类名称:Block
方法名:setRegistryName

Block.setRegistryName介绍

暂无

代码示例

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

public static void registerBlockWithCustomItem(Block block, ItemBlock iBlock, String registryname) {
  block.setRegistryName(JurassiCraft.MODID, registryname);
  iBlock.setRegistryName(JurassiCraft.MODID, registryname);
  blocksToReg.add(block);
  itemsToReg.add(iBlock);
  blockItems.put(block, iBlock);
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

public static void registerBlock(Block block, String registryname) {
  block.setRegistryName(registryname);
  block.setUnlocalizedName(registryname);
  blocksToReg.add(block);
}

代码示例来源:origin: RS485/LogisticsPipes

public static <T extends Block> T setName(T block, String name) {
  block.setRegistryName(LPConstants.LP_MOD_ID, name);
  block.setUnlocalizedName(String.format("%s.%s", LPConstants.LP_MOD_ID, name));
  return block;
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

block.setRegistryName( AppEng.MOD_ID, this.registryName );
block.setUnlocalizedName( "appliedenergistics2." + this.registryName );

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

private static <T extends Block> T register(IForgeRegistry<Block> r, String name, T block)
{
  block.setRegistryName(MOD_ID, name);
  block.setTranslationKey(MOD_ID + "." + name.replace('/', '.'));
  r.register(block);
  return block;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public final @Nonnull <B extends Block> B apply(@Nonnull B blockIn) {
 blockIn.setUnlocalizedName(getUnlocalisedName());
 blockIn.setRegistryName(getRegistryName());
 return blockIn;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public final @Nonnull <B extends Block> B apply(@Nonnull B blockIn) {
 blockIn.setUnlocalizedName(getUnlocalisedName());
 blockIn.setRegistryName(getRegistryName());
 return blockIn;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public final @Nonnull <B extends Block> B apply(@Nonnull B blockIn) {
 blockIn.setUnlocalizedName(getUnlocalisedName());
 blockIn.setRegistryName(getRegistryName());
 return blockIn;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
default @Nonnull <B extends Block> B apply(@Nonnull B block) {
 block.setUnlocalizedName(getUnlocalisedName());
 block.setRegistryName(getRegistryName());
 return block;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public final @Nonnull <B extends Block> B apply(@Nonnull B blockIn) {
 blockIn.setUnlocalizedName(getUnlocalisedName());
 blockIn.setRegistryName(getRegistryName());
 return blockIn;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public final @Nonnull <B extends Block> B apply(@Nonnull B blockIn) {
 blockIn.setUnlocalizedName(getUnlocalisedName());
 blockIn.setRegistryName(getRegistryName());
 return blockIn;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public final @Nonnull <B extends Block> B apply(@Nonnull B blockIn) {
 blockIn.setUnlocalizedName(getUnlocalisedName());
 blockIn.setRegistryName(getRegistryName());
 return blockIn;
}

代码示例来源:origin: Funwayguy/BetterQuesting

public static void registerBlock(Block b, String name)
{
  ResourceLocation res = new ResourceLocation(BetterQuesting.MODID + ":" + name);
  ALL_BLOCKS.add(b.setRegistryName(res));
  ALL_ITEMS.add(new ItemBlock(b).setRegistryName(res));
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

}.setLightLevel( 0.2f ).setCreativeTab( CreativeTabs.DECORATIONS ).setRegistryName( uvlblockR );

代码示例来源:origin: joshiejack/Mariculture

/** Register this block WITHOUT assigning the item **/
default T registerWithoutItem(String name) {
  Block block = (Block) this;
  block.setUnlocalizedName(name.replace("_", "."));
  block.setRegistryName(new ResourceLocation(MODID, name));
  GameRegistry.register(block);
  return (T) this;
}

代码示例来源:origin: Ellpeck/ActuallyAdditions

public static void registerBlock(Block block, ItemBlockBase itemBlock, String name, boolean addTab){
  block.setTranslationKey(ActuallyAdditions.MODID+"."+name);
  block.setRegistryName(ActuallyAdditions.MODID, name);
  RegistryHandler.BLOCKS_TO_REGISTER.add(block);
  itemBlock.setRegistryName(block.getRegistryName());
  RegistryHandler.ITEMS_TO_REGISTER.add(itemBlock);
  block.setCreativeTab(addTab ? CreativeTab.INSTANCE : null);
  IMCHandler.doBlockIMC(block);
  if(block instanceof IColorProvidingBlock){
    ActuallyAdditions.PROXY.addColoredBlock(block);
  }
}

代码示例来源:origin: Glitchfiend/ToughAsNails

public static Block registerFluidBlock(Fluid fluid, Block fluidBlock, String name)
{
  fluidBlock.setRegistryName(new ResourceLocation(ToughAsNails.MOD_ID, name));
  ForgeRegistries.BLOCKS.register(fluidBlock);
  ToughAsNails.proxy.registerFluidBlockRendering(fluidBlock, name);
  fluid.setBlock(fluidBlock);
  return fluidBlock;
}

代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped

public void registerBlocks(RegistryEvent.Register<Block> event) {
  physicsInfuser = new BlockPhysicsInfuser(Material.ROCK).setHardness(12f).setUnlocalizedName("shipblock")
      .setRegistryName(MODID, "shipblock").setCreativeTab(vwTab);
  physicsInfuserCreative = new BlockPhysicsInfuserCreative(Material.ROCK).setHardness(12f)
      .setUnlocalizedName("shipblockcreative").setRegistryName(MODID, "shipblockcreative")
      .setCreativeTab(vwTab);
  event.getRegistry().register(physicsInfuser);
  event.getRegistry().register(physicsInfuserCreative);
}

代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped

@Override
public void registerBlocks(RegistryEvent.Register<Block> event) {
  gpsBlock = new GPSBlock().setUnlocalizedName("gpsblock").setRegistryName(getModID(), "gpsblock").setCreativeTab(ValkyrienWarfareMod.vwTab);
  event.getRegistry().register(gpsBlock);
}

代码示例来源:origin: Darkhax-Minecraft/Tesla

public static Block registerBlock (Block block, Class<? extends TileEntity> tileEntityClass, String name) {
  block.setRegistryName(name);
  GameRegistry.registerTileEntity(tileEntityClass, block.getRegistryName().toString());
  block.setCreativeTab(tab);
  registerItem(new ItemBlock(block), name);
  blocks.add(block);
  return block;
}

相关文章

Block类方法