Skip to content

Commit

Permalink
v1.3.8 [ 1.20.2 ]
Browse files Browse the repository at this point in the history
changelog: see changelog.md
  • Loading branch information
sa-shiro committed Oct 13, 2023
1 parent f55da34 commit 690f2c7
Show file tree
Hide file tree
Showing 38 changed files with 732 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

run-name: "v1.3.7 - 1.20.2"
run-name: "v1.3.8 - 1.20.2"

name: build
on: [ push, pull_request, workflow_dispatch ]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

run-name: "release: v1.3.7 - 1.20.2"
run-name: "release: v1.3.8 - 1.20.2"

name: publish
on: workflow_dispatch

env:
VERSION: 1.3.7
VERSION: 1.3.8
MC_VERSION: "1.20.2"
MC_VERSION_RANGE: |
1.20
Expand Down
9 changes: 2 additions & 7 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
# v1.3.7 [ 1.20.2 ]
# v1.3.8 [ 1.20.2 ]

## General

- Update to Minecraft `1.20.2`
- Added the forgotten Copper Blocks
- Compatible with: `[ 1.20, 1.20.1, 1.20.2 ]`

---

## Fabric

- upgrade fabric `0.83.0+1.20` to `0.90.0+1.20.2`
- upgrade fabric loader `0.14.21` to `0.14.23`

---

## Forge

- upgrade forge `46.0.14` to `48.0.26`

