Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ repositories {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
maven {
name = "progwml6"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
name = "blamejared"
url = "https://maven.blamejared.com/"
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/gregtechfoodoption/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gregtechfoodoption;

import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import gregtech.api.GTValues;
import gregtech.api.util.LocalizationUtils;
import gregtechfoodoption.block.GTFOMetaBlocks;
import gregtechfoodoption.entity.GTFOEntities;
Expand All @@ -14,6 +15,7 @@
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Mod;
Expand Down Expand Up @@ -42,13 +44,14 @@ public void preLoad() {
Minecraft.getMinecraft().getFramebuffer().enableStencil();
}
GTFOEntities.registerRenders();
OBJLoader.INSTANCE.addDomain(GTValues.MODID);
}


@Override
public void onLoad() {
super.onLoad();
if(Loader.isModLoaded("appleskin")) {
if(Loader.isModLoaded(GTFOValues.MODID_AP)) {
GTFOMetaTooltipOverlay.init();
GTFOMetaHUDOverlay.init();
}
Expand Down
50 changes: 49 additions & 1 deletion src/main/java/gregtechfoodoption/item/GTFOMetaItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
import gregtechfoodoption.potion.*;
import gregtechfoodoption.utils.GTFOLog;
import gregtechfoodoption.utils.GTFOUtils;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -376,6 +379,11 @@ public class GTFOMetaItem extends MetaItem<GTFOMetaItem.GTFOMetaValueItem> imple

public static MetaItem<?>.MetaValueItem EMERGENCY_RATIONS;

//KillReal items
public static MetaItem<?>.MetaValueItem JACK_DANIELS;
public static MetaItem<?>.MetaValueItem CHEESE;
//

public GTFOMetaItem() {
super((short) 0);
}
Expand Down Expand Up @@ -883,6 +891,15 @@ public void registerSubItems() {
WHITE_GRAPE_SEED = addItem(321, "seed.white_grape");
WHITE_GRAPE_SEED.addComponents(new GTFOCropSeedBehaviour(GTFOCrops.CROP_WHITE_GRAPE, WHITE_GRAPE_SEED.getStackForm(), WHITE_GRAPES.getStackForm()));

//ALCOHOL
JACK_DANIELS = addItem(326, "food.alcohol.jack_daniels").addComponents(new GTFOFoodStats(4, 0.7f, true, true, new ItemStack(Items.GLASS_BOTTLE),
new RandomPotionEffect(MobEffects.NAUSEA, 600, 0, 100 - 60),
new RandomPotionEffect(MobEffects.RESISTANCE, 400, 0, 100 - 40))
.setEatingDuration(96));
//
//Experiment
CHEESE = addItem(327, "food.models.cheese").setHasObjModel(true)
.addComponents(new GTFOFoodStats(4, 0.7f));

// 175-189 left blank for organic circuits
SPRINKLER_COVER = addItem(224, "cover.sprinkler");
Expand Down Expand Up @@ -936,7 +953,7 @@ public ItemStack getContainerItem(ItemStack stack) {


protected String formatModelPath(GTFOMetaItem.GTFOMetaValueItem metaValueItem) {
return "metaitems/" + metaValueItem.unlocalizedName.replace('.', '/');
return "metaitems/" + metaValueItem.unlocalizedName.replace('.', '/') + (metaValueItem.hasObjModel ? ".obj" : "");
}

@Override
Expand Down Expand Up @@ -972,6 +989,7 @@ public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStac
}

public class GTFOMetaValueItem extends MetaItem<?>.MetaValueItem {
private boolean hasObjModel;

protected GTFOMetaValueItem(int metaValue, String unlocalizedName) {
super(metaValue, unlocalizedName);
Expand All @@ -995,7 +1013,37 @@ protected void addItemComponentsInternal(IItemComponent... stats) {
}
}

public boolean hasObjModel() {
return hasObjModel;
}

public GTFOMetaValueItem setHasObjModel(boolean hasObjModel) {
this.hasObjModel = hasObjModel;
return this;
}
}

@SideOnly(Side.CLIENT)
public void registerModels() {
for (short itemMetaKey : metaItems.keySet()) {
GTFOMetaValueItem metaValueItem = metaItems.get(itemMetaKey);
int numberOfModels = metaValueItem.getModelAmount();
if (numberOfModels > 1) {
ModelResourceLocation[] resourceLocations = new ModelResourceLocation[numberOfModels];
for (int i = 0; i < resourceLocations.length; i++) {
ResourceLocation resourceLocation = createItemModelPath(metaValueItem, "/" + (i + 1));
ModelBakery.registerItemVariants(this, resourceLocation);
resourceLocations[i] = new ModelResourceLocation(resourceLocation, "inventory");
}
specialItemsModels.put((short) (metaItemOffset + itemMetaKey), resourceLocations);
continue;
}
ResourceLocation resourceLocation = createItemModelPath(metaValueItem, "");
if (numberOfModels > 0) {
ModelBakery.registerItemVariants(this, resourceLocation);
}

metaItemsModels.put((short) (metaItemOffset + itemMetaKey), new ModelResourceLocation(resourceLocation, "inventory"));
}
}
}
Binary file not shown.

This file was deleted.

172 changes: 0 additions & 172 deletions src/main/resources/assets/gregtech/models/item/gradlew

This file was deleted.

Loading