Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No brewing yet, but bottling and tipped arrows works
- Loading branch information
1 parent
f540299
commit 947ff4f
Showing
40 changed files
with
455 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/generated/resources/data/inspirations/loot_tables/blocks/potion_cauldron.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"rolls": 1.0, | ||
"bonus_rolls": 0.0, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "minecraft:cauldron" | ||
} | ||
], | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
] | ||
} | ||
] | ||
} |
15 changes: 0 additions & 15 deletions
15
src/generated/resources/data/inspirations/recipes/cauldron/potion/lingering_empty.json
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/generated/resources/data/inspirations/recipes/cauldron/potion/lingering_fill.json
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/generated/resources/data/inspirations/recipes/cauldron/potion/normal_empty.json
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/generated/resources/data/inspirations/recipes/cauldron/potion/normal_fill.json
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/generated/resources/data/inspirations/recipes/cauldron/potion/splash_empty.json
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/generated/resources/data/inspirations/recipes/cauldron/potion/splash_fill.json
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/generated/resources/data/inspirations/recipes/cauldron/potion/tipped_arrow.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/knightminer/inspirations/common/network/CauldronPotionUpdatePacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package knightminer.inspirations.common.network; | ||
|
||
import knightminer.inspirations.library.MiscUtil; | ||
import knightminer.inspirations.recipes.block.entity.PotionCauldronBlockEntity; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.world.item.alchemy.Potion; | ||
import net.minecraftforge.network.NetworkEvent.Context; | ||
import net.minecraftforge.registries.ForgeRegistries; | ||
import slimeknights.mantle.network.packet.IThreadsafePacket; | ||
import slimeknights.mantle.util.BlockEntityHelper; | ||
|
||
/** Packet to update the potion in a cauldron */ | ||
public class CauldronPotionUpdatePacket implements IThreadsafePacket { | ||
private final BlockPos pos; | ||
private final Potion potion; | ||
|
||
public CauldronPotionUpdatePacket(BlockPos pos, Potion potion) { | ||
this.pos = pos; | ||
this.potion = potion; | ||
} | ||
|
||
public CauldronPotionUpdatePacket(FriendlyByteBuf buffer) { | ||
this.pos = buffer.readBlockPos(); | ||
this.potion = buffer.readRegistryIdUnsafe(ForgeRegistries.POTIONS); | ||
} | ||
|
||
@Override | ||
public void encode(FriendlyByteBuf buffer) { | ||
buffer.writeBlockPos(pos); | ||
buffer.writeRegistryIdUnsafe(ForgeRegistries.POTIONS, potion); | ||
} | ||
|
||
@Override | ||
public void handleThreadsafe(Context context) { | ||
HandleClient.handle(this); | ||
} | ||
|
||
/** Once removed client class */ | ||
private static class HandleClient { | ||
private static void handle(CauldronPotionUpdatePacket packet) { | ||
BlockEntityHelper.get(PotionCauldronBlockEntity.class, Minecraft.getInstance().level, packet.pos, true).ifPresent(te -> { | ||
if (te.setPotion(packet.potion)) { | ||
MiscUtil.notifyClientUpdate(te); | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.