コード例 #1
0
 public ParticleMagicLine(
     World worldIn,
     double x,
     double y,
     double z,
     double vx,
     double vy,
     double vz,
     double r,
     double g,
     double b) {
   super(worldIn, x, y, z, 0, 0, 0);
   this.colorR = r;
   this.colorG = g;
   this.colorB = b;
   if (this.colorR > 1.0) {
     this.colorR = this.colorR / 255.0;
   }
   if (this.colorG > 1.0) {
     this.colorG = this.colorG / 255.0;
   }
   if (this.colorB > 1.0) {
     this.colorB = this.colorB / 255.0;
   }
   this.setRBGColorF(1, 1, 1);
   this.particleMaxAge = 8;
   this.particleGravity = 0.0f;
   this.motionX = (vx - x) / (double) this.particleMaxAge;
   this.motionY = (vy - y) / (double) this.particleMaxAge;
   this.motionZ = (vz - z) / (double) this.particleMaxAge;
   TextureAtlasSprite sprite =
       Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(texture.toString());
   this.setParticleTexture(sprite);
 }
コード例 #2
0
 public ParticleMagicSparkle(
     World worldIn,
     double x,
     double y,
     double z,
     double vx,
     double vy,
     double vz,
     double r,
     double g,
     double b) {
   super(worldIn, x, y, z, 0, 0, 0);
   this.colorR = r;
   this.colorG = g;
   this.colorB = b;
   if (this.colorR > 1.0) {
     this.colorR = this.colorR / 255.0;
   }
   if (this.colorG > 1.0) {
     this.colorG = this.colorG / 255.0;
   }
   if (this.colorB > 1.0) {
     this.colorB = this.colorB / 255.0;
   }
   this.setRBGColorF(1, 1, 1);
   this.particleMaxAge = 10;
   this.motionX = vx;
   this.motionY = vy;
   this.motionZ = vz;
   this.particleScale = 5.0f;
   this.field_190014_F = random.nextFloat() * 2.0f * (float) Math.PI;
   TextureAtlasSprite sprite =
       Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(texture.toString());
   this.setParticleTexture(sprite);
 }
コード例 #3
0
ファイル: MixinPotion.java プロジェクト: AIOOB/SpongeCommon
 @Inject(method = "<init>(ILnet/minecraft/util/ResourceLocation;ZI)V", at = @At("RETURN"))
 private void onConstruct(
     int potionID,
     ResourceLocation location,
     boolean badEffect,
     int potionColor,
     CallbackInfo callbackInfo) {
   this.spongeResourceID = location.toString();
 }
コード例 #4
0
 /** (abstract) Protected helper method to write subclass entity data to NBT. */
 public void writeEntityToNBT(NBTTagCompound tagCompound) {
   tagCompound.setShort("xTile", (short) this.xTile);
   tagCompound.setShort("yTile", (short) this.yTile);
   tagCompound.setShort("zTile", (short) this.zTile);
   ResourceLocation resourcelocation =
       (ResourceLocation) Block.blockRegistry.getNameForObject(this.inTile);
   tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
   tagCompound.setByte("shake", (byte) this.shake);
   tagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0));
 }
コード例 #5
0
  public List func_135056_b(ResourceLocation par1ResourceLocation) throws IOException {
    ResourceManager resourcemanager =
        (ResourceManager) this.field_110548_a.get(par1ResourceLocation.func_110624_b());

    if (resourcemanager != null) {
      return resourcemanager.func_135056_b(par1ResourceLocation);
    } else {
      throw new FileNotFoundException(par1ResourceLocation.toString());
    }
  }
コード例 #6
0
  public GenericStructureInfo structureInfoFromResource(ResourceLocation resourceLocation) {
    try {
      return structureInfoFromZip(
          new ZipInputStream(IvFileHelper.inputStreamFromResourceLocation(resourceLocation)));
    } catch (Exception ex) {
      RecurrentComplex.logger.error(
          "Could not read generic structure " + resourceLocation.toString(), ex);
    }

    return null;
  }
コード例 #7
0
ファイル: Potion.java プロジェクト: McSwede/XIV
  public static String[] func_180141_c() {
    String[] var0 = new String[field_180150_I.size()];
    int var1 = 0;
    ResourceLocation var3;

    for (Iterator var2 = field_180150_I.keySet().iterator();
        var2.hasNext();
        var0[var1++] = var3.toString()) {
      var3 = (ResourceLocation) var2.next();
    }

    return var0;
  }
コード例 #8
0
ファイル: ItemStackHelper.java プロジェクト: Ipsis/Woot
  public static String getItemStackName(ItemStack itemStack) {

    if (itemStack == null) return null;

    Item item = itemStack.getItem();
    if (item == null) return null;

    ResourceLocation resourceLocation = getItemName(item);
    if (resourceLocation == null) return null;

    String ret;
    if (!itemStack.isItemStackDamageable()) {
      int dmg = itemStack.getItemDamage();
      if (dmg != OreDictionary.WILDCARD_VALUE)
        ret = String.format("%s:%d", resourceLocation.toString(), dmg);
      else ret = resourceLocation.toString();
    } else {
      ret = resourceLocation.toString();
    }

    return ret;
  }
コード例 #9
0
ファイル: ItemStack.java プロジェクト: ppypp/CanaryMod
  public NBTTagCompound b(NBTTagCompound nbttagcompound) {
    ResourceLocation resourcelocation = (ResourceLocation) Item.e.c(this.d);

    nbttagcompound.a(
        "id", resourcelocation == null ? "minecraft:air" : resourcelocation.toString());
    nbttagcompound.a("Count", (byte) this.b);
    nbttagcompound.a("Damage", (short) this.f);
    if (this.e != null) {
      nbttagcompound.a("tag", (NBTBase) this.e);
    }

    return nbttagcompound;
  }
