Skip to content

Commit

Permalink
🚚 class renames
Browse files Browse the repository at this point in the history
  • Loading branch information
LocusAzzurro committed Jul 15, 2023
1 parent fac46ce commit 597ce20
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public IcarusWings() {
ItemRegistry.ITEMS.register(bus);
EntityTypeRegistry.ENTITIES.register(bus);
ParticleRegistry.PARTICLES.register(bus);
TileEntityTypeRegistry.TILE_ENTITIES.register(bus);
BlockEntityTypeRegistry.BLOCK_ENTITIES.register(bus);
EnchantmentRegistry.ENCHANTMENTS.register(bus);
EffectRegistry.EFFECTS.register(bus);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.mineplugin.locusazzurro.icaruswings.blocks.blockentities.AmphoraTileEntity;
import org.mineplugin.locusazzurro.icaruswings.blocks.blockentities.AmphoraBlockEntity;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -89,8 +89,8 @@ public void setPlacedBy(Level worldIn, BlockPos posIn, BlockState stateIn, Livin
worldIn.setBlock(posIn.above(), stateIn.setValue(HALF, DoubleBlockHalf.UPPER), 3);
if (stackIn.hasCustomHoverName()) {
BlockEntity tileentity = worldIn.getBlockEntity(posIn);
if (tileentity instanceof AmphoraTileEntity) {
((AmphoraTileEntity) tileentity).setCustomName(stackIn.getHoverName());
if (tileentity instanceof AmphoraBlockEntity) {
((AmphoraBlockEntity) tileentity).setCustomName(stackIn.getHoverName());
}
}
}
Expand Down Expand Up @@ -140,7 +140,7 @@ public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos)
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState state) {
if (state.getValue(HALF) == DoubleBlockHalf.LOWER) {
return new AmphoraTileEntity(pPos, state);
return new AmphoraBlockEntity(pPos, state);
}

return null;
Expand All @@ -156,8 +156,8 @@ public InteractionResult use(BlockState stateIn, Level worldIn, BlockPos posIn,
if (stateIn.getValue(HALF) == DoubleBlockHalf.UPPER) {
tileentity = worldIn.getBlockEntity(posIn.below()); }
else { tileentity = worldIn.getBlockEntity(posIn); }
if (tileentity instanceof AmphoraTileEntity) {
playerIn.openMenu((AmphoraTileEntity) tileentity);
if (tileentity instanceof AmphoraBlockEntity) {
playerIn.openMenu((AmphoraBlockEntity) tileentity);
}
return InteractionResult.CONSUME;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
import net.minecraftforge.items.ItemHandlerHelper;
import org.jetbrains.annotations.Nullable;
import org.mineplugin.locusazzurro.icaruswings.blocks.blockentities.ITickableBlockEntity;
import org.mineplugin.locusazzurro.icaruswings.blocks.blockentities.MeadPotTileEntity;
import org.mineplugin.locusazzurro.icaruswings.blocks.blockentities.MeadPotBlockEntity;
import org.mineplugin.locusazzurro.icaruswings.items.Mead;
import org.mineplugin.locusazzurro.icaruswings.items.WorldEssence;
import org.mineplugin.locusazzurro.icaruswings.registry.ItemRegistry;
import org.mineplugin.locusazzurro.icaruswings.registry.SoundRegistry;
import org.mineplugin.locusazzurro.icaruswings.registry.TileEntityTypeRegistry;
import org.mineplugin.locusazzurro.icaruswings.registry.BlockEntityTypeRegistry;
import org.mineplugin.locusazzurro.icaruswings.utils.IWLazy;

import javax.annotation.ParametersAreNonnullByDefault;
Expand Down Expand Up @@ -84,13 +84,13 @@ public MeadPot() {
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker getTicker(Level pLevel, BlockState pState, BlockEntityType<T> pBlockEntityType) {
return ITickableBlockEntity.getTicker(pLevel, TileEntityTypeRegistry.meadPotTileEntity.get(), pBlockEntityType);
return ITickableBlockEntity.getTicker(pLevel, BlockEntityTypeRegistry.MEAD_POT_BLOCK_ENTITY.get(), pBlockEntityType);
}

@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) {
return new MeadPotTileEntity(pPos, pState);
return new MeadPotBlockEntity(pPos, pState);
}

@Override
Expand All @@ -115,9 +115,9 @@ public boolean hasAnalogOutputSignal(BlockState pState) {

@Override
public int getAnalogOutputSignal(BlockState stateIn, Level worldIn, BlockPos pos) {
if (worldIn.getBlockEntity(pos) != null && worldIn.getBlockEntity(pos) instanceof MeadPotTileEntity meadPotTE){
if (worldIn.getBlockEntity(pos) != null && worldIn.getBlockEntity(pos) instanceof MeadPotBlockEntity meadPotTE){
float progress = meadPotTE.getFermentationProgress();
float fermentationTime = MeadPotTileEntity.getFermentationTime();
float fermentationTime = MeadPotBlockEntity.getFermentationTime();
return (int) ((progress / fermentationTime) * 15);
}
return 0;
Expand All @@ -129,7 +129,7 @@ public boolean isPathfindable(BlockState pState, BlockGetter pLevel, BlockPos pP
}
@Override
public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {
if (!worldIn.isClientSide && handIn == InteractionHand.MAIN_HAND && worldIn.getBlockEntity(pos) instanceof MeadPotTileEntity meadPotTE) {
if (!worldIn.isClientSide && handIn == InteractionHand.MAIN_HAND && worldIn.getBlockEntity(pos) instanceof MeadPotBlockEntity meadPotTE) {
ItemStack stackIn = player.getItemInHand(handIn);
if (stackIn.getItem() == Items.HONEY_BOTTLE && stackIn.getCount() >= 4
&& !meadPotTE.isFermenting() && !meadPotTE.isComplete()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import org.mineplugin.locusazzurro.icaruswings.registry.TileEntityTypeRegistry;
import org.mineplugin.locusazzurro.icaruswings.registry.BlockEntityTypeRegistry;

public class AmphoraTileEntity extends RandomizableContainerBlockEntity {
public class AmphoraBlockEntity extends RandomizableContainerBlockEntity {

private NonNullList<ItemStack> items = NonNullList.withSize(45, ItemStack.EMPTY);


public AmphoraTileEntity(BlockPos a, BlockState b) {
super(TileEntityTypeRegistry.amphoraTileEntity.get(), a, b);
public AmphoraBlockEntity(BlockPos a, BlockState b) {
super(BlockEntityTypeRegistry.AMPHORA_BLOCK_ENTITY.get(), a, b);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import org.mineplugin.locusazzurro.icaruswings.blocks.MeadPot;
import org.mineplugin.locusazzurro.icaruswings.registry.TileEntityTypeRegistry;
import org.mineplugin.locusazzurro.icaruswings.registry.BlockEntityTypeRegistry;

public class MeadPotTileEntity extends BlockEntity implements ITickableBlockEntity<MeadPotTileEntity> {
public class MeadPotBlockEntity extends BlockEntity implements ITickableBlockEntity<MeadPotBlockEntity> {

private static final int FERMENTATION_TIME = 3600 * 20; //1h / 3 in-game days
private int fermentationProgress = 0;
private boolean isFermenting = false;
private boolean isComplete = false;

public MeadPotTileEntity(BlockPos pos, BlockState state) {
super(TileEntityTypeRegistry.meadPotTileEntity.get(), pos, state);
public MeadPotBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityTypeRegistry.MEAD_POT_BLOCK_ENTITY.get(), pos, state);
}

public void startFermenting() {
Expand Down Expand Up @@ -63,7 +63,7 @@ public static int getFermentationTime() {
}

@Override
public MeadPotTileEntity getBlockEntity() {
public MeadPotBlockEntity getBlockEntity() {
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ public static void gatherData(GatherDataEvent event) {
ExistingFileHelper fh = event.getExistingFileHelper();
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();

generator.addProvider(event.includeServer(), new RecipesGenerator(output));
generator.addProvider(event.includeServer(), new ModRecipesProvider(output));
//generator.addProvider(event.includeServer(), LootTableProvider.create(output));

BlockTagsGenerator blockTags = new BlockTagsGenerator(output, lookupProvider, fh);
ModBlockTagsGenerator blockTags = new ModBlockTagsGenerator(output, lookupProvider, fh);
generator.addProvider(event.includeServer(), blockTags);
generator.addProvider(event.includeServer(), new ItemTagsGenerator(output, lookupProvider, blockTags, fh));
generator.addProvider(event.includeServer(), new ModItemTagsProvider(output, lookupProvider, blockTags, fh));
generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider(output, event.getLookupProvider(), BUILDER, Set.of(ModData.MOD_ID)));
//generator.addProvider(event.includeServer(), new DamageTagsGenerator(output, lookupProvider, fh));

generator.addProvider(event.includeClient(), new BlockStatesGenerator(output, fh));
generator.addProvider(event.includeClient(), new ItemModelsGenerator(output, fh));
generator.addProvider(event.includeClient(), new ModBlockStateProvider(output, fh));
generator.addProvider(event.includeClient(), new ModItemModelGenerator(output, fh));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public class LootTableProvider {

public static net.minecraft.data.loot.LootTableProvider create(PackOutput output){
return new net.minecraft.data.loot.LootTableProvider(output, Set.of(),
List.of(new net.minecraft.data.loot.LootTableProvider.SubProviderEntry(BlockLootTableProvider::new, LootContextParamSets.BLOCK)));
List.of(new net.minecraft.data.loot.LootTableProvider.SubProviderEntry(ModBlockLootTableProvider::new, LootContextParamSets.BLOCK)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import java.util.Set;

public class BlockLootTableProvider extends BlockLootSubProvider {
public class ModBlockLootTableProvider extends BlockLootSubProvider {

public BlockLootTableProvider() {
public ModBlockLootTableProvider() {
super(Set.of(), FeatureFlags.REGISTRY.allFlags());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.mineplugin.locusazzurro.icaruswings.datagen;

import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.minecraftforge.client.model.generators.BlockStateProvider;
import net.minecraftforge.common.data.ExistingFileHelper;

/**
* @author DustW
* @author LocusAzzurro
**/
public class BlockStatesGenerator extends BlockStateProvider {
public class ModBlockStateProvider extends BlockStateProvider {

public BlockStatesGenerator(PackOutput output, ExistingFileHelper existingFileHelper) {
public ModBlockStateProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
super(output, DataGenerators.MOD_ID, existingFileHelper);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

/**
* @author DustW
* @author LocusAzzurro
**/
public class BlockTagsGenerator extends BlockTagsProvider {
public class ModBlockTagsGenerator extends BlockTagsProvider {

public BlockTagsGenerator(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper helper) {
public ModBlockTagsGenerator(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper helper) {
super(output, lookupProvider, DataGenerators.MOD_ID, helper);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package org.mineplugin.locusazzurro.icaruswings.datagen;

import net.minecraft.core.HolderLookup;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.TagsProvider;
import net.minecraft.resources.ResourceKey;
import net.minecraft.tags.DamageTypeTags;
import net.minecraft.world.damagesource.DamageType;
import net.minecraftforge.common.data.ExistingFileHelper;
Expand All @@ -14,9 +12,9 @@
import javax.annotation.Nullable;
import java.util.concurrent.CompletableFuture;

public class DamageTagsGenerator extends TagsProvider<DamageType> {
public class ModDamageTagsGenerator extends TagsProvider<DamageType> {

public DamageTagsGenerator(PackOutput output, CompletableFuture<HolderLookup.Provider> provider, @Nullable ExistingFileHelper fh) {
public ModDamageTagsGenerator(PackOutput output, CompletableFuture<HolderLookup.Provider> provider, @Nullable ExistingFileHelper fh) {
super(output, Registries.DAMAGE_TYPE, provider, CompletableFuture.completedFuture(TagsProvider.TagLookup.empty()), DataGenerators.MOD_ID, fh);
}
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.mineplugin.locusazzurro.icaruswings.datagen;

import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.minecraftforge.client.model.generators.ItemModelProvider;
import net.minecraftforge.common.data.ExistingFileHelper;

/**
* @author DustW
* @author LocusAzzurro
**/
public class ItemModelsGenerator extends ItemModelProvider {
public class ModItemModelGenerator extends ItemModelProvider {

public ItemModelsGenerator(PackOutput output, ExistingFileHelper existingFileHelper) {
public ModItemModelGenerator(PackOutput output, ExistingFileHelper existingFileHelper) {
super(output, DataGenerators.MOD_ID, existingFileHelper);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
/**
* @author DustW
**/
public class ItemTagsGenerator extends ItemTagsProvider {
public class ModItemTagsProvider extends ItemTagsProvider {

public ItemTagsGenerator(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, TagsProvider<Block> blockTagProvider, ExistingFileHelper existingFileHelper) {
public ModItemTagsProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, TagsProvider<Block> blockTagProvider, ExistingFileHelper existingFileHelper) {
super(output, lookupProvider, blockTagProvider.contentsGetter(), DataGenerators.MOD_ID, existingFileHelper);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.mineplugin.locusazzurro.icaruswings.datagen;

import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeProvider;
Expand All @@ -10,10 +9,11 @@

/**
* @author DustW
* @author LocusAzzurro
**/
public class RecipesGenerator extends RecipeProvider implements IConditionBuilder {
public class ModRecipesProvider extends RecipeProvider implements IConditionBuilder {

public RecipesGenerator(PackOutput output) {
public ModRecipesProvider(PackOutput output) {
super(output);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
@Mixin(CapeLayer.class)
public class CapeLayerMixin {

@Inject(at = @At(value = "HEAD"), method = "render", cancellable = true)
public void render(PoseStack p_225628_1_, MultiBufferSource p_225628_2_, int p_225628_3_,
AbstractClientPlayer p_225628_4_, float p_225628_5_, float p_225628_6_, float p_225628_7_,
@Inject(at = @At(value = "HEAD"), method = "render*", cancellable = true)
public void render(PoseStack pose, MultiBufferSource p_225628_2_, int p_225628_3_,
AbstractClientPlayer clientPlayer, float p_225628_5_, float p_225628_6_, float p_225628_7_,
float p_225628_8_, float p_225628_9_, float p_225628_10_, CallbackInfo cb) {

ItemStack itemstack = p_225628_4_.getItemBySlot(EquipmentSlot.CHEST);
ItemStack itemstack = clientPlayer.getItemBySlot(EquipmentSlot.CHEST);
if (itemstack.getItem() instanceof AbstractWings) {
cb.cancel();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.mineplugin.locusazzurro.icaruswings.registry;

import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.mineplugin.locusazzurro.icaruswings.blocks.blockentities.AmphoraBlockEntity;
import org.mineplugin.locusazzurro.icaruswings.blocks.blockentities.MeadPotBlockEntity;
import org.mineplugin.locusazzurro.icaruswings.data.ModData;

public class BlockEntityTypeRegistry {

public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, ModData.MOD_ID);

public static final RegistryObject<BlockEntityType<MeadPotBlockEntity>>
MEAD_POT_BLOCK_ENTITY = BLOCK_ENTITIES.register(
"mead_pot_block_entity", () -> BlockEntityType.Builder
.of(MeadPotBlockEntity::new, BlockRegistry.meadPot.get()).build(null));

public static final RegistryObject<BlockEntityType<AmphoraBlockEntity>>
AMPHORA_BLOCK_ENTITY = BLOCK_ENTITIES.register(
"amphora_block_entity", () -> BlockEntityType.Builder
.of(AmphoraBlockEntity::new, BlockRegistry.amphora.get()).build(null));
}

This file was deleted.

0 comments on commit 597ce20

Please sign in to comment.