Tuber Tube Tidy-up

- Set recovery chance for unenchanted Potato Cannons to 0
- Power enchantment on Potato Cannons now scales the damage of the projectile type instead of adding to it
- Changed Potato Cannon crafting recipe to better fit the new model
This commit is contained in:
reidbhuntley 2021-07-09 23:11:16 -04:00
parent 802f8337fb
commit bc456a76cd
4 changed files with 19 additions and 20 deletions

View file

@ -3383,7 +3383,7 @@ c2e15ac0c9109bad3face6d13efc32d7116b4c25 data/create/recipes/limestone_pillar_fr
14e322d4de8fae35d952274376497740bb3d5962 data/create/recipes/mechanical_crafting/extendo_grip.json 14e322d4de8fae35d952274376497740bb3d5962 data/create/recipes/mechanical_crafting/extendo_grip.json
de7fea84434753873dfa2b929d9b5f5f86ac6a5c data/create/recipes/mechanical_crafting/flywheel.json de7fea84434753873dfa2b929d9b5f5f86ac6a5c data/create/recipes/mechanical_crafting/flywheel.json
e491fd8a8873308270f9dc2a57ac8f2c70431dcc data/create/recipes/mechanical_crafting/furnace_engine.json e491fd8a8873308270f9dc2a57ac8f2c70431dcc data/create/recipes/mechanical_crafting/furnace_engine.json
6ebd36ff54059038badefad239284ec1724fdf1d data/create/recipes/mechanical_crafting/potato_cannon.json 8e5224d22b228f69473ca48ca0d874b34660b573 data/create/recipes/mechanical_crafting/potato_cannon.json
98f877bf8f3f8a686fc6cf7479a0fba5744248ce data/create/recipes/milling/allium.json 98f877bf8f3f8a686fc6cf7479a0fba5744248ce data/create/recipes/milling/allium.json
8c7e1cbc87c7ca7df2bf949957e89422fef8ad94 data/create/recipes/milling/aluminum_ore.json 8c7e1cbc87c7ca7df2bf949957e89422fef8ad94 data/create/recipes/milling/aluminum_ore.json
bcff4d30ae09a0729bce8b2dbde4ddd6719a998b data/create/recipes/milling/andesite.json bcff4d30ae09a0729bce8b2dbde4ddd6719a998b data/create/recipes/milling/andesite.json

View file

