Skip to content

Commit

Permalink
Update to 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugman76 committed Mar 26, 2023
1 parent 4017f34 commit 7a138da
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 52 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.1-SNAPSHOT'
}

apply from: 'https://dawnteammc.github.io/resources/gradle_scripts/fabric-mod/java-17.gradle'
Expand All @@ -24,8 +24,8 @@ dependencies {
modImplementation("com.terraformersmc:modmenu:${modmenu_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation "squeek.appleskin:appleskin-fabric:mc1.19.3-${appleskin_version}:api"
modImplementation("squeek.appleskin:appleskin-fabric:mc1.19.3-${appleskin_version}") {
modImplementation "squeek.appleskin:appleskin-fabric:mc1.19.4-${appleskin_version}:api"
modImplementation("squeek.appleskin:appleskin-fabric:mc1.19.4-${appleskin_version}") {
exclude module: 'modmenu'
}
}
Expand Down
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ github_name=DawnAPI
# CurseForge Metadata
curseforge_slug=dawn
curseforge_id=399309
curseforge_game_versions=1.19.3, Java 17, Fabric
curseforge_game_versions=1.19.4, Java 17, Fabric
curseforge_embedded_libraries=cloth-config
curseforge_required_dependencies=fabric-api

# Modrinth Metadata
modrinth_slug=dawn
modrinth_id=meZK2DCX
modrinth_game_versions=1.19.3
modrinth_game_versions=1.19.4
modrinth_mod_loaders=fabric
modrinth_embedded_dependencies=cloth-config
modrinth_required_dependencies=fabric-api

# https://fabricmc.net/develop/
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
loader_version=0.14.12
fabric_version=0.72.0+1.19.3
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.18
fabric_version=0.76.0+1.19.4

# https://maven.shedaniel.me/me/shedaniel/cloth/cloth-config-fabric/
cloth_version=9.0.94
cloth_version=10.0.96
# https://maven.terraformersmc.com/releases/com/terraformersmc/terraform-api/terraform-shapes-api-v1
terraform_shapes_version=5.0.0-beta.1
terraform_shapes_version=6.1.0-alpha.4
# https://maven.terraformersmc.com/releases/com/terraformersmc/terraform-api/terraform-wood-api-v1
terraform_wood_version=5.0.0-beta.1
terraform_wood_version=6.1.0-alpha.4
# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/
modmenu_version=5.0.2
modmenu_version=6.1.0-rc.4
# https://maven.ryanliptak.com/squeek/appleskin/appleskin-fabric/
appleskin_version=2.4.2
appleskin_version=2.4.3
34 changes: 18 additions & 16 deletions src/main/java/fr/hugman/dawn/DawnFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,26 +155,28 @@ public static SlabBlock slab(Block baseBlock) {
return new SlabBlock(DawnBlockSettings.copy(baseBlock));
}

public static PressurePlateBlock pressurePlate(Block baseBlock, PressurePlateBlock.ActivationRule activationRule, SoundEvent depressSound, SoundEvent pressSound) {
public static PressurePlateBlock pressurePlate(Block baseBlock, PressurePlateBlock.ActivationRule activationRule, BlockSetType setType) {
DawnBlockSettings settings = DawnBlockSettings.copy(baseBlock)
.strength(0.5f)
.noCollision();
return new PressurePlateBlock(activationRule, settings, depressSound, pressSound);
return new PressurePlateBlock(activationRule, settings, setType);
}

public static PressurePlateBlock pressurePlate(Block baseBlock) {
return pressurePlate(baseBlock, PressurePlateBlock.ActivationRule.MOBS, SoundEvents.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_OFF, SoundEvents.BLOCK_WOODEN_PRESSURE_PLATE_CLICK_ON);
return pressurePlate(baseBlock, PressurePlateBlock.ActivationRule.MOBS, BlockSetType.OAK);
}

public static ButtonBlock woodenButton(boolean isNether) {
public static ButtonBlock woodenButton(boolean isNether, BlockSetType setType) {
return new ButtonBlock(DawnBlockSettings.of(Material.DECORATION)
.item()
.strength(0.5f)
.noCollision()
.sounds(isNether ? BlockSoundGroup.NETHER_WOOD : BlockSoundGroup.WOOD),
30, true,
isNether ? SoundEvents.BLOCK_NETHER_WOOD_BUTTON_CLICK_OFF : SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_OFF,
isNether ? SoundEvents.BLOCK_NETHER_WOOD_BUTTON_CLICK_ON : SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_ON);
setType, 30, true);
}

public static ButtonBlock woodenButton(boolean isNether) {
return woodenButton(isNether, BlockSetType.OAK);
}

public static FenceBlock fence(boolean isNether, Block baseBlock) {
Expand All @@ -184,38 +186,38 @@ public static FenceBlock fence(boolean isNether, Block baseBlock) {
}


public static FenceGateBlock fenceGate(boolean isNether, Block baseBlock, SoundEvent closeSound, SoundEvent openSound) {
public static FenceGateBlock fenceGate(boolean isNether, Block baseBlock, WoodType woodType) {
DawnBlockSettings settings = DawnBlockSettings.copy(baseBlock).item(new DawnItemSettings().fuelTime(isNether ? 0 : 300));
if(isNether) settings.flammability(5, 20);
return new FenceGateBlock(settings, closeSound, openSound);
return new FenceGateBlock(settings, woodType);
}

public static FenceGateBlock fenceGate(boolean isNether, Block baseBlock) {
return fenceGate(isNether, baseBlock, SoundEvents.BLOCK_FENCE_GATE_CLOSE, SoundEvents.BLOCK_FENCE_GATE_OPEN);
return fenceGate(isNether, baseBlock, WoodType.OAK);
}

public static WallBlock wall(Block baseBlock) {
return new WallBlock(DawnBlockSettings.copy(baseBlock));
}

public static TrapdoorBlock trapdoor(Block baseBlock, SoundEvent closeSound, SoundEvent openSound) {
public static TrapdoorBlock trapdoor(Block baseBlock, BlockSetType setType) {
DawnBlockSettings settings = DawnBlockSettings.copy(baseBlock)
.strength(3.0f)
.nonOpaque()
.allowsSpawning((state, world, pos, type) -> false);
return new TrapdoorBlock(settings, closeSound, openSound);
return new TrapdoorBlock(settings, setType);
}

public static TrapdoorBlock woodenTrapdoor(Block baseBlock) {
return trapdoor(baseBlock, SoundEvents.BLOCK_WOODEN_TRAPDOOR_CLOSE, SoundEvents.BLOCK_WOODEN_TRAPDOOR_OPEN);
return trapdoor(baseBlock, BlockSetType.OAK);
}

public static DoorBlock door(Block baseBlock, SoundEvent openSound, SoundEvent closeSound) {
return new DoorBlock(DawnBlockSettings.copy(baseBlock).strength(3.0f).nonOpaque(), openSound, closeSound);
public static DoorBlock door(Block baseBlock, BlockSetType setType) {
return new DoorBlock(DawnBlockSettings.copy(baseBlock).strength(3.0f).nonOpaque(), setType);
}

public static DoorBlock woodenDoor(Block baseBlock) {
return door(baseBlock, SoundEvents.BLOCK_WOODEN_DOOR_OPEN, SoundEvents.BLOCK_WOODEN_DOOR_CLOSE);
return door(baseBlock, BlockSetType.OAK);
}

public static SaplingBlock sapling(SaplingGenerator generator) {
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/fr/hugman/dawn/block/DawnBlockSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,8 @@ public DawnBlockSettings dropsNothing() {
}

@Override
public DawnBlockSettings offsetType(AbstractBlock.OffsetType offsetType) {
super.offsetType(offsetType);
return this;
}

@Override
public DawnBlockSettings offsetType(Function<BlockState, AbstractBlock.OffsetType> offsetType) {
super.offsetType(offsetType);
public DawnBlockSettings offset(AbstractBlock.OffsetType offsetType) {
super.offset(offsetType);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void render(FlyingBlockEntity entity, float entityYaw, float partialTicks
World world = entity.getWorldClient();
if(blockState != world.getBlockState(entity.getBlockPos()) && blockState.getRenderType() != BlockRenderType.INVISIBLE) {
matrixStack.push();
BlockPos blockPos = new BlockPos(entity.getX(), entity.getBoundingBox().maxY, entity.getZ());
BlockPos blockPos = BlockPos.ofFloored(entity.getX(), entity.getBoundingBox().maxY, entity.getZ());
matrixStack.translate(-0.5D, 0.0D, -0.5D);
BlockRenderManager blockRenderManager = MinecraftClient.getInstance().getBlockRenderManager();
blockRenderManager.getModelRenderer().render(world, blockRenderManager.getModel(blockState), blockState, blockPos, matrixStack, vertexConsumerProvider.getBuffer(RenderLayers.getMovingBlockLayer(blockState)), false, Random.create(), blockState.getRenderingSeed(entity.getFallingBlockPos()), OverlayTexture.DEFAULT_UV);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fr/hugman/dawn/codec/DawnCodecs.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class DawnCodecs {
private static Codec<IntProvider> nonZeroIntProvider() {
Function<IntProvider, DataResult<IntProvider>> function = (provider) -> {
if(provider.getMin() <= 0 && provider.getMax() >= 0) {
return DataResult.error("Value provider should not contain the zero value: [" + provider.getMin() + "-" + provider.getMax() + "]");
return DataResult.error(() -> "Value provider should not contain the zero value: [" + provider.getMin() + "-" + provider.getMax() + "]");
}
return DataResult.success(provider);
};
Expand All @@ -42,7 +42,7 @@ private static Codec<IntProvider> nonZeroIntProvider() {
private static Codec<FloatProvider> nonZeroFloatProvider() {
Function<FloatProvider, DataResult<FloatProvider>> function = (provider) -> {
if(provider.getMin() <= 0.0F && provider.getMax() >= 0.0F) {
return DataResult.error("Value provider should not contain the zero value: [" + provider.getMin() + "-" + provider.getMax() + "]");
return DataResult.error(() -> "Value provider should not contain the zero value: [" + provider.getMin() + "-" + provider.getMax() + "]");
}
return DataResult.success(provider);
};
Expand All @@ -69,7 +69,7 @@ private static <N extends Number> Function<N, DataResult<N>> createRangeChecker(
if(((Comparable) value).compareTo(min) >= 0 && ((Comparable) value).compareTo(max) <= 0) {
return DataResult.success(value);
}
return DataResult.error((String) messageFactory.apply(value));
return DataResult.error(() -> messageFactory.apply(value));
};
}
}
3 changes: 0 additions & 3 deletions src/main/java/fr/hugman/dawn/command/HealthCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ private static int setHealth(ServerCommandSource source, Collection<? extends En
if(amount > 0.0F) {
livingEntity.heal(amount);
}
else if(amount < 0.0F) {
livingEntity.damage(DamageSource.OUT_OF_WORLD, amount * -1.0f);
}
}
else {
if(livingEntity.getHealth() > 0.0F) {
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/fr/hugman/dawn/entity/CustomTNTEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MovementType;
import net.minecraft.entity.TntEntity;
import net.minecraft.entity.data.DataTracker;
import net.minecraft.entity.data.TrackedData;
import net.minecraft.entity.data.TrackedDataHandlerRegistry;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtHelper;
import net.minecraft.network.Packet;
import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;

public class CustomTNTEntity extends Entity {
private static final TrackedData<Integer> FUSE = DataTracker.registerData(CustomTNTEntity.class, TrackedDataHandlerRegistry.INTEGER);
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/fr/hugman/dawn/entity/FlyingBlockEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.FallingBlockEntity;
import net.minecraft.entity.MovementType;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.data.DataTracker;
Expand All @@ -20,8 +19,8 @@
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtHelper;
import net.minecraft.network.Packet;
import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket;
import net.minecraft.predicate.entity.EntityPredicates;
import net.minecraft.registry.tag.BlockTags;
Expand Down Expand Up @@ -221,7 +220,7 @@ public boolean handleFallDamage(float fallDistance, float damageMultiplier, Dama
}
else {
predicate2 = EntityPredicates.EXCEPT_SPECTATOR;
damageSource3 = DamageSource.fallingBlock(this);
damageSource3 = this.getDamageSources().fallingBlock(this);
}

float f = (float) Math.min(MathHelper.floor((float) i * this.flyHurtAmount), this.flyHurtMax);
Expand Down

0 comments on commit 7a138da

Please sign in to comment.