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
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.internal.logging.text.StyledTextOutputFactory
import org.jetbrains.gradle.ext.Gradle

import javax.inject.Inject

import static org.gradle.internal.logging.text.StyledTextOutput.Style
Expand Down
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ dependencies {
implementation "curse.maven:infinitylib-251396:3317119"
implementation "curse.maven:spice-of-life-carrot-edition-277616:2959847"

compileOnly "curse.maven:enderio-64578:3328811"
compileOnly "curse.maven:endercore-231868:2972849"
// api "info.loenwind.autoconfig:AutoConfig:${project.minecraft.version}-1.0.2"
// api "info.loenwind.autosave:AutoSave:${project.minecraft.version}-1.0.11"
implementation "curse.maven:enderio-64578:3328811"
implementation "curse.maven:endercore-231868:2972849"
implementation "info.loenwind.autoconfig:AutoConfig:${project.minecraft.version}-1.0.2"
implementation "info.loenwind.autosave:AutoSave:${project.minecraft.version}-1.0.11"

implementation rfg.deobf("curse.maven:spiceoflife-220811:2571951")

Expand Down
9 changes: 9 additions & 0 deletions src/main/java/gregtechfoodoption/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ public static void registerBlocks(RegistryEvent.Register<Block> event) {
registry.register(GTFOMetaBlocks.GTFO_CASING);
registry.register(GTFOMetaBlocks.GTFO_METAL_CASING);
registry.register(GTFOMetaBlocks.GTFO_GLASS_CASING);
registry.register(GTFOMetaBlocks.PIZZA_MINCEMEAT);
registry.register(GTFOMetaBlocks.PIZZA_CHEESE);
registry.register(GTFOMetaBlocks.PIZZA_VEGGIE);
registry.register(GTFOMetaBlocks.PIZZA_BOX_MINCEMEAT);
registry.register(GTFOMetaBlocks.PIZZA_BOX_CHEESE);
registry.register(GTFOMetaBlocks.PIZZA_BOX_VEGGIE);

CROP_BLOCKS.forEach(registry::register);
GTFOMetaBlocks.GTFO_LEAVES.forEach(registry::register);
Expand All @@ -122,6 +128,9 @@ public static void registerItems(RegistryEvent.Register<Item> event) {
registry.register(createItemBlock(GTFOMetaBlocks.GTFO_CASING, VariantItemBlock::new));
registry.register(createItemBlock(GTFOMetaBlocks.GTFO_METAL_CASING, VariantItemBlock::new));
registry.register(createItemBlock(GTFOMetaBlocks.GTFO_GLASS_CASING, VariantItemBlock::new));
registry.register(createItemBlock(GTFOMetaBlocks.PIZZA_BOX_MINCEMEAT, ItemBlock::new));
registry.register(createItemBlock(GTFOMetaBlocks.PIZZA_BOX_CHEESE, ItemBlock::new));
registry.register(createItemBlock(GTFOMetaBlocks.PIZZA_BOX_VEGGIE, ItemBlock::new));
GTFOMetaBlocks.GTFO_LEAVES.forEach(leaves -> registry.register(createItemBlock(leaves, GTFOSpecialVariantItemBlock::new)));
GTFOMetaBlocks.GTFO_LOGS.forEach(log -> registry.register(createItemBlock(log, GTFOSpecialVariantItemBlock::new)));
GTFOMetaBlocks.GTFO_SAPLINGS.forEach(sapling -> registry.register(createItemBlock(sapling, GTFOSpecialVariantItemBlock::new)));
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/gregtechfoodoption/GTFOValues.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package gregtechfoodoption;

import gregtech.api.unification.material.info.MaterialIconSet;
import gregtech.api.items.toolitem.ToolHelper;
import gregtech.api.unification.material.Materials;
import gregtech.api.util.BaseCreativeTab;
import gregtechfoodoption.item.GTFOMetaItem;

Expand Down Expand Up @@ -35,6 +37,12 @@ public class GTFOValues {

public static final BaseCreativeTab TAB_GTFO = new BaseCreativeTab("gregtechfoodoption.main", () -> GTFOMetaItem.DOUGH.getStackForm(), true);
public static final BaseCreativeTab TAB_GTFO_FOOD = new BaseCreativeTab("gregtechfoodoption.food", () -> GTFOMetaItem.BANANA.getStackForm(), true);
public static final BaseCreativeTab TAB_GTFO_CROPS = new BaseCreativeTab("gregtechfoodoption.crops", () -> GTFOMetaItem.ONION_SEED.getStackForm(), true);
public static final BaseCreativeTab TAB_GTFO_TOOLS = new BaseCreativeTab("gregtechfoodoption.tools", () -> ToolHelper.getAndSetToolData(GTFOMetaItem.ROLLING_PIN, Materials.Wood, 1, 1, 1F, 1F), true);
public static final BaseCreativeTab TAB_GTFO_BLOCKS = new BaseCreativeTab("gregtechfoodoption.blocks", () -> GTFOMetaItem.ADOBE_BRICK.getStackForm(), true);
public static final BaseCreativeTab TAB_GTFO_DRUGSALCOHOL = new BaseCreativeTab("gregtechfoodoption.funnystuff", () -> GTFOMetaItem.BEER.getStackForm(), true);
public static final BaseCreativeTab TAB_GTFO_DRINKS = new BaseCreativeTab("gregtechfoodoption.drinks", () -> GTFOMetaItem.ORANGE_JUICE.getStackForm(), true);
public static final BaseCreativeTab TAB_GTFO_FRUITSVEGETABLES = new BaseCreativeTab("gregtechfoodoption.fruitsvegetables", () -> GTFOMetaItem.MANGO.getStackForm(), true);

public static final Random rand = new Random();
}
2 changes: 2 additions & 0 deletions src/main/java/gregtechfoodoption/block/GTFOBlockCasing.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gregtechfoodoption.block;

import gregtech.api.block.VariantBlock;
import gregtechfoodoption.GTFOValues;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
Expand All @@ -18,6 +19,7 @@ public GTFOBlockCasing() {
setResistance(10.0f);
setSoundType(SoundType.STONE);
setHarvestLevel("wrench", 2);
setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
setDefaultState(getState(CasingType.ADOBE_BRICKS));
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregtechfoodoption/block/GTFOCrop.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gregtechfoodoption.block;

import gregtechfoodoption.GTFOValues;
import gregtechfoodoption.GregTechFoodOption;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.properties.PropertyInteger;
Expand Down Expand Up @@ -36,6 +37,7 @@ protected GTFOCrop(String name) {
CROP_BLOCKS.add(this);
this.name = name;
this.setTranslationKey("gtfo_crop_" + name);
this.setCreativeTab(GTFOValues.TAB_GTFO_CROPS);
}

public static GTFOCrop create(String name) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregtechfoodoption/block/GTFOGlassCasing.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gregtechfoodoption.block;

import gregtech.api.block.VariantActiveBlock;
import gregtechfoodoption.GTFOValues;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
Expand All @@ -26,6 +27,7 @@ public GTFOGlassCasing() {
setResistance(5.0F);
setSoundType(SoundType.GLASS);
setHarvestLevel("pickaxe", 1);
setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
setDefaultState(getState(CasingType.GREENHOUSE_GLASS));
}

Expand Down
26 changes: 26 additions & 0 deletions src/main/java/gregtechfoodoption/block/GTFOMetaBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public class GTFOMetaBlocks {
public static GTFOBlockCasing GTFO_CASING;
public static GTFOMetalCasing GTFO_METAL_CASING;
public static GTFOGlassCasing GTFO_GLASS_CASING;
public static GTFOPizza PIZZA_MINCEMEAT;
public static GTFOPizza PIZZA_CHEESE;
public static GTFOPizza PIZZA_VEGGIE;
public static GTFOPizzaBox PIZZA_BOX_MINCEMEAT;
public static GTFOPizzaBox PIZZA_BOX_CHEESE;
public static GTFOPizzaBox PIZZA_BOX_VEGGIE;

public static List<GTFOBlockLeaves> GTFO_LEAVES = new ArrayList<>();
public static List<GTFOBlockLog> GTFO_LOGS = new ArrayList<>();
Expand All @@ -51,6 +57,23 @@ public static void init() {
GTFO_GLASS_CASING = new GTFOGlassCasing();
GTFO_GLASS_CASING.setRegistryName("gtfo_glass_casing");

PIZZA_MINCEMEAT = new GTFOPizza("pizza_mincemeat");
PIZZA_MINCEMEAT.setRegistryName("pizza_mincemeat");

PIZZA_CHEESE = new GTFOPizza("pizza_cheese");
PIZZA_CHEESE.setRegistryName("pizza_cheese");

PIZZA_VEGGIE = new GTFOPizza("pizza_veggie");
PIZZA_VEGGIE.setRegistryName("pizza_veggie");
PIZZA_BOX_MINCEMEAT = new GTFOPizzaBox("pizza_box_mincemeat", PIZZA_MINCEMEAT);
PIZZA_BOX_MINCEMEAT.setRegistryName("pizza_box_mincemeat");

PIZZA_BOX_CHEESE = new GTFOPizzaBox("pizza_box_cheese", PIZZA_CHEESE);
PIZZA_BOX_CHEESE.setRegistryName("pizza_box_cheese");

PIZZA_BOX_VEGGIE = new GTFOPizzaBox("pizza_box_veggie", PIZZA_VEGGIE);
PIZZA_BOX_VEGGIE.setRegistryName("pizza_box_veggie");

GTFOTrees.init();
GTFOBerries.init();
for (int i = 0; i <= (GTFOTree.TREES.size() - 1) / 4; i++) {
Expand Down Expand Up @@ -79,6 +102,9 @@ public static void registerItemModels() {
registerItemModel(GTFO_CASING);
registerItemModel(GTFO_METAL_CASING);
registerItemModel(GTFO_GLASS_CASING);
registerItemModel(PIZZA_BOX_MINCEMEAT);
registerItemModel(PIZZA_BOX_CHEESE);
registerItemModel(PIZZA_BOX_VEGGIE);
GTFO_LEAVES.forEach(GTFOMetaBlocks::registerItemModel);
GTFO_SAPLINGS.forEach(GTFOMetaBlocks::registerItemModel);
for (GTFOBlockSapling sapling : GTFO_SAPLINGS) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregtechfoodoption/block/GTFOMetalCasing.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import gregtech.api.block.VariantBlock;
import gregtech.api.unification.material.Material;
import gregtech.client.renderer.ICubeRenderer;
import gregtechfoodoption.GTFOValues;
import net.minecraft.block.SoundType;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLiving;
Expand All @@ -21,6 +22,7 @@ public GTFOMetalCasing() {
setResistance(10.0f);
setSoundType(SoundType.METAL);
setHarvestLevel("wrench", 2);
setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
setDefaultState(getState(CasingType.BISMUTH_BRONZE_CASING));
}

Expand Down
90 changes: 90 additions & 0 deletions src/main/java/gregtechfoodoption/block/GTFOPizza.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package gregtechfoodoption.block;

import gregtechfoodoption.GTFOValues;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.stats.StatList;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class GTFOPizza extends Block {
public static final PropertyInteger BITES = PropertyInteger.create("bites", 0, 3);
private static final AxisAlignedBB PIZZA_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D);

public GTFOPizza(String name) {
super(Material.CAKE);
setTranslationKey(name);
setHardness(0.5F);
setSoundType(SoundType.CLOTH);
setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
setDefaultState(getBlockState().getBaseState().withProperty(BITES, 0));
}

@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BITES);
}

@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(BITES, Math.min(3, meta));
}

@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(BITES);
}

@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
return PIZZA_AABB;
}

@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}

@Override
public boolean isFullCube(IBlockState state) {
return false;
}

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand,
EnumFacing facing, float hitX, float hitY, float hitZ) {
if (worldIn.isRemote) {
return true;
}
if (!playerIn.canEat(false)) {
return false;
}
eatSlice(worldIn, pos, state, playerIn);
return true;
}

private void eatSlice(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn) {
playerIn.getFoodStats().addStats(2, 0.1F);
playerIn.addStat(StatList.CAKE_SLICES_EATEN);
worldIn.playSound(null, pos, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 0.5F,
worldIn.rand.nextFloat() * 0.1F + 0.9F);

int bites = state.getValue(BITES);
if (bites >= 3) {
worldIn.setBlockToAir(pos);
} else {
worldIn.setBlockState(pos, state.withProperty(BITES, bites + 1), 3);
}
}
}
76 changes: 76 additions & 0 deletions src/main/java/gregtechfoodoption/block/GTFOPizzaBox.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package gregtechfoodoption.block;

