-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from SynthRose/0.5.0
0.5.0: Magnum Opus
- Loading branch information
Showing
137 changed files
with
1,671 additions
and
180 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
org.gradle.jvmargs = -Xmx1G | ||
|
||
#Fabric properties | ||
minecraft_version = 20w14a | ||
yarn_mappings = 20w14a+build.9 | ||
minecraft_version = 20w15a | ||
yarn_mappings = 20w15a+build.4 | ||
loader_version = 0.8.2+build.194 | ||
|
||
#Mod properties | ||
mod_version = 0.4.0 | ||
mod_version = 0.5.0 | ||
maven_group = io.github.synthrose.artofalchemy | ||
archives_base_name = artofalchemy | ||
|
||
#Dependencies | ||
fabric_api_version = 0.5.8+build.316-1.16 | ||
libgui_version = 1.8.0+20w12a | ||
modmenu_version = 1.11.0+build.2 | ||
fabric_api_version = 0.5.9+build.319-1.16 | ||
libgui_version = 1.8.1+20w15a | ||
modmenu_version = 1.11.1+build.3 |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/io/github/synthrose/artofalchemy/block/BlockCalcinatorPlus.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,32 @@ | ||
package io.github.synthrose.artofalchemy.block; | ||
|
||
import io.github.synthrose.artofalchemy.blockentity.BlockEntityCalcinatorPlus; | ||
import net.minecraft.block.Material; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.sound.BlockSoundGroup; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.world.BlockView; | ||
|
||
public class BlockCalcinatorPlus extends BlockCalcinator { | ||
|
||
public static final Settings SETTINGS = Settings | ||
.of(Material.METAL).sounds(BlockSoundGroup.METAL) | ||
.strength(5.0f, 6.0f) | ||
.lightLevel((state) -> state.get(LIT) ? 15 : 0) | ||
.nonOpaque(); | ||
|
||
public static Identifier getId() { | ||
return Registry.BLOCK.getId(AoABlocks.CALCINATOR_PLUS); | ||
} | ||
|
||
public BlockCalcinatorPlus() { | ||
super(SETTINGS); | ||
} | ||
|
||
@Override | ||
public BlockEntity createBlockEntity(BlockView world) { | ||
return new BlockEntityCalcinatorPlus(); | ||
} | ||
|
||
} |
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
31 changes: 31 additions & 0 deletions
31
src/main/java/io/github/synthrose/artofalchemy/block/BlockDissolverPlus.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,31 @@ | ||
package io.github.synthrose.artofalchemy.block; | ||
|
||
import io.github.synthrose.artofalchemy.blockentity.BlockEntityDissolverPlus; | ||
import net.minecraft.block.Material; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.world.BlockView; | ||
|
||
public class BlockDissolverPlus extends BlockDissolver { | ||
|
||
public static final Settings SETTINGS = Settings | ||
.of(Material.METAL) | ||
.strength(5.0f, 6.0f) | ||
.lightLevel((state) -> state.get(LIT) ? 15 : 0) | ||
.nonOpaque(); | ||
|
||
public static Identifier getId() { | ||
return Registry.BLOCK.getId(AoABlocks.DISSOLVER_PLUS); | ||
} | ||
|
||
public BlockDissolverPlus() { | ||
super(SETTINGS); | ||
} | ||
|
||
@Override | ||
public BlockEntity createBlockEntity(BlockView world) { | ||
return new BlockEntityDissolverPlus(); | ||
} | ||
|
||
} |
109 changes: 109 additions & 0 deletions
109
src/main/java/io/github/synthrose/artofalchemy/block/BlockProjector.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,109 @@ | ||
package io.github.synthrose.artofalchemy.block; | ||
|
||
import io.github.synthrose.artofalchemy.blockentity.BlockEntityProjector; | ||
import io.github.synthrose.artofalchemy.item.AoAItems; | ||
import net.fabricmc.fabric.api.container.ContainerProviderRegistry; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockEntityProvider; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.Material; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.inventory.Inventory; | ||
import net.minecraft.item.ItemPlacementContext; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.sound.BlockSoundGroup; | ||
import net.minecraft.sound.SoundCategory; | ||
import net.minecraft.sound.SoundEvents; | ||
import net.minecraft.state.StateManager.Builder; | ||
import net.minecraft.state.property.BooleanProperty; | ||
import net.minecraft.state.property.Properties; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.ItemScatterer; | ||
import net.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.world.BlockView; | ||
import net.minecraft.world.World; | ||
|
||
public class BlockProjector extends Block implements BlockEntityProvider { | ||
|
||
public static final BooleanProperty LIT = Properties.LIT; | ||
public static final Settings SETTINGS = Settings | ||
.of(Material.METAL).sounds(BlockSoundGroup.METAL) | ||
.strength(5.0f, 6.0f) | ||
.lightLevel((state) -> state.get(LIT) ? 15 : 0) | ||
.nonOpaque(); | ||
|
||
public static Identifier getId() { | ||
return Registry.BLOCK.getId(AoABlocks.PROJECTOR); | ||
} | ||
|
||
public BlockProjector() { | ||
this(SETTINGS); | ||
} | ||
|
||
protected BlockProjector(Settings settings) { | ||
super(settings); | ||
setDefaultState(getDefaultState().with(LIT, false)); | ||
} | ||
|
||
@Override | ||
protected void appendProperties(Builder<Block, BlockState> builder) { | ||
builder.add(LIT); | ||
} | ||
|
||
@Override | ||
public BlockState getPlacementState(ItemPlacementContext ctx) { | ||
return super.getPlacementState(ctx); | ||
} | ||
|
||
@Override | ||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, | ||
BlockHitResult hit) { | ||
|
||
ItemStack inHand = player.getStackInHand(hand); | ||
|
||
BlockEntity blockEntity = world.getBlockEntity(pos); | ||
if (blockEntity instanceof BlockEntityProjector) { | ||
BlockEntityProjector projector = (BlockEntityProjector) blockEntity; | ||
if (inHand.getItem() == AoAItems.ALKAHEST_BUCKET && projector.addAlkahest(1000)) { | ||
if (!player.abilities.creativeMode) { | ||
player.setStackInHand(hand, new ItemStack(Items.BUCKET)); | ||
} | ||
world.playSound(null, pos, SoundEvents.ITEM_BUCKET_EMPTY, | ||
SoundCategory.BLOCKS, 1.0F, 1.0F); | ||
return ActionResult.SUCCESS; | ||
} | ||
if (!world.isClient()) { | ||
ContainerProviderRegistry.INSTANCE.openContainer(getId(), player, | ||
(packetByteBuf -> packetByteBuf.writeBlockPos(pos))); | ||
} | ||
return ActionResult.SUCCESS; | ||
} else { | ||
return ActionResult.PASS; | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public BlockEntity createBlockEntity(BlockView world) { | ||
return new BlockEntityProjector(); | ||
} | ||
|
||
@Override | ||
public void onBlockRemoved(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) { | ||
if (state.getBlock() != newState.getBlock()) { | ||
BlockEntity blockEntity = world.getBlockEntity(pos); | ||
if (blockEntity instanceof BlockEntityProjector) { | ||
ItemScatterer.spawn(world, pos, (Inventory) blockEntity); | ||
} | ||
|
||
super.onBlockRemoved(state, world, pos, newState, moved); | ||
} | ||
} | ||
|
||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/io/github/synthrose/artofalchemy/block/BlockSynthesizerPlus.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,32 @@ | ||
package io.github.synthrose.artofalchemy.block; | ||
|
||
import io.github.synthrose.artofalchemy.blockentity.BlockEntityDissolverPlus; | ||
import io.github.synthrose.artofalchemy.blockentity.BlockEntitySynthesizerPlus; | ||
import net.minecraft.block.Material; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.world.BlockView; | ||
|
||
public class BlockSynthesizerPlus extends BlockSynthesizer { | ||
|
||
public static final Settings SETTINGS = Settings | ||
.of(Material.METAL) | ||
.strength(5.0f, 6.0f) | ||
.lightLevel((state) -> state.get(LIT) ? 15 : 0) | ||
.nonOpaque(); | ||
|
||
public static Identifier getId() { | ||
return Registry.BLOCK.getId(AoABlocks.SYNTHESIZER_PLUS); | ||
} | ||
|
||
public BlockSynthesizerPlus() { | ||
super(SETTINGS); | ||
} | ||
|
||
@Override | ||
public BlockEntity createBlockEntity(BlockView world) { | ||
return new BlockEntitySynthesizerPlus(); | ||
} | ||
|
||
} |
Oops, something went wrong.