@ -1,11 +1,8 @@
{ {
"type": "create:mechanical_crafting", "type": "create:mechanical_crafting",
"pattern": [ "pattern": [
"L", "LRSSS",
"R", "CC "
"S",
"S",
"S"
], ],
"key": { "key": {
"L": { "L": {
@ -15,6 +12,9 @@
"item": "create:precision_mechanism" "item": "create:precision_mechanism"
}, },
"S": { "S": {
"item": "create:fluid_pipe"
},
"C": {
"tag": "forge:ingots/copper" "tag": "forge:ingots/copper"
} }
}, },

View file

@ -30,6 +30,7 @@ import net.minecraft.util.IndirectEntityDamageSource;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.EntityRayTraceResult; import net.minecraft.util.math.EntityRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData; import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
@ -46,9 +47,9 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
PotatoProjectileRenderMode stuckRenderer; PotatoProjectileRenderMode stuckRenderer;
double stuckFallSpeed; double stuckFallSpeed;
float additionalDamage = 0; float additionalDamageMult = 0;
float additionalKnockback = 0; float additionalKnockback = 0;
float recoveryChance = .125f; float recoveryChance = 0;
public PotatoProjectileEntity(EntityType<? extends DamagingProjectileEntity> type, World world) { public PotatoProjectileEntity(EntityType<? extends DamagingProjectileEntity> type, World world) {
super(type, world); super(type, world);
@ -76,7 +77,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
int recovery = EnchantmentHelper.getEnchantmentLevel(AllEnchantments.POTATO_RECOVERY.get(), cannon); int recovery = EnchantmentHelper.getEnchantmentLevel(AllEnchantments.POTATO_RECOVERY.get(), cannon);
if (power > 0) if (power > 0)
additionalDamage = power * 2; additionalDamageMult = 1 + power * .2f;
if (punch > 0) if (punch > 0)
additionalKnockback = punch * .5f; additionalKnockback = punch * .5f;
if (flame > 0) if (flame > 0)
@ -88,7 +89,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
@Override @Override
public void readAdditional(CompoundNBT nbt) { public void readAdditional(CompoundNBT nbt) {
stack = ItemStack.read(nbt.getCompound("Item")); stack = ItemStack.read(nbt.getCompound("Item"));
additionalDamage = nbt.getFloat("AdditionalDamage"); additionalDamageMult = nbt.getFloat("AdditionalDamage");
additionalKnockback = nbt.getFloat("AdditionalKnockback"); additionalKnockback = nbt.getFloat("AdditionalKnockback");
recoveryChance = nbt.getFloat("Recovery"); recoveryChance = nbt.getFloat("Recovery");
super.readAdditional(nbt); super.readAdditional(nbt);
@ -97,7 +98,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
@Override @Override
public void writeAdditional(CompoundNBT nbt) { public void writeAdditional(CompoundNBT nbt) {
nbt.put("Item", stack.serializeNBT()); nbt.put("Item", stack.serializeNBT());
nbt.putFloat("AdditionalDamage", additionalDamage); nbt.putFloat("AdditionalDamage", additionalDamageMult);
nbt.putFloat("AdditionalKnockback", additionalKnockback); nbt.putFloat("AdditionalKnockback", additionalKnockback);
nbt.putFloat("Recovery", recoveryChance); nbt.putFloat("Recovery", recoveryChance);
super.writeAdditional(nbt); super.writeAdditional(nbt);
@ -174,7 +175,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
Vector3d hit = ray.getHitVec(); Vector3d hit = ray.getHitVec();
Entity target = ray.getEntity(); Entity target = ray.getEntity();
PotatoCannonProjectileTypes projectileType = getProjectileType(); PotatoCannonProjectileTypes projectileType = getProjectileType();
float damage = projectileType.getDamage() + additionalDamage; float damage = MathHelper.floor(projectileType.getDamage() * additionalDamageMult);
float knockback = projectileType.getKnockback() + additionalKnockback; float knockback = projectileType.getKnockback() + additionalKnockback;
Entity owner = this.getOwner(); Entity owner = this.getOwner();
@ -193,7 +194,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
target.setFire(5); target.setFire(5);
boolean onServer = !world.isRemote; boolean onServer = !world.isRemote;
if (onServer && !target.attackEntityFrom(causePotatoDamage(), (float) damage)) { if (onServer && !target.attackEntityFrom(causePotatoDamage(), damage)) {
target.setFireTicks(k); target.setFireTicks(k);
remove(); remove();
return; return;

View file

@ -39,16 +39,14 @@ public class MechanicalCraftingRecipeGen extends CreateRecipeProvider {
.patternLine("SSS") .patternLine("SSS")
.patternLine("SSS") .patternLine("SSS")
.patternLine(" H ")), .patternLine(" H ")),
POTATO_CANNON = create(AllItems.POTATO_CANNON::get).returns(1) POTATO_CANNON = create(AllItems.POTATO_CANNON::get).returns(1)
.recipe(b -> b.key('L', I.andesite()) .recipe(b -> b.key('L', I.andesite())
.key('R', I.precisionMechanism()) .key('R', I.precisionMechanism())
.key('S', Ingredient.fromTag(I.copper())) .key('S', AllBlocks.FLUID_PIPE.get())
.patternLine("L") .key('C', Ingredient.fromTag(I.copper()))
.patternLine("R") .patternLine("LRSSS")
.patternLine("S") .patternLine("CC ")),
.patternLine("S")
.patternLine("S")),
FURNACE_ENGINE = create(AllBlocks.FURNACE_ENGINE::get).returns(1) FURNACE_ENGINE = create(AllBlocks.FURNACE_ENGINE::get).returns(1)
.recipe(b -> b.key('P', Ingredient.fromTag(I.brassSheet())) .recipe(b -> b.key('P', Ingredient.fromTag(I.brassSheet()))