Skip to content

Commit

Permalink
Merge pull request #323 from Mixinors/development-1.16.3
Browse files Browse the repository at this point in the history
1.11.1
  • Loading branch information
Shnupbups authored Oct 12, 2020
2 parents 108ea7e + c242cde commit 263bcc0
Show file tree
Hide file tree
Showing 233 changed files with 5,923 additions and 1,407 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
package com.github.chainmailstudios.astromine.datagen.entrypoint;

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.datagen.registry.*;
import me.shedaniel.cloth.api.datagen.v1.*;
import com.github.chainmailstudios.astromine.datagen.registry.AstromineLootTableGenerators;
import com.github.chainmailstudios.astromine.datagen.registry.AstromineMaterialSets;
import com.github.chainmailstudios.astromine.datagen.registry.AstromineModelStateGenerators;
import com.github.chainmailstudios.astromine.datagen.registry.AstromineRecipeGenerators;
import com.github.chainmailstudios.astromine.datagen.registry.AstromineTagGenerators;
import com.github.chainmailstudios.astromine.datagen.registry.AstromineWorldGenGenerators;
import me.shedaniel.cloth.api.datagen.v1.DataGeneratorHandler;
import me.shedaniel.cloth.api.datagen.v1.LootTableData;
import me.shedaniel.cloth.api.datagen.v1.ModelStateData;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;
import me.shedaniel.cloth.api.datagen.v1.TagData;
import me.shedaniel.cloth.api.datagen.v1.WorldGenData;

import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.chainmailstudios.astromine.datagen.generator.modelstate.onetime;

import net.minecraft.block.Block;
import net.minecraft.data.client.model.ModelIds;

import me.shedaniel.cloth.api.datagen.v1.ModelStateData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

import me.shedaniel.cloth.api.datagen.v1.ModelStateData;

import java.util.Arrays;
import java.util.List;

