Search in sources :

Example 31 with OnlyIn

use of net.minecraftforge.api.distmarker.OnlyIn in project Overloaded by CJ-MC-Mods.

the class BlockHyperItemReceiver method registerModel.

@Override
@OnlyIn(Dist.CLIENT)
public void registerModel() {
    super.registerModel();
    ImageUtil.registerDynamicTexture(new ResourceLocation(MODID, "textures/block/hyper_item_receiver.png"), OverloadedConfig.INSTANCE.textureResolutions.blockResolution);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Example 32 with OnlyIn

use of net.minecraftforge.api.distmarker.OnlyIn in project Overloaded by CJ-MC-Mods.

the class BlockCreativeGenerator method registerModel.

@OnlyIn(Dist.CLIENT)
@Override
public void registerModel() {
    ModelResourceLocation location = new ModelResourceLocation(getRegistryName(), "inventory");
    // ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, location);
    ImageUtil.registerDynamicTexture(new ResourceLocation(MODID, "textures/block/creative_generator.png"), OverloadedConfig.INSTANCE.textureResolutions.blockResolution);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.model.ModelResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.model.ModelResourceLocation) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Example 33 with OnlyIn

use of net.minecraftforge.api.distmarker.OnlyIn in project Overloaded by CJ-MC-Mods.

the class ItemRailGun method registerModel.

@OnlyIn(Dist.CLIENT)
@Override
public void registerModel() {
    ModelResourceLocation location = new ModelResourceLocation(new ResourceLocation(MODID, "railgun"), null);
    // ModelLoader.setCustomModelResourceLocation(this, 0, location);
    ImageUtil.registerDynamicTexture(new ResourceLocation(MODID, "textures/item/railgun.png"), OverloadedConfig.INSTANCE.textureResolutions.itemResolution);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.model.ModelResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.model.ModelResourceLocation) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Example 34 with OnlyIn

use of net.minecraftforge.api.distmarker.OnlyIn in project Overloaded by CJ-MC-Mods.

the class ItemRailGun method use.

@Override
@Nonnull
@OnlyIn(Dist.CLIENT)
public ActionResult<ItemStack> use(World worldIn, @Nonnull PlayerEntity playerIn, @Nonnull Hand handIn) {
    if (worldIn.isClientSide) {
        int distance = OverloadedConfig.INSTANCE.railGun.maxRange;
        Vector3d vec3d = playerIn.getEyePosition(Minecraft.getInstance().getFrameTime());
        Vector3d vec3d1 = playerIn.getViewVector(Minecraft.getInstance().getFrameTime());
        Vector3d vec3d2 = vec3d.add(vec3d1.x * distance, vec3d1.y * distance, vec3d1.z * distance);
        float f = 1.0F;
        AxisAlignedBB axisalignedbb = playerIn.getBoundingBox().expandTowards(vec3d1.scale(distance)).inflate(1.0D, 1.0D, 1.0D);
        EntityRayTraceResult ray = ProjectileHelper.getEntityHitResult(playerIn, vec3d, vec3d2, axisalignedbb, (p_215312_0_) -> !p_215312_0_.isSpectator() && p_215312_0_.isPickable(), distance * distance);
        if (ray != null) {
            Vector3d moveVev = playerIn.getEyePosition(1).subtract(ray.getLocation()).normalize().scale(-1.0);
            Overloaded.proxy.networkWrapper.sendToServer(new RailGunFireMessage(ray.getEntity().getId(), moveVev, handIn));
        } else {
            Overloaded.proxy.networkWrapper.sendToServer(new RailGunFireMessage(0, Vector3d.ZERO, handIn));
        }
    }
    return new ActionResult<>(ActionResultType.SUCCESS, playerIn.getItemInHand(handIn));
}
Also used : AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) RailGunFireMessage(com.cjm721.overloaded.network.packets.RailGunFireMessage) EntityRayTraceResult(net.minecraft.util.math.EntityRayTraceResult) Vector3d(net.minecraft.util.math.vector.Vector3d) Nonnull(javax.annotation.Nonnull) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Example 35 with OnlyIn

use of net.minecraftforge.api.distmarker.OnlyIn in project Overloaded by CJ-MC-Mods.

the class ItemSettingEditor method registerModel.

@OnlyIn(Dist.CLIENT)
@Override
public void registerModel() {
    ModelResourceLocation location = new ModelResourceLocation(new ResourceLocation(MODID, "settings_editor"), null);
    // ModelLoader.setCustomModelResourceLocation(this, 0, location);
    ImageUtil.registerDynamicTexture(new ResourceLocation(MODID, "textures/item/settings_editor.png"), OverloadedConfig.INSTANCE.textureResolutions.itemResolution);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.model.ModelResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.model.ModelResourceLocation) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Aggregations

OnlyIn (net.minecraftforge.api.distmarker.OnlyIn)45 ResourceLocation (net.minecraft.util.ResourceLocation)23 ModelResourceLocation (net.minecraft.client.renderer.model.ModelResourceLocation)17 Minecraft (net.minecraft.client.Minecraft)5 ResizeableTextureGenerator (com.cjm721.overloaded.client.render.dynamic.general.ResizeableTextureGenerator)3 StringTextComponent (net.minecraft.util.text.StringTextComponent)3 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)3 CompoundNBT (net.minecraft.nbt.CompoundNBT)2 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)2 BlockPos (net.minecraft.util.math.BlockPos)2 Vector3d (net.minecraft.util.math.vector.Vector3d)2 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)2 BlockBPMultipart (com.bluepowermod.block.BlockBPMultipart)1 RailGunFireMessage (com.cjm721.overloaded.network.packets.RailGunFireMessage)1 Streams (com.google.common.collect.Streams)1 MinecraftProfileTexture (com.mojang.authlib.minecraft.MinecraftProfileTexture)1 Type (com.mojang.authlib.minecraft.MinecraftProfileTexture.Type)1 IVertexBuilder (com.mojang.blaze3d.vertex.IVertexBuilder)1 ILaunchPluginService (cpw.mods.modlauncher.serviceapi.ILaunchPluginService)1 ArrayList (java.util.ArrayList)1