-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
772c3e6
commit 0c78787
Showing
24 changed files
with
293 additions
and
21 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
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
44 changes: 44 additions & 0 deletions
44
src/main/java/net/pengi/potatoperks/block/custom/PotatoPortal.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,44 @@ | ||
package net.pengi.potatoperks.block.custom; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.ItemEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.sound.SoundCategory; | ||
import net.minecraft.sound.SoundEvents; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import net.pengi.potatoperks.item.ModItems; | ||
|
||
public class PotatoPortal extends Block { | ||
public PotatoPortal(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
@Override | ||
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, | ||
BlockHitResult hit) { | ||
world.playSound(player, pos, SoundEvents.BLOCK_AMETHYST_BLOCK_CHIME, SoundCategory.BLOCKS, 1f, 1f); | ||
return ActionResult.SUCCESS; | ||
} | ||
|
||
@Override | ||
public void onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity) { | ||
if (entity instanceof ItemEntity itemEntity) { | ||
if(itemEntity.getStack().getItem() == ModItems.COOKED_PINK_POTATO){ | ||
itemEntity.setStack(new ItemStack(ModItems.BLUE_POTATO, itemEntity.getStack().getCount())); | ||
} | ||
if(itemEntity.getStack().getItem() == ModItems.COOKED_BLUE_POTATO){ | ||
itemEntity.setStack(new ItemStack(ModItems.ORANGE_POTATO, itemEntity.getStack().getCount())); | ||
} | ||
if(itemEntity.getStack().getItem() == ModItems.COOKED_ORANGE_POTATO){ | ||
itemEntity.setStack(new ItemStack(ModItems.PURPLE_POTATO, itemEntity.getStack().getCount())); | ||
} | ||
} | ||
super.onSteppedOn(world, pos, state, entity); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/potatoperks/blockstates/potato_portal.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,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "potatoperks:block/potato_portal" | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/potatoperks/models/block/potato_portal.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,6 @@ | ||
{ | ||
"parent": "minecraft:block/cube_all", | ||
"textures": { | ||
"all": "potatoperks:block/potato_portal" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/potatoperks/models/item/cooked_purple_potato.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,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "potatoperks:item/cooked_purple_potato" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/potatoperks/models/item/potato_portal.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,3 @@ | ||
{ | ||
"parent": "potatoperks:block/potato_portal" | ||
} |
Binary file added
BIN
+961 Bytes
src/main/resources/assets/potatoperks/textures/block/potato_portal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+420 Bytes
src/main/resources/assets/potatoperks/textures/item/cooked_purple_potato.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
src/main/resources/data/minecraft/tags/block/mineable/pickaxe.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,7 @@ | ||
{ | ||
"replace": false, | ||
"values": [ | ||
"potatoperks:petrified_potato_ore" | ||
|
||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/data/minecraft/tags/block/needs_iron_tool.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,7 @@ | ||
{ | ||
"replace": false, | ||
"values": [ | ||
"potatoperks:petrified_potato_ore" | ||
|
||
] | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/resources/data/potatoperks/loot_table/blocks/blue_potato_block.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": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "potatoperks:blue_potato_block" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
] | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/resources/data/potatoperks/loot_table/blocks/orange_potato_block.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": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "potatoperks:orange_potato_block" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
] | ||
} |
60 changes: 60 additions & 0 deletions
60
src/main/resources/data/potatoperks/loot_table/blocks/petrified_potato_ore.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,60 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:alternatives", | ||
"children": [ | ||
{ | ||
"type": "minecraft:item", | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:match_tool", | ||
"predicate": { | ||
"predicates": { | ||
"minecraft:enchantments": [ | ||
{ | ||
"enchantments": "minecraft:silk_touch", | ||
"levels": { | ||
"min": 1 | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"name": "potatoperks:petrified_potato_ore" | ||
}, | ||
{ | ||
"type": "minecraft:item", | ||
"functions": [ | ||
{ | ||
"add": false, | ||
"count": { | ||
"type": "minecraft:uniform", | ||
"max": 5.0, | ||
"min": 2.0 | ||
}, | ||
"function": "minecraft:set_count" | ||
}, | ||
{ | ||
"enchantment": "minecraft:fortune", | ||
"formula": "minecraft:ore_drops", | ||
"function": "minecraft:apply_bonus" | ||
}, | ||
{ | ||
"function": "minecraft:explosion_decay" | ||
} | ||
], | ||
"name": "potatoperks:pink_potato" | ||
} | ||
] | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
] | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/resources/data/potatoperks/loot_table/blocks/pink_potato_block.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": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "potatoperks:pink_potato_block" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
] | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/resources/data/potatoperks/loot_table/blocks/potato_portal.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": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "potatoperks:potato_portal" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
] | ||
} |
Oops, something went wrong.