---
6 changes: 3 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ base {
}
minecraft {
version(minecraft_version)
if(file("src/main/resources/${mod_id}.accesswidener").exists()){
if (file("src/main/resources/${mod_id}.accesswidener").exists()) {
accessWideners(file("src/main/resources/${mod_id}.accesswidener"))
}
}

dependencies {
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// common compatible binaries. This means common code can not directly use loader specific concepts such as Forge events
// however it will be compatible with all supported mod loaders.
public class CommonClass {

// The loader specific projects are able to import and use any code from the common project. This allows you to
// write the majority of your code here and load it from your loader specific projects. This example has some
// code that gets invoked by the entry point of the loader specific projects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Collection;

public class Constants {

public static final String MOD_ID = "compressedblocks";
public static final String MOD_NAME = "Compressed Blocks";
public static final Logger LOG = LoggerFactory.getLogger(MOD_NAME);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,186 +18,201 @@

@SuppressWarnings("unused")
public class CompressedBlock {


public static class CustomDefaultBlock extends Block {
private final Compression compressor = new Compression();

public CustomDefaultBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomMudBlock extends MudBlock {
private final Compression compressor = new Compression();

public CustomMudBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomNyliumBlock extends NyliumBlock {
private final Compression compressor = new Compression();

public CustomNyliumBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomSandBlock extends SandBlock {
private final Compression compressor = new Compression();

public CustomSandBlock(int dustColor, Properties properties, int compressionLevel) {
super(dustColor, properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomGravelBlock extends GravelBlock {
private final Compression compressor = new Compression();

public CustomGravelBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomDropExperienceBlock extends DropExperienceBlock {
private final Compression compressor = new Compression();

public CustomDropExperienceBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomRedstoneOreBlock extends RedStoneOreBlock {
private final Compression compressor = new Compression();

public CustomRedstoneOreBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomRedstoneTorchBlock extends RedstoneTorchBlock {
private final Compression compressor = new Compression();

public CustomRedstoneTorchBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomSlimeBlock extends SlimeBlock {
private final Compression compressor = new Compression();

public CustomSlimeBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomSoulSandBlock extends SoulSandBlock {
private final Compression compressor = new Compression();

public CustomSoulSandBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomRotatedPillarBlock extends RotatedPillarBlock {
private final Compression compressor = new Compression();

public CustomRotatedPillarBlock(Properties properties, int compressionLevel) {
super(properties);
compressor.setCompressionLevel(compressionLevel);
}

public CustomRotatedPillarBlock(MapColor innerColor, MapColor outerColor, float hardness, float resistance, int compressionLevel) {
super(Properties.of().mapColor((color) -> color.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y ? innerColor : outerColor).sound(SoundType.WOOD).strength(hardness, resistance));
compressor.setCompressionLevel(compressionLevel);
}

@Override
public @NotNull BlockState rotate(@NotNull BlockState blockState, @NotNull Rotation rotation) {
return super.rotate(blockState, rotation);
}

@Override
protected void createBlockStateDefinition(StateDefinition.@NotNull Builder<Block, BlockState> blockBlockStateBuilder) {
super.createBlockStateDefinition(blockBlockStateBuilder);
}

@Override
public BlockState getStateForPlacement(@NotNull BlockPlaceContext blockPlaceContext) {
return super.getStateForPlacement(blockPlaceContext);
}


@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
lC.add(Component.literal(compressor.getBlockCount() + " Blocks").withStyle(compressor.getStyle()));
}
}

public static class CustomWeatheringCopperBlock extends WeatheringCopperFullBlock {
private final Compression compressor = new Compression();

public CustomWeatheringCopperBlock(WeatherState weatherState, Properties properties, int compressionLevel) {
super(weatherState, properties);
compressor.setCompressionLevel(compressionLevel);
}

@Override
public void appendHoverText(@NotNull ItemStack is, @Nullable BlockGetter bg, @NotNull List<Component> lC, @NotNull TooltipFlag ttf) {
super.appendHoverText(is, bg, lC, ttf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class CrateList {
private static final BlockBehaviour.Properties p7 = BlockBehaviour.Properties.of().strength(HARDNESS[7], RESISTANCE[7]).mapColor(MapColor.COLOR_BROWN).sound(SoundType.WOOD);
private static final BlockBehaviour.Properties p8 = BlockBehaviour.Properties.of().strength(HARDNESS[8], RESISTANCE[8]).mapColor(MapColor.COLOR_BROWN).sound(SoundType.WOOD);
private static final BlockBehaviour.Properties p9 = BlockBehaviour.Properties.of().strength(HARDNESS[9], RESISTANCE[9]).mapColor(MapColor.COLOR_BROWN).sound(SoundType.WOOD);

public static final RotatedPillarBlock APPLE_0 = new RotatedPillarBlock(p0);
public static final RotatedPillarBlock APPLE_1 = new RotatedPillarBlock(p1);
public static final RotatedPillarBlock APPLE_2 = new RotatedPillarBlock(p2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import java.util.List;

public class CrateItem extends BlockItem {

private final Block block;
private final String itemCount;
private final Compression comp = new Compression();

public CrateItem(Block block) {
super(block, new Properties()
.stacksTo(64)
Expand All @@ -27,7 +27,7 @@ public CrateItem(Block block) {
comp.setCompressionLevel(getLevel());
this.itemCount = comp.getBlockCount();
}

private int getLevel() {
String name = block.getDescriptionId().replace("block.compressedblocks.", "").replace("item.compressedblocks.", "");
if (name.startsWith("crated_")) return 0;
Expand All @@ -42,7 +42,7 @@ private int getLevel() {
if (name.startsWith("giga_")) return 9;
else return 0;
}

@Override
@ParametersAreNonnullByDefault
public void appendHoverText(ItemStack s, @Nullable Level l, List<Component> c, TooltipFlag t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
// environment to another. In the context of MultiLoader we use this feature to access a mock API in the common code that
// is swapped out for the platform specific implementation at runtime.
public class Services {

// In this example we provide a platform helper which provides information about what platform the mod is running on.
// For example this can be used to check if the code is running on Forge vs Fabric, or to ask the modloader if another
// mod is loaded.
public static final IPlatformHelper PLATFORM = load(IPlatformHelper.class);

// This code is used to load a service for the current environment. Your implementation of the service must be defined
// manually by including a text file in META-INF/services named with the fully qualified class name of the service.
// Inside the file you should write the fully qualified class name of the implementation to load for the platform. For
// example our file on Forge points to ForgePlatformHelper while Fabric points to FabricPlatformHelper.
public static <T> T load(Class<T> clazz) {

final T loadedService = ServiceLoader.load(clazz)
.findFirst()
.orElseThrow(() -> new NullPointerException("Failed to load service for " + clazz.getName()));
Expand Down
Loading

0 comments on commit 690f2c7

Please sign in to comment.