Skip to content

Commit

Permalink
Merge pull request #232 from paulevsGitch/1.17
Browse files Browse the repository at this point in the history
1.17.1
  • Loading branch information
paulevsGitch authored Jul 9, 2021
2 parents a2aacd7 + 2c8862a commit 71148f4
Show file tree
Hide file tree
Showing 76 changed files with 1,213 additions and 34 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ Building:
* Run command line in folder: gradlew build
* Mod .jar will be in ./build/libs

Mappings:
* https://modmuss50.me/fabric.html?&version=1.16.4
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings= 6
loader_version= 0.11.6

# Mod Properties
mod_version = 0.10.1-pre
mod_version = 0.10.2-pre
maven_group = ru.betterend
archives_base_name = better-end

Expand Down
6 changes: 6 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# From https://github.com/jitpack/jitpack.io/issues/4506#issuecomment-864562270
before_install:
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdk update
- sdk install java 16.0.1.hs-adpt
- sdk use java 16.0.1.hs-adpt
4 changes: 2 additions & 2 deletions src/main/java/ru/betterend/blocks/NeonCactusBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.world.level.block.Blocks;
import ru.bclib.blocks.BaseRotatedPillarBlock;
import ru.betterend.blocks.basis.LitPillarBlock;

public class NeonCactusBlock extends BaseRotatedPillarBlock {
public class NeonCactusBlock extends LitPillarBlock {
public NeonCactusBlock() {
super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15));
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import ru.bclib.blocks.BaseRotatedPillarBlock;
import ru.betterend.blocks.basis.LitPillarBlock;

public class SmaragdantCrystalBlock extends BaseRotatedPillarBlock {
public class SmaragdantCrystalBlock extends LitPillarBlock {
public SmaragdantCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS)
.breakByTool(FabricToolTags.PICKAXES)
.luminance(15)
.hardness(1F)
.resistance(1F)
.noOcclusion()
.sound(SoundType.GLASS));
.sound(SoundType.AMETHYST));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public SmaragdantCrystalShardBlock() {
.materialColor(MaterialColor.COLOR_GREEN)
.breakByTool(FabricToolTags.PICKAXES)
.luminance(15)
.sound(SoundType.GLASS)
.sound(SoundType.AMETHYST_CLUSTER)
.requiresCorrectToolForDrops()
.noCollission());
}
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/ru/betterend/blocks/basis/LitBaseBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ru.betterend.blocks.basis;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.Nullable;
import ru.bclib.blocks.BaseBlock;

public class LitBaseBlock extends BaseBlock {
private static final String PATTERN = "{\"parent\":\"betterend:block/cube_noshade\",\"textures\":{\"texture\":\"betterend:block/name\"}}";

public LitBaseBlock(Properties settings) {
super(settings);
}

@Nullable
@Override
@Environment(EnvType.CLIENT)
public BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
return BlockModel.fromString(PATTERN.replace("name", resourceLocation.getPath()));
}
}
23 changes: 23 additions & 0 deletions src/main/java/ru/betterend/blocks/basis/LitPillarBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package ru.betterend.blocks.basis;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.resources.ResourceLocation;
import ru.bclib.blocks.BaseRotatedPillarBlock;

import java.util.Optional;

public class LitPillarBlock extends BaseRotatedPillarBlock {
private static final String PATTERN = "{\"parent\":\"betterend:block/pillar_noshade\",\"textures\":{\"end\":\"betterend:block/name_top\",\"side\":\"betterend:block/name_side\"}}";

public LitPillarBlock(Properties settings) {
super(settings);
}

@Override
@Environment(EnvType.CLIENT)
protected Optional<String> createBlockPattern(ResourceLocation blockId) {
String name = blockId.getPath();
return Optional.of(PATTERN.replace("name", name));
}
}
13 changes: 10 additions & 3 deletions src/main/java/ru/betterend/blocks/basis/PedestalBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@
import ru.betterend.blocks.EndBlockProperties;
import ru.betterend.blocks.EndBlockProperties.PedestalState;
import ru.betterend.blocks.InfusionPedestal;
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
import ru.betterend.blocks.entities.InfusionPedestalEntity;
import ru.betterend.blocks.entities.PedestalBlockEntity;
import ru.betterend.client.models.Patterns;
import ru.betterend.registry.EndBlockEntities;
import ru.betterend.registry.EndBlocks;
import ru.betterend.rituals.InfusionRitual;

