87 errors, will finish later

This commit is contained in:
modmuss50 2016-03-13 17:38:12 +00:00
parent 7a121be651
commit cc0b762b56
19 changed files with 62 additions and 61 deletions

View file

@ -1,16 +1,16 @@
package techreborn.blocks;
import net.minecraft.block.BlockFence;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.material.Material;
import techreborn.client.TechRebornCreativeTabMisc;
public class BlockIronFence extends BlockFence {
public BlockIronFence() {
super(Material.iron);
super(Material.iron, BlockPlanks.EnumType.OAK.getMapColor());
setUnlocalizedName("techreborn.ironfence");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setStepSound(soundTypeMetal);
setHardness(2.0F);
setHarvestLevel("pickaxe", 2);
}

View file

@ -32,7 +32,8 @@ public class BlockNuke extends BlockTNT implements ITexturedBlock {
if (state.getValue(EXPLODE).booleanValue()) {
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F), (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter);
worldIn.spawnEntityInWorld(entitynukeprimed);
worldIn.playSoundAtEntity(entitynukeprimed, "game.tnt.primed", 1.0F, 1.0F);
//TODO 1.9 sounds
//worldIn.playSoundAtEntity(entitynukeprimed, "game.tnt.primed", 1.0F, 1.0F);
}
}
}
@ -48,7 +49,7 @@ public class BlockNuke extends BlockTNT implements ITexturedBlock {
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
return false
return false;
}
@Override

View file

@ -13,8 +13,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.EnumFacing;
@ -65,17 +65,17 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
}
@Override
public boolean canConnectRedstone(IBlockAccess world, BlockPos pos, EnumFacing side) {
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
return true;
}
@Override
public boolean canProvidePower() {
public boolean canProvidePower(IBlockState state) {
return true;
}
@Override
public int getWeakPower(IBlockAccess blockAccess, BlockPos pos, IBlockState state, EnumFacing side) {
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
TileEntity entity = blockAccess.getTileEntity(pos);
if (entity instanceof TilePlayerDectector) {
return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0;
@ -84,7 +84,7 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
}
@Override
public int getStrongPower(IBlockAccess blockAccess, BlockPos pos, IBlockState state, EnumFacing side) {
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
TileEntity entity = blockAccess.getTileEntity(pos);
if (entity instanceof TilePlayerDectector) {
return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0;
@ -92,7 +92,6 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
return 0;
}
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
@ -103,7 +102,7 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing side, float hitX, float hitY, float hitZ) {
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityPlayer, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
// int newMeta = (world.getBlockMetadata(x, y, z) + 1) % 3;
int newMeta = getMetaFromState(state);
String message = "";
@ -118,7 +117,7 @@ public class BlockPlayerDetector extends BaseTileBlock implements ITexturedBlock
message = TextFormatting.BLUE + "Detects only you";
}
if(!world.isRemote){
entityplayer.addChatComponentMessage(new TextComponentString(message));
entityPlayer.addChatComponentMessage(new TextComponentString(message));
//world.setBlockMetadataWithNotify(x, y, z, newMeta, 2);
}
return true;

View file

@ -21,7 +21,6 @@ public class BlockRubberSapling extends BlockSapling {
public BlockRubberSapling() {
setUnlocalizedName("techreborn.rubbersapling");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setStepSound(soundTypeGrass);
this.setDefaultState(this.getDefaultState().withProperty(STAGE, Integer.valueOf(0)));
}

View file

@ -5,6 +5,7 @@ import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
@ -44,7 +45,7 @@ public class ChargeHud {
public void drawChargeHud(ScaledResolution res) {
EntityPlayer player = mc.thePlayer;
ItemStack armorstack = player.getCurrentArmor(2);
ItemStack armorstack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
ItemStack stack = mc.thePlayer.inventory.getCurrentItem();
int y = 5;

View file

@ -1,6 +1,7 @@
package techreborn.events;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
@ -20,7 +21,7 @@ public class TRTickHandler {
EntityPlayer player = e.player;
Item chestslot = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null ? player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() : null;
if (previouslyWearing != chestslot && previouslyWearing == ModItems.cloakingDevice && player.isInvisible() && !player.isPotionActive(Potion.invisibility)) {
if (previouslyWearing != chestslot && previouslyWearing == ModItems.cloakingDevice && player.isInvisible() && !player.isPotionActive(MobEffects.invisibility)) {
player.setInvisible(false);
}

View file

@ -1,6 +1,7 @@
package techreborn.items.tools;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import techreborn.config.ConfigTechReborn;
@ -8,13 +9,13 @@ import techreborn.config.ConfigTechReborn;
public class ItemAdvancedChainsaw extends ItemChainsaw {
public ItemAdvancedChainsaw() {
super(ToolMaterial.EMERALD, "techreborn.advancedChainsaw", ConfigTechReborn.AdvancedChainsawCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
super(ToolMaterial.DIAMOND, "techreborn.advancedChainsaw", ConfigTechReborn.AdvancedChainsawCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
this.cost = 250;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_axe.canHarvestBlock(block, stack);
public boolean canHarvestBlock(IBlockState blockIn) {
return Items.diamond_axe.canHarvestBlock(blockIn);
}
@Override

View file

@ -1,6 +1,7 @@
package techreborn.items.tools;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import techreborn.config.ConfigTechReborn;
@ -8,13 +9,13 @@ import techreborn.config.ConfigTechReborn;
public class ItemAdvancedDrill extends ItemDrill {
public ItemAdvancedDrill() {
super(ToolMaterial.EMERALD, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
super(ToolMaterial.DIAMOND, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F);
this.cost = 250;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack);
public boolean canHarvestBlock(IBlockState blockIn) {
return Items.diamond_pickaxe.canHarvestBlock(blockIn) || Items.diamond_shovel.canHarvestBlock(blockIn);
}
@Override

View file

@ -12,6 +12,8 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
@ -80,8 +82,8 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ);
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand);
}
@Override

View file

@ -1,6 +1,7 @@
package techreborn.items.tools;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import techreborn.config.ConfigTechReborn;
@ -8,13 +9,13 @@ import techreborn.config.ConfigTechReborn;
public class ItemDiamondChainsaw extends ItemChainsaw {
public ItemDiamondChainsaw() {
super(ToolMaterial.EMERALD, "techreborn.diamondChainsaw", ConfigTechReborn.DiamondChainsawCharge, ConfigTechReborn.DiamondChainsawTier, 2.5F);
super(ToolMaterial.DIAMOND, "techreborn.diamondChainsaw", ConfigTechReborn.DiamondChainsawCharge, ConfigTechReborn.DiamondChainsawTier, 2.5F);
this.cost = 250;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_axe.canHarvestBlock(block, stack);
public boolean canHarvestBlock(IBlockState blockIn) {
return Items.diamond_axe.canHarvestBlock(blockIn);
}
@Override

View file

@ -7,6 +7,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -27,7 +30,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITextur
public double transferLimit = 100;
public ItemNanosaber() {
super(ToolMaterial.EMERALD);
super(ToolMaterial.DIAMOND);
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
@ -44,12 +47,12 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITextur
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World worldIn, EntityPlayer player, EnumHand hand) {
if(player.isSneaking())
{
changeMode(stack);
}
return stack;
return new ActionResult<>(EnumActionResult.FAIL, stack);
}
public void changeMode(ItemStack stack)

View file

@ -28,7 +28,7 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITex
public static final int tier = ConfigTechReborn.RockCutterTier;
public ItemRockCutter() {
super(Item.ToolMaterial.EMERALD);
super(ToolMaterial.DIAMOND);
setUnlocalizedName("techreborn.rockcutter");
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);

View file

@ -5,7 +5,7 @@ import techreborn.config.ConfigTechReborn;
public class ItemSteelJackhammer extends ItemJackhammer {
public ItemSteelJackhammer() {
super(ToolMaterial.EMERALD, "techreborn.steelJackhammer", ConfigTechReborn.SteelJackhammerCharge, ConfigTechReborn.SteelJackhammerTier);
super(ToolMaterial.DIAMOND, "techreborn.steelJackhammer", ConfigTechReborn.SteelJackhammerCharge, ConfigTechReborn.SteelJackhammerTier);
this.cost = 100;
this.efficiencyOnProperMaterial = 16F;
}

View file

@ -3,6 +3,9 @@ package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
@ -19,10 +22,10 @@ public class ItemTechManual extends ItemTR implements ITexturedItem {
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, EnumHand hand) {
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world,
(int) player.posX, (int) player.posY, (int) player.posY);
return itemStack;
return new ActionResult<>(EnumActionResult.SUCCESS, itemStackIn);
}
@Override

View file

@ -18,11 +18,6 @@ public class ItemTreeTap extends Item implements ITexturedItem {
setCreativeTab(TechRebornCreativeTab.instance);
}
@Override
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) {
return super.onItemRightClick(itemStackIn, worldIn, playerIn);
}
@Override
public boolean showDurabilityBar(ItemStack stack) {
if(stack.getMetadata()!=0){

View file

@ -94,7 +94,8 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
world.spawnEntityInWorld(entityItem);
}
}
world.playSoundAtEntity(player, "techreborn:block_dismantle", 0.8F, 1F);
//TODO 1.9 sounds
//world.playSoundAtEntity(player, "techreborn:block_dismantle", 0.8F, 1F);
if(!world.isRemote){
world.setBlockState(pos, Blocks.air.getDefaultState(), 2);
}

View file

@ -2,40 +2,32 @@ package techreborn.parts;
import net.minecraft.util.IStringSerializable;
import reborncore.api.power.EnumPowerTier;
import techreborn.parts.types.CopperCable;
import techreborn.parts.types.GlassFiberCable;
import techreborn.parts.types.GoldCable;
import techreborn.parts.types.HVCable;
import techreborn.parts.types.InsulatedCopperCable;
import techreborn.parts.types.InsulatedGoldCable;
import techreborn.parts.types.InsulatedHVCable;
import techreborn.parts.types.TinCable;
public enum EnumCableType implements IStringSerializable {
COPPER("copper", "techreborn:blocks/cables/copper_cable", 128, 12.0, true, CopperCable.class, EnumPowerTier.LOW),
TIN("tin", "techreborn:blocks/cables/tin_cable", 32, 12.0, true, TinCable.class, EnumPowerTier.MEDIUM),
GOLD("gold", "techreborn:blocks/cables/gold_cable", 512, 12.0, true, GoldCable.class, EnumPowerTier.MEDIUM),
HV("hv", "techreborn:blocks/cables/hv_cable", 2048, 12.0, true, HVCable.class, EnumPowerTier.HIGH),
GLASSFIBER("glassfiber", "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, GlassFiberCable.class, EnumPowerTier.HIGH),
ICOPPER("insulatedcopper", "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, InsulatedCopperCable.class, EnumPowerTier.LOW),
IGOLD("insulatedgold", "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, false, InsulatedGoldCable.class, EnumPowerTier.HIGH),
IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, InsulatedHVCable.class, EnumPowerTier.HIGH);
COPPER("copper", "techreborn:blocks/cables/copper_cable", 128, 12.0, true, EnumPowerTier.LOW),
TIN("tin", "techreborn:blocks/cables/tin_cable", 32, 12.0, true, EnumPowerTier.MEDIUM),
GOLD("gold", "techreborn:blocks/cables/gold_cable", 512, 12.0, true, EnumPowerTier.MEDIUM),
HV("hv", "techreborn:blocks/cables/hv_cable", 2048, 12.0, true, EnumPowerTier.HIGH),
GLASSFIBER("glassfiber", "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, EnumPowerTier.HIGH),
ICOPPER("insulatedcopper", "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, EnumPowerTier.LOW),
IGOLD("insulatedgold", "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, false, EnumPowerTier.HIGH),
IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, EnumPowerTier.HIGH);
private String friendlyName;
public String textureName = "minecraft:blocks/iron_block";
public int transferRate = 128;
public double cableThickness = 3.0;
public boolean canKill = false;
public Class<? extends CableMultipart> cableClass;
//public Class<? extends CableMultipart> cableClass;
public EnumPowerTier tier;
EnumCableType(String friendlyName, String textureName, int transferRate, double cableThickness, boolean canKill, Class<? extends CableMultipart> cableClass, EnumPowerTier tier) {
EnumCableType(String friendlyName, String textureName, int transferRate, double cableThickness, boolean canKill, EnumPowerTier tier) {
this.friendlyName = friendlyName;
this.textureName = textureName;
this.transferRate = transferRate;
this.cableThickness = cableThickness / 2;
this.canKill = canKill;
this.cableClass = cableClass;
// this.cableClass = cableClass;
this.tier = tier;
}

View file

@ -6,6 +6,7 @@ import net.minecraft.util.EnumFacing;
import reborncore.api.power.EnumPowerTier;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.util.WorldUtils;
import java.util.Iterator;
@ -79,7 +80,7 @@ public class TilePlayerDectector extends TilePowerAcceptor {
useEnergy(50);
}
if(lastRedstone != redstone){
worldObj.markBlockForUpdate(getPos());
WorldUtils.updateBlock(worldObj, getPos());
worldObj.notifyNeighborsOfStateChange(getPos(), worldObj.getBlockState(getPos()).getBlock());
}
}