public class SimpleBlockItemModelStateGenerator extends GenericBlockModelStateGenerator {
public SimpleBlockItemModelStateGenerator(Block... blocks) {
super(blocks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.github.chainmailstudios.astromine.datagen.generator.recipe.onetime.base.CookingRecipeGenerator;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;
Expand All @@ -26,7 +25,7 @@ public BlastingRecipeGenerator(Ingredient input, ItemConvertible output) {
@Override
public Identifier getRecipeId() {
Identifier id = super.getRecipeId();
return new Identifier(id.getNamespace(), id.getPath()+"_from_blasting");
return new Identifier(id.getNamespace(), id.getPath() + "_from_blasting");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

public class Crafting3x3RecipeGenerator extends ShapedCraftingRecipeGenerator {
public Crafting3x3RecipeGenerator(ItemConvertible output, Ingredient input) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import net.minecraft.data.server.recipe.ShapedRecipeJsonFactory;
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.github.chainmailstudios.astromine.datagen.generator.recipe.onetime.base.OneTimeRecipeGenerator;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;
Expand Down Expand Up @@ -35,7 +33,7 @@ public ShapedCraftingRecipeGenerator addIngredient(char c, Ingredient ingredient
@Override
public void generate(RecipeData recipes) {
if (ingredients.size() == 0) throw new IllegalStateException("recipe must have at least one ingredient");
else if(pattern.length == 0) throw new IllegalStateException("recipe must have a pattern");
else if (pattern.length == 0) throw new IllegalStateException("recipe must have a pattern");
else {
ShapedRecipeJsonFactory factory = ShapedRecipeJsonFactory
.create(output, outputCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import net.minecraft.data.server.recipe.ShapelessRecipeJsonFactory;
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.github.chainmailstudios.astromine.datagen.generator.recipe.onetime.base.OneTimeRecipeGenerator;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

public class SlabCraftingRecipeGenerator extends ShapedCraftingRecipeGenerator {
public SlabCraftingRecipeGenerator(ItemConvertible output, Ingredient base) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.github.chainmailstudios.astromine.datagen.generator.recipe.onetime.base.CookingRecipeGenerator;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;
Expand All @@ -26,7 +25,7 @@ public SmeltingRecipeGenerator(Ingredient input, ItemConvertible output) {
@Override
public Identifier getRecipeId() {
Identifier id = super.getRecipeId();
return new Identifier(id.getNamespace(), id.getPath()+"_from_smelting");
return new Identifier(id.getNamespace(), id.getPath() + "_from_smelting");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

public class StairsCraftingRecipeGenerator extends ShapedCraftingRecipeGenerator {
public StairsCraftingRecipeGenerator(ItemConvertible output, Ingredient base) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import net.minecraft.data.server.recipe.SingleItemRecipeJsonFactory;
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.StonecuttingRecipe;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.github.chainmailstudios.astromine.datagen.generator.recipe.onetime.base.OneTimeRecipeGenerator;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;
Expand All @@ -31,7 +29,7 @@ public String getGeneratorName() {
@Override
public Identifier getRecipeId() {
Identifier id = super.getRecipeId();
return new Identifier(id.getNamespace(), id.getPath()+"_from_stonecutting");
return new Identifier(id.getNamespace(), id.getPath() + "_from_stonecutting");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

public class WallCraftingRecipeGenerator extends ShapedCraftingRecipeGenerator {
public WallCraftingRecipeGenerator(ItemConvertible output, Ingredient base) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

public abstract class CookingRecipeGenerator extends SimpleProcessingRecipeGenerator {
public final float experience;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

public abstract class EnergyProcessingRecipeGenerator extends SimpleProcessingRecipeGenerator {
public final int energyConsumed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Identifier;

public abstract class SimpleProcessingRecipeGenerator extends OneTimeRecipeGenerator {
public final Ingredient input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.github.chainmailstudios.astromine.datagen.material.MaterialSet;
import me.shedaniel.cloth.api.datagen.v1.RecipeData;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -39,26 +38,27 @@ public void addType(char c, MaterialItemType type) {

@Override
public void generate(RecipeData recipes, MaterialSet set) {
if(pattern.length == 0) throw new IllegalStateException("recipe must have a pattern");
if (pattern.length == 0) throw new IllegalStateException("recipe must have a pattern");
else {
ShapedRecipeJsonFactory factory = ShapedRecipeJsonFactory
.create(set.getItem(output), outputCount)
.criterion("impossible", new ImpossibleCriterion.Conditions());
for (String s : pattern) {
factory.pattern(s);
}
if(patternContains('#')) factory.input('#', set.getIngredient(input));
if(patternContains('I')) factory.input('I', set.getItem(input));
if (patternContains('#')) factory.input('#', set.getIngredient(input));
if (patternContains('I')) factory.input('I', set.getItem(input));
ingredients.forEach(factory::input);
types.forEach((c, type) -> factory.input(c, set.getIngredient(type)));
factory.offerTo(recipes, getRecipeId(set));
}
}

public boolean patternContains(char c) {
for(String s:pattern) {
if(s.contains(String.valueOf(c))) return true;
} return false;
for (String s : pattern) {
if (s.contains(String.valueOf(c))) return true;
}
return false;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ShapelessCraftingSetRecipeGenerator extends CraftingSetRecipeGenerator {
public final List<Ingredient> ingredients;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public Ingredient asIngredient() {
@Override
public Item asItem() {
Item item = Registry.ITEM.get(itemId);
if(item.equals(Items.AIR)) throw new InvalidIdentifierException("oh fuck entry "+this.getItemId()+" returned air");
if (item.equals(Items.AIR))
throw new InvalidIdentifierException("oh fuck entry " + this.getItemId() + " returned air");
return item;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@

package com.github.chainmailstudios.astromine;

import blue.endless.jankson.Jankson;
import com.github.chainmailstudios.astromine.registry.*;
import com.google.gson.Gson;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;

import net.minecraft.util.Identifier;

import blue.endless.jankson.Jankson;
import com.github.chainmailstudios.astromine.registry.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.google.gson.Gson;

public class AstromineCommon implements ModInitializer {
public static final String LOG_ID = "Astromine";
public static final String MOD_ID = "astromine";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

package com.github.chainmailstudios.astromine.client.rei;

import com.github.chainmailstudios.astromine.common.utilities.NumberUtilities;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

Expand All @@ -43,9 +42,10 @@

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.client.render.sprite.SpriteRenderer;
import com.github.chainmailstudios.astromine.common.volume.fraction.Fraction;
import com.github.chainmailstudios.astromine.common.utilities.FluidUtilities;
import com.github.chainmailstudios.astromine.common.utilities.NumberUtilities;
import com.github.chainmailstudios.astromine.common.volume.fluid.FluidVolume;
import com.github.chainmailstudios.astromine.common.volume.fraction.Fraction;
import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.EntryStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

package com.github.chainmailstudios.astromine.client.screen.base;

import com.github.vini2003.blade.client.handler.BaseHandledScreen;
import com.github.vini2003.blade.common.handler.BaseScreenHandler;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;

import com.github.vini2003.blade.client.handler.BaseHandledScreen;
import com.github.vini2003.blade.common.handler.BaseScreenHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

package com.github.chainmailstudios.astromine.client.screen.base.block;

import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;

import com.github.chainmailstudios.astromine.client.screen.base.BladeHandledScreen;
import com.github.chainmailstudios.astromine.common.screenhandler.base.block.ComponentBlockEntityScreenHandler;
import com.github.vini2003.blade.common.handler.BaseScreenHandler;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;

public class ComponentBlockEntityHandledScreen<T extends ComponentBlockEntityScreenHandler> extends BladeHandledScreen<T> {
public ComponentBlockEntityHandledScreen(BaseScreenHandler handler, PlayerInventory inventory, Text title) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

package com.github.chainmailstudios.astromine.client.screen.base.entity;

import com.github.chainmailstudios.astromine.common.screenhandler.base.entity.ComponentEntityFluidInventoryScreenHandler;
import com.github.vini2003.blade.common.handler.BaseScreenHandler;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;

import com.github.chainmailstudios.astromine.common.screenhandler.base.entity.ComponentEntityFluidInventoryScreenHandler;
import com.github.vini2003.blade.common.handler.BaseScreenHandler;

public abstract class ComponentEntityFluidInventoryHandledScreen<T extends ComponentEntityFluidInventoryScreenHandler> extends ComponentEntityHandledScreen<T> {
public ComponentEntityFluidInventoryHandledScreen(BaseScreenHandler handler, PlayerInventory inventory, Text title) {
super(handler, inventory, title);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

package com.github.chainmailstudios.astromine.client.screen.base.entity;

import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;

import com.github.chainmailstudios.astromine.client.screen.base.BladeHandledScreen;
import com.github.chainmailstudios.astromine.common.screenhandler.base.entity.ComponentEntityScreenHandler;
import com.github.vini2003.blade.common.handler.BaseScreenHandler;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;

public class ComponentEntityHandledScreen<T extends ComponentEntityScreenHandler> extends BladeHandledScreen<T> {
public ComponentEntityHandledScreen(BaseScreenHandler handler, PlayerInventory inventory, Text title) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

package com.github.chainmailstudios.astromine.common.block.base;

import com.github.chainmailstudios.astromine.common.item.base.EnergyVolumeItem;
import com.github.chainmailstudios.astromine.common.item.base.FluidVolumeItem;
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;

import net.minecraft.block.AbstractBlock;
Expand Down Expand Up @@ -57,6 +55,9 @@
import net.minecraft.world.BlockView;
import net.minecraft.world.World;

import com.github.chainmailstudios.astromine.common.item.base.EnergyVolumeItem;
import com.github.chainmailstudios.astromine.common.item.base.FluidVolumeItem;

import java.util.List;

public abstract class BlockWithEntity extends Block implements BlockEntityProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@

package com.github.chainmailstudios.astromine.common.block.base;

import net.minecraft.block.*;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.ShapeContext;
import net.minecraft.block.Waterloggable;
import net.minecraft.entity.LivingEntity;
import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

package com.github.chainmailstudios.astromine.common.block.base;

import com.github.chainmailstudios.astromine.AstromineCommon;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
Expand All @@ -43,6 +42,8 @@
import net.minecraft.util.registry.Registry;
import net.minecraft.world.World;

import com.github.chainmailstudios.astromine.AstromineCommon;

import java.util.Locale;
import java.util.Optional;
import java.util.Random;
Expand Down
Loading

0 comments on commit 263bcc0

Please sign in to comment.