@Override @Nonnull public IConduitBundle getBundle() { return NullHelper.notnull(bundle, "Logic error in conduit---no bundle set"); }
@Override @Nonnull public IConduitBundle getBundle() { return NullHelper.notnull(bundle, "Logic error in conduit---no bundle set"); }
@Override public @Nonnull SoundEvent getSoundEvent() { return NullHelper.notnull(soundEvent, "trying to play unregistered sound"); }
@SafeVarargs private ItemHidingHelper(Predicate<IModRegistry> predicate, @Nonnull Supplier<ItemStack>... suppliers) { this.suppliers.addAll(suppliers); this.predicate = NullHelper.notnull(predicate, "predicate fail"); }
@Override public @Nonnull TelepadTarget getElementAt(int index) { ArrayList<TelepadTarget> targs = te.getTargets(); if (index < 0 || index >= targs.size()) { throw new IndexOutOfBoundsException("No telepad target for index " + index); } return NullHelper.notnull(targs.get(index), "Telepad target was null in list"); }
@SuppressWarnings({ "unchecked", "serial" }) private static IHandler<EnumMap<ChannelType, Set<Channel>>> getDelegate() { try { return BaseHandlers.REGISTRY.findHandlers(NullHelper.notnull(new TypeToken<EnumMap<ChannelType, Set<Channel>>>(){}.getType(), "TypeToken#getType")).stream() .filter(Objects::nonNull) .findFirst() .orElseThrow(() -> new IllegalStateException("Could not find delegate handler for ChannelList")); } catch (IllegalAccessException | InstantiationException e) { throw new RuntimeException(e); } } }
public GuiContainerBaseEIO(@Nonnull Container par1Container, String... guiTexture) { super(par1Container); for (String string : guiTexture) { guiTextures.add(EnderIO.proxy.getGuiTexture(NullHelper.notnull(string, "invalid gui texture name"))); } }
private ItemHidingHelper(Predicate<IModRegistry> predicate, final @Nonnull Material... materials) { for (Material material : materials) { this.suppliers.add(() -> material.getStack()); } this.predicate = NullHelper.notnull(predicate, "predicate fail"); }
public static void addOverride(@Nonnull ResourceLocation name, int baseValue, @Nullable String scalerString) { ICapacitorKey key = REGISTRY.getValue(name); if (key == null) { throw new RuntimeException("Trying to override non-existant key " + name); } key.setBaseValue(baseValue); key.setScaler(NullHelper.notnull(ScalerFactory.fromString(scalerString), "Invalid scaler '", scalerString, "'")); }
public static void setValue(@Nonnull ResourceLocation name, int baseValue, @Nullable Scaler scaler, @Nonnull String scalerString) { ICapacitorKey key = REGISTRY.getValue(name); if (key == null) { throw new RuntimeException("Trying to configure non-existant key " + name); } Scaler theScaler = scaler != null ? scaler : NullHelper.notnull(ScalerFactory.fromString(scalerString), "Invalid scaler '", scalerString, "'"); key.setBaseValue(baseValue); key.setScaler(theScaler); BASE.put(key, Triple.of(baseValue, theScaler, scalerString)); }
private ItemHidingHelper(Predicate<IModRegistry> predicate, final @Nonnull IProducer... producers) { for (IProducer producer : producers) { this.suppliers.add(() -> new ItemStack(producer.getItemNN(), 1, OreDictionary.WILDCARD_VALUE)); } this.predicate = NullHelper.notnull(predicate, "predicate fail"); }
public static boolean isToolEffective(@Nonnull IBlockState state, @Nonnull ItemStack stack) { for (String type : stack.getItem().getToolClasses(stack)) { if (state.getBlock().isToolEffective(NullHelper.notnull(type, "getToolClasses() derped"), state)) { return true; } } return false; }
@SideOnly(Side.CLIENT) @SubscribeEvent public void onIconLoad(TextureStitchEvent.Pre event) { for (Entry<String, TextureAtlasSprite> entry : sprites.entrySet()) { Log.debug("TextureStitchEvent.Pre for ", entry.getKey()); entry.setValue(event.getMap().registerSprite(new ResourceLocation(NullHelper.notnull(entry.getKey(), "internal data corruption")))); } }
public @Nonnull Fluid getFluidType() { Fluid fluid = null; String fluidname = InvpanelConfig.remoteInventoryFluidTypes.get(ordinal()).get(); fluid = FluidRegistry.getFluid(fluidname); if (fluid == null) { Log.warn("ItemRemoteInvAccessType: Could not find fluid '" + fluidname + "' using default fluid " + Fluids.NUTRIENT_DISTILLATION.getFluid()); fluid = NullHelper.notnull(Fluids.NUTRIENT_DISTILLATION.getFluid(), "Nutrient Distillation registration went AWOL"); } return fluid; }
private @Nonnull static LootEntry createDarkSteelLootEntry(@Nonnull Item item, int meta, int minStackSize, int maxStackSize, float chance) { LootCondition[] chanceCond = new LootCondition[] { new RandomChance(chance) }; final ResourceLocation registryName = NullHelper.notnull(item.getRegistryName(), "found unregistered item"); return new LootEntryItem(item, 1, 1, new LootFunction[] { setCount(minStackSize, maxStackSize), setDamage(item, meta), setUpgrades(), setEnergy() }, chanceCond, registryName.toString() + ":" + meta); }
@Override public void registerRenderers(@Nonnull IModObject modObject) { for (EnumFacadeType type : EnumFacadeType.values()) { final ModelResourceLocation mrl = new ModelResourceLocation(NullHelper.notnull(getRegistryName(), "unregistered item?"), "type=" + type.getName()); ModelLoader.setCustomModelResourceLocation(this, EnumFacadeType.getMetaFromType(type), mrl); ItemModelRegistry.registerFacade(mrl); } }
private @Nonnull static LootEntry createLootEntry(@Nonnull ItemStack stack, int minStackSize, int maxStackSize, float chance) { LootCondition[] chanceCond = new LootCondition[] { new RandomChance(chance) }; final ResourceLocation registryName = NullHelper.notnull(stack.getItem().getRegistryName(), "found unregistered item"); return new LootEntryItem(stack.getItem(), 1, 1, new LootFunction[] { setCount(minStackSize, maxStackSize), setMetadata(stack.getMetadata()) }, chanceCond, registryName.toString() + ":" + stack.getMetadata()); }
private ItemHidingHelper(Predicate<IModRegistry> predicate, final @Nonnull IAlloy... alloys) { for (IAlloy alloy : alloys) { this.suppliers.add(() -> alloy.getStackBall()); this.suppliers.add(() -> alloy.getStackBlock()); this.suppliers.add(() -> alloy.getStackIngot()); this.suppliers.add(() -> alloy.getStackNugget()); } this.predicate = NullHelper.notnull(predicate, "predicate fail"); }
private @Nonnull static LootEntry createLootEntry(@Nonnull Item item, int meta, int minStackSize, int maxStackSize, float chance) { LootCondition[] chanceCond = new LootCondition[] { new RandomChance(chance) }; final ResourceLocation registryName = NullHelper.notnull(item.getRegistryName(), "found unregistered item"); if (item.isDamageable()) { return new LootEntryItem(item, 1, 1, new LootFunction[] { setCount(minStackSize, maxStackSize), setDamage(item, meta), setEnergy() }, chanceCond, registryName.toString() + ":" + meta); } else { return new LootEntryItem(item, 1, 1, new LootFunction[] { setCount(minStackSize, maxStackSize), setMetadata(meta) }, chanceCond, registryName.toString() + ":" + meta); } }