It`s strage: I have blocks, but maybe block without tileentity
Hmm
Posts by Rumaruka
-
-
Code
CodeItem fluid_cell_uu = IC2Items.getItem("fluid_cell","uu_matter").getItem(); CrucibleRecipe crystalUU = new CrucibleRecipe("EMT.ALT_USE_UU",new ItemStack(EMTItems.materials_uumatterdrop),new ItemStack(fluid_cell_uu),new AspectList().add(Aspect.CRYSTAL,8).add(Aspect.MAGIC,8).add(Aspect.ORDER,8)); ThaumcraftApi.addCrucibleRecipe(new ResourceLocation("EMT.crystalUU"),crystalUU );
And crush report
-
I-i don`t know =(
-
I maked, but don`t working :<
-
Looking at the missing interface methods, it looks only the vanilla ones are missing. Are you using a normal version instead of a -dev version (of the IC2) jar to compile against?
normal version
-
I`m try extrends TileEntitySolarGenerator, but don`t work
If i extends TileEntityBaseGenerator, then needen implements something method, but it`s absctract class. WHAAAAT?
Code
Display Morepackage com.rumaruka.emt.tile.solar.compressed; import ic2.core.IC2; import ic2.core.block.generator.tileentity.TileEntitySolarGenerator; import ic2.core.init.MainConfig; import ic2.core.network.GuiSynced; import ic2.core.util.BiomeUtil; import ic2.core.util.ConfigUtil; import ic2.core.util.Util; import net.minecraft.util.math.BlockPos; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import net.minecraftforge.common.BiomeDictionary; public class TileEntityCompressedSolar extends TileEntitySolarGenerator { @GuiSynced public float skyLight; private int ticker; private static final int tickRate = 128; private static final double energyMultiplier = ConfigUtil.getDouble(MainConfig.get(), "balance/energy/generator/solar"); public TileEntityCompressedSolar() { super(); this.ticker = IC2.random.nextInt(tickRate); } protected void onLoaded() { super.onLoaded(); this.updateSunVisibility(); } public boolean gainEnergy() { if (++this.ticker % 128 == 0) { this.updateSunVisibility(); } if (this.skyLight > 0.0F) { this.energy.addEnergy(2*(energyMultiplier * (double)this.skyLight)); return true; } else { return false; } } public boolean gainFuel() { return false; } public void updateSunVisibility() { this.skyLight = getSkyLight(this.getWorld(), this.pos.up()); } public static float getSkyLight(World world, BlockPos pos) { if (world.provider.isNether()) { return 0.0F; } else { float sunBrightness = Util.limit((float)Math.cos((double)world.getCelestialAngleRadians(1.0F)) * 2.0F + 0.2F, 0.0F, 1.0F); if (!BiomeDictionary.hasType(BiomeUtil.getBiome(world, pos), BiomeDictionary.Type.SANDY)) { sunBrightness *= 1.0F - world.getRainStrength(1.0F) * 5.0F / 16.0F; sunBrightness *= 1.0F - world.getRainStrength(1.0F) * 5.0F / 16.0F; sunBrightness = Util.limit(sunBrightness, 0.0F, 1.0F); } return (float)world.getLightFor(EnumSkyBlock.SKY, pos) / 15.0F * sunBrightness; } } public boolean needsFuel() { return false; } public boolean getGuiState(String name) { if ("sunlight".equals(name)) { return this.skyLight > 0.0F; } else { return super.getGuiState(name); } } protected boolean delayActiveUpdate() { return true; } }
And
Code
Display Morepackage com.rumaruka.emt.tile.solar.compressed; import ic2.core.IC2; import ic2.core.block.generator.tileentity.TileEntityBaseGenerator; import ic2.core.block.generator.tileentity.TileEntitySolarGenerator; import ic2.core.init.MainConfig; import ic2.core.network.GuiSynced; import ic2.core.util.BiomeUtil; import ic2.core.util.ConfigUtil; import ic2.core.util.Util; import net.minecraft.util.math.BlockPos; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import net.minecraftforge.common.BiomeDictionary; public class TileEntityCompressedSolar extends TileEntityBaseGenerator //Error with implements { @GuiSynced public float skyLight; private int ticker; private static final int tickRate = 128; private static final double energyMultiplier = ConfigUtil.getDouble(MainConfig.get(), "balance/energy/generator/solar"); public TileEntityCompressedSolar() { super(2.0d,2,2); this.ticker = IC2.random.nextInt(tickRate); } protected void onLoaded() { super.onLoaded(); this.updateSunVisibility(); } public boolean gainEnergy() { if (++this.ticker % 128 == 0) { this.updateSunVisibility(); } if (this.skyLight > 0.0F) { this.energy.addEnergy(2*(energyMultiplier * (double)this.skyLight)); return true; } else { return false; } } public boolean gainFuel() { return false; } public void updateSunVisibility() { this.skyLight = getSkyLight(this.getWorld(), this.pos.up()); } public static float getSkyLight(World world, BlockPos pos) { if (world.provider.isNether()) { return 0.0F; } else { float sunBrightness = Util.limit((float)Math.cos((double)world.getCelestialAngleRadians(1.0F)) * 2.0F + 0.2F, 0.0F, 1.0F); if (!BiomeDictionary.hasType(BiomeUtil.getBiome(world, pos), BiomeDictionary.Type.SANDY)) { sunBrightness *= 1.0F - world.getRainStrength(1.0F) * 5.0F / 16.0F; sunBrightness *= 1.0F - world.getRainStrength(1.0F) * 5.0F / 16.0F; sunBrightness = Util.limit(sunBrightness, 0.0F, 1.0F); } return (float)world.getLightFor(EnumSkyBlock.SKY, pos) / 15.0F * sunBrightness; } } public boolean needsFuel() { return false; } public boolean getGuiState(String name) { if ("sunlight".equals(name)) { return this.skyLight > 0.0F; } else { return super.getGuiState(name); } } protected boolean delayActiveUpdate() { return true; } }
-
Thank you, Working FINALLY :3
-
Reoganize code and try fix, but not working D:
Code
Display Morepackage com.rumaruka.emt.item; import com.rumaruka.emt.client.creativetabs.EMTCreativeTabs; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import ic2.core.item.IPseudoDamageItem; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import thaumcraft.api.items.IScribeTools; import thaumcraft.common.items.ItemTCBase; import thaumcraft.common.items.tools.ItemScribingTools; public class ItemElectricScribingTools extends Item implements IScribeTools, IElectricItem , IPseudoDamageItem{ public static int maxChange = 400; public static int cost = 10; public ItemElectricScribingTools() { super(); this.setMaxStackSize(1); setHasSubtypes(true); } @Override public void setDamage(ItemStack stack, int damage) { ElectricItem.manager.use(stack,cost,) } @Override public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if(tab== EMTCreativeTabs.EMT_CREATIVEtabs){ ItemStack itemStack = new ItemStack(this, 1); if (getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); items.add(charged); } if (getEmptyItem(itemStack) == this) { items.add(new ItemStack(this, 1, getMaxDamage())); } } } public Item getChargedItem(ItemStack itemStack) { return this; } public Item getEmptyItem(ItemStack itemStack) { return this; } @Override public boolean canProvideEnergy(ItemStack itemStack) { return false; } @Override public double getMaxCharge(ItemStack itemStack) { return maxChange; } @Override public int getTier(ItemStack itemStack) { return 1; } @Override public double getTransferLimit(ItemStack itemStack) { return 5; } @Override public void setStackDamage(ItemStack itemStack, int i) { } }
-
-
-
-
The problem is that the this item uses durability instead of energy.
Electric Pen yep! -
I don`t know and i wait help :3
Code
Display Moreprotected int maxCharge=400; protected int cost = 10; public ItemElectricScribingTools() { super(); this.setMaxDamage(maxCharge); this.setMaxStackSize(1); this.setNoRepair(); setHasSubtypes(false); } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entity, int itemSlot, boolean isSelected) { try { if(entity instanceof EntityPlayer) { if(ElectricItem.manager.canUse(stack,cost) ) { ElectricItem.manager.use(stack,cost, (EntityPlayer) entity); } } }catch(Exception e) { e.printStackTrace(); return; } } @Override public void setDamage(ItemStack stack, int damage) { if(ElectricItem.manager.canUse(stack,cost)) super.setDamage(stack, stack.getItemDamage() - cost); } @Override public boolean canProvideEnergy(ItemStack itemStack) { return false; } @Override public double getMaxCharge(ItemStack itemStack) { return maxCharge; } @Override public int getTier(ItemStack itemStack) { return 1; } @Override public double getTransferLimit(ItemStack itemStack) { return 5; } @Override public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if(tab== EMTCreativeTabs.EMT_CREATIVEtabs){ ItemStack itemStack = new ItemStack(this, 1); if (getChargedItem(itemStack) == this) { ItemStack charged = new ItemStack(this, 1); ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); items.add(charged); } if (getEmptyItem(itemStack) == this) { items.add(new ItemStack(this, 1, getMaxDamage())); } } } public Item getChargedItem(ItemStack itemStack) { return this; } public Item getEmptyItem(ItemStack itemStack) { return this; } }