Skip to content

Commit

Permalink
delete the things
Browse files Browse the repository at this point in the history
- remove nonessential method
- delete unnecessary dependencies
- imag
  • Loading branch information
rhysdh540 committed Oct 23, 2023
1 parent 9e0d81b commit 8a34cde
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sudolev.interiors.foundation.mixin;

import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.AABB;

Expand All @@ -15,10 +16,13 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

@Mixin(value = SeatBlock.class, remap = false)
public abstract class SeatBlockMixin {

@Inject(method = "isSeatOccupied", at = @At("HEAD"), cancellable = true)
private static void sitDown(Level world, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
if(!world.getEntitiesOfClass(BigSeatEntity.class, new AABB(pos)).isEmpty())
Expand All @@ -27,10 +31,15 @@ private static void sitDown(Level world, BlockPos pos, CallbackInfoReturnable<Bo

@Redirect(method = "sitDown", at = @At(value = "NEW", target = "(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lcom/simibubi/create/content/contraptions/actors/seat/SeatEntity;"))
private static SeatEntity createSeatEntity(Level world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() instanceof BigChairBlock) {
return new BigSeatEntity(world, pos);
} else {
return new SeatEntity(world, pos);
return world.getBlockState(pos).getBlock() instanceof BigChairBlock
? new BigSeatEntity(world, pos)
: new SeatEntity(world, pos);
}

@Inject(method = "sitDown", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;addFreshEntity(Lnet/minecraft/world/entity/Entity;)Z"), locals = LocalCapture.CAPTURE_FAILHARD)
private static void getY(Level world, BlockPos pos, Entity entity, CallbackInfo ci, SeatEntity seat) {
if(seat instanceof BigSeatEntity) {
seat.setPos(seat.getX(), seat.getY() + .34f, seat.getZ());
}
}
}
22 changes: 2 additions & 20 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
modLoader = "javafml"
loaderVersion = "[${neo_version},)"
license = "MIT"
license = "GPL-3.0"
issueTrackerURL = "https://github.com/sudolev/CreateInteriorsMod/issues"

[[mods]]
Expand Down Expand Up @@ -38,26 +38,8 @@ mandatory = true
versionRange = "[${create_version},)"
ordering = "NONE"
side = "BOTH"
[[dependencies.interiors]]
modId="jei"
mandatory=false
versionRange="[0.0.0,)"
ordering="NONE"
side="CLIENT"
[[dependencies.interiors]]
modId="configured"
mandatory=false
versionRange="[0.0.0,)"
ordering="NONE"
side="CLIENT"
[[dependencies.interiors]]
modId="catalogue"
mandatory=false
versionRange="[0.0.0,)"
ordering="NONE"
side="CLIENT"

[modproperties.interiors]
catalogueImageIcon="icon.png"
catalogueBackground="background.png"
catalogueBackground="mod_banner.png"
configuredBackground="create:textures/block/seat/top_red.png"
Binary file removed src/main/resources/background.png
Binary file not shown.
Binary file modified src/main/resources/mod_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/main/wordmark.png
Binary file not shown.

0 comments on commit 8a34cde

Please sign in to comment.