Skip to content

Commit

Permalink
Kill OnlyIn (mostly), some dedi server fixes but it's still broke sadly
Browse files Browse the repository at this point in the history
  • Loading branch information
quat1024 committed Nov 10, 2023
1 parent b9f71cc commit 0ed76a0
Show file tree
Hide file tree
Showing 64 changed files with 371 additions and 532 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.material.PushReaction;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

public class MagnetBlock extends QuarkBlock implements EntityBlock {

Expand All @@ -50,7 +48,6 @@ public MagnetBlock(ZetaModule module) {
}

@Override
@OnlyIn(Dist.CLIENT)
public void appendHoverText(@Nonnull ItemStack stack, @Nullable BlockGetter worldIn, @Nonnull List<Component> tooltip, @Nonnull TooltipFlag flagIn) {
if (stack.getHoverName().getString().equals("Q"))
tooltip.add(Component.literal("haha yes"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.network.NetworkHooks;

public class MatrixEnchantingTableBlock extends EnchantmentTableBlock implements IQuarkBlock {
Expand Down Expand Up @@ -110,7 +108,6 @@ public InteractionResult use(@Nonnull BlockState state, Level worldIn, @Nonnull
}

@Override
@OnlyIn(Dist.CLIENT)
public void animateTick(@Nonnull BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) {
boolean enabled = Quark.ZETA.modules.isEnabled(MatrixEnchantingModule.class);
boolean showInfluences = enabled && MatrixEnchantingModule.allowInfluencing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import javax.annotation.Nonnull;

Expand Down Expand Up @@ -64,17 +62,14 @@ public float getProgress(float ticks) {
return Mth.lerp(ticks, this.lastProgress, this.progress);
}

@OnlyIn(Dist.CLIENT)
public float getOffsetX(float ticks) {
return this.magnetFacing.getStepX() * this.getExtendedProgress(this.getProgress(ticks));
}

@OnlyIn(Dist.CLIENT)
public float getOffsetY(float ticks) {
return this.magnetFacing.getStepY() * this.getExtendedProgress(this.getProgress(ticks));
}

@OnlyIn(Dist.CLIENT)
public float getOffsetZ(float ticks) {
return this.magnetFacing.getStepZ() * this.getExtendedProgress(this.getProgress(ticks));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

public class EncasedPipeBlock extends BasePipeBlock {

Expand All @@ -30,7 +28,6 @@ public boolean allowsFullConnection(ConnectionType conn) {
}

@Override
@OnlyIn(Dist.CLIENT)
public boolean skipRendering(@Nonnull BlockState state, BlockState adjacentBlockState, @Nonnull Direction side) {
return adjacentBlockState.is(this) || adjacentBlockState.is(Blocks.GLASS) || super.skipRendering(state, adjacentBlockState, side);
}
Expand All @@ -42,7 +39,6 @@ public VoxelShape getVisualShape(@Nonnull BlockState state, @Nonnull BlockGetter
}

@Override
@OnlyIn(Dist.CLIENT)
public float getShadeBrightness(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos) {
return 1.0F;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import net.minecraft.client.model.geom.builders.CubeListBuilder;
import net.minecraft.client.model.geom.builders.LayerDefinition;
import net.minecraft.client.model.geom.builders.PartDefinition;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class BackpackModel {

public static LayerDefinition createBodyLayer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public record TinyPotatoModel(BakedModel originalModel) implements BakedModel {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@
import net.minecraft.world.level.block.piston.PistonHeadBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.ForgeHooksClient;

@OnlyIn(Dist.CLIENT)
public class MagnetizedBlockRenderer implements BlockEntityRenderer<MagnetizedBlockBlockEntity> {

private BlockRenderDispatcher blockRenderer = Minecraft.getInstance().getBlockRenderer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import javax.annotation.Nonnull;

Expand All @@ -42,7 +40,6 @@
import java.util.Map;
import java.util.regex.Pattern;

@OnlyIn(Dist.CLIENT)
public class TinyPotatoRenderer implements BlockEntityRenderer<TinyPotatoBlockEntity> {
public static final String DEFAULT = "default";
public static final String HALLOWEEN = "halloween";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

/**
* @author WireSegal
* Created at 2:01 PM on 3/30/20.
*/
@OnlyIn(Dist.CLIENT)
public class TotemOfHoldingRenderer extends EntityRenderer<TotemOfHoldingEntity> {

private static final ModelResourceLocation LOCATION_MODEL = new ModelResourceLocation(Quark.MOD_ID, "extra/totem_of_holding", "inventory");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.Level;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.LazyOptional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;

@Cancelable
@OnlyIn(Dist.CLIENT)
public class UsageTickerEvent extends Event {

public final EquipmentSlot slot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

/**
* @author WireSegal
Expand All @@ -36,7 +34,6 @@ public QuarkGlassBlock(String regname, ZetaModule module, CreativeModeTab creati
}

@Override
@OnlyIn(Dist.CLIENT)
public boolean skipRendering(@Nonnull BlockState state, BlockState adjacentBlockState, @Nonnull Direction side) {
return adjacentBlockState.is(this) || super.skipRendering(state, adjacentBlockState, side);
}
Expand All @@ -48,7 +45,6 @@ public VoxelShape getVisualShape(@Nonnull BlockState state, @Nonnull BlockGetter
}

@Override
@OnlyIn(Dist.CLIENT)
public float getShadeBrightness(@Nonnull BlockState state, @Nonnull BlockGetter worldIn, @Nonnull BlockPos pos) {
return 1.0F;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import javax.annotation.Nonnull;

@OnlyIn(Dist.CLIENT)
public class QuarkArmorModel extends HumanoidModel<LivingEntity> {

protected final EquipmentSlot slot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.violetmoon.quark.base.network.QuarkNetwork;
import org.violetmoon.quark.base.network.message.structural.S2CUpdateFlag;
import org.violetmoon.zeta.event.bus.LoadEvent;
import org.violetmoon.zeta.event.bus.PlayEvent;
import org.violetmoon.zeta.event.load.ZConfigChanged;

public class SyncedFlagHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.item.*;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import javax.annotation.Nonnull;

Expand All @@ -27,8 +25,8 @@
public class QuarkMusicDiscItem extends RecordItem implements IZetaItem {

private final ZetaModule module;
private final boolean isAmbient;
private final Supplier<SoundEvent> soundSupplier;
public final boolean isAmbient;
public final Supplier<SoundEvent> soundSupplier;

private BooleanSupplier enabledSupplier = () -> true;

Expand Down Expand Up @@ -63,25 +61,4 @@ public boolean doesConditionApply() {
return enabledSupplier.getAsBoolean();
}

@OnlyIn(Dist.CLIENT)
public boolean playAmbientSound(BlockPos pos) {
if(isAmbient) {
Minecraft mc = Minecraft.getInstance();
SoundManager soundEngine = mc.getSoundManager();
LevelRenderer render = mc.levelRenderer;

SimpleSoundInstance simplesound = new SimpleSoundInstance(soundSupplier.get().getLocation(), SoundSource.RECORDS, (float) AmbientDiscsModule.volume, 1.0F, SoundInstance.createUnseededRandom(), true, 0, SoundInstance.Attenuation.LINEAR, pos.getX(), pos.getY(), pos.getZ(), false);

render.playingRecords.put(pos, simplesound);
soundEngine.play(simplesound);

if(mc.level != null)
mc.level.addParticle(ParticleTypes.NOTE,pos.getX() + Math.random(), pos.getY() + 1.1, pos.getZ() + Math.random(), Math.random(), 0, 0);

return true;
}

return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.ConfigScreenHandler.ConfigScreenFactory;
import net.minecraftforge.fml.ModLoadingContext;

Expand All @@ -37,9 +35,7 @@
import org.violetmoon.quark.base.network.message.structural.C2SUpdateFlag;
import org.violetmoon.quark.mixin.client.accessor.AccessorMultiPlayerGameMode;
import org.violetmoon.zeta.client.TopLayerTooltipHandler;
import org.violetmoon.zeta.registry.RenderLayerRegistry;

@OnlyIn(Dist.CLIENT)
public class ClientProxy extends CommonProxy {

public static boolean jingleBellsMotherfucker = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void start() {

@LoadEvent
public void setup(ZCommonSetup event) {
handleQuarkConfigChange();
event.enqueueWork(this::handleQuarkConfigChange);
}

//TODO find a better place for this little one-off thing, lol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.TickPriority;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.ForgeEventFactory;

/**
Expand Down Expand Up @@ -189,7 +187,6 @@ public static void notifyNeighbors(Block block, Level world, BlockPos pos, Block
world.updateNeighborsAtExceptFromFacing(neighborPos, block, face);
}

@OnlyIn(Dist.CLIENT)
@Override
public void animateTick(BlockState stateIn, @Nonnull Level worldIn, @Nonnull BlockPos pos, @Nonnull RandomSource rand) {
if (stateIn.getValue(POWERED) != RandomizerPowerState.OFF) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,10 @@
import net.minecraft.world.item.MapItem;
import net.minecraft.world.item.ShieldItem;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.StandingSignBlock;
import net.minecraft.world.level.block.entity.BannerBlockEntity;
import net.minecraft.world.level.block.entity.BannerPattern;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RenderItemInFrameEvent;
import net.minecraftforge.common.MinecraftForge;

Expand All @@ -57,7 +53,6 @@
* Created at 11:58 AM on 8/25/19.
*/

@OnlyIn(Dist.CLIENT)
public class GlassItemFrameRenderer extends EntityRenderer<GlassItemFrame> {

private static final ModelResourceLocation LOCATION_MODEL = new ModelResourceLocation(new ResourceLocation(Quark.MOD_ID, "extra/glass_item_frame"), "inventory");
Expand Down
Loading

0 comments on commit 0ed76a0

Please sign in to comment.