Expand All @@ -55,6 +53,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.ToIntFunction;

@SuppressWarnings({"deprecation"})
public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
Expand Down Expand Up @@ -95,11 +94,19 @@ public static Block registerPedestal(ResourceLocation id, Block source) {
protected float height = 1.0F;

public PedestalBlock(Block parent) {
super(FabricBlockSettings.copyOf(parent).luminance(state -> state.getValue(HAS_LIGHT) ? 12 : 0));
super(FabricBlockSettings.copyOf(parent).luminance(getLuminance(parent.defaultBlockState())));
this.registerDefaultState(stateDefinition.any().setValue(STATE, PedestalState.DEFAULT).setValue(HAS_ITEM, false).setValue(HAS_LIGHT, false));
this.parent = parent;
}

private static ToIntFunction<BlockState> getLuminance(BlockState parent) {
final int light = parent.getLightEmission();
if (light > 0) {
return state -> light;
}
return state -> state.getValue(HAS_LIGHT) ? 12 : 0;
}

public float getHeight(BlockState state) {
if (state.getBlock() instanceof PedestalBlock && state.getValue(STATE) == PedestalState.PEDESTAL_TOP) {
return this.height - 0.2F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.level.block.Block;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.blocks.BaseRotatedPillarBlock;
import ru.bclib.blocks.BaseSlabBlock;
import ru.bclib.blocks.BaseStairsBlock;
import ru.bclib.blocks.BaseWallBlock;
import ru.bclib.recipes.GridRecipe;
import ru.bclib.util.TagHelper;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.EndPedestal;
import ru.betterend.blocks.basis.LitBaseBlock;
import ru.betterend.blocks.basis.LitPillarBlock;
import ru.betterend.config.Configs;
import ru.betterend.recipe.CraftingRecipes;
import ru.betterend.registry.EndBlocks;
Expand All @@ -32,14 +32,14 @@ public class CrystalSubblocksMaterial {

public CrystalSubblocksMaterial(String name, Block source) {
FabricBlockSettings material = FabricBlockSettings.copyOf(source);
polished = EndBlocks.registerBlock(name + "_polished", new BaseBlock(material));
tiles = EndBlocks.registerBlock(name + "_tiles", new BaseBlock(material));
pillar = EndBlocks.registerBlock(name + "_pillar", new BaseRotatedPillarBlock(material));
polished = EndBlocks.registerBlock(name + "_polished", new LitBaseBlock(material));
tiles = EndBlocks.registerBlock(name + "_tiles", new LitBaseBlock(material));
pillar = EndBlocks.registerBlock(name + "_pillar", new LitPillarBlock(material));
stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(source));
slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(source));
wall = EndBlocks.registerBlock(name + "_wall", new BaseWallBlock(source));
pedestal = EndBlocks.registerBlock(name + "_pedestal", new EndPedestal(source));
bricks = EndBlocks.registerBlock(name + "_bricks", new BaseBlock(material));
bricks = EndBlocks.registerBlock(name + "_bricks", new LitBaseBlock(material));
brick_stairs = EndBlocks.registerBlock(name + "_bricks_stairs", new BaseStairsBlock(bricks));
brick_slab = EndBlocks.registerBlock(name + "_bricks_slab", new BaseSlabBlock(bricks));
brick_wall = EndBlocks.registerBlock(name + "_bricks_wall", new BaseWallBlock(bricks));
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ protected void be_onTakeOutput(Player player, ItemStack stack, CallbackInfo info
world.levelEvent(1030, blockPos, 0);
}
});
//TODO: no more return, does this still work?
//info.setReturnValue(stack);
info.cancel();
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public ItemStack craft(Container craftingInventory, Player player) {
if (!player.isCreative()) {
if (!checkHammerDurability(craftingInventory, player)) return ItemStack.EMPTY;
ItemStack hammer = craftingInventory.getItem(1);
hammer.hurtAndBreak(this.damage, player, entity ->
entity.broadcastBreakEvent((InteractionHand) null));
hammer.hurtAndBreak(this.damage, player, entity -> entity.broadcastBreakEvent((InteractionHand) null));
}
return this.assemble(craftingInventory);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ru/betterend/registry/EndBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,9 @@ public class EndBlocks extends BlocksRegistry {
public static final Block ENDER_BLOCK = registerBlock("ender_block", new EnderBlock());
public static final Block AURORA_CRYSTAL = registerBlock("aurora_crystal", new AuroraCrystalBlock());
public static final Block AMBER_BLOCK = registerBlock("amber_block", new AmberBlock());
public static final Block SMARAGDANT_CRYSTAL_SHARD = registerBlock("smaragdant_crystal_shard", new SmaragdantCrystalShardBlock());
public static final Block SMARAGDANT_CRYSTAL = registerBlock("smaragdant_crystal", new SmaragdantCrystalBlock());
public static final CrystalSubblocksMaterial SMARAGDANT_SUBBLOCKS = new CrystalSubblocksMaterial("smaragdant_crystal", SMARAGDANT_CRYSTAL);
public static final Block SMARAGDANT_CRYSTAL_SHARD = registerBlock("smaragdant_crystal_shard", new SmaragdantCrystalShardBlock());

public static final Block RESPAWN_OBELISK = registerBlock("respawn_obelisk", new RespawnObeliskBlock());

Expand Down
1 change: 1 addition & 0 deletions src/main/java/ru/betterend/registry/EndSounds.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class EndSounds {
public static final SoundEvent AMBIENT_UMBRELLA_JUNGLE = register("ambient", "umbrella_jungle");
public static final SoundEvent AMBIENT_GLOWING_GRASSLANDS = register("ambient", "glowing_grasslands");
public static final SoundEvent AMBIENT_CAVES = register("ambient", "caves");
public static final SoundEvent AMBIENT_AMBER_LAND = register("ambient", "amber_land");

// Entity
public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public AmberLandBiome() {
.setPlantsColor(219, 115, 38)
.setWaterAndFogColor(145, 108, 72)
.setMusic(EndSounds.MUSIC_FOREST)
.setLoop(EndSounds.AMBIENT_AMBER_LAND)
.setParticles(EndParticles.AMBER_SPHERE, 0.001F)
.setSurface(EndBlocks.AMBER_MOSS)
.addFeature(EndFeatures.AMBER_ORE)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"variants": {
"facing=east,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs" },
"facing=west,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "y": 180 },
"facing=south,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "y": 90 },
"facing=north,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "y": 270 },
"facing=east,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer" },
"facing=west,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 180 },
"facing=south,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 90 },
"facing=north,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 270 },
"facing=east,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 270 },
"facing=west,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 90 },
"facing=south,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer" },
"facing=north,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 180 },
"facing=east,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner" },
"facing=west,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 180 },
"facing=south,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 90 },
"facing=north,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 270 },
"facing=east,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 270 },
"facing=west,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 90 },
"facing=south,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner" },
"facing=north,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 180 },
"facing=east,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180 },
"facing=west,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180, "y": 180 },
"facing=south,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180, "y": 90 },
"facing=north,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180, "y": 270 },
"facing=east,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 90 },
"facing=west,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 270 },
"facing=south,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 180 },
"facing=north,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180 },
"facing=east,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180 },
"facing=west,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 180 },
"facing=south,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 90 },
"facing=north,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 270 },
"facing=east,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 90 },
"facing=west,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 270 },
"facing=south,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 180 },
"facing=north,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180 },
"facing=east,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180 },
"facing=west,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 180 },
"facing=south,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 90 },
"facing=north,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 270 }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"multipart": [
{
"when": {
"up": "true"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_post"
}
},
{
"when": {
"north": "low"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side",
"uvlock": true
}
},
{
"when": {
"east": "low"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side",
"y": 90,
"uvlock": true
}
},
{
"when": {
"south": "low"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side",
"y": 180,
"uvlock": true
}
},
{
"when": {
"west": "low"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side",
"y": 270,
"uvlock": true
}
},
{
"when": {
"north": "tall"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall",
"uvlock": true
}
},
{
"when": {
"east": "tall"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall",
"y": 90,
"uvlock": true
}
},
{
"when": {
"south": "tall"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall",
"y": 180,
"uvlock": true
}
},
{
"when": {
"west": "tall"
},
"apply": {
"model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall",
"y": 270,
"uvlock": true
}
}
]
}
Loading

0 comments on commit 71148f4

Please sign in to comment.