コード例 #10
0
 private Object verify(Object obj) {
   if (obj instanceof String)
     AbyssalCraftAPI.getInternalNDHandler().verifyImageURL((String) obj);
   if (!(obj instanceof ResourceLocation)) return obj;
   if (FMLCommonHandler.instance().getSide().isServer()) return obj;
   ResourceLocation res = (ResourceLocation) obj;
   if (res.toString().equals("abyssalcraft:textures/gui/necronomicon/missing.png")) return obj;
   try {
     TextureUtil.readBufferedImage(
         Minecraft.getMinecraft().getResourceManager().getResource(res).getInputStream());
   } catch (IOException e) {
     return new ResourceLocation("abyssalcraft", "textures/gui/necronomicon/missing.png");
   }
   return res;
 }
コード例 #11
0
ファイル: EntityMinecart.java プロジェクト: leijurv/MineBot
  /** (abstract) Protected helper method to write subclass entity data to NBT. */
  protected void writeEntityToNBT(NBTTagCompound tagCompound) {
    if (this.hasDisplayTile()) {
      tagCompound.setBoolean("CustomDisplayTile", true);
      IBlockState iblockstate = this.getDisplayTile();
      ResourceLocation resourcelocation =
          (ResourceLocation) Block.blockRegistry.getNameForObject(iblockstate.getBlock());
      tagCompound.setString(
          "DisplayTile", resourcelocation == null ? "" : resourcelocation.toString());
      tagCompound.setInteger("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate));
      tagCompound.setInteger("DisplayOffset", this.getDisplayTileOffset());
    }

    if (this.entityName != null && this.entityName.length() > 0) {
      tagCompound.setString("CustomName", this.entityName);
    }
  }
コード例 #12
0
ファイル: StatList.java プロジェクト: McSwede/XIV
 private static String func_180204_a(Item p_180204_0_) {
   ResourceLocation var1 = (ResourceLocation) Item.itemRegistry.getNameForObject(p_180204_0_);
   return var1 != null ? var1.toString().replace(':', '.') : null;
 }
コード例 #13
0
 public BlockSource() {
   super(Material.IRON);
   setCreativeTab(CreativeTabs.MISC);
   setUnlocalizedName(name.toString());
   setRegistryName(name);
 }
コード例 #14
0
 @Inject(method = "<init>", at = @At("RETURN"))
 public void onConstructed(
     int id, ResourceLocation resLoc, int weight, EnumEnchantmentType type, CallbackInfo ci) {
   this.id = resLoc.toString();
 }
コード例 #15
0
 public boolean resourceExists(ResourceLocation p_110589_1_) {
   return this.getResourceStream(p_110589_1_) != null
       || this.field_152781_b.containsKey(p_110589_1_.toString());
 }
コード例 #16
0
 @Inject(method = "registerBlock", at = @At("RETURN"))
 private static void onRegisterBlock(
     int id, ResourceLocation location, Block block, CallbackInfo ci) {
   BlockTypeRegistryModule.getInstance()
       .registerFromGameData(location.toString(), (BlockType) block);
 }
コード例 #17
0
 protected White() {
   super(loc.toString());
 }
コード例 #18
0
    public Collection<ResourceLocation> getTextures() {
      // setting parent here to make textures resolve properly
      if (model.getParentLocation() != null) {
        if (model.getParentLocation().getResourcePath().equals("builtin/generated")) {
          model.parent = MODEL_GENERATED;
        } else {
          try {
            IModel parent = getModel(model.getParentLocation());
            if (parent instanceof VanillaModelWrapper) {
              model.parent = ((VanillaModelWrapper) parent).model;
            } else {
              throw new IllegalStateException(
                  "vanilla model '" + model + "' can't have non-vanilla parent");
            }
          } catch (IOException e) {
            FMLLog.warning(
                "Could not load vanilla model parent '"
                    + model.getParentLocation()
                    + "' for '"
                    + model
                    + "': "
                    + e.toString());
            IModel missing = ModelLoader.this.getMissingModel();
            if (missing instanceof VanillaModelWrapper) {
              model.parent = ((VanillaModelWrapper) missing).model;
            } else {
              throw new IllegalStateException(
                  "vanilla model '"
                      + model
                      + "' has missing parent, and missing model is not a vanilla model");
            }
          }
        }
      }

      ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder();

      if (hasItemModel(model)) {
        for (String s : (List<String>) ItemModelGenerator.LAYERS) {
          String r = model.resolveTextureName(s);
          ResourceLocation loc = new ResourceLocation(r);
          if (!r.equals(s)) {
            builder.add(loc);
          }
          // mojang hardcode
          if (model.getRootModel() == MODEL_COMPASS
              && !loc.equals(TextureMap.LOCATION_MISSING_TEXTURE)) {
            TextureAtlasSprite.setLocationNameCompass(loc.toString());
          } else if (model.getRootModel() == MODEL_CLOCK
              && !loc.equals(TextureMap.LOCATION_MISSING_TEXTURE)) {
            TextureAtlasSprite.setLocationNameClock(loc.toString());
          }
        }
      }
      for (String s : (Iterable<String>) model.textures.values()) {
        if (!s.startsWith("#")) {
          builder.add(new ResourceLocation(s));
        }
      }
      return builder.build();
    }
コード例 #19
0
 public InputStream func_152780_c(ResourceLocation p_152780_1_) throws IOException {
   File file1 = (File) this.field_152781_b.get(p_152780_1_.toString());
   return file1 != null && file1.isFile() ? new FileInputStream(file1) : null;
 }