Skip to content

Commit

Permalink
Disc rename, drink fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulevsGitch committed Jun 17, 2021
1 parent c39d11e commit 52750fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=6
loader_version=0.11.3

# Mod Properties
mod_version = 0.1.34
mod_version = 0.1.35
maven_group = ru.bclib
archives_base_name = bclib

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import net.minecraft.world.item.RecordItem;
import ru.bclib.client.models.ItemModelProvider;

public class EndDiscItem extends RecordItem implements ItemModelProvider {
public EndDiscItem(int comparatorOutput, SoundEvent sound, Properties settings) {
public class BaseDiscItem extends RecordItem implements ItemModelProvider {
public BaseDiscItem(int comparatorOutput, SoundEvent sound, Properties settings) {
super(comparatorOutput, sound, settings);
}
}
10 changes: 8 additions & 2 deletions src/main/java/ru/bclib/items/BaseDrinkItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ public InteractionResultHolder<ItemStack> use(Level world, Player user, Interact
}

@Override
public ItemStack finishUsingItem(ItemStack stack, Level world, LivingEntity user) {
public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity user) {
if (this.isEdible()) {
int count = stack.getCount();
user.eat(level, stack);
stack.setCount(count);
}

if (user instanceof ServerPlayer) {
ServerPlayer serverPlayerEntity = (ServerPlayer) user;
CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayerEntity, stack);
Expand All @@ -45,7 +51,7 @@ public ItemStack finishUsingItem(ItemStack stack, Level world, LivingEntity user
stack.shrink(1);
}

if (!world.isClientSide) {
if (!level.isClientSide) {
user.removeAllEffects();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ru/bclib/registry/ItemsRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import net.minecraft.world.level.block.DispenserBlock;
import ru.bclib.items.BaseDrinkItem;
import ru.bclib.items.BaseSpawnEggItem;
import ru.bclib.items.EndDiscItem;
import ru.bclib.items.BaseDiscItem;
import ru.bclib.items.ModelProviderItem;
import ru.bclib.items.tool.BaseAxeItem;
import ru.bclib.items.tool.BaseHoeItem;
Expand All @@ -35,7 +35,7 @@ protected ItemsRegistry(CreativeModeTab creativeTab) {
}

public Item registerDisc(String name, int power, SoundEvent sound) {
return register(name, new EndDiscItem(power, sound, makeItemSettings().stacksTo(1)));
return register(name, new BaseDiscItem(power, sound, makeItemSettings().stacksTo(1)));
}

public Item registerItem(String name) {
Expand Down

0 comments on commit 52750fd

Please sign in to comment.