use of net.minecraftforge.fml.common.Optional.Method in project Cavern2 by kegare.
the class HaCPlugin method load.
@Method(modid = LIB_MODID)
public static void load() {
RecipeAPI.registerSmelting.addRecipe(new ItemStack(CaveBlocks.SLIPPERY_ICE), DCHeatTier.FROSTBITE, DCHumidity.WET, DCAirflow.FLOW, false, new ItemStack(Blocks.PACKED_ICE));
DamageAPI.armorRegister.registerMaterial(CaveItems.HEXCITE_ARMOR, 0.5F, 0.5F);
DamageAPI.resistantData.registerEntityResistant(EntityCavenicSkeleton.class, 7.0F, 4.0F);
DamageAPI.resistantData.registerEntityResistant(EntityCavenicCreeper.class, 2.0F, 5.0F);
DamageAPI.resistantData.registerEntityResistant(EntityCavenicZombie.class, 8.0F, 5.0F);
DamageAPI.resistantData.registerEntityResistant(EntityCavenicSpider.class, 6.0F, 4.0F);
DamageAPI.resistantData.registerEntityResistant(EntityCavenicWitch.class, 6.0F, 6.0F);
DamageAPI.resistantData.registerEntityResistant(EntityCavenicBear.class, 10.0F, 15.0F);
DamageAPI.resistantData.registerEntityResistant(EntityCaveman.class, 5.0F, 3.0F);
if (CaveDimensions.FROST_MOUNTAINS != null) {
int dim = CaveDimensions.FROST_MOUNTAINS.getId();
for (Biome biome : BiomeDictionary.getBiomes(BiomeDictionary.Type.COLD)) {
ClimateAPI.register.addBiomeClimate(biome, dim, DCHeatTier.FROSTBITE, DCHumidity.WET, DCAirflow.NORMAL);
}
}
if (CaveDimensions.WIDE_DESERT != null) {
int dim = CaveDimensions.WIDE_DESERT.getId();
for (Biome biome : BiomeDictionary.getBiomes(BiomeDictionary.Type.SANDY)) {
ClimateAPI.register.addBiomeClimate(biome, dim, DCHeatTier.HOT, DCHumidity.DRY, DCAirflow.NORMAL);
}
}
}
use of net.minecraftforge.fml.common.Optional.Method in project GregTech by GregTechCE.
the class OreDepositDefinition method ctGetBiomeWeightModifier.
@ZenMethod("getBiomeWeightModifier")
@Method(modid = GTValues.MODID_CT)
public int ctGetBiomeWeightModifier(IBiome biome) {
int biomeIndex = ArrayUtils.indexOf(CraftTweakerMC.biomes, biome);
Biome mcBiome = Biome.REGISTRY.getObjectById(biomeIndex);
return mcBiome == null ? 0 : getBiomeWeightModifier().apply(mcBiome);
}
use of net.minecraftforge.fml.common.Optional.Method in project GregTech by GregTechCE.
the class RecipeMap method ctFindRecipe.
@ZenMethod("findRecipe")
@Method(modid = GTValues.MODID_CT)
@Nullable
public CTRecipe ctFindRecipe(long maxVoltage, IItemStack[] itemInputs, ILiquidStack[] fluidInputs, @Optional(valueLong = Integer.MAX_VALUE) int outputFluidTankCapacity) {
List<ItemStack> mcItemInputs = itemInputs == null ? Collections.emptyList() : Arrays.stream(itemInputs).map(CraftTweakerMC::getItemStack).collect(Collectors.toList());
List<FluidStack> mcFluidInputs = fluidInputs == null ? Collections.emptyList() : Arrays.stream(fluidInputs).map(CraftTweakerMC::getLiquidStack).collect(Collectors.toList());
Recipe backingRecipe = findRecipe(maxVoltage, mcItemInputs, mcFluidInputs, outputFluidTankCapacity);
return backingRecipe == null ? null : new CTRecipe(this, backingRecipe);
}
use of net.minecraftforge.fml.common.Optional.Method in project GregTech by GregTechCE.
the class ScoopBehaviour method processButterflyCatch.
@Method(modid = GTValues.MODID_FR)
private boolean processButterflyCatch(ItemStack itemStack, EntityPlayer player, Entity entity) {
if (entity instanceof IEntityButterfly) {
if (player.world.isRemote) {
return true;
}
if (player.capabilities.isCreativeMode || GTUtility.doDamageItem(itemStack, this.cost, false)) {
IEntityButterfly butterfly = (IEntityButterfly) entity;
IAlleleButterflySpecies species = butterfly.getButterfly().getGenome().getPrimary();
species.getRoot().getBreedingTracker(entity.world, player.getGameProfile()).registerCatch(butterfly.getButterfly());
player.world.spawnEntity(new EntityItem(player.world, entity.posX, entity.posY, entity.posZ, species.getRoot().getMemberStack(butterfly.getButterfly().copy(), EnumFlutterType.BUTTERFLY)));
entity.setDead();
}
return true;
}
return false;
}
use of net.minecraftforge.fml.common.Optional.Method in project GregTech by GregTechCE.
the class SolidMaterial method ctAddEnchantmentForTools.
@ZenMethod("addToolEnchantment")
@Method(modid = GTValues.MODID_CT)
public void ctAddEnchantmentForTools(IEnchantment enchantment) {
Enchantment enchantmentType = (Enchantment) enchantment.getDefinition().getInternal();
toolEnchantments.add(new EnchantmentData(enchantmentType, enchantment.getLevel()));
}
Aggregations