-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...-opts-dfc/src/main/java/com/ishland/c2me/opts/dfc/common/ducks/IBlendingAwareVisitor.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,7 @@ | ||
package com.ishland.c2me.opts.dfc.common.ducks; | ||
|
||
public interface IBlendingAwareVisitor { | ||
|
||
boolean c2me$isBlendingEnabled(); | ||
|
||
} |
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
...fc/src/main/java/com/ishland/c2me/opts/dfc/common/gen/DelegatingBlendingAwareVisitor.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 com.ishland.c2me.opts.dfc.common.gen; | ||
|
||
import com.ishland.c2me.opts.dfc.common.ducks.IBlendingAwareVisitor; | ||
import net.minecraft.world.gen.densityfunction.DensityFunction; | ||
|
||
import java.util.Objects; | ||
|
||
public class DelegatingBlendingAwareVisitor implements IBlendingAwareVisitor, DensityFunction.DensityFunctionVisitor { | ||
|
||
private final DensityFunction.DensityFunctionVisitor delegate; | ||
private final boolean blendingEnabled; | ||
|
||
public DelegatingBlendingAwareVisitor(DensityFunction.DensityFunctionVisitor delegate, boolean blendingEnabled) { | ||
this.delegate = Objects.requireNonNull(delegate); | ||
this.blendingEnabled = blendingEnabled; | ||
} | ||
|
||
@Override | ||
public DensityFunction apply(DensityFunction densityFunction) { | ||
return this.delegate.apply(densityFunction); | ||
} | ||
|
||
@Override | ||
public DensityFunction.Noise apply(DensityFunction.Noise noiseDensityFunction) { | ||
return this.delegate.apply(noiseDensityFunction); | ||
} | ||
|
||
@Override | ||
public boolean c2me$isBlendingEnabled() { | ||
return this.blendingEnabled; | ||
} | ||
} |
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