-
Content Count
40 -
Joined
-
Last visited
Community Reputation
1 NeutralAbout WildTan
-
Rank
Tree Puncher
- Birthday 04/01/2005
Converted
-
Gender
Female
-
[1.15.2] Edit Minecraft Source Code or, more simply, hooks
WildTan replied to WildTan's topic in Modder Support
PR has already been there for a long time, why hasn't it been accepted yet? -
If i want to use Kotlin for modding i need to use language adapter but there are around 7 adapters and they are not work or i work terrible. How about integrating the Kotlin standard library into Forge? No effort is required from you, I will do it myself. You only need to take PR.
-
If i remove all json files, I can not see pink-black cube... Minecraft combines TESR and json models. How i can do it?
-
up
-
Yes, but i changed path in gradle. I must not do it?
-
I did all of it. I only changed file name. You can see it in files above
-
I have AT: public net.minecraft.world.dimension.DimensionType * public net.minecraft.world.dimension.DimensionType *() public-f net.minecraft.world.dimension.DimensionType * public net.minecraft.world.gen.surfacebuilders.SurfaceBuilder *() public net.minecraft.client.renderer.RenderType * public net.minecraft.client.renderer.RenderType *() public net.minecraft.world.biome.Biome * public net.minecraft.world.biome.Biome *() public net.minecraft.world.server.ServerChunkProvider * public-f net.minecraft.world.server.ServerChunkProvider * public net.minecraft.item.crafting.RecipeManager *() public net.minecraft.client.renderer.RenderState * My gradle: buildscript { ext.kotlin_version = '1.4.20-M1' repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'kotlin' version = modVersion group = modGroup archivesBaseName = modBaseName compileJava.options.encoding = "UTF-8" compileTestJava.options.encoding = "UTF-8" sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' minecraft { mappings channel: 'snapshot', version: '20201118-1.15.1' accessTransformer = file('src/main/resources/META-INF/phoenix_at.cfg') runs { client { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' mods { phoenix { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { phoenix { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' args '--mod', 'phoenix', '--all', '--output', file('src/generated/resources/') mods { phoenix { source sourceSets.main } } } } } repositories { mavenCentral() maven { // Мавен, который поддерживает JEI. name = "Progwml6 maven" url = "http://dvs1.progwml6.com/files/maven" } maven { // Мавен, который поддерживает JEI, для резерва. name = "ModMaven" url = "modmaven.k-4u.nl" } maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } mavenCentral() jcenter() } dependencies { minecraft 'net.minecraftforge:forge:1.15.2-31.2.46' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api") runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}") } compileKotlin { kotlinOptions { jvmTarget = "1.8" } } compileTestKotlin { kotlinOptions { jvmTarget = "1.8" } } jar { manifest { attributes 'FMLAT': 'phoenix_at.cfg' attributes([ "Specification-Title": "phoenix", "Specification-Vendor": "phoenix", "Specification-Version": "1", "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" : "wildtan", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } AT works it testing client but not in real client.
-
Thanks!
-
I have entity: class KnifeEntity : ThrowableEntity { var knife = ItemStack(PhoenixItems.ZIRCONIUM_KNIFE.get()) var isReal = false; constructor(type: EntityType<KnifeEntity>, worldIn: World) : super(type, worldIn) constructor(worldIn: World, owner: LivingEntity, isReal: Boolean) : super(PhoenixEntities.KNIFE.get(), owner, worldIn) { this.isReal = isReal; } @OnlyIn(Dist.CLIENT) override fun handleStatusUpdate(id: Byte) { if (id.toInt() == 3) { for (i in 0..7) { //Появляются частицы лавы. В обычном майнкрафте они образуются на потолке, если сверху лава. world.addParticle(ParticleTypes.RAIN, posX, posY, posZ, 0.0, 0.0, 0.0) } } } override fun onImpact(result: RayTraceResult) { if (!world.isRemote) { var dropItem = isReal dropItem = when (result.type) { ENTITY -> dropItem and (knife.item as KnifeItem).onHitEntity(world, owner, this, (result as EntityRayTraceResult).entity, knife) BLOCK -> dropItem and (knife.item as KnifeItem).onHitBlock(world, owner, (result as BlockRayTraceResult).pos, this, knife) MISS -> dropItem } if (dropItem) world.addEntity(ItemEntity(world, posX, posY, posZ, knife)) onKillCommand() } } override fun registerData() { } } And renderer: public class KnifeRenderer<T extends KnifeEntity> extends EntityRenderer<T> { private final ItemRenderer itemRenderer; private final float scale = 1; public KnifeRenderer(EntityRendererManager renderManagerIn) { super(renderManagerIn); itemRenderer = Minecraft.getInstance().getItemRenderer(); } protected int getBlockLight(T entityIn, float partialTicks) { return super.getBlockLight(entityIn, partialTicks); } @Override public void render(T entityIn, float entityYaw, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn) { Phoenix.getLOGGER().error("no..."); matrixStackIn.push(); matrixStackIn.scale(this.scale, this.scale, this.scale); matrixStackIn.rotate(this.renderManager.getCameraOrientation()); matrixStackIn.rotate(Vector3f.YP.rotationDegrees(180.0F)); this.itemRenderer.renderItem(new ItemStack(PhoenixItems.INSTANCE.getZIRCONIUM_KNIFE().get()), ItemCameraTransforms.TransformType.GROUND, packedLightIn, OverlayTexture.NO_OVERLAY, matrixStackIn, bufferIn); matrixStackIn.pop(); super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn); } public ResourceLocation getEntityTexture(T entity) { return AtlasTexture.LOCATION_BLOCKS_TEXTURE; } } Register: public static void onClientSetup(FMLClientSetupEvent event) { ... RenderingRegistry.registerEntityRenderingHandler(PhoenixEntities.getKNIFE().get(), KnifeRenderer::new); ... } Item: class KnifeItem(tier: IItemTier, attackDamageIn: Float, attackSpeedIn: Float, maxUsages: Int) : ToolItem(attackDamageIn, attackSpeedIn, tier, breakableBlocks, Properties().group(Phoenix.PHOENIX).maxDamage(maxUsages)) { val damage: Float = attackDamageIn + tier.attackDamage override fun onItemRightClick(world : World, player : PlayerEntity, hand : Hand): ActionResult<ItemStack> { val itemstack = player.getHeldItem(hand) world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5f, 0.4f / (random.nextFloat() * 0.4f + 0.8f)) var coolDown = 10 val speed = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, itemstack) coolDown = (coolDown * speed.toDouble() / 3).toInt() player.cooldownTracker.setCooldown(this, coolDown) if (!world.isRemote) { val knife = KnifeEntity(world, player, true) knife.shoot(player, player.rotationPitch, player.rotationYaw, 0.0f, 1.5f, 1.0f) world.addEntity(knife) val count = EnchantmentHelper.getEnchantmentLevel(Enchantments.MULTISHOT, itemstack) + 1 for (i in 0..count - 1) { addTask(5) { val knife2 = KnifeEntity(world, player, false) knife2.shoot(player, player.rotationPitch, player.rotationYaw, 0.0f, 1.5f, 1.0f) world.addEntity(knife2) } } } itemstack.count = 0 return ActionResult(ActionResultType.SUCCESS, itemstack) } fun onHitBlock(world: World, owner: LivingEntity, pos: BlockPos, knife: KnifeEntity, item: ItemStack): Boolean { var shouldBroke = false val block = world.getBlockState(pos).block for (tag in breakableBlocksTypes) if (block.isIn(tag)) { shouldBroke = true break } if (breakableBlocks.contains(world.getBlockState(pos).block) || shouldBroke) { WorldUtils.destroyBlock(world, pos, true, owner, item) } item.damageItem(1, owner, { p: LivingEntity? -> world.playSound(null, owner.position, SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5f, 0.4f / (random.nextFloat() * 0.4f + 0.8f)) }) return !(block !== Blocks.SNOW_BLOCK && block !== Blocks.SNOW && block.isIn(Tags.Blocks.SAND)) } fun onHitEntity(world: World?, owner: LivingEntity, knife: KnifeEntity, hitted: Entity, knifeItem: ItemStack): Boolean { val powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, knifeItem) val damage = damage + powerLevel.toDouble() * 0.6 if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, knifeItem) > 0 && hitted.type !== EntityType.SNOW_GOLEM) hitted.setFire(100) hitted.attackEntityFrom(DamageSource.causeThrownDamage(knife, knife.thrower), damage.toFloat()) return hitted.type !== EntityType.SNOW_GOLEM && hitted.type !== EntityType.END_CRYSTAL && hitted.type !== EntityType.PANDA } override fun canApplyAtEnchantingTable(stack: ItemStack, enchantment: Enchantment): Boolean { return enchantment === Enchantments.POWER || enchantment === Enchantments.QUICK_CHARGE || enchantment === Enchantments.MENDING || enchantment === Enchantments.FLAME || enchantment === Enchantments.SILK_TOUCH || enchantment === Enchantments.UNBREAKING } companion object { var breakableBlocks: Set<Block> = ImmutableSet.of(Blocks.SPONGE, Blocks.VINE, Blocks.SEA_PICKLE, Blocks.WET_SPONGE) var breakableBlocksTypes: Set<Tag<Block?>> = ImmutableSet.of(Tags.Blocks.GLASS, Tags.Blocks.STAINED_GLASS_PANES) } } Entity exits(it has damage), but render isn't runned... I can not see it. And If i tap F3 + B there are not any hit boxes of it. It is really strange... I need some help.
-
WildTan changed their profile photo
-
You can not use client classes on server part
-
Up
-
I try to divide game into stages. In some stages of the game, some biomes and structures should not be generated.
-
If i try to get WorldSavedData from world gen it is null. How i can storage information for world gen?
-
[1.15.2] Edit Minecraft Source Code or, more simply, hooks
WildTan replied to WildTan's topic in Modder Support
How do you imagine that? Yes, I can determine whether the item is salted or not, but how can I use it THERE? Should I write my entire food system or what? It sounds like a bicycle. -
[1.15.2] Edit Minecraft Source Code or, more simply, hooks
WildTan replied to WildTan's topic in Modder Support
Item#getFood does not contain it. I can not get it from there.