mirror of
https://github.com/FabricMC/fabric.git
synced 2025-07-28 15:09:35 -04:00
1.14.3-pre1
This commit is contained in:
parent
792c1c35b3
commit
bdffbb2cdb
6 changed files with 10 additions and 10 deletions
build.gradle
fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/api/client/itemgroup
fabric-mining-levels-v0/src/main/java/net/fabricmc/fabric
fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/trackers/vanilla
|
@ -12,7 +12,7 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
def baseVersion = "0.3.0"
|
||||
def mcVersion = "1.14.2"
|
||||
def mcVersion = "1.14.3-pre1"
|
||||
def yarnVersion = "+build.1"
|
||||
|
||||
def getSubprojectVersion(project, version) {
|
||||
|
@ -182,7 +182,7 @@ curseforge {
|
|||
project {
|
||||
id = '306612'
|
||||
changelog = 'A changelog can be found at https://github.com/FabricMC/fabric/commits/master'
|
||||
releaseType = 'beta'
|
||||
releaseType = 'alpha'
|
||||
addGameVersion '1.14-Snapshot'
|
||||
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) {
|
||||
displayName = "[$mcVersion] Fabric API $baseVersion build $ENV.BUILD_NUMBER"
|
||||
|
|
|
@ -105,12 +105,12 @@ public final class FabricItemGroupBuilder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void appendItems(DefaultedList<ItemStack> stacks) {
|
||||
public void appendStacks(DefaultedList<ItemStack> stacks) {
|
||||
if (stacksForDisplay != null) {
|
||||
stacksForDisplay.accept(stacks);
|
||||
return;
|
||||
}
|
||||
super.appendItems(stacks);
|
||||
super.appendStacks(stacks);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public final class ToolManager {
|
|||
|
||||
private static int getMiningLevel(ItemStack stack) {
|
||||
if (stack.getItem() instanceof ToolItem) {
|
||||
return ((ToolItem) stack.getItem()).getType().getMiningLevel();
|
||||
return ((ToolItem) stack.getItem()).getMaterial().getMiningLevel();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public final class ToolManager {
|
|||
if (entry != null) {
|
||||
Item item = stack.getItem();
|
||||
for (int i = 0; i < entry.tags.length; i++) {
|
||||
if (item.matches(entry.tags[i])) {
|
||||
if (item.isIn(entry.tags[i])) {
|
||||
return TriState.of(getMiningLevel(stack) >= entry.tagLevels[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,5 +23,5 @@ import org.spongepowered.asm.mixin.gen.Accessor;
|
|||
@Mixin(MiningToolItem.class)
|
||||
public interface MiningToolItemAccessor {
|
||||
@Accessor
|
||||
float getBlockBreakingSpeed();
|
||||
float getMiningSpeed();
|
||||
}
|
||||
|
|
|
@ -41,12 +41,12 @@ public abstract class MixinItemStack {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "getBlockBreakingSpeed", cancellable = true)
|
||||
@Inject(at = @At("HEAD"), method = "getMiningSpeed", cancellable = true)
|
||||
public void getBlockBreakingSpeed(BlockState state, CallbackInfoReturnable<Float> info) {
|
||||
if (this.getItem() instanceof MiningToolItemAccessor) {
|
||||
TriState triState = ToolManager.handleIsEffectiveOn((ItemStack) (Object) this, state);
|
||||
if (triState != TriState.DEFAULT) {
|
||||
info.setReturnValue(triState.get() ? ((MiningToolItemAccessor) this.getItem()).getBlockBreakingSpeed() : 1.0F);
|
||||
info.setReturnValue(triState.get() ? ((MiningToolItemAccessor) this.getItem()).getMiningSpeed() : 1.0F);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public final class BlockItemTracker implements RegistryEntryAddedCallback<Item>
|
|||
@Override
|
||||
public void onEntryAdded(int rawId, Identifier id, Item object) {
|
||||
if (object instanceof BlockItem) {
|
||||
((BlockItem) object).registerBlockItemMap(Item.BLOCK_ITEM_MAP, object);
|
||||
((BlockItem) object).appendBlocks(Item.BLOCK_ITEMS, object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue