Added Legacy Controller textures and recipe

This commit is contained in:
Timo Ley 2021-04-03 12:02:52 +02:00
parent 27ff3fb1d6
commit c41fb8f795
14 changed files with 56 additions and 4 deletions

View File

@ -1,12 +1,14 @@
package appeng.block.legacy;
import appeng.block.AEBaseTileBlock;
import appeng.client.texture.ExtraBlockTextures;
import appeng.core.features.AEFeature;
import appeng.core.sync.GuiBridge;
import appeng.tile.legacy.TileLegacyController;
import appeng.util.Platform;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -26,4 +28,27 @@ public class BlockLegacyController extends AEBaseTileBlock {
return true;
}
@Override
public IIcon getIcon(int direction, int metadata) {
if (direction == 3) {
switch (metadata) {
case 0:
return ExtraBlockTextures.Controller0.getIcon();
case 1:
return ExtraBlockTextures.Controller1.getIcon();
case 2:
return ExtraBlockTextures.Controller2.getIcon();
case 3:
return ExtraBlockTextures.Controller3.getIcon();
case 4:
return ExtraBlockTextures.Controller4.getIcon();
case 5:
return ExtraBlockTextures.Controller5.getIcon();
case 6:
return ExtraBlockTextures.ControllerLinked.getIcon();
}
}
return super.getIcon(direction, metadata);
}
}

View File

@ -21,6 +21,7 @@ package appeng.client.texture;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import jdk.nashorn.internal.ir.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.IIcon;
@ -85,7 +86,9 @@ public enum ExtraBlockTextures
BlockCraftingMonitorOuter( "BlockCraftingMonitorOuter" ), BlockCraftingFitSolid( "BlockCraftingFitSolid" ),
BlockPaint2( "BlockPaint2" ), BlockPaint3( "BlockPaint3" );
BlockPaint2( "BlockPaint2" ), BlockPaint3( "BlockPaint3" ),
Controller0("Controller0"), Controller1("Controller1"), Controller2("Controller2"), Controller3("Controller3"), Controller4("Controller4"), Controller5("BlockLegacyControllerFront"), ControllerLinked("ControllerLinked");
private final String name;
private IIcon IIcon;

View File

@ -14,9 +14,10 @@ public class TileLegacyController extends AENetworkPowerTile {
private static final IInventory NULL_INVENTORY = new AppEngInternalInventory( null, 0 );
private static final int[] ACCESSIBLE_SLOTS_BY_SIDE = {};
public TileLegacyController() {
this.setInternalMaxPower( 8000 );
public TileLegacyController() { //TODO Fix power storage
this.setInternalMaxPower( 10000 );
this.setInternalPublicPowerStorage( true );
this.getProxy().setIdlePowerUsage(6.0);
}
@Override
@ -37,9 +38,10 @@ public class TileLegacyController extends AENetworkPowerTile {
@Override
protected double getFunnelPowerDemand( final double maxReceived )
{
updateMeta();
try
{
return this.getProxy().getEnergy().getEnergyDemand( 8000 );
return this.getProxy().getEnergy().getEnergyDemand( 10000 );
}
catch( final GridAccessException e )
{
@ -51,6 +53,7 @@ public class TileLegacyController extends AENetworkPowerTile {
@Override
protected double funnelPowerIntoStorage( final double power, final Actionable mode )
{
updateMeta();
try
{
final double ret = this.getProxy().getEnergy().injectPower( power, mode );
@ -67,4 +70,19 @@ public class TileLegacyController extends AENetworkPowerTile {
}
}
public void updateMeta() {
int meta = (int) Math.ceil((5.0 * this.getInternalCurrentPower() / this.getInternalMaxPower()));
if (meta < 0) {
meta = 0;
} else if (meta > 5) {
meta = 5;
}
if (getProxy().isActive() && getInternalCurrentPower() == 0.0) {
meta = 6;
}
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, meta, 2);
}
}

View File

@ -27,3 +27,9 @@ shaped=
ae2:CableGlass.Fluix ae2:ItemMaterial.LogicProcessor glass,
oredictionary:ingotIron oredictionary:ingotIron glass
-> ae2:BlockCraftMonitor
shaped=
oredictionary:ingotIron fluixCrystal oredictionary:ingotIron,
fluixCrystal ae2:ItemMaterial.EngProcessor fluixCrystal,
oredictionary:ingotIron fluixCrystal oredictionary:ingotIron
-> ae2:BlockLegacyController

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB