Skip to content

Commit

Permalink
Match expected FabricBlockSettings method names
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Jul 13, 2024
1 parent cbb1cdc commit ab63bcd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 65 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ val upstreamVersion = version

ext["upstreamVersion"] = upstreamVersion

version = "$upstreamVersion+$implementationVersion+$versionMc"
version = "$upstreamVersion+$implementationVersion+$versionMc${(if (System.getenv("GITHUB_RUN_NUMBER") == null) "+local" else "")}"
println("Version: $version")

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@ protected FabricBlockSettings(BlockBehaviour.Properties settings) {
AbstractBlockSettingsAccessor otherAccessor = (AbstractBlockSettingsAccessor) settings;

// Copied in vanilla: sorted by vanilla copy order
this.destroyTime(otherAccessor.getDestroyTime());
this.explosionResistance(otherAccessor.getExplosionResistance());
this.hardness(otherAccessor.getDestroyTime());
this.resistance(otherAccessor.getExplosionResistance());
this.collidable(otherAccessor.getHasCollision());
thisAccessor.setIsRandomlyTicking(otherAccessor.getIsRandomlyTicking());
this.lightLevel(otherAccessor.getLuminance());
thisAccessor.setMapColor(otherAccessor.getMapColor());
this.sound(otherAccessor.getSoundType());
this.friction(otherAccessor.getFriction());
this.speedFactor(otherAccessor.getSpeedFactor());
this.sounds(otherAccessor.getSoundType());
this.slipperiness(otherAccessor.getFriction());
this.velocityMultiplier(otherAccessor.getSpeedFactor());
thisAccessor.setDynamicShape(otherAccessor.getDynamicShape());
thisAccessor.setCanOcclude(otherAccessor.getCanOcclude());
thisAccessor.setIsAir(otherAccessor.getIsAir());
thisAccessor.setIgnitedByLava(otherAccessor.getIgnitedByLava());
thisAccessor.setLiquid(otherAccessor.getLiquid());
thisAccessor.setForceSolidOff(otherAccessor.getForceSolidOff());
thisAccessor.setForceSolidOn(otherAccessor.getForceSolidOn());
this.pushReaction(otherAccessor.getPushReaction());
this.pistonBehavior(otherAccessor.getPushReaction());
thisAccessor.setRequiresCorrectToolForDrops(otherAccessor.isRequiresCorrectToolForDrops());
thisAccessor.setOffsetFunction(otherAccessor.getOffsetFunction());
thisAccessor.setSpawnTerrainParticles(otherAccessor.getSpawnTerrainParticles());
thisAccessor.setRequiredFeatures(otherAccessor.getRequiredFeatures());
this.emissiveRendering(otherAccessor.getEmissiveRendering());
this.emissiveLighting(otherAccessor.getEmissiveRendering());
this.instrument(otherAccessor.getInstrument());
thisAccessor.setReplaceable(otherAccessor.getReplaceable());

Expand All @@ -82,13 +82,13 @@ protected FabricBlockSettings(BlockBehaviour.Properties settings) {
// deprecated. To maintain compatibility and since this behavior seems to be the
// more proper way, this copies all the fields, not just the shallow ones.
// Fields are added by field definition order.
this.jumpFactor(otherAccessor.getJumpFactor());
this.jumpVelocityMultiplier(otherAccessor.getJumpFactor());
this.drops(otherAccessor.getDrops());
this.isValidSpawn(otherAccessor.getIsValidSpawn());
this.isRedstoneConductor(otherAccessor.getIsRedstoneConductor());
this.isSuffocating(otherAccessor.getIsSuffocating());
this.isViewBlocking(otherAccessor.getIsViewBlocking());
this.hasPostProcess(otherAccessor.getHasPostProcess());
this.allowsSpawning(otherAccessor.getIsValidSpawn());
this.solidBlock(otherAccessor.getIsRedstoneConductor());
this.suffocates(otherAccessor.getIsSuffocating());
this.blockVision(otherAccessor.getIsViewBlocking());
this.postProcess(otherAccessor.getHasPostProcess());
}

/**
Expand Down Expand Up @@ -123,36 +123,31 @@ public FabricBlockSettings noCollission() {
}

@Deprecated
@Override
public FabricBlockSettings noOcclusion() {
public FabricBlockSettings nonOpaque() {
super.noOcclusion();
return this;
}

@Deprecated
@Override
public FabricBlockSettings friction(float value) {
public FabricBlockSettings slipperiness(float value) {
super.friction(value);
return this;
}

@Deprecated
@Override
public FabricBlockSettings speedFactor(float velocityMultiplier) {
public FabricBlockSettings velocityMultiplier(float velocityMultiplier) {
super.speedFactor(velocityMultiplier);
return this;
}

@Deprecated
@Override
public FabricBlockSettings jumpFactor(float jumpVelocityMultiplier) {
public FabricBlockSettings jumpVelocityMultiplier(float jumpVelocityMultiplier) {
super.jumpFactor(jumpVelocityMultiplier);
return this;
}

@Deprecated
@Override
public FabricBlockSettings sound(SoundType group) {
public FabricBlockSettings sounds(SoundType group) {
super.sound(group);
return this;
}
Expand All @@ -172,8 +167,7 @@ public FabricBlockSettings strength(float hardness, float resistance) {
}

@Deprecated
@Override
public FabricBlockSettings instabreak() {
public FabricBlockSettings breakInstantly() {
super.instabreak();
return this;
}
Expand All @@ -186,22 +180,19 @@ public FabricBlockSettings strength(float strength) {
}

@Deprecated
@Override
public FabricBlockSettings randomTicks() {
public FabricBlockSettings ticksRandomly() {
super.randomTicks();
return this;
}

@Deprecated
@Override
public FabricBlockSettings dynamicShape() {
public FabricBlockSettings dynamicBounds() {
super.dynamicShape();
return this;
}

@Deprecated
@Override
public FabricBlockSettings noLootTable() {
public FabricBlockSettings dropsNothing() {
super.noLootTable();
return this;
}
Expand All @@ -221,43 +212,37 @@ public FabricBlockSettings air() {
}

@Deprecated
@Override
public FabricBlockSettings isValidSpawn(BlockBehaviour.StateArgumentPredicate<EntityType<?>> predicate) {
public FabricBlockSettings allowsSpawning(BlockBehaviour.StateArgumentPredicate<EntityType<?>> predicate) {
super.isValidSpawn(predicate);
return this;
}

@Deprecated
@Override
public FabricBlockSettings isRedstoneConductor(BlockBehaviour.StatePredicate predicate) {
public FabricBlockSettings solidBlock(BlockBehaviour.StatePredicate predicate) {
super.isRedstoneConductor(predicate);
return this;
}

@Deprecated
@Override
public FabricBlockSettings isSuffocating(BlockBehaviour.StatePredicate predicate) {
public FabricBlockSettings suffocates(BlockBehaviour.StatePredicate predicate) {
super.isSuffocating(predicate);
return this;
}

@Deprecated
@Override
public FabricBlockSettings isViewBlocking(BlockBehaviour.StatePredicate predicate) {
public FabricBlockSettings blockVision(BlockBehaviour.StatePredicate predicate) {
super.isViewBlocking(predicate);
return this;
}

@Deprecated
@Override
public FabricBlockSettings hasPostProcess(BlockBehaviour.StatePredicate predicate) {
public FabricBlockSettings postProcess(BlockBehaviour.StatePredicate predicate) {
super.hasPostProcess(predicate);
return this;
}

@Deprecated
@Override
public FabricBlockSettings emissiveRendering(BlockBehaviour.StatePredicate predicate) {
public FabricBlockSettings emissiveLighting(BlockBehaviour.StatePredicate predicate) {
super.emissiveRendering(predicate);
return this;
}
Expand All @@ -266,8 +251,7 @@ public FabricBlockSettings emissiveRendering(BlockBehaviour.StatePredicate predi
* Make the block require tool to drop and slows down mining speed if the incorrect tool is used.
*/
@Deprecated
@Override
public FabricBlockSettings requiresCorrectToolForDrops() {
public FabricBlockSettings requiresTool() {
super.requiresCorrectToolForDrops();
return this;
}
Expand All @@ -280,36 +264,31 @@ public FabricBlockSettings mapColor(MapColor color) {
}

@Deprecated
@Override
public FabricBlockSettings destroyTime(float hardness) {
public FabricBlockSettings hardness(float hardness) {
super.destroyTime(hardness);
return this;
}

@Deprecated
@Override
public FabricBlockSettings explosionResistance(float resistance) {
public FabricBlockSettings resistance(float resistance) {
super.explosionResistance(resistance);
return this;
}

@Deprecated
@Override
public FabricBlockSettings offsetType(BlockBehaviour.OffsetType offsetType) {
public FabricBlockSettings offset(BlockBehaviour.OffsetType offsetType) {
super.offsetType(offsetType);
return this;
}

@Deprecated
@Override
public FabricBlockSettings noTerrainParticles() {
public FabricBlockSettings noBlockBreakParticles() {
super.noTerrainParticles();
return this;
}

@Deprecated
@Override
public FabricBlockSettings requiredFeatures(FeatureFlag... features) {
public FabricBlockSettings requires(FeatureFlag... features) {
super.requiredFeatures(features);
return this;
}
Expand All @@ -322,8 +301,7 @@ public FabricBlockSettings mapColor(Function<BlockState, MapColor> mapColorProvi
}

@Deprecated
@Override
public FabricBlockSettings ignitedByLava() {
public FabricBlockSettings burnable() {
super.ignitedByLava();
return this;
}
Expand All @@ -336,22 +314,19 @@ public FabricBlockSettings liquid() {
}

@Deprecated
@Override
public FabricBlockSettings forceSolidOn() {
public FabricBlockSettings solid() {
super.forceSolidOn();
return this;
}

@Deprecated
@Override
public FabricBlockSettings forceSolidOff() {
public FabricBlockSettings notSolid() {
super.forceSolidOff();
return this;
}

@Deprecated
@Override
public FabricBlockSettings pushReaction(PushReaction pistonBehavior) {
public FabricBlockSettings pistonBehavior(PushReaction pistonBehavior) {
super.pushReaction(pistonBehavior);
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion ffapi.gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
loom.platform=neoforge
fabric.loom.dontRemap=true

implementationVersion=2.0.1
implementationVersion=2.0.2

versionMc=1.21
versionForge=21.0.57-beta
Expand Down

0 comments on commit ab63bcd

Please sign in to comment.