Transmaterial Differentiator

This commit is contained in:
Ellpeck 2016-01-19 21:56:45 +01:00
parent ca30b483e1
commit 223db4e04e
2 changed files with 81 additions and 5 deletions

View file

@ -12,11 +12,10 @@ package de.ellpeck.actuallyadditions.mod.blocks;
import de.ellpeck.actuallyadditions.api.lens.ILensItem;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.util.*;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
@ -37,10 +36,15 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
public static final int NAME_FLAVOR_AMOUNTS_1 = 12;
public static final int NAME_FLAVOR_AMOUNTS_2 = 14;
public BlockAtomicReconstructor(String name){
super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0);
@ -129,4 +133,46 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE);
}
}
@Override
protected Class<? extends ItemBlockBase> getItemBlock(){
return TheItemBlock.class;
}
public static class TheItemBlock extends ItemBlockBase{
private long lastSysTime;
private int toPick1;
private int toPick2;
public TheItemBlock(Block block){
super(block);
this.setHasSubtypes(false);
this.setMaxDamage(0);
}
@Override
public String getUnlocalizedName(ItemStack stack){
return this.getUnlocalizedName();
}
@Override
public int getMetadata(int damage){
return damage;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean bool){
long sysTime = System.currentTimeMillis();
if(this.lastSysTime+3000 < sysTime){
this.lastSysTime = sysTime;
this.toPick1 = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS_1)+1;
this.toPick2 = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS_2)+1;
}
String base = "tile."+ModUtil.MOD_ID_LOWER+"."+((BlockAtomicReconstructor)this.block).getBaseName()+".info.";
list.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2));
}
}
}

View file

@ -116,7 +116,6 @@ tile.actuallyadditions.blockMiscIronCasing.name=Iron Casing
tile.actuallyadditions.blockBlackLotus.name=Black Lotus
tile.actuallyadditions.blockTestifiBucksWhiteFence.name=Ethetic Quartz Wall
tile.actuallyadditions.blockTestifiBucksGreenFence.name=Ethetic Green Wall
tile.actuallyadditions.blockAtomicReconstructor.name=Atomic Reconstructor
tile.actuallyadditions.blockCrystalRed.name=Restonia Crystal Block
tile.actuallyadditions.blockCrystalBlue.name=Palis Crystal Block
tile.actuallyadditions.blockCrystalLightBlue.name=Diamatine Crystal Block
@ -154,6 +153,37 @@ tile.actuallyadditions.blockInputter.add.13.name=Efficient Sucking Dilettant
tile.actuallyadditions.blockInputter.add.14.name=Extreme Sand Digger
tile.actuallyadditions.blockInputter.add.15.name=Ending Serious Daughter
#Reconstructor
tile.actuallyadditions.blockAtomicReconstructor.name=Atomic Reconstructor
tile.actuallyadditions.blockAtomicReconstructor.info.1.1=Molecular
tile.actuallyadditions.blockAtomicReconstructor.info.1.2=Material
tile.actuallyadditions.blockAtomicReconstructor.info.1.3=Quarkal
tile.actuallyadditions.blockAtomicReconstructor.info.1.4=Atomatic
tile.actuallyadditions.blockAtomicReconstructor.info.1.5=Tiny Bit
tile.actuallyadditions.blockAtomicReconstructor.info.1.6=Component
tile.actuallyadditions.blockAtomicReconstructor.info.1.7=Vittle
tile.actuallyadditions.blockAtomicReconstructor.info.1.8=Transmaterial
tile.actuallyadditions.blockAtomicReconstructor.info.1.9=Part
tile.actuallyadditions.blockAtomicReconstructor.info.1.10=Jimmie
tile.actuallyadditions.blockAtomicReconstructor.info.1.11=Chit
tile.actuallyadditions.blockAtomicReconstructor.info.1.12=Cube
tile.actuallyadditions.blockAtomicReconstructor.info.2.1=Recombobulizer
tile.actuallyadditions.blockAtomicReconstructor.info.2.2=Shiftulator
tile.actuallyadditions.blockAtomicReconstructor.info.2.3=Recombinator
tile.actuallyadditions.blockAtomicReconstructor.info.2.4=Modulator
tile.actuallyadditions.blockAtomicReconstructor.info.2.5=Moleculizer
tile.actuallyadditions.blockAtomicReconstructor.info.2.6=Modificulator
tile.actuallyadditions.blockAtomicReconstructor.info.2.7=Changer
tile.actuallyadditions.blockAtomicReconstructor.info.2.8=Atomizer
tile.actuallyadditions.blockAtomicReconstructor.info.2.9=Makerator
tile.actuallyadditions.blockAtomicReconstructor.info.2.10=Swapper
tile.actuallyadditions.blockAtomicReconstructor.info.2.11=Exchanger
tile.actuallyadditions.blockAtomicReconstructor.info.2.12=Replacer
tile.actuallyadditions.blockAtomicReconstructor.info.2.13=Differentiator
tile.actuallyadditions.blockAtomicReconstructor.info.2.14=Rustler
#Items
item.actuallyadditions.itemDrill.name=Drill
item.actuallyadditions.itemFoodRice.name=Rice