mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Remove registerForAll
This commit is contained in:
@@ -56,30 +56,6 @@ public final class BlockFlammabilityRegistry {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the flammability for the given blocks for all fire blocks.
|
||||
*
|
||||
* @param burnOdds the burn odds
|
||||
* @param flameOdds the flame odds
|
||||
* @param flammableBlocks the flammable blocks
|
||||
*/
|
||||
@ExpectPlatform
|
||||
public static void registerAll(int burnOdds, int flameOdds, Block... flammableBlocks) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the flammability for a given block tag for all fire blocks.
|
||||
*
|
||||
* @param burnOdds the burn odds
|
||||
* @param flameOdds the flame odds
|
||||
* @param flammableBlocks the flammable block tag
|
||||
*/
|
||||
@ExpectPlatform
|
||||
public static void registerAll(int burnOdds, int flameOdds, TagKey<Block> flammableBlocks) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the flammability for the given blocks for a given fire block.
|
||||
*
|
||||
|
||||
@@ -53,18 +53,6 @@ public class BlockFlammabilityRegistryImpl {
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerAll(int burnOdds, int flameOdds, Block... flammableBlocks) {
|
||||
FlammableBlockRegistry registry = FlammableBlockRegistry.getDefaultInstance();
|
||||
for (Block block : flammableBlocks) {
|
||||
registry.add(block, burnOdds, flameOdds);
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerAll(int burnOdds, int flameOdds, TagKey<Block> flammableBlocks) {
|
||||
FlammableBlockRegistry registry = FlammableBlockRegistry.getDefaultInstance();
|
||||
registry.add(flammableBlocks, burnOdds, flameOdds);
|
||||
}
|
||||
|
||||
public static void register(Block fireBlock, int burnOdds, int flameOdds, Block... flammableBlocks) {
|
||||
FlammableBlockRegistry registry = FlammableBlockRegistry.getInstance(fireBlock);
|
||||
for (Block block : flammableBlocks) {
|
||||
|
||||
@@ -33,7 +33,6 @@ import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.util.Unit;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.FireBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
@@ -48,10 +47,6 @@ public class BlockFlammabilityRegistryImpl {
|
||||
|
||||
private static final Reference2ObjectMap<Block, Data> DATAS = new Reference2ObjectOpenHashMap<>();
|
||||
|
||||
private static Data getGlobalData() {
|
||||
return DATAS.computeIfAbsent(Blocks.AIR, $ -> new Data());
|
||||
}
|
||||
|
||||
private static Data getData(Block fireBlock) {
|
||||
if (fireBlock instanceof FireBlock) {
|
||||
return DATAS.computeIfAbsent(fireBlock, $ -> new Data());
|
||||
@@ -106,22 +101,6 @@ public class BlockFlammabilityRegistryImpl {
|
||||
});
|
||||
}
|
||||
|
||||
public static void registerAll(int burnOdds, int flameOdds, Block... flammableBlocks) {
|
||||
Data data = getGlobalData();
|
||||
|
||||
for (Block block : flammableBlocks) {
|
||||
data.burnOdds.put(block, burnOdds);
|
||||
data.flameOdds.put(block, burnOdds);
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerAll(int burnOdds, int flameOdds, TagKey<Block> flammableBlocks) {
|
||||
Data data = getGlobalData();
|
||||
|
||||
data.burnTagOdds.put(flammableBlocks, burnOdds);
|
||||
data.flameTagOdds.put(flammableBlocks, burnOdds);
|
||||
}
|
||||
|
||||
public static void register(Block fireBlock, int burnOdds, int flameOdds, Block... flammableBlocks) {
|
||||
Data data = getData(fireBlock);
|
||||
|
||||
@@ -146,16 +125,6 @@ public class BlockFlammabilityRegistryImpl {
|
||||
if (odds >= 0) {
|
||||
return odds;
|
||||
}
|
||||
} else {
|
||||
int odds = getData(Blocks.FIRE).getBurnOdds(state.getBlock());
|
||||
if (odds >= 0) {
|
||||
return odds;
|
||||
}
|
||||
}
|
||||
|
||||
int odds = getGlobalData().getBurnOdds(state.getBlock());
|
||||
if (odds >= 0) {
|
||||
return odds;
|
||||
}
|
||||
|
||||
return previousValue;
|
||||
@@ -169,16 +138,6 @@ public class BlockFlammabilityRegistryImpl {
|
||||
if (odds >= 0) {
|
||||
return odds;
|
||||
}
|
||||
} else {
|
||||
int odds = getData(Blocks.FIRE).getFlameOdds(state.getBlock());
|
||||
if (odds >= 0) {
|
||||
return odds;
|
||||
}
|
||||
}
|
||||
|
||||
int odds = getGlobalData().getFlameOdds(state.getBlock());
|
||||
if (odds >= 0) {
|
||||
return odds;
|
||||
}
|
||||
|
||||
return previousValue;
|
||||
|
||||
Reference in New Issue
Block a user