-
Notifications
You must be signed in to change notification settings - Fork 23
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
1 parent
99e5f59
commit 8bac624
Showing
7 changed files
with
141 additions
and
52 deletions.
There are no files selected for viewing
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
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,25 @@ | ||
package guichaguri.betterfps.api; | ||
|
||
import javax.annotation.Nullable; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.IBlockAccess; | ||
import net.minecraft.world.World; | ||
|
||
/** | ||
* @author Guilherme Chaguri | ||
*/ | ||
public interface IBlock { | ||
|
||
/** | ||
* Method added by Forge. Reimplemented for compatibility with it. | ||
*/ | ||
boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon); | ||
|
||
/** | ||
* Method added by Forge. Reimplemented for compatibility with it. | ||
*/ | ||
@Nullable | ||
float[] getBeaconColorMultiplier(IBlockState state, World world, BlockPos pos, BlockPos beaconPos); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/guichaguri/betterfps/patches/block/BlockPatch.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,35 @@ | ||
package guichaguri.betterfps.patches.block; | ||
|
||
import guichaguri.betterfps.api.IBlock; | ||
import guichaguri.betterfps.transformers.annotations.Copy; | ||
import guichaguri.betterfps.transformers.annotations.Copy.Mode; | ||
import javax.annotation.Nullable; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.IBlockAccess; | ||
import net.minecraft.world.World; | ||
|
||
/** | ||
* @author Guilherme Chaguri | ||
*/ | ||
public abstract class BlockPatch extends Block implements IBlock { | ||
public BlockPatch(Material m) { | ||
super(m); | ||
} | ||
|
||
@Copy(Mode.COPY) | ||
@Override | ||
public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon) { | ||
return this == Blocks.EMERALD_BLOCK || this == Blocks.GOLD_BLOCK || this == Blocks.DIAMOND_BLOCK || this == Blocks.IRON_BLOCK; | ||
} | ||
|
||
@Copy(Mode.COPY) | ||
@Nullable | ||
@Override | ||
public float[] getBeaconColorMultiplier(IBlockState state, World world, BlockPos pos, BlockPos beaconPos) { | ||
return null; | ||
} | ||
} |
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
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