import gregtechfoodoption.GTFOValues;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;

public class GTFOPizzaBox extends Block {
private static final AxisAlignedBB PIZZA_BOX_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D);
private final Block pizzaBlock;

public GTFOPizzaBox(String name, Block pizzaBlock) {
super(Material.WOOD);
this.pizzaBlock = pizzaBlock;
setTranslationKey(name);
setHardness(0.5F);
setResistance(1.0F);
setSoundType(SoundType.WOOD);
setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
}

@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
return PIZZA_BOX_AABB;
}

@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return PIZZA_BOX_AABB;
}

@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}

@Override
public boolean isFullCube(IBlockState state) {
return false;
}

@Override
public boolean isTopSolid(IBlockState state) {
return true;
}

@Override
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
return side == EnumFacing.UP;
}

@Override
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) {
return face == EnumFacing.UP ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED;
}

@Override
public boolean onBlockActivated(net.minecraft.world.World worldIn, BlockPos pos, IBlockState state,
net.minecraft.entity.player.EntityPlayer playerIn, net.minecraft.util.EnumHand hand,
EnumFacing facing, float hitX, float hitY, float hitZ) {
if (worldIn.isRemote) {
return true;
}
if (pizzaBlock == null) {
return false;
}
worldIn.setBlockState(pos, pizzaBlock.getDefaultState(), 3);
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public GTFOBlockLeaves(int offset) {
.withProperty(DECAYABLE, true)
.withProperty(VARIANT, 0));
GTFOMetaBlocks.GTFO_LEAVES.add(this);
this.setCreativeTab(GTFOValues.TAB_GTFO);
this.setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
Blocks.FIRE.setFireInfo(this, 30, 60);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public GTFOBlockLog(int offset) {
.withProperty(LOG_AXIS, EnumAxis.Y));
GTFOMetaBlocks.GTFO_LOGS.add(this);
Blocks.FIRE.setFireInfo(this, 5, 5);
this.setCreativeTab(GTFOValues.TAB_GTFO);
this.setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
setHarvestLevel("axe", 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public GTFOBlockPlanks(int offset) {
setHarvestLevel("axe", 0);
Blocks.FIRE.setFireInfo(this, 5, 20);
GTFOMetaBlocks.GTFO_PLANKS.add(this);
this.setCreativeTab(GTFOValues.TAB_GTFO);
this.setCreativeTab(GTFOValues.TAB_GTFO_BLOCKS);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public GTFOBlockSapling(int offset) {
this.setLightOpacity(1);
this.setSoundType(SoundType.PLANT);
GTFOMetaBlocks.GTFO_SAPLINGS.add(this);
this.setCreativeTab(GTFOValues.TAB_GTFO);
this.setCreativeTab(GTFOValues.TAB_GTFO_CROPS);
}

@Nonnull
Expand Down
Loading
Loading