recipes, block drop conf
This commit is contained in:
parent
4e23362194
commit
d63b932d46
5 changed files with 43 additions and 9 deletions
|
|
@ -195,7 +195,9 @@ public class ChargedExplosiveBlock extends FaceAttachedHorizontalDirectionalBloc
|
||||||
if (state.getBlock().defaultDestroyTime() >= 0.0 && !state.isAir()) {
|
if (state.getBlock().defaultDestroyTime() >= 0.0 && !state.isAir()) {
|
||||||
level.removeBlock(p, false);
|
level.removeBlock(p, false);
|
||||||
/* Ignore the yellow squiggles below - p_49886 is passed to a func where it's Nullable */
|
/* Ignore the yellow squiggles below - p_49886 is passed to a func where it's Nullable */
|
||||||
|
if (CommonConfig.EXPLOSION_DROPS.get()) {
|
||||||
Block.dropResources(state, level, p, null, null, ItemStack.EMPTY);
|
Block.dropResources(state, level, p, null, null, ItemStack.EMPTY);
|
||||||
|
}
|
||||||
if (level.getRandom().nextBoolean()) {
|
if (level.getRandom().nextBoolean()) {
|
||||||
ChargedExplosives.getInstance().PROXY.spawnExplosionParticle(p);
|
ChargedExplosives.getInstance().PROXY.spawnExplosionParticle(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
package com.oitsjustjose.charged_explosives.common.config;
|
package com.oitsjustjose.charged_explosives.common.config;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
|
||||||
|
|
||||||
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||||
import com.electronwill.nightconfig.core.io.WritingMode;
|
import com.electronwill.nightconfig.core.io.WritingMode;
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
import net.minecraftforge.common.ForgeConfigSpec;
|
||||||
import net.minecraftforge.common.ForgeConfigSpec.Builder;
|
import net.minecraftforge.common.ForgeConfigSpec.Builder;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
@Mod.EventBusSubscriber
|
@Mod.EventBusSubscriber
|
||||||
public class CommonConfig {
|
public class CommonConfig {
|
||||||
public static final ForgeConfigSpec COMMON_CONFIG;
|
public static final ForgeConfigSpec COMMON_CONFIG;
|
||||||
|
|
@ -20,6 +19,7 @@ public class CommonConfig {
|
||||||
public static ForgeConfigSpec.IntValue MAX_EXPLOSION_DEPTH;
|
public static ForgeConfigSpec.IntValue MAX_EXPLOSION_DEPTH;
|
||||||
public static ForgeConfigSpec.IntValue EXPLOSION_COUNTDOWN_TIME;
|
public static ForgeConfigSpec.IntValue EXPLOSION_COUNTDOWN_TIME;
|
||||||
public static ForgeConfigSpec.IntValue NUM_BEEPS;
|
public static ForgeConfigSpec.IntValue NUM_BEEPS;
|
||||||
|
public static ForgeConfigSpec.BooleanValue EXPLOSION_DROPS;
|
||||||
private static final String CATEGORY_MISC = "common_configuration";
|
private static final String CATEGORY_MISC = "common_configuration";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
@ -50,6 +50,9 @@ public class CommonConfig {
|
||||||
NUM_BEEPS = COMMON_BUILDER.comment("The number of warning beeps given after setting an explosive off to detonate. Time is distributed evenly across the value configured in 'detonationCountdownTime'")
|
NUM_BEEPS = COMMON_BUILDER.comment("The number of warning beeps given after setting an explosive off to detonate. Time is distributed evenly across the value configured in 'detonationCountdownTime'")
|
||||||
.defineInRange("detonationBeepCount", 5, 0, Integer.MAX_VALUE);
|
.defineInRange("detonationBeepCount", 5, 0, Integer.MAX_VALUE);
|
||||||
|
|
||||||
|
EXPLOSION_DROPS = COMMON_BUILDER.comment("Controls if a charge's explosion should provide drops. Setting this to true will drop items, false will not")
|
||||||
|
.define("explosionsDropItems", true);
|
||||||
|
|
||||||
COMMON_BUILDER.pop();
|
COMMON_BUILDER.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -59,9 +59,9 @@ public class ChargedExplosiveBlockEntity extends BlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public float calculateConcussiveDamage() {
|
public float calculateConcussiveDamage() {
|
||||||
return (((float) this.explosionWidth / (CommonConfig.MAX_EXPLOSION_WIDTH.get() / 2F)) +
|
return (((float) this.explosionWidth / (CommonConfig.MAX_EXPLOSION_WIDTH.get() / 4F)) +
|
||||||
((float) this.explosionHeight / (CommonConfig.MAX_EXPLOSION_HEIGHT.get() / 2F)) +
|
((float) this.explosionHeight / (CommonConfig.MAX_EXPLOSION_HEIGHT.get() / 4F)) +
|
||||||
((float) this.explosionDepth / (CommonConfig.MAX_EXPLOSION_DEPTH.get() / 2F))) *
|
((float) this.explosionDepth / (CommonConfig.MAX_EXPLOSION_DEPTH.get() / 4F))) *
|
||||||
CommonConfig.CONCUSSIVE_DAMAGE_SCALE.get().floatValue();
|
CommonConfig.CONCUSSIVE_DAMAGE_SCALE.get().floatValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"RRB",
|
||||||
|
"TTT",
|
||||||
|
"CCC"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"C": {"item": "minecraft:green_concrete"},
|
||||||
|
"T": {"item": "minecraft:tnt"},
|
||||||
|
"R": {"item": "minecraft:redstone"},
|
||||||
|
"B": {"tag": "minecraft:buttons"}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "charged_explosives:charged_explosive",
|
||||||
|
"count": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shapeless",
|
||||||
|
"ingredients": [
|
||||||
|
{
|
||||||
|
"item": "charged_explosives:charged_explosive"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"item": "charged_explosives:charged_explosive"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue