items oredicted "crystalCertusQuartz" can go into the charger
and change to ae2 charged certus quartz
This commit is contained in:
@@ -24,6 +24,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import appeng.core.AEConfig;
|
||||||
|
import appeng.core.features.AEFeature;
|
||||||
|
import appeng.util.item.OreHelper;
|
||||||
|
import appeng.util.item.OreReference;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@@ -184,11 +188,17 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
|||||||
if( myItem.isEmpty() )
|
if( myItem.isEmpty() )
|
||||||
{
|
{
|
||||||
ItemStack held = player.inventory.getCurrentItem();
|
ItemStack held = player.inventory.getCurrentItem();
|
||||||
|
if( !held.isEmpty() )
|
||||||
if( AEApi.instance().definitions().materials().certusQuartzCrystal().isSameAs( held ) || Platform.isChargeable( held ) )
|
|
||||||
{
|
{
|
||||||
held = player.inventory.decrStackSize( player.inventory.currentItem, 1 );
|
if( AEConfig.instance().isFeatureEnabled( AEFeature.CERTUS ) )
|
||||||
this.inv.setStackInSlot( 0, held );
|
{
|
||||||
|
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||||
|
if( AEItemStack.fromItemStack( held ).sameOre( AEItemStack.fromItemStack( materials.certusQuartzCrystal().maybeStack( 1 ).orElse( ItemStack.EMPTY ) ) ) || Platform.isChargeable( held ) )
|
||||||
|
{
|
||||||
|
held = player.inventory.decrStackSize( player.inventory.currentItem, 1 );
|
||||||
|
this.inv.setStackInSlot( 0, held );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -254,7 +264,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( this.getInternalCurrentPower() > POWER_THRESHOLD && materials.certusQuartzCrystal().isSameAs( myItem ) )
|
else if( this.getInternalCurrentPower() > POWER_THRESHOLD && ( materials.certusQuartzCrystal().isSameAs( myItem ) || AEItemStack.fromItemStack( myItem ).sameOre( AEItemStack.fromItemStack( materials.certusQuartzCrystal().maybeStack( 1 ).orElse( ItemStack.EMPTY ) ) ) ) )
|
||||||
{
|
{
|
||||||
if( Platform.getRandomFloat() > 0.8f ) // simulate wait
|
if( Platform.getRandomFloat() > 0.8f ) // simulate wait
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user