Removal of lots of fixmes.
Removed InvTweaks sort order (mod indicates it wont update, suggested replacement cpw sorting mod only sorts by count and reg-id). Reactivated dissassemble special recipe. Removed leftovers from cable bus non-tesr tile. Added JEI facade recipes back in. Removed superflous datagen for quartz tools.
This commit is contained in:
@@ -18,13 +18,12 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.effects.ParticleTypes;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.MetaRotation;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
@@ -48,10 +47,13 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.effects.ParticleTypes;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.MetaRotation;
|
||||
|
||||
public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock {
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.block.misc;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.entity.EntityTinyTNTPrimed;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -43,7 +43,8 @@ import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.entity.EntityTinyTNTPrimed;
|
||||
|
||||
public class BlockTinyTNT extends AEBaseBlock {
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@ public class QuantumBridgeRendering extends BlockRenderingCustomizer {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
// FIXME rendering.builtInModel( "models/block/qnb/qnb_formed", new
|
||||
// QnbFormedModel() );
|
||||
// Disable auto rotation
|
||||
rendering.modelCustomizer((location, model) -> model);
|
||||
}
|
||||
|
||||
@@ -165,8 +165,7 @@ public class GuiSettingToggleButton<T extends Enum<T>> extends GuiIconButton {
|
||||
|
||||
registerApp(64, Settings.SORT_BY, SortOrder.NAME, ButtonToolTips.SortBy, ButtonToolTips.ItemName);
|
||||
registerApp(65, Settings.SORT_BY, SortOrder.AMOUNT, ButtonToolTips.SortBy, ButtonToolTips.NumberOfItems);
|
||||
registerApp(68, Settings.SORT_BY, SortOrder.INVTWEAKS, ButtonToolTips.SortBy,
|
||||
ButtonToolTips.InventoryTweaks);
|
||||
// 68: Formerly sort by inventory tweaks
|
||||
registerApp(69, Settings.SORT_BY, SortOrder.MOD, ButtonToolTips.SortBy, ButtonToolTips.Mod);
|
||||
|
||||
registerApp(16, Settings.VIEW_MODE, ViewItems.STORED, ButtonToolTips.View, ButtonToolTips.StoredItems);
|
||||
|
||||
@@ -30,7 +30,6 @@ import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.config.YesNo;
|
||||
@@ -181,14 +180,11 @@ public class ItemRepo {
|
||||
final Enum SortDir = this.sortSrc.getSortDir();
|
||||
|
||||
ItemSorters.setDirection((appeng.api.config.SortDir) SortDir);
|
||||
ItemSorters.init();
|
||||
|
||||
if (SortBy == SortOrder.MOD) {
|
||||
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_MOD);
|
||||
} else if (SortBy == SortOrder.AMOUNT) {
|
||||
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_SIZE);
|
||||
} else if (SortBy == SortOrder.INVTWEAKS) {
|
||||
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_INV_TWEAKS);
|
||||
} else {
|
||||
Collections.sort(this.view, ItemSorters.CONFIG_BASED_SORT_BY_NAME);
|
||||
}
|
||||
|
||||
@@ -18,17 +18,19 @@
|
||||
|
||||
package appeng.client.render;
|
||||
|
||||
import appeng.client.render.cablebus.FacadeBuilder;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Objects;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
|
||||
import appeng.client.render.cablebus.FacadeBuilder;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
/**
|
||||
* This baked model class is used as a dispatcher to redirect the renderer to
|
||||
|
||||
@@ -18,18 +18,20 @@
|
||||
|
||||
package appeng.client.render;
|
||||
|
||||
import appeng.client.render.cablebus.FacadeBuilder;
|
||||
import appeng.core.AppEng;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
|
||||
import net.minecraft.client.renderer.model.*;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import appeng.client.render.cablebus.FacadeBuilder;
|
||||
import appeng.core.AppEng;
|
||||
|
||||
/**
|
||||
* The model class for facades. Since facades wrap existing models, they don't
|
||||
|
||||
@@ -164,7 +164,7 @@ public class AutoRotatingBakedModel implements IBakedModel {
|
||||
}
|
||||
|
||||
AEModelData aeModelData = (AEModelData) extraData;
|
||||
quadCache.invalidateAll(); // FIXME
|
||||
|
||||
if (aeModelData.isCacheable()) {
|
||||
return quadCache.getUnchecked(new AutoRotatingCacheKey(state, aeModelData, side));
|
||||
} else {
|
||||
|
||||
@@ -30,22 +30,10 @@ import appeng.core.AppEng;
|
||||
|
||||
public class SpatialPylonRendering extends BlockRenderingCustomizer {
|
||||
|
||||
private static final ResourceLocation MODEL_ID = new ResourceLocation(AppEng.MOD_ID,
|
||||
"models/blocks/spatial_pylon/builtin");
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
// FIXME rendering.builtInModel( MODEL_ID.getResourcePath(), new
|
||||
// SpatialPylonModel() );
|
||||
// FIXME rendering.stateMapper( this::mapState );
|
||||
}
|
||||
|
||||
// FIXME private Map<BlockState, ModelResourceLocation> mapState( Block block )
|
||||
// FIXME {
|
||||
// FIXME return ImmutableMap.of( block.getDefaultState(), new
|
||||
// ModelResourceLocation( MODEL_ID, "normal" ) );
|
||||
// FIXME }
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.client.renderer.Quaternion;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@@ -59,7 +60,7 @@ public class CrankTESR extends TileEntityRenderer<TileCrank> {
|
||||
ms.rotate(new Quaternion(0, te.getVisibleRotation(), 0, true));
|
||||
ms.translate(-0.5, -0.5, -0.5);
|
||||
|
||||
BlockState blockState = te.getWorld().getBlockState(te.getPos()); // FIXME: i think world might be null here
|
||||
BlockState blockState = te.getBlockState();
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
IBakedModel model = dispatcher.getModelForState(blockState);
|
||||
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.container.slot;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.hooks.BasicEventHooks;
|
||||
@@ -82,60 +83,6 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
protected void onCrafting(final ItemStack par1ItemStack) {
|
||||
par1ItemStack.onCrafting(this.thePlayer.world, this.thePlayer, this.amountCrafted);
|
||||
this.amountCrafted = 0;
|
||||
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.CRAFTING_TABLE )
|
||||
// )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_WORK_BENCH, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemPickaxe )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_PICKAXE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.FURNACE ) )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_FURNACE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemHoe )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_HOE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Items.BREAD )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.MAKE_BREAD, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Items.CAKE )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BAKE_CAKE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool)
|
||||
// par1ItemStack.getItem()
|
||||
// ).getToolMaterial() != Item.ToolMaterial.WOOD )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_BETTER_PICKAXE, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() instanceof ItemSword )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BUILD_SWORD, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.ENCHANTING_TABLE
|
||||
// ) )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.ENCHANTMENTS, 1 );
|
||||
// }
|
||||
//
|
||||
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.BOOKSHELF ) )
|
||||
// {
|
||||
// this.thePlayer.addStat( AchievementList.BOOKCASE, 1 );
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -191,7 +138,7 @@ public class AppEngCraftingSlot extends AppEngSlot {
|
||||
// TODO: This is really hacky and NEEDS to be solved with a full container/gui
|
||||
// refactoring.
|
||||
protected NonNullList<ItemStack> getRemainingItems(CraftingInventory ic, World world) {
|
||||
// FIXME return CraftingManager.getRemainingItems( ic, world );
|
||||
return null;
|
||||
return world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, ic, world)
|
||||
.map(iCraftingRecipe -> iCraftingRecipe.getRemainingItems(ic)).orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package appeng.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AEItemGroup extends ItemGroup {
|
||||
|
||||
|
||||
@@ -18,34 +18,13 @@
|
||||
|
||||
package appeng.core;
|
||||
|
||||
import appeng.block.paint.PaintSplotchesModel;
|
||||
import appeng.block.qnb.QnbFormedModel;
|
||||
import appeng.bootstrap.components.IClientSetupComponent;
|
||||
import appeng.bootstrap.components.IInitComponent;
|
||||
import appeng.bootstrap.components.IPostInitComponent;
|
||||
import appeng.capabilities.Capabilities;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.client.render.DummyFluidItemModel;
|
||||
import appeng.client.render.FacadeItemModel;
|
||||
import appeng.client.render.SimpleModelLoader;
|
||||
import appeng.client.render.cablebus.CableBusModelLoader;
|
||||
import appeng.client.render.cablebus.P2PTunnelFrequencyModel;
|
||||
import appeng.client.render.crafting.CraftingCubeModelLoader;
|
||||
import appeng.client.render.crafting.EncodedPatternModelLoader;
|
||||
import appeng.client.render.model.*;
|
||||
import appeng.client.render.spatial.SpatialPylonModel;
|
||||
import appeng.core.crash.ModCrashEnhancement;
|
||||
import appeng.core.features.registries.PartModels;
|
||||
import appeng.core.stats.AdvancementTriggers;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
import appeng.entity.*;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.integration.Integrations;
|
||||
import appeng.parts.PartPlacement;
|
||||
import appeng.parts.automation.PlaneModelLoader;
|
||||
import appeng.server.ServerHelper;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.ItemRenderer;
|
||||
@@ -78,9 +57,33 @@ import net.minecraftforge.fml.event.server.FMLServerStoppedEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
import appeng.block.paint.PaintSplotchesModel;
|
||||
import appeng.block.qnb.QnbFormedModel;
|
||||
import appeng.bootstrap.components.IClientSetupComponent;
|
||||
import appeng.bootstrap.components.IInitComponent;
|
||||
import appeng.bootstrap.components.IPostInitComponent;
|
||||
import appeng.capabilities.Capabilities;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.client.render.DummyFluidItemModel;
|
||||
import appeng.client.render.FacadeItemModel;
|
||||
import appeng.client.render.SimpleModelLoader;
|
||||
import appeng.client.render.cablebus.CableBusModelLoader;
|
||||
import appeng.client.render.cablebus.P2PTunnelFrequencyModel;
|
||||
import appeng.client.render.crafting.CraftingCubeModelLoader;
|
||||
import appeng.client.render.crafting.EncodedPatternModelLoader;
|
||||
import appeng.client.render.model.*;
|
||||
import appeng.client.render.spatial.SpatialPylonModel;
|
||||
import appeng.core.crash.ModCrashEnhancement;
|
||||
import appeng.core.features.registries.PartModels;
|
||||
import appeng.core.stats.AdvancementTriggers;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
import appeng.entity.*;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.integration.Integrations;
|
||||
import appeng.parts.PartPlacement;
|
||||
import appeng.parts.automation.PlaneModelLoader;
|
||||
import appeng.server.ServerHelper;
|
||||
|
||||
@Mod(AppEng.MOD_ID)
|
||||
public final class AppEng {
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
|
||||
package appeng.core;
|
||||
|
||||
import appeng.items.parts.ItemFacade;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
@@ -27,8 +29,7 @@ import net.minecraft.item.Items;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
public final class FacadeItemGroup extends ItemGroup {
|
||||
|
||||
|
||||
@@ -18,6 +18,45 @@
|
||||
|
||||
package appeng.core;
|
||||
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScreenManager;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.GenerationStage;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.feature.IFeatureConfig;
|
||||
import net.minecraft.world.gen.feature.OreFeatureConfig;
|
||||
import net.minecraft.world.gen.placement.CountRangeConfig;
|
||||
import net.minecraft.world.gen.placement.IPlacementConfig;
|
||||
import net.minecraft.world.gen.placement.Placement;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.ModDimension;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import net.minecraftforge.common.extensions.IForgeContainerType;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.loading.FMLEnvironment;
|
||||
import net.minecraftforge.fml.network.IContainerFactory;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
@@ -76,44 +115,6 @@ import appeng.tile.crafting.MolecularAssemblerRenderer;
|
||||
import appeng.worldgen.ChargedQuartzOreConfig;
|
||||
import appeng.worldgen.ChargedQuartzOreFeature;
|
||||
import appeng.worldgen.MeteoriteStructure;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScreenManager;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.GenerationStage;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.feature.IFeatureConfig;
|
||||
import net.minecraft.world.gen.feature.OreFeatureConfig;
|
||||
import net.minecraft.world.gen.placement.CountRangeConfig;
|
||||
import net.minecraft.world.gen.placement.IPlacementConfig;
|
||||
import net.minecraft.world.gen.placement.Placement;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.ModDimension;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import net.minecraftforge.common.extensions.IForgeContainerType;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.loading.FMLEnvironment;
|
||||
import net.minecraftforge.fml.network.IContainerFactory;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
final class Registration {
|
||||
|
||||
@@ -340,7 +341,8 @@ final class Registration {
|
||||
|
||||
ItemFacade facadeItem = (ItemFacade) Api.INSTANCE.definitions().items().facade().item();
|
||||
r.registerAll(DisassembleRecipe.SERIALIZER, GrinderRecipeSerializer.INSTANCE,
|
||||
InscriberRecipeSerializer.INSTANCE, FacadeRecipe.getSerializer(facadeItem));
|
||||
InscriberRecipeSerializer.INSTANCE, FacadeRecipe.getSerializer(facadeItem),
|
||||
DisassembleRecipe.SERIALIZER);
|
||||
|
||||
CraftingHelper.register(FeaturesEnabled.Serializer.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -158,15 +158,12 @@ public final class ApiItems implements IItems {
|
||||
.itemGroup(ItemGroup.COMBAT).addFeatures(AEFeature.QUARTZ_SWORD).build();
|
||||
this.certusQuartzWrench = certusTools.item("certus_quartz_wrench", ToolQuartzWrench::new)
|
||||
.itemGroup(ItemGroup.TOOLS).props(props -> props.maxStackSize(1)).addFeatures(AEFeature.QUARTZ_WRENCH)
|
||||
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) )
|
||||
.build();
|
||||
this.certusQuartzKnife = certusTools
|
||||
.item("certus_quartz_cutting_knife",
|
||||
props -> new ToolQuartzCuttingKnife(props, AEFeature.CERTUS_QUARTZ_TOOLS))
|
||||
.itemGroup(ItemGroup.TOOLS).props(props -> props.maxStackSize(1).maxDamage(50).setNoRepair())
|
||||
.addFeatures(AEFeature.QUARTZ_KNIFE)
|
||||
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) )
|
||||
.build();
|
||||
.addFeatures(AEFeature.QUARTZ_KNIFE).build();
|
||||
|
||||
FeatureFactory netherTools = registry.features(AEFeature.NETHER_QUARTZ_TOOLS);
|
||||
this.netherQuartzAxe = netherTools
|
||||
@@ -186,15 +183,12 @@ public final class ApiItems implements IItems {
|
||||
.itemGroup(ItemGroup.COMBAT).addFeatures(AEFeature.QUARTZ_SWORD).build();
|
||||
this.netherQuartzWrench = netherTools.item("nether_quartz_wrench", ToolQuartzWrench::new)
|
||||
.itemGroup(ItemGroup.TOOLS).props(props -> props.maxStackSize(1)).addFeatures(AEFeature.QUARTZ_WRENCH)
|
||||
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzWrench", new ItemStack( item ) ) )
|
||||
.build();
|
||||
this.netherQuartzKnife = netherTools
|
||||
.item("nether_quartz_cutting_knife",
|
||||
props -> new ToolQuartzCuttingKnife(props, AEFeature.NETHER_QUARTZ_TOOLS))
|
||||
.itemGroup(ItemGroup.TOOLS).props(props -> props.maxStackSize(1).maxDamage(50).setNoRepair())
|
||||
.addFeatures(AEFeature.QUARTZ_KNIFE)
|
||||
// FIXME .bootstrap( item -> (IOreDictComponent) side -> OreDictionary.registerOre( "itemQuartzKnife", new ItemStack( item ) ) )
|
||||
.build();
|
||||
.addFeatures(AEFeature.QUARTZ_KNIFE).build();
|
||||
|
||||
Consumer<Item.Properties> chargedDefaults = props -> props.maxStackSize(1).maxDamage(32).setNoRepair();
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public enum ButtonToolTips {
|
||||
|
||||
Blocking, NonBlocking,
|
||||
|
||||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall,
|
||||
LevelType, LevelType_Energy, LevelType_Item, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall,
|
||||
TerminalStyle_Small,
|
||||
|
||||
Stash, StashDesc, Encode, EncodeDescription, Substitutions, SubstitutionsOn, SubstitutionsOff,
|
||||
|
||||
@@ -50,11 +50,12 @@ public class TileItemGen extends AEBaseTile {
|
||||
for (final Item mi : ForgeRegistries.ITEMS) {
|
||||
if (mi != null && mi != Items.AIR) {
|
||||
if (mi.isDamageable()) {
|
||||
// FIXME: Rethink if this branch is necessary
|
||||
for (int dmg = 0; dmg < mi.getMaxDamage(); dmg++) {
|
||||
ItemStack item = new ItemStack(mi, 1);
|
||||
item.setDamage(dmg);
|
||||
POSSIBLE_ITEMS.add(item);
|
||||
ItemStack sampleStack = new ItemStack(mi);
|
||||
int maxDamage = sampleStack.getMaxDamage();
|
||||
for (int dmg = 0; dmg < maxDamage; dmg++) {
|
||||
ItemStack is = sampleStack.copy();
|
||||
is.setDamage(dmg);
|
||||
POSSIBLE_ITEMS.add(is);
|
||||
}
|
||||
} else {
|
||||
if (mi.getGroup() == null) {
|
||||
|
||||
@@ -36,41 +36,6 @@ public class BlockChargedQuartzOre extends BlockQuartzOre {
|
||||
super(props);
|
||||
}
|
||||
|
||||
// FIXME: Loot tables
|
||||
// @Override
|
||||
// public Item getItemDropped( final BlockState state, final Random rand, final int fortune )
|
||||
// {
|
||||
// return AEApi.instance()
|
||||
// .definitions()
|
||||
// .materials()
|
||||
// .certusQuartzCrystalCharged()
|
||||
// .maybeItem()
|
||||
// .orElseThrow( () -> new MissingDefinitionException( "Tried to access charged certus quartz crystal, even though they are disabled" ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int damageDropped( final BlockState state )
|
||||
// {
|
||||
// return AEApi.instance()
|
||||
// .definitions()
|
||||
// .materials()
|
||||
// .certusQuartzCrystalCharged()
|
||||
// .maybeStack( 1 )
|
||||
// .orElseThrow( () -> new MissingDefinitionException( "Tried to access charged certus quartz crystal, even though they are disabled" ) )
|
||||
// .getItemDamage();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack getPickBlock( BlockState state, RayTraceResult target, World world, BlockPos pos, PlayerEntity player )
|
||||
// {
|
||||
// return AEApi.instance()
|
||||
// .definitions()
|
||||
// .blocks()
|
||||
// .quartzOreCharged()
|
||||
// .maybeStack( 1 )
|
||||
// .orElseThrow( () -> new MissingDefinitionException( "Tried to access charged certus quartz ore, even though they are disabled" ) );
|
||||
// }
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
|
||||
|
||||
@@ -29,62 +29,10 @@ public class BlockQuartzOre extends AEBaseBlock {
|
||||
super(props);
|
||||
}
|
||||
|
||||
// FIXME: Loot Tables
|
||||
// @Override
|
||||
// public int quantityDropped( BlockState state, int fortune, Random rand )
|
||||
// {
|
||||
// if( fortune > 0 && Item.getItemFromBlock( this ) != this.getItemDropped( null, rand, fortune ) )
|
||||
// {
|
||||
// int j = rand.nextInt( fortune + 2 ) - 1;
|
||||
//
|
||||
// if( j < 0 )
|
||||
// {
|
||||
// j = 0;
|
||||
// }
|
||||
//
|
||||
// return this.quantityDropped( rand ) * ( j + 1 );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return this.quantityDropped( rand );
|
||||
// }
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public int quantityDropped( final Random rand )
|
||||
// {
|
||||
// return 1 + rand.nextInt( 2 );
|
||||
// }
|
||||
//
|
||||
|
||||
@Override
|
||||
public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader reader, BlockPos pos, int fortune,
|
||||
int silktouch) {
|
||||
return silktouch == 0 ? MathHelper.nextInt(RANDOM, 2, 5) : 0;
|
||||
}
|
||||
|
||||
// FIXME: loot tables
|
||||
// @Override
|
||||
// public Item getItemDropped( final BlockState state, final Random rand, final int fortune )
|
||||
// {
|
||||
// return AEApi.instance()
|
||||
// .definitions()
|
||||
// .materials()
|
||||
// .certusQuartzCrystal()
|
||||
// .maybeItem()
|
||||
// .orElseThrow( () -> new MissingDefinitionException( "Tried to access certus quartz crystal, even though they are disabled" ) );
|
||||
// }
|
||||
|
||||
// FIXME: loot tables
|
||||
// @Override
|
||||
// public int damageDropped( final BlockState state )
|
||||
// {
|
||||
// return AEApi.instance()
|
||||
// .definitions()
|
||||
// .materials()
|
||||
// .certusQuartzCrystal()
|
||||
// .maybeStack( 1 )
|
||||
// .orElseThrow( () -> new MissingDefinitionException( "Tried to access certus quartz crystal, even though they are disabled" ) )
|
||||
// .getItemDamage();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
|
||||
package appeng.facade;
|
||||
|
||||
import appeng.api.parts.IBoxProvider;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
import appeng.api.parts.IPartCollisionHelper;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -30,6 +26,11 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
|
||||
import appeng.api.parts.IBoxProvider;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
import appeng.api.parts.IPartCollisionHelper;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
public class FacadePart implements IFacadePart, IBoxProvider {
|
||||
|
||||
private final ItemStack facade;
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Random;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -274,9 +275,8 @@ public class PartFluidLevelEmitter extends PartUpgradeable
|
||||
final double d1 = d.yOffset * 0.45F + (r.nextFloat() - 0.5F) * 0.2D;
|
||||
final double d2 = d.zOffset * 0.45F + (r.nextFloat() - 0.5F) * 0.2D;
|
||||
|
||||
// FIXME world.spawnParticle( EnumParticleTypes.REDSTONE, 0.5 + pos.getX() + d0,
|
||||
// 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D,
|
||||
// FIXME new int[0] );
|
||||
world.addParticle(RedstoneParticleData.REDSTONE_DUST, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1,
|
||||
0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,7 @@ import net.minecraftforge.fml.event.lifecycle.GatherDataEvent;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import appeng.forge.data.providers.loot.BlockDropProvider;
|
||||
import appeng.forge.data.providers.recipes.QuartzToolRecipes;
|
||||
import appeng.forge.data.providers.recipes.SlabStairRecipes;
|
||||
import appeng.forge.data.providers.recipes.SpecialRecipes;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = AppEng.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class AE2DataGenerators {
|
||||
@@ -20,8 +18,6 @@ public class AE2DataGenerators {
|
||||
if (dataEvent.includeServer()) {
|
||||
generator.addProvider(new BlockDropProvider(dataEvent));
|
||||
generator.addProvider(new SlabStairRecipes(generator));
|
||||
generator.addProvider(new QuartzToolRecipes(generator));
|
||||
generator.addProvider(new SpecialRecipes(generator));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package appeng.forge.data.providers.recipes;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.IFinishedRecipe;
|
||||
import net.minecraft.data.RecipeProvider;
|
||||
import net.minecraft.data.ShapedRecipeBuilder;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.common.crafting.ConditionalRecipe;
|
||||
|
||||
import it.unimi.dsi.fastutil.chars.Char2ObjectArrayMap;
|
||||
import it.unimi.dsi.fastutil.chars.Char2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.chars.CharOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.chars.CharSet;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.forge.data.providers.IAE2DataProvider;
|
||||
import appeng.recipes.conditions.FeaturesEnabled;
|
||||
|
||||
public class QuartzToolRecipes extends RecipeProvider implements IAE2DataProvider {
|
||||
|
||||
private Map<net.minecraft.tags.Tag<Item>, IItemDefinition[]> items = ImmutableMap.of(Tags.Items.GEMS_QUARTZ,
|
||||
new IItemDefinition[] { ITEMS.netherQuartzAxe(), ITEMS.netherQuartzHoe(), ITEMS.netherQuartzShovel(),
|
||||
ITEMS.netherQuartzPick(), ITEMS.netherQuartzSword(), ITEMS.netherQuartzWrench(),
|
||||
ITEMS.netherQuartzKnife() }
|
||||
// FIXME certus quartz
|
||||
);
|
||||
|
||||
private String[][] patterns = { { "XX ", "X/ ", " / " }, { "XX ", " / ", " / " }, { " X ", " / ", " / " },
|
||||
{ "XXX", " / ", " / " }, { " X ", " X ", " / " }, { "X X", " X ", "X X" }, { " /", "I/ ", "XX " } };
|
||||
|
||||
private Char2ObjectMap<Tag<Item>> keys = new Char2ObjectArrayMap<>(new char[] { 'I', '/' },
|
||||
new Tag[] { Tags.Items.INGOTS_IRON, Tags.Items.RODS_WOODEN });
|
||||
|
||||
public QuartzToolRecipes(DataGenerator generatorIn) {
|
||||
super(generatorIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes(@Nonnull Consumer<IFinishedRecipe> consumer) {
|
||||
for (Map.Entry<Tag<Item>, IItemDefinition[]> entry : items.entrySet()) {
|
||||
Tag<Item> tag = entry.getKey();
|
||||
IItemDefinition[] tools = entry.getValue();
|
||||
|
||||
for (int i = 0; i < tools.length; i++) {
|
||||
CharSet keySet = new CharOpenHashSet(new char[] { 'X', ' ' });
|
||||
|
||||
ShapedRecipeBuilder shapedBuilder = ShapedRecipeBuilder.shapedRecipe(tools[i].item());
|
||||
for (String s : patterns[i]) {
|
||||
shapedBuilder.patternLine(s);
|
||||
|
||||
for (int j = 0; j < s.length(); j++) {
|
||||
char c = s.charAt(j);
|
||||
if (!keySet.contains(c)) {
|
||||
keySet.add(c);
|
||||
shapedBuilder.key(c, keys.get(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shapedBuilder.key('X', tag).addCriterion("has_" + tag.getId(), hasItem(tag));
|
||||
|
||||
ConditionalRecipe.builder().addCondition(new FeaturesEnabled(tools[i].features()))
|
||||
.addRecipe(shapedBuilder::build)
|
||||
.build(consumer, AppEng.MOD_ID, "tools/" + tools[i].identifier());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return AppEng.MOD_NAME + " Quartz Tools";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package appeng.forge.data.providers.recipes;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.IFinishedRecipe;
|
||||
import net.minecraft.data.RecipeProvider;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import appeng.forge.data.providers.IAE2DataProvider;
|
||||
|
||||
public class SpecialRecipes extends RecipeProvider implements IAE2DataProvider {
|
||||
|
||||
public SpecialRecipes(DataGenerator generatorIn) {
|
||||
super(generatorIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes(@Nonnull Consumer<IFinishedRecipe> consumer) {
|
||||
// ConditionalRecipe.builder() FIXME this works, but NPEs at runtime
|
||||
// .addCondition( new FeaturesEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING ) )
|
||||
// .addRecipe( new FinishedRecipe( DisassembleRecipe.SERIALIZER ) )
|
||||
// .build( consumer, AppEng.MOD_ID, "special/disassemble" );
|
||||
|
||||
// ConditionalRecipe.builder() FIXME re-implement facades
|
||||
// .addCondition( new FeaturesEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) )
|
||||
// .addRecipe( new FinishedRecipe( FacadeRecipe.SERIALIZER ) )
|
||||
// .build( consumer, AppEng.MOD_ID, "special/facade" );
|
||||
}
|
||||
|
||||
private static class FinishedRecipe implements IFinishedRecipe {
|
||||
|
||||
private final IRecipeSerializer<?> serializer;
|
||||
|
||||
public FinishedRecipe(IRecipeSerializer<?> serializer) {
|
||||
this.serializer = serializer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(@Nonnull JsonObject json) {
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getID() {
|
||||
return Objects.requireNonNull(serializer.getRegistryName());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return serializer;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public JsonObject getAdvancementJson() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getAdvancementID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getName() {
|
||||
return AppEng.MOD_NAME + " Special Crafting Recipes";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.integration.modules.jei;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.IFocus;
|
||||
import mezz.jei.api.recipe.advanced.IRecipeManagerPlugin;
|
||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
/**
|
||||
* This plugin will dynamically add facade recipes for any item that can be
|
||||
* turned into a facade.
|
||||
*/
|
||||
class FacadeRegistryPlugin implements IRecipeManagerPlugin {
|
||||
|
||||
private final ItemFacade itemFacade;
|
||||
|
||||
private final ItemStack cableAnchor;
|
||||
|
||||
FacadeRegistryPlugin(ItemFacade itemFacade, ItemStack cableAnchor) {
|
||||
this.itemFacade = itemFacade;
|
||||
this.cableAnchor = cableAnchor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> List<ResourceLocation> getRecipeCategoryUids(IFocus<V> focus) {
|
||||
if (focus.getMode() == IFocus.Mode.OUTPUT && focus.getValue() instanceof ItemStack) {
|
||||
// Looking up how a certain facade is crafted
|
||||
ItemStack itemStack = (ItemStack) focus.getValue();
|
||||
if (itemStack.getItem() instanceof ItemFacade) {
|
||||
return Collections.singletonList(VanillaRecipeCategoryUid.CRAFTING);
|
||||
}
|
||||
} else if (focus.getMode() == IFocus.Mode.INPUT && focus.getValue() instanceof ItemStack) {
|
||||
// Looking up if a certain block can be used to make a facade
|
||||
ItemStack itemStack = (ItemStack) focus.getValue();
|
||||
|
||||
if (!this.itemFacade.createFacadeForItem(itemStack, true).isEmpty()) {
|
||||
return Collections.singletonList(VanillaRecipeCategoryUid.CRAFTING);
|
||||
}
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T, V> List<T> getRecipes(IRecipeCategory<T> recipeCategory, IFocus<V> focus) {
|
||||
if (!VanillaRecipeCategoryUid.CRAFTING.equals(recipeCategory.getUid())) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
if (focus.getMode() == IFocus.Mode.OUTPUT && focus.getValue() instanceof ItemStack) {
|
||||
// Looking up how a certain facade is crafted
|
||||
ItemStack itemStack = (ItemStack) focus.getValue();
|
||||
if (itemStack.getItem() instanceof ItemFacade) {
|
||||
ItemFacade facadeItem = (ItemFacade) itemStack.getItem();
|
||||
ItemStack textureItem = facadeItem.getTextureItem(itemStack);
|
||||
return Collections.singletonList((T) make(textureItem, this.cableAnchor, itemStack));
|
||||
}
|
||||
} else if (focus.getMode() == IFocus.Mode.INPUT && focus.getValue() instanceof ItemStack) {
|
||||
// Looking up if a certain block can be used to make a facade
|
||||
|
||||
ItemStack itemStack = (ItemStack) focus.getValue();
|
||||
ItemStack facade = this.itemFacade.createFacadeForItem(itemStack, false);
|
||||
|
||||
if (!facade.isEmpty()) {
|
||||
return Collections.singletonList((T) make(itemStack, this.cableAnchor, facade));
|
||||
}
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private ShapedRecipe make(ItemStack textureItem, ItemStack cableAnchor, ItemStack result) {
|
||||
// This id should only be used within JEI and not really matter
|
||||
ResourceLocation id = new ResourceLocation(AppEng.MOD_ID,
|
||||
"facade/" + textureItem.getItem().getRegistryName().toString().replace(':', '/'));
|
||||
|
||||
NonNullList<Ingredient> ingredients = NonNullList.withSize(9, Ingredient.EMPTY);
|
||||
ingredients.set(1, Ingredient.fromStacks(cableAnchor));
|
||||
ingredients.set(3, Ingredient.fromStacks(cableAnchor));
|
||||
ingredients.set(5, Ingredient.fromStacks(cableAnchor));
|
||||
ingredients.set(7, Ingredient.fromStacks(cableAnchor));
|
||||
ingredients.set(4, Ingredient.fromStacks(textureItem));
|
||||
|
||||
return new ShapedRecipe(id, "", 3, 3, ingredients, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> getRecipes(IRecipeCategory<T> recipeCategory) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@@ -32,11 +32,7 @@ import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.JeiPlugin;
|
||||
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.constants.VanillaTypes;
|
||||
import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.registration.IRecipeRegistration;
|
||||
import mezz.jei.api.registration.IRecipeTransferRegistration;
|
||||
import mezz.jei.api.registration.ISubtypeRegistration;
|
||||
import mezz.jei.api.registration.*;
|
||||
import mezz.jei.api.runtime.IJeiRuntime;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -51,6 +47,7 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
import appeng.recipes.handlers.GrinderRecipe;
|
||||
import appeng.recipes.handlers.InscriberRecipe;
|
||||
|
||||
@@ -90,13 +87,6 @@ public class JEIPlugin implements IModPlugin {
|
||||
|
||||
IDefinitions definitions = AEApi.instance().definitions();
|
||||
|
||||
// FIXME Optional<Item> itemFacade = definitions.items().facade().maybeItem();
|
||||
// FIXME Optional<ItemStack> cableAnchor = definitions.parts().cableAnchor().maybeStack( 1 );
|
||||
// FIXME if( itemFacade.isPresent() && cableAnchor.isPresent() && AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) )
|
||||
// FIXME {
|
||||
// FIXME registration.addRecipeRegistryPlugin( new FacadeRegistryPlugin( (ItemFacade) itemFacade.get(), cableAnchor.get() ) );
|
||||
// FIXME }
|
||||
|
||||
RecipeManager recipeManager = Minecraft.getInstance().world.getRecipeManager();
|
||||
registration.addRecipes(recipeManager.getRecipes(GrinderRecipe.TYPE).values(), GrinderRecipeCategory.UID);
|
||||
registration.addRecipes(recipeManager.getRecipes(InscriberRecipe.TYPE).values(), InscriberRecipeCategory.UID);
|
||||
@@ -164,8 +154,21 @@ public class JEIPlugin implements IModPlugin {
|
||||
registry.addIngredientInfo(itemDefinition.stack(1), VanillaTypes.ITEM, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAdvanced(IAdvancedRegistration registration) {
|
||||
|
||||
IDefinitions definitions = AEApi.instance().definitions();
|
||||
|
||||
if (AEConfig.instance().isFeatureEnabled(AEFeature.ENABLE_FACADE_CRAFTING)) {
|
||||
ItemFacade itemFacade = (ItemFacade) definitions.items().facade().item();
|
||||
ItemStack cableAnchor = definitions.parts().cableAnchor().stack(1);
|
||||
registration.addRecipeManagerPlugin(new FacadeRegistryPlugin(itemFacade, cableAnchor));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
|
||||
JEIFacade.setInstance(new JeiRuntimeAdapter(jeiRuntime));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public final class DisassembleRecipe extends SpecialRecipe {
|
||||
DisassembleRecipe::new);
|
||||
|
||||
static {
|
||||
SERIALIZER.setRegistryName(new ResourceLocation(AppEng.MOD_ID, "disassemble_recipe"));
|
||||
SERIALIZER.setRegistryName(new ResourceLocation(AppEng.MOD_ID, "disassemble"));
|
||||
}
|
||||
|
||||
private static final ItemStack MISMATCHED_STACK = ItemStack.EMPTY;
|
||||
|
||||
@@ -18,9 +18,14 @@
|
||||
|
||||
package appeng.spatial;
|
||||
|
||||
import net.minecraft.util.SharedSeedRandom;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.gen.ChunkGenerator;
|
||||
import net.minecraft.world.gen.GenerationSettings;
|
||||
import net.minecraft.world.gen.GenerationStage;
|
||||
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -38,14 +43,6 @@ public class StorageCellBiome extends Biome {
|
||||
.precipitation(RainType.NONE).category(Category.NONE).depth(0).scale(1)
|
||||
// Copied from the vanilla void biome
|
||||
.temperature(0.5F).downfall(0.5F).waterColor(4159204).waterFogColor(329011).parent(null));
|
||||
// FIXME this.decorator.treesPerChunk = 0;
|
||||
// FIXME this.decorator.flowersPerChunk = 0;
|
||||
// FIXME this.decorator.grassPerChunk = 0;
|
||||
// FIXME
|
||||
// FIXME this.spawnableMonsterList.clear();
|
||||
// FIXME this.spawnableCreatureList.clear();
|
||||
// FIXME this.spawnableWaterCreatureList.clear();
|
||||
// FIXME this.spawnableCaveCreatureList.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,4 +66,9 @@ public class StorageCellBiome extends Biome {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorate(GenerationStage.Decoration stage, ChunkGenerator<? extends GenerationSettings> chunkGenerator,
|
||||
IWorld worldIn, long seed, SharedSeedRandom random, BlockPos pos) {
|
||||
// Nothing should ever generate here...
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,26 +107,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile {
|
||||
* rendering.
|
||||
*/
|
||||
protected void updateTileSetting() {
|
||||
// FIXME if( this.getCableBus().isRequiresDynamicRender() )
|
||||
// FIXME {
|
||||
// FIXME try
|
||||
// FIXME {
|
||||
// FIXME final TileCableBus tcb = (TileCableBus) BlockCableBus.getTesrTile().newInstance();
|
||||
// FIXME tcb.copyFrom( this );
|
||||
// FIXME this.getWorld().setTileEntity( this.pos, tcb );
|
||||
// FIXME }
|
||||
// FIXME catch( final Throwable ignored )
|
||||
// FIXME {
|
||||
// FIXME
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
}
|
||||
|
||||
protected void copyFrom(final TileCableBus oldTile) {
|
||||
final CableBusContainer tmpCB = this.getCableBus();
|
||||
this.setCableBus(oldTile.getCableBus());
|
||||
this.oldLV = oldTile.oldLV;
|
||||
oldTile.setCableBus(tmpCB);
|
||||
// FIXME: potentially invalidate voxel shape cache?
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2015, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.tile.networking;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
||||
public class TileCableBusTESR extends TileCableBus {
|
||||
|
||||
public TileCableBusTESR(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes this tile to the non-TESR version, if none of the parts require
|
||||
* dynamic rendering.
|
||||
*/
|
||||
@Override
|
||||
protected void updateTileSetting() {
|
||||
// FIXME if( !this.getCableBus().isRequiresDynamicRender() )
|
||||
// FIXME {
|
||||
// FIXME try
|
||||
// FIXME {
|
||||
// FIXME final TileCableBus tcb = (TileCableBus) BlockCableBus.getNoTesrTile().newInstance();
|
||||
// FIXME tcb.copyFrom( this );
|
||||
// FIXME this.getWorld().setTileEntity( this.pos, tcb );
|
||||
// FIXME }
|
||||
// FIXME catch( final Throwable ignored )
|
||||
// FIXME {
|
||||
// FIXME
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
}
|
||||
}
|
||||
@@ -52,35 +52,6 @@ public class ItemSorters {
|
||||
return applyDirection(cmp);
|
||||
};
|
||||
|
||||
// FIXME private static IInvTweaks api;
|
||||
|
||||
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_INV_TWEAKS = (o1, o2) -> {
|
||||
// FIXME if( api == null )
|
||||
// FIXME {
|
||||
return CONFIG_BASED_SORT_BY_NAME.compare(o1, o2);
|
||||
// FIXME }
|
||||
|
||||
// FIXME final int cmp = api.compareItems( o1.createItemStack(),
|
||||
// o2.createItemStack() );
|
||||
// FIXME return applyDirection( cmp );
|
||||
};
|
||||
|
||||
public static void init() {
|
||||
// FIXME if( api != null )
|
||||
// FIXME {
|
||||
// FIXME return;
|
||||
// FIXME }
|
||||
|
||||
// FIXME if( Integrations.invTweaks().isEnabled() )
|
||||
// FIXME {
|
||||
// FIXME api = Integrations.invTweaks();
|
||||
// FIXME }
|
||||
// FIXME else
|
||||
// FIXME {
|
||||
// FIXME api = null;
|
||||
// FIXME }
|
||||
}
|
||||
|
||||
private static SortDir getDirection() {
|
||||
return Direction;
|
||||
}
|
||||
|
||||
@@ -1330,9 +1330,6 @@ public class Platform {
|
||||
}
|
||||
|
||||
public static boolean isSortOrderAvailable(SortOrder order) {
|
||||
if (order == SortOrder.INVTWEAKS) {
|
||||
return false; // FIXME Integrations.invTweaks().isEnabled()
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user