Search in sources :

Example 1 with GrenadeSkins

use of ladysnake.gaspunk.api.customization.GrenadeSkins in project Gaspunk by Ladysnake.

the class ThaumcraftCompat method registerGasAspect.

private static void registerGasAspect(IGas gas, AspectList aspects) {
    ItemStack gasTube = ((ItemGasTube) ModItems.GAS_TUBE).getItemStackFor(gas);
    aspects.add(divide(generateAspectsFromBrewing(gasTube), 1.1));
    ThaumcraftApi.registerObjectTag(gasTube, aspects.copy());
    ItemStack grenade = ((ItemGrenade) ModItems.GRENADE).getItemStackFor(gas);
    // aspects = divide(aspects, 1.2);
    aspects.add(divide(AspectHelper.getObjectAspects(new ItemStack(ModItems.GRENADE)), 1.8));
    for (GrenadeSkins skin : GrenadeSkins.VALUES) {
        // need to register for every skin as thaumcraft counts an itemstack with different nbt as unique
        ((ItemGrenade) ModItems.GRENADE).setSkin(grenade, skin);
        ThaumcraftApi.registerObjectTag(grenade, aspects.copy());
    }
}
Also used : ItemGasTube(ladysnake.gaspunk.item.ItemGasTube) GrenadeSkins(ladysnake.gaspunk.api.customization.GrenadeSkins) ItemGrenade(ladysnake.gaspunk.item.ItemGrenade) ItemStack(net.minecraft.item.ItemStack)

Example 2 with GrenadeSkins

use of ladysnake.gaspunk.api.customization.GrenadeSkins in project Gaspunk by Ladysnake.

the class ClientProxy method onSpecialRewardsRetrieved.

@Override
public void onSpecialRewardsRetrieved() {
    UUID profileID = Minecraft.getMinecraft().getSession().getProfile().getId();
    // add the config option to choose which one will appear on new grenades
    if (SpecialRewardChecker.isSpecialPerson(profileID)) {
        List<GrenadeSkins> awardedSkins = SpecialRewardChecker.getRewards(profileID);
        // list of valid skins this player can have
        String[] skinNames = awardedSkins.stream().map(GrenadeSkins::getDisplayName).toArray(String[]::new);
        // this guy has a special skin, don't hide it by default
        String defaultSkin = awardedSkins.stream().filter(g -> g != GrenadeSkins.NONE).findAny().orElse(GrenadeSkins.NONE).getDisplayName();
        selectedSkin = config.get("general", "specialGrenadeSkin", defaultSkin, "The kind of diffuser you will craft (grenade skins are determined by the diffuser used)", skinNames);
    }
}
Also used : CommonProxy(ladysnake.gaspunk.CommonProxy) Loader(net.minecraftforge.fml.common.Loader) GasPunk(ladysnake.gaspunk.GasPunk) GrenadeSkins(ladysnake.gaspunk.api.customization.GrenadeSkins) World(net.minecraft.world.World) ModItems(ladysnake.gaspunk.init.ModItems) ItemGasTube(ladysnake.gaspunk.item.ItemGasTube) UUID(java.util.UUID) LayerBelt(ladysnake.gaspunk.client.render.entity.LayerBelt) java.awt(java.awt) ParticleGasSmoke(ladysnake.gaspunk.client.particle.ParticleGasSmoke) List(java.util.List) LadyLib(ladylib.LadyLib) Minecraft(net.minecraft.client.Minecraft) Side(net.minecraftforge.fml.relauncher.Side) FMLPreInitializationEvent(net.minecraftforge.fml.common.event.FMLPreInitializationEvent) Optional(java.util.Optional) SpecialRewardChecker(ladysnake.gaspunk.util.SpecialRewardChecker) Property(net.minecraftforge.common.config.Property) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) IGasParticleType(ladysnake.gaspunk.api.IGasParticleType) GrenadeSkins(ladysnake.gaspunk.api.customization.GrenadeSkins) UUID(java.util.UUID)

Aggregations

GrenadeSkins (ladysnake.gaspunk.api.customization.GrenadeSkins)2 ItemGasTube (ladysnake.gaspunk.item.ItemGasTube)2 java.awt (java.awt)1 List (java.util.List)1 Optional (java.util.Optional)1 UUID (java.util.UUID)1 LadyLib (ladylib.LadyLib)1 CommonProxy (ladysnake.gaspunk.CommonProxy)1 GasPunk (ladysnake.gaspunk.GasPunk)1 IGasParticleType (ladysnake.gaspunk.api.IGasParticleType)1 ParticleGasSmoke (ladysnake.gaspunk.client.particle.ParticleGasSmoke)1 LayerBelt (ladysnake.gaspunk.client.render.entity.LayerBelt)1 ModItems (ladysnake.gaspunk.init.ModItems)1 ItemGrenade (ladysnake.gaspunk.item.ItemGrenade)1 SpecialRewardChecker (ladysnake.gaspunk.util.SpecialRewardChecker)1 Minecraft (net.minecraft.client.Minecraft)1 ItemStack (net.minecraft.item.ItemStack)1 World (net.minecraft.world.World)1 Property (net.minecraftforge.common.config.Property)1 Loader (net.minecraftforge.fml.common.Loader)1