Skip to content

Commit

Permalink
Week #15 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
North-West-Wind committed Mar 9, 2021
1 parent 5b65379 commit 8eb8eec
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.9.0-1.16.x'
version = '1.10.0-1.16.x'
group = 'ml.northwestwind.moreboots' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'moreboots'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ public void onLivingUpdate(final LivingEvent.LivingUpdateEvent event) {
} else if (boots.getItem().equals(ItemInit.SPONGE_BOOTS)) {
boolean absorbed = Utils.absorb(entity.world, new BlockPos(entity.getPositionVec()));
if (absorbed) boots.damageItem(1, entity, ent -> ent.playSound(SoundEvents.BLOCK_GRASS_BREAK, 1, 1));
} else if (boots.getItem().equals(ItemInit.LAVA_SPONGE_BOOTS)) {
boolean absorbed = Utils.absorb(entity.world, new BlockPos(entity.getPositionVec()), FluidTags.LAVA);
if (absorbed) boots.damageItem(1, entity, ent -> ent.playSound(SoundEvents.BLOCK_GRASS_BREAK, 1, 1));
}
}

Expand Down
9 changes: 7 additions & 2 deletions src/main/java/ml/northwestwind/moreboots/handler/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids;
import net.minecraft.tags.FluidTags;
import net.minecraft.tags.ITag;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Tuple;
Expand Down Expand Up @@ -114,7 +115,7 @@ public static Object bytesToObj(byte[] bytes) {
return obj;
}

public static boolean absorb(World worldIn, BlockPos pos) {
public static boolean absorb(World worldIn, BlockPos pos, ITag.INamedTag<Fluid> tag) {
Queue<Tuple<BlockPos, Integer>> queue = Lists.newLinkedList();
queue.add(new Tuple<>(pos, 0));
int i = 0;
Expand All @@ -129,7 +130,7 @@ public static boolean absorb(World worldIn, BlockPos pos) {
BlockState blockstate = worldIn.getBlockState(blockpos1);
FluidState fluidstate = worldIn.getFluidState(blockpos1);
Material material = blockstate.getMaterial();
if (fluidstate.isTagged(FluidTags.WATER)) {
if (fluidstate.isTagged(tag)) {
if (blockstate.getBlock() instanceof IBucketPickupHandler && ((IBucketPickupHandler)blockstate.getBlock()).pickupFluid(worldIn, blockpos1, blockstate) != Fluids.EMPTY) {
++i;
if (j < 6) {
Expand Down Expand Up @@ -160,4 +161,8 @@ public static boolean absorb(World worldIn, BlockPos pos) {

return i > 0;
}

public static boolean absorb(World worldIn, BlockPos pos) {
return absorb(worldIn, pos, FluidTags.WATER);
}
}
5 changes: 4 additions & 1 deletion src/main/java/ml/northwestwind/moreboots/init/ItemInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class ItemInit {
public static final Item STORAGE_BOOTS = new StorageBootsItem(ModArmorMaterial.STORAGE, "storage_boots", 6);
public static final Item GLIDER = registerBoots(ModArmorMaterial.GLIDER, "gliding_boots");
public static final Item SPONGE_BOOTS = registerBoots(ModArmorMaterial.SPONGE, "sponge_boots");
public static final Item LAVA_SPONGE_BOOTS = registerBoots(ModArmorMaterial.LAVA_SPONGE, "lava_sponge_boots", true);

public static final Item QUARTZ_INGOT = new ItemBase("quartz_ingot");
public static final Item METAL_MIX = new ItemBase("metal_mix");
Expand Down Expand Up @@ -116,6 +117,7 @@ public static void registerItems(final RegistryEvent.Register<Item> event) {
event.getRegistry().register(STORAGE_BOOTS);
event.getRegistry().register(GLIDER);
event.getRegistry().register(SPONGE_BOOTS);
event.getRegistry().register(LAVA_SPONGE_BOOTS);

event.getRegistry().register(QUARTZ_INGOT);
event.getRegistry().register(METAL_MIX);
Expand Down Expand Up @@ -203,7 +205,8 @@ public enum ModArmorMaterial implements IArmorMaterial {
LOKI(Reference.MODID + ":loki", 20, 1, 12, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0.0f, 0.0f, () -> Ingredient.EMPTY),
STORAGE(Reference.MODID + ":storage", 10, 1, 8, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.0f, 0.0f, () -> Ingredient.fromItems(Items.CHEST)),
GLIDER(Reference.MODID + ":gliding", 20, 1, 10, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.0f, 0.0f, () -> Ingredient.fromItems(Items.PHANTOM_MEMBRANE)),
SPONGE(Reference.MODID + ":sponge", 10, 1, 6, SoundEvents.BLOCK_GRASS_BREAK, 0.0f, 0.0f, () -> Ingredient.fromItems(Items.SPONGE, Items.WET_SPONGE));
SPONGE(Reference.MODID + ":sponge", 10, 1, 6, SoundEvents.BLOCK_GRASS_BREAK, 0.0f, 0.0f, () -> Ingredient.fromItems(Items.SPONGE, Items.WET_SPONGE)),
LAVA_SPONGE(Reference.MODID + ":sponge", 10, 1, 6, SoundEvents.BLOCK_GRASS_BREAK, 0.0f, 0.0f, () -> Ingredient.fromItems(Items.SPONGE));
private static final int[] MAX_DAMAGE_ARRAY = new int[] { 16, 16, 16, 16 };
private final String name;
private final float maxDamageFactor;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ issueTrackerURL="https://github.com/North-West-Wind/MoreBoots/issues"

[[mods]]
modId="moreboots"
version="1.9.0"
version="1.10.0"
displayName="More Boots"
updateJSONURL="https://github.com/North-West-Wind/MoreBoots/raw/main/update.json"
displayURL="https://github.com/North-West-Wind/MoreBoots"
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/assets/moreboots/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"item.moreboots.storage_boots": "Storage Boots",
"item.moreboots.gliding_boots": "Glider",
"item.moreboots.sponge_boots": "Sponge Boots",
"item.moreboots.lava_sponge_boots": "Lava Sponge Boots",

"item.moreboots.quartz_ingot": "Quartz Ingot",
"item.moreboots.metal_mix": "Metal Mix",
Expand Down Expand Up @@ -103,6 +104,7 @@
"tooltip.moreboots.storage_boots": "\u00A77\u00A7oExtra storage",
"tooltip.moreboots.gliding_boots": "\u00A77\u00A7oGlides while moving in the air",
"tooltip.moreboots.sponge_boots": "\u00A77\u00A7oAbsorbs water around",
"tooltip.moreboots.lava_sponge_boots": "\u00A77\u00A7oAbsorbs lava around",
"itemGroup.morebootstab": "More Boots",

"death.attack.stomp": "%1$s was stomped by %2$s",
Expand Down Expand Up @@ -192,6 +194,8 @@
"advancements.moreboots.gliding_boots.description": "Obtain the Glider",
"advancements.moreboots.sponge_boots.title": "Absorption, but Water",
"advancements.moreboots.sponge_boots.description": "Obtain the Sponge Boots",
"advancements.moreboots.lava_sponge_boots.title": "Absorption, but Lava",
"advancements.moreboots.lava_sponge_boots.description": "Obtain the Lava Sponge Boots",

"key.categories.moreboots": "More Boots",
"key.moreboots.teleport": "Ender Boots Teleport",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 20 additions & 15 deletions update.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"1.7.0": "Week #7 Update",
"1.7.1": "Fixed Server Crash",
"1.8.0": "Week #11 Update",
"1.9.0": "Week #14 Update"
"1.9.0": "Week #14 Update",
"1.10.0": "Week #15 Update"
},
"1.16.4": {
"1.0.0": "The very first release",
Expand All @@ -32,7 +33,8 @@
"1.7.0": "Week #7 Update",
"1.7.1": "Fixed Server Crash",
"1.8.0": "Week #11 Update",
"1.9.0": "Week #14 Update"
"1.9.0": "Week #14 Update",
"1.10.0": "Week #15 Update"
},
"1.16.3": {
"1.0.0": "The very first release",
Expand All @@ -49,7 +51,8 @@
"1.7.0": "Week #7 Update",
"1.7.1": "Fixed Server Crash",
"1.8.0": "Week #11 Update",
"1.9.0": "Week #14 Update"
"1.9.0": "Week #14 Update",
"1.10.0": "Week #15 Update"
},
"1.16.2": {
"1.0.0": "The very first release",
Expand All @@ -66,7 +69,8 @@
"1.7.0": "Week #7 Update",
"1.7.1": "Fixed Server Crash",
"1.8.0": "Week #11 Update",
"1.9.0": "Week #14 Update"
"1.9.0": "Week #14 Update",
"1.10.0": "Week #15 Update"
},
"1.16.1": {
"1.0.0": "The very first release",
Expand All @@ -83,18 +87,19 @@
"1.7.0": "Week #7 Update",
"1.7.1": "Fixed Server Crash",
"1.8.0": "Week #11 Update",
"1.9.0": "Week #14 Update"
"1.9.0": "Week #14 Update",
"1.10.0": "Week #15 Update"
},
"promos": {
"1.16.5-latest": "1.9.0",
"1.16.5-recommended": "1.9.0",
"1.16.4-latest": "1.9.0",
"1.16.4-recommended": "1.9.0",
"1.16.3-latest": "1.9.0",
"1.16.3-recommended": "1.9.0",
"1.16.2-latest": "1.9.0",
"1.16.2-recommended": "1.9.0",
"1.16.1-latest": "1.9.0",
"1.16.1-recommended": "1.9.0"
"1.16.5-latest": "1.10.0",
"1.16.5-recommended": "1.10.0",
"1.16.4-latest": "1.10.0",
"1.16.4-recommended": "1.10.0",
"1.16.3-latest": "1.10.0",
"1.16.3-recommended": "1.10.0",
"1.16.2-latest": "1.10.0",
"1.16.2-recommended": "1.10.0",
"1.16.1-latest": "1.10.0",
"1.16.1-recommended": "1.10.0"
}
}

0 comments on commit 8eb8eec

Please sign in to comment.