Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c91e852ec | |||
| 52f516299b | |||
| c74166b02a | |||
| 26e86a114c | |||
| fc834036a0 | |||
| f96f7d82c5 | |||
| c592f54a77 | |||
| 89609a83ea | |||
| e67969f52f | |||
| 32a0496bc2 | |||
| 6df311c11a | |||
| 2e23b92763 | |||
| 41a029ffb4 | |||
| 9c8f914f42 | |||
| d75cdc9696 | |||
| 77bb28ded6 | |||
| 0e7981d717 | |||
| fbb0c05c7f | |||
| efa0ab7e4e | |||
| 70fe5189e0 | |||
| 3a8d6d0bcd | |||
| 7ac817e9ae | |||
| 0ceb4765a2 | |||
| 7ce9654402 | |||
| 5328627d7a | |||
| fe1a67ffaa | |||
| 4253d659f1 | |||
| b3560aaa00 | |||
| 005392911d | |||
| 7f02562e0c | |||
| 84bc00fa20 | |||
| c1483d87c7 | |||
| f5e4a202cb | |||
| 6f15c2921a | |||
| d891e5da15 | |||
| 6607c8cd2f | |||
| 1e20086799 | |||
| f85ab7ddc2 | |||
| c3700737c3 | |||
| 2f8013a49b | |||
| af54883fd3 | |||
| 223a210d49 | |||
| c133e4f0ef | |||
| 424d27b71c | |||
| 2fe5a3cef8 | |||
| a3c33d5323 | |||
| e927c27b85 | |||
| d7d99c5e7e | |||
| b6d3be41e1 | |||
| 071ee83b7a | |||
| dfe7a29c92 | |||
| 2b02dc19c0 | |||
| 9bf296bec9 | |||
| 5db7fc8e8c | |||
| c7eb696d60 | |||
| 4f53f5910b | |||
| 971fc3d243 | |||
| c2b5a58dd2 | |||
| 53c32cc296 | |||
| 89299cdb3c | |||
| 2972f0ddc8 |
+4
-1
@@ -25,4 +25,7 @@
|
||||
!codeformat/
|
||||
|
||||
# Github specific files and directories
|
||||
!.github/
|
||||
!.github/
|
||||
|
||||
# Explicit ignores
|
||||
Thumbs.db
|
||||
@@ -1,5 +1,4 @@
|
||||
[](https://travis-ci.org/AppliedEnergistics/Applied-Energistics-2)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/tags)
|
||||
[](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
|
||||
|
||||
# Applied Energistics 2
|
||||
@@ -53,7 +52,7 @@ Downloads can be found on [CurseForge](http://www.curse.com/mc-mods/minecraft/22
|
||||
|
||||
[Download Latest Nightly Build](https://ci.appveyor.com/api/projects/shartte/applied-energistics-2/artifacts/ae2-rv4-nightly.zip?branch=master)
|
||||
|
||||
Nightly builds for the Minecraft 1.10.2 branch of AE2 (rv4-alpha) are available from [AppVeyor](https://ci.appveyor.com/api/projects/shartte/applied-energistics-2/history). These builds are only for testing purposes and might lead to loss of data, and will contain significant bugs. Please see below on how you can report bugs you find during testing.
|
||||
Nightly builds for the Minecraft 1.10.2 branch of AE2 (rv4-alpha) are available from [AppVeyor](https://ci.appveyor.com/project/shartte/applied-energistics-2/history). These builds are only for testing purposes and might lead to loss of data, and will contain significant bugs. Please see below on how you can report bugs you find during testing.
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
+16
-19
@@ -40,7 +40,6 @@ repositories {
|
||||
|
||||
apply from: 'gradle/scripts/dependencies.gradle'
|
||||
apply from: 'gradle/scripts/artifacts.gradle'
|
||||
apply from: 'gradle/scripts/integration.gradle'
|
||||
apply from: 'gradle/scripts/optional.gradle'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
@@ -56,6 +55,9 @@ jar {
|
||||
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
||||
}
|
||||
|
||||
from sourceSets.api.output
|
||||
dependsOn apiClasses
|
||||
|
||||
// specify which files are really included, can control which APIs should be in
|
||||
include "appeng/**"
|
||||
include "assets/**"
|
||||
@@ -82,26 +84,21 @@ minecraft {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs += 'src/api/java'
|
||||
srcDirs += 'src/main/java/'
|
||||
}
|
||||
|
||||
resources {
|
||||
srcDir "src/main/resources/"
|
||||
include "assets/appliedenergistics2/recipes/**/*.recipe",
|
||||
"assets/appliedenergistics2/recipes/README.html",
|
||||
"assets/appliedenergistics2/lang/*.lang",
|
||||
"assets/appliedenergistics2/blockstates/**/*.json",
|
||||
"assets/appliedenergistics2/models/**/*.json",
|
||||
"assets/appliedenergistics2/textures/**/*.png",
|
||||
"assets/appliedenergistics2/textures/**/*.mcmeta",
|
||||
"assets/appliedenergistics2/meta/*",
|
||||
"mcmod.info",
|
||||
"pack.mcmeta"
|
||||
}
|
||||
api
|
||||
|
||||
// This source set will contain third party API code that we need to compile, but which is not shipped with the jar
|
||||
thirdparty {
|
||||
// Third Party APIs often need access to Minecraft classes (i.e. EnumFacing), so set this up here
|
||||
compileClasspath += configurations.forgeGradleMc + configurations.forgeGradleMcDeps
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile sourceSets.thirdparty.output
|
||||
}
|
||||
|
||||
processResources
|
||||
|
||||
@@ -46,7 +46,7 @@ task apiJar(type: Jar) {
|
||||
from sourceSets.api.java
|
||||
include "appeng/api/**"
|
||||
|
||||
from sourceSets.main.output
|
||||
from sourceSets.api.output
|
||||
include "appeng/api/**"
|
||||
|
||||
classifier = 'api'
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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>.
|
||||
*/
|
||||
|
||||
// Should be provided by ForgeGradle, some idea user should confirm it.
|
||||
apply plugin: 'idea'
|
||||
|
||||
idea {
|
||||
module {
|
||||
inheritOutputDirs = true
|
||||
|
||||
// excludes integration due to not being available upon port
|
||||
excludeDirs += file('src/main/java/appeng/parts/layers/')
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public interface IParts
|
||||
|
||||
IItemDefinition p2PTunnelLiquids();
|
||||
|
||||
// IItemDefinition p2PTunnelEU();
|
||||
IItemDefinition p2PTunnelEU();
|
||||
|
||||
// IItemDefinition p2PTunnelRF();
|
||||
|
||||
|
||||
@@ -271,87 +271,93 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
|
||||
@Override
|
||||
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( player != null )
|
||||
if( player != null && heldItem != null )
|
||||
{
|
||||
if( heldItem != null )
|
||||
if( Platform.isWrench( player, heldItem, pos ) && player.isSneaking() )
|
||||
{
|
||||
if( Platform.isWrench( player, heldItem, pos ) && player.isSneaking() )
|
||||
final IBlockState blockState = w.getBlockState( pos );
|
||||
final Block block = blockState.getBlock();
|
||||
|
||||
if( block == null )
|
||||
{
|
||||
final IBlockState ids = w.getBlockState( pos );
|
||||
final Block id = ids.getBlock();
|
||||
if( id != null )
|
||||
{
|
||||
final AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
final ItemStack[] drops = Platform.getBlockDrops( w, pos );
|
||||
|
||||
if( tile == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final ItemStack op = new ItemStack( this );
|
||||
for( final ItemStack ol : drops )
|
||||
{
|
||||
if( Platform.isSameItemType( ol, op ) )
|
||||
{
|
||||
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
|
||||
if( tag != null )
|
||||
{
|
||||
ol.setTagCompound( tag );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( id.removedByPlayer( ids, w, pos, player, false ) )
|
||||
{
|
||||
final List<ItemStack> l = Lists.newArrayList( drops );
|
||||
Platform.spawnDrops( w, pos, l );
|
||||
w.setBlockToAir( pos );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if( heldItem.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
|
||||
final AEBaseTile tile = this.getTileEntity( w, pos );
|
||||
|
||||
if( tile == null )
|
||||
{
|
||||
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
|
||||
if( player.isSneaking() )
|
||||
return false;
|
||||
}
|
||||
|
||||
if( tile instanceof TileCableBus || tile instanceof TileSkyChest )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( w, pos );
|
||||
final ItemStack op = new ItemStack( this );
|
||||
|
||||
for( final ItemStack ol : itemDropCandidates )
|
||||
{
|
||||
if( Platform.itemComparisons().isEqualItemType( ol, op ) )
|
||||
{
|
||||
final AEBaseTile t = this.getTileEntity( w, pos );
|
||||
if( t != null )
|
||||
final NBTTagCompound tag = tile.downloadSettings( SettingsFrom.DISMANTLE_ITEM );
|
||||
if( tag != null )
|
||||
{
|
||||
final String name = this.getUnlocalizedName();
|
||||
final NBTTagCompound data = t.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||
if( data != null )
|
||||
{
|
||||
memoryCard.setMemoryCardContents( heldItem, name, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||
return true;
|
||||
}
|
||||
ol.setTagCompound( tag );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( block.removedByPlayer( blockState, w, pos, player, false ) )
|
||||
{
|
||||
final List<ItemStack> itemsToDrop = Lists.newArrayList( itemDropCandidates );
|
||||
Platform.spawnDrops( w, pos, itemsToDrop );
|
||||
w.setBlockToAir( pos );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( heldItem.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
|
||||
{
|
||||
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
|
||||
final AEBaseTile tileEntity = this.getTileEntity( w, pos );
|
||||
|
||||
if( tileEntity == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final String name = this.getUnlocalizedName();
|
||||
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
final NBTTagCompound data = tileEntity.downloadSettings( SettingsFrom.MEMORY_CARD );
|
||||
if( data != null )
|
||||
{
|
||||
memoryCard.setMemoryCardContents( heldItem, name, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final String savedName = memoryCard.getSettingsName( heldItem );
|
||||
final NBTTagCompound data = memoryCard.getData( heldItem );
|
||||
|
||||
if( this.getUnlocalizedName().equals( savedName ) )
|
||||
{
|
||||
tileEntity.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
||||
}
|
||||
else
|
||||
{
|
||||
final String name = memoryCard.getSettingsName( heldItem );
|
||||
final NBTTagCompound data = memoryCard.getData( heldItem );
|
||||
if( this.getUnlocalizedName().equals( name ) )
|
||||
{
|
||||
final AEBaseTile t = this.getTileEntity( w, pos );
|
||||
t.uploadSettings( SettingsFrom.MEMORY_CARD, data );
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
|
||||
}
|
||||
else
|
||||
{
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
|
||||
}
|
||||
return false;
|
||||
memoryCard.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,10 +75,22 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
|
||||
return super.getActualState( state, worldIn, pos ).withProperty( POWERED, powered );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT)
|
||||
/**
|
||||
* NOTE: This is only used to determine how to render an item being held in hand.
|
||||
* For determining block rendering, the method below is used (canRenderInLayer).
|
||||
*/
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@Override
|
||||
public boolean canRenderInLayer( BlockRenderLayer layer )
|
||||
{
|
||||
return layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
public boolean isFullCube(IBlockState state)
|
||||
|
||||
@@ -69,9 +69,6 @@ import appeng.client.render.cablebus.CableBusRenderState;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
import appeng.parts.ICableBusContainer;
|
||||
import appeng.parts.NullCableBusContainer;
|
||||
import appeng.tile.AEBaseTile;
|
||||
@@ -349,10 +346,6 @@ public class BlockCableBus extends AEBaseTileBlock
|
||||
{
|
||||
out = ( (TileCableBus) te ).getCableBus();
|
||||
}
|
||||
else if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
{
|
||||
out = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getCableContainer( te );
|
||||
}
|
||||
|
||||
return out == null ? NULL_CABLE_BUS : out;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
package appeng.capabilities;
|
||||
|
||||
|
||||
import net.darkhax.tesla.api.ITeslaConsumer;
|
||||
import net.darkhax.tesla.api.ITeslaHolder;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
@@ -41,6 +43,12 @@ public final class Capabilities
|
||||
@CapabilityInject( IStorageMonitorableAccessor.class )
|
||||
public static Capability<IStorageMonitorableAccessor> STORAGE_MONITORABLE_ACCESSOR;
|
||||
|
||||
@CapabilityInject(ITeslaConsumer.class)
|
||||
public static Capability<ITeslaConsumer> TESLA_CONSUMER;
|
||||
|
||||
@CapabilityInject(ITeslaHolder.class)
|
||||
public static Capability<ITeslaHolder> TESLA_HOLDER;
|
||||
|
||||
/**
|
||||
* Register AE2 provided capabilities.
|
||||
*/
|
||||
|
||||
@@ -161,12 +161,6 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
|
||||
final boolean hasClicked = Mouse.isButtonDown( 0 );
|
||||
if( hasClicked && this.getScrollBar() != null )
|
||||
{
|
||||
this.getScrollBar().click( this, mouseX - this.guiLeft, mouseY - this.guiTop );
|
||||
}
|
||||
|
||||
for( final Object c : this.buttonList )
|
||||
{
|
||||
if( c instanceof ITooltip )
|
||||
@@ -217,7 +211,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
// All lines after the first are colored gray
|
||||
for( int i = 1; i < lines.size(); i++ )
|
||||
{
|
||||
lines.set(i, TextFormatting.GRAY + lines.get(i));
|
||||
lines.set( i, TextFormatting.GRAY + lines.get( i ) );
|
||||
}
|
||||
|
||||
this.drawHoveringText( lines, x, y, fontRendererObj );
|
||||
@@ -258,13 +252,15 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
if( fs.isEnabled() )
|
||||
{
|
||||
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
|
||||
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18,
|
||||
18 );
|
||||
}
|
||||
else
|
||||
{
|
||||
GlStateManager.color( 1.0F, 1.0F, 1.0F, 0.4F );
|
||||
GlStateManager.enableBlend();
|
||||
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18, 18 );
|
||||
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.getSourceX() - 1, fs.getSourceY() - 1, 18,
|
||||
18 );
|
||||
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
}
|
||||
}
|
||||
@@ -290,6 +286,11 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
}
|
||||
|
||||
if( this.getScrollBar() != null )
|
||||
{
|
||||
this.getScrollBar().click( this, xCoord - this.guiLeft, yCoord - this.guiTop );
|
||||
}
|
||||
|
||||
super.mouseClicked( xCoord, yCoord, btn );
|
||||
}
|
||||
|
||||
@@ -299,6 +300,11 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final Slot slot = this.getSlot( x, y );
|
||||
final ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack();
|
||||
|
||||
if( this.getScrollBar() != null )
|
||||
{
|
||||
this.getScrollBar().click( this, x - this.guiLeft, y - this.guiTop );
|
||||
}
|
||||
|
||||
if( slot instanceof SlotFake && itemstack != null )
|
||||
{
|
||||
this.drag_click.add( slot );
|
||||
@@ -317,7 +323,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
}
|
||||
|
||||
//TODO 1.9.4 aftermath - Whole ClickType thing, to be checked.
|
||||
// TODO 1.9.4 aftermath - Whole ClickType thing, to be checked.
|
||||
@Override
|
||||
protected void handleMouseClick( final Slot slot, final int slotIdx, final int mouseButton, final ClickType clickType )
|
||||
{
|
||||
@@ -325,7 +331,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
if( slot instanceof SlotFake )
|
||||
{
|
||||
final InventoryAction action = isCtrlKeyDown() ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
final InventoryAction action = mouseButton == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
|
||||
if( this.drag_click.size() > 1 )
|
||||
{
|
||||
@@ -369,7 +375,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
else
|
||||
{
|
||||
// Craft stack on right-click, craft single on left-click
|
||||
action = (mouseButton == 1) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
|
||||
action = ( mouseButton == 1 ) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
|
||||
}
|
||||
|
||||
final PacketInventoryAction p = new PacketInventoryAction( action, slotIdx, 0 );
|
||||
@@ -409,10 +415,10 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
switch( clickType )
|
||||
{
|
||||
case PICKUP: // pickup / set-down.
|
||||
action = (mouseButton == 1) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
action = ( mouseButton == 1 ) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
break;
|
||||
case QUICK_MOVE:
|
||||
action = isCtrlKeyDown() ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
|
||||
action = ( mouseButton == 1 ) ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
|
||||
break;
|
||||
|
||||
case CLONE: // creative dupe:
|
||||
@@ -445,7 +451,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
switch( clickType )
|
||||
{
|
||||
case PICKUP: // pickup / set-down.
|
||||
action = (mouseButton == 1) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
action = ( mouseButton == 1 ) ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
stack = ( (SlotME) slot ).getAEStack();
|
||||
|
||||
if( stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN && stack.getStackSize() == 0 && player.inventory.getItemStack() == null )
|
||||
@@ -455,7 +461,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
|
||||
break;
|
||||
case QUICK_MOVE:
|
||||
action = isCtrlKeyDown() ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
|
||||
action = ( mouseButton == 1 ) ? InventoryAction.PICKUP_SINGLE : InventoryAction.SHIFT_CLICK;
|
||||
stack = ( (SlotME) slot ).getAEStack();
|
||||
break;
|
||||
|
||||
@@ -515,7 +521,9 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final List<Slot> slots = this.getInventorySlots();
|
||||
for( final Slot inventorySlot : slots )
|
||||
{
|
||||
if( inventorySlot != null && inventorySlot.canTakeStack( this.mc.thePlayer ) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.canAddItemToSlot( inventorySlot, this.dbl_whichItem, true ) )
|
||||
if( inventorySlot != null && inventorySlot.canTakeStack(
|
||||
this.mc.thePlayer ) && inventorySlot.getHasStack() && inventorySlot.inventory == slot.inventory && Container.canAddItemToSlot(
|
||||
inventorySlot, this.dbl_whichItem, true ) )
|
||||
{
|
||||
this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, 1, clickType );
|
||||
}
|
||||
@@ -759,11 +767,15 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final float f1 = 0.00390625F;
|
||||
final float f = 0.00390625F;
|
||||
final float par6 = 16;
|
||||
vb.pos( par1 + 0, par2 + par6, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
|
||||
vb.pos( par1 + 0, par2 + par6, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() ).endVertex();
|
||||
final float par5 = 16;
|
||||
vb.pos( par1 + par5, par2 + par6, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
|
||||
vb.pos( par1 + par5, par2 + 0, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
|
||||
vb.pos( par1 + 0, par2 + 0, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f, aes.getOpacityOfIcon() ).endVertex();
|
||||
vb.pos( par1 + par5, par2 + par6, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + par6 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() ).endVertex();
|
||||
vb.pos( par1 + par5, par2 + 0, this.zLevel ).tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() ).endVertex();
|
||||
vb.pos( par1 + 0, par2 + 0, this.zLevel ).tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ).color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() ).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
}
|
||||
@@ -777,7 +789,8 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.NotAvailable )
|
||||
{
|
||||
boolean isValid = s.isItemValid( is ) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible || s instanceof SlotFake || s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
|
||||
boolean isValid = s.isItemValid(
|
||||
is ) || s instanceof SlotOutput || s instanceof AppEngCraftingSlot || s instanceof SlotDisabled || s instanceof SlotInaccessible || s instanceof SlotFake || s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
|
||||
if( isValid && s instanceof SlotRestrictedInput )
|
||||
{
|
||||
try
|
||||
@@ -848,6 +861,7 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file );
|
||||
this.mc.getTextureManager().bindTexture( loc );
|
||||
}
|
||||
|
||||
protected GuiScrollbar getScrollBar()
|
||||
{
|
||||
return this.myScrollBar;
|
||||
|
||||
@@ -24,8 +24,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerSkyChest;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.Integrations;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
|
||||
|
||||
@@ -55,6 +54,6 @@ public class GuiSkyChest extends AEBaseGui
|
||||
@Override
|
||||
protected boolean enableSpaceClicking()
|
||||
{
|
||||
return !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.InvTweaks );
|
||||
return !Integrations.invTweaks().isEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,11 +37,11 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.widgets.IScrollSource;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.integration.modules.JEI;
|
||||
import appeng.integration.Integrations;
|
||||
import appeng.items.storage.ItemViewCell;
|
||||
import appeng.util.ItemSorters;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.prioitylist.IPartitionList;
|
||||
import appeng.util.prioritylist.IPartitionList;
|
||||
|
||||
|
||||
public class ItemRepo
|
||||
@@ -58,7 +58,6 @@ public class ItemRepo
|
||||
private String searchString = "";
|
||||
private IPartitionList<IAEItemStack> myPartitionList;
|
||||
private String innerSearch = "";
|
||||
private String jeiSearch = null;
|
||||
private boolean hasPower;
|
||||
|
||||
public ItemRepo( final IScrollSource src, final ISortSource sortSrc )
|
||||
@@ -244,7 +243,7 @@ public class ItemRepo
|
||||
|
||||
private void updateJEI( String filter )
|
||||
{
|
||||
JEI.instance.getJei().setSearchText( filter );
|
||||
Integrations.jei().setSearchText( filter );
|
||||
}
|
||||
|
||||
public int size()
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
@@ -108,13 +107,10 @@ public class FacadeDispatcherBakedModel implements IBakedModel
|
||||
|
||||
ItemFacade itemFacade = (ItemFacade) stack.getItem();
|
||||
|
||||
Block block = itemFacade.getBlock( stack );
|
||||
int meta = itemFacade.getMeta( stack );
|
||||
IBlockState state = itemFacade.getTextureBlockState( stack );
|
||||
ItemStack textureItem = itemFacade.getTextureItem( stack );
|
||||
|
||||
// This is kinda fascinating, how do we get the meta from the itemblock
|
||||
IBlockState state = block.getStateFromMeta( meta );
|
||||
|
||||
return new FacadeWithBlockBakedModel( baseModel, state, format );
|
||||
return new FacadeWithBlockBakedModel( baseModel, state, textureItem, format );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import appeng.client.render.cablebus.CubeBuilder;
|
||||
@@ -53,10 +54,13 @@ public class FacadeWithBlockBakedModel implements IBakedModel
|
||||
|
||||
private final VertexFormat format;
|
||||
|
||||
public FacadeWithBlockBakedModel( IBakedModel baseModel, IBlockState blockState, VertexFormat format )
|
||||
private final ItemStack textureItem;
|
||||
|
||||
public FacadeWithBlockBakedModel( IBakedModel baseModel, IBlockState blockState, ItemStack textureItem, VertexFormat format )
|
||||
{
|
||||
this.baseModel = baseModel;
|
||||
this.blockState = blockState;
|
||||
this.textureItem = textureItem;
|
||||
this.textureModel = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( blockState );
|
||||
this.format = format;
|
||||
}
|
||||
@@ -69,10 +73,14 @@ public class FacadeWithBlockBakedModel implements IBakedModel
|
||||
{
|
||||
List<BakedQuad> quads = new ArrayList<>( 1 );
|
||||
CubeBuilder builder = new CubeBuilder( format, quads );
|
||||
TextureAtlasSprite sprite = FacadeBuilder.getSprite( textureModel, blockState, side, rand );
|
||||
if ( sprite != null )
|
||||
FacadeBuilder.TextureAtlasAndTint sprite = FacadeBuilder.getSprite( textureModel, blockState, side, rand );
|
||||
if ( sprite != null && sprite.getSprite() != null )
|
||||
{
|
||||
builder.setTexture( sprite );
|
||||
if( sprite.getTint() != -1 )
|
||||
{
|
||||
builder.setColor( Minecraft.getMinecraft().getItemColors().getColorFromItemstack( textureItem, sprite.getTint() ) );
|
||||
}
|
||||
builder.setTexture( sprite.getSprite() );
|
||||
builder.setDrawFaces( EnumSet.of( EnumFacing.NORTH ) );
|
||||
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
||||
return quads;
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.render.cablebus;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -35,13 +36,14 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.color.BlockColors;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.AEAxisAlignedBB;
|
||||
@@ -57,13 +59,14 @@ public class FacadeBuilder
|
||||
|
||||
private static final ResourceLocation TEXTURE_FACADE = new ResourceLocation( AppEng.MOD_ID, "parts/cable_anchor" );
|
||||
|
||||
private final BlockColors blockColors = Minecraft.getMinecraft().getBlockColors();
|
||||
|
||||
private final VertexFormat format;
|
||||
|
||||
private final TextureAtlasSprite facadeTexture;
|
||||
|
||||
private final BlockRendererDispatcher blockRendererDispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
|
||||
private static final Set<ResourceLocation> warnedFor = new HashSet<>();
|
||||
|
||||
FacadeBuilder( VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
|
||||
{
|
||||
this.format = format;
|
||||
@@ -81,7 +84,7 @@ public class FacadeBuilder
|
||||
|
||||
CubeBuilder builder = new CubeBuilder( format, quads );
|
||||
|
||||
facadesState.forEach( ( side, textureItem ) ->
|
||||
facadesState.forEach( ( side, state ) ->
|
||||
{
|
||||
AxisAlignedBB facadeBox = getFacadeBox( side, thinFacades );
|
||||
AEAxisAlignedBB cutOutBox = getCutOutBox( facadeBox, partBoxes );
|
||||
@@ -98,25 +101,68 @@ public class FacadeBuilder
|
||||
} );
|
||||
}
|
||||
|
||||
public static TextureAtlasSprite getSprite( IBakedModel blockModel, IBlockState state, EnumFacing facing, long rand)
|
||||
public static TextureAtlasAndTint getSprite( IBakedModel blockModel, IBlockState state, EnumFacing facing, long rand)
|
||||
{
|
||||
for( BakedQuad bakedQuad : blockModel.getQuads( state, facing, rand ) )
|
||||
|
||||
TextureAtlasAndTint firstFound = null;
|
||||
BlockRenderLayer orgLayer = MinecraftForgeClient.getRenderLayer();
|
||||
|
||||
try
|
||||
{
|
||||
return bakedQuad.getSprite();
|
||||
// Some other mods also distinguish between layers, so we're doing this in a loop from most likely to least likely
|
||||
for( BlockRenderLayer layer : BlockRenderLayer.values() )
|
||||
{
|
||||
|
||||
ForgeHooksClient.setRenderLayer( layer );
|
||||
|
||||
for( BakedQuad bakedQuad : blockModel.getQuads( state, facing, rand ) )
|
||||
{
|
||||
return new TextureAtlasAndTint( bakedQuad );
|
||||
}
|
||||
|
||||
for( BakedQuad bakedQuad : blockModel.getQuads( state, null, rand ) )
|
||||
{
|
||||
if( firstFound == null )
|
||||
{
|
||||
firstFound = new TextureAtlasAndTint( bakedQuad );
|
||||
}
|
||||
if( bakedQuad.getFace() == facing )
|
||||
{
|
||||
return new TextureAtlasAndTint( bakedQuad );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
if( warnedFor.add( state.getBlock().getRegistryName() ) )
|
||||
{
|
||||
AELog.warn( "Unable to get facade sprite for blockstate %s. Supressing further warnings for this block.", state );
|
||||
AELog.debug( e );
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ForgeHooksClient.setRenderLayer( orgLayer );
|
||||
}
|
||||
|
||||
TextureAtlasSprite firstFound = null;
|
||||
for( BakedQuad bakedQuad : blockModel.getQuads( state, null, rand ) )
|
||||
// Fall back to the particle texture, if we havent found anything else so far.
|
||||
if( firstFound == null )
|
||||
{
|
||||
if( firstFound == null )
|
||||
try
|
||||
{
|
||||
firstFound = bakedQuad.getSprite();
|
||||
return new TextureAtlasAndTint( blockModel.getParticleTexture(), -1 );
|
||||
}
|
||||
if( bakedQuad.getFace() == facing )
|
||||
catch( Exception e )
|
||||
{
|
||||
return bakedQuad.getSprite();
|
||||
if( warnedFor.add( state.getBlock().getRegistryName() ) )
|
||||
{
|
||||
AELog.warn( "Unable to get facade sprite particle texture fallback for blockstate %s. Supressing further warnings for this block.", state );
|
||||
AELog.debug( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return firstFound;
|
||||
}
|
||||
|
||||
@@ -128,6 +174,9 @@ public class FacadeBuilder
|
||||
|
||||
builder.setDrawFaces( EnumSet.allOf( EnumFacing.class ) );
|
||||
|
||||
// Reset to no color multiplicator
|
||||
builder.setColorRGB( 0xFFFFFF );
|
||||
|
||||
// We only render the stilt if we don't intersect with any part directly, and if there's no part on our side
|
||||
if( renderStilt && busBounds == null && layer == BlockRenderLayer.CUTOUT )
|
||||
{
|
||||
@@ -166,36 +215,42 @@ public class FacadeBuilder
|
||||
|
||||
IBakedModel blockModel = blockRendererDispatcher.getModelForState( blockState );
|
||||
|
||||
int color = 0xffffff;
|
||||
try
|
||||
{
|
||||
blockColors.getColor( blockState );
|
||||
}
|
||||
catch( final Throwable ignored )
|
||||
{
|
||||
}
|
||||
|
||||
final int color;
|
||||
if( translucent )
|
||||
{
|
||||
color &= 0xFFFFFF;
|
||||
color |= 0x4C000000;
|
||||
builder.setColor( color );
|
||||
color = 0x4CFFFFFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setColorRGB( color );
|
||||
color = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
// TODO: Cache this
|
||||
for( EnumFacing facing : facadeState.getOpenFaces() )
|
||||
{
|
||||
TextureAtlasSprite sprite = getSprite( blockModel, blockState, facing, rand );
|
||||
if( sprite != null )
|
||||
TextureAtlasAndTint spriteAndTint = getSprite( blockModel, blockState, facing, rand );
|
||||
if( spriteAndTint != null && spriteAndTint.sprite != null )
|
||||
{
|
||||
builder.setTexture( facing, sprite );
|
||||
// Use the tint color from the item stack here, which is based upon the assumption that the
|
||||
// model used for the block will use the same meaning for tint indices as the item model does
|
||||
if( spriteAndTint.tint != -1 )
|
||||
{
|
||||
int tintColor = facadeState.resolveTintColor( spriteAndTint.tint );
|
||||
|
||||
// Still apply the transparency color
|
||||
tintColor &= 0xFFFFFF;
|
||||
tintColor |= color & 0xFF000000;
|
||||
builder.setColor( tintColor );
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setColor( color );
|
||||
}
|
||||
builder.setTexture( facing, spriteAndTint.sprite );
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setColor( color );
|
||||
builder.setTexture( facing, facadeTexture );
|
||||
}
|
||||
}
|
||||
@@ -411,4 +466,34 @@ public class FacadeBuilder
|
||||
throw new IllegalArgumentException( "Unsupported face: " + side );
|
||||
}
|
||||
}
|
||||
|
||||
public static class TextureAtlasAndTint
|
||||
{
|
||||
private final TextureAtlasSprite sprite;
|
||||
private final int tint;
|
||||
|
||||
private TextureAtlasAndTint( BakedQuad quad )
|
||||
{
|
||||
this.sprite = quad.getSprite();
|
||||
this.tint = quad.getTintIndex();
|
||||
}
|
||||
|
||||
private TextureAtlasAndTint( TextureAtlasSprite sprite, int tint )
|
||||
{
|
||||
this.sprite = sprite;
|
||||
this.tint = tint;
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getSprite()
|
||||
{
|
||||
return sprite;
|
||||
}
|
||||
|
||||
public int getTint()
|
||||
{
|
||||
return tint;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ package appeng.client.render.cablebus;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
|
||||
@@ -19,10 +21,14 @@ public class FacadeRenderState
|
||||
// Which faces of the cube should be rendered for this particular facade
|
||||
private final EnumSet<EnumFacing> openFaces;
|
||||
|
||||
public FacadeRenderState( IBlockState sourceBlock, EnumSet<EnumFacing> openFaces )
|
||||
// For resolving the tint indices of a facade
|
||||
private final ItemStack textureItem;
|
||||
|
||||
public FacadeRenderState( IBlockState sourceBlock, EnumSet<EnumFacing> openFaces, ItemStack textureItem )
|
||||
{
|
||||
this.sourceBlock = sourceBlock;
|
||||
this.openFaces = openFaces;
|
||||
this.textureItem = textureItem;
|
||||
}
|
||||
|
||||
public IBlockState getSourceBlock()
|
||||
@@ -35,4 +41,9 @@ public class FacadeRenderState
|
||||
return openFaces;
|
||||
}
|
||||
|
||||
public int resolveTintColor( int tintIndex )
|
||||
{
|
||||
return Minecraft.getMinecraft().getItemColors().getColorFromItemstack( textureItem, tintIndex );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -88,8 +88,23 @@ public class AutoRotatingModel implements IBakedModel
|
||||
builder.setQuadOrientation( null );
|
||||
|
||||
}
|
||||
BakedQuad q = builder.build();
|
||||
rotated.add( q );
|
||||
BakedQuad unpackedQuad = builder.build();
|
||||
|
||||
// Make a copy of it to resolve the vertex data and throw away the unpacked stuff
|
||||
// This also fixes a bug in Forge's UnpackedBakedQuad, which unpacks a byte-based normal like 0,0,-1
|
||||
// to 0,0,-0.99607843. We replace these normals with the proper 0,0,-1 when rotation, which
|
||||
// causes a bug in the AO lighter, if an unpacked quad pipes this value back to it.
|
||||
// Packing it back to the vanilla vertex format will fix this inconsistency because it converts
|
||||
// the normal back to a byte-based format, which then re-applies Forge's own bug when piping it
|
||||
// to the AO lighter, thus fixing our problem.
|
||||
BakedQuad packedQuad = new BakedQuad( unpackedQuad.getVertexData(),
|
||||
quad.getTintIndex(),
|
||||
unpackedQuad.getFace(),
|
||||
quad.getSprite(),
|
||||
quad.shouldApplyDiffuseLighting(),
|
||||
quad.getFormat()
|
||||
);
|
||||
rotated.add( packedQuad );
|
||||
}
|
||||
return rotated;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.model.ModelChest;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
@@ -70,14 +71,8 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
|
||||
}
|
||||
else
|
||||
{
|
||||
if( te != null )
|
||||
{
|
||||
this.bindTexture( ( (BlockSkyChest) te.getBlockType() ).type == SkyChestType.STONE ? TEXTURE_STONE : TEXTURE_BLOCK );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.bindTexture( TEXTURE_BLOCK );
|
||||
}
|
||||
SkyChestType chestType = getChestType( te );
|
||||
this.bindTexture( chestType == SkyChestType.STONE ? TEXTURE_STONE : TEXTURE_BLOCK );
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -128,4 +123,20 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
|
||||
}
|
||||
}
|
||||
|
||||
// Defensively determine the sky chest type
|
||||
private static SkyChestType getChestType( TileSkyChest te )
|
||||
{
|
||||
if( te == null )
|
||||
{
|
||||
return SkyChestType.BLOCK;
|
||||
}
|
||||
|
||||
Block blockType = te.getBlockType();
|
||||
if( blockType instanceof BlockSkyChest )
|
||||
{
|
||||
return ( (BlockSkyChest) blockType ).type;
|
||||
}
|
||||
return SkyChestType.BLOCK;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ public abstract class AEBaseContainer extends Container
|
||||
final ItemStack a = stack == null ? null : stack.getItemStack();
|
||||
final ItemStack b = this.clientRequestedTargetItem == null ? null : this.clientRequestedTargetItem.getItemStack();
|
||||
|
||||
if( Platform.isSameItemPrecise( a, b ) )
|
||||
if( Platform.itemComparisons().isSameItem( a, b ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -438,13 +438,11 @@ public abstract class AEBaseContainer extends Container
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
for( final Object crafter : this.listeners )
|
||||
for( final IContainerListener listener : this.listeners )
|
||||
{
|
||||
final IContainerListener IContainerListener = (IContainerListener) crafter;
|
||||
|
||||
for( final SyncData sd : this.syncData.values() )
|
||||
{
|
||||
sd.tick( IContainerListener );
|
||||
sd.tick( listener );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -545,7 +543,7 @@ public abstract class AEBaseContainer extends Container
|
||||
|
||||
if( !( cs.isPlayerSide() ) && cs instanceof SlotFake )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( destination, tis ) )
|
||||
if( Platform.itemComparisons().isSameItem( destination, tis ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -577,7 +575,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
final ItemStack t = d.getStack();
|
||||
|
||||
if( Platform.isSameItemPrecise( tis, t ) ) // t.isItemEqual(tis))
|
||||
if( Platform.itemComparisons().isSameItem( tis, t ) ) // t.isItemEqual(tis))
|
||||
{
|
||||
int maxSize = t.getMaxStackSize();
|
||||
if( maxSize > d.getSlotStackLimit() )
|
||||
@@ -629,7 +627,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
final ItemStack t = d.getStack();
|
||||
|
||||
if( Platform.isSameItemPrecise( t, tis ) )
|
||||
if( Platform.itemComparisons().isSameItem( t, tis ) )
|
||||
{
|
||||
int maxSize = t.getMaxStackSize();
|
||||
if( d.getSlotStackLimit() < maxSize )
|
||||
@@ -795,7 +793,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
if( hand == null )
|
||||
{
|
||||
is.stackSize--;
|
||||
is.stackSize = Math.max( 1, is.stackSize - 1 );
|
||||
}
|
||||
else if( hand.isItemEqual( is ) )
|
||||
{
|
||||
@@ -929,7 +927,7 @@ public abstract class AEBaseContainer extends Container
|
||||
{
|
||||
liftQty = 0;
|
||||
}
|
||||
if( !Platform.isSameItemPrecise( slotItem.getItemStack(), item ) )
|
||||
if( !Platform.itemComparisons().isSameItem( slotItem.getItemStack(), item ) )
|
||||
{
|
||||
liftQty = 0;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,10 @@ public class SyncData
|
||||
}
|
||||
else if( val instanceof Long || val.getClass() == long.class )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketProgressBar( this.channel, (Long) val ), (EntityPlayerMP) o );
|
||||
if( o instanceof EntityPlayerMP )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketProgressBar( this.channel, (Long) val ), (EntityPlayerMP) o );
|
||||
}
|
||||
}
|
||||
else if( val instanceof Boolean || val.getClass() == boolean.class )
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
@@ -151,22 +152,24 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
this.setValidContainer( false );
|
||||
}
|
||||
|
||||
for( final Object crafter : this.listeners )
|
||||
for( final IContainerListener listener : this.listeners )
|
||||
{
|
||||
final IContainerListener IContainerListener = (IContainerListener) crafter;
|
||||
|
||||
if( this.prevStack != is )
|
||||
{
|
||||
// if the bars changed an item was probably made, so just send shit!
|
||||
for( final Object s : this.inventorySlots )
|
||||
for( final Slot s : this.inventorySlots )
|
||||
{
|
||||
if( s instanceof OptionalSlotRestrictedInput )
|
||||
{
|
||||
final OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s;
|
||||
IContainerListener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
|
||||
listener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
|
||||
}
|
||||
}
|
||||
( (EntityPlayerMP) IContainerListener ).isChangingQuantityOnly = false;
|
||||
|
||||
if( listener instanceof EntityPlayerMP )
|
||||
{
|
||||
( (EntityPlayerMP) listener ).isChangingQuantityOnly = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
{
|
||||
for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( optional, is ) )
|
||||
if( Platform.itemComparisons().isSameItem( optional, is ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -126,18 +126,18 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
|
||||
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
|
||||
{
|
||||
final boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( top, recipe.getTopOptional().orElse( null ) ) ) && // and...
|
||||
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( bot, recipe.getBottomOptional().orElse( null ) ) );
|
||||
final boolean matchA = ( top == null && !recipe.getTopOptional().isPresent() ) || ( Platform.itemComparisons().isSameItem( top, recipe.getTopOptional().orElse( null ) ) ) && // and...
|
||||
( bot == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.itemComparisons().isSameItem( bot, recipe.getBottomOptional().orElse( null ) ) );
|
||||
|
||||
final boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.isSameItemPrecise( bot, recipe.getTopOptional().orElse( null ) ) ) && // and...
|
||||
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.isSameItemPrecise( top, recipe.getBottomOptional().orElse( null ) ) );
|
||||
final boolean matchB = ( bot == null && !recipe.getTopOptional().isPresent() ) || ( Platform.itemComparisons().isSameItem( bot, recipe.getTopOptional().orElse( null ) ) ) && // and...
|
||||
( top == null && !recipe.getBottomOptional().isPresent() ) | ( Platform.itemComparisons().isSameItem( top, recipe.getBottomOptional().orElse( null ) ) );
|
||||
|
||||
if( matchA || matchB )
|
||||
{
|
||||
matches = true;
|
||||
for( final ItemStack option : recipe.getInputs() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( is, option ) )
|
||||
if( Platform.itemComparisons().isSameItem( is, option ) )
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
@@ -174,13 +174,13 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
|
||||
boolean isValid = false;
|
||||
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( recipe.getTopOptional().orElse( null ), otherSlot ) )
|
||||
if( Platform.itemComparisons().isSameItem( recipe.getTopOptional().orElse( null ), otherSlot ) )
|
||||
{
|
||||
isValid = Platform.isSameItemPrecise( is, recipe.getBottomOptional().orElse( null ) );
|
||||
isValid = Platform.itemComparisons().isSameItem( is, recipe.getBottomOptional().orElse( null ) );
|
||||
}
|
||||
else if( Platform.isSameItemPrecise( recipe.getBottomOptional().orElse( null ), otherSlot ) )
|
||||
else if( Platform.itemComparisons().isSameItem( recipe.getBottomOptional().orElse( null ), otherSlot ) )
|
||||
{
|
||||
isValid = Platform.isSameItemPrecise( is, recipe.getTopOptional().orElse( null ) );
|
||||
isValid = Platform.itemComparisons().isSameItem( is, recipe.getTopOptional().orElse( null ) );
|
||||
}
|
||||
|
||||
if( isValid )
|
||||
|
||||
@@ -186,15 +186,18 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
if( sideLocal != sideRemote )
|
||||
{
|
||||
this.clientCM.putSetting( set, sideLocal );
|
||||
for( final Object crafter : this.listeners )
|
||||
for( final IContainerListener crafter : this.listeners )
|
||||
{
|
||||
try
|
||||
if( crafter instanceof EntityPlayerMP )
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance.sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (EntityPlayerMP) crafter );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,6 +261,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void updatePowerStatus()
|
||||
@@ -340,7 +344,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removeListener( final IContainerListener c )
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable
|
||||
{
|
||||
if( currentItem != null )
|
||||
{
|
||||
if( Platform.isSameItem( this.civ.getItemStack(), currentItem ) )
|
||||
if( Platform.itemComparisons().isEqualItem( this.civ.getItemStack(), currentItem ) )
|
||||
{
|
||||
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.civ.getItemStack() );
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ContainerNetworkTool extends AEBaseContainer
|
||||
{
|
||||
if( currentItem != null )
|
||||
{
|
||||
if( Platform.isSameItem( this.toolInv.getItemStack(), currentItem ) )
|
||||
if( Platform.itemComparisons().isEqualItem( this.toolInv.getItemStack(), currentItem ) )
|
||||
{
|
||||
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.toolInv.getItemStack() );
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
if( output != null && !this.isPattern( output ) )
|
||||
{
|
||||
return;
|
||||
}// if nothing is there we should snag a new pattern.
|
||||
} // if nothing is there we should snag a new pattern.
|
||||
else if( output == null )
|
||||
{
|
||||
output = this.patternSlotIN.getStack();
|
||||
@@ -414,7 +414,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
|
||||
final IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj );
|
||||
|
||||
if( rr == r && Platform.isSameItemPrecise( rr.getCraftingResult( real ), is ) )
|
||||
if( rr == r && Platform.itemComparisons().isSameItem( rr.getCraftingResult( real ), is ) )
|
||||
{
|
||||
final SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 );
|
||||
sc.onPickupFromSlot( p, is );
|
||||
@@ -483,19 +483,19 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
{
|
||||
if( s == this.patternSlotOUT && Platform.isServer() )
|
||||
{
|
||||
for( final Object crafter : this.listeners )
|
||||
for( final IContainerListener listener : this.listeners )
|
||||
{
|
||||
final IContainerListener IContainerListener = (IContainerListener) crafter;
|
||||
|
||||
for( final Object g : this.inventorySlots )
|
||||
for( final Slot slot : this.inventorySlots )
|
||||
{
|
||||
if( g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix )
|
||||
if( slot instanceof OptionalSlotFake || slot instanceof SlotFakeCraftingMatrix )
|
||||
{
|
||||
final Slot sri = (Slot) g;
|
||||
IContainerListener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
|
||||
listener.sendSlotContents( this, slot.slotNumber, slot.getStack() );
|
||||
}
|
||||
}
|
||||
( (EntityPlayerMP) IContainerListener ).isChangingQuantityOnly = false;
|
||||
if( listener instanceof EntityPlayerMP )
|
||||
{
|
||||
( (EntityPlayerMP) listener ).isChangingQuantityOnly = false;
|
||||
}
|
||||
}
|
||||
this.detectAndSendChanges();
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
|
||||
{
|
||||
if( currentItem != null )
|
||||
{
|
||||
if( Platform.isSameItem( this.toolInv.getItemStack(), currentItem ) )
|
||||
if( Platform.itemComparisons().isEqualItem( this.toolInv.getItemStack(), currentItem ) )
|
||||
{
|
||||
this.getPlayerInv().setInventorySlotContents( this.getPlayerInv().currentItem, this.toolInv.getItemStack() );
|
||||
}
|
||||
|
||||
@@ -168,11 +168,10 @@ public class ContainerSecurityStation extends ContainerMEMonitorable implements
|
||||
this.wirelessOut.putStack( term );
|
||||
|
||||
// update the two slots in question...
|
||||
for( final Object crafter : this.listeners )
|
||||
for( final IContainerListener listener : this.listeners )
|
||||
{
|
||||
final IContainerListener IContainerListener = (IContainerListener) crafter;
|
||||
IContainerListener.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() );
|
||||
IContainerListener.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() );
|
||||
listener.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() );
|
||||
listener.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
|
||||
{
|
||||
if( currentItem != null )
|
||||
{
|
||||
if( Platform.isSameItem( this.tbInventory.getItemStack(), currentItem ) )
|
||||
if( Platform.itemComparisons().isEqualItem( this.tbInventory.getItemStack(), currentItem ) )
|
||||
{
|
||||
this.getPlayerInv().setInventorySlotContents( this.tbSlot, this.tbInventory.getItemStack() );
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
|
||||
// update crafting matrix...
|
||||
ItemStack is = this.getStack();
|
||||
|
||||
if( is != null && Platform.isSameItem( request, is ) )
|
||||
if( is != null && Platform.itemComparisons().isEqualItem( request, is ) )
|
||||
{
|
||||
final ItemStack[] set = new ItemStack[this.getPattern().getSizeInventory()];
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
|
||||
for( final ItemStack optional : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( optional, i ) )
|
||||
if( Platform.itemComparisons().isSameItem( optional, i ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -258,7 +258,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
|
||||
public static boolean isMetalIngot( final ItemStack i )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( i, new ItemStack( Items.IRON_INGOT ) ) )
|
||||
if( Platform.itemComparisons().isSameItem( i, new ItemStack( Items.IRON_INGOT ) ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
||||
{
|
||||
for( final ItemStack ingot : OreDictionary.getOres( "ingot" + name ) )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( i, ingot ) )
|
||||
if( Platform.itemComparisons().isSameItem( i, ingot ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
@@ -88,6 +88,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
public boolean enableEffects = true;
|
||||
public boolean useLargeFonts = false;
|
||||
public boolean useColoredCraftingStatus;
|
||||
public boolean removeCrashingItemsOnLoad = false;
|
||||
public int wirelessTerminalBattery = 1600000;
|
||||
public int entropyManipulatorBattery = 200000;
|
||||
public int matterCannonBattery = 200000;
|
||||
@@ -113,7 +114,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
super( configFile );
|
||||
this.configFile = configFile;
|
||||
|
||||
FMLCommonHandler.instance().bus().register( this );
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
|
||||
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
|
||||
@@ -126,6 +127,8 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
CondenserOutput.MATTER_BALLS.requiredPower = this.get( "Condenser", "MatterBalls", 256 ).getInt( 256 );
|
||||
CondenserOutput.SINGULARITY.requiredPower = this.get( "Condenser", "Singularity", 256000 ).getInt( 256000 );
|
||||
|
||||
this.removeCrashingItemsOnLoad = this.get( "general", "removeCrashingItemsOnLoad", false, "Will auto-remove items that crash when being loaded from storage. This will destroy those items instead of crashing the game!" ).getBoolean();
|
||||
|
||||
this.grinderOres = this.get( "GrindStone", "grinderOres", this.grinderOres ).getStringList();
|
||||
this.oreDoublePercentage = this.get( "GrindStone", "oreDoublePercentage", this.oreDoublePercentage ).getDouble( this.oreDoublePercentage );
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.core;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
@@ -197,10 +196,17 @@ public final class AppEng
|
||||
|
||||
if( this.exportConfig.isExportingItemNamesEnabled() )
|
||||
{
|
||||
final ExportProcess process = new ExportProcess( this.recipeDirectory, this.exportConfig );
|
||||
final Thread exportProcessThread = new Thread( process );
|
||||
if( FMLCommonHandler.instance().getSide().isClient() )
|
||||
{
|
||||
final ExportProcess process = new ExportProcess( this.recipeDirectory, this.exportConfig );
|
||||
final Thread exportProcessThread = new Thread( process );
|
||||
|
||||
this.startService( "AE2 CSV Export", exportProcessThread );
|
||||
this.startService( "AE2 CSV Export", exportProcessThread );
|
||||
}
|
||||
else
|
||||
{
|
||||
AELog.info( "Disabling item.csv export for custom recipes, since creative tab information is only available on the client." );
|
||||
}
|
||||
}
|
||||
|
||||
this.registration.initialize( event, this.recipeDirectory, this.customRecipeConfig );
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.core;
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
@@ -30,7 +29,6 @@ import com.google.common.base.Preconditions;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
@@ -65,6 +63,7 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.core.stats.PlayerStatsRegistration;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.integration.Integrations;
|
||||
import appeng.items.materials.ItemMaterial;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
import appeng.loot.ChestLoot;
|
||||
@@ -86,7 +85,6 @@ import appeng.recipes.game.ShapedRecipe;
|
||||
import appeng.recipes.game.ShapelessRecipe;
|
||||
import appeng.recipes.handlers.Crusher;
|
||||
import appeng.recipes.handlers.Grind;
|
||||
import appeng.recipes.handlers.GrindFZ;
|
||||
import appeng.recipes.handlers.HCCrusher;
|
||||
import appeng.recipes.handlers.Inscribe;
|
||||
import appeng.recipes.handlers.Macerator;
|
||||
@@ -216,7 +214,6 @@ public final class Registration
|
||||
registry.addNewCraftHandler( "mekechamber", MekEnrichment.class );
|
||||
registry.addNewCraftHandler( "grind", Grind.class );
|
||||
registry.addNewCraftHandler( "crusher", Crusher.class );
|
||||
registry.addNewCraftHandler( "grindfz", GrindFZ.class );
|
||||
registry.addNewCraftHandler( "pulverizer", Pulverizer.class );
|
||||
registry.addNewCraftHandler( "macerator", Macerator.class );
|
||||
|
||||
@@ -248,13 +245,11 @@ public final class Registration
|
||||
final Runnable recipeLoader = new RecipeLoader( recipeDirectory, customRecipeConfig, this.recipeHandler );
|
||||
recipeLoader.run();
|
||||
|
||||
// TODO readd layers
|
||||
|
||||
// if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.IC2 ) )
|
||||
// {
|
||||
// partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" );
|
||||
// partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
|
||||
// }
|
||||
if( Integrations.ic2().isEnabled() )
|
||||
{
|
||||
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" );
|
||||
partHelper.registerNewLayer( "appeng.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
|
||||
}
|
||||
//
|
||||
// if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.RF ) )
|
||||
// {
|
||||
@@ -267,7 +262,6 @@ public final class Registration
|
||||
// "li.cil.oc.api.network.SidedEnvironment" );
|
||||
// }
|
||||
|
||||
FMLCommonHandler.instance().bus().register( TickHandler.INSTANCE );
|
||||
MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE );
|
||||
|
||||
|
||||
@@ -300,7 +294,7 @@ public final class Registration
|
||||
|
||||
this.recipeHandler.injectRecipes();
|
||||
|
||||
final PlayerStatsRegistration registration = new PlayerStatsRegistration( FMLCommonHandler.instance().bus(), AEConfig.instance );
|
||||
final PlayerStatsRegistration registration = new PlayerStatsRegistration( MinecraftForge.EVENT_BUS, AEConfig.instance );
|
||||
registration.registerAchievementHandlers();
|
||||
registration.registerAchievements();
|
||||
|
||||
@@ -337,8 +331,6 @@ public final class Registration
|
||||
PlayerMessages.values();
|
||||
GuiText.values();
|
||||
|
||||
Api.INSTANCE.partHelper().initFMPSupport();
|
||||
|
||||
definitions.getRegistry().getBootstrapComponents().forEach( b -> b.postInitialize( event.getSide() ) );
|
||||
|
||||
// Interface
|
||||
|
||||
@@ -28,7 +28,10 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
@@ -53,9 +56,6 @@ import appeng.api.parts.IPartHelper;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
import appeng.parts.PartPlacement;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
@@ -64,80 +64,91 @@ import appeng.tile.networking.TileCableBus;
|
||||
public class ApiPart implements IPartHelper
|
||||
{
|
||||
|
||||
private final Map<String, Class<? extends AEBaseTile>> tileImplementations = new HashMap<>();
|
||||
private final Map<Class<?>, String> interfaces2Layer = new HashMap<Class<?>, String>();
|
||||
private final Map<String, Class> roots = new HashMap<String, Class>();
|
||||
private final LoadingCache<CacheKey, Class<? extends AEBaseTile>> cache = CacheBuilder.newBuilder().build( new CacheLoader<CacheKey, Class<? extends AEBaseTile>>()
|
||||
{
|
||||
@Override
|
||||
public Class<? extends AEBaseTile> load( CacheKey key ) throws Exception
|
||||
{
|
||||
return generateCombinedClass( key );
|
||||
}
|
||||
} );
|
||||
|
||||
private final Map<Class<?>, String> interfaces2Layer = new HashMap<>();
|
||||
private final List<String> desc = new LinkedList<String>();
|
||||
|
||||
public void initFMPSupport()
|
||||
{
|
||||
for( final Class layerInterface : this.interfaces2Layer.keySet() )
|
||||
{
|
||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
{
|
||||
( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).registerPassThrough( layerInterface );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Conceptually this method will build a new class hierarchy that is rooted at the given base class, and includes a chain of all registered layers.
|
||||
* <p/>
|
||||
* To accomplish this, it takes the first registered layer, replaces it's inheritance from LayerBase with an inheritance from the given baseClass,
|
||||
* and uses the resulting class as the parent class for the next registered layer, for which it repeats this process. This process is then repeated
|
||||
* until a class hierarchy of all layers is formed. While janking out the inheritance from LayerBase, it'll make also sure that calls to that
|
||||
* classes method will instead be forwarded to the superclass that was inserted as part of the described process.
|
||||
* <p/>
|
||||
* Example: If layers A and B are registered, and TileCableBus is passed in as the baseClass, a synthetic class A_B_TileCableBus should be returned,
|
||||
* which has A_B_TileCableBus -extends-> B_TileCableBus -extends-> TileCableBus as it's class hierarchy, where A_B_TileCableBus has been generated
|
||||
* from A, and B_TileCableBus has been generated from B.
|
||||
*/
|
||||
public Class<? extends AEBaseTile> getCombinedInstance( final Class<? extends AEBaseTile> baseClass )
|
||||
{
|
||||
String base = baseClass.getName();
|
||||
|
||||
if( this.desc.isEmpty() )
|
||||
{
|
||||
// No layers registered...
|
||||
return baseClass;
|
||||
}
|
||||
|
||||
final String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() );
|
||||
|
||||
if( this.tileImplementations.get( description ) != null )
|
||||
{
|
||||
return this.tileImplementations.get( description );
|
||||
}
|
||||
|
||||
String f = base;// TileCableBus.class.getName();
|
||||
String Addendum = baseClass.getSimpleName();
|
||||
Class<? extends AEBaseTile> myClass = baseClass;
|
||||
|
||||
String path = f;
|
||||
|
||||
for( final String name : this.desc )
|
||||
{
|
||||
try
|
||||
{
|
||||
final String newPath = path + ';' + name;
|
||||
myClass = this.getClassByDesc( baseClass.getSimpleName(), newPath, f, this.interfaces2Layer.get( Class.forName( name ) ) );
|
||||
path = newPath;
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
AELog.warn( "Error loading " + name );
|
||||
AELog.debug( t );
|
||||
}
|
||||
f = myClass.getName();
|
||||
}
|
||||
|
||||
this.tileImplementations.put( description, myClass );
|
||||
|
||||
return myClass;
|
||||
return cache.getUnchecked( new CacheKey( baseClass, this.desc ) );
|
||||
}
|
||||
|
||||
private Class getClassByDesc( final String addendum, final String fullPath, final String root, final String next )
|
||||
private Class<? extends AEBaseTile> generateCombinedClass( CacheKey cacheKey )
|
||||
{
|
||||
if( this.roots.get( fullPath ) != null )
|
||||
final Class<? extends AEBaseTile> parentClass;
|
||||
|
||||
// Get the list of interfaces that still need to be implemented beyond the current one
|
||||
List<String> remainingInterfaces = cacheKey.getInterfaces().subList( 1, cacheKey.getInterfaces().size() );
|
||||
|
||||
// We are not at the root of the class hierarchy yet
|
||||
if( !remainingInterfaces.isEmpty() )
|
||||
{
|
||||
return this.roots.get( fullPath );
|
||||
CacheKey parentKey = new CacheKey( cacheKey.getBaseClass(), remainingInterfaces );
|
||||
parentClass = cache.getUnchecked( parentKey );
|
||||
}
|
||||
else
|
||||
{
|
||||
parentClass = cacheKey.getBaseClass();
|
||||
}
|
||||
|
||||
// Which interface should be implemented in this layer?
|
||||
String interfaceName = cacheKey.getInterfaces().get( 0 );
|
||||
|
||||
try
|
||||
{
|
||||
// This is the particular interface that this layer was registered for. Loading the class may fail if i.e. an API is broken or not present
|
||||
// and in this case, the layer will be skipped!
|
||||
Class<?> interfaceClass = Class.forName( interfaceName );
|
||||
String layerImpl = this.interfaces2Layer.get( interfaceClass );
|
||||
|
||||
return this.getClassByDesc( parentClass, layerImpl );
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
AELog.warn( "Error loading " + interfaceName );
|
||||
AELog.debug( t );
|
||||
return parentClass;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
private Class<? extends AEBaseTile> getClassByDesc( Class<? extends AEBaseTile> baseClass, final String next )
|
||||
{
|
||||
final ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS );
|
||||
final ClassNode n = this.getReader( next );
|
||||
final String originalName = n.name;
|
||||
|
||||
try
|
||||
{
|
||||
n.name = n.name + '_' + addendum;
|
||||
n.superName = Class.forName( root ).getName().replace( ".", "/" );
|
||||
n.name = n.name + '_' + baseClass.getSimpleName();
|
||||
n.superName = baseClass.getName().replace( '.', '/' );
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
@@ -167,14 +178,13 @@ public class ApiPart implements IPartHelper
|
||||
try
|
||||
{
|
||||
final Object fish = clazz.newInstance();
|
||||
final Class rootC = Class.forName( root );
|
||||
|
||||
boolean hasError = false;
|
||||
|
||||
if( !rootC.isInstance( fish ) )
|
||||
if( !baseClass.isInstance( fish ) )
|
||||
{
|
||||
hasError = true;
|
||||
AELog.error( "Error, Expected layer to implement " + root + " did not." );
|
||||
AELog.error( "Error, Expected layer to implement " + baseClass + " did not." );
|
||||
}
|
||||
|
||||
if( fish instanceof LayerBase )
|
||||
@@ -183,19 +193,16 @@ public class ApiPart implements IPartHelper
|
||||
AELog.error( "Error, Expected layer to NOT implement LayerBase but it DID." );
|
||||
}
|
||||
|
||||
if( !fullPath.contains( ".fmp." ) )
|
||||
if( !( fish instanceof TileCableBus ) )
|
||||
{
|
||||
if( !( fish instanceof TileCableBus ) )
|
||||
{
|
||||
hasError = true;
|
||||
AELog.error( "Error, Expected layer to implement TileCableBus did not." );
|
||||
}
|
||||
hasError = true;
|
||||
AELog.error( "Error, Expected layer to implement TileCableBus did not." );
|
||||
}
|
||||
|
||||
if( !( fish instanceof TileEntity ) )
|
||||
{
|
||||
hasError = true;
|
||||
AELog.error( "Error, Expected layer to implement TileEntity did not." );
|
||||
}
|
||||
if( !( fish instanceof TileEntity ) )
|
||||
{
|
||||
hasError = true;
|
||||
AELog.error( "Error, Expected layer to implement TileEntity did not." );
|
||||
}
|
||||
|
||||
if( !hasError )
|
||||
@@ -209,7 +216,6 @@ public class ApiPart implements IPartHelper
|
||||
AELog.debug( t );
|
||||
}
|
||||
|
||||
this.roots.put( fullPath, clazz );
|
||||
return clazz;
|
||||
}
|
||||
|
||||
@@ -260,10 +266,19 @@ public class ApiPart implements IPartHelper
|
||||
defineClassMethod.setAccessible( true );
|
||||
try
|
||||
{
|
||||
final Object[] argsA = { name, name, b };
|
||||
final Object[] argsA = {
|
||||
name,
|
||||
name,
|
||||
b
|
||||
};
|
||||
b = (byte[]) runTransformersMethod.invoke( loader, argsA );
|
||||
|
||||
final Object[] args = { name, b, 0, b.length };
|
||||
final Object[] args = {
|
||||
name,
|
||||
b,
|
||||
0,
|
||||
b.length
|
||||
};
|
||||
clazz = (Class) defineClassMethod.invoke( loader, args );
|
||||
}
|
||||
finally
|
||||
@@ -319,7 +334,7 @@ public class ApiPart implements IPartHelper
|
||||
private static class DefaultPackageClassNameRemapper extends Remapper
|
||||
{
|
||||
|
||||
private final HashMap<String, String> inputOutput = new HashMap<String, String>();
|
||||
private final HashMap<String, String> inputOutput = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public String map( final String typeName )
|
||||
@@ -332,4 +347,53 @@ public class ApiPart implements IPartHelper
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class CacheKey
|
||||
{
|
||||
private final Class<? extends AEBaseTile> baseClass;
|
||||
|
||||
private final List<String> interfaces;
|
||||
|
||||
private CacheKey( Class<? extends AEBaseTile> baseClass, List<String> interfaces )
|
||||
{
|
||||
this.baseClass = baseClass;
|
||||
this.interfaces = ImmutableList.copyOf( interfaces );
|
||||
}
|
||||
|
||||
private Class<? extends AEBaseTile> getBaseClass()
|
||||
{
|
||||
return baseClass;
|
||||
}
|
||||
|
||||
private List<String> getInterfaces()
|
||||
{
|
||||
return interfaces;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object o )
|
||||
{
|
||||
if( this == o )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if( o == null || getClass() != o.getClass() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CacheKey cacheKey = (CacheKey) o;
|
||||
|
||||
return baseClass.equals( cacheKey.baseClass ) && interfaces.equals( cacheKey.interfaces );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int result = baseClass.hashCode();
|
||||
result = 31 * result + interfaces.hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class ApiParts implements IParts
|
||||
private final IItemDefinition p2PTunnelRedstone;
|
||||
private final IItemDefinition p2PTunnelItems;
|
||||
private final IItemDefinition p2PTunnelLiquids;
|
||||
// private final IItemDefinition p2PTunnelEU;
|
||||
private final IItemDefinition p2PTunnelEU;
|
||||
// private final IItemDefinition p2PTunnelRF;
|
||||
private final IItemDefinition p2PTunnelLight;
|
||||
// private final IItemDefinition p2PTunnelOpenComputers;
|
||||
@@ -113,7 +113,7 @@ public final class ApiParts implements IParts
|
||||
this.p2PTunnelRedstone = new DamagedItemDefinition( "part.tunnel.redstone", itemPart.createPart( PartType.P2PTunnelRedstone ) );
|
||||
this.p2PTunnelItems = new DamagedItemDefinition( "part.tunnel.item", itemPart.createPart( PartType.P2PTunnelItems ) );
|
||||
this.p2PTunnelLiquids = new DamagedItemDefinition( "part.tunnel.fluid", itemPart.createPart( PartType.P2PTunnelLiquids ) );
|
||||
// this.p2PTunnelEU = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelEU ) );
|
||||
this.p2PTunnelEU = new DamagedItemDefinition( "part.tunnel.eu", itemPart.createPart( PartType.P2PTunnelEU ) );
|
||||
// this.p2PTunnelRF = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRF ) );
|
||||
this.p2PTunnelLight = new DamagedItemDefinition( "part.tunnel.light", itemPart.createPart( PartType.P2PTunnelLight ) );
|
||||
// this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart(
|
||||
@@ -286,13 +286,13 @@ public final class ApiParts implements IParts
|
||||
return this.p2PTunnelLiquids;
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override
|
||||
* public IItemDefinition p2PTunnelEU()
|
||||
* {
|
||||
* return this.p2PTunnelEU;
|
||||
* }
|
||||
* @Override
|
||||
@Override
|
||||
public IItemDefinition p2PTunnelEU()
|
||||
{
|
||||
return this.p2PTunnelEU;
|
||||
}
|
||||
|
||||
/* @Override
|
||||
* public IItemDefinition p2PTunnelRF()
|
||||
* {
|
||||
* return this.p2PTunnelRF;
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ItemDefinition implements IItemDefinition
|
||||
@Override
|
||||
public final boolean isSameAs( final ItemStack comparableStack )
|
||||
{
|
||||
return isEnabled() && Platform.isSameItemType( comparableStack, this.maybeStack( 1 ).get() );
|
||||
return isEnabled() && Platform.itemComparisons().isEqualItemType( comparableStack, this.maybeStack( 1 ).get() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
{
|
||||
for( final IGrinderEntry gr : this.recipes )
|
||||
{
|
||||
if( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
if( Platform.itemComparisons().isSameItem( gr.getInput(), appEngGrinderRecipe.getInput() ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
{
|
||||
for( final IGrinderEntry r : this.recipes )
|
||||
{
|
||||
if( Platform.isSameItem( input, r.getInput() ) )
|
||||
if( Platform.itemComparisons().isEqualItem( input, r.getInput() ) )
|
||||
{
|
||||
this.log( "Recipe for " + input.getUnlocalizedName() + " found " + Platform.getItemDisplayName( r.getOutput() ) );
|
||||
return r;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
|
||||
{
|
||||
for( final ItemStack o : this.DamageModifiers.keySet() )
|
||||
{
|
||||
if( Platform.isSameItem( o, is ) )
|
||||
if( Platform.itemComparisons().isEqualItem( o, is ) )
|
||||
{
|
||||
return this.DamageModifiers.get( o ).floatValue();
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
return this.tunnels.get( is );
|
||||
}
|
||||
|
||||
if( Platform.isSameItem( is, trigger ) )
|
||||
if( Platform.itemComparisons().isEqualItem( is, trigger ) )
|
||||
{
|
||||
return this.tunnels.get( is );
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ public enum WailaText
|
||||
|
||||
DeviceOnline, DeviceOffline, DeviceMissingChannel,
|
||||
|
||||
P2PUnlinked, P2PInputOneOutput, P2PInputManyOutputs, P2POutput,
|
||||
|
||||
Locked, Unlocked, Showing,
|
||||
|
||||
Contains, Channels;
|
||||
|
||||
@@ -37,6 +37,8 @@ public enum TickRates
|
||||
|
||||
Inscriber( 1, 1 ),
|
||||
|
||||
Charger( 10, 120 ),
|
||||
|
||||
IOPort( 1, 5 ),
|
||||
|
||||
VibrationChamber( 10, 40 ),
|
||||
|
||||
@@ -54,7 +54,7 @@ public class AchievementCraftingHandler
|
||||
switch( achievement.getType() )
|
||||
{
|
||||
case Craft:
|
||||
if( Platform.isSameItemPrecise( achievement.getStack(), event.crafting ) )
|
||||
if( Platform.itemComparisons().isSameItem( achievement.getStack(), event.crafting ) )
|
||||
{
|
||||
achievement.addToPlayer( event.player );
|
||||
return;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class AchievementPickupHandler
|
||||
|
||||
for( final Achievements achievement : Achievements.values() )
|
||||
{
|
||||
if( achievement.getType() == AchievementType.Pickup && Platform.isSameItemPrecise( achievement.getStack(), is ) )
|
||||
if( achievement.getType() == AchievementType.Pickup && Platform.itemComparisons().isSameItem( achievement.getStack(), is ) )
|
||||
{
|
||||
achievement.addToPlayer( event.player );
|
||||
return;
|
||||
|
||||
@@ -38,7 +38,6 @@ import appeng.core.sync.packets.PacketLightning;
|
||||
import appeng.core.sync.packets.PacketMEInventoryUpdate;
|
||||
import appeng.core.sync.packets.PacketMatterCannon;
|
||||
import appeng.core.sync.packets.PacketMockExplosion;
|
||||
import appeng.core.sync.packets.PacketMultiPart;
|
||||
import appeng.core.sync.packets.PacketJEIRecipe;
|
||||
import appeng.core.sync.packets.PacketNewStorageDimension;
|
||||
import appeng.core.sync.packets.PacketPaintedEntity;
|
||||
@@ -68,8 +67,6 @@ public class AppEngPacketHandlerBase
|
||||
|
||||
PACKET_CONFIG_BUTTON( PacketConfigButton.class ),
|
||||
|
||||
PACKET_MULTIPART( PacketMultiPart.class ),
|
||||
|
||||
PACKET_PART_PLACEMENT( PacketPartPlacement.class ),
|
||||
|
||||
PACKET_LIGHTNING( PacketLightning.class ),
|
||||
|
||||
@@ -59,7 +59,7 @@ import appeng.items.storage.ItemViewCell;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import appeng.util.prioitylist.IPartitionList;
|
||||
import appeng.util.prioritylist.IPartitionList;
|
||||
|
||||
|
||||
public class PacketJEIRecipe extends AppEngPacket
|
||||
@@ -167,7 +167,7 @@ public class PacketJEIRecipe extends AppEngPacket
|
||||
final ItemStack newItemStack = r.matches( testInv, pmp.worldObj ) ? r.getCraftingResult( testInv ) : null;
|
||||
testInv.setInventorySlotContents( x, patternItem );
|
||||
|
||||
if( newItemStack == null || !Platform.isSameItemPrecise( newItemStack, is ) )
|
||||
if( newItemStack == null || !Platform.itemComparisons().isSameItem( newItemStack, is ) )
|
||||
{
|
||||
final IAEItemStack in = AEItemStack.create( currentItem );
|
||||
if( in != null )
|
||||
|
||||
@@ -1,64 +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.core.sync.packets;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IFMP;
|
||||
|
||||
|
||||
public class PacketMultiPart extends AppEngPacket
|
||||
{
|
||||
|
||||
// automatic.
|
||||
public PacketMultiPart( final ByteBuf stream )
|
||||
{
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketMultiPart()
|
||||
{
|
||||
final ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( this.getPacketID() );
|
||||
|
||||
this.configureWrite( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
|
||||
{
|
||||
final IFMP fmp = (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP );
|
||||
if( fmp != null )
|
||||
{
|
||||
final EntityPlayerMP sender = (EntityPlayerMP) player;
|
||||
MinecraftForge.EVENT_BUS.post( fmp.newFMPPacketEvent( sender ) ); // when received it just posts this event.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,8 +34,6 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -45,8 +43,8 @@ public class TileChunkLoader extends AEBaseTile implements ITickable
|
||||
private boolean requestTicket = true;
|
||||
private Ticket ct = null;
|
||||
|
||||
@TileEvent( TileEventType.TICK )
|
||||
public void onTickEvent()
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
if( this.requestTicket )
|
||||
{
|
||||
|
||||
@@ -30,8 +30,6 @@ import net.minecraft.util.text.TextComponentString;
|
||||
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.TileEvent;
|
||||
import appeng.tile.events.TileEventType;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -43,8 +41,8 @@ public class TileCubeGenerator extends AEBaseTile implements ITickable
|
||||
private int countdown = 20 * 10;
|
||||
private EntityPlayer who = null;
|
||||
|
||||
@TileEvent( TileEventType.TICK )
|
||||
public void onTickEvent()
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
if( this.is != null && Platform.isServer() )
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
|
||||
this.delay++;
|
||||
|
||||
final int j = MathHelper.floor_double( this.posX );
|
||||
final int i = MathHelper.floor_double( this.posY );
|
||||
final int i = MathHelper.floor_double( (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D );
|
||||
final int k = MathHelper.floor_double( this.posZ );
|
||||
|
||||
IBlockState state = this.worldObj.getBlockState( new BlockPos( j, i, k ) );
|
||||
@@ -119,12 +119,12 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
|
||||
final ItemStack other = ( (EntityItem) e ).getEntityItem();
|
||||
if( other != null && other.stackSize > 0 )
|
||||
{
|
||||
if( Platform.isSameItem( other, new ItemStack( Items.REDSTONE ) ) )
|
||||
if( Platform.itemComparisons().isEqualItem( other, new ItemStack( Items.REDSTONE ) ) )
|
||||
{
|
||||
redstone = (EntityItem) e;
|
||||
}
|
||||
|
||||
if( Platform.isSameItem( other, new ItemStack( Items.QUARTZ ) ) )
|
||||
if( Platform.itemComparisons().isEqualItem( other, new ItemStack( Items.QUARTZ ) ) )
|
||||
{
|
||||
netherQuartz = (EntityItem) e;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public final class EntityGrowingCrystal extends EntityItem
|
||||
if( gc instanceof IGrowableCrystal ) // if it changes this just stops being an issue...
|
||||
{
|
||||
final int j = MathHelper.floor_double( this.posX );
|
||||
final int i = MathHelper.floor_double( this.posY );
|
||||
final int i = MathHelper.floor_double( (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D );
|
||||
final int k = MathHelper.floor_double( this.posZ );
|
||||
|
||||
final IBlockState state = this.worldObj.getBlockState( new BlockPos( j, i, k ) );
|
||||
|
||||
@@ -24,8 +24,6 @@ import java.util.Optional;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -35,9 +33,6 @@ import appeng.api.parts.IFacadeContainer;
|
||||
import appeng.api.parts.IFacadePart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.IBuildCraftTransport;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
import appeng.parts.CableBusStorage;
|
||||
|
||||
@@ -136,29 +131,16 @@ public class FacadeContainer implements IFacadeContainer
|
||||
{
|
||||
ids[0] = out.readInt();
|
||||
ids[1] = out.readInt();
|
||||
final boolean isBC = ids[0] < 0;
|
||||
ids[0] = Math.abs( ids[0] );
|
||||
|
||||
if( isBC && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
final IBlockState state = Block.getStateById( ids[0] );
|
||||
final IFacadePart created = bc.createFacadePart( state, side );
|
||||
changed = changed || this.storage.getFacade( x ) == null;
|
||||
|
||||
this.storage.setFacade( x, created );
|
||||
}
|
||||
else if( !isBC )
|
||||
{
|
||||
Optional<Item> maybeFacadeItem = AEApi.instance().definitions().items().facade().maybeItem();
|
||||
if (maybeFacadeItem.isPresent()) {
|
||||
final ItemFacade ifa = (ItemFacade) maybeFacadeItem.get();
|
||||
final ItemStack facade = ifa.createFromIDs( ids );
|
||||
if( facade != null )
|
||||
{
|
||||
changed = changed || this.storage.getFacade( x ) == null;
|
||||
this.storage.setFacade( x, ifa.createPartFromItemStack( facade, side ) );
|
||||
}
|
||||
Optional<Item> maybeFacadeItem = AEApi.instance().definitions().items().facade().maybeItem();
|
||||
if (maybeFacadeItem.isPresent()) {
|
||||
final ItemFacade ifa = (ItemFacade) maybeFacadeItem.get();
|
||||
final ItemStack facade = ifa.createFromIDs( ids );
|
||||
if( facade != null )
|
||||
{
|
||||
changed = changed || this.storage.getFacade( x ) == null;
|
||||
this.storage.setFacade( x, ifa.createPartFromItemStack( facade, side ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,17 +172,6 @@ public class FacadeContainer implements IFacadeContainer
|
||||
{
|
||||
this.storage.setFacade( x, ( (IFacadeItem) i ).createPartFromItemStack( is, AEPartLocation.fromOrdinal( x ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
final IBuildCraftTransport bc = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
if( bc.isFacade( is ) )
|
||||
{
|
||||
this.storage.setFacade( x, bc.createFacadePart( is, AEPartLocation.fromOrdinal( x ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,11 @@ package appeng.facade;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -121,10 +120,7 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
return true;
|
||||
}
|
||||
|
||||
final ItemStack is = this.getTextureItem();
|
||||
final Block blk = Block.getBlockFromItem( is.getItem() );
|
||||
|
||||
return !blk.isOpaqueCube( blk.getDefaultState() );
|
||||
return this.getBlockState().isOpaqueCube();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -147,25 +143,17 @@ public class FacadePart implements IFacadePart, IBoxProvider
|
||||
@Override
|
||||
public IBlockState getBlockState()
|
||||
{
|
||||
ItemStack itemStack = getTextureItem();
|
||||
final Item maybeFacade = this.facade.getItem();
|
||||
|
||||
if( !(itemStack.getItem() instanceof ItemBlock ) )
|
||||
// AE Facade
|
||||
if( maybeFacade instanceof IFacadeItem )
|
||||
{
|
||||
return null;
|
||||
final IFacadeItem facade = (IFacadeItem) maybeFacade;
|
||||
|
||||
return facade.getTextureBlockState( this.facade );
|
||||
}
|
||||
|
||||
ItemBlock itemBlock = (ItemBlock) itemStack.getItem();
|
||||
|
||||
// Try to get the block state based on the item stack's meta. If this fails, don't consider it for a facade
|
||||
// This for example fails for Pistons because they hardcoded an invalid meta value in vanilla
|
||||
try
|
||||
{
|
||||
return itemBlock.getBlock().getStateFromMeta( itemStack.getItemDamage() );
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return Blocks.GLASS.getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.facade;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
@@ -32,7 +32,6 @@ public interface IFacadeItem
|
||||
|
||||
ItemStack getTextureItem( ItemStack is );
|
||||
|
||||
int getMeta( ItemStack is );
|
||||
IBlockState getTextureBlockState( ItemStack is );
|
||||
|
||||
Block getBlock( ItemStack is );
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
{
|
||||
final ItemStack testOutput = this.standardRecipe.getCraftingResult( this.testFrame );
|
||||
|
||||
if( Platform.isSameItemPrecise( this.correctOutput, testOutput ) )
|
||||
if( Platform.itemComparisons().isSameItem( this.correctOutput, testOutput ) )
|
||||
{
|
||||
this.testFrame.setInventorySlotContents( slotIndex, this.crafting.getStackInSlot( slotIndex ) );
|
||||
this.markItemAs( slotIndex, i, TestStatus.ACCEPT );
|
||||
@@ -256,7 +256,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
{
|
||||
final ItemStack testOutput = CraftingManager.getInstance().findMatchingRecipe( this.testFrame, w );
|
||||
|
||||
if( Platform.isSameItemPrecise( this.correctOutput, testOutput ) )
|
||||
if( Platform.itemComparisons().isSameItem( this.correctOutput, testOutput ) )
|
||||
{
|
||||
this.testFrame.setInventorySlotContents( slotIndex, this.crafting.getStackInSlot( slotIndex ) );
|
||||
this.markItemAs( slotIndex, i, TestStatus.ACCEPT );
|
||||
|
||||
@@ -21,7 +21,26 @@ package appeng.integration;
|
||||
|
||||
public interface IIntegrationModule
|
||||
{
|
||||
void init() throws Throwable;
|
||||
|
||||
void postInit();
|
||||
default boolean isEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
default void init() throws Throwable
|
||||
{
|
||||
}
|
||||
|
||||
default void postInit()
|
||||
{
|
||||
}
|
||||
|
||||
class Stub implements IIntegrationModule
|
||||
{
|
||||
@Override
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,42 +19,38 @@
|
||||
package appeng.integration;
|
||||
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.ModAPIManager;
|
||||
|
||||
import appeng.api.exceptions.ModNotInstalled;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.integration.modules.ic2.IC2Module;
|
||||
import appeng.integration.modules.jei.JEIModule;
|
||||
import appeng.integration.modules.waila.WailaModule;
|
||||
|
||||
|
||||
public final class IntegrationNode
|
||||
final class IntegrationNode
|
||||
{
|
||||
|
||||
private final String displayName;
|
||||
private final String modID;
|
||||
private final IntegrationType shortName;
|
||||
private final IntegrationType type;
|
||||
private IntegrationStage state = IntegrationStage.PRE_INIT;
|
||||
private IntegrationStage failedStage = IntegrationStage.PRE_INIT;
|
||||
private Throwable exception = null;
|
||||
private String name = null;
|
||||
private Class<?> classValue = null;
|
||||
private Object instance;
|
||||
private IIntegrationModule mod = null;
|
||||
|
||||
public IntegrationNode( final String displayName, final String modID, final IntegrationType shortName, final String name )
|
||||
IntegrationNode( final String displayName, final String modID, final IntegrationType type )
|
||||
{
|
||||
this.displayName = displayName;
|
||||
this.shortName = shortName;
|
||||
this.type = type;
|
||||
this.modID = modID;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return this.getShortName().name() + ':' + this.getState().name();
|
||||
return this.getType().name() + ':' + this.getState().name();
|
||||
}
|
||||
|
||||
boolean isActive()
|
||||
@@ -98,10 +94,18 @@ public final class IntegrationNode
|
||||
|
||||
if( enabled )
|
||||
{
|
||||
this.classValue = this.getClass().getClassLoader().loadClass( this.name );
|
||||
this.mod = (IIntegrationModule) this.classValue.getConstructor().newInstance();
|
||||
final Field f = this.classValue.getField( "instance" );
|
||||
f.set( this.classValue, this.setInstance( this.mod ) );
|
||||
switch( type )
|
||||
{
|
||||
case IC2:
|
||||
this.mod = Integrations.setIc2( new IC2Module() );
|
||||
break;
|
||||
case JEI:
|
||||
this.mod = Integrations.setJei( new JEIModule() );
|
||||
break;
|
||||
case Waila:
|
||||
this.mod = new WailaModule();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -128,7 +132,6 @@ public final class IntegrationNode
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
this.failedStage = stage;
|
||||
this.exception = t;
|
||||
this.setState( IntegrationStage.FAILED );
|
||||
}
|
||||
@@ -151,20 +154,9 @@ public final class IntegrationNode
|
||||
}
|
||||
}
|
||||
|
||||
Object getInstance()
|
||||
IntegrationType getType()
|
||||
{
|
||||
return this.instance;
|
||||
}
|
||||
|
||||
private Object setInstance( final Object instance )
|
||||
{
|
||||
this.instance = instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
IntegrationType getShortName()
|
||||
{
|
||||
return this.shortName;
|
||||
return this.type;
|
||||
}
|
||||
|
||||
IntegrationStage getState()
|
||||
|
||||
@@ -22,8 +22,6 @@ package appeng.integration;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.FMLLaunchHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -32,8 +30,6 @@ public enum IntegrationRegistry
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
private static final String PACKAGE_PREFIX = "appeng.integration.modules.";
|
||||
|
||||
private final Collection<IntegrationNode> modules = new LinkedList<IntegrationNode>();
|
||||
|
||||
public void add( final IntegrationType type )
|
||||
@@ -48,7 +44,7 @@ public enum IntegrationRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
this.modules.add( new IntegrationNode( type.dspName, type.modID, type, PACKAGE_PREFIX + type.name() ) );
|
||||
this.modules.add( new IntegrationNode( type.dspName, type.modID, type ) );
|
||||
}
|
||||
|
||||
public void init()
|
||||
@@ -83,7 +79,7 @@ public enum IntegrationRegistry
|
||||
builder.append( ", " );
|
||||
}
|
||||
|
||||
final String integrationState = node.getShortName() + ":" + ( node.getState() == IntegrationStage.FAILED ? "OFF" : "ON" );
|
||||
final String integrationState = node.getType() + ":" + ( node.getState() == IntegrationStage.FAILED ? "OFF" : "ON" );
|
||||
builder.append( integrationState );
|
||||
}
|
||||
|
||||
@@ -94,7 +90,7 @@ public enum IntegrationRegistry
|
||||
{
|
||||
for( final IntegrationNode node : this.modules )
|
||||
{
|
||||
if( node.getShortName() == name )
|
||||
if( node.getType() == name )
|
||||
{
|
||||
return node.isActive();
|
||||
}
|
||||
@@ -102,18 +98,4 @@ public enum IntegrationRegistry
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public Object getInstance( final IntegrationType name )
|
||||
{
|
||||
for( final IntegrationNode node : this.modules )
|
||||
{
|
||||
if( node.getShortName() == name && node.isActive() )
|
||||
{
|
||||
return node.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalStateException( "integration with " + name.name() + " is disabled." );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.integration;
|
||||
|
||||
|
||||
public enum IntegrationSide
|
||||
enum IntegrationSide
|
||||
{
|
||||
CLIENT, SERVER, BOTH
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.integration;
|
||||
|
||||
|
||||
public enum IntegrationStage
|
||||
enum IntegrationStage
|
||||
{
|
||||
|
||||
PRE_INIT, INIT, POST_INIT,
|
||||
|
||||
@@ -23,46 +23,22 @@ public enum IntegrationType
|
||||
{
|
||||
IC2( IntegrationSide.BOTH, "Industrial Craft 2", "IC2" ),
|
||||
|
||||
RotaryCraft( IntegrationSide.BOTH, "Rotary Craft", "RotaryCraft" ),
|
||||
|
||||
RC( IntegrationSide.BOTH, "Railcraft", "Railcraft" ),
|
||||
|
||||
BuildCraftCore( IntegrationSide.BOTH, "BuildCraft Core", "BuildCraft|Core" ),
|
||||
|
||||
BuildCraftTransport( IntegrationSide.BOTH, "BuildCraft Transport", "BuildCraft|Transport" ),
|
||||
|
||||
BuildCraftBuilder( IntegrationSide.BOTH, "BuildCraft Builders", "BuildCraft|Builders" ),
|
||||
|
||||
RF( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", "CoFHAPI" ),
|
||||
|
||||
RFItem( IntegrationSide.BOTH, "RedstoneFlux Power - Items", "CoFHAPI" ),
|
||||
|
||||
MFR( IntegrationSide.BOTH, "Mine Factory Reloaded", "MineFactoryReloaded" ),
|
||||
|
||||
DSU( IntegrationSide.BOTH, "Deep Storage Unit", null ),
|
||||
|
||||
FZ( IntegrationSide.BOTH, "Factorization", "factorization" ),
|
||||
|
||||
FMP( IntegrationSide.BOTH, "Forge MultiPart", "McMultipart" ),
|
||||
|
||||
RB( IntegrationSide.BOTH, "Rotatable Blocks", "RotatableBlocks" ),
|
||||
|
||||
CLApi( IntegrationSide.BOTH, "Colored Lights Core", "coloredlightscore" ),
|
||||
|
||||
Waila( IntegrationSide.BOTH, "Waila", "Waila" ),
|
||||
|
||||
InvTweaks( IntegrationSide.CLIENT, "Inventory Tweaks", "inventorytweaks" ),
|
||||
|
||||
JEI( IntegrationSide.CLIENT, "Just Enough Items", "JEI" ),
|
||||
|
||||
CraftGuide( IntegrationSide.CLIENT, "Craft Guide", "craftguide" ),
|
||||
|
||||
Mekanism( IntegrationSide.BOTH, "Mekanism", "Mekanism" ),
|
||||
|
||||
ImmibisMicroblocks( IntegrationSide.BOTH, "ImmibisMicroblocks", "ImmibisMicroblocks" ),
|
||||
|
||||
BetterStorage( IntegrationSide.BOTH, "BetterStorage", "betterstorage" ),
|
||||
|
||||
OpenComputers( IntegrationSide.BOTH, "OpenComputers", "OpenComputers" );
|
||||
|
||||
public final IntegrationSide side;
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
import appeng.integration.abstraction.IIC2;
|
||||
import appeng.integration.abstraction.IInvTweaks;
|
||||
import appeng.integration.abstraction.IJEI;
|
||||
import appeng.integration.abstraction.IMekanism;
|
||||
import appeng.integration.abstraction.IRC;
|
||||
|
||||
|
||||
/**
|
||||
* Provides convenient access to various integrations with other mods.
|
||||
*/
|
||||
public final class Integrations
|
||||
{
|
||||
|
||||
static IIC2 ic2 = new IIC2.Stub();
|
||||
|
||||
static IJEI jei = new IJEI.Stub();
|
||||
|
||||
static IRC rc = new IRC.Stub();
|
||||
|
||||
static IMekanism mekanism = new IMekanism.Stub();
|
||||
|
||||
static IInvTweaks invTweaks = new IInvTweaks.Stub();
|
||||
|
||||
private Integrations()
|
||||
{
|
||||
}
|
||||
|
||||
public static IIC2 ic2()
|
||||
{
|
||||
return ic2;
|
||||
}
|
||||
|
||||
public static IJEI jei()
|
||||
{
|
||||
return jei;
|
||||
}
|
||||
|
||||
public static IRC rc()
|
||||
{
|
||||
return rc;
|
||||
}
|
||||
|
||||
public static IMekanism mekanism()
|
||||
{
|
||||
return mekanism;
|
||||
}
|
||||
|
||||
public static IInvTweaks invTweaks()
|
||||
{
|
||||
return invTweaks;
|
||||
}
|
||||
|
||||
static IIC2 setIc2( IIC2 ic2 )
|
||||
{
|
||||
Integrations.ic2 = ic2;
|
||||
return ic2;
|
||||
}
|
||||
|
||||
static IJEI setJei( IJEI jei )
|
||||
{
|
||||
Integrations.jei = jei;
|
||||
return jei;
|
||||
}
|
||||
|
||||
static IRC setRc( IRC rc )
|
||||
{
|
||||
Integrations.rc = rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static IMekanism setMekanism( IMekanism mekanism )
|
||||
{
|
||||
Integrations.mekanism = mekanism;
|
||||
return mekanism;
|
||||
}
|
||||
|
||||
static IInvTweaks setInvTweaks( IInvTweaks invTweaks )
|
||||
{
|
||||
Integrations.invTweaks = invTweaks;
|
||||
return invTweaks;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import appeng.util.InventoryAdaptor;
|
||||
|
||||
|
||||
public interface IBetterStorage
|
||||
{
|
||||
|
||||
boolean isStorageCrate( Object te );
|
||||
|
||||
InventoryAdaptor getAdaptor( Object te, EnumFacing d );
|
||||
}
|
||||
@@ -1,71 +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.integration.abstraction;
|
||||
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
|
||||
/**
|
||||
* Contains wrench behaviour
|
||||
*
|
||||
* and registers the engines as P2P attunements for RF tunnels (since BC 7, they are part of BC Core) The attunement is
|
||||
* currently not public anymore, because it
|
||||
* was only used internally
|
||||
*
|
||||
* @author AlgorithmX2
|
||||
* @version rv3
|
||||
* @since rv0
|
||||
*/
|
||||
public interface IBuildCraftCore
|
||||
{
|
||||
/**
|
||||
* @param eq to be checked item, can be {@code null}
|
||||
*
|
||||
* @return {@code true} if it is an {@link buildcraft.api.tools.IToolWrench}
|
||||
*/
|
||||
boolean isWrench( @Nullable Item eq );
|
||||
|
||||
/**
|
||||
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
|
||||
* @param wrencher wrenching player, can be probably {@code null}, but not sure
|
||||
* @param pos pos
|
||||
*
|
||||
* @return {@code true} if player can wrench with that {@code wrench}
|
||||
*
|
||||
* @throws NullPointerException if {@code wrench} is {@code null}
|
||||
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
|
||||
*/
|
||||
boolean canWrench( @Nonnull Item wrench, EntityPlayer wrencher, BlockPos pos );
|
||||
|
||||
/**
|
||||
* @param wrench to be checked item, must be an {@link buildcraft.api.tools.IToolWrench}
|
||||
* @param wrencher wrenching player, can be probably {@code null}, but not sure
|
||||
* @param pos pos
|
||||
*
|
||||
* @throws NullPointerException if {@code wrench} is {@code null}
|
||||
* @throws ClassCastException if {@code wrench} is not an {@link buildcraft.api.tools.IToolWrench}
|
||||
*/
|
||||
void wrenchUsed( @Nonnull Item wrench, EntityPlayer wrencher, BlockPos pos );
|
||||
}
|
||||
@@ -1,117 +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.integration.abstraction;
|
||||
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import appeng.api.parts.IFacadePart;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
|
||||
/**
|
||||
* Contains facade logic to interchange BC facades with AE facades,
|
||||
*
|
||||
* pipe logic to interact between storage buses and pipes
|
||||
*
|
||||
* and using pipes for attunements
|
||||
* The attunement is currently not public anymore,
|
||||
* because it was only used internally
|
||||
*
|
||||
* @author thatsIch
|
||||
* @version rv3 - 12.06.2015
|
||||
* @since rv3 12.06.2015
|
||||
*/
|
||||
public interface IBuildCraftTransport
|
||||
{
|
||||
/**
|
||||
* @param is to be checked item
|
||||
*
|
||||
* @return {@code true} if the checked item is a {@link buildcraft.api.facades.IFacadeItem}
|
||||
*/
|
||||
boolean isFacade( @Nullable ItemStack is );
|
||||
|
||||
/**
|
||||
* @param blk block used for the ae facade
|
||||
* @param meta meta of the block
|
||||
* @param side side of the ae facade
|
||||
*
|
||||
* @return ae facade through bc facade system
|
||||
*/
|
||||
@Nullable
|
||||
IFacadePart createFacadePart( @Nullable IBlockState blk, @Nonnull AEPartLocation side );
|
||||
|
||||
/**
|
||||
* @param held create facade for that item
|
||||
* @param side on which side should the part be rendered, should rather be not {@code null}
|
||||
*
|
||||
* @return new instance using the {@code held} and side as direct argument, no logic in between
|
||||
*
|
||||
* @throws IllegalArgumentException if {@code held} is {@code null}
|
||||
*/
|
||||
IFacadePart createFacadePart( @Nonnull ItemStack held, @Nonnull AEPartLocation side );
|
||||
|
||||
/**
|
||||
* @param facade buildcraft facade
|
||||
*
|
||||
* @return item with the block and metadata based on the facade or {@code null} if {@code facade} was not a facade
|
||||
*
|
||||
* @throws NullPointerException if {@code facade} is {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
ItemStack getTextureForFacade( @Nonnull ItemStack facade );
|
||||
|
||||
/**
|
||||
* @param te the to be checked {@link TileEntity}
|
||||
* @param dir direction of the {@link TileEntity}
|
||||
*
|
||||
* @return {@code true} if {@code te} is a buildcraft pipe, but not plugged
|
||||
*
|
||||
* @throws NullPointerException if {@code dir} is {@code null}
|
||||
*/
|
||||
boolean isPipe( @Nullable TileEntity te, @Nonnull EnumFacing dir );
|
||||
|
||||
/**
|
||||
* checks weather if the {@code te} is injectable and simulates to inject the item
|
||||
*
|
||||
* @param te preferred something like a buildcraft injectable, can handle anything, just fails that way
|
||||
* @param is to be injected item
|
||||
* @param dir direction of the pipe
|
||||
*
|
||||
* @return {@code true} if items were simulated successfully being added
|
||||
*/
|
||||
boolean canAddItemsToPipe( TileEntity te, ItemStack is, EnumFacing dir );
|
||||
|
||||
/**
|
||||
* checks weather if the {@code te} is injectable, simulates the inject and tries to inject the item
|
||||
*
|
||||
* @param te preferred something like a buildcraft injectable, can handle anything, just fails that way
|
||||
* @param is to be injected item
|
||||
* @param dir direction of the pipe
|
||||
*
|
||||
* @return {@code true} if items were added to the buildcraft pipe
|
||||
*/
|
||||
boolean addItemsToPipe( @Nullable TileEntity te, @Nullable ItemStack is, @Nonnull EnumFacing dir );
|
||||
}
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.integration.modules.ic2;
|
||||
package appeng.integration.abstraction;
|
||||
|
||||
|
||||
import java.util.Set;
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
|
||||
public interface ICLApi
|
||||
{
|
||||
|
||||
int colorLight( AEColor color, int light );
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.storage.IMEInventory;
|
||||
|
||||
|
||||
public interface IDSU
|
||||
{
|
||||
|
||||
IMEInventory getDSU( TileEntity te );
|
||||
|
||||
boolean isDSU( TileEntity te );
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.storage.IMEInventory;
|
||||
|
||||
|
||||
public interface IFZ
|
||||
{
|
||||
|
||||
ItemStack barrelGetItem( TileEntity te );
|
||||
|
||||
int barrelGetMaxItemCount( TileEntity te );
|
||||
|
||||
int barrelGetItemCount( TileEntity te );
|
||||
|
||||
void setItemType( TileEntity te, ItemStack input );
|
||||
|
||||
void barrelSetCount( TileEntity te, int max );
|
||||
|
||||
IMEInventory getFactorizationBarrel( TileEntity te );
|
||||
|
||||
boolean isBarrel( TileEntity te );
|
||||
|
||||
void grinderRecipe( ItemStack is, ItemStack itemStack );
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import appeng.api.features.IItemComparisonProvider;
|
||||
|
||||
|
||||
public interface IForestry
|
||||
{
|
||||
|
||||
IItemComparisonProvider getGeneticsComparisonProvider();
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.storage.IMEInventory;
|
||||
|
||||
|
||||
public interface IGT
|
||||
{
|
||||
|
||||
boolean isQuantumChest( TileEntity te );
|
||||
|
||||
IMEInventory getQuantumChest( TileEntity te );
|
||||
}
|
||||
@@ -22,15 +22,27 @@ package appeng.integration.abstraction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.modules.ic2.IC2PowerSinkStub;
|
||||
import appeng.tile.powersink.IExternalPowerSink;
|
||||
|
||||
public interface IIC2
|
||||
|
||||
public interface IIC2 extends IIntegrationModule
|
||||
{
|
||||
|
||||
void addToEnergyNet( TileEntity appEngTile );
|
||||
default void maceratorRecipe( ItemStack in, ItemStack out )
|
||||
{
|
||||
}
|
||||
|
||||
void removeFromEnergyNet( TileEntity appEngTile );
|
||||
/**
|
||||
* Create an IC2 power sink for the given external sink.
|
||||
*/
|
||||
default IC2PowerSink createPowerSink( TileEntity tileEntity, IExternalPowerSink externalSink ) {
|
||||
return IC2PowerSinkStub.INSTANCE;
|
||||
}
|
||||
|
||||
ItemStack getItem( String string );
|
||||
class Stub extends IIntegrationModule.Stub implements IIC2
|
||||
{
|
||||
|
||||
void maceratorRecipe( ItemStack in, ItemStack out );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
|
||||
|
||||
public interface IImmibisMicroblocks
|
||||
{
|
||||
|
||||
IPartHost getOrCreateHost( EntityPlayer player, int side, TileEntity te );
|
||||
|
||||
/**
|
||||
* @param te to be left tile entity
|
||||
*
|
||||
* @return true if this worked..
|
||||
*/
|
||||
boolean leaveParts( TileEntity te );
|
||||
}
|
||||
@@ -21,9 +21,19 @@ package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public interface IInvTweaks
|
||||
|
||||
public interface IInvTweaks extends IIntegrationModule
|
||||
{
|
||||
|
||||
int compareItems( ItemStack i, ItemStack j );
|
||||
default int compareItems( ItemStack i, ItemStack j )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
class Stub extends IIntegrationModule.Stub implements IInvTweaks
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,43 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
|
||||
/**
|
||||
* Abstracts access to the JEI API functionality.
|
||||
*/
|
||||
public interface IJEI
|
||||
public interface IJEI extends IIntegrationModule
|
||||
{
|
||||
|
||||
boolean isEnabled();
|
||||
default String getSearchText()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
String getSearchText();
|
||||
default void setSearchText( String searchText )
|
||||
{
|
||||
}
|
||||
|
||||
void setSearchText( String searchText );
|
||||
class Stub extends IIntegrationModule.Stub implements IJEI
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.storage.IMEInventory;
|
||||
|
||||
|
||||
public interface ILP
|
||||
{
|
||||
|
||||
List<ItemStack> getCraftedItems( TileEntity te );
|
||||
|
||||
List<ItemStack> getProvidedItems( TileEntity te );
|
||||
|
||||
boolean isRequestPipe( TileEntity te );
|
||||
|
||||
List<ItemStack> performRequest( TileEntity te, ItemStack wanted );
|
||||
|
||||
IMEInventory getInv( TileEntity te );
|
||||
|
||||
Object getGetPowerPipe( TileEntity te );
|
||||
|
||||
boolean isPowerSource( TileEntity tt );
|
||||
|
||||
boolean canUseEnergy( Object pp, int ceil, List<Object> providersToIgnore );
|
||||
|
||||
boolean useEnergy( Object pp, int ceil, List<Object> providersToIgnore );
|
||||
}
|
||||
@@ -21,11 +21,21 @@ package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public interface IMekanism
|
||||
|
||||
public interface IMekanism extends IIntegrationModule
|
||||
{
|
||||
|
||||
void addCrusherRecipe( ItemStack in, ItemStack out );
|
||||
default void addCrusherRecipe( ItemStack in, ItemStack out )
|
||||
{
|
||||
}
|
||||
|
||||
void addEnrichmentChamberRecipe( ItemStack in, ItemStack out );
|
||||
default void addEnrichmentChamberRecipe( ItemStack in, ItemStack out )
|
||||
{
|
||||
}
|
||||
|
||||
class Stub extends IIntegrationModule.Stub implements IMekanism
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,16 @@ package appeng.integration.abstraction;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.integration.IIntegrationModule;
|
||||
|
||||
public interface IRC
|
||||
|
||||
public interface IRC extends IIntegrationModule
|
||||
{
|
||||
|
||||
void rockCrusher( ItemStack input, ItemStack output );
|
||||
default void rockCrusher( ItemStack input, ItemStack output ) {
|
||||
}
|
||||
|
||||
class Stub extends IIntegrationModule.Stub implements IRC {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* 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.abstraction;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
|
||||
public interface ITE
|
||||
{
|
||||
|
||||
void addPulverizerRecipe( int i, ItemStack blkQuartz, ItemStack blockDust );
|
||||
|
||||
void addPulverizerRecipe( int i, ItemStack blkQuartzOre, ItemStack matQuartz, ItemStack matQuartzDust );
|
||||
|
||||
boolean isPipe( TileEntity te, AEPartLocation opposite );
|
||||
|
||||
ItemStack addItemsToPipe( TileEntity ad, ItemStack itemstack, AEPartLocation dir );
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.modules.ic2.IC2PowerSink;
|
||||
import appeng.integration.modules.ic2.IC2PowerSinkAdapter;
|
||||
import appeng.integration.modules.ic2.IC2PowerSinkStub;
|
||||
import appeng.tile.powersink.IExternalPowerSink;
|
||||
|
||||
|
||||
public class IC2 implements IIntegrationModule
|
||||
{
|
||||
|
||||
@Reflected
|
||||
public static IC2 instance;
|
||||
|
||||
private static BiFunction<TileEntity, IExternalPowerSink, IC2PowerSink> powerSinkFactory = ( ( te, sink ) -> IC2PowerSinkStub.INSTANCE );
|
||||
|
||||
@Override
|
||||
public void init() throws Throwable
|
||||
{
|
||||
powerSinkFactory = IC2PowerSinkAdapter::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an IC2 power sink for the given external sink.
|
||||
*/
|
||||
public static IC2PowerSink createPowerSink( TileEntity tileEntity, IExternalPowerSink externalSink )
|
||||
{
|
||||
return powerSinkFactory.apply( tileEntity, externalSink );
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package appeng.integration.modules;
|
||||
|
||||
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.integration.IIntegrationModule;
|
||||
import appeng.integration.abstraction.IJEI;
|
||||
import appeng.integration.modules.jei.NullJEI;
|
||||
|
||||
|
||||
public class JEI implements IIntegrationModule
|
||||
{
|
||||
|
||||
@Reflected
|
||||
public static JEI instance;
|
||||
|
||||
private IJEI jei = new NullJEI();
|
||||
|
||||
@Override
|
||||
public void init() throws Throwable
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void setJei( IJEI jei )
|
||||
{
|
||||
this.jei = jei;
|
||||
}
|
||||
|
||||
public IJEI getJei()
|
||||
{
|
||||
return jei;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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.ic2;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.api.features.IP2PTunnelRegistry;
|
||||
import appeng.integration.IntegrationHelper;
|
||||
import appeng.integration.abstraction.IC2PowerSink;
|
||||
import appeng.integration.abstraction.IIC2;
|
||||
import appeng.tile.powersink.IExternalPowerSink;
|
||||
|
||||
|
||||
public class IC2Module implements IIC2
|
||||
{
|
||||
|
||||
public IC2Module()
|
||||
{
|
||||
IntegrationHelper.testClassExistence( this, ic2.api.energy.tile.IEnergyTile.class );
|
||||
IntegrationHelper.testClassExistence( this, ic2.api.recipe.RecipeInputItemStack.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
final IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel();
|
||||
reg.addNewAttunement( this.getItem( "copperCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "insulatedCopperCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "goldCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "insulatedGoldCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "ironCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "insulatedIronCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "insulatedTinCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "glassFiberCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "tinCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "detectorCableItem" ), TunnelType.IC2_POWER );
|
||||
reg.addNewAttunement( this.getItem( "splitterCableItem" ), TunnelType.IC2_POWER );
|
||||
}
|
||||
|
||||
private ItemStack getItem( final String name )
|
||||
{
|
||||
return ic2.api.item.IC2Items.getItem( name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an IC2 power sink for the given external sink.
|
||||
*/
|
||||
@Override
|
||||
public IC2PowerSink createPowerSink( TileEntity tileEntity, IExternalPowerSink externalSink )
|
||||
{
|
||||
return new IC2PowerSinkAdapter( tileEntity, externalSink );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void maceratorRecipe( ItemStack in, ItemStack out )
|
||||
{
|
||||
ic2.api.recipe.Recipes.macerator.addRecipe( new RecipeInputItemStack( in, in.stackSize ), null, false, out );
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import ic2.api.energy.prefab.BasicSink;
|
||||
import ic2.api.energy.tile.IEnergyEmitter;
|
||||
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.integration.abstraction.IC2PowerSink;
|
||||
import appeng.tile.powersink.IExternalPowerSink;
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
package appeng.integration.modules.ic2;
|
||||
|
||||
|
||||
import appeng.integration.abstraction.IC2PowerSink;
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of IC2PowerSink that just stubs out all methods and does nothing.
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
+30
-12
@@ -16,25 +16,43 @@
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.integration.abstraction;
|
||||
package appeng.integration.modules.jei;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.integration.abstraction.IJEI;
|
||||
|
||||
|
||||
public interface IFMP
|
||||
public class JEIModule implements IJEI
|
||||
{
|
||||
|
||||
IPartHost getOrCreateHost( TileEntity tile );
|
||||
private IJEI jei = new IJEI.Stub();
|
||||
|
||||
CableBusContainer getCableContainer( TileEntity te );
|
||||
public void setJei( IJEI jei )
|
||||
{
|
||||
this.jei = jei;
|
||||
}
|
||||
|
||||
void registerPassThrough( Class<?> layerInterface );
|
||||
public IJEI getJei()
|
||||
{
|
||||
return jei;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchText()
|
||||
{
|
||||
return jei.getSearchText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSearchText( String searchText )
|
||||
{
|
||||
jei.setSearchText( searchText );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return jei.isEnabled();
|
||||
}
|
||||
|
||||
Event newFMPPacketEvent( EntityPlayerMP sender );
|
||||
}
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -26,9 +44,7 @@ import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.modules.JEI;
|
||||
import appeng.integration.Integrations;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
|
||||
@@ -180,7 +196,7 @@ public class JEIPlugin extends BlankModPlugin
|
||||
@Override
|
||||
public void onRuntimeAvailable( IJeiRuntime jeiRuntime )
|
||||
{
|
||||
JEI jeiModule = (JEI) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.JEI );
|
||||
JEIModule jeiModule = (JEIModule) Integrations.jei();
|
||||
jeiModule.setJei( new JeiRuntimeAdapter( jeiRuntime ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user