Résolu Problème avec une modification de mod
-
Salut
J’ai commencer hier soir a modifier le mod tinkerconstruct mais je ne comprend pas deux trois chose
Le mod quand je mes les sources avec mantle, codechikencore ect…
une dizaine d’erreur reste
:::package tconstruct.client.tabs; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.*; import java.util.*; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.network.play.client.C0DPacketCloseWindow; import net.minecraftforge.client.event.GuiScreenEvent; public class TabRegistry { private static ArrayList <abstracttab>tabList = new ArrayList<abstracttab>(); public static void registerTab (AbstractTab tab) { tabList.add(tab); } public static ArrayList <abstracttab>getTabList () { return tabList; } @SideOnly(Side.CLIENT) @SubscribeEvent public void guiPostInit (GuiScreenEvent.InitGuiEvent.Post event) { if ((event.gui instanceof GuiInventory)) { int xSize = 176; int ySize = 166; int guiLeft = (event.gui.width - xSize) / 2; int guiTop = (event.gui.height - ySize) / 2; updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); addTabsToList(event.gui.buttonList); } } private static Minecraft mc = FMLClientHandler.instance().getClient(); public static void openInventoryGui () { mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); GuiInventory inventory = new GuiInventory(mc.thePlayer); mc.displayGuiScreen(inventory); } public static void updateTabValues (int cornerX, int cornerY, Class selectedButton) { int count = 2; for (int i = 0; i < tabList.size(); i++) { AbstractTab t = tabList.get(i); if (t.shouldAddToList()) { t.id = count; t.xPosition = cornerX + (count - 2) * 28; t.yPosition = cornerY - 28; t.enabled = !t.getClass().equals(selectedButton); count++; } } } public static void addTabsToList (List buttonList) { for (AbstractTab tab : tabList) { if (tab.shouldAddToList()) { buttonList.add(tab); } } } }
:::
L’erreur est ici : addTabsToList(event.gui.buttonList); sur buttonList et éclipse me cite : The field GuiScreen.buttonList is not visibleJ’ai d’autre erreur du genre : field….
:::
package tconstruct.tools.entity; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import io.netty.buffer.ByteBuf; import java.util.*; import net.minecraft.block.Block; import net.minecraft.crash.*; import net.minecraft.entity.*; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.player.*; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; import net.minecraft.item.*; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.play.server.S2BPacketChangeGameState; import net.minecraft.util.*; import net.minecraft.world.World; public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnData { public ItemStack returnStack; public float mass; public int baseDamage; private float knockbackStrengthMod; Random random = new Random(); public ArrowEntity(World par1World) { super(par1World); } public ArrowEntity(World world, EntityLivingBase living, float baseSpeed, ItemStack stack) { super(world, living, baseSpeed); this.returnStack = stack; NBTTagCompound toolTag = stack.getTagCompound().getCompoundTag("InfiTool"); this.mass = toolTag.getFloat("Mass"); this.baseDamage = toolTag.getInteger("Attack"); } public ArrowEntity(World world, double x, double y, double z, ItemStack stack) { super(world, x, y, z); this.returnStack = stack; NBTTagCompound toolTag = stack.getTagCompound().getCompoundTag("InfiTool"); this.mass = toolTag.getFloat("Mass"); this.baseDamage = toolTag.getInteger("Attack"); } @Override public void onCollideWithPlayer (EntityPlayer par1EntityPlayer) { if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) { boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode; if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(returnStack)) { flag = false; } if (flag) { this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); par1EntityPlayer.onItemPickup(this, 1); if(returnStack.stackSize <= 0 || this.canBePickedUp == 2) this.setDead(); } } } @Override public void onUpdate () { this.onEntityUpdate(); if (returnStack == null || returnStack.stackSize < 1) { this.setDead(); } if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f) * 180.0D / Math.PI); } Block i = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); i.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); AxisAlignedBB axisalignedbb = i.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { this.onGround = true; } if (this.arrowShake > 0) { –this.arrowShake; } if (this.inGround) { if (!worldObj.isRemote) { Block j = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); int k = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); if (j == this.field_145790_g && k == this.inData) { ++this.ticksInGround; if (this.ticksInGround == 120000) { this.setDead(); } } else { this.inGround = false; this.motionX *= (double) (this.rand.nextFloat() * 0.2F); this.motionY *= (double) (this.rand.nextFloat() * 0.2F); this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); this.ticksInGround = 0; this.ticksInAir = 0; } } } else { ++this.ticksInAir; Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); Vec3 vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec31, false, true, false); vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); if (movingobjectposition != null) { vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); } Entity entity = null; List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); double d0 = 0.0D; int l; float ySpeed; for (l = 0; l < list.size(); ++l) { Entity entity1 = (Entity) list.get(l); if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { ySpeed = 0.3F; AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double) ySpeed, (double) ySpeed, (double) ySpeed); MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31); if (movingobjectposition1 != null) { double d1 = vec3.distanceTo(movingobjectposition1.hitVec); if (d1 < d0 || d0 == 0.0D) { entity = entity1; d0 = d1; } } } } if (entity != null) { movingobjectposition = new MovingObjectPosition(entity); } if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit; if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) { movingobjectposition = null; } } float speed; float f3; if (movingobjectposition != null) { if (movingobjectposition.entityHit != null) { speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); double damageSpeed = (double) speed * this.getDamage(); damageSpeed *= baseDamage; damageSpeed /= 5D; int damageInflicted = MathHelper.ceiling_double_int(damageSpeed); if (this.getIsCritical()) { damageInflicted += this.rand.nextInt(damageInflicted / 2 + 2); } DamageSource damagesource = null; if (this.shootingEntity == null) { damagesource = DamageSource.causeArrowDamage(this, this); } else { damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity); } if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) { movingobjectposition.entityHit.setFire(5); } if (returnStack.hasTagCompound()) { int fireAspect = 0; NBTTagCompound toolTags = returnStack.getTagCompound().getCompoundTag("InfiTool"); if (toolTags.hasKey("Fiery") || toolTags.hasKey("Lava")) { fireAspect *= 4; if (toolTags.hasKey("Fiery")) { fireAspect += toolTags.getInteger("Fiery") / 5 + 1; } if (toolTags.getBoolean("Lava")) { fireAspect += 3; } entity.setFire(fireAspect); } int drain = toolTags.getInteger("Necrotic") * 2; if (drain > 0 && shootingEntity != null && shootingEntity instanceof EntityLiving) ((EntityLiving) shootingEntity).heal(random.nextInt(drain + 1)); } if (movingobjectposition.entityHit.attackEntityFrom(damagesource, damageInflicted)) { if (movingobjectposition.entityHit instanceof EntityLivingBase) { EntityLivingBase entityliving = (EntityLivingBase) movingobjectposition.entityHit; if (!this.worldObj.isRemote) { entityliving.setArrowCountInEntity(entityliving.getArrowCountInEntity() + 1); } if (this.knockbackStrength > 0 || this.knockbackStrengthMod > 0) { f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); if (f3 > 0.0F) { float knockback = knockbackStrength + knockbackStrengthMod; movingobjectposition.entityHit.addVelocity(this.motionX * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3, 0.1D, this.motionZ * (double) knockback * 0.6000000238418579D / (double) f3); } } if (this.shootingEntity != null) { damagesource = DamageSource.causeArrowDamage(this, this); } else { damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity); } if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { ((EntityPlayerMP) this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0)); // TConstruct.packetPipeline.sendTo(new // S2BPacketChangeGameState(6, 0), // (EntityPlayerMP) this.shootingEntity); } } this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); if (!(movingobjectposition.entityHit instanceof EntityEnderman)) { this.motionX = 0; this.motionZ = 0; if (movingobjectposition.entityHit instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) movingobjectposition.entityHit; if (canBePickedUp == 2 || player.inventory.addItemStackToInventory(returnStack)) this.setDead(); } else if (movingobjectposition.entityHit instanceof EntityLivingBase) { EntityLivingBase living = (EntityLivingBase) movingobjectposition.entityHit; if (canBePickedUp == 2 || addItemStackToInventory(returnStack, living)) this.setDead(); } } } else { this.motionX *= -0.10000000149011612D; this.motionY *= -0.10000000149011612D; this.motionZ *= -0.10000000149011612D; this.rotationYaw += 180.0F; this.prevRotationYaw += 180.0F; this.ticksInAir = 0; } } else { this.field_145791_d = movingobjectposition.blockX; this.field_145792_e = movingobjectposition.blockY; this.field_145789_f = movingobjectposition.blockZ; this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); this.motionX = (double) ((float) (movingobjectposition.hitVec.xCoord - this.posX)); this.motionY = (double) ((float) (movingobjectposition.hitVec.yCoord - this.posY)); this.motionZ = (double) ((float) (movingobjectposition.hitVec.zCoord - this.posZ)); speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); this.posX -= this.motionX / (double) speed * 0.05000000074505806D; this.posY -= this.motionY / (double) speed * 0.05000000074505806D; this.posZ -= this.motionZ / (double) speed * 0.05000000074505806D; this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); this.inGround = true; this.arrowShake = 0; this.setIsCritical(false); if (this.field_145790_g != Blocks.air) { this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this); } } } if (this.getIsCritical()) { for (l = 0; l < 4; ++l) { this.worldObj.spawnParticle("crit", this.posX + this.motionX * (double) l / 4.0D, this.posY + this.motionY * (double) l / 4.0D, this.posZ + this.motionZ * (double) l / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); } } this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) speed) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ; } while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { this.prevRotationPitch += 360.0F; } while (this.rotationYaw - this.prevRotationYaw < -180.0F) { this.prevRotationYaw -= 360.0F; } while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { this.prevRotationYaw += 360.0F; } this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; float dropSpeed = 0.99F; float speedMod = 1.05f + (mass / 1.26F) / 6F; ySpeed = 0.05F * speedMod; if (this.isInWater()) { for (int j1 = 0; j1 < 4; ++j1) { f3 = 0.25F; this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) f3, this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX, this.motionY, this.motionZ); } dropSpeed = 0.8F; } this.motionX *= (double) dropSpeed; this.motionY *= (double) dropSpeed; this.motionZ *= (double) dropSpeed; this.motionY -= (double) ySpeed; this.setPosition(this.posX, this.posY, this.posZ); this.func_145775_I(); } } public boolean addItemStackToInventory (ItemStack par1ItemStack, EntityLivingBase living) { if (par1ItemStack == null) { return false; } else { try { int stackSize; do { stackSize = par1ItemStack.stackSize; par1ItemStack.stackSize = this.storePartialItemStack(par1ItemStack, living); } while (par1ItemStack.stackSize > 0 && par1ItemStack.stackSize < stackSize); return par1ItemStack.stackSize < stackSize; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding item to inventory"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being added"); // TODO is this needed??? // crashreportcategory.addCrashSection("Item ID", // Integer.valueOf(par1ItemStack.itemID)); crashreportcategory.addCrashSection("Item data", Integer.valueOf(par1ItemStack.getItemDamage())); // crashreportcategory.addCrashSectionCallable("Item name", new // CallableItemName(this, par1ItemStack)); throw new ReportedException(crashreport); } } } public int getFirstEmptyStack (EntityLivingBase living) { for (int i = 0; i < 5; ++i) { if (living.getEquipmentInSlot(i) == null) { return i; } } return -1; } private int storePartialItemStack (ItemStack par1ItemStack, EntityLivingBase living) { int stackSize = par1ItemStack.stackSize; int slotID; if (!par1ItemStack.isStackable()) { slotID = this.getFirstEmptyStack(living); if (slotID < 0) { return stackSize; } else { living.setCurrentItemOrArmor(slotID, par1ItemStack.copy()); if (living instanceof EntityLiving) ((EntityLiving) living).setEquipmentDropChance(slotID, 2.0f); return 0; } } else { slotID = this.storeItemStack(par1ItemStack, living); if (slotID < 0) { slotID = this.getFirstEmptyStack(living); } if (slotID < 0) { return stackSize; } else { ItemStack stack = living.getEquipmentInSlot(slotID); if (stack == null) { living.setCurrentItemOrArmor(slotID, par1ItemStack.copy()); if (living instanceof EntityLiving) ((EntityLiving) living).setEquipmentDropChance(slotID, 2.0f); return 0; } else { int l = stackSize; if (stackSize > stack.getMaxStackSize() - stack.stackSize) { l = stack.getMaxStackSize() - stack.stackSize; } if (l > 64 - stack.stackSize) { l = 64 - stack.stackSize; } if (l == 0) { return stackSize; } else { stackSize -= l; stack.stackSize += l; living.setCurrentItemOrArmor(slotID, stack); if (living instanceof EntityLiving) ((EntityLiving) living).setEquipmentDropChance(slotID, 2.0f); return stackSize; } } } } } private int storeItemStack (ItemStack par1ItemStack, EntityLivingBase living) { for (int slotID = 0; slotID < 5; ++slotID) { ItemStack stack = living.getEquipmentInSlot(slotID); if (stack != null && stack.isItemEqual(par1ItemStack) && ItemStack.areItemStackTagsEqual(stack, par1ItemStack) && stack.isStackable() && stack.stackSize < stack.getMaxStackSize()) { return slotID; } } return -1; } public void setKnockbackModStrength (float par1) { this.knockbackStrengthMod = par1; } @Override public void writeEntityToNBT (NBTTagCompound tags) { super.writeEntityToNBT(tags); tags.setTag("Throwable", this.returnStack.writeToNBT(new NBTTagCompound())); } @Override public void readEntityFromNBT (NBTTagCompound tags) { super.readEntityFromNBT(tags); this.returnStack = ItemStack.loadItemStackFromNBT(tags.getCompoundTag("Throwable")); } @Override public void writeSpawnData (ByteBuf data) { if (!returnStack.hasTagCompound()) this.kill(); NBTTagCompound tags = returnStack.getTagCompound().getCompoundTag("InfiTool"); ByteBufUtils.writeItemStack(data, returnStack); data.writeFloat(rotationYaw); data.writeFloat(mass); data.writeInt(tags.getInteger("RenderHandle")); data.writeInt(tags.getInteger("RenderHead")); data.writeInt(tags.getInteger("RenderAccessory")); int effects = 0; if (tags.hasKey("Effect1")) effects++; if (tags.hasKey("Effect2")) effects++; if (tags.hasKey("Effect3")) effects++; if (tags.hasKey("Effect4")) effects++; if (tags.hasKey("Effect5")) effects++; if (tags.hasKey("Effect6")) effects++; data.writeInt(effects); switch (effects) { case 6: data.writeInt(tags.getInteger("Effect6")); case 5: data.writeInt(tags.getInteger("Effect5")); case 4: data.writeInt(tags.getInteger("Effect4")); case 3: data.writeInt(tags.getInteger("Effect3")); case 2: data.writeInt(tags.getInteger("Effect2")); case 1: data.writeInt(tags.getInteger("Effect1")); } } @Override public void readSpawnData (ByteBuf data) { returnStack = ByteBufUtils.readItemStack(data); rotationYaw = data.readFloat(); mass = data.readFloat(); NBTTagCompound compound = new NBTTagCompound(); NBTTagCompound toolTag = new NBTTagCompound(); toolTag.setInteger("RenderHandle", data.readInt()); toolTag.setInteger("RenderHead", data.readInt()); toolTag.setInteger("RenderAccessory", data.readInt()); switch (data.readInt()) { case 6: toolTag.setInteger("Effect6", data.readInt()); case 5: toolTag.setInteger("Effect5", data.readInt()); case 4: toolTag.setInteger("Effect4", data.readInt()); case 3: toolTag.setInteger("Effect3", data.readInt()); case 2: toolTag.setInteger("Effect2", data.readInt()); case 1: toolTag.setInteger("Effect1", data.readInt()); } compound.setTag("InfiTool", toolTag); returnStack.setTagCompound(compound); } public ItemStack getEntityItem () { return returnStack; } }
:::
Quelques screen :
https://gyazo.com/3d719c3c23b3a8b2fbeec14616bfcad3
https://gyazo.com/0444948b52860bb2e56a8017d1f1c37f
https://gyazo.com/e0e17ee530721e9b5097addcccb64412
https://gyazo.com/6023169d29338fc13d6879b07916524b
https://gyazo.com/79ee3f8dcc022b7fce9dfb8b6e722851Voila donc si jamais quelqu’un avais des réponse a tous sa meme si c’est du de vous montrer toute les erreur</abstracttab></abstracttab></abstracttab>
-
Salut,
Le mod utilise un transformateur d’accès : https://github.com/SlimeKnights/TinkersConstruct/blob/master/resources/META-INF/TConstruct_at.cfg
Cela permet de passer en public des variables / méthodes privées ou protégées.Clone directement le projet git de TinkersConstruct et utilises fichier gradlew qui se trouve dans le projet pour faire le setup, normalement il devrait prendre en compte le transformateur d’accès.
-
Alors on peut dire que git est moi je mis connais un peu mais faudrais que je sache un peu comment mis prendre =/
Ensuite j’ai aussi des probleme avec les gui.left ect qui sont pas prise en charge
-
https://github.com/SlimeKnights/TinkersConstruct/archive/master.zip
Tu as juste à extraire le zip quelque part et faire un setup. -
Je me prends cette erreur : https://gyazo.com/cc358c2b819717b88083a268a314a3f4
Je l’ai pris via github
-
Enlève la task buildInfo
-
Oula ? mais c’est ou ?
-
/ Finds and sets version data task buildInfo { def cmd = "git rev-parse –short HEAD" def proc = cmd.execute() proc.waitFor() if (proc.exitValue() == 0) { ext.revision = proc.text.trim() } else { ext.revision = "GITBORK" } if (System.getenv().BUILD_NUMBER != null) { ext.buildNum = "build${System.getenv().BUILD_NUMBER}" } else { ext.buildNum = "DEV.${project.buildInfo.revision}" }
Quand je la supprime j’ai une autre erreur : A problem occurred evaluating root project ‘TConstruct’.
Could not find property ‘buildInfo’ on root project ‘TConstruct’.
-
Enlève de task buildInfo à “version =”
-
/* * Tinkers Construct * Master build file * * Authors: Sunstrike, ProgWML6 * Help from AbrarSyed */ buildscript { repositories { mavenCentral() mavenLocal() maven { name = 'ForgeFS' url = 'http://files.minecraftforge.net/maven' } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } repositories { maven { name 'CB Maven FS' url "http://chickenbones.net/maven/" } /*maven { name "ProfMobius Maven FS" url "http://mobiusstrip.eu/maven" }*/ maven { name 'DVS1 Maven FS' url 'http://dvs1.progwml6.com/files/maven' } maven { name 'ForgeFS' url 'http://files.minecraftforge.net/maven' } } // Load ForgeGradle apply plugin: 'forge' group = 'tconstruct' // Define properties file ext.configFile = file "build.properties" configFile.withReader { // Load config. It shall from now be referenced as simply config or project.config def prop = new Properties() prop.load(it) project.ext.config = new ConfigSlurper().parse prop } configurations { deployerJars } dependencies { compile "mantle:Mantle:${config.minecraft_version}-${config.mantle_version}:deobf" compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.CCLIB_version}:dev" compile "codechicken:CodeChickenCore:${config.minecraft_version}-${config.ccc_version}:dev" compile "codechicken:NotEnoughItems:${config.minecraft_version}-${config.NEI_version}:dev" compile "codechicken:ForgeMultipart:${config.minecraft_version}-${config.fmp_version}:dev" //compile "mcp.mobius.waila:Waila:${config.waila_version}:dev" deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2' } version = "${config.minecraft_version}-${artifact_version}" minecraft { version = config.minecraft_version + "-" + config.forge_version runDir = 'run' replace '${version}', project.version } sourceSets { main { resources { srcDir 'resources' } } } processResources { inputs.property "version", artifact_version inputs.property "MCversion", config.minecraft_version // Replace stuff in text files, not binaries. from(sourceSets.main.resources.srcDirs) { include '**/*.info' // Replace version and MCversion expand 'version':artifact_version,'MCversion':config.minecraft_version } // Copy everything else that's not text from(sourceSets.main.resources.srcDirs) { exclude '**/*.info' } } // Add Coremod Manifest jar { manifest { attributes 'FMLAT': 'TConstruct_at.cfg' } } // Create deobf dev jars task deobfJar(type: Jar) { from sourceSets.main.output classifier = 'deobf' manifest { attributes 'FMLAT': 'TConstruct_at.cfg' } } // Create API library jar task libJar(type: Jar) { from(sourceSets.main.java) { include "tconstruct/library/**/*" } classifier = 'lib' } // Create Maven source jar task sourceJar(type: Jar, dependsOn:classes) { classifier = 'sources' from sourceSets.main.allJava } artifacts { archives deobfJar archives libJar archives sourceJar } // verify the properties exist.. or initialize. if (!project.hasProperty("keystore_location")) // keystore location ext.keystore_location = "."; if (!project.hasProperty("keystore_user_alias")) // keystore user alias ext.keystore_user_alias = ""; if (!project.hasProperty("sftp_username")) ext.sftp_username = ""; if (!project.hasProperty("sftp_key")) ext.sftp_key = ""; if (!project.hasProperty("keystore_user_password")) // keystore user pass ext.keystore_user_password = ""; if (System.getenv().KSK_PW != null) ext.keystore_user_password =System.getenv().KSK_PW; task("uploadJars", dependsOn:"build") { description = "uploads JARs" if (project.hasProperty("local_maven") || project.hasProperty("sftp_maven")) { apply plugin: 'maven' uploadArchives { repositories { if(project.hasProperty("local_maven")) { mavenDeployer { repository(url: "file://${local_maven}") } } if(project.hasProperty("sftp_maven")) { repositories.mavenDeployer { configuration = configurations.deployerJars repository(url: "sftp://${sftp_maven}"){ authentication(userName: "${sftp_username}",privateKey: "${sftp_key}")} } } } } } }
-
Je t’ai dit d’enlever aussi la version
-
C’est pareil
- What went wrong:
A problem occurred evaluating root project ‘TConstruct’.
Could not find property ‘artifact_version’ on task ‘:processResources’.
- What went wrong:
-
Envoi le build.gradle
-
Mis plus haut en “code”
-
Dans celui que tu m’as envoyé il y a la version…
-
/* * Tinkers Construct * Master build file * * Authors: Sunstrike, ProgWML6 * Help from AbrarSyed */ buildscript { repositories { mavenCentral() mavenLocal() maven { name = 'ForgeFS' url = 'http://files.minecraftforge.net/maven' } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } repositories { maven { name 'CB Maven FS' url "http://chickenbones.net/maven/" } /*maven { name "ProfMobius Maven FS" url "http://mobiusstrip.eu/maven" }*/ maven { name 'DVS1 Maven FS' url 'http://dvs1.progwml6.com/files/maven' } maven { name 'ForgeFS' url 'http://files.minecraftforge.net/maven' } } // Load ForgeGradle apply plugin: 'forge' group = 'tconstruct' // Define properties file ext.configFile = file "build.properties" configFile.withReader { // Load config. It shall from now be referenced as simply config or project.config def prop = new Properties() prop.load(it) project.ext.config = new ConfigSlurper().parse prop } configurations { deployerJars } dependencies { compile "mantle:Mantle:${config.minecraft_version}-${config.mantle_version}:deobf" compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.CCLIB_version}:dev" compile "codechicken:CodeChickenCore:${config.minecraft_version}-${config.ccc_version}:dev" compile "codechicken:NotEnoughItems:${config.minecraft_version}-${config.NEI_version}:dev" compile "codechicken:ForgeMultipart:${config.minecraft_version}-${config.fmp_version}:dev" //compile "mcp.mobius.waila:Waila:${config.waila_version}:dev" deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2' } minecraft { version = config.minecraft_version + "-" + config.forge_version runDir = 'run' replace '${version}', project.version } sourceSets { main { resources { srcDir 'resources' } } } processResources { inputs.property "version", artifact_version inputs.property "MCversion", config.minecraft_version // Replace stuff in text files, not binaries. from(sourceSets.main.resources.srcDirs) { include '**/*.info' // Replace version and MCversion expand 'version':artifact_version,'MCversion':config.minecraft_version } // Copy everything else that's not text from(sourceSets.main.resources.srcDirs) { exclude '**/*.info' } } // Add Coremod Manifest jar { manifest { attributes 'FMLAT': 'TConstruct_at.cfg' } } // Create deobf dev jars task deobfJar(type: Jar) { from sourceSets.main.output classifier = 'deobf' manifest { attributes 'FMLAT': 'TConstruct_at.cfg' } } // Create API library jar task libJar(type: Jar) { from(sourceSets.main.java) { include "tconstruct/library/**/*" } classifier = 'lib' } // Create Maven source jar task sourceJar(type: Jar, dependsOn:classes) { classifier = 'sources' from sourceSets.main.allJava } artifacts { archives deobfJar archives libJar archives sourceJar } // verify the properties exist.. or initialize. if (!project.hasProperty("keystore_location")) // keystore location ext.keystore_location = "."; if (!project.hasProperty("keystore_user_alias")) // keystore user alias ext.keystore_user_alias = ""; if (!project.hasProperty("sftp_username")) ext.sftp_username = ""; if (!project.hasProperty("sftp_key")) ext.sftp_key = ""; if (!project.hasProperty("keystore_user_password")) // keystore user pass ext.keystore_user_password = ""; if (System.getenv().KSK_PW != null) ext.keystore_user_password =System.getenv().KSK_PW; task("uploadJars", dependsOn:"build") { description = "uploads JARs" if (project.hasProperty("local_maven") || project.hasProperty("sftp_maven")) { apply plugin: 'maven' uploadArchives { repositories { if(project.hasProperty("local_maven")) { mavenDeployer { repository(url: "file://${local_maven}") } } if(project.hasProperty("sftp_maven")) { repositories.mavenDeployer { configuration = configurations.deployerJars repository(url: "sftp://${sftp_maven}"){ authentication(userName: "${sftp_username}",privateKey: "${sftp_key}")} } } } } } }
-
Plus simple -> tu installes git et tu gardes le build.gradle comme il est de base …
-
J’ai déja git
-
Il n’est pas dans ton path alors, essaie dans ton dossier de faire “git –help”
-
Ne marche pas comment je fais xD ?