0.15.0
This commit is contained in:
parent
f91e44e846
commit
0b57f36d41
13
README.md
13
README.md
@ -1,8 +1,13 @@
|
|||||||
# For info on the mod go to either
|
# For info on the mod go to either
|
||||||
* [the wiki](https://git.smthng.de/Jenny/Enhanced-Explosives/wiki)
|
|
||||||
* [modrinth](https://modrinth.com/mod/enhanced-explosives)
|
* [modrinth](https://modrinth.com/mod/enhanced-explosives)
|
||||||
* [curseforge](https://www.curseforge.com/minecraft/mc-mods/enhanced-explosives)
|
* [curseforge](https://www.curseforge.com/minecraft/mc-mods/enhanced-explosives)
|
||||||
|
* in-game wiki (guidebook & patchouli)
|
||||||
|
|
||||||
# How to run the mod in an IDE
|
# How to run / build the mod in an IDE
|
||||||
* If you use Intellij, you can import the project from git
|
* git clone the project
|
||||||
* You will have to run "runData" once, else textures will be missing
|
* run the _runData_ gradle task, it generates the item & block models
|
||||||
|
* the data generation only works in versions =>1.20.1, as I didn't backport it. If you want to build the
|
||||||
|
mod for versions before that, you can run the _runData_ gradle task in the 1.20.1 branch and switch back to the
|
||||||
|
branch for your desired version
|
||||||
|
* run _runClient_ to start a minecraft session, or run _jar_ to generate a .jar file of the mod (located at _.
|
||||||
|
/build/reobfJar/output.jar_)
|
45
build.gradle
45
build.gradle
@ -88,11 +88,17 @@ minecraft {
|
|||||||
client {
|
client {
|
||||||
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
|
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
|
||||||
property 'forge.enabledGameTestNamespaces', mod_id
|
property 'forge.enabledGameTestNamespaces', mod_id
|
||||||
|
// fixes patchouli mixin error
|
||||||
|
property 'mixin.env.remapRefMap', 'true'
|
||||||
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
property 'forge.enabledGameTestNamespaces', mod_id
|
property 'forge.enabledGameTestNamespaces', mod_id
|
||||||
args '--nogui'
|
args '--nogui'
|
||||||
|
// fixes patchouli mixin error
|
||||||
|
property 'mixin.env.remapRefMap', 'true'
|
||||||
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
||||||
}
|
}
|
||||||
|
|
||||||
// This run config launches GameTestServer and runs all registered gametests, then exits.
|
// This run config launches GameTestServer and runs all registered gametests, then exits.
|
||||||
@ -108,6 +114,10 @@ minecraft {
|
|||||||
|
|
||||||
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
||||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||||
|
|
||||||
|
// fixes patchouli mixin error
|
||||||
|
property 'mixin.env.remapRefMap', 'true'
|
||||||
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,39 +126,16 @@ minecraft {
|
|||||||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// Put repositories for dependencies here
|
maven {
|
||||||
// ForgeGradle automatically adds the Forge maven and Maven Central for you
|
url "https://cursemaven.com"
|
||||||
|
content {
|
||||||
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
|
includeGroup "curse.maven"
|
||||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
|
}
|
||||||
// flatDir {
|
}
|
||||||
// dir 'libs'
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Specify the version of Minecraft to use.
|
|
||||||
// Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
|
|
||||||
// The "userdev" classifier will be requested and setup by ForgeGradle.
|
|
||||||
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
|
|
||||||
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
|
|
||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
|
|
||||||
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
|
|
||||||
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
|
|
||||||
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
|
|
||||||
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
|
|
||||||
|
|
||||||
// Example mod dependency using a mod jar from ./libs with a flat dir repository
|
|
||||||
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
|
|
||||||
// The group id is ignored when searching -- in this case, it is "blank"
|
|
||||||
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
|
|
||||||
|
|
||||||
// For more info:
|
|
||||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
|
||||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This block of code expands all declared replace properties in the specified resource targets.
|
// This block of code expands all declared replace properties in the specified resource targets.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
org.gradle.jvmargs=-Xmx3G
|
# CreateCoredumpOnCrash only works on jdk9+
|
||||||
|
org.gradle.jvmargs=-Xmx3G -XX:-CreateCoredumpOnCrash
|
||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
minecraft_version=1.20.3
|
minecraft_version=1.20.3
|
||||||
minecraft_version_range=[1.20.3,1.20.4]
|
minecraft_version_range=[1.20.3,1.20.4]
|
||||||
@ -11,7 +12,7 @@ mapping_version=2023.12.31-1.20.3
|
|||||||
mod_id=enhancedexplosives
|
mod_id=enhancedexplosives
|
||||||
mod_name=Enhanced Explosives
|
mod_name=Enhanced Explosives
|
||||||
mod_license=All Rights Reserved
|
mod_license=All Rights Reserved
|
||||||
mod_version=0.14.0
|
mod_version=0.15.0
|
||||||
mod_group_id=com.jenny
|
mod_group_id=com.jenny
|
||||||
mod_authors=Jenny
|
mod_authors=xJenny69
|
||||||
mod_description=strong & throwable explosives
|
mod_description=strong & throwable explosives
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
package com.jenny.enhancedexplosives;
|
package com.jenny.enhancedexplosives;
|
||||||
|
|
||||||
|
import com.jenny.enhancedexplosives.entities.entities;
|
||||||
import com.jenny.enhancedexplosives.particles.ArrowParticle;
|
import com.jenny.enhancedexplosives.particles.ArrowParticle;
|
||||||
import com.jenny.enhancedexplosives.particles.particles;
|
import com.jenny.enhancedexplosives.particles.particles;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.client.event.RegisterParticleProvidersEvent;
|
import net.minecraftforge.client.event.RegisterParticleProvidersEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
|
|
||||||
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
import static com.jenny.enhancedexplosives.EnhancedExplosives.MODID;
|
||||||
|
|
||||||
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||||
public class eventBusEvents {
|
public class ClientEvents {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void registerParticleFactories(final RegisterParticleProvidersEvent event) {
|
public static void registerParticleFactories(final RegisterParticleProvidersEvent event) {
|
||||||
Minecraft.getInstance().particleEngine.register(particles.CONCUSSIVE_ARROW_PARTICLE.get(),
|
Minecraft.getInstance().particleEngine.register(particles.CONCUSSIVE_ARROW_PARTICLE.get(),
|
||||||
@ -22,4 +25,9 @@ public class eventBusEvents {
|
|||||||
Minecraft.getInstance().particleEngine.register(particles.TUNNEL_ARROW_PARTICLE.get(),
|
Minecraft.getInstance().particleEngine.register(particles.TUNNEL_ARROW_PARTICLE.get(),
|
||||||
ArrowParticle.Provider::new);
|
ArrowParticle.Provider::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onClientSetup(FMLClientSetupEvent event) {
|
||||||
|
entities.registerRenderers();
|
||||||
|
}
|
||||||
}
|
}
|
@ -7,7 +7,6 @@ import com.jenny.enhancedexplosives.entities.entities;
|
|||||||
import com.jenny.enhancedexplosives.items.items;
|
import com.jenny.enhancedexplosives.items.items;
|
||||||
import com.jenny.enhancedexplosives.particles.particles;
|
import com.jenny.enhancedexplosives.particles.particles;
|
||||||
import com.mojang.logging.LogUtils;
|
import com.mojang.logging.LogUtils;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.server.ServerStartingEvent;
|
import net.minecraftforge.event.server.ServerStartingEvent;
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
@ -15,7 +14,6 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|||||||
import net.minecraftforge.fml.ModLoadingContext;
|
import net.minecraftforge.fml.ModLoadingContext;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.config.ModConfig;
|
import net.minecraftforge.fml.config.ModConfig;
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -54,14 +52,4 @@ public class EnhancedExplosives {
|
|||||||
public void onServerStarting(ServerStartingEvent event) {
|
public void onServerStarting(ServerStartingEvent event) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
|
|
||||||
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
|
||||||
public static class ClientModEvents {
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public static void onClientSetup(FMLClientSetupEvent event) {
|
|
||||||
entities.registerRenderers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package com.jenny.enhancedexplosives.blocks;
|
||||||
|
|
||||||
|
import com.jenny.enhancedexplosives.entities.tnt.bedrockPrimedTNT;
|
||||||
|
import com.jenny.enhancedexplosives.entities.tnt.selectivePrimedTNT;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.sounds.SoundSource;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.level.Explosion;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.TntBlock;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public class bedrockTNTBlock extends TntBlock {
|
||||||
|
public final float pRadius;
|
||||||
|
public final int fuseTime;
|
||||||
|
|
||||||
|
public bedrockTNTBlock(Properties p_57422_, float pRadius, int fuseTime) {
|
||||||
|
super(p_57422_);
|
||||||
|
this.pRadius = pRadius;
|
||||||
|
this.fuseTime = fuseTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCaughtFire(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @Nullable Direction face, @Nullable LivingEntity igniter) {
|
||||||
|
explode(world, pos, igniter, this.pRadius, this.fuseTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static void explode(Level p_57434_, BlockPos p_57435_, float pRadius, int fuseTime) {
|
||||||
|
explode(p_57434_, p_57435_, (LivingEntity)null, pRadius, fuseTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
private static void explode(Level p_57437_, BlockPos p_57438_, @Nullable LivingEntity p_57439_, float pRadius, int fuseTime) {
|
||||||
|
if (!p_57437_.isClientSide) {
|
||||||
|
bedrockPrimedTNT primedtnt = new bedrockPrimedTNT(p_57437_, (double)p_57438_.getX() + (double)0.5F, (double)p_57438_.getY(), (double)p_57438_.getZ() + (double)0.5F, p_57439_, pRadius, fuseTime);
|
||||||
|
p_57437_.addFreshEntity(primedtnt);
|
||||||
|
p_57437_.playSound((Player)null, primedtnt.getX(), primedtnt.getY(), primedtnt.getZ(), SoundEvents.TNT_PRIMED, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||||
|
p_57437_.gameEvent(p_57439_, GameEvent.PRIME_FUSE, p_57438_);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||||
|
if (!level.isClientSide) {
|
||||||
|
int ft = (short) (level.random.nextInt(fuseTime / 4) + fuseTime / 8);
|
||||||
|
bedrockPrimedTNT primedtnt = new bedrockPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, ft);
|
||||||
|
level.addFreshEntity(primedtnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -61,6 +61,12 @@ public class blocks {
|
|||||||
public static final RegistryObject<Block> TNT_REPULSIVE = BLOCKS.register("tnt_repulsive", () -> new repulsiveTNTBlock(DEFAULT_PROPS, 4.0f, 80, 1));
|
public static final RegistryObject<Block> TNT_REPULSIVE = BLOCKS.register("tnt_repulsive", () -> new repulsiveTNTBlock(DEFAULT_PROPS, 4.0f, 80, 1));
|
||||||
public static final RegistryObject<Item> TNT_REPULSIVE_ITEM = ITEMS.register("tnt_repulsive", () -> new BlockItemTooltip(TNT_REPULSIVE.get(), new Item.Properties()));
|
public static final RegistryObject<Item> TNT_REPULSIVE_ITEM = ITEMS.register("tnt_repulsive", () -> new BlockItemTooltip(TNT_REPULSIVE.get(), new Item.Properties()));
|
||||||
|
|
||||||
|
public static final RegistryObject<Block> TNT_BEDROCK = BLOCKS.register("tnt_bedrock", () -> new bedrockTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80));
|
||||||
|
public static final RegistryObject<Item> TNT_BEDROCK_ITEM = ITEMS.register("tnt_bedrock", () -> new BlockItemTooltip(TNT_BEDROCK.get(), new Item.Properties()));
|
||||||
|
|
||||||
|
public static final RegistryObject<Block> TNT_ENTITY = BLOCKS.register("tnt_entity", () -> new entityTNTBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED), 4.0f, 80));
|
||||||
|
public static final RegistryObject<Item> TNT_ENTITY_ITEM = ITEMS.register("tnt_entity", () -> new BlockItemTooltip(TNT_ENTITY.get(), new Item.Properties()));
|
||||||
|
|
||||||
|
|
||||||
public static void register(IEventBus bus) {
|
public static void register(IEventBus bus) {
|
||||||
BLOCKS.register(bus);
|
BLOCKS.register(bus);
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
package com.jenny.enhancedexplosives.blocks;
|
||||||
|
|
||||||
|
import com.jenny.enhancedexplosives.entities.tnt.EntityPrimedTNT;
|
||||||
|
import com.jenny.enhancedexplosives.entities.tnt.bedrockPrimedTNT;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.sounds.SoundSource;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.level.Explosion;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.TntBlock;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.gameevent.GameEvent;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public class entityTNTBlock extends TntBlock {
|
||||||
|
public final float pRadius;
|
||||||
|
public final int fuseTime;
|
||||||
|
|
||||||
|
public entityTNTBlock(Properties p_57422_, float pRadius, int fuseTime) {
|
||||||
|
super(p_57422_);
|
||||||
|
this.pRadius = pRadius;
|
||||||
|
this.fuseTime = fuseTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCaughtFire(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @Nullable Direction face, @Nullable LivingEntity igniter) {
|
||||||
|
explode(world, pos, igniter, this.pRadius, this.fuseTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static void explode(Level p_57434_, BlockPos p_57435_, float pRadius, int fuseTime) {
|
||||||
|
explode(p_57434_, p_57435_, (LivingEntity)null, pRadius, fuseTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
private static void explode(Level p_57437_, BlockPos p_57438_, @Nullable LivingEntity p_57439_, float pRadius, int fuseTime) {
|
||||||
|
if (!p_57437_.isClientSide) {
|
||||||
|
EntityPrimedTNT primedtnt = new EntityPrimedTNT(p_57437_, (double)p_57438_.getX() + (double)0.5F, (double)p_57438_.getY(), (double)p_57438_.getZ() + (double)0.5F, p_57439_, pRadius, fuseTime);
|
||||||
|
p_57437_.addFreshEntity(primedtnt);
|
||||||
|
p_57437_.playSound((Player)null, primedtnt.getX(), primedtnt.getY(), primedtnt.getZ(), SoundEvents.TNT_PRIMED, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||||
|
p_57437_.gameEvent(p_57439_, GameEvent.PRIME_FUSE, p_57438_);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void wasExploded(Level level, @NotNull BlockPos blockPos, @NotNull Explosion pExplosion) {
|
||||||
|
if (!level.isClientSide) {
|
||||||
|
int ft = (short) (level.random.nextInt(fuseTime / 4) + fuseTime / 8);
|
||||||
|
EntityPrimedTNT primedtnt = new EntityPrimedTNT(level, (double) blockPos.getX() + (double) 0.5F, (double) blockPos.getY(), (double) blockPos.getZ() + (double) 0.5F, pExplosion.getIndirectSourceEntity(), pRadius, ft);
|
||||||
|
level.addFreshEntity(primedtnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -31,6 +31,8 @@ public class ModBlockStateProvider extends BlockStateProvider {
|
|||||||
sideTopBottom(blocks.TNT_128);
|
sideTopBottom(blocks.TNT_128);
|
||||||
sideTopBottom(blocks.TNT_ENDER);
|
sideTopBottom(blocks.TNT_ENDER);
|
||||||
sideTopBottom(blocks.TNT_CLAYMORE);
|
sideTopBottom(blocks.TNT_CLAYMORE);
|
||||||
|
sideTopBottom(blocks.TNT_BEDROCK);
|
||||||
|
sideTopBottom(blocks.TNT_ENTITY);
|
||||||
SideTop(blocks.TNT_BLACK_HOLE);
|
SideTop(blocks.TNT_BLACK_HOLE);
|
||||||
SideTop(blocks.TNT_REPULSIVE);
|
SideTop(blocks.TNT_REPULSIVE);
|
||||||
SideOnlyTNT(blocks.TNT_CLUSTER_2);
|
SideOnlyTNT(blocks.TNT_CLUSTER_2);
|
||||||
|
@ -36,7 +36,6 @@ public class tntArrow extends baseArrow {
|
|||||||
@Override
|
@Override
|
||||||
public void spawnParticles(float partialTicks) {
|
public void spawnParticles(float partialTicks) {
|
||||||
for (int i = 1; i <= ConfigClient.calcPCount(5); i++) {
|
for (int i = 1; i <= ConfigClient.calcPCount(5); i++) {
|
||||||
double m = (double) level().getRandom().nextIntBetweenInclusive(- 100, 100) / 100;
|
|
||||||
Vec3 DeltaMovement = getDeltaMovement();
|
Vec3 DeltaMovement = getDeltaMovement();
|
||||||
Vec3 pos = particlePos(0.5);
|
Vec3 pos = particlePos(0.5);
|
||||||
level().addParticle(particles.TNT_ARROW_PARTICLE.get(), pos.x, pos.y, pos.z, DeltaMovement.x, DeltaMovement.y, DeltaMovement.z);
|
level().addParticle(particles.TNT_ARROW_PARTICLE.get(), pos.x, pos.y, pos.z, DeltaMovement.x, DeltaMovement.y, DeltaMovement.z);
|
||||||
|
@ -50,6 +50,15 @@ public class entities {
|
|||||||
ENTITY_TYPES.register("tnt_repulsive", () -> EntityType.Builder.<repulsivePrimedTNT>of(repulsivePrimedTNT::new, MobCategory.MISC)
|
ENTITY_TYPES.register("tnt_repulsive", () -> EntityType.Builder.<repulsivePrimedTNT>of(repulsivePrimedTNT::new, MobCategory.MISC)
|
||||||
.fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_repulsive"));
|
.fireImmune().sized(0.98F, 0.98F).clientTrackingRange(10).updateInterval(10).build("tnt_repulsive"));
|
||||||
|
|
||||||
|
public static final RegistryObject<EntityType<bedrockPrimedTNT>> TNT_BEDROCK =
|
||||||
|
ENTITY_TYPES.register("tnt_bedrock", () -> EntityType.Builder.<bedrockPrimedTNT>of(bedrockPrimedTNT::new, MobCategory.MISC)
|
||||||
|
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_bedrock"));
|
||||||
|
|
||||||
|
public static final RegistryObject<EntityType<EntityPrimedTNT>> TNT_ENTITY =
|
||||||
|
ENTITY_TYPES.register("tnt_entity", () -> EntityType.Builder.<EntityPrimedTNT>of(EntityPrimedTNT::new, MobCategory.MISC)
|
||||||
|
.sized(0.98F, 0.7F).fireImmune().clientTrackingRange(8).build("tnt_entity"));
|
||||||
|
|
||||||
|
|
||||||
public static final RegistryObject<EntityType<tntArrow>> ARROW_TNT =
|
public static final RegistryObject<EntityType<tntArrow>> ARROW_TNT =
|
||||||
ENTITY_TYPES.register("arrow_tnt", () -> EntityType.Builder.<tntArrow>of(tntArrow::new, MobCategory.MISC)
|
ENTITY_TYPES.register("arrow_tnt", () -> EntityType.Builder.<tntArrow>of(tntArrow::new, MobCategory.MISC)
|
||||||
.sized(0.48F, 0.48F).clientTrackingRange(64).build("arrow_tnt"));
|
.sized(0.48F, 0.48F).clientTrackingRange(64).build("arrow_tnt"));
|
||||||
@ -89,6 +98,8 @@ public class entities {
|
|||||||
EntityRenderers.register(TNT_CLAYMORE.get(), BaseTNTRenderer::new);
|
EntityRenderers.register(TNT_CLAYMORE.get(), BaseTNTRenderer::new);
|
||||||
EntityRenderers.register(TNT_ENDER.get(), BaseTNTRenderer::new);
|
EntityRenderers.register(TNT_ENDER.get(), BaseTNTRenderer::new);
|
||||||
EntityRenderers.register(TNT_REPULSIVE.get(), BaseTNTRenderer::new);
|
EntityRenderers.register(TNT_REPULSIVE.get(), BaseTNTRenderer::new);
|
||||||
|
EntityRenderers.register(TNT_BEDROCK.get(), BaseTNTRenderer::new);
|
||||||
|
EntityRenderers.register(TNT_ENTITY.get(), BaseTNTRenderer::new);
|
||||||
|
|
||||||
EntityRenderers.register(TNT_SELECTIVE.get(), SelectiveTNTRenderer::new);
|
EntityRenderers.register(TNT_SELECTIVE.get(), SelectiveTNTRenderer::new);
|
||||||
|
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.jenny.enhancedexplosives.entities.tnt;
|
||||||
|
|
||||||
|
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||||
|
import com.jenny.enhancedexplosives.entities.entities;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
|
import net.minecraft.world.level.Explosion;
|
||||||
|
import net.minecraft.world.level.ExplosionDamageCalculator;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class EntityPrimedTNT extends basePrimedTNT {
|
||||||
|
static class noEntityExplosionCalculator extends ExplosionDamageCalculator {
|
||||||
|
public boolean shouldBlockExplode(@NotNull Explosion pExplosion, @NotNull BlockGetter pReader, @NotNull BlockPos pPos, @NotNull BlockState pState, float pPower) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityPrimedTNT(Level pLevel, double pX, double pY, double pZ, @Nullable LivingEntity pOwner, float power, int fuse) {
|
||||||
|
super(entities.TNT_ENTITY.get(), pLevel, pOwner, new Vec3(pX, pY, pZ), fuse, power);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityPrimedTNT(EntityType<EntityPrimedTNT> entityType, Level level) {
|
||||||
|
super(entityType, level, null);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void explode() {
|
||||||
|
noEntityExplosionCalculator dmgCalc = new noEntityExplosionCalculator();
|
||||||
|
this.level().explode(this, null, dmgCalc, position(), getPower(), false, Level.ExplosionInteraction.TNT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getBlockBelow() {
|
||||||
|
return new BlockPos((int) Math.floor(getX()), (int) Math.floor(getY()) - 1, (int) Math.floor(getZ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBlock() {
|
||||||
|
return level().getBlockState(getBlockBelow()).getBlock().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Block renderBlock() {
|
||||||
|
return blocks.TNT_ENTITY.get();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.jenny.enhancedexplosives.entities.tnt;
|
||||||
|
|
||||||
|
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||||
|
import com.jenny.enhancedexplosives.entities.entities;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
|
import net.minecraft.world.level.Explosion;
|
||||||
|
import net.minecraft.world.level.ExplosionDamageCalculator;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class bedrockPrimedTNT extends basePrimedTNT {
|
||||||
|
static class noExplosionCalculator extends ExplosionDamageCalculator {
|
||||||
|
public boolean shouldBlockExplode(@NotNull Explosion pExplosion, @NotNull BlockGetter pReader, @NotNull BlockPos pPos, @NotNull BlockState pState, float pPower) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bedrockPrimedTNT(Level pLevel, double pX, double pY, double pZ, @Nullable LivingEntity pOwner, float power, int fuse) {
|
||||||
|
super(entities.TNT_BEDROCK.get(), pLevel, pOwner, new Vec3(pX, pY, pZ), fuse, power);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bedrockPrimedTNT(EntityType<bedrockPrimedTNT> entityType, Level level) {
|
||||||
|
super(entityType, level, null);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void explode() {
|
||||||
|
noExplosionCalculator dmgCalc = new noExplosionCalculator();
|
||||||
|
this.level().explode(this, null, dmgCalc, position(), getPower(), false, Level.ExplosionInteraction.TNT);
|
||||||
|
explodeBelow();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos getBlockBelow() {
|
||||||
|
return new BlockPos((int) Math.floor(getX()), (int) Math.floor(getY()) - 1, (int) Math.floor(getZ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBlock() {
|
||||||
|
return level().getBlockState(getBlockBelow()).getBlock().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void explodeBelow()
|
||||||
|
{
|
||||||
|
if (Objects.equals(getBlock(), Blocks.BEDROCK.toString())) {
|
||||||
|
level().destroyBlock(getBlockBelow(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Block renderBlock() {
|
||||||
|
return blocks.TNT_BEDROCK.get();
|
||||||
|
}
|
||||||
|
}
|
@ -1,64 +1,36 @@
|
|||||||
# This is an example mods.toml file. It contains the data relating to the loading mods.
|
modLoader = "javafml"
|
||||||
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
|
|
||||||
# The overall format is standard TOML format, v0.5.0.
|
|
||||||
# Note that there are a couple of TOML lists in this file.
|
|
||||||
# Find more information on toml format here: https://github.com/toml-lang/toml
|
|
||||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
|
||||||
modLoader = "javafml" #mandatory
|
|
||||||
logoFile = "logo.png"
|
logoFile = "logo.png"
|
||||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
loaderVersion = "${loader_version_range}"
|
||||||
loaderVersion = "${loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
|
||||||
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
|
|
||||||
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
|
||||||
license = "${mod_license}"
|
license = "${mod_license}"
|
||||||
# A URL to refer people to when problems occur with this mod
|
[[mods]]
|
||||||
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
|
modId = "${mod_id}"
|
||||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
version = "${mod_version}"
|
||||||
[[mods]] #mandatory
|
displayName = "${mod_name}"
|
||||||
# The modid of the mod
|
authors = "${mod_authors}"
|
||||||
modId = "${mod_id}" #mandatory
|
displayTest = "MATCH_VERSION"
|
||||||
# The version number of the mod
|
displayURL = "https://git.smthng.de/Jenny/Enhanced-Explosives"
|
||||||
version = "${mod_version}" #mandatory
|
|
||||||
# A display name for the mod
|
|
||||||
displayName = "${mod_name}" #mandatory
|
|
||||||
# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/
|
|
||||||
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
|
|
||||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
|
||||||
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
|
|
||||||
# A file name (in the root of the mod JAR) containing a logo for display
|
|
||||||
#logoFile="enhancedexplosives.png" #optional
|
|
||||||
# A text field displayed in the mod UI
|
|
||||||
#credits="Thanks for this example mod goes to Java" #optional
|
|
||||||
# A text field displayed in the mod UI
|
|
||||||
authors = "${mod_authors}" #optional
|
|
||||||
# Display Test controls the display for your mod in the server connection screen
|
|
||||||
# MATCH_VERSION means that your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod.
|
|
||||||
# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod.
|
|
||||||
# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component.
|
|
||||||
# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value.
|
|
||||||
# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself.
|
|
||||||
#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional)
|
|
||||||
|
|
||||||
# The description text for the mod (multi line!) (#mandatory)
|
|
||||||
description = '''${mod_description}'''
|
description = '''${mod_description}'''
|
||||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
|
||||||
[[dependencies."${mod_id}"]] #optional
|
[[dependencies."${mod_id}"]] #optional
|
||||||
# the modid of the dependency
|
modId = "forge"
|
||||||
modId = "forge" #mandatory
|
mandatory = true
|
||||||
# Does this dependency have to exist - if not, ordering below must be specified
|
versionRange = "${forge_version_range}"
|
||||||
mandatory = true #mandatory
|
|
||||||
# The version range of the dependency
|
|
||||||
versionRange = "${forge_version_range}" #mandatory
|
|
||||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
|
|
||||||
# BEFORE - This mod is loaded BEFORE the dependency
|
|
||||||
# AFTER - This mod is loaded AFTER the dependency
|
|
||||||
ordering = "NONE"
|
ordering = "NONE"
|
||||||
# Side this dependency is applied on - BOTH, CLIENT, or SERVER
|
side = "BOTH"
|
||||||
side = "BOTH"# Here's another dependency
|
|
||||||
[[dependencies."${mod_id}"]]
|
[[dependencies."${mod_id}"]]
|
||||||
modId = "minecraft"
|
modId = "minecraft"
|
||||||
mandatory = true
|
mandatory = true
|
||||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
|
||||||
versionRange = "${minecraft_version_range}"
|
versionRange = "${minecraft_version_range}"
|
||||||
ordering = "NONE"
|
ordering = "NONE"
|
||||||
side = "BOTH"
|
side = "BOTH"
|
||||||
|
[[dependencies."${mod_id}"]]
|
||||||
|
modId = "gbook"
|
||||||
|
mandatory = false
|
||||||
|
versionRange = "[1.7.3,)"
|
||||||
|
ordering = "BEFORE"
|
||||||
|
side = "BOTH"
|
||||||
|
[[dependencies."${mod_id}"]]
|
||||||
|
modId = "patchouli"
|
||||||
|
mandatory = false
|
||||||
|
versionRange = "[1.0.6,)"
|
||||||
|
ordering = "BEFORE"
|
||||||
|
side = "BOTH"
|
3
src/main/resources/assets/enhancedexplosives/books.json
Normal file
3
src/main/resources/assets/enhancedexplosives/books.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[
|
||||||
|
"enhancedexplosives:books/guide_enhanced_explosives.xml"
|
||||||
|
]
|
@ -13,6 +13,8 @@
|
|||||||
"block.enhancedexplosives.tnt_selective": "Selective TNT",
|
"block.enhancedexplosives.tnt_selective": "Selective TNT",
|
||||||
"block.enhancedexplosives.tnt_ender": "Ender TNT",
|
"block.enhancedexplosives.tnt_ender": "Ender TNT",
|
||||||
"block.enhancedexplosives.tnt_repulsive": "Repulsive TNT",
|
"block.enhancedexplosives.tnt_repulsive": "Repulsive TNT",
|
||||||
|
"block.enhancedexplosives.tnt_bedrock": "Bedrock TNT",
|
||||||
|
"block.enhancedexplosives.tnt_entity": "Entity TNT",
|
||||||
|
|
||||||
"tooltip.enhancedexplosives.tnt_cluster_2": "splits into 2 small TNTs",
|
"tooltip.enhancedexplosives.tnt_cluster_2": "splits into 2 small TNTs",
|
||||||
"tooltip.enhancedexplosives.tnt_cluster_4": "splits into 4 small TNTs",
|
"tooltip.enhancedexplosives.tnt_cluster_4": "splits into 4 small TNTs",
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 459 B |
Binary file not shown.
After Width: | Height: | Size: 563 B |
Binary file not shown.
After Width: | Height: | Size: 459 B |
Binary file not shown.
After Width: | Height: | Size: 151 B |
Binary file not shown.
After Width: | Height: | Size: 1016 B |
Binary file not shown.
After Width: | Height: | Size: 515 B |
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"rolls": 1,
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "enhancedexplosives:tnt_bedrock"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"rolls": 1,
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "enhancedexplosives:tnt_entity"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "redstone",
|
||||||
|
"pattern": [
|
||||||
|
"AA ",
|
||||||
|
"AA ",
|
||||||
|
" "
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"A": {
|
||||||
|
"item": "enhancedexplosives:tnt_128"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "enhancedexplosives:tnt_bedrock"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shapeless",
|
||||||
|
"category": "redstone",
|
||||||
|
"ingredients":[
|
||||||
|
{
|
||||||
|
"item": "minecraft:tnt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item": "minecraft:water_bucket"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"item": "enhancedexplosives:tnt_entity"
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"result": {
|
"result": {
|
||||||
"item": "enhancedexplosives:tnt_black_hole"
|
"item": "enhancedexplosives:tnt_repulsive"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shapeless",
|
||||||
|
"category": "combat",
|
||||||
|
"ingredients":[
|
||||||
|
{
|
||||||
|
"item": "minecraft:tnt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item": "minecraft:obsidian"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"item": "enhancedexplosives:tnt_selective"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user