• Communication bidirectionnelle Forge Spigot

    Déplacé Résolu 1.12.2
    10
    0 Votes
    10 Messages
    927 Vues
    A
    @sportday24 Dans ma deuxième réponse (où j’ai trouvé la solution), on se trouve côté serveur. Plus spécifiquement dans le message listener, à partir de la ligne 11 inclus. Dans ma deuxième réponse, j’utilise la librarie ProtocolLib. Puis je traite côté client ce paquet dans la classe GenericMessage.
  • Nom de fonctions glitch

    Déplacé Résolu 1.12.2
    16
    1 Votes
    16 Messages
    846 Vues
    robin4002R
    Je ne sais pas non plus, et je n’ai pas le temps de regarder en détails, désolé.
  • Sauvegarder une donnée en 1.12.2

    Déplacé Résolu 1.12.2
    21
    2 Votes
    21 Messages
    2k Vues
    pazzazzoP
    @UtopiePhysique oui mais comment je dis que joueur qui perde l’argent et celui qui gagner l’argent Ha non j’ai pas utiliser se tuto moi x) je vais regarder se tuto et comme c’est résolu stp dm moi discord pazzazzo#9999
  • Crash serveur lors de son démarage

    Déplacé Résolu 1.12.2
    12
    1 Votes
    12 Messages
    499 Vues
    pazzazzoP
    Ho oui *tn MERCIIIIII!
  • Effet de healt-boost réitéré a chaque tick

    Déplacé Résolu 1.12.2
    22
    0 Votes
    22 Messages
    1k Vues
    I
    le dernier soucis est que graphiquement c’est pas beau, quand je retire les pièces d’armure, certains disparaissent graphiquement,d’autre non, parfois obligé de se /kill pour actualiser graphiquement
  • Changer la taille du joueur

    Déplacé Résolu 1.12.2
    12
    0 Votes
    12 Messages
    1k Vues
    S
    @FeedBack merci
  • Vérifier si le a un item dans l'inventaire

    Déplacé Résolu 1.12.2
    4
    0 Votes
    4 Messages
    473 Vues
    U
    @FeedBack En effet c’est pas super claire et simple pour ce genre de tâche, c’est étonnant, j’espère que ce sera modifié un jour … Voici 2 méthodes que j’ai faites avec un exemple en utilisant une commande /test: public static void register(CommandDispatcher<CommandSource> dispatcher) { dispatcher.register( LiteralArgumentBuilder.<CommandSource>literal("test") .executes(ctx -> cmdClaim(ctx.getSource())) ); } private static int cmdClaim(CommandSource src) { // Si c'est un joueur physique (et pas une console): if (src.getEntity() instanceof PlayerEntity) { PlayerEntity joueur = (PlayerEntity)src.getEntity(); // On simplifie la prise d'entité joueur // On vérifie combien on possède de livres src.sendFeedback(new StringTextComponent(ChatFormatting.DARK_PURPLE + "Le joueur possède: " + getQtyItem(joueur, Items.BOOK) + " livres."), false); if (getQtyItem(joueur, Items.BOOK) >= 2) { // Si on possède 2 livres ou plus removeItems(joueur, Items.BOOK, 2); // On supprime 2 livres src.sendFeedback(new StringTextComponent(ChatFormatting.GREEN + "2 livres supprimé."), false); } else { src.sendFeedback(new StringTextComponent(ChatFormatting.RED + "La quantité de livres est insuffisante."), false); } // On vérifie combien on possède de livres à nouveau src.sendFeedback(new StringTextComponent(ChatFormatting.DARK_PURPLE + "Le joueur possède: " + getQtyItem(joueur, Items.BOOK) + " livres."), false); } return 1; } // Permet de récupérer la quantité d'items d'un joueur (tout stacks inclus) private static int getQtyItem(PlayerEntity joueur, Item item) { int nombreItems = 0; for(int slot = 0; slot <= joueur.inventory.getSizeInventory(); slot++) { // Pour chaque slots dans l'inventaire ItemStack getIS = joueur.inventory.getStackInSlot(slot); // On récupère l'ItemStack du slot if (getIS.getItem() == item) nombreItems += getIS.getCount(); // Si l'ItemStack correspond à l'item on compte } return nombreItems; } // Permet de retirer la quantité d'items d'un joueur (tout stacks inclus) private static void removeItems(PlayerEntity joueur, Item item, int quantity) { for(int slot = 0; slot <= joueur.inventory.getSizeInventory(); slot++) { // Pour chaque slots dans l'inventaire ItemStack getIS = joueur.inventory.getStackInSlot(slot); // On récupère l'ItemStack du slot if (getIS.getItem() == item) { // Si l'ItemStack correspond à l'item if (getIS.getCount() >= quantity) { // Si la quantité est supérieur au retrait joueur.inventory.getStackInSlot(slot).setCount(getIS.getCount() - quantity); break; } else { quantity -= getIS.getCount(); joueur.inventory.getStackInSlot(slot).setCount(0); } } } } Que ce sois 1 seul stack, 10 stack, 36 stacks (tout l’inventaire), il repère bien la quantité et supprimes tout les stacks jusqu’à la quantité voulu. Tu n’as plus qu’à passer cela en 1.12.2 et de transformer ça a ta sauce Screen: Spoiler J’ai changé la quantité vérifier et celle supprimée, mais pas le texte donc ça dit “2” mais c’est “5” livres. [image: maih.png] [image: j2kl.png] PS: j’utilise joueur.inventory.getStackInSlot(slot).setCount(); au lieux de getIS.setCount(); sinon, pour je ne sais quel raisons, c’est uniquement le dernier stack supprimé qui est pris en compte.
  • Drop de mon minerais par une variable

    Déplacé Résolu 1.12.2
    12
    0 Votes
    12 Messages
    513 Vues
    I
    merci beaucoup maintenant tout fonctionne, merci a vous deux
  • Save Capability

    Déplacé Résolu 1.12.2
    3
    0 Votes
    3 Messages
    181 Vues
    FeedBackF
    @robin4002 Merci ^^ J’avais oublié de le faire pour cet event
  • Probleme de rendu de bloc.

    Déplacé Résolu 1.12.2
    3
    0 Votes
    3 Messages
    201 Vues
    S
    Merci tout fonctionne maintenant.
  • Créer une configuration ServerSide

    Déplacé Résolu 1.12.2
    2
    0 Votes
    2 Messages
    137 Vues
    robin4002R
    Bonjour, Ajoutes le code lié au config dans le serveur proxy. De cette manière la config ne sera que présente sur un serveur dédié.
  • Commande inutilisable

    Déplacé Résolu 1.12.2
    12
    0 Votes
    12 Messages
    441 Vues
    robin4002R
    Attention par contre, au début de ta fonction execute il faut faire le cast après le check d’instance, comme ceci : if(player instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP)sender; Sinon tu vas avoir une erreur si tu utilises la commande depuis la console du serveur.
  • rendu animé

    Déplacé Résolu 1.12.2
    4
    1
    1 Votes
    4 Messages
    302 Vues
    pazzazzoP
    affaire résolue! j’ai ajouté sa energy_crystal.png.mcmeta dns le dossier ressource {"animation":{"frametime":5}} et voici mon energy_crystal.png [image: 1596979851374-energy_crystal.png] le dossier json ne change pas
  • Mobs qui spawn trop

    Déplacé Résolu 1.12.2
    9
    0 Votes
    9 Messages
    554 Vues
    pazzazzoP
    essay sa package com.drastic.redskyll.world.dimension.moon; import java.util.List; import java.util.Random; import javax.annotation.Nullable; import com.drastic.redskyll.entity.EntityMinion; import com.drastic.redskyll.init.BiomeInit; import com.drastic.redskyll.init.BlockInit; import com.google.common.collect.Lists; import net.minecraft.block.BlockFalling; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.monster.EntityGiantZombie; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome.SpawnListEntry; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.IChunkGenerator; import net.minecraft.world.gen.NoiseGeneratorOctaves; import net.minecraft.world.gen.NoiseGeneratorSimplex; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField; import net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextEnd; import net.minecraftforge.event.terraingen.TerrainGen; import net.minecraftforge.fml.common.eventhandler.Event; public class ChunkGeneratorEndTemplate implements IChunkGenerator { // Block that replaces End Stone protected static final IBlockState MAIN_BLOCK = BlockInit.MOON_ROCK.getDefaultState(); protected static final IBlockState AIR = Blocks.AIR.getDefaultState(); // List of all the mobs you want to spawn protected List<SpawnListEntry> spawnableCreatureList = Lists.<SpawnListEntry>newArrayList(); // Keep all these the same private final Random rand; private final World world; private final boolean mapFeaturesEnabled; private final BlockPos spawnPoint; private Biome[] biomesForGeneration; private int chunkX = 0, chunkZ = 0; private NoiseGeneratorOctaves lperlinNoise1, lperlinNoise2, perlinNoise1, noiseGen5, noiseGen6; private static NoiseGeneratorSimplex islandNoise; private double[] buffer; double[] pnr, ar, br; // Put map features here // e.g. private MapGenEndCity endCityGen = new MapGenEndCity(this); public ChunkGeneratorEndTemplate(World world, boolean mapFeaturesEnabled, long seed, BlockPos spawn) { this.world = world; this.mapFeaturesEnabled = mapFeaturesEnabled; this.spawnPoint = spawn; this.rand = new Random(seed); spawnableCreatureList.add(new SpawnListEntry(EntityMinion.class, 1, 1, 2)); // spawnableCreatureList.add(new SpawnListEntry(EntityGiantZombie.class, 50, 1, 2)); this.lperlinNoise1 = new NoiseGeneratorOctaves(this.rand, 16); this.lperlinNoise2 = new NoiseGeneratorOctaves(this.rand, 16); this.perlinNoise1 = new NoiseGeneratorOctaves(this.rand, 8); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.islandNoise = new NoiseGeneratorSimplex(this.rand); ContextEnd ctx = new ContextEnd(lperlinNoise1, lperlinNoise2, perlinNoise1, noiseGen5, noiseGen6, islandNoise); ctx = TerrainGen.getModdedNoiseGenerators(world, this.rand, ctx); this.lperlinNoise1 = ctx.getLPerlin1(); this.lperlinNoise2 = ctx.getLPerlin2(); this.perlinNoise1 = ctx.getPerlin(); this.noiseGen5 = ctx.getDepth(); this.noiseGen6 = ctx.getScale(); this.islandNoise = ctx.getIsland(); // Set the map features to be something // e.g. this.endCityGen = (MapGenEndCity) TerrainGen.getModdedMapGen(this.endCityGen,InitMapGenEvent.EventType.END_CITY); } public void setBlocksInChunk(int x, int z, ChunkPrimer primer) { int i = 2; int j = 3; int k = 33; int l = 3; this.buffer = this.getHeights(this.buffer, x * 2, 0, z * 2, 3, 33, 3); for(int i1 = 0; i1 < 2; ++i1) { for(int j1 = 0; j1 < 2; ++j1) { for(int k1 = 0; k1 < 32; ++k1) { double d0 = 0.25D; double d1 = this.buffer[((i1 + 0) * 3 + j1 + 0) * 33 + k1 + 0]; double d2 = this.buffer[((i1 + 0) * 3 + j1 + 1) * 33 + k1 + 0]; double d3 = this.buffer[((i1 + 1) * 3 + j1 + 0) * 33 + k1 + 0]; double d4 = this.buffer[((i1 + 1) * 3 + j1 + 1) * 33 + k1 + 0]; double d5 = (this.buffer[((i1 + 0) * 3 + j1 + 0) * 33 + k1 + 1] - d1) * 0.25D; double d6 = (this.buffer[((i1 + 0) * 3 + j1 + 1) * 33 + k1 + 1] - d2) * 0.25D; double d7 = (this.buffer[((i1 + 1) * 3 + j1 + 0) * 33 + k1 + 1] - d3) * 0.25D; double d8 = (this.buffer[((i1 + 1) * 3 + j1 + 1) * 33 + k1 + 1] - d4) * 0.25D; for(int l1 = 0; l1 < 4; ++l1) { double d9 = 0.125D; double d10 = d1; double d11 = d2; double d12 = (d3 - d1) * 0.125D; double d13 = (d4 - d2) * 0.125D; for(int i2 = 0; i2 < 8; ++i2) { double d14 = 0.125D; double d15 = d10; double d16 = (d11 - d10) * 0.125D; for(int j2 = 0; j2 < 8; ++j2) { IBlockState iblockstate = AIR; if(d15 > 0.0D) { iblockstate = MAIN_BLOCK; } int k2 = i2 + i1 * 8; int l2 = l1 + k1 * 4; int i3 = j2 + j1 * 8; primer.setBlockState(k2, l2, i3, iblockstate); d15 += d16; } d10 += d12; d11 += d13; } d1 += d5; d2 += d6; d3 += d7; d4 += d8; } } } } } public void buildSurfaces(ChunkPrimer primer) { if(!ForgeEventFactory.onReplaceBiomeBlocks(this, this.chunkX, this.chunkZ, primer, this.world)) return; for(int i = 0; i < 16; ++i) { for(int j = 0; j < 16; ++j) { int k = 1; int l = -1; IBlockState iblockstate = MAIN_BLOCK; IBlockState iblockstate1 = MAIN_BLOCK; for(int i1 = 127; i1 >= 0; --i1) { IBlockState iblockstate2 = primer.getBlockState(i, i1, j); if(iblockstate2.getMaterial() == Material.AIR) { l = -1; } else if(iblockstate2.getBlock() == Blocks.STONE) { if(l == -1) { l = 1; if(i1 >= 0) { primer.setBlockState(i, i1, j, iblockstate); } else { primer.setBlockState(i, i1, j, iblockstate1); } } else if(l > 0) { --l; primer.setBlockState(i, i1, j, iblockstate1); } } } } } } @Override public Chunk generateChunk(int x, int z) { this.chunkX = x; this.chunkZ = z; this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); this.setBlocksInChunk(x, z, chunkprimer); this.buildSurfaces(chunkprimer); if(this.mapFeaturesEnabled) { // Put map feature generation here // e.g. this.endCityGen.generate(this.world, x, z, chunkprimer); } Chunk chunk = new Chunk(this.world, chunkprimer, x, z); byte[] abyte = chunk.getBiomeArray(); for(int i = 0; i < abyte.length; ++i) { abyte[i] = (byte)Biome.getIdForBiome(BiomeInit.MOON); } chunk.generateSkylightMap(); return chunk; } public static float getIslandHeightValue(int x, int z, int p_185960_3_, int p_185960_4_) { float f = (float)(x * 2 + p_185960_3_); float f1 = (float)(z * 2 + p_185960_4_); float f2 = 100.0F - MathHelper.sqrt(f * f + f1 * f1) * 8.0F; if(f2 > 80.0F) { f2 = 80.0F; } if(f2 < -100.0F) { f2 = -100.0F; } for(int i = -12; i <= 12; ++i) { for(int j = -12; j <= 12; ++j) { long k = (long)(x + i); long l = (long)(z + j); if(k * k + l * l > 4096L && ChunkGeneratorEndTemplate.islandNoise.getValue((double)k, (double)l) < -0.8999999761581421D) { float f3 = (MathHelper.abs((float)k) * 3439.0F + MathHelper.abs((float)l) * 147.0F) % 13.0F + 9.0F; f = (float)(p_185960_3_ - i * 2); f1 = (float)(p_185960_4_ - j * 2); float f4 = 100.0F - MathHelper.sqrt(f * f + f1 * f1) * f3; if(f4 > 80.0F) { f4 = 80.0F; } if(f4 < -100.0F) { f4 = -100.0F; } if(f4 > f2) { f2 = f4; } } } } return f2; } public boolean isIslandChunk(int x, int z) { return (long)x * (long)x + (long)z * (long)z > 4096L && this.getIslandHeightValue(x, z, 1, 1) >= 0.0F; } private double[] getHeights(double[] noiseField, int x, int y, int z, int xSize, int ySize, int zSize) { InitNoiseField event = new InitNoiseField(this, noiseField, x, y, z, xSize, ySize, zSize); MinecraftForge.EVENT_BUS.post(event); if(event.getResult() == Event.Result.DENY) return event.getNoisefield(); if(noiseField == null) noiseField = new double[xSize * ySize * zSize]; double d0 = 684.412D; double d1 = 684.412D; d0 = d0 * 2.0D; this.pnr = this.perlinNoise1.generateNoiseOctaves(this.pnr, x, y, z, xSize, ySize, zSize, d0 / 80.0D, 4.277575000000001D, d0 / 80.0D); this.ar = this.lperlinNoise1.generateNoiseOctaves(this.ar, x, y, z, xSize, ySize, zSize, d0, 684.412D, d0); this.br = this.lperlinNoise2.generateNoiseOctaves(this.br, x, y, z, xSize, ySize, zSize, d0, 684.412D, d0); int i = x / 2; int j = z / 2; int k = 0; for(int l = 0; l < xSize; ++l) { for(int i1 = 0; i1 < zSize; ++i1) { float f = this.getIslandHeightValue(i, j, l, i1); for(int j1 = 0; j1 < ySize; ++j1) { double d2 = this.ar[k] / 512.0D; double d3 = this.br[k] / 512.0D; double d5 = (this.pnr[k] / 10.0D + 1.0D) / 2.0D; double d4; if(d5 < 0.0D) { d4 = d2; } else if(d5 > 1.0D) { d4 = d3; } else { d4 = d2 + (d3 - d2) * d5; } d4 = d4 - 8.0D; d4 = d4 + (double)f; int k1 = 2; if(j1 > ySize / 2 - k1) { double d6 = (double)((float)(j1 - (ySize / 2 - k1)) / 64.0F); d6 = MathHelper.clamp(d6, 0.0D, 1.0D); d4 = d4 * (1.0D - d6) + -3000.0D * d6; } k1 = 8; if(j1 < k1) { double d7 = (double)((float)(k1 - j1) / ((float)k1 - 1.0F)); d4 = d4 * (1.0D - d7) + -30.0D * d7; } noiseField[k] = d4; ++k; } } } return noiseField; } @Override public void populate(int x, int z) { BlockFalling.fallInstantly = true; ForgeEventFactory.onChunkPopulate(true, this, this.world, this.rand, x, z, false); BlockPos blockpos = new BlockPos(x * 1, 0, z * 1); if(this.mapFeaturesEnabled) { // Put map feature structure generation here // e.g. this.endCityGen.generateStructure(this.world, this.rand, new ChunkPos(x, z)); } this.world.getBiome(blockpos.add(16, 0, 16)).decorate(this.world, this.world.rand, blockpos); long i = (long)x * (long)x + (long)z * (long)z; if(i > 4096L) { float f = this.getIslandHeightValue(x, z, 1, 1); if(this.getIslandHeightValue(x, z, 1, 1) > 40.0F) { int j = this.rand.nextInt(5); for(int k = 0; k < j; ++k) { int l = this.rand.nextInt(16) + 8; int i1 = this.rand.nextInt(16) + 8; int j1 = this.world.getHeight(blockpos.add(l, 0, i1)).getY(); if(j1 > 0) { int k1 = j1 - 1; if(this.world.isAirBlock(blockpos.add(l, k1 + 1, i1)) && this.world.getBlockState(blockpos.add(l, k1, i1)).getBlock() == MAIN_BLOCK.getBlock()) { // Any plants or foliage you want to spawn (usually chorus plants) // Make sure that the plant can grow on your main block } } } } } ForgeEventFactory.onChunkPopulate(false, this, this.world, this.rand, x, z, false); BlockFalling.fallInstantly = false; } @Override public boolean generateStructures(Chunk chunkIn, int x, int z) { return true; } @Override public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) { return spawnableCreatureList; } @Nullable @Override public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) { return null; } @Override public boolean isInsideStructure(World worldIn, String structureName, BlockPos pos) { return false; } @Override public void recreateStructures(Chunk chunkIn, int x, int z) {} }
  • Click droit sur un block avec un hammer que a une chance sur 2 de drop

    Déplacé Résolu 1.12.2
    2
    0 Votes
    2 Messages
    188 Vues
    FeedBackF
    @jerem5 cadeau :beaming_face_with_smiling_eyes: @Override public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { IBlockState iblockstate = worldIn.getBlockState(pos); Block block = iblockstate.getBlock(); Random random = new Random(); if(block.equals(Blocks.IRON_ORE) && !worldIn.isRemote) { worldIn.spawnEntity(new EntityItem(worldIn, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.IRON_INGOT, random.nextInt(2)))); worldIn.setBlockToAir(pos); return EnumActionResult.SUCCESS; } else { return EnumActionResult.PASS; } }
  • Chest loot system problem

    Déplacé Résolu 1.12.2
    4
    0 Votes
    4 Messages
    274 Vues
    P
    J’y avait pas pensé sur le moment mais oui passer la le TileEntity ca seras largement moins compliquer que de créé un évent Merci je passe en résolut le reste c’est pas très compliquer xD
  • Problème Packet

    Déplacé Résolu 1.12.2
    3
    0 Votes
    3 Messages
    277 Vues
    K
    Bonjour en faite j’ai trouvé tout seul x), je me suis un peu précipiter sur le forum dans trop réfléchir. Quand j’envoyais le packet je mettais directement un int alors que quand j’ai fait une méthode pour récupérer un int ça a marché. Merci de la réponse quand même
  • Entité Fusée

    Déplacé Résolu 1.12.2
    11
    0 Votes
    11 Messages
    465 Vues
    FeedBackF
    Merci à plagueZ ! Et vu que je suis gentil voici le code: EntityFuse: public class EntityFuse extends EntityHorse { private static boolean isLaunched = false; public EntityFuse(World worldIn) { super(worldIn); } public EntityFuse(World worldIn, double x, double y, double z) { super(worldIn); this.setPosition(x, y, z); } @Override public boolean processInteract(EntityPlayer player, EnumHand hand) { ItemStack itemstack = player.getHeldItem(hand); boolean flag = !itemstack.isEmpty(); if (!this.isChild()) { if (this.isBeingRidden()) { return super.processInteract(player, hand); } } if (flag) { if (itemstack.interactWithEntity(player, this, hand)) { return true; } } if(!this.isChild()) { this.mount(player); this.playSound(SoundsHandler.FUSE_LAUNCH, 9.0F, 0); } else { return super.processInteract(player, hand); } return true; } @Override protected ResourceLocation getLootTable() { // TODO Auto-generated method stub return LootTableHandler.FUSE; } private void mount(EntityPlayer player) { this.setRearing(false); if (!world.isRemote) { player.startRiding(this); } isLaunched = true; } protected void entityInit() { super.entityInit(); } protected SoundEvent getAmbientSound() { return SoundsHandler.IDLE_FUSE; } protected SoundEvent getDeathSound() { return SoundsHandler.IDLE_FUSE; } protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return SoundsHandler.IDLE_FUSE; } protected SoundEvent getAngrySound() { return SoundsHandler.IDLE_FUSE; } @Override public void writeEntityToNBT(NBTTagCompound compound) { } @Override public void readEntityFromNBT(NBTTagCompound compound) { } @Override public boolean isAIDisabled() { // TODO Auto-generated method stub return true; } /** * Called to update the entity's position/logic. */ public void onUpdate() { super.onUpdate(); if (this.world.isRemote && this.dataManager.isDirty()) { this.dataManager.setClean(); } if(isLaunched) { this.addVelocity(0, 1, 0); } world.spawnParticle(EnumParticleTypes.FLAME, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, 0); } @Override public boolean attackable() { // TODO Auto-generated method stub return false; } @Override public boolean canBeAttackedWithItem() { // TODO Auto-generated method stub return false; } } ModelFuse: public class ModelFuse extends ModelBase { private final ModelRenderer bone; public ModelFuse() { textureWidth = 64; textureHeight = 64; bone = new ModelRenderer(this); bone.setRotationPoint(0.0F, 24.0F, -8.0F); bone.cubeList.add(new ModelBox(bone, 0, 29, -3.0F, -29.0F, 5.0F, 6, 29, 6, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 24, 59, -2.0F, -30.0F, 6.0F, 4, 1, 4, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 24, 55, -1.0F, -32.0F, 7.0F, 2, 2, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 56, 48, -1.0F, -25.0F, 11.0F, 2, 13, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 48, 36, -1.0F, -23.0F, 1.0F, 2, 10, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 48, 36, -1.0F, -21.0F, -1.0F, 2, 10, 2, 0.0F, true)); bone.cubeList.add(new ModelBox(bone, 48, 48, -1.0F, -25.0F, 3.0F, 2, 13, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 56, 36, -1.0F, -23.0F, 13.0F, 2, 10, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 56, 36, -1.0F, -21.0F, 15.0F, 2, 10, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 2, 2, 3.0F, -25.0F, 7.0F, 2, 13, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 56, 12, -7.0F, -23.0F, 7.0F, 2, 10, 2, 0.0F, true)); bone.cubeList.add(new ModelBox(bone, 56, 0, -9.0F, -21.0F, 7.0F, 2, 10, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 2, 2, -5.0F, -25.0F, 7.0F, 2, 13, 2, 0.0F, true)); bone.cubeList.add(new ModelBox(bone, 56, 24, 7.0F, -21.0F, 7.0F, 2, 10, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 56, 12, 5.0F, -23.0F, 7.0F, 2, 10, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 58, 3.0F, -6.0F, 7.0F, 2, 4, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 52, -7.0F, -4.0F, 7.0F, 2, 4, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 58, -5.0F, -6.0F, 7.0F, 2, 4, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 52, 5.0F, -4.0F, 7.0F, 2, 4, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 58, -1.0F, -6.0F, 3.0F, 2, 4, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 52, -1.0F, -4.0F, 1.0F, 2, 4, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 58, -1.0F, -6.0F, 11.0F, 2, 4, 2, 0.0F, false)); bone.cubeList.add(new ModelBox(bone, 40, 52, -1.0F, -4.0F, 13.0F, 2, 4, 2, 0.0F, false)); } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { bone.render(f5); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } RenderFuse: public class RenderFuse extends RenderLiving<EntityFuse> { protected static ModelBase modelFuse = new ModelFuse(); public static final ResourceLocation TEXTURES = new ResourceLocation(Reference.MODID + ":textures/entity/fuse.png"); public RenderFuse(RenderManager renderManager) { super(renderManager, modelFuse, 0.5f); bindTexture(TEXTURES); } @Override protected ResourceLocation getEntityTexture(EntityFuse entity) { return TEXTURES; } } Events: @SubscribeEvent public static void playerTickEvent(PlayerTickEvent e) { if(e.player.dimension == 2) { e.player.addVelocity(0, 0.02754375, 0); if(e.player.getPosition().getY() >= 299 && !e.player.world.isRemote && e.player.getRidingEntity() instanceof EntityFuse) { e.player.dismountRidingEntity(); if(e.player.world.isRemote) { e.player.sendMessage(new TextComponentString("Copyright: DrasticLp :D")); } CustomTeleporter.teleportToDimension(e.player, 0, 0, 150, 0); } } if(e.player.dimension == 0) { if(e.player.getPosition().getY() >= 299 && !e.player.world.isRemote && e.player.getRidingEntity() instanceof EntityFuse) { e.player.dismountRidingEntity(); if(e.player.world.isRemote) { e.player.sendMessage(new TextComponentString("Copyright: DrasticLp :D")); } CustomTeleporter.teleportToDimension(e.player, Reference.MOON, 0, 150, 0); } } } @SubscribeEvent public static void killFuse(LivingUpdateEvent e) { if(e.getEntityLiving().getPosition().getY()>= 298D) { //System.out.println("Pos"); if(!e.getEntityLiving().world.isRemote) { //System.out.println("world"); if(e.getEntityLiving() instanceof EntityFuse) { //System.out.println("fuse"); e.getEntityLiving().addPotionEffect(new PotionEffect(MobEffects.INSTANT_DAMAGE, 20, 20)); } } } } Texture :[image: 1595538186526-fuse.png]
  • [1.12.2] Touche personnalisé sous conditions crash

    Déplacé Résolu 1.12.2
    9
    0 Votes
    9 Messages
    475 Vues
    ScoulouneS
    @pazzazzo Tu as discord ? Scouloune #9522
  • Probleme lors du render de mes items

    Déplacé Résolu 1.12.2
    13
    2
    0 Votes
    13 Messages
    527 Vues
    T
    Mais en compilant le mod et en l’ajoutant a minecraft tout marche nickel (même si cela prend